@easyeyes_threshold/runtime 1.20260915.79596 → 1.20260915.82119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/threshold.min.js +3 -3
- package/package.json +5 -5
package/js/threshold.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let getAugmentedNamespace;let __tla=(async()=>{!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f61ba57e-7ce7-4d8f-8d29-91123f3e5470",e._sentryDebugIdIdentifier="sentry-dbid-f61ba57e-7ce7-4d8f-8d29-91123f3e5470")}catch(e){}}();const DEBUG_BUILD$1="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,GLOBAL_OBJ$1=globalThis,SDK_VERSION$2="10.38.0";function getMainCarrier$1(){return getSentryCarrier$1(GLOBAL_OBJ$1),GLOBAL_OBJ$1}function getSentryCarrier$1(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||SDK_VERSION$2,t[SDK_VERSION$2]=t[SDK_VERSION$2]||{}}function getGlobalSingleton$1(e,t,r=GLOBAL_OBJ$1){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[SDK_VERSION$2]=n[SDK_VERSION$2]||{};return i[e]||(i[e]=t())}const PREFIX$1="Sentry Logger ",originalConsoleMethods$1={};function consoleSandbox$1(e){if(!("console"in GLOBAL_OBJ$1))return e();const t=GLOBAL_OBJ$1.console,r={},n=Object.keys(originalConsoleMethods$1);n.forEach((e=>{const n=originalConsoleMethods$1[e];r[e]=t[e],t[e]=n}));try{return e()}finally{n.forEach((e=>{t[e]=r[e]}))}}function enable$2(){_getLoggerSettings$1().enabled=!0}function disable$1(){_getLoggerSettings$1().enabled=!1}function isEnabled$1(){return _getLoggerSettings$1().enabled}function log$4(...e){_maybeLog$1("log",...e)}function warn$3(...e){_maybeLog$1("warn",...e)}function error$2(...e){_maybeLog$1("error",...e)}function _maybeLog$1(e,...t){DEBUG_BUILD$1&&isEnabled$1()&&consoleSandbox$1((()=>{GLOBAL_OBJ$1.console[e](`${PREFIX$1}[${e}]:`,...t)}))}function _getLoggerSettings$1(){return DEBUG_BUILD$1?getGlobalSingleton$1("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const debug$2={enable:enable$2,disable:disable$1,isEnabled:isEnabled$1,log:log$4,warn:warn$3,error:error$2},objectToString$3=Object.prototype.toString;function isBuiltin$1(e,t){return objectToString$3.call(e)===`[object ${t}]`}function isPlainObject$3(e){return isBuiltin$1(e,"Object")}function isThenable$3(e){return Boolean(e?.then&&"function"==typeof e.then)}function addNonEnumerableProperty$1(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{DEBUG_BUILD$1&&debug$2.log(`Failed to add non-enumerable property "${t}" to object`,e)}}let RESOLVED_RUNNER,emptyUuid$1;function withRandomSafeContext(e){if(void 0!==RESOLVED_RUNNER)return RESOLVED_RUNNER?RESOLVED_RUNNER(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=GLOBAL_OBJ$1;return t in r&&"function"==typeof r[t]?(RESOLVED_RUNNER=r[t],RESOLVED_RUNNER(e)):(RESOLVED_RUNNER=null,e())}function safeMathRandom(){return withRandomSafeContext((()=>Math.random()))}function safeDateNow(){return withRandomSafeContext((()=>Date.now()))}function truncate$2(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function getCrypto$1(){const e=GLOBAL_OBJ$1;return e.crypto||e.msCrypto}function getRandomByte$1(){return 16*safeMathRandom()}function uuid4$1(e=getCrypto$1()){try{if(e?.randomUUID)return withRandomSafeContext((()=>e.randomUUID())).replace(/-/g,"")}catch{}return emptyUuid$1||(emptyUuid$1=[1e7]+1e3+4e3+8e3+1e11),emptyUuid$1.replace(/[018]/g,(e=>(e^(15&getRandomByte$1())>>e/4).toString(16)))}const ONE_SECOND_IN_MS$1=1e3;function dateTimestampInSeconds$1(){return safeDateNow()/ONE_SECOND_IN_MS$1}function createUnixTimestampInSecondsFunc$1(){const{performance:e}=GLOBAL_OBJ$1;if(!e?.now||!e.timeOrigin)return dateTimestampInSeconds$1;const t=e.timeOrigin;return()=>(t+withRandomSafeContext((()=>e.now())))/ONE_SECOND_IN_MS$1}let _cachedTimestampInSeconds$1;function timestampInSeconds$1(){return(_cachedTimestampInSeconds$1??(_cachedTimestampInSeconds$1=createUnixTimestampInSecondsFunc$1()))()}function updateSession$1(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||timestampInSeconds$1(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:uuid4$1()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function merge$4(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&0===Object.keys(t).length)return e;const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=merge$4(n[i],t[i],r-1));return n}function generateTraceId$1(){return uuid4$1()}const SCOPE_SPAN_FIELD$1="_sentrySpan";function _setSpanForScope$1(e,t){t?addNonEnumerableProperty$1(e,SCOPE_SPAN_FIELD$1,t):delete e[SCOPE_SPAN_FIELD$1]}function _getSpanForScope$1(e){return e[SCOPE_SPAN_FIELD$1]}const DEFAULT_MAX_BREADCRUMBS$1=100;let Scope$1=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId$1(),sampleRand:safeMathRandom()}}clone(){const t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,_setSpanForScope$1(t,_getSpanForScope$1(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession$1(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const r="function"==typeof t?t(this):t,n=r instanceof e?r.getScopeData():isPlainObject$3(r)?t:void 0,{tags:i,attributes:a,extra:o,user:s,contexts:l,level:c,fingerprint:u=[],propagationContext:d,conversationId:h}=n||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...a},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),h&&(this._conversationId=h),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,_setSpanForScope$1(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId$1(),sampleRand:safeMathRandom()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:DEFAULT_MAX_BREADCRUMBS$1;if(r<=0)return this;const n={timestamp:dateTimestampInSeconds$1(),...e,message:e.message?truncate$2(e.message,2048):e.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope$1(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=merge$4(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t?.event_id||uuid4$1();if(!this._client)return DEBUG_BUILD$1&&debug$2.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r?.event_id||uuid4$1();if(!this._client)return DEBUG_BUILD$1&&debug$2.warn("No client configured on scope - will not capture message!"),n;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=t?.event_id||uuid4$1();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(DEBUG_BUILD$1&&debug$2.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}};function getDefaultCurrentScope$1(){return getGlobalSingleton$1("defaultCurrentScope",(()=>new Scope$1))}function getDefaultIsolationScope$1(){return getGlobalSingleton$1("defaultIsolationScope",(()=>new Scope$1))}let AsyncContextStack$1=class{constructor(e,t){let r,n;r=e||new Scope$1,n=t||new Scope$1,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(n){throw this._popScope(),n}return isThenable$3(r)?r.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function getAsyncContextStack$1(){const e=getSentryCarrier$1(getMainCarrier$1());return e.stack=e.stack||new AsyncContextStack$1(getDefaultCurrentScope$1(),getDefaultIsolationScope$1())}function withScope$1(e){return getAsyncContextStack$1().withScope(e)}function withSetScope$1(e,t){const r=getAsyncContextStack$1();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function withIsolationScope$1(e){return getAsyncContextStack$1().withScope((()=>e(getAsyncContextStack$1().getIsolationScope())))}function getStackAsyncContextStrategy$1(){return{withIsolationScope:withIsolationScope$1,withScope:withScope$1,withSetScope:withSetScope$1,withSetIsolationScope:(e,t)=>withIsolationScope$1(t),getCurrentScope:()=>getAsyncContextStack$1().getScope(),getIsolationScope:()=>getAsyncContextStack$1().getIsolationScope()}}function getAsyncContextStrategy$1(e){const t=getSentryCarrier$1(e);return t.acs?t.acs:getStackAsyncContextStrategy$1()}function getCurrentScope$1(){return getAsyncContextStrategy$1(getMainCarrier$1()).getCurrentScope()}function parseEventHintOrCaptureContext$1(e){if(e)return hintIsScopeOrFunction$1(e)||hintIsScopeContext$1(e)?{captureContext:e}:e}function hintIsScopeOrFunction$1(e){return e instanceof Scope$1||"function"==typeof e}const captureContextKeys$1=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function hintIsScopeContext$1(e){return Object.keys(e).some((e=>captureContextKeys$1.includes(e)))}function captureException$1(e,t){return getCurrentScope$1().captureException(e,parseEventHintOrCaptureContext$1(t))}const SENSITIVE_KEY$1=/token|authorization|password|secret|spreadsheet|workbook|content|participant/i,sanitize$1=(e,t=0)=>t>4?"[Truncated]":null==e?e:"string"==typeof e?e.replace(/(access_token|oauthToken|authorization)=([^&\s]+)/gi,"$1=[Filtered]").replace(/Bearer\s+[A-Za-z0-9._~-]+/gi,"Bearer [Filtered]"):["number","boolean"].includes(typeof e)?e:Array.isArray(e)?e.slice(0,50).map((e=>sanitize$1(e,t+1))):"object"!=typeof e?String(e):Object.fromEntries(Object.entries(e).map((([e,r])=>[e,SENSITIVE_KEY$1.test(e)?"[Filtered]":sanitize$1(r,t+1)])));function captureError$1(e,t="",r={}){console.error(t,e),captureException$1(e,{tags:{context:t},extra:sanitize$1(r)})}function mulberry32(e){let t=e>>>0;return function(){t|=0,t=t+0x6d2b79f5|0;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/0x100000000}}function selectTypedResponse(e,t=Math.random){const r=e.validCharsTyped.split(""),n=e.correctResponse??r[0];switch(e.simulationModel??"right"){case"right":case"ideal":default:return n;case"wrong":{const e=r.filter((e=>e!==n));return e.length>0?e[Math.floor(t()*e.length)]:n}case"blind":return r[Math.floor(t()*r.length)];case"weibull":{const i=parseFloat(e.trialLevel??"0"),a=Math.log10(parseFloat(e.simulationThreshold??"2")),o=parseFloat(e.simulationBeta??"2.3"),s=parseFloat(e.simulationDelta??"0.01"),l=parseFloat(e.thresholdProportionCorrect??"0.816");if(isNaN(i)||isNaN(a)||isNaN(o)||isNaN(s)||isNaN(l))return console.warn(`[sim:weibull] NaN param — trialLevel=${e.trialLevel} threshold=${e.simulationThreshold} beta=${e.simulationBeta} delta=${e.simulationDelta} tpc=${e.thresholdProportionCorrect}. Falling back to blind.`),r[Math.floor(t()*r.length)];const c=1/r.length,u=i-a+Math.log10(-Math.log(-(l-s*c)/(1-s)+1)/(1-c))/o,d=s*c+(1-s)*(1-(1-c)*Math.exp(-Math.pow(10,o*u)));if(t()<d)return n;const h=r.filter((e=>e!==n));return h.length>0?h[Math.floor(t()*h.length)]:n}}}function selectClickedIndex(e,t,r=Math.random){const n=t.simulationModel??"right",i=t.correctResponse?.toLowerCase()??null,a=i?e.findIndex((e=>e.toLowerCase()===i)):-1;switch(n){case"right":case"ideal":return a>=0?a:Math.floor(r()*e.length);case"wrong":{const t=e.map(((e,t)=>t)).filter((e=>e!==a));return t.length>0?t[Math.floor(r()*t.length)]:0}case"blind":return Math.floor(r()*e.length);case"weibull":{const n=selectTypedResponse(t,r),i=e.findIndex((e=>e.toLowerCase()===n.toLowerCase()));return i>=0?i:0}default:return a>=0?a:0}}let masterSeed=null,seedSource="unseeded",initAttempted=!1;const streams=new Map;function hash32(e){let t=0x811c9dc5;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,0x1000193);return t>>>0}function substreamSeed(e){return(masterSeed^hash32(e))>>>0}function initRng(e,t){masterSeed=e>>>0,seedSource=t,streams.clear(),initAttempted=!0}function ensureInit(){if(initAttempted||"undefined"==typeof window)return void(initAttempted=!0);initAttempted=!0;const e=window;if("number"==typeof e.__SIM_SEED__&&Number.isFinite(e.__SIM_SEED__))return void initRng(e.__SIM_SEED__,"sim");const t=new URLSearchParams(window.location.search).get("rngSeed");null!==t&&""!==t&&Number.isFinite(Number(t))&&initRng(Number(t),"url")}function getSeedSource(){return ensureInit(),seedSource}function getMasterSeed(){return ensureInit(),masterSeed}function random$1(e="misc"){if(ensureInit(),null===masterSeed)return Math.random();let t=streams.get(e);return t||(t=mulberry32(substreamSeed(e)),streams.set(e,t)),t()}function rngFor(e){return()=>random$1(e)}function handlerSeed(e){return ensureInit(),null===masterSeed?Math.floor(Math.random()*2**31):substreamSeed(e)}const BASE_DELAY_SEC=.2,MAX_DELAY_SEC=30,wait=e=>new Promise((t=>setTimeout(t,e))),getRetryDelayMs=e=>1e3*Math.min(BASE_DELAY_SEC*Math.pow(1.75,e),MAX_DELAY_SEC)*(.8+.4*Math.random()),waitForRetryDelay=e=>{const t=globalThis.window;return t?.addEventListener?new Promise((r=>{const n=()=>{clearTimeout(i),t.removeEventListener?.("online",n),r()},i=setTimeout(n,e);t.addEventListener("online",n)})):wait(e)};let retryObserver=null;const setRetryObserver=e=>{retryObserver=e},notifyRetryAttempt=(e,t={})=>{try{retryObserver?.(e,t)}catch(r){}};let registry$2=null;function initPhrases(e){registry$2=e}function getPhrases(){if(null===registry$2)throw new Error("getPhrases() called before initPhrases()");return registry$2.phrases}const LOCALHOST_BASE_URL="http://localhost:8888",PRODUCTION_BASE_URL="https://easyeyes.app";let localhostBaseUrlPromise;const resolveLocalhostBaseUrl=async()=>{try{return await fetch(LOCALHOST_BASE_URL,{method:"HEAD",mode:"no-cors"}),LOCALHOST_BASE_URL}catch{return PRODUCTION_BASE_URL}},getEasyEyesBaseUrl=async()=>{const e=new URLSearchParams(window.location.search).get("preview-deploy");return e||(/--easyeyes\.netlify\.app$/.test(window.location.hostname)?window.location.origin:"localhost"!==window.location.hostname?PRODUCTION_BASE_URL:(localhostBaseUrlPromise||(localhostBaseUrlPromise=resolveLocalhostBaseUrl()),localhostBaseUrlPromise))};async function loadPhrases(e){const[t,r]=e.split("/").filter(Boolean),n=await getEasyEyesBaseUrl(),i=`${n}/.netlify/functions/phrases?pinned=${t}/${r}`;let a,o=0;for(;;){let e;try{e=await fetch(i)}catch{await wait(getRetryDelayMs(o++));continue}if(404!==e.status){if(e.ok){a=(await e.json()).version;break}await wait(getRetryDelayMs(o++))}else{if("No pinned version"===(await e.json()).error)throw new Error(`No phrasesVersion pinned for ${t}/${r}. Recompile the experiment.`);await wait(getRetryDelayMs(o++))}}const s=`${n}/.netlify/functions/phrases?v=${a}`;for(;;){let e;try{e=await fetch(s)}catch{await wait(getRetryDelayMs(o++));continue}if(!e.ok){await wait(getRetryDelayMs(o++));continue}const t=await e.json();return initPhrases(t),t}}const phrasesData=await loadPhrases(window.location.pathname);let DefaultMap$1=class extends Map{constructor(e,t){super(t),this.default=e}get(e){return this.has(e)||this.set(e,this.default()),super.get(e)}};const status={block:0,nthBlock:void 0,trial:void 0,block_condition:void 0,condition:void 0,trialCorrect_thisBlock:0,trialCompleted_thisBlock:0,trialAttempted_thisBlock:0,nthTrialCorrectThisBlockByCondition:new DefaultMap$1((()=>0),null),nthTrialCompletedThisBlockByCondition:new DefaultMap$1((()=>0),null),nthTrialByCondition:new DefaultMap$1((()=>1),null),nthTrialAttemptedByCondition:new DefaultMap$1((()=>0),null),currentFunction:"",terminated:!1,retryThisTrialBool:!1,consentGiven:void 0},withBreadcrumb=async(e,t)=>{const r=status.currentFunction;status.currentFunction=e;try{return await t()}finally{status.currentFunction=r}},resetBlockScopedStatus=()=>{status.trial=void 0,status.block_condition=void 0,status.condition=void 0,status.trialCorrect_thisBlock=0,status.trialCompleted_thisBlock=0,status.trialAttempted_thisBlock=0,status.nthTrialCorrectThisBlockByCondition.clear(),status.nthTrialCompletedThisBlockByCondition.clear(),status.nthTrialByCondition.clear(),status.nthTrialAttemptedByCondition.clear(),status.currentFunction="",status.retryThisTrialBool=!1};class DefaultMap extends Map{constructor(e,t){super(t),this.default=e}get(e){return this.has(e)||this.set(e,this.default()),super.get(e)}}const thisExperimentInfo={name:"threshold",expName:"threshold",psychopyVersion:void 0,participant:void 0,_s:1,EasyEyesID:void 0,PavloviaSessionID:void 0,actualPavloviaSessionID:void 0,ProlificParticipantID:void 0,ProlificSessionID:void 0,ProlificStudyID:void 0,experimentFilename:void 0,experiment:void 0,date:void 0,hardwareConcurrency:void 0,deviceType:void 0,deviceSystem:void 0,deviceSystemFamily:void 0,deviceBrowser:void 0,deviceBrowserVersion:void 0,deviceLanguage:void 0,psychojsWindowDimensions:void 0,monitorFrameRate:void 0,get session(){return this._s.toString().padStart(4,"0")},set session(e){},setSession(e){this._s=e}},localStorageKey="__EASYEYES__",_key_resp_allKeys={current:[]},_key_resp_event_handlers={current:[]},handler$1={set:function(e,t,r){return e[t]=r,_key_resp_event_handlers.current.forEach((e=>e(r))),!0}},proxyVariable_key_resp_allKeys=new Proxy(_key_resp_allKeys.current,handler$1);if("undefined"==typeof RemoteCalibrator){const e="RemoteCalibrator resource failed to load.",t="Please check your internet connection and refresh the page.";throw window.showCriticalLoadError?window.showCriticalLoadError(e,t):setTimeout((()=>window.showCriticalLoadError?.(e,t)),50),new Error("RemoteCalibrator is not defined")}const rc=RemoteCalibrator;await rc.init({languagePhrasesJSON:phrasesData.phrases},void 0,{easyEyesKeypadHandler:{event_handlers:_key_resp_event_handlers,all_keys:_key_resp_allKeys}});const websiteRepoLastCommitDeploy={current:void 0};await fetch("CompatibilityRequirements.txt").then((e=>e?.ok?e.json():"")).then((e=>{e&&e.compilerUpdateDate&&(websiteRepoLastCommitDeploy.current=e.compilerUpdateDate)})).catch((e=>{}));const stats={current:void 0,on:!1},usingGaze={current:void 0};Object.seal({window:void 0,windowWidthCm:void 0,windowWidthPx:void 0,pixPerCm:void 0,nearPointXYDeg:[void 0,void 0],nearPointXYPix:[void 0,void 0]});const grid={current:void 0,units:void 0},totalBlocks={current:void 0},totalTrialsThisBlock={current:void 0},blockOrder={current:void 0},targetTask={current:void 0},targetKind={current:void 0},correctAns={current:[]},font={name:void 0,source:void 0,direction:"ltr",language:"en",punctuationRTL:"none",colorRGBA:void 0,padding:void 0,letterSpacing:0,kerning:void 0,textRendering:void 0,featureSettings:void 0,variantLigatures:void 0,medialShapeResponse:void 0,medialShapeTarget:void 0,fontPositionalShapeResponse:void 0},typekit={kitId:void 0,fonts:new Map},fontCharacterSet={current:void 0,where:void 0},showTimingBarsBool={current:!1},screenBackground={defaultColorRGBA:"0.933,0.933,0.933,1",colorRGBA:void 0},measureMeters={canMeasureMeters:0,needMeasureMeters:0},targetEccentricityDeg={x:void 0,y:void 0},showConditionNameConfig$1={name:void 0,show:!1,targetSpecs:void 0,showTargetSpecs:!1},letterConfig=Object.seal({targetDurationSec:void 0,targetSizeIsHeightBool:void 0,targetMinimumPix:void 0,targetSizeDeg:void 0,targetCharacter:void 0,targetEccentricityXYDeg:[void 0,void 0],thresholdParameter:void 0,spacingDirection:void 0,spacingSymmetry:void 0,spacingOverSizeRatio:void 0,spacingRelationToSize:void 0,flankerCharacters:[void 0,void 0],delayBeforeStimOnsetSec:void 0,targetSafetyMarginSec:void 0,markingOnsetAfterTargetOffsetSecs:void 0,flankerXYDegs:[],thresholdAllowedBlackoutBool:void 0,fontMaxPxShrinkage:1,useFontMaxPxShrinkageBool:!1,currentNominalFontSize:void 0,fontMaxPx:void 0,responseMaxOptions:99}),imageFolders={folders:new Map},imageConfig=Object.seal({targetSizeDeg:0,targetDurationSec:0,targetEccentricityXDeg:0,targetEccentricityYDeg:0,thresholdParameter:"",targetSizeIsHeightBool:!1,targetImageFolder:"",targetImageReplacementBool:!1,currentImageFileName:"",currentImageFile:void 0,delayAfterStimOnsetSec:0,delayBeforeStimOnsetSec:0,responseMaxOptions:99,responsePositiveFeedbackBool:!0,currentImageFullFileName:"",targetImageExclude:"none",targetImageFoilsExclude:"none",targetImageSpareFraction:0,targetImageWhere:"top"}),pastImages={targets:new Map,foils:new Map},imageQuestionAndAnswer=Object.seal({current:{}}),repeatedLettersConfig=Object.seal({targetRepeatsBorderCharacter:void 0,targetRepeatsMaxLines:void 0,stims:void 0,level:void 0,stimulusParameters:void 0}),repeatedLettersResponse=Object.seal({current:[],clickTime:[],rt:[],correct:[]}),instructionFont={current:void 0},customInstructionText={current:void 0},tolerances=Object.seal({allowed:{thresholdAllowedDurationRatio:void 0,thresholdAllowedGazeXErrorDeg:void 0,thresholdAllowedGazeYErrorDeg:void 0,thresholdAllowedGazeRErrorDeg:void 0,thresholdAllowedLatenessSec:void 0},measured:{thresholdDurationRatio:void 0,gazeMeasuredXDeg:void 0,gazeMeasuredYDeg:void 0,gazeMeasuredRDeg:void 0,gazeMeasuredRawDeg:[],gazeMeasurementLatencySec:void 0,targetMeasuredLatenessSec:void 0,targetMeasuredDurationSec:void 0,targetMeasuredDurationFrames:void 0,targetMeasuredPreRenderSec:void 0}}),skipTrialOrBlock={blockId:null,trialId:null,skipTrial:!1,skipBlock:!1,restartBlock:!1},timing=Object.seal({clickToStimulusOnsetSec:void 0,stimulusOnsetToOffset:void 0}),letterTiming=Object.seal({trialFirstFrameSec:void 0,targetStartSec:void 0,targetFinishSec:void 0,targetDrawnConfirmedTimestamp:void 0,crosshairClickedTimestamp:void 0,targetRequestedTimestamp:void 0,blackoutDetectedBool:!1,preRenderStartSec:void 0,preRenderEndSec:void 0,preRenderOpacifyStartSec:void 0,preRenderOpacifyEndSec:void 0}),letterHeapData={heapUsedBeforeDrawingMB:void 0,heapTotalBeforeDrawingMB:void 0,heapLimitBeforeDrawingMB:void 0,heapUsedAfterDrawingMB:void 0,heapTotalAfterDrawingMB:void 0,heapLimitAfterDrawingMB:void 0,heapTotalPreLatenessMB:void 0,heapTotalPostLatenessMB:void 0},viewingDistanceCm={current:40,desired:40,max:40},responseType={current:2,original:2,numberOfResponses:1},clickedContinue={current:!1,timestamps:[]},showCharacterSetResponse={current:[],onsetTime:[],clickTime:[],alreadyClickedCharacters:[]},phraseIdentificationResponse=Object.seal({current:[],correct:[],targetWord:[],categoriesResponded:[],onsetTime:void 0,onsetT:void 0,clickTime:[]}),markingShowCursorBool={current:!0},readingCorpusArchive={},readingWordListArchive={},readingWordFrequencyArchive={},readingFrequencyToWordArchive={},readingCorpusFoilsArchive=new DefaultMap((()=>[])),readingCorpusPastTargets=new Set,readingCorpusPastFoils=new Set,readingUsedText={},readingThisBlockPages=new DefaultMap((()=>[])),readingPageIndex={current:0},readingQuestions={current:void 0},readingCurrentQuestionIndex={current:0},readingClickableAnswersSetup={current:!1},readingClickableAnswersUpdate={current:!1},readingConfig={height:void 0,actualLinesPerPage:void 0},readingTiming=Object.seal({onsets:[]}),readingPageStats=Object.seal({readingPageSkipCorpusWords:new DefaultMap((()=>[])),readingPageDurationSec:new DefaultMap((()=>[])),readingPageLines:new DefaultMap((()=>[])),readingPageWords:new DefaultMap((()=>[])),readingPageNonblankCharacters:new DefaultMap((()=>[]))}),readingCorpusDepleted=new DefaultMap((()=>!1)),readingLineLengthUnit=new DefaultMap((()=>"character")),questionsThisBlock={current:[]},qaPlanThisBlock={current:null},uniComponentConfig={text:"",units:"pix",alignHoriz:"left",ori:0,opacity:1,isInstruction:!1},instructionsConfig={...uniComponentConfig,height:25,wrapWidth:.8*window.innerWidth,depth:-12,isInstruction:!0},conditionNameConfig={...uniComponentConfig,height:30,wrapWidth:window.innerWidth,depth:-20,name:"conditionName",alignVert:"bottom",pos:[-window.innerWidth/2,-window.innerHeight/2],autoDraw:!1},targetSpecsConfig$1={...uniComponentConfig,height:20,wrapWidth:window.innerWidth,depth:-21,name:"targetSpecs",alignVert:"bottom",pos:[-window.innerWidth/2,-window.innerHeight/2],autoDraw:!1},trialCounterConfig={...uniComponentConfig,height:20,wrapWidth:window.innerWidth,depth:-22,name:"trialCounter",alignVert:"bottom",alignHoriz:"right",pos:[window.innerWidth/2,-window.innerHeight/2],autoDraw:!1},targetTextStimConfig={text:"",font:"Arial",units:"pix",pos:[0,0],height:1,wrapWidth:void 0,ori:0,opacity:1,depth:-7,alignVert:"center",alignHoriz:"center",isInstruction:!1,medialForm:!1},deviceType={isSmartphone:!1,isLoudspeaker:!0,isParticipant:!1,profileFetchedFromLibrary:!1,showSystemCorrection:!0},targetIsPresentBool={current:void 0},ProposedVolumeLevelFromQuest={current:void 0,adjusted:void 0},maskerVolumeDbSPL={current:void 0},soundGainDBSPL={current:void 0},invertedImpulseResponse={current:void 0},whiteNoiseLevel={current:void 0},maskerSoundFolder={current:void 0},targetSoundFolder={current:void 0},targetSoundListFiles={},targetSoundListMap={},targetSoundListTrialData={left:void 0,right:void 0,targetVolume:void 0,whiteNoiseLevel:void 0,trialSound:void 0},speechInNoiseTargetList={current:void 0},speechInNoiseShowClickable={current:!0},vocoderPhrases={targetPhrase:void 0,maskerPhrase:void 0},actualSamplingRate={current:""},actualBitsPerSample={current:""},microphoneActualSamplingRate={current:""},vocoderPhraseCategories={chosen:void 0,all:void 0},vocoderPhraseShowClickable={current:!0},vocoderPhraseCorrectResponse={current:void 0},soundCalibrationResults={current:void 0},qualityMetrics={current:{}},sdOfRecordingOfFilteredMLS={current:void 0},currentFirestoreProfileDocumentID={microphone:void 0,loudspeaker:void 0},allHzCalibrationResults={x_unconv:void 0,y_unconv:void 0,x_conv:void 0,y_conv:void 0,knownIr:void 0,x_background:void 0,y_background:void 0,system:{},component:{},background:{},mls_psd:{},microphoneGain:{Freq:[],Gain:[]},loudspeakerGain:{Freq:[],Gain:[]},filteredMLSRange:{system:{Min:null,Max:null},component:{Min:null,Max:null}},timestamps:""},flags={current:{autoGainControl:"",echoCancellation:"",noiseSuppression:""}},calibrationRound={current:0},loudspeakerIR={Freq:[],Gain:[]},webAudioDeviceNames={loudspeaker:"",microphone:"",loudspeakerText:"",microphoneText:""},IDsToSaveInSoundProfileLibrary={ProlificParticipantID:"",PavloviaSessionID:""},parseJsonSaveTargets=e=>{const t=(e||"").toLowerCase().split(",").map((e=>e.trim())).filter(Boolean);return{wantsLocal:t.includes("local"),wantsOnline:t.includes("online")}},calibrateSoundSamplingDesiredBits={current:16},_calibrateSoundShowParametersBool={current:!0},_calibrateSoundAllHzBool={current:!1},_calibrateSoundSaveJSON={current:""},calibrateSoundSmoothOctaves={current:.3333333},calibrateSoundSmoothMinBandwidthHz={current:200},calibrateSoundPowerBinDesiredSec={current:.2},calibrateSoundPowerDbSDToleratedDb={current:1},calibrateSoundTaperSec={current:.01},calibrateSoundBackgroundSecs={current:0},calibrateSoundBurstRepeats={current:4},calibrateSoundBurstSec={current:1},_calibrateSoundBurstPreSec={current:1},_calibrateSoundBurstPostSec={current:1},calibrateSoundHz={current:48e3},calibrateSoundBurstMLSVersions={current:4},_calibrateSound1000HzBool={current:!1},_calibrateSound1000HzDB={current:"-50, -40, -30, -20, -10"},_calibrateSound1000HzSec={current:1},_calibrateSound1000HzPreSec={current:3.5},_calibrateSound1000HzPostSec={current:.5},calibrateSoundIIRSec={current:.2},calibrateSoundIIRPhase={current:"linear"},calibrateSoundIRSec={current:.2},calibrateSoundBurstDb={current:-18},calibrateSoundBurstFilteredExtraDb={current:6},calibrateSoundBurstScalarDB={current:71},calibrateSoundBurstLevelReTBool={current:!1},calibrateSoundBurstNormalizeBy1000HzGainBool={current:!1},_calibrateSound1000HzMaxSD_dB={current:4},_calibrateSound1000HzMaxTries={current:4},_calibrateSoundBurstMaxSD_dB={current:4},calibrateSoundBurstDownsample={current:1},timeoutNewPhoneSec={current:15},timeoutSoundCalibrationSec={current:1e6},calibrateSoundCheck={current:"speakerOrMic"},_calibrateSoundShowResultsBool={current:!1},_calibrateSoundShowTestPageBool={current:!1},microphoneCalibrationResults=[],microphoneCalibrationResult={current:void 0},_calibrateSoundMaxHz={current:void 0},_calibrateSoundMinHz={current:void 0},fMaxHz={system:void 0,component:void 0},calibrateSoundSimulateLoudspeaker={type:"impulseResponse",frequencies:null,gains:null,amplitudes:null,fileName:void 0,time:null,enabled:!1},calibrateSoundSimulateMicrophone={type:"impulseResponse",frequencies:null,gains:null,amplitudes:null,fileName:void 0,time:null,enabled:!1},attenuatorGainDB={system:void 0,component:void 0},debugBool={current:!1},calibrateMicrophonesBool={current:!1},rsvpReadingWordsForThisBlock={current:void 0},timeToCalibrate={current:1,timeAtTheStartOfCalibration:0,timeAtTheEndOfCalibration:0,calibrationDuration:0},calibrateSoundUMIKBase_dB={umik1:-75.11,umik2:-99.96},calibrateSoundLimit={current:1},filteredMLSAttenuation={component:1,system:1,maxAbsSystem:1,maxAbsComponent:1,attenuationDbSystem:0,attenuationDbComponent:0},micsForSoundTestPage={list:[]},thisDevice={current:void 0},gotLoudspeakerMatch={current:!1},loudspeakerInfo$1={current:{}},loudspeakerBrowserDetails={current:{browser:void 0,browserVersion:void 0}},microphoneBrowserDetails={current:{browser:void 0,browserVersion:void 0}},microphoneInfo$1={current:{}},calibrationTime={current:void 0},needPhoneSurvey={current:!1},needComputerSurveyBool={current:!1},authorEmail={current:void 0},rsvpReadingTargetSets={numberOfSets:void 0,numberOfIdentifications:void 0,identificationTargetSets:void 0,current:void 0,upcoming:[],past:[],skippedDueToBadTracking:0},rsvpReadingResponse={categories:void 0,identificationCategories:void 0,screen:void 0,displayStatus:!1,responseType:void 0,responseTypeForCurrentBlock:[]},rsvpSpeechPreflight={completed:!1,required:!1,status:"idle",block:void 0,lastFailureCode:void 0},rsvpSpeechRuntime$1={controller:void 0,status:"idle",simulated:!1,blockCondition:void 0,utteranceId:void 0,result:void 0,error:void 0,preparationStartedAtMs:void 0,readyAtMs:void 0,captureStartedAtMs:void 0,finalizationAllowedAtMs:void 0,responseRegistrationStatus:"pending",responseRegistrationError:void 0,responseDiagnostics:void 0},rsvpReadingTiming={current:{finishSec:void 0},past:[]},dummyStim={current:void 0},eyeTrackingStimulusRecords=[],cursorTracking={records:[],target:void 0},measureLuminance={records:[],movieStart:void 0,measureLuminanceDelaySec:0,measurementShouldStartAt:void 0,movieValues:[],colorimeter:void 0,currentMovieValueIndex:0,pretendBool:!1,movieSec:0},keypad={handler:void 0},thresholdParacticeUntilCorrect={doneWithPractice:new DefaultMap((()=>!1))};class MonotonicClock{constructor(e=MonotonicClock.getReferenceTime()){this._timeAtLastReset=e}getTime(){return MonotonicClock.getReferenceTime()-this._timeAtLastReset}getLastResetTime(){return this._timeAtLastReset}static getReferenceTime(){return performance.now()/1e3-MonotonicClock._referenceTime}static getDate(e="en-CA",t){const r=new Date,n=Object.assign({hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3},t);return new Intl.DateTimeFormat(e,n).format(r)}static getTimeZone(e="en-CA",t={}){const r=new Date,n=Object.assign({timeZoneName:"shortOffset"},t);return new Intl.DateTimeFormat(e,n).formatToParts(r).find((e=>"timeZoneName"===e.type)).value.replace("GMT","UTC")}static getDateStr(){return MonotonicClock.getDate().replace(", ","_").replace(":","h").replace(":",".")}}MonotonicClock._referenceTime=performance.now()/1e3;let Clock$1=class extends MonotonicClock{constructor(){super()}reset(e=0){this._timeAtLastReset=MonotonicClock.getReferenceTime()+e}add(e){this._timeAtLastReset+=e}};class CountdownTimer extends Clock$1{constructor(e=0){super(),this._timeAtLastReset=MonotonicClock.getReferenceTime(),this._countdown_duration=e,e&&this.add(e)}add(e){this._timeAtLastReset+=e}reset(e=void 0){void 0===e?this._timeAtLastReset=MonotonicClock.getReferenceTime()+this._countdown_duration:(this._countdown_duration=e,this._timeAtLastReset=MonotonicClock.getReferenceTime()+e)}getTime(){return this._timeAtLastReset-MonotonicClock.getReferenceTime()}}var commonjsGlobal$2="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}getAugmentedNamespace=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r};var log4javascript$1={exports:{}};(function(module,exports$1){!function(e,t){module.exports=e()}((function(){function isUndefined(e){return void 0===e}function EventSupport(){}Array.prototype.push||(Array.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)this[this.length]=arguments[e];return this.length}),Array.prototype.shift||(Array.prototype.shift=function(){if(this.length>0){for(var e=this[0],t=0,r=this.length-1;t<r;t++)this[t]=this[t+1];return this.length=this.length-1,e}}),Array.prototype.splice||(Array.prototype.splice=function(e,t){var r=this.slice(e+t),n=this.slice(e,e+t);this.length=e;for(var i=[],a=0,o=arguments.length;a<o;a++)i[a]=arguments[a];var s=i.length>2?r=i.slice(2).concat(r):r;for(a=0,o=s.length;a<o;a++)this.push(s[a]);return n}),EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(e){if(e instanceof Array){this.eventTypes=e,this.eventListeners={};for(var t=0,r=this.eventTypes.length;t<r;t++)this.eventListeners[this.eventTypes[t]]=[]}else handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array")},addEventListener:function(e,t){"function"==typeof t?(array_contains(this.eventTypes,e)||handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+e+"'"),this.eventListeners[e].push(t)):handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function")},removeEventListener:function(e,t){"function"==typeof t?(array_contains(this.eventTypes,e)||handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+e+"'"),array_remove(this.eventListeners[e],t)):handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function")},dispatchEvent:function(e,t){if(array_contains(this.eventTypes,e))for(var r=this.eventListeners[e],n=0,i=r.length;n<i;n++)r[n](this,e,t);else handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+e+"'")}};var applicationStartDate=new Date,uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+Math.floor(1e8*Math.random()),emptyFunction=function(){},newLine="\r\n",pageLoaded=!1;function Log4JavaScript(){}Log4JavaScript.prototype=new EventSupport;var log4javascript=new Log4JavaScript;function toStr(e){return e&&e.toString?e.toString():String(e)}function getExceptionMessage(e){return e.message?e.message:e.description?e.description:toStr(e)}function getUrlFileName(e){var t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return e.substr(t+1)}function getExceptionStringRep(e){if(e){var t="Exception: "+getExceptionMessage(e);try{e.lineNumber&&(t+=" on line number "+e.lineNumber),e.fileName&&(t+=" in file "+getUrlFileName(e.fileName))}catch(r){logLog.warn("Unable to obtain file and line information for error")}return showStackTraces&&e.stack&&(t+=newLine+"Stack trace:"+newLine+e.stack),t}return null}function bool(e){return Boolean(e)}function trim(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function splitIntoLines(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n")}log4javascript.version="1.4.13",log4javascript.edition="log4javascript";var urlEncode=void 0!==window.encodeURIComponent?function(e){return encodeURIComponent(e)}:function(e){return escape(e).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D")};function array_remove(e,t){for(var r=-1,n=0,i=e.length;n<i;n++)if(e[n]===t){r=n;break}return r>=0&&(e.splice(r,1),!0)}function array_contains(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]==t)return!0;return!1}function extractBooleanFromParam(e,t){return isUndefined(e)?t:bool(e)}function extractStringFromParam(e,t){return isUndefined(e)?t:String(e)}function extractIntFromParam(e,t){if(isUndefined(e))return t;try{var r=parseInt(e,10);return isNaN(r)?t:r}catch(n){return logLog.warn("Invalid int param "+e,n),t}}function extractFunctionFromParam(e,t){return"function"==typeof e?e:t}function isError(e){return e instanceof Error}Function.prototype.apply||(Function.prototype.apply=function(obj,args){var methodName="__apply__";void 0!==obj[methodName]&&(methodName+=String(Math.random()).substr(2)),obj[methodName]=this;for(var argsStrings=[],i=0,len=args.length;i<len;i++)argsStrings[i]="args["+i+"]";var script="obj."+methodName+"("+argsStrings.join(",")+")",returnValue=eval(script);return delete obj[methodName],returnValue}),Function.prototype.call||(Function.prototype.call=function(e){for(var t=[],r=1,n=arguments.length;r<n;r++)t[r-1]=arguments[r];return this.apply(e,t)});var logLog={quietMode:!1,debugMessages:[],setQuietMode:function(e){this.quietMode=bool(e)},numberOfErrors:0,alertAllErrors:!1,setAlertAllErrors:function(e){this.alertAllErrors=e},debug:function(e){this.debugMessages.push(e)},displayDebug:function(){alert(this.debugMessages.join(newLine))},warn:function(e,t){},error:function(e,t){if((1==++this.numberOfErrors||this.alertAllErrors)&&!this.quietMode){var r="log4javascript error: "+e;t&&(r+=newLine+newLine+"Original error: "+getExceptionStringRep(t)),alert(r)}}};function handleError(e,t){logLog.error(e,t),log4javascript.dispatchEvent("error",{message:e,exception:t})}log4javascript.logLog=logLog,log4javascript.setEventTypes(["load","error"]),log4javascript.handleError=handleError;var enabled=!("undefined"!=typeof log4javascript_disabled&&log4javascript_disabled);log4javascript.setEnabled=function(e){enabled=bool(e)},log4javascript.isEnabled=function(){return enabled};var useTimeStampsInMilliseconds=!0;log4javascript.setTimeStampsInMilliseconds=function(e){useTimeStampsInMilliseconds=bool(e)},log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds},log4javascript.evalInScope=function(expr){return eval(expr)};var showStackTraces=!1;log4javascript.setShowStackTraces=function(e){showStackTraces=bool(e)};var Level=function(e,t){this.level=e,this.name=t};function Timer(e,t){this.name=e,this.level=isUndefined(t)?Level.INFO:t,this.start=new Date}Level.prototype={toString:function(){return this.name},equals:function(e){return this.level==e.level},isGreaterOrEqual:function(e){return this.level>=e.level}},Level.ALL=new Level(Number.MIN_VALUE,"ALL"),Level.TRACE=new Level(1e4,"TRACE"),Level.DEBUG=new Level(2e4,"DEBUG"),Level.INFO=new Level(3e4,"INFO"),Level.WARN=new Level(4e4,"WARN"),Level.ERROR=new Level(5e4,"ERROR"),Level.FATAL=new Level(6e4,"FATAL"),Level.OFF=new Level(Number.MAX_VALUE,"OFF"),log4javascript.Level=Level,Timer.prototype.getElapsedTime=function(){return(new Date).getTime()-this.start.getTime()};var anonymousLoggerName="[anonymous]",defaultLoggerName="[default]",nullLoggerName="[null]",rootLoggerName="root";function Logger(e){this.name=e,this.parent=null,this.children=[];var t=[],r=null,n=this.name===rootLoggerName,i=this.name===nullLoggerName,a=null,o=!1;this.addChild=function(e){this.children.push(e),e.parent=this,e.invalidateAppenderCache()};var s=!0;this.getAdditivity=function(){return s},this.setAdditivity=function(e){var t=s!=e;s=e,t&&this.invalidateAppenderCache()},this.addAppender=function(e){i?handleError("Logger.addAppender: you may not add an appender to the null logger"):e instanceof log4javascript.Appender?array_contains(t,e)||(t.push(e),e.setAddedToLogger(this),this.invalidateAppenderCache()):handleError("Logger.addAppender: appender supplied ('"+toStr(e)+"') is not a subclass of Appender")},this.removeAppender=function(e){array_remove(t,e),e.setRemovedFromLogger(this),this.invalidateAppenderCache()},this.removeAllAppenders=function(){var e=t.length;if(e>0){for(var r=0;r<e;r++)t[r].setRemovedFromLogger(this);t.length=0,this.invalidateAppenderCache()}},this.getEffectiveAppenders=function(){if(null===a||o){var e=n||!this.getAdditivity()?[]:this.parent.getEffectiveAppenders();a=e.concat(t),o=!1}return a},this.invalidateAppenderCache=function(){o=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].invalidateAppenderCache()},this.log=function(e,t){if(enabled&&e.isGreaterOrEqual(this.getEffectiveLevel())){var r,n=t.length-1,i=t[n];t.length>1&&isError(i)&&(r=i,n--);for(var a=[],o=0;o<=n;o++)a[o]=t[o];var s=new LoggingEvent(this,new Date,e,a,r);this.callAppenders(s)}},this.callAppenders=function(e){for(var t=this.getEffectiveAppenders(),r=0,n=t.length;r<n;r++)t[r].doAppend(e)},this.setLevel=function(e){n&&null===e?handleError("Logger.setLevel: you cannot set the level of the root logger to null"):e instanceof Level?r=e:handleError("Logger.setLevel: level supplied to logger "+this.name+" is not an instance of log4javascript.Level")},this.getLevel=function(){return r},this.getEffectiveLevel=function(){for(var e=this;null!==e;e=e.parent){var t=e.getLevel();if(null!==t)return t}},this.group=function(e,t){if(enabled)for(var r=this.getEffectiveAppenders(),n=0,i=r.length;n<i;n++)r[n].group(e,t)},this.groupEnd=function(){if(enabled)for(var e=this.getEffectiveAppenders(),t=0,r=e.length;t<r;t++)e[t].groupEnd()};var l={};this.time=function(e,t){enabled&&(isUndefined(e)?handleError("Logger.time: a name for the timer must be supplied"):!t||t instanceof Level?l[e]=new Timer(e,t):handleError("Logger.time: level supplied to timer "+e+" is not an instance of log4javascript.Level"))},this.timeEnd=function(e){if(enabled)if(isUndefined(e))handleError("Logger.timeEnd: a name for the timer must be supplied");else if(l[e]){var t=l[e],r=t.getElapsedTime();this.log(t.level,["Timer "+toStr(e)+" completed in "+r+"ms"]),delete l[e]}else logLog.warn("Logger.timeEnd: no timer found with name "+e)},this.assert=function(e){if(enabled&&!e){for(var t=[],r=1,n=arguments.length;r<n;r++)t.push(arguments[r]);(t=t.length>0?t:["Assertion Failure"]).push(newLine),t.push(e),this.log(Level.ERROR,t)}},this.toString=function(){return"Logger["+this.name+"]"}}Logger.prototype={trace:function(){this.log(Level.TRACE,arguments)},debug:function(){this.log(Level.DEBUG,arguments)},info:function(){this.log(Level.INFO,arguments)},warn:function(){this.log(Level.WARN,arguments)},error:function(){this.log(Level.ERROR,arguments)},fatal:function(){this.log(Level.FATAL,arguments)},isEnabledFor:function(e){return e.isGreaterOrEqual(this.getEffectiveLevel())},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE)},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG)},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO)},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN)},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR)},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL)}},Logger.prototype.trace.isEntryPoint=!0,Logger.prototype.debug.isEntryPoint=!0,Logger.prototype.info.isEntryPoint=!0,Logger.prototype.warn.isEntryPoint=!0,Logger.prototype.error.isEntryPoint=!0,Logger.prototype.fatal.isEntryPoint=!0;var loggers={},ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG,rootLogger=new Logger(rootLoggerName);rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),log4javascript.getRootLogger=function(){return rootLogger},log4javascript.getLogger=function(e){if("string"!=typeof e&&(e=anonymousLoggerName,logLog.warn("log4javascript.getLogger: non-string logger name "+toStr(e)+" supplied, returning anonymous logger")),e==rootLoggerName&&handleError("log4javascript.getLogger: root logger may not be obtained by name"),!loggers[e]){var t=new Logger(e);loggers[e]=t;var r,n=e.lastIndexOf(".");if(n>-1){var i=e.substring(0,n);r=log4javascript.getLogger(i)}else r=rootLogger;r.addChild(t)}return loggers[e]};var defaultLogger=null;log4javascript.getDefaultLogger=function(){return defaultLogger||(defaultLogger=createDefaultLogger()),defaultLogger};var nullLogger=null;log4javascript.getNullLogger=function(){return nullLogger||(nullLogger=new Logger(nullLoggerName)).setLevel(Level.OFF),nullLogger},log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),loggers={}};var LoggingEvent=function(e,t,r,n,i){this.logger=e,this.timeStamp=t,this.timeStampInMilliseconds=t.getTime(),this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1e3),this.milliseconds=this.timeStamp.getMilliseconds(),this.level=r,this.messages=n,this.exception=i};LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):""},getCombinedMessages:function(){return 1==this.messages.length?this.messages[0]:this.messages.join(newLine)},toString:function(){return"LoggingEvent["+this.level+"]"}},log4javascript.LoggingEvent=LoggingEvent;var Layout=function(){};Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:!1,overrideTimeStampsSetting:!1,useTimeStampsInMilliseconds:null,format:function(){handleError("Layout.format: layout supplied has no format() method")},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method")},getContentType:function(){return"text/plain"},allowBatching:function(){return!0},setTimeStampsInMilliseconds:function(e){this.overrideTimeStampsSetting=!0,this.useTimeStampsInMilliseconds=bool(e)},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds},getTimeStampValue:function(e){return this.isTimeStampsInMilliseconds()?e.timeStampInMilliseconds:e.timeStampInSeconds},getDataValues:function(e,t){var r=[[this.loggerKey,e.logger.name],[this.timeStampKey,this.getTimeStampValue(e)],[this.levelKey,e.level.name],[this.urlKey,window.location.href],[this.messageKey,t?e.getCombinedMessages():e.messages]];if(this.isTimeStampsInMilliseconds()||r.push([this.millisecondsKey,e.milliseconds]),e.exception&&r.push([this.exceptionKey,getExceptionStringRep(e.exception)]),this.hasCustomFields())for(var n=0,i=this.customFields.length;n<i;n++){var a=this.customFields[n].value;"function"==typeof a&&(a=a(this,e)),r.push([this.customFields[n].name,a])}return r},setKeys:function(e,t,r,n,i,a,o){this.loggerKey=extractStringFromParam(e,this.defaults.loggerKey),this.timeStampKey=extractStringFromParam(t,this.defaults.timeStampKey),this.levelKey=extractStringFromParam(r,this.defaults.levelKey),this.messageKey=extractStringFromParam(n,this.defaults.messageKey),this.exceptionKey=extractStringFromParam(i,this.defaults.exceptionKey),this.urlKey=extractStringFromParam(a,this.defaults.urlKey),this.millisecondsKey=extractStringFromParam(o,this.defaults.millisecondsKey)},setCustomField:function(e,t){for(var r=!1,n=0,i=this.customFields.length;n<i;n++)this.customFields[n].name===e&&(this.customFields[n].value=t,r=!0);r||this.customFields.push({name:e,value:t})},hasCustomFields:function(){return this.customFields.length>0},formatWithException:function(e){var t=this.format(e);return e.exception&&this.ignoresThrowable()&&(t+=e.getThrowableStrRep()),t},toString:function(){handleError("Layout.toString: all layouts must override this method")}},log4javascript.Layout=Layout;var Appender=function(){},SimpleDateFormat;function SimpleLayout(){this.customFields=[]}function NullLayout(){this.customFields=[]}function XmlLayout(e){this.combineMessages=extractBooleanFromParam(e,!0),this.customFields=[]}function escapeNewLines(e){return e.replace(/\r\n|\r|\n/g,"\\r\\n")}function JsonLayout(e,t){this.readable=extractBooleanFromParam(e,!1),this.combineMessages=extractBooleanFromParam(t,!0),this.batchHeader=this.readable?"["+newLine:"[",this.batchFooter=this.readable?"]"+newLine:"]",this.batchSeparator=this.readable?","+newLine:",",this.setKeys(),this.colon=this.readable?": ":":",this.tab=this.readable?" ":"",this.lineBreak=this.readable?newLine:"",this.customFields=[]}function HttpPostDataLayout(){this.setKeys(),this.customFields=[],this.returnsPostData=!0}function formatObjectExpansion(e,t,r){var n=[];return function e(t,r,i){var a,o,s,l,c,u,d;function h(e){for(var t=splitIntoLines(e),r=1,n=t.length;r<n;r++)t[r]=i+t[r];return t.join(newLine)}if(i||(i=""),null===t)return"null";if(void 0===t)return"undefined";if("string"==typeof t)return h(t);if("object"==typeof t&&array_contains(n,t)){try{u=toStr(t)}catch(p){u="Error formatting property. Details: "+getExceptionStringRep(p)}return u+" [already expanded]"}if(t instanceof Array&&r>0){for(n.push(t),u="["+newLine,s=r-1,l=i+" ",c=[],a=0,o=t.length;a<o;a++)try{d=e(t[a],s,l),c.push(l+d)}catch(p){c.push(l+"Error formatting array member. Details: "+getExceptionStringRep(p))}return u+=c.join(","+newLine)+newLine+i+"]"}if("[object Date]"==Object.prototype.toString.call(t))return t.toString();if("object"==typeof t&&r>0){for(a in n.push(t),u="{"+newLine,s=r-1,l=i+" ",c=[],t)try{d=e(t[a],s,l),c.push(l+a+": "+d)}catch(p){c.push(l+a+": Error formatting property. Details: "+getExceptionStringRep(p))}return u+=c.join(","+newLine)+newLine+i+"}"}return h(toStr(t))}(e,t,r)}function PatternLayout(e){this.pattern=e||PatternLayout.DEFAULT_CONVERSION_PATTERN,this.customFields=[]}function AlertAppender(){}function BrowserConsoleAppender(){}Appender.prototype=new EventSupport,Appender.prototype.layout=new PatternLayout,Appender.prototype.threshold=Level.ALL,Appender.prototype.loggers=[],Appender.prototype.doAppend=function(e){enabled&&e.level.level>=this.threshold.level&&this.append(e)},Appender.prototype.append=function(e){},Appender.prototype.setLayout=function(e){e instanceof Layout?this.layout=e:handleError("Appender.setLayout: layout supplied to "+this.toString()+" is not a subclass of Layout")},Appender.prototype.getLayout=function(){return this.layout},Appender.prototype.setThreshold=function(e){e instanceof Level?this.threshold=e:handleError("Appender.setThreshold: threshold supplied to "+this.toString()+" is not a subclass of Level")},Appender.prototype.getThreshold=function(){return this.threshold},Appender.prototype.setAddedToLogger=function(e){this.loggers.push(e)},Appender.prototype.setRemovedFromLogger=function(e){array_remove(this.loggers,e)},Appender.prototype.group=emptyFunction,Appender.prototype.groupEnd=emptyFunction,Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method")},log4javascript.Appender=Appender,SimpleLayout.prototype=new Layout,SimpleLayout.prototype.format=function(e){return e.level.name+" - "+e.getCombinedMessages()},SimpleLayout.prototype.ignoresThrowable=function(){return!0},SimpleLayout.prototype.toString=function(){return"SimpleLayout"},log4javascript.SimpleLayout=SimpleLayout,NullLayout.prototype=new Layout,NullLayout.prototype.format=function(e){return e.messages},NullLayout.prototype.ignoresThrowable=function(){return!0},NullLayout.prototype.formatWithException=function(e){var t=e.messages,r=e.exception;return r?t.concat([r]):t},NullLayout.prototype.toString=function(){return"NullLayout"},log4javascript.NullLayout=NullLayout,XmlLayout.prototype=new Layout,XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages},XmlLayout.prototype.getContentType=function(){return"text/xml"},XmlLayout.prototype.escapeCdata=function(e){return e.replace(/\]\]>/,"]]>]]><![CDATA[")},XmlLayout.prototype.format=function(e){var t,r,n=this;function i(e){return e="string"==typeof e?e:toStr(e),"<log4javascript:message><![CDATA["+n.escapeCdata(e)+"]]></log4javascript:message>"}var a='<log4javascript:event logger="'+e.logger.name+'" timestamp="'+this.getTimeStampValue(e)+'"';if(this.isTimeStampsInMilliseconds()||(a+=' milliseconds="'+e.milliseconds+'"'),a+=' level="'+e.level.name+'">'+newLine,this.combineMessages)a+=i(e.getCombinedMessages());else{for(a+="<log4javascript:messages>"+newLine,t=0,r=e.messages.length;t<r;t++)a+=i(e.messages[t])+newLine;a+="</log4javascript:messages>"+newLine}if(this.hasCustomFields())for(t=0,r=this.customFields.length;t<r;t++)a+='<log4javascript:customfield name="'+this.customFields[t].name+'"><![CDATA['+this.customFields[t].value.toString()+"]]></log4javascript:customfield>"+newLine;return e.exception&&(a+="<log4javascript:exception><![CDATA["+getExceptionStringRep(e.exception)+"]]></log4javascript:exception>"+newLine),a+="</log4javascript:event>"+newLine+newLine},XmlLayout.prototype.ignoresThrowable=function(){return!1},XmlLayout.prototype.toString=function(){return"XmlLayout"},log4javascript.XmlLayout=XmlLayout,JsonLayout.prototype=new Layout,JsonLayout.prototype.isReadable=function(){return this.readable},JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages},JsonLayout.prototype.format=function(e){var t,r,n=this,i=this.getDataValues(e,this.combineMessages),a="{"+this.lineBreak;function o(e,t,r){var i,a=typeof e;if(e instanceof Date)i=String(e.getTime());else if(r&&e instanceof Array){i="["+n.lineBreak;for(var s=0,l=e.length;s<l;s++){var c=t+n.tab;i+=c+o(e[s],c,!1),s<e.length-1&&(i+=","),i+=n.lineBreak}i+=t+"]"}else i="number"!==a&&"boolean"!==a?'"'+escapeNewLines(toStr(e).replace(/\"/g,'\\"'))+'"':e;return i}for(t=0,r=i.length-1;t<=r;t++)a+=this.tab+'"'+i[t][0]+'"'+this.colon+o(i[t][1],this.tab,!0),t<r&&(a+=","),a+=this.lineBreak;return a+="}"+this.lineBreak},JsonLayout.prototype.ignoresThrowable=function(){return!1},JsonLayout.prototype.toString=function(){return"JsonLayout"},JsonLayout.prototype.getContentType=function(){return"application/json"},log4javascript.JsonLayout=JsonLayout,HttpPostDataLayout.prototype=new Layout,HttpPostDataLayout.prototype.allowBatching=function(){return!1},HttpPostDataLayout.prototype.format=function(e){for(var t=this.getDataValues(e),r=[],n=0,i=t.length;n<i;n++){var a=t[n][1]instanceof Date?String(t[n][1].getTime()):t[n][1];r.push(urlEncode(t[n][0])+"="+urlEncode(a))}return r.join("&")},HttpPostDataLayout.prototype.ignoresThrowable=function(e){return!1},HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout"},log4javascript.HttpPostDataLayout=HttpPostDataLayout,function(){var e=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/,t=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={G:0,y:3,M:4,w:2,W:2,D:2,d:2,F:2,E:1,a:0,H:2,k:2,K:2,h:2,m:2,s:2,S:2,Z:5},i=864e5,a=6048e5,o=function(e,t,r){var n=new Date(e,t,r,0,0,0);return n.setMilliseconds(0),n};Date.prototype.getDifference=function(e){return this.getTime()-e.getTime()},Date.prototype.isBefore=function(e){return this.getTime()<e.getTime()},Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())},Date.prototype.getTimeSince=function(e){return this.getUTCTime()-e.getUTCTime()},Date.prototype.getPreviousSunday=function(){var e=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0),t=new Date(e.getTime()-this.getDay()*i);return o(t.getFullYear(),t.getMonth(),t.getDate())},Date.prototype.getWeekInYear=function(e){isUndefined(this.minimalDaysInFirstWeek)&&(e=1);var t=this.getPreviousSunday(),r=o(this.getFullYear(),0,1),n=t.isBefore(r)?0:1+Math.floor(t.getTimeSince(r)/a);return 7-r.getDay()<e&&n--,n},Date.prototype.getWeekInMonth=function(e){isUndefined(this.minimalDaysInFirstWeek)&&(e=1);var t=this.getPreviousSunday(),r=o(this.getFullYear(),this.getMonth(),1),n=t.isBefore(r)?0:1+Math.floor(t.getTimeSince(r)/a);return 7-r.getDay()>=e&&n++,n},Date.prototype.getDayInYear=function(){var e=o(this.getFullYear(),0,1);return 1+Math.floor(this.getTimeSince(e)/i)},(SimpleDateFormat=function(e){this.formatString=e}).prototype.setMinimalDaysInFirstWeek=function(e){this.minimalDaysInFirstWeek=e},SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?1:this.minimalDaysInFirstWeek};var s=function(e,t){for(;e.length<t;)e="0"+e;return e},l=function(e,t,r){return t>=4?e:e.substr(0,Math.max(r,t))},c=function(e,t){return s(""+e,t)};SimpleDateFormat.prototype.format=function(i){for(var a,o="",u=this.formatString;a=e.exec(u);){var d=a[1],h=a[2],p=a[3],f=a[4];if(d)o+="''"==d?"'":d.substring(1,d.length-1);else if(p);else if(f)o+=f;else if(h){var m=h.charAt(0),g=h.length,_="";switch(m){case"G":_="AD";break;case"y":_=i.getFullYear();break;case"M":_=i.getMonth();break;case"w":_=i.getWeekInYear(this.getMinimalDaysInFirstWeek());break;case"W":_=i.getWeekInMonth(this.getMinimalDaysInFirstWeek());break;case"D":_=i.getDayInYear();break;case"d":_=i.getDate();break;case"F":_=1+Math.floor((i.getDate()-1)/7);break;case"E":_=r[i.getDay()];break;case"a":_=i.getHours()>=12?"PM":"AM";break;case"H":_=i.getHours();break;case"k":_=i.getHours()||24;break;case"K":_=i.getHours()%12;break;case"h":_=i.getHours()%12||12;break;case"m":_=i.getMinutes();break;case"s":_=i.getSeconds();break;case"S":_=i.getMilliseconds();break;case"Z":_=i.getTimezoneOffset()}switch(n[m]){case 0:o+=l(_,g,2);break;case 1:o+=l(_,g,3);break;case 2:o+=c(_,g);break;case 3:if(g<=3)o+=(""+_).substr(2,2);else o+=c(_,g);break;case 4:o+=g>=3?l(t[_],g,g):c(_+1,g);break;case 5:var y=_>0?"-":"+",b=Math.abs(_),v=""+Math.floor(b/60),S=""+b%60;o+=y+(v=s(v,2))+(S=s(S,2))}}u=u.substr(a.index+a[0].length)}return o}}(),log4javascript.SimpleDateFormat=SimpleDateFormat,PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n",PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n",PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS",PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS",PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS",PatternLayout.prototype=new Layout,PatternLayout.prototype.format=function(e){for(var t,r=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/,n="",i=this.pattern;t=r.exec(i);){var a=t[0],o=t[1],s=t[2],l=t[3],c=t[5],u=t[6];if(u)n+=""+u;else{var d,h="";switch(l){case"a":case"m":var p=0;c&&(p=parseInt(c,10),isNaN(p)&&(handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character '"+l+"' - should be a number"),p=0));for(var f="a"===l?e.messages[0]:e.messages,m=0,g=f.length;m<g;m++)m>0&&" "!==h.charAt(h.length-1)&&(h+=" "),h+=0===p?f[m]:formatObjectExpansion(f[m],p);break;case"c":var _=e.logger.name;if(c){var y=parseInt(c,10),b=e.logger.name.split(".");h=y>=b.length?_:b.slice(b.length-y).join(".")}else h=_;break;case"d":var v=PatternLayout.ISO8601_DATEFORMAT;c&&("ISO8601"==(v=c)?v=PatternLayout.ISO8601_DATEFORMAT:"ABSOLUTE"==v?v=PatternLayout.ABSOLUTETIME_DATEFORMAT:"DATE"==v&&(v=PatternLayout.DATETIME_DATEFORMAT)),h=new SimpleDateFormat(v).format(e.timeStamp);break;case"f":if(this.hasCustomFields()){var S=0;c&&(S=parseInt(c,10),isNaN(S)?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - should be a number"):0===S?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - must be greater than zero"):S>this.customFields.length?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - there aren't that many custom fields"):S-=1);var w=this.customFields[S].value;"function"==typeof w&&(w=w(this,e)),h=w}break;case"n":h=newLine;break;case"p":h=e.level.name;break;case"r":h=""+e.timeStamp.getDifference(applicationStartDate);break;case"%":h="%";break;default:h=a}if(s){d=parseInt(s.substr(1),10);var T=h.length;d<T&&(h=h.substring(T-d,T))}if(o)if("-"==o.charAt(0))for(d=parseInt(o.substr(1),10);h.length<d;)h+=" ";else for(d=parseInt(o,10);h.length<d;)h=" "+h;n+=h}i=i.substr(t.index+t[0].length)}return n},PatternLayout.prototype.ignoresThrowable=function(){return!0},PatternLayout.prototype.toString=function(){return"PatternLayout"},log4javascript.PatternLayout=PatternLayout,AlertAppender.prototype=new Appender,AlertAppender.prototype.layout=new SimpleLayout,AlertAppender.prototype.append=function(e){alert(this.getLayout().formatWithException(e))},AlertAppender.prototype.toString=function(){return"AlertAppender"},log4javascript.AlertAppender=AlertAppender,BrowserConsoleAppender.prototype=new log4javascript.Appender,BrowserConsoleAppender.prototype.layout=new NullLayout,BrowserConsoleAppender.prototype.threshold=Level.DEBUG,BrowserConsoleAppender.prototype.append=function(e){var t,r=this,n=function(t){var n=r.getLayout().formatWithException(e);return"string"==typeof n?t?n:[n]:t?n.join(" "):n},i=window.console;i&&i.log?"function"==typeof i[t=i.debug&&Level.DEBUG.isGreaterOrEqual(e.level)?"debug":i.info&&Level.INFO.equals(e.level)?"info":i.warn&&Level.WARN.equals(e.level)?"warn":i.error&&e.level.isGreaterOrEqual(Level.ERROR)?"error":"log"].apply?i[t].apply(i,n(!1)):i[t](n(!0)):"undefined"!=typeof opera&&opera.postError&&opera.postError(n(!0))},BrowserConsoleAppender.prototype.group=function(e){window.console&&window.console.group&&window.console.group(e)},BrowserConsoleAppender.prototype.groupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},BrowserConsoleAppender.prototype.toString=function(){return"BrowserConsoleAppender"},log4javascript.BrowserConsoleAppender=BrowserConsoleAppender;var xhrFactory=function(){return new XMLHttpRequest},xmlHttpFactories=[xhrFactory,function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],withCredentialsSupported=!1,getXmlHttp=function(e){for(var t,r=null,n=0,i=xmlHttpFactories.length;n<i;n++){t=xmlHttpFactories[n];try{return r=t(),withCredentialsSupported=t==xhrFactory&&"withCredentials"in r,getXmlHttp=t,r}catch(a){}}e?e():handleError("getXmlHttp: unable to obtain XMLHttpRequest object")},ConsoleAppender;function isHttpRequestSuccessful(e){return isUndefined(e.status)||0===e.status||e.status>=200&&e.status<300||1223==e.status}function AjaxAppender(e,t){var r=this,n=!0;e||(handleError("AjaxAppender: URL must be specified in constructor"),n=!1);var i=this.defaults.timed,a=this.defaults.waitForResponse,o=this.defaults.batchSize,s=this.defaults.timerInterval,l=this.defaults.requestSuccessCallback,c=this.defaults.failCallback,u=this.defaults.postVarName,d=this.defaults.sendAllOnUnload,h=this.defaults.contentType,p=null,f=[],m=[],g=[],_=!1,y=!1;function b(e){return!y||(handleError("AjaxAppender: configuration option '"+e+"' may not be set after the appender has been initialized"),!1)}function v(){var e;if(n&&enabled)if(_=!0,a)m.length>0?x(w(e=m.shift()),v):(_=!1,i&&T());else{for(;e=m.shift();)x(w(e));_=!1,i&&T()}}function S(){var e=!1;if(n&&enabled){for(var t,s=r.getLayout().allowBatching()?o:1,l=[];t=f.shift();)l.push(t),f.length>=s&&(m.push(l),l=[]);l.length>0&&m.push(l),e=m.length>0,a=!1,i=!1,v()}return e}function w(e){for(var t,n=[],i="";t=e.shift();)n.push(r.getLayout().formatWithException(t));return i=1==e.length?n.join(""):r.getLayout().batchHeader+n.join(r.getLayout().batchSeparator)+r.getLayout().batchFooter,h==r.defaults.contentType&&((i=r.getLayout().returnsPostData?i:urlEncode(u)+"="+urlEncode(i)).length>0&&(i+="&"),i+="layout="+urlEncode(r.getLayout().toString())),i}function T(){window.setTimeout(v,s)}function E(){var e="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";handleError(e),n=!1,c&&c(e)}function x(r,i){try{var a=getXmlHttp(E);if(n){a.onreadystatechange=function(){if(4==a.readyState){if(isHttpRequestSuccessful(a))l&&l(a),i&&i(a);else{var t="AjaxAppender.append: XMLHttpRequest request to URL "+e+" returned status code "+a.status;handleError(t),c&&c(t)}a.onreadystatechange=emptyFunction,a=null}},a.open("POST",e,!0),t&&withCredentialsSupported&&(a.withCredentials=!0);try{for(var o,s=0;o=g[s++];)a.setRequestHeader(o.name,o.value);a.setRequestHeader("Content-Type",h)}catch(p){var u="AjaxAppender.append: your browser's XMLHttpRequest implementation does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";return handleError(u),n=!1,void(c&&c(u))}a.send(r)}}catch(f){var d="AjaxAppender.append: error sending log message to "+e;handleError(d,f),n=!1,c&&c(d+". Details: "+getExceptionStringRep(f))}}this.getSessionId=function(){return p},this.setSessionId=function(e){p=extractStringFromParam(e,null),this.layout.setCustomField("sessionid",p)},this.setLayout=function(e){b("layout")&&(this.layout=e,null!==p&&this.setSessionId(p))},this.isTimed=function(){return i},this.setTimed=function(e){b("timed")&&(i=bool(e))},this.getTimerInterval=function(){return s},this.setTimerInterval=function(e){b("timerInterval")&&(s=extractIntFromParam(e,s))},this.isWaitForResponse=function(){return a},this.setWaitForResponse=function(e){b("waitForResponse")&&(a=bool(e))},this.getBatchSize=function(){return o},this.setBatchSize=function(e){b("batchSize")&&(o=extractIntFromParam(e,o))},this.isSendAllOnUnload=function(){return d},this.setSendAllOnUnload=function(e){b("sendAllOnUnload")&&(d=extractBooleanFromParam(e,d))},this.setRequestSuccessCallback=function(e){l=extractFunctionFromParam(e,l)},this.setFailCallback=function(e){c=extractFunctionFromParam(e,c)},this.getPostVarName=function(){return u},this.setPostVarName=function(e){b("postVarName")&&(u=extractStringFromParam(e,u))},this.getHeaders=function(){return g},this.addHeader=function(e,t){"content-type"==e.toLowerCase()?h=t:g.push({name:e,value:t})},this.sendAll=v,this.sendAllRemaining=S,this.append=function(e){if(n){y||function(){if(y=!0,d){var e=window.onbeforeunload;window.onbeforeunload=function(){e&&e(),S()}}i&&T()}(),f.push(e);var t=this.getLayout().allowBatching()?o:1;if(f.length>=t){for(var r,s=[];r=f.shift();)s.push(r);m.push(s),i||a&&(!a||_)||v()}}}}function setCookie(e,t,r,n){n=n?"; path="+n:"",document.cookie=escape(e)+"="+escape(t)+n}function getCookie(e){for(var t=escape(e)+"=",r=document.cookie.split(";"),n=0,i=r.length;n<i;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return unescape(a.substring(t.length,a.length))}return null}function getBaseUrl(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t)if(-1!=e[t].src.indexOf("log4javascript")){var n=e[t].src.lastIndexOf("/");return-1==n?"":e[t].src.substr(0,n+1)}return null}function isLoaded(e){try{return bool(e.loaded)}catch(t){return!1}}function padWithSpaces(e,t){if(e.length<t){for(var r=[],n=Math.max(0,t-e.length),i=0;i<n;i++)r[i]=" ";e+=r.join("")}return e}function createDefaultLogger(){var e=log4javascript.getLogger(defaultLoggerName),t=new log4javascript.PopUpAppender;return e.addAppender(t),e}if(AjaxAppender.prototype=new Appender,AjaxAppender.prototype.defaults={waitForResponse:!1,timed:!1,timerInterval:1e3,batchSize:1,sendAllOnUnload:!1,requestSuccessCallback:null,failCallback:null,postVarName:"data",contentType:"application/x-www-form-urlencoded"},AjaxAppender.prototype.layout=new HttpPostDataLayout,AjaxAppender.prototype.toString=function(){return"AjaxAppender"},log4javascript.AjaxAppender=AjaxAppender,function(){var e=[],t=1;function r(e,t,r,n,i){this.create(!1,null,e,t,r,n,i,this.defaults.focusPopUp)}function n(e,t,r,n,i,a){this.create(!0,e,t,r,n,i,a,!1)}(ConsoleAppender=function(){}).prototype=new Appender,ConsoleAppender.prototype.create=function(r,n,i,a,o,s,l,c){var u=this,d=!1,h=!1,p=!1,f=!1,m=[],g=!0,_=t++;a=extractBooleanFromParam(a,this.defaults.initiallyMinimized),i=extractBooleanFromParam(i,this.defaults.lazyInit),o=extractBooleanFromParam(o,this.defaults.useDocumentWrite);var y=this.defaults.newestMessageAtTop,b=this.defaults.scrollToLatestMessage;s=s||this.defaults.width,l=l||this.defaults.height;var v,S,w,T,E,x=this.defaults.maxMessages,A=this.defaults.showCommandLine,C=this.defaults.commandLineObjectExpansionDepth,R=this.defaults.showHideButton,D=this.defaults.showCloseButton;this.setLayout(this.defaults.layout);var P=r?"InPageAppender":"PopUpAppender",I=function(e){return!h||(handleError(P+": configuration option '"+e+"' may not be set after the appender has been initialized"),!1)},k=function(){return p&&g&&!f};this.isNewestMessageAtTop=function(){return y},this.setNewestMessageAtTop=function(e){y=bool(e),k()&&T().setNewestAtTop(y)},this.isScrollToLatestMessage=function(){return b},this.setScrollToLatestMessage=function(e){b=bool(e),k()&&T().setScrollToLatest(b)},this.getWidth=function(){return s},this.setWidth=function(e){I("width")&&(s=extractStringFromParam(e,s))},this.getHeight=function(){return l},this.setHeight=function(e){I("height")&&(l=extractStringFromParam(e,l))},this.getMaxMessages=function(){return x},this.setMaxMessages=function(e){x=extractIntFromParam(e,x),k()&&T().setMaxMessages(x)},this.isShowCommandLine=function(){return A},this.setShowCommandLine=function(e){A=bool(e),k()&&T().setShowCommandLine(A)},this.isShowHideButton=function(){return R},this.setShowHideButton=function(e){R=bool(e),k()&&T().setShowHideButton(R)},this.isShowCloseButton=function(){return D},this.setShowCloseButton=function(e){D=bool(e),k()&&T().setShowCloseButton(D)},this.getCommandLineObjectExpansionDepth=function(){return C},this.setCommandLineObjectExpansionDepth=function(e){C=extractIntFromParam(e,C)};var M=a;function $(e,t){this.loggingEvent=e,this.levelName=e.level.name,this.formattedMessage=t}function O(e,t){this.name=e,this.initiallyExpanded=t}function N(){}this.isInitiallyMinimized=function(){return a},this.setInitiallyMinimized=function(e){I("initiallyMinimized")&&(a=bool(e),M=a)},this.isUseDocumentWrite=function(){return o},this.setUseDocumentWrite=function(e){I("useDocumentWrite")&&(o=bool(e))},$.prototype.append=function(){T().log(this.levelName,this.formattedMessage)},O.prototype.append=function(){T().group(this.name,this.initiallyExpanded)},N.prototype.append=function(){T().groupEnd()};var F=function(){w(),d?f&&te&&S():v(),w()&&L()};this.append=function(e){if(g){var t=u.getLayout().formatWithException(e);m.push(new $(e,t)),F()}},this.group=function(e,t){g&&(m.push(new O(e,t)),F())},this.groupEnd=function(){g&&(m.push(new N),F())};var L=function(){for(;m.length>0;)m.shift().append();c&&T().focus()};this.setAddedToLogger=function(e){this.loggers.push(e),enabled&&!i&&v()},this.clear=function(){k()&&T().clearLog(),m.length=0},this.focus=function(){k()&&T().focus()},this.focusCommandLine=function(){k()&&T().focusCommandLine()},this.focusSearch=function(){k()&&T().focusSearch()};var B=window;this.getCommandWindow=function(){return B},this.setCommandWindow=function(e){B=e},this.executeLastCommand=function(){k()&&T().evalLastCommand()};var V=new PatternLayout("%m");this.getCommandLayout=function(){return V},this.setCommandLayout=function(e){V=e},this.evalCommandAndAppend=function(e){var t={appendResult:!0,isError:!1},r="";try{var n,i;!B.eval&&B.execScript&&B.execScript("null");var a={};for(i=0,len=U.length;i<len;i++)a[U[i][0]]=U[i][1];var o=[],s=function(e){o.push([e,B[e]])};s("appender"),B.appender=u,s("commandReturnValue"),B.commandReturnValue=t,s("commandLineFunctionsHash"),B.commandLineFunctionsHash=a;var l=function(e){s(e),B[e]=function(){return this.commandLineFunctionsHash[e](u,arguments,t)}};for(i=0,len=U.length;i<len;i++)l(U[i][0]);for(B===window&&B.execScript?(s("evalExpr"),s("result"),window.evalExpr=e,B.execScript("window.result=eval(window.evalExpr);"),n=window.result):n=B.eval(e),r=isUndefined(n)?n:formatObjectExpansion(n,C),i=0,len=o.length;i<len;i++)B[o[i][0]]=o[i][1]}catch(f){r="Error evaluating command: "+getExceptionStringRep(f),t.isError=!0}if(t.appendResult){var c=">>> "+e;isUndefined(r)||(c+=newLine+r);var d=t.isError?Level.ERROR:Level.INFO,h=new LoggingEvent(null,new Date,d,[c],null),p=this.getLayout();this.setLayout(V),this.append(h),this.setLayout(p)}};var U=e.concat([]);this.addCommandLineFunction=function(e,t){U.push([e,t])};var z="log4javascriptCommandHistory";this.storeCommandHistory=function(e){setCookie(z,e.join(","))};var H=function(e){var t=['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">',"<head>","<title>log4javascript</title>",'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',"<!-- Make IE8 behave like IE7, having gone to all the trouble of making IE work -->",'<meta http-equiv="X-UA-Compatible" content="IE=7" />','<script type="text/javascript">var isIe = false, isIePre7 = false;</script>','<!--[if IE]><script type="text/javascript">isIe = true</script><![endif]-->','<!--[if lt IE 7]><script type="text/javascript">isIePre7 = true</script><![endif]-->','<script type="text/javascript">',"//<![CDATA[","var loggingEnabled=true;var logQueuedEventsTimer=null;var logEntries=[];var logEntriesAndSeparators=[];var logItems=[];var renderDelay=100;var unrenderedLogItemsExist=false;var rootGroup,currentGroup=null;var loaded=false;var currentLogItem=null;var logMainContainer;function copyProperties(obj,props){for(var i in props){obj[i]=props[i];}}","function LogItem(){}","LogItem.prototype={mainContainer:null,wrappedContainer:null,unwrappedContainer:null,group:null,appendToLog:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].appendToLog();}","this.group.update();},doRemove:function(doUpdate,removeFromGroup){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].remove();}","this.unwrappedElementContainer=null;this.wrappedElementContainer=null;this.mainElementContainer=null;}","if(this.group&&removeFromGroup){this.group.removeChild(this,doUpdate);}","if(this===currentLogItem){currentLogItem=null;}},remove:function(doUpdate,removeFromGroup){this.doRemove(doUpdate,removeFromGroup);},render:function(){},accept:function(visitor){visitor.visit(this);},getUnwrappedDomContainer:function(){return this.group.unwrappedElementContainer.contentDiv;},getWrappedDomContainer:function(){return this.group.wrappedElementContainer.contentDiv;},getMainDomContainer:function(){return this.group.mainElementContainer.contentDiv;}};LogItem.serializedItemKeys={LOG_ENTRY:0,GROUP_START:1,GROUP_END:2};function LogItemContainerElement(){}",'LogItemContainerElement.prototype={appendToLog:function(){var insertBeforeFirst=(newestAtTop&&this.containerDomNode.hasChildNodes());if(insertBeforeFirst){this.containerDomNode.insertBefore(this.mainDiv,this.containerDomNode.firstChild);}else{this.containerDomNode.appendChild(this.mainDiv);}}};function SeparatorElementContainer(containerDomNode){this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="separator";this.mainDiv.innerHTML=" ";}',"SeparatorElementContainer.prototype=new LogItemContainerElement();SeparatorElementContainer.prototype.remove=function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;};function Separator(){this.rendered=false;}","Separator.prototype=new LogItem();copyProperties(Separator.prototype,{render:function(){var containerDomNode=this.group.contentDiv;if(isIe){this.unwrappedElementContainer=new SeparatorElementContainer(this.getUnwrappedDomContainer());this.wrappedElementContainer=new SeparatorElementContainer(this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new SeparatorElementContainer(this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}",'this.content=this.formattedMessage;this.rendered=true;}});function GroupElementContainer(group,containerDomNode,isRoot,isWrapped){this.group=group;this.containerDomNode=containerDomNode;this.isRoot=isRoot;this.isWrapped=isWrapped;this.expandable=false;if(this.isRoot){if(isIe){this.contentDiv=logMainContainer.appendChild(document.createElement("div"));this.contentDiv.id=this.isWrapped?"log_wrapped":"log_unwrapped";}else{this.contentDiv=logMainContainer;}}else{var groupElementContainer=this;this.mainDiv=document.createElement("div");this.mainDiv.className="group";this.headingDiv=this.mainDiv.appendChild(document.createElement("div"));this.headingDiv.className="groupheading";this.expander=this.headingDiv.appendChild(document.createElement("span"));this.expander.className="expander unselectable greyedout";this.expander.unselectable=true;var expanderText=this.group.expanded?"-":"+";this.expanderTextNode=this.expander.appendChild(document.createTextNode(expanderText));this.headingDiv.appendChild(document.createTextNode(" "+this.group.name));this.contentDiv=this.mainDiv.appendChild(document.createElement("div"));var contentCssClass=this.group.expanded?"expanded":"collapsed";this.contentDiv.className="groupcontent "+contentCssClass;this.expander.onclick=function(){if(groupElementContainer.group.expandable){groupElementContainer.group.toggleExpanded();}};}}','GroupElementContainer.prototype=new LogItemContainerElement();copyProperties(GroupElementContainer.prototype,{toggleExpanded:function(){if(!this.isRoot){var oldCssClass,newCssClass,expanderText;if(this.group.expanded){newCssClass="expanded";oldCssClass="collapsed";expanderText="-";}else{newCssClass="collapsed";oldCssClass="expanded";expanderText="+";}',"replaceClass(this.contentDiv,newCssClass,oldCssClass);this.expanderTextNode.nodeValue=expanderText;}},remove:function(){if(!this.isRoot){this.headingDiv=null;this.expander.onclick=null;this.expander=null;this.expanderTextNode=null;this.contentDiv=null;this.containerDomNode=null;this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;}},reverseChildren:function(){var node=null;var childDomNodes=[];while((node=this.contentDiv.firstChild)){this.contentDiv.removeChild(node);childDomNodes.push(node);}",'while((node=childDomNodes.pop())){this.contentDiv.appendChild(node);}},update:function(){if(!this.isRoot){if(this.group.expandable){removeClass(this.expander,"greyedout");}else{addClass(this.expander,"greyedout");}}},clear:function(){if(this.isRoot){this.contentDiv.innerHTML="";}}});function Group(name,isRoot,initiallyExpanded){this.name=name;this.group=null;this.isRoot=isRoot;this.initiallyExpanded=initiallyExpanded;this.elementContainers=[];this.children=[];this.expanded=initiallyExpanded;this.rendered=false;this.expandable=false;}',"Group.prototype=new LogItem();copyProperties(Group.prototype,{addChild:function(logItem){this.children.push(logItem);logItem.group=this;},render:function(){if(isIe){var unwrappedDomContainer,wrappedDomContainer;if(this.isRoot){unwrappedDomContainer=logMainContainer;wrappedDomContainer=logMainContainer;}else{unwrappedDomContainer=this.getUnwrappedDomContainer();wrappedDomContainer=this.getWrappedDomContainer();}","this.unwrappedElementContainer=new GroupElementContainer(this,unwrappedDomContainer,this.isRoot,false);this.wrappedElementContainer=new GroupElementContainer(this,wrappedDomContainer,this.isRoot,true);this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{var mainDomContainer=this.isRoot?logMainContainer:this.getMainDomContainer();this.mainElementContainer=new GroupElementContainer(this,mainDomContainer,this.isRoot,false);this.elementContainers=[this.mainElementContainer];}","this.rendered=true;},toggleExpanded:function(){this.expanded=!this.expanded;for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].toggleExpanded();}},expand:function(){if(!this.expanded){this.toggleExpanded();}},accept:function(visitor){visitor.visitGroup(this);},reverseChildren:function(){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].reverseChildren();}}},update:function(){var previouslyExpandable=this.expandable;this.expandable=(this.children.length!==0);if(this.expandable!==previouslyExpandable){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].update();}}},flatten:function(){var visitor=new GroupFlattener();this.accept(visitor);return visitor.logEntriesAndSeparators;},removeChild:function(child,doUpdate){array_remove(this.children,child);child.group=null;if(doUpdate){this.update();}},remove:function(doUpdate,removeFromGroup){for(var i=0,len=this.children.length;i<len;i++){this.children[i].remove(false,false);}","this.children=[];this.update();if(this===currentGroup){currentGroup=this.group;}","this.doRemove(doUpdate,removeFromGroup);},serialize:function(items){items.push([LogItem.serializedItemKeys.GROUP_START,this.name]);for(var i=0,len=this.children.length;i<len;i++){this.children[i].serialize(items);}","if(this!==currentGroup){items.push([LogItem.serializedItemKeys.GROUP_END]);}},clear:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clear();}}});function LogEntryElementContainer(){}",'LogEntryElementContainer.prototype=new LogItemContainerElement();copyProperties(LogEntryElementContainer.prototype,{remove:function(){this.doRemove();},doRemove:function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;this.contentElement=null;this.containerDomNode=null;},setContent:function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=content;}},setSearchMatch:function(isMatch){var oldCssClass=isMatch?"searchnonmatch":"searchmatch";var newCssClass=isMatch?"searchmatch":"searchnonmatch";replaceClass(this.mainDiv,newCssClass,oldCssClass);},clearSearch:function(){removeClass(this.mainDiv,"searchmatch");removeClass(this.mainDiv,"searchnonmatch");}});function LogEntryWrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.mainDiv.className="logentry wrapped "+this.logEntry.level;this.contentElement=this.mainDiv;}','LogEntryWrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryWrappedElementContainer.prototype.setContent=function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=wrappedContent;}};function LogEntryUnwrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry unwrapped "+this.logEntry.level;this.pre=this.mainDiv.appendChild(document.createElement("pre"));this.pre.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.pre.className="unwrapped";this.contentElement=this.pre;}','LogEntryUnwrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryUnwrappedElementContainer.prototype.remove=function(){this.doRemove();this.pre=null;};function LogEntryMainElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry nonielogentry "+this.logEntry.level;this.contentElement=this.mainDiv.appendChild(document.createElement("span"));this.contentElement.appendChild(document.createTextNode(this.logEntry.formattedMessage));}',"LogEntryMainElementContainer.prototype=new LogEntryElementContainer();function LogEntry(level,formattedMessage){this.level=level;this.formattedMessage=formattedMessage;this.rendered=false;}",'LogEntry.prototype=new LogItem();copyProperties(LogEntry.prototype,{render:function(){var logEntry=this;var containerDomNode=this.group.contentDiv;if(isIe){this.formattedMessage=this.formattedMessage.replace(/\\r\\n/g,"\\r");this.unwrappedElementContainer=new LogEntryUnwrappedElementContainer(this,this.getUnwrappedDomContainer());this.wrappedElementContainer=new LogEntryWrappedElementContainer(this,this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new LogEntryMainElementContainer(this,this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;},setContent:function(content,wrappedContent){if(content!=this.content){if(isIe&&(content!==this.formattedMessage)){content=content.replace(/\\r\\n/g,"\\r");}',"for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setContent(content,wrappedContent);}",'this.content=content;}},getSearchMatches:function(){var matches=[];var i,len;if(isIe){var unwrappedEls=getElementsByClass(this.unwrappedElementContainer.mainDiv,"searchterm","span");var wrappedEls=getElementsByClass(this.wrappedElementContainer.mainDiv,"searchterm","span");for(i=0,len=unwrappedEls.length;i<len;i++){matches[i]=new Match(this.level,null,unwrappedEls[i],wrappedEls[i]);}}else{var els=getElementsByClass(this.mainElementContainer.mainDiv,"searchterm","span");for(i=0,len=els.length;i<len;i++){matches[i]=new Match(this.level,els[i]);}}',"return matches;},setSearchMatch:function(isMatch){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setSearchMatch(isMatch);}},clearSearch:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clearSearch();}},accept:function(visitor){visitor.visitLogEntry(this);},serialize:function(items){items.push([LogItem.serializedItemKeys.LOG_ENTRY,this.level,this.formattedMessage]);}});function LogItemVisitor(){}","LogItemVisitor.prototype={visit:function(logItem){},visitParent:function(logItem){if(logItem.group){logItem.group.accept(this);}},visitChildren:function(logItem){for(var i=0,len=logItem.children.length;i<len;i++){logItem.children[i].accept(this);}},visitLogEntry:function(logEntry){this.visit(logEntry);},visitSeparator:function(separator){this.visit(separator);},visitGroup:function(group){this.visit(group);}};function GroupFlattener(){this.logEntriesAndSeparators=[];}",'GroupFlattener.prototype=new LogItemVisitor();GroupFlattener.prototype.visitGroup=function(group){this.visitChildren(group);};GroupFlattener.prototype.visitLogEntry=function(logEntry){this.logEntriesAndSeparators.push(logEntry);};GroupFlattener.prototype.visitSeparator=function(separator){this.logEntriesAndSeparators.push(separator);};window.onload=function(){if(location.search){var queryBits=unescape(location.search).substr(1).split("&"),nameValueBits;for(var i=0,len=queryBits.length;i<len;i++){nameValueBits=queryBits[i].split("=");if(nameValueBits[0]=="log4javascript_domain"){document.domain=nameValueBits[1];break;}}}','logMainContainer=$("log");if(isIePre7){addClass(logMainContainer,"oldIe");}','rootGroup=new Group("root",true);rootGroup.render();currentGroup=rootGroup;setCommandInputWidth();setLogContainerHeight();toggleLoggingEnabled();toggleSearchEnabled();toggleSearchFilter();toggleSearchHighlight();applyFilters();checkAllLevels();toggleWrap();toggleNewestAtTop();toggleScrollToLatest();renderQueuedLogItems();loaded=true;$("command").value="";$("command").autocomplete="off";$("command").onkeydown=function(evt){evt=getEvent(evt);if(evt.keyCode==10||evt.keyCode==13){evalCommandLine();stopPropagation(evt);}else if(evt.keyCode==27){this.value="";this.focus();}else if(evt.keyCode==38&&commandHistory.length>0){currentCommandIndex=Math.max(0,currentCommandIndex-1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}else if(evt.keyCode==40&&commandHistory.length>0){currentCommandIndex=Math.min(commandHistory.length-1,currentCommandIndex+1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}};$("command").onkeypress=function(evt){evt=getEvent(evt);if(evt.keyCode==38&&commandHistory.length>0&&evt.preventDefault){evt.preventDefault();}};$("command").onkeyup=function(evt){evt=getEvent(evt);if(evt.keyCode==27&&evt.preventDefault){evt.preventDefault();this.focus();}};document.onkeydown=function keyEventHandler(evt){evt=getEvent(evt);switch(evt.keyCode){case 69:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){evalLastCommand();cancelKeyEvent(evt);return false;}',"break;case 75:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusSearch();cancelKeyEvent(evt);return false;}","break;case 40:case 76:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusCommandLine();cancelKeyEvent(evt);return false;}","break;}};setTimeout(setLogContainerHeight,20);setShowCommandLine(showCommandLine);doSearch();};window.onunload=function(){if(mainWindowExists()){appender.unload();}",'appender=null;};function toggleLoggingEnabled(){setLoggingEnabled($("enableLogging").checked);}',"function setLoggingEnabled(enable){loggingEnabled=enable;}","var appender=null;function setAppender(appenderParam){appender=appenderParam;}",'function setShowCloseButton(showCloseButton){$("closeButton").style.display=showCloseButton?"inline":"none";}','function setShowHideButton(showHideButton){$("hideButton").style.display=showHideButton?"inline":"none";}',"var newestAtTop=false;function LogItemContentReverser(){}","LogItemContentReverser.prototype=new LogItemVisitor();LogItemContentReverser.prototype.visitGroup=function(group){group.reverseChildren();this.visitChildren(group);};function setNewestAtTop(isNewestAtTop){var oldNewestAtTop=newestAtTop;var i,iLen,j,jLen;newestAtTop=Boolean(isNewestAtTop);if(oldNewestAtTop!=newestAtTop){var visitor=new LogItemContentReverser();rootGroup.accept(visitor);if(currentSearch){var currentMatch=currentSearch.matches[currentMatchIndex];var matchIndex=0;var matches=[];var actOnLogEntry=function(logEntry){var logEntryMatches=logEntry.getSearchMatches();for(j=0,jLen=logEntryMatches.length;j<jLen;j++){matches[matchIndex]=logEntryMatches[j];if(currentMatch&&logEntryMatches[j].equals(currentMatch)){currentMatchIndex=matchIndex;}","matchIndex++;}};if(newestAtTop){for(i=logEntries.length-1;i>=0;i--){actOnLogEntry(logEntries[i]);}}else{for(i=0,iLen=logEntries.length;i<iLen;i++){actOnLogEntry(logEntries[i]);}}","currentSearch.matches=matches;if(currentMatch){currentMatch.setCurrent();}}else if(scrollToLatest){doScrollToLatest();}}",'$("newestAtTop").checked=isNewestAtTop;}','function toggleNewestAtTop(){var isNewestAtTop=$("newestAtTop").checked;setNewestAtTop(isNewestAtTop);}',"var scrollToLatest=true;function setScrollToLatest(isScrollToLatest){scrollToLatest=isScrollToLatest;if(scrollToLatest){doScrollToLatest();}",'$("scrollToLatest").checked=isScrollToLatest;}','function toggleScrollToLatest(){var isScrollToLatest=$("scrollToLatest").checked;setScrollToLatest(isScrollToLatest);}','function doScrollToLatest(){var l=logMainContainer;if(typeof l.scrollTop!="undefined"){if(newestAtTop){l.scrollTop=0;}else{var latestLogEntry=l.lastChild;if(latestLogEntry){l.scrollTop=l.scrollHeight;}}}}',"var closeIfOpenerCloses=true;function setCloseIfOpenerCloses(isCloseIfOpenerCloses){closeIfOpenerCloses=isCloseIfOpenerCloses;}","var maxMessages=null;function setMaxMessages(max){maxMessages=max;pruneLogEntries();}",'var showCommandLine=false;function setShowCommandLine(isShowCommandLine){showCommandLine=isShowCommandLine;if(loaded){$("commandLine").style.display=showCommandLine?"block":"none";setCommandInputWidth();setLogContainerHeight();}}','function focusCommandLine(){if(loaded){$("command").focus();}}','function focusSearch(){if(loaded){$("searchBox").focus();}}',"function getLogItems(){var items=[];for(var i=0,len=logItems.length;i<len;i++){logItems[i].serialize(items);}","return items;}","function setLogItems(items){var loggingReallyEnabled=loggingEnabled;loggingEnabled=true;for(var i=0,len=items.length;i<len;i++){switch(items[i][0]){case LogItem.serializedItemKeys.LOG_ENTRY:log(items[i][1],items[i][2]);break;case LogItem.serializedItemKeys.GROUP_START:group(items[i][1]);break;case LogItem.serializedItemKeys.GROUP_END:groupEnd();break;}}","loggingEnabled=loggingReallyEnabled;}","function log(logLevel,formattedMessage){if(loggingEnabled){var logEntry=new LogEntry(logLevel,formattedMessage);logEntries.push(logEntry);logEntriesAndSeparators.push(logEntry);logItems.push(logEntry);currentGroup.addChild(logEntry);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}","logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function renderQueuedLogItems(){logQueuedEventsTimer=null;var pruned=pruneLogEntries();var initiallyHasMatches=currentSearch?currentSearch.hasMatches():false;for(var i=0,len=logItems.length;i<len;i++){if(!logItems[i].rendered){logItems[i].render();logItems[i].appendToLog();if(currentSearch&&(logItems[i]instanceof LogEntry)){currentSearch.applyTo(logItems[i]);}}}","if(currentSearch){if(pruned){if(currentSearch.hasVisibleMatches()){if(currentMatchIndex===null){setCurrentMatchIndex(0);}","displayMatches();}else{displayNoMatches();}}else if(!initiallyHasMatches&¤tSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}}","if(scrollToLatest){doScrollToLatest();}","unrenderedLogItemsExist=false;}","function pruneLogEntries(){if((maxMessages!==null)&&(logEntriesAndSeparators.length>maxMessages)){var numberToDelete=logEntriesAndSeparators.length-maxMessages;var prunedLogEntries=logEntriesAndSeparators.slice(0,numberToDelete);if(currentSearch){currentSearch.removeMatches(prunedLogEntries);}","var group;for(var i=0;i<numberToDelete;i++){group=logEntriesAndSeparators[i].group;array_remove(logItems,logEntriesAndSeparators[i]);array_remove(logEntries,logEntriesAndSeparators[i]);logEntriesAndSeparators[i].remove(true,true);if(group.children.length===0&&group!==currentGroup&&group!==rootGroup){array_remove(logItems,group);group.remove(true,true);}}","logEntriesAndSeparators=array_removeFromStart(logEntriesAndSeparators,numberToDelete);return true;}","return false;}",'function group(name,startExpanded){if(loggingEnabled){initiallyExpanded=(typeof startExpanded==="undefined")?true:Boolean(startExpanded);var newGroup=new Group(name,false,initiallyExpanded);currentGroup.addChild(newGroup);currentGroup=newGroup;logItems.push(newGroup);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}',"logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function groupEnd(){currentGroup=(currentGroup===rootGroup)?rootGroup:currentGroup.group;}","function mainPageReloaded(){currentGroup=rootGroup;var separator=new Separator();logEntriesAndSeparators.push(separator);logItems.push(separator);currentGroup.addChild(separator);}","function closeWindow(){if(appender&&mainWindowExists()){appender.close(true);}else{window.close();}}","function hide(){if(appender&&mainWindowExists()){appender.hide();}}",'var mainWindow=window;var windowId="log4javascriptConsoleWindow_"+new Date().getTime()+"_"+(""+Math.random()).substr(2);function setMainWindow(win){mainWindow=win;mainWindow[windowId]=window;if(opener&&closeIfOpenerCloses){pollOpener();}}',"function pollOpener(){if(closeIfOpenerCloses){if(mainWindowExists()){setTimeout(pollOpener,500);}else{closeWindow();}}}","function mainWindowExists(){try{return(mainWindow&&!mainWindow.closed&&mainWindow[windowId]==window);}catch(ex){}","return false;}",'var logLevels=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function getCheckBox(logLevel){return $("switch_"+logLevel);}','function getIeWrappedLogContainer(){return $("log_wrapped");}','function getIeUnwrappedLogContainer(){return $("log_unwrapped");}',"function applyFilters(){for(var i=0;i<logLevels.length;i++){if(getCheckBox(logLevels[i]).checked){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}","updateSearchFromFilters();}",'function toggleAllLevels(){var turnOn=$("switch_ALL").checked;for(var i=0;i<logLevels.length;i++){getCheckBox(logLevels[i]).checked=turnOn;if(turnOn){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}}','function checkAllLevels(){for(var i=0;i<logLevels.length;i++){if(!getCheckBox(logLevels[i]).checked){getCheckBox("ALL").checked=false;return;}}','getCheckBox("ALL").checked=true;}',"function clearLog(){rootGroup.clear();currentGroup=rootGroup;logEntries=[];logItems=[];logEntriesAndSeparators=[];doSearch();}",'function toggleWrap(){var enable=$("wrap").checked;if(enable){addClass(logMainContainer,"wrap");}else{removeClass(logMainContainer,"wrap");}',"refreshCurrentMatch();}","var searchTimer=null;function scheduleSearch(){try{clearTimeout(searchTimer);}catch(ex){}","searchTimer=setTimeout(doSearch,500);}","function Search(searchTerm,isRegex,searchRegex,isCaseSensitive){this.searchTerm=searchTerm;this.isRegex=isRegex;this.searchRegex=searchRegex;this.isCaseSensitive=isCaseSensitive;this.matches=[];}","Search.prototype={hasMatches:function(){return this.matches.length>0;},hasVisibleMatches:function(){if(this.hasMatches()){for(var i=0;i<this.matches.length;i++){if(this.matches[i].isVisible()){return true;}}}","return false;},match:function(logEntry){var entryText=String(logEntry.formattedMessage);var matchesSearch=false;if(this.isRegex){matchesSearch=this.searchRegex.test(entryText);}else if(this.isCaseSensitive){matchesSearch=(entryText.indexOf(this.searchTerm)>-1);}else{matchesSearch=(entryText.toLowerCase().indexOf(this.searchTerm.toLowerCase())>-1);}","return matchesSearch;},getNextVisibleMatchIndex:function(){for(var i=currentMatchIndex+1;i<this.matches.length;i++){if(this.matches[i].isVisible()){return i;}}","for(i=0;i<=currentMatchIndex;i++){if(this.matches[i].isVisible()){return i;}}","return-1;},getPreviousVisibleMatchIndex:function(){for(var i=currentMatchIndex-1;i>=0;i--){if(this.matches[i].isVisible()){return i;}}","for(var i=this.matches.length-1;i>=currentMatchIndex;i--){if(this.matches[i].isVisible()){return i;}}",'return-1;},applyTo:function(logEntry){var doesMatch=this.match(logEntry);if(doesMatch){logEntry.group.expand();logEntry.setSearchMatch(true);var logEntryContent;var wrappedLogEntryContent;var searchTermReplacementStartTag="<span class=\\"searchterm\\">";var searchTermReplacementEndTag="<"+"/span>";var preTagName=isIe?"pre":"span";var preStartTag="<"+preTagName+" class=\\"pre\\">";var preEndTag="<"+"/"+preTagName+">";var startIndex=0;var searchIndex,matchedText,textBeforeMatch;if(this.isRegex){var flags=this.isCaseSensitive?"g":"gi";var capturingRegex=new RegExp("("+this.searchRegex.source+")",flags);var rnd=(""+Math.random()).substr(2);var startToken="%%s"+rnd+"%%";var endToken="%%e"+rnd+"%%";logEntryContent=logEntry.formattedMessage.replace(capturingRegex,startToken+"$1"+endToken);logEntryContent=escapeHtml(logEntryContent);var result;var searchString=logEntryContent;logEntryContent="";wrappedLogEntryContent="";while((searchIndex=searchString.indexOf(startToken,startIndex))>-1){var endTokenIndex=searchString.indexOf(endToken,searchIndex);matchedText=searchString.substring(searchIndex+startToken.length,endTokenIndex);textBeforeMatch=searchString.substring(startIndex,searchIndex);logEntryContent+=preStartTag+textBeforeMatch+preEndTag;logEntryContent+=searchTermReplacementStartTag+preStartTag+matchedText+',"preEndTag+searchTermReplacementEndTag;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=endTokenIndex+endToken.length;}",'logEntryContent+=preStartTag+searchString.substr(startIndex)+preEndTag;if(isIe){wrappedLogEntryContent+=searchString.substr(startIndex);}}else{logEntryContent="";wrappedLogEntryContent="";var searchTermReplacementLength=searchTermReplacementStartTag.length+',"this.searchTerm.length+searchTermReplacementEndTag.length;var searchTermLength=this.searchTerm.length;var searchTermLowerCase=this.searchTerm.toLowerCase();var logTextLowerCase=logEntry.formattedMessage.toLowerCase();while((searchIndex=logTextLowerCase.indexOf(searchTermLowerCase,startIndex))>-1){matchedText=escapeHtml(logEntry.formattedMessage.substr(searchIndex,this.searchTerm.length));textBeforeMatch=escapeHtml(logEntry.formattedMessage.substring(startIndex,searchIndex));var searchTermReplacement=searchTermReplacementStartTag+","preStartTag+matchedText+preEndTag+searchTermReplacementEndTag;logEntryContent+=preStartTag+textBeforeMatch+preEndTag+searchTermReplacement;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=searchIndex+searchTermLength;}","var textAfterLastMatch=escapeHtml(logEntry.formattedMessage.substr(startIndex));logEntryContent+=preStartTag+textAfterLastMatch+preEndTag;if(isIe){wrappedLogEntryContent+=textAfterLastMatch;}}","logEntry.setContent(logEntryContent,wrappedLogEntryContent);var logEntryMatches=logEntry.getSearchMatches();this.matches=this.matches.concat(logEntryMatches);}else{logEntry.setSearchMatch(false);logEntry.setContent(logEntry.formattedMessage,logEntry.formattedMessage);}","return doesMatch;},removeMatches:function(logEntries){var matchesToRemoveCount=0;var currentMatchRemoved=false;var matchesToRemove=[];var i,iLen,j,jLen;for(i=0,iLen=this.matches.length;i<iLen;i++){for(j=0,jLen=logEntries.length;j<jLen;j++){if(this.matches[i].belongsTo(logEntries[j])){matchesToRemove.push(this.matches[i]);if(i===currentMatchIndex){currentMatchRemoved=true;}}}}","var newMatch=currentMatchRemoved?null:this.matches[currentMatchIndex];if(currentMatchRemoved){for(i=currentMatchIndex,iLen=this.matches.length;i<iLen;i++){if(this.matches[i].isVisible()&&!array_contains(matchesToRemove,this.matches[i])){newMatch=this.matches[i];break;}}}","for(i=0,iLen=matchesToRemove.length;i<iLen;i++){array_remove(this.matches,matchesToRemove[i]);matchesToRemove[i].remove();}","if(this.hasVisibleMatches()){if(newMatch===null){setCurrentMatchIndex(0);}else{var newMatchIndex=0;for(i=0,iLen=this.matches.length;i<iLen;i++){if(newMatch===this.matches[i]){newMatchIndex=i;break;}}","setCurrentMatchIndex(newMatchIndex);}}else{currentMatchIndex=null;displayNoMatches();}}};function getPageOffsetTop(el,container){var currentEl=el;var y=0;while(currentEl&¤tEl!=container){y+=currentEl.offsetTop;currentEl=currentEl.offsetParent;}","return y;}",'function scrollIntoView(el){var logContainer=logMainContainer;if(!$("wrap").checked){var logContainerLeft=logContainer.scrollLeft;var logContainerRight=logContainerLeft+logContainer.offsetWidth;var elLeft=el.offsetLeft;var elRight=elLeft+el.offsetWidth;if(elLeft<logContainerLeft||elRight>logContainerRight){logContainer.scrollLeft=elLeft-(logContainer.offsetWidth-el.offsetWidth)/2;}}',"var logContainerTop=logContainer.scrollTop;var logContainerBottom=logContainerTop+logContainer.offsetHeight;var elTop=getPageOffsetTop(el)-getToolBarsHeight();var elBottom=elTop+el.offsetHeight;if(elTop<logContainerTop||elBottom>logContainerBottom){logContainer.scrollTop=elTop-(logContainer.offsetHeight-el.offsetHeight)/2;}}","function Match(logEntryLevel,spanInMainDiv,spanInUnwrappedPre,spanInWrappedDiv){this.logEntryLevel=logEntryLevel;this.spanInMainDiv=spanInMainDiv;if(isIe){this.spanInUnwrappedPre=spanInUnwrappedPre;this.spanInWrappedDiv=spanInWrappedDiv;}","this.mainSpan=isIe?spanInUnwrappedPre:spanInMainDiv;}",'Match.prototype={equals:function(match){return this.mainSpan===match.mainSpan;},setCurrent:function(){if(isIe){addClass(this.spanInUnwrappedPre,"currentmatch");addClass(this.spanInWrappedDiv,"currentmatch");var elementToScroll=$("wrap").checked?this.spanInWrappedDiv:this.spanInUnwrappedPre;scrollIntoView(elementToScroll);}else{addClass(this.spanInMainDiv,"currentmatch");scrollIntoView(this.spanInMainDiv);}},belongsTo:function(logEntry){if(isIe){return isDescendant(this.spanInUnwrappedPre,logEntry.unwrappedPre);}else{return isDescendant(this.spanInMainDiv,logEntry.mainDiv);}},setNotCurrent:function(){if(isIe){removeClass(this.spanInUnwrappedPre,"currentmatch");removeClass(this.spanInWrappedDiv,"currentmatch");}else{removeClass(this.spanInMainDiv,"currentmatch");}},isOrphan:function(){return isOrphan(this.mainSpan);},isVisible:function(){return getCheckBox(this.logEntryLevel).checked;},remove:function(){if(isIe){this.spanInUnwrappedPre=null;this.spanInWrappedDiv=null;}else{this.spanInMainDiv=null;}}};var currentSearch=null;var currentMatchIndex=null;function doSearch(){var searchBox=$("searchBox");var searchTerm=searchBox.value;var isRegex=$("searchRegex").checked;var isCaseSensitive=$("searchCaseSensitive").checked;var i;if(searchTerm===""){$("searchReset").disabled=true;$("searchNav").style.display="none";removeClass(document.body,"searching");removeClass(searchBox,"hasmatches");removeClass(searchBox,"nomatches");for(i=0;i<logEntries.length;i++){logEntries[i].clearSearch();logEntries[i].setContent(logEntries[i].formattedMessage,logEntries[i].formattedMessage);}','currentSearch=null;setLogContainerHeight();}else{$("searchReset").disabled=false;$("searchNav").style.display="block";var searchRegex;var regexValid;if(isRegex){try{searchRegex=isCaseSensitive?new RegExp(searchTerm,"g"):new RegExp(searchTerm,"gi");regexValid=true;replaceClass(searchBox,"validregex","invalidregex");searchBox.title="Valid regex";}catch(ex){regexValid=false;replaceClass(searchBox,"invalidregex","validregex");searchBox.title="Invalid regex: "+(ex.message?ex.message:(ex.description?ex.description:"unknown error"));return;}}else{searchBox.title="";removeClass(searchBox,"validregex");removeClass(searchBox,"invalidregex");}','addClass(document.body,"searching");currentSearch=new Search(searchTerm,isRegex,searchRegex,isCaseSensitive);for(i=0;i<logEntries.length;i++){currentSearch.applyTo(logEntries[i]);}',"setLogContainerHeight();if(currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}else{displayNoMatches();}}}","function updateSearchFromFilters(){if(currentSearch){if(currentSearch.hasMatches()){if(currentMatchIndex===null){currentMatchIndex=0;}","var currentMatch=currentSearch.matches[currentMatchIndex];if(currentMatch.isVisible()){displayMatches();setCurrentMatchIndex(currentMatchIndex);}else{currentMatch.setNotCurrent();var nextVisibleMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextVisibleMatchIndex>-1){setCurrentMatchIndex(nextVisibleMatchIndex);displayMatches();}else{displayNoMatches();}}}else{displayNoMatches();}}}","function refreshCurrentMatch(){if(currentSearch&¤tSearch.hasVisibleMatches()){setCurrentMatchIndex(currentMatchIndex);}}",'function displayMatches(){replaceClass($("searchBox"),"hasmatches","nomatches");$("searchBox").title=""+currentSearch.matches.length+" matches found";$("searchNav").style.display="block";setLogContainerHeight();}','function displayNoMatches(){replaceClass($("searchBox"),"nomatches","hasmatches");$("searchBox").title="No matches found";$("searchNav").style.display="none";setLogContainerHeight();}','function toggleSearchEnabled(enable){enable=(typeof enable=="undefined")?!$("searchDisable").checked:enable;$("searchBox").disabled=!enable;$("searchReset").disabled=!enable;$("searchRegex").disabled=!enable;$("searchNext").disabled=!enable;$("searchPrevious").disabled=!enable;$("searchCaseSensitive").disabled=!enable;$("searchNav").style.display=(enable&&($("searchBox").value!=="")&¤tSearch&¤tSearch.hasVisibleMatches())?"block":"none";if(enable){removeClass($("search"),"greyedout");addClass(document.body,"searching");if($("searchHighlight").checked){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}','if($("searchFilter").checked){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','$("searchDisable").checked=!enable;}else{addClass($("search"),"greyedout");removeClass(document.body,"searching");removeClass(logMainContainer,"searchhighlight");removeClass(logMainContainer,"searchfilter");}',"setLogContainerHeight();}",'function toggleSearchFilter(){var enable=$("searchFilter").checked;if(enable){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}',"refreshCurrentMatch();}",'function toggleSearchHighlight(){var enable=$("searchHighlight").checked;if(enable){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}}','function clearSearch(){$("searchBox").value="";doSearch();}','function searchNext(){if(currentSearch!==null&¤tMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var nextMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextMatchIndex>currentMatchIndex||confirm("Reached the end of the page. Start from the top?")){setCurrentMatchIndex(nextMatchIndex);}}}','function searchPrevious(){if(currentSearch!==null&¤tMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var previousMatchIndex=currentSearch.getPreviousVisibleMatchIndex();if(previousMatchIndex<currentMatchIndex||confirm("Reached the start of the page. Continue from the bottom?")){setCurrentMatchIndex(previousMatchIndex);}}}',"function setCurrentMatchIndex(index){currentMatchIndex=index;currentSearch.matches[currentMatchIndex].setCurrent();}",'function addClass(el,cssClass){if(!hasClass(el,cssClass)){if(el.className){el.className+=" "+cssClass;}else{el.className=cssClass;}}}','function hasClass(el,cssClass){if(el.className){var classNames=el.className.split(" ");return array_contains(classNames,cssClass);}',"return false;}",'function removeClass(el,cssClass){if(hasClass(el,cssClass)){var existingClasses=el.className.split(" ");var newClasses=[];for(var i=0,len=existingClasses.length;i<len;i++){if(existingClasses[i]!=cssClass){newClasses[newClasses.length]=existingClasses[i];}}','el.className=newClasses.join(" ");}}',"function replaceClass(el,newCssClass,oldCssClass){removeClass(el,oldCssClass);addClass(el,newCssClass);}","function getElementsByClass(el,cssClass,tagName){var elements=el.getElementsByTagName(tagName);var matches=[];for(var i=0,len=elements.length;i<len;i++){if(hasClass(elements[i],cssClass)){matches.push(elements[i]);}}","return matches;}","function $(id){return document.getElementById(id);}","function isDescendant(node,ancestorNode){while(node!=null){if(node===ancestorNode){return true;}","node=node.parentNode;}","return false;}","function isOrphan(node){var currentNode=node;while(currentNode){if(currentNode==document.body){return false;}","currentNode=currentNode.parentNode;}","return true;}",'function escapeHtml(str){return str.replace(/&/g,"&").replace(/[<]/g,"<").replace(/>/g,">");}',"function getWindowWidth(){if(window.innerWidth){return window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth;}else if(document.body){return document.body.clientWidth;}","return 0;}","function getWindowHeight(){if(window.innerHeight){return window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}","return 0;}",'function getToolBarsHeight(){return $("switches").offsetHeight;}','function getChromeHeight(){var height=getToolBarsHeight();if(showCommandLine){height+=$("commandLine").offsetHeight;}',"return height;}",'function setLogContainerHeight(){if(logMainContainer){var windowHeight=getWindowHeight();$("body").style.height=getWindowHeight()+"px";logMainContainer.style.height=""+','Math.max(0,windowHeight-getChromeHeight())+"px";}}','function setCommandInputWidth(){if(showCommandLine){$("command").style.width=""+Math.max(0,$("commandLineContainer").offsetWidth-','($("evaluateButton").offsetWidth+13))+"px";}}',"window.onresize=function(){setCommandInputWidth();setLogContainerHeight();};if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];}","return this.length;};}","if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length>0){var val=this[this.length-1];this.length=this.length-1;return val;}};}","if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];}","this.length=this.length-1;return firstItem;}};}","if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];}","var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);}","return itemsDeleted;};}","function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}}","if(index>=0){arr.splice(index,1);return index;}else{return false;}}","function array_removeFromStart(array,numberToRemove){if(Array.prototype.splice){array.splice(0,numberToRemove);}else{for(var i=numberToRemove,len=array.length;i<len;i++){array[i-numberToRemove]=array[i];}","array.length=array.length-numberToRemove;}","return array;}","function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}}","return false;}","function getErrorMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}",'return""+ex;}',"function moveCaretToEnd(input){if(input.setSelectionRange){input.focus();var length=input.value.length;input.setSelectionRange(length,length);}else if(input.createTextRange){var range=input.createTextRange();range.collapse(false);range.select();}","input.focus();}",'function stopPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;}}',"function getEvent(evt){return evt?evt:event;}","function getTarget(evt){return evt.target?evt.target:evt.srcElement;}",'function getRelatedTarget(evt){if(evt.relatedTarget){return evt.relatedTarget;}else if(evt.srcElement){switch(evt.type){case"mouseover":return evt.fromElement;case"mouseout":return evt.toElement;default:return evt.srcElement;}}}',"function cancelKeyEvent(evt){evt.returnValue=false;stopPropagation(evt);}",'function evalCommandLine(){var expr=$("command").value;evalCommand(expr);$("command").value="";}',"function evalLastCommand(){if(lastCommand!=null){evalCommand(lastCommand);}}",'var lastCommand=null;var commandHistory=[];var currentCommandIndex=0;function evalCommand(expr){if(appender){appender.evalCommandAndAppend(expr);}else{var prefix=">>> "+expr+"\\r\\n";try{log("INFO",prefix+eval(expr));}catch(ex){log("ERROR",prefix+"Error: "+getErrorMessage(ex));}}',"if(expr!=commandHistory[commandHistory.length-1]){commandHistory.push(expr);if(appender){appender.storeCommandHistory(commandHistory);}}","currentCommandIndex=(expr==commandHistory[currentCommandIndex])?currentCommandIndex+1:commandHistory.length;lastCommand=expr;}","//]]>","</script>",'<style type="text/css">',"body{background-color:white;color:black;padding:0;margin:0;font-family:tahoma,verdana,arial,helvetica,sans-serif;overflow:hidden}div#switchesContainer input{margin-bottom:0}div.toolbar{border-top:solid #ffffff 1px;border-bottom:solid #aca899 1px;background-color:#f1efe7;padding:3px 5px;font-size:68.75%}div.toolbar,div#search input{font-family:tahoma,verdana,arial,helvetica,sans-serif}div.toolbar input.button{padding:0 5px;font-size:100%}div.toolbar input.hidden{display:none}div#switches input#clearButton{margin-left:20px}div#levels label{font-weight:bold}div#levels label,div#options label{margin-right:5px}div#levels label#wrapLabel{font-weight:normal}div#search label{margin-right:10px}div#search label.searchboxlabel{margin-right:0}div#search input{font-size:100%}div#search input.validregex{color:green}div#search input.invalidregex{color:red}div#search input.nomatches{color:white;background-color:#ff6666}div#search input.nomatches{color:white;background-color:#ff6666}div#searchNav{display:none}div#commandLine{display:none}div#commandLine input#command{font-size:100%;font-family:Courier New,Courier}div#commandLine input#evaluateButton{}*.greyedout{color:gray !important;border-color:gray !important}*.greyedout *.alwaysenabled{color:black}*.unselectable{-khtml-user-select:none;-moz-user-select:none;user-select:none}div#log{font-family:Courier New,Courier;font-size:75%;width:100%;overflow:auto;clear:both;position:relative}div.group{border-color:#cccccc;border-style:solid;border-width:1px 0 1px 1px;overflow:visible}div.oldIe div.group,div.oldIe div.group *,div.oldIe *.logentry{height:1%}div.group div.groupheading span.expander{border:solid black 1px;font-family:Courier New,Courier;font-size:0.833em;background-color:#eeeeee;position:relative;top:-1px;color:black;padding:0 2px;cursor:pointer;cursor:hand;height:1%}div.group div.groupcontent{margin-left:10px;padding-bottom:2px;overflow:visible}div.group div.expanded{display:block}div.group div.collapsed{display:none}*.logentry{overflow:visible;display:none;white-space:pre}span.pre{white-space:pre}pre.unwrapped{display:inline !important}pre.unwrapped pre.pre,div.wrapped pre.pre{display:inline}div.wrapped pre.pre{white-space:normal}div.wrapped{display:none}body.searching *.logentry span.currentmatch{color:white !important;background-color:green !important}body.searching div.searchhighlight *.logentry span.searchterm{color:black;background-color:yellow}div.wrap *.logentry{white-space:normal !important;border-width:0 0 1px 0;border-color:#dddddd;border-style:dotted}div.wrap #log_wrapped,#log_unwrapped{display:block}div.wrap #log_unwrapped,#log_wrapped{display:none}div.wrap *.logentry span.pre{overflow:visible;white-space:normal}div.wrap *.logentry pre.unwrapped{display:none}div.wrap *.logentry span.wrapped{display:inline}div.searchfilter *.searchnonmatch{display:none !important}div#log *.TRACE,label#label_TRACE{color:#666666}div#log *.DEBUG,label#label_DEBUG{color:green}div#log *.INFO,label#label_INFO{color:#000099}div#log *.WARN,label#label_WARN{color:#999900}div#log *.ERROR,label#label_ERROR{color:red}div#log *.FATAL,label#label_FATAL{color:#660066}div.TRACE#log *.TRACE,div.DEBUG#log *.DEBUG,div.INFO#log *.INFO,div.WARN#log *.WARN,div.ERROR#log *.ERROR,div.FATAL#log *.FATAL{display:block}div#log div.separator{background-color:#cccccc;margin:5px 0;line-height:1px}","</style>","</head>",'<body id="body">','<div id="switchesContainer">','<div id="switches">','<div id="levels" class="toolbar">',"Filters:",'<input type="checkbox" id="switch_TRACE" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide trace messages" /><label for="switch_TRACE" id="label_TRACE">trace</label>','<input type="checkbox" id="switch_DEBUG" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide debug messages" /><label for="switch_DEBUG" id="label_DEBUG">debug</label>','<input type="checkbox" id="switch_INFO" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide info messages" /><label for="switch_INFO" id="label_INFO">info</label>','<input type="checkbox" id="switch_WARN" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide warn messages" /><label for="switch_WARN" id="label_WARN">warn</label>','<input type="checkbox" id="switch_ERROR" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide error messages" /><label for="switch_ERROR" id="label_ERROR">error</label>','<input type="checkbox" id="switch_FATAL" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide fatal messages" /><label for="switch_FATAL" id="label_FATAL">fatal</label>','<input type="checkbox" id="switch_ALL" onclick="toggleAllLevels(); applyFilters()" checked="checked" title="Show/hide all messages" /><label for="switch_ALL" id="label_ALL">all</label>',"</div>",'<div id="search" class="toolbar">','<label for="searchBox" class="searchboxlabel">Search:</label> <input type="text" id="searchBox" onclick="toggleSearchEnabled(true)" onkeyup="scheduleSearch()" size="20" />','<input type="button" id="searchReset" disabled="disabled" value="Reset" onclick="clearSearch()" class="button" title="Reset the search" />','<input type="checkbox" id="searchRegex" onclick="doSearch()" title="If checked, search is treated as a regular expression" /><label for="searchRegex">Regex</label>','<input type="checkbox" id="searchCaseSensitive" onclick="doSearch()" title="If checked, search is case sensitive" /><label for="searchCaseSensitive">Match case</label>','<input type="checkbox" id="searchDisable" onclick="toggleSearchEnabled()" title="Enable/disable search" /><label for="searchDisable" class="alwaysenabled">Disable</label>','<div id="searchNav">','<input type="button" id="searchNext" disabled="disabled" value="Next" onclick="searchNext()" class="button" title="Go to the next matching log entry" />','<input type="button" id="searchPrevious" disabled="disabled" value="Previous" onclick="searchPrevious()" class="button" title="Go to the previous matching log entry" />','<input type="checkbox" id="searchFilter" onclick="toggleSearchFilter()" title="If checked, non-matching log entries are filtered out" /><label for="searchFilter">Filter</label>','<input type="checkbox" id="searchHighlight" onclick="toggleSearchHighlight()" title="Highlight matched search terms" /><label for="searchHighlight" class="alwaysenabled">Highlight all</label>',"</div>","</div>",'<div id="options" class="toolbar">',"Options:",'<input type="checkbox" id="enableLogging" onclick="toggleLoggingEnabled()" checked="checked" title="Enable/disable logging" /><label for="enableLogging" id="enableLoggingLabel">Log</label>','<input type="checkbox" id="wrap" onclick="toggleWrap()" title="Enable / disable word wrap" /><label for="wrap" id="wrapLabel">Wrap</label>','<input type="checkbox" id="newestAtTop" onclick="toggleNewestAtTop()" title="If checked, causes newest messages to appear at the top" /><label for="newestAtTop" id="newestAtTopLabel">Newest at the top</label>','<input type="checkbox" id="scrollToLatest" onclick="toggleScrollToLatest()" checked="checked" title="If checked, window automatically scrolls to a new message when it is added" /><label for="scrollToLatest" id="scrollToLatestLabel">Scroll to latest</label>','<input type="button" id="clearButton" value="Clear" onclick="clearLog()" class="button" title="Clear all log messages" />','<input type="button" id="hideButton" value="Hide" onclick="hide()" class="hidden button" title="Hide the console" />','<input type="button" id="closeButton" value="Close" onclick="closeWindow()" class="hidden button" title="Close the window" />',"</div>","</div>","</div>",'<div id="log" class="TRACE DEBUG INFO WARN ERROR FATAL"></div>','<div id="commandLine" class="toolbar">','<div id="commandLineContainer">','<input type="text" id="command" title="Enter a JavaScript command here and hit return or press \'Evaluate\'" />','<input type="button" id="evaluateButton" value="Evaluate" class="button" title="Evaluate the command" onclick="evalCommandLine()" />',"</div>","</div>","</body>","</html>",""];e.open();for(var r=0,n=t.length;r<n;r++)e.writeln(t[r]);e.close()};this.setEventTypes(["load","unload"]);var j=function(){var e=T();e.setAppender(u),e.setNewestAtTop(y),e.setScrollToLatest(b),e.setMaxMessages(x),e.setShowCommandLine(A),e.setShowHideButton(R),e.setShowCloseButton(D),e.setMainWindow(window);var t=getCookie(z);t&&(e.commandHistory=t.split(","),e.currentCommandIndex=e.commandHistory.length),u.dispatchEvent("load",{win:e})};this.unload=function(){logLog.debug("unload "+this+", caller: "+this.unload.caller),f||(logLog.debug("really doing unload "+this),f=!0,p=!1,h=!1,u.dispatchEvent("unload",{}))};var G=function(e,t,r,n){var i=setInterval((function(){try{f&&clearInterval(i),e(T())&&(clearInterval(i),r())}catch(t){clearInterval(i),g=!1,handleError(n,t)}}),t)},W=function(){var e=document.domain!=location.hostname;return o?"":getBaseUrl()+"console.html"+(e?"?log4javascript_domain="+escape(document.domain):"")};if(r){var q=null,X=[];this.addCssProperty=function(e,t){I("cssProperties")&&X.push([e,t])};var K,Y=!1,J=uniqueId+"_InPageAppender_"+_;this.hide=function(){d&&h&&(k()&&T().$("command").blur(),K.style.display="none",M=!0)},this.show=function(){d&&(h?(K.style.display="block",this.setShowCommandLine(A),M=!1):Y||S(!0))},this.isVisible=function(){return!M&&!f},this.close=function(e){f||e&&!confirm("This will permanently remove the console from the page. No more messages will be logged. Do you wish to continue?")||(K.parentNode.removeChild(K),this.unload())},E=function(){var e="InPageAppender.open: unable to create console iframe";function t(){try{a||u.show(),j(),p=!0,L()}catch(t){g=!1,handleError(e,t)}}function r(){try{var r=function(e){return isLoaded(e)};o&&H(T().document),r(T())?t():G(r,100,t,e)}catch(n){g=!1,handleError(e,n)}}M=!1,(K=q.appendChild(document.createElement("div"))).style.width=s,K.style.height=l,K.style.border="solid gray 1px";for(var n=0,i=X.length;n<i;n++)K.style[X[n][0]]=X[n][1];var c=o?"":" src='"+W()+"'";K.innerHTML="<iframe id='"+J+"' name='"+J+"' width='100%' height='100%' frameborder='0'"+c+" scrolling='no'></iframe>",f=!1;var d=function(e){try{return bool(e)&&bool(e.document)}catch(t){return!1}};d(T())?r():G(d,100,r,e),h=!0},S=function(e){if(e||!a){var t=function(){if(n)try{var e=document.getElementById(n);1==e.nodeType&&(q=e),E()}catch(t){handleError("InPageAppender.init: invalid container element '"+n+"' supplied",t)}else(q=document.createElement("div")).style.position="fixed",q.style.left="0",q.style.right="0",q.style.bottom="0",document.body.appendChild(q),u.addCssProperty("borderWidth","1px 0 0 0"),u.addCssProperty("zIndex",1e6),E()};pageLoaded&&n&&n.appendChild?(q=n,E()):pageLoaded?t():log4javascript.addEventListener("load",t),Y=!0}},v=function(){S(),d=!0},T=function(){var e=window.frames[J];if(e)return e},w=function(){return!(!g||f)&&(h&&!p&&T()&&isLoaded(T())&&(p=!0),p)}}else{var Z,Q=u.defaults.useOldPopUp,ee=u.defaults.complainAboutPopUpBlocking,te=this.defaults.reopenWhenClosed;this.isUseOldPopUp=function(){return Q},this.setUseOldPopUp=function(e){I("useOldPopUp")&&(Q=bool(e))},this.isComplainAboutPopUpBlocking=function(){return ee},this.setComplainAboutPopUpBlocking=function(e){I("complainAboutPopUpBlocking")&&(ee=bool(e))},this.isFocusPopUp=function(){return c},this.setFocusPopUp=function(e){c=bool(e)},this.isReopenWhenClosed=function(){return te},this.setReopenWhenClosed=function(e){te=bool(e)},this.close=function(){logLog.debug("close "+this);try{Z.close(),this.unload()}catch(e){}},this.hide=function(){logLog.debug("hide "+this),k()&&this.close()},this.show=function(){logLog.debug("show "+this),h||E()},this.isVisible=function(){return w()},E=function(){var e="width="+s+",height="+l+",status,resizable",t="";try{var r=window.frameElement;r&&(t="_"+r.tagName+"_"+(r.name||r.id||""))}catch(d){t="_inaccessibleParentFrame"}var n="PopUp_"+location.host.replace(/[^a-z0-9]/gi,"_")+"_"+_+t;Q&&o||(n=n+"_"+uniqueId);var i=function(e){if(f)return!0;try{return bool(e)&&e.closed}catch(t){}return!1},a=function(){f||u.unload()};function c(){T().setCloseIfOpenerCloses(!Q||!o),j(),p=!0,L(),G(i,500,a,"PopUpAppender.checkPopUpClosed: error checking pop-up window")}try{if(Z=window.open(W(),n,e),f=!1,h=!0,Z&&Z.document)if(o&&Q&&isLoaded(Z))Z.mainPageReloaded(),c();else{o&&H(Z.document);isLoaded(Z)?c():G((function(e){return bool(e)&&isLoaded(e)}),100,c,"PopUpAppender.init: unable to create console window")}else g=!1,logLog.warn("PopUpAppender.init: pop-ups blocked, please unblock to use PopUpAppender"),ee&&handleError("log4javascript: pop-up windows appear to be blocked. Please unblock them to use pop-up logging.")}catch(m){handleError("PopUpAppender.init: error creating pop-up",m)}},S=function(){a||E()},v=function(){S(),d=!0},T=function(){return Z},w=function(){if(g&&!isUndefined(Z)&&!f){if(Z.closed||p&&isUndefined(Z.closed))return u.unload(),logLog.debug("PopUpAppender: pop-up closed"),!1;!p&&isLoaded(Z)&&(p=!0)}return g&&p&&!f}}this.getConsoleWindow=T},ConsoleAppender.addGlobalCommandLineFunction=function(t,r){e.push([t,r])},r.prototype=new ConsoleAppender,r.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:!1,focusPopUp:!1,lazyInit:!0,useOldPopUp:!0,complainAboutPopUpBlocking:!0,newestMessageAtTop:!1,scrollToLatestMessage:!0,width:"600",height:"400",reopenWhenClosed:!1,maxMessages:null,showCommandLine:!0,commandLineObjectExpansionDepth:1,showHideButton:!1,showCloseButton:!0,useDocumentWrite:!0},r.prototype.toString=function(){return"PopUpAppender"},log4javascript.PopUpAppender=r,n.prototype=new ConsoleAppender,n.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:!1,lazyInit:!0,newestMessageAtTop:!1,scrollToLatestMessage:!0,width:"100%",height:"220px",maxMessages:null,showCommandLine:!0,commandLineObjectExpansionDepth:1,showHideButton:!1,showCloseButton:!1,showLogEntryDeleteButtons:!0,useDocumentWrite:!0},n.prototype.toString=function(){return"InPageAppender"},log4javascript.InPageAppender=n,log4javascript.InlineAppender=n}(),function(){function e(e){var t=0;for(var r in e)t=Math.max(toStr(r).length,t);var n=[];for(r in e){var i,a=" "+padWithSpaces(toStr(r),t+2);try{i=splitIntoLines(toStr(e[r])).join(padWithSpaces(newLine,t+6))}catch(o){i="[Error obtaining property. Details: "+getExceptionMessage(o)+"]"}n.push(a+i)}return n.join(newLine)}var t=1,r=3,n=4,i=9,a=11,o=["script","pre"],s=["br","img","hr","param","link","area","input","col","base","meta"];function l(e,c,u,d,h){var p;function f(e){for(var t=e.style.cssText.split(";"),r="",n=0,i=t.length;n<i;n++){var a=t[n].split(":"),o=[];/^\s*$/.test(a[0])||o.push(trim(a[0]).toLowerCase()+":"+trim(a[1])),r=o.join(";")}return r}"string"!=typeof u&&(u=""),d=!!d,h=!!h;var m,g;if(!(c=void 0===c||!!c)||e.nodeType==a){for(p="",m=0,g=e.childNodes.length;m<g;m++)p+=l(e.childNodes[m],!0,u+" ");return p}switch(e.nodeType){case t:var _=e.tagName.toLowerCase();p=d?newLine+u:"",p+="<";var y=function(e){return e.prefix?e.prefix:e.outerHTML&&new RegExp("<([^:]+):"+e.tagName+"[^>]*>","i").test(e.outerHTML)?RegExp.$1.toLowerCase():""}(e),b=!!y;for(b&&(p+=y+":"),p+=_,m=0,g=e.attributes.length;m<g;m++){var v=e.attributes[m];v.specified&&null!==v.nodeValue&&"style"!==v.nodeName.toLowerCase()&&"string"==typeof v.nodeValue&&0!==v.nodeName.indexOf("_moz")&&(p+=" "+v.nodeName.toLowerCase()+'="',p+=v.nodeValue.toString().replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),p+='"')}if(e.style.cssText)""!==f(e)&&(p+=' style="'+f(e)+'"');if(array_contains(s,_)||b&&!e.hasChildNodes())p+="/>";else{p+=">";var S=!(1===e.childNodes.length&&e.childNodes[0].nodeType===r),w=array_contains(o,_);for(m=0,g=e.childNodes.length;m<g;m++)p+=l(e.childNodes[m],!0,u+" ",S,w);var T="</"+_+">";p+=S?newLine+u+T:T}return p;case r:if(function(e){return e.nodeType==r&&/^[ \t\r\n]*$/.test(e.nodeValue)}(e))p="";else{if(h)p=e.nodeValue;else{var E=splitIntoLines(trim(e.nodeValue)),x=[];for(m=0,g=E.length;m<g;m++)x[m]=trim(E[m]);p=x.join(newLine+u)}d&&(p=newLine+u+p)}return p;case n:return"<![CDATA["+e.nodeValue+"]]>"+newLine;case i:for(p="",m=0,g=e.childNodes.length;m<g;m++)p+=l(e.childNodes[m],!0,u);return p;default:return""}}ConsoleAppender.addGlobalCommandLineFunction("$",(function(e,t,r){return document.getElementById(t[0])})),ConsoleAppender.addGlobalCommandLineFunction("dir",(function(t,r,n){for(var i=[],a=0,o=r.length;a<o;a++)i[a]=e(r[a]);return i.join(newLine+newLine)})),ConsoleAppender.addGlobalCommandLineFunction("dirxml",(function(e,t,r){for(var n=[],i=0,a=t.length;i<a;i++)n[i]=l(t[i]);return n.join(newLine+newLine)})),ConsoleAppender.addGlobalCommandLineFunction("cd",(function(e,t,r){var n,i;return 0===t.length||""===t[0]?(n=window,i="Command line set to run in main window"):t[0].window==t[0]?(n=t[0],i="Command line set to run in frame '"+t[0].name+"'"):(n=window.frames[t[0]])?i="Command line set to run in frame '"+t[0]+"'":(r.isError=!0,i="Frame '"+t[0]+"' does not exist",n=e.getCommandWindow()),e.setCommandWindow(n),i})),ConsoleAppender.addGlobalCommandLineFunction("clear",(function(e,t,r){r.appendResult=!1,e.clear()})),ConsoleAppender.addGlobalCommandLineFunction("keys",(function(e,t,r){var n=[];for(var i in t[0])n.push(i);return n})),ConsoleAppender.addGlobalCommandLineFunction("values",(function(e,t,r){var n=[];for(var i in t[0])try{n.push(t[0][i])}catch(a){logLog.warn("values(): Unable to obtain value for key "+i+". Details: "+getExceptionMessage(a))}return n})),ConsoleAppender.addGlobalCommandLineFunction("expansionDepth",(function(e,t,r){var n=parseInt(t[0],10);return isNaN(n)||n<0?(r.isError=!0,t[0]+" is not a valid expansion depth"):(e.setCommandLineObjectExpansionDepth(n),"Object expansion depth set to "+n)}))}(),log4javascript.setDocumentReady=function(){pageLoaded=!0,log4javascript.dispatchEvent("load",{})},window.addEventListener)window.addEventListener("load",log4javascript.setDocumentReady,!1);else if(window.attachEvent)window.attachEvent("onload",log4javascript.setDocumentReady);else{var oldOnload=window.onload;"function"!=typeof window.onload?window.onload=log4javascript.setDocumentReady:window.onload=function(e){oldOnload&&oldOnload(e),log4javascript.setDocumentReady()}}return log4javascript}))})(log4javascript$1);var log4javascriptExports=log4javascript$1.exports;const log4javascript=getDefaultExportFromCjs(log4javascriptExports);var current_ansi=1252,VALID_ANSI$1=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],CS2CP$1={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},set_ansi$1=function(e){-1!=VALID_ANSI$1.indexOf(e)&&(current_ansi=CS2CP$1[0]=e)};function reset_ansi$1(){set_ansi$1(1252)}var set_cp$1=function(e){set_ansi$1(e)};function reset_cp$1(){set_cp$1(1200),reset_ansi$1()}function char_codes$1(e){for(var t=[],r=0,n=e.length;r<n;++r)t[r]=e.charCodeAt(r);return t}function utf16leread$1(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}function utf16beread$1(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}var debom$1=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return 255==t&&254==r?utf16leread$1(e.slice(2)):254==t&&255==r?utf16beread$1(e.slice(2)):65279==t?e.slice(1):e},_getchar$1=function(e){return String.fromCharCode(e)},_getansi$1=function(e){return String.fromCharCode(e)},$cptable,Base64_map$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Base64_encode$1(e){for(var t="",r=0,n=0,i=0,a=0,o=0,s=0,l=0,c=0;c<e.length;)a=(r=e.charCodeAt(c++))>>2,o=(3&r)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(i=e.charCodeAt(c++))>>6,l=63&i,isNaN(n)?s=l=64:isNaN(i)&&(l=64),t+=Base64_map$1.charAt(a)+Base64_map$1.charAt(o)+Base64_map$1.charAt(s)+Base64_map$1.charAt(l);return t}function Base64_decode$1(e){var t="",r=0,n=0,i=0,a=0,o=0,s=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var l=0;l<e.length;)r=Base64_map$1.indexOf(e.charAt(l++))<<2|(a=Base64_map$1.indexOf(e.charAt(l++)))>>4,t+=String.fromCharCode(r),n=(15&a)<<4|(o=Base64_map$1.indexOf(e.charAt(l++)))>>2,64!==o&&(t+=String.fromCharCode(n)),i=(3&o)<<6|(s=Base64_map$1.indexOf(e.charAt(l++))),64!==s&&(t+=String.fromCharCode(i));return t}var has_buf$1=function(){return"undefined"!=typeof Buffer&&"undefined"!=typeof process&&void 0!==process.versions&&!!process.versions.node}(),Buffer_from$1=function(){if("undefined"!=typeof Buffer){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(t){e=!0}return e?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function new_raw_buf$1(e){return has_buf$1?Buffer.alloc?Buffer.alloc(e):new Buffer(e):"undefined"!=typeof Uint8Array?new Uint8Array(e):new Array(e)}function new_unsafe_buf$1(e){return has_buf$1?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):"undefined"!=typeof Uint8Array?new Uint8Array(e):new Array(e)}var s2a$1=function(e){return has_buf$1?Buffer_from$1(e,"binary"):e.split("").map((function(e){return 255&e.charCodeAt(0)}))};function a2s$1(e){if(Array.isArray(e))return e.map((function(e){return String.fromCharCode(e)})).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function ab2a$1(e){if("undefined"==typeof ArrayBuffer)throw new Error("Unsupported");if(e instanceof ArrayBuffer)return ab2a$1(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var bconcat$1=has_buf$1?function(e){return Buffer.concat(e.map((function(e){return Buffer.isBuffer(e)?e:Buffer_from$1(e)})))}:function(e){if("undefined"!=typeof Uint8Array){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var n=new Uint8Array(r),i=0;for(t=0,r=0;t<e.length;r+=i,++t)if(i=e[t].length,e[t]instanceof Uint8Array)n.set(e[t],r);else{if("string"==typeof e[t])throw"wtf";n.set(new Uint8Array(e[t]),r)}return n}return[].concat.apply([],e.map((function(e){return Array.isArray(e)?e:[].slice.call(e)})))};function utf8decode$1(e){for(var t=[],r=0,n=e.length+250,i=new_raw_buf$1(e.length+255),a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o<128)i[r++]=o;else if(o<2048)i[r++]=192|o>>6&31,i[r++]=128|63&o;else if(o>=55296&&o<57344){o=64+(1023&o);var s=1023&e.charCodeAt(++a);i[r++]=240|o>>8&7,i[r++]=128|o>>2&63,i[r++]=128|s>>6&15|(3&o)<<4,i[r++]=128|63&s}else i[r++]=224|o>>12&15,i[r++]=128|o>>6&63,i[r++]=128|63&o;r>n&&(t.push(i.slice(0,r)),r=0,i=new_raw_buf$1(65535),n=65530)}return t.push(i.slice(0,r)),bconcat$1(t)}var chr0$1=/\u0000/g,chr1$1=/[\u0001-\u0006]/g;function _strrev$1(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function pad0$1(e,t){var r=""+e;return r.length>=t?r:fill$3("0",t-r.length)+r}function pad_$1(e,t){var r=""+e;return r.length>=t?r:fill$3(" ",t-r.length)+r}function rpad_$1(e,t){var r=""+e;return r.length>=t?r:r+fill$3(" ",t-r.length)}function pad0r1$1(e,t){var r=""+Math.round(e);return r.length>=t?r:fill$3("0",t-r.length)+r}function pad0r2$1(e,t){var r=""+e;return r.length>=t?r:fill$3("0",t-r.length)+r}var p2_32$1=Math.pow(2,32);function pad0r$1(e,t){return e>p2_32$1||e<-p2_32$1?pad0r1$1(e,t):pad0r2$1(Math.round(e),t)}function SSF_isgeneral$1(e,t){return t=t||0,e.length>=7+t&&103==(32|e.charCodeAt(t))&&101==(32|e.charCodeAt(t+1))&&110==(32|e.charCodeAt(t+2))&&101==(32|e.charCodeAt(t+3))&&114==(32|e.charCodeAt(t+4))&&97==(32|e.charCodeAt(t+5))&&108==(32|e.charCodeAt(t+6))}var days$1=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],months$1=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function SSF_init_table$1(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var table_fmt$1={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},SSF_default_map$1={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},SSF_default_str$1={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function SSF_frac$1(e,t,r){for(var n=e<0?-1:1,i=e*n,a=0,o=1,s=0,l=1,c=0,u=0,d=Math.floor(i);c<t&&(s=(d=Math.floor(i))*o+a,u=d*c+l,!(i-d<5e-8));)i=1/(i-d),a=o,o=s,l=c,c=u;if(u>t&&(c>t?(u=l,s=a):(u=c,s=o)),!r)return[0,n*s,u];var h=Math.floor(n*s/u);return[h,n*s-h*u,u]}function SSF_parse_date_code$1(e,t,r){if(e>2958465||e<0)return null;var n=0|e,i=Math.floor(86400*(e-n)),a=0,o=[],s={D:n,T:i,u:86400*(e-n)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),t&&t.date1904&&(n+=1462),s.u>.9999&&(s.u=0,86400==++i&&(s.T=i=0,++n,++s.D)),60===n)o=r?[1317,10,29]:[1900,2,29],a=3;else if(0===n)o=r?[1317,8,29]:[1900,1,0],a=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],a=l.getDay(),n<60&&(a=(a+6)%7),r&&(a=SSF_fix_hijri$1(l,o))}return s.y=o[0],s.m=o[1],s.d=o[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=a,s}var SSFbasedate=new Date(1899,11,31,0,0,0),SSFdnthresh=SSFbasedate.getTime(),SSFbase1904=new Date(1900,2,1,0,0,0);function datenum_local(e,t){var r=e.getTime();return t?r-=1262304e5:e>=SSFbase1904&&(r+=864e5),(r-(SSFdnthresh+6e4*(e.getTimezoneOffset()-SSFbasedate.getTimezoneOffset())))/864e5}function SSF_strip_decimal$1(e){return-1==e.indexOf(".")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function SSF_normalize_exp$1(e){return-1==e.indexOf("E")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function SSF_small_exp$1(e){var t=e<0?12:11,r=SSF_strip_decimal$1(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10)).length<=t?r:e.toExponential(5)}function SSF_large_exp$1(e){var t=SSF_strip_decimal$1(e.toFixed(11));return t.length>(e<0?12:11)||"0"===t||"-0"===t?e.toPrecision(6):t}function SSF_general_num$1(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return SSF_strip_decimal$1(SSF_normalize_exp$1((t>=-4&&t<=-1?e.toPrecision(10+t):Math.abs(t)<=9?SSF_small_exp$1(e):10===t?e.toFixed(10).substr(0,12):SSF_large_exp$1(e)).toUpperCase()))}function SSF_general$1(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?e.toString(10):SSF_general_num$1(e);case"undefined":return"";case"object":if(null==e)return"";if(e instanceof Date)return SSF_format$1(14,datenum_local(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function SSF_fix_hijri$1(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function SSF_write_date$1(e,t,r,n){var i,a="",o=0,s=0,l=r.y,c=0;switch(e){case 98:l=r.y+543;case 121:switch(t.length){case 1:case 2:i=l%100,c=2;break;default:i=l%1e4,c=4}break;case 109:switch(t.length){case 1:case 2:i=r.m,c=t.length;break;case 3:return months$1[r.m-1][1];case 5:return months$1[r.m-1][0];default:return months$1[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:i=r.d,c=t.length;break;case 3:return days$1[r.q][0];default:return days$1[r.q][1]}break;case 104:switch(t.length){case 1:case 2:i=1+(r.H+11)%12,c=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:i=r.H,c=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:i=r.M,c=t.length;break;default:throw"bad minute format: "+t}break;case 115:if("s"!=t&&"ss"!=t&&".0"!=t&&".00"!=t&&".000"!=t)throw"bad second format: "+t;return 0!==r.u||"s"!=t&&"ss"!=t?(s=n>=2?3===n?1e3:100:1===n?10:1,(o=Math.round(s*(r.S+r.u)))>=60*s&&(o=0),"s"===t?0===o?"0":""+o/s:(a=pad0$1(o,2+n),"ss"===t?a.substr(0,2):"."+a.substr(2,t.length-1))):pad0$1(r.S,t.length);case 90:switch(t){case"[h]":case"[hh]":i=24*r.D+r.H;break;case"[m]":case"[mm]":i=60*(24*r.D+r.H)+r.M;break;case"[s]":case"[ss]":i=60*(60*(24*r.D+r.H)+r.M)+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}c=3===t.length?1:2;break;case 101:i=l,c=1}return c>0?pad0$1(i,c):""}function commaify$1(e){if(e.length<=3)return e;for(var t=e.length%3,r=e.substr(0,t);t!=e.length;t+=3)r+=(r.length>0?",":"")+e.substr(t,3);return r}var pct1$1=/%/g;function write_num_pct$1(e,t,r){var n=t.replace(pct1$1,""),i=t.length-n.length;return write_num$1(e,n,r*Math.pow(10,2*i))+fill$3("%",i)}function write_num_cm$1(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return write_num$1(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function write_num_exp$1(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+write_num_exp$1(e,-t);var i=e.indexOf(".");-1===i&&(i=e.indexOf("E"));var a=Math.floor(Math.log(t)*Math.LOG10E)%i;if(a<0&&(a+=i),-1===(r=(t/Math.pow(10,a)).toPrecision(n+1+(i+a)%i)).indexOf("e")){var o=Math.floor(Math.log(t)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+a):r+="E+"+(o-a);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,i)+"."+r.substr(2+i)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,r,n){return t+r+n.substr(0,(i+a)%i)+"."+n.substr(a)+"E"}))}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var frac1$1=/# (\?+)( ?)\/( ?)(\d+)/;function write_num_f1$1(e,t,r){var n=parseInt(e[4],10),i=Math.round(t*n),a=Math.floor(i/n),o=i-a*n,s=n;return r+(0===a?"":""+a)+" "+(0===o?fill$3(" ",e[1].length+1+e[4].length):pad_$1(o,e[1].length)+e[2]+"/"+e[3]+pad0$1(s,e[4].length))}function write_num_f2$1(e,t,r){return r+(0===t?"":""+t)+fill$3(" ",e[1].length+2+e[4].length)}var dec1$1=/^#*0*\.([0#]+)/,closeparen$1=/\).*[0#]/,phone$1=/\(###\) ###\\?-####/;function hashq$1(e){for(var t,r="",n=0;n!=e.length;++n)switch(t=e.charCodeAt(n)){case 35:break;case 63:r+=" ";break;case 48:r+="0";break;default:r+=String.fromCharCode(t)}return r}function rnd$1(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function dec$1(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function carry$1(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function flr$1(e){return e<0x7fffffff&&e>-0x80000000?""+(e>=0?0|e:e-1|0):""+Math.floor(e)}function write_num_flt$1(e,t,r){if(40===e.charCodeAt(0)&&!t.match(closeparen$1)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?write_num_flt$1("n",n,r):"("+write_num_flt$1("n",n,-r)+")"}if(44===t.charCodeAt(t.length-1))return write_num_cm$1(e,t,r);if(-1!==t.indexOf("%"))return write_num_pct$1(e,t,r);if(-1!==t.indexOf("E"))return write_num_exp$1(t,r);if(36===t.charCodeAt(0))return"$"+write_num_flt$1(e,t.substr(" "==t.charAt(1)?2:1),r);var i,a,o,s,l=Math.abs(r),c=r<0?"-":"";if(t.match(/^00+$/))return c+pad0r$1(l,t.length);if(t.match(/^[#?]+$/))return"0"===(i=pad0r$1(r,0))&&(i=""),i.length>t.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(frac1$1))return write_num_f1$1(a,l,c);if(t.match(/^#+0+$/))return c+pad0r$1(l,t.length-t.indexOf("0"));if(a=t.match(dec1$1))return i=rnd$1(r,a[1].length).replace(/^([^\.]+)$/,"$1."+hashq$1(a[1])).replace(/\.$/,"."+hashq$1(a[1])).replace(/\.(\d*)$/,(function(e,t){return"."+t+fill$3("0",hashq$1(a[1]).length-t.length)})),-1!==t.indexOf("0.")?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),a=t.match(/^(0*)\.(#*)$/))return c+rnd$1(l,a[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=t.match(/^#{1,3},##0(\.?)$/))return c+commaify$1(pad0r$1(l,0));if(a=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+write_num_flt$1(e,t,-r):commaify$1(""+(Math.floor(r)+carry$1(r,a[1].length)))+"."+pad0$1(dec$1(r,a[1].length),a[1].length);if(a=t.match(/^#,#*,#0/))return write_num_flt$1(e,t.replace(/^#,#*,/,""),r);if(a=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=_strrev$1(write_num_flt$1(e,t.replace(/[\\-]/g,""),r)),o=0,_strrev$1(_strrev$1(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return o<i.length?i.charAt(o++):"0"===e?"0":""})));if(t.match(phone$1))return"("+(i=write_num_flt$1(e,"##########",r)).substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(a=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(a[4].length,7),s=SSF_frac$1(l,Math.pow(10,o)-1,!1),i=""+c," "==(u=write_num$1("n",a[1],s[1])).charAt(u.length-1)&&(u=u.substr(0,u.length-1)+"0"),i+=u+a[2]+"/"+a[3],(u=rpad_$1(s[2],o)).length<a[4].length&&(u=hashq$1(a[4].substr(a[4].length-u.length))+u),i+=u;if(a=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(a[1].length,a[4].length),7),c+((s=SSF_frac$1(l,Math.pow(10,o)-1,!0))[0]||(s[1]?"":"0"))+" "+(s[1]?pad_$1(s[1],o)+a[2]+"/"+a[3]+rpad_$1(s[2],o):fill$3(" ",2*o+1+a[2].length+a[3].length));if(a=t.match(/^[#0?]+$/))return i=pad0r$1(r,0),t.length<=i.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(/^([#0?]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var d=t.indexOf(".")-o,h=t.length-i.length-d;return hashq$1(t.substr(0,d)+i+t.substr(t.length-h))}if(a=t.match(/^00,000\.([#0]*0)$/))return o=dec$1(r,a[1].length),r<0?"-"+write_num_flt$1(e,t,-r):commaify$1(flr$1(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?pad0$1(0,3-e.length):"")+e}))+"."+pad0$1(o,a[1].length);switch(t){case"###,##0.00":return write_num_flt$1(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var p=commaify$1(pad0r$1(l,0));return"0"!==p?c+p:"";case"###,###.00":return write_num_flt$1(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return write_num_flt$1(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function write_num_cm2$1(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return write_num$1(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function write_num_pct2$1(e,t,r){var n=t.replace(pct1$1,""),i=t.length-n.length;return write_num$1(e,n,r*Math.pow(10,2*i))+fill$3("%",i)}function write_num_exp2$1(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+write_num_exp2$1(e,-t);var i=e.indexOf(".");-1===i&&(i=e.indexOf("E"));var a=Math.floor(Math.log(t)*Math.LOG10E)%i;if(a<0&&(a+=i),!(r=(t/Math.pow(10,a)).toPrecision(n+1+(i+a)%i)).match(/[Ee]/)){var o=Math.floor(Math.log(t)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+a):r+="E+"+(o-a),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,r,n){return t+r+n.substr(0,(i+a)%i)+"."+n.substr(a)+"E"}))}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function write_num_int$1(e,t,r){if(40===e.charCodeAt(0)&&!t.match(closeparen$1)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?write_num_int$1("n",n,r):"("+write_num_int$1("n",n,-r)+")"}if(44===t.charCodeAt(t.length-1))return write_num_cm2$1(e,t,r);if(-1!==t.indexOf("%"))return write_num_pct2$1(e,t,r);if(-1!==t.indexOf("E"))return write_num_exp2$1(t,r);if(36===t.charCodeAt(0))return"$"+write_num_int$1(e,t.substr(" "==t.charAt(1)?2:1),r);var i,a,o,s,l=Math.abs(r),c=r<0?"-":"";if(t.match(/^00+$/))return c+pad0$1(l,t.length);if(t.match(/^[#?]+$/))return i=""+r,0===r&&(i=""),i.length>t.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(frac1$1))return write_num_f2$1(a,l,c);if(t.match(/^#+0+$/))return c+pad0$1(l,t.length-t.indexOf("0"));if(a=t.match(dec1$1))return i=(i=(""+r).replace(/^([^\.]+)$/,"$1."+hashq$1(a[1])).replace(/\.$/,"."+hashq$1(a[1]))).replace(/\.(\d*)$/,(function(e,t){return"."+t+fill$3("0",hashq$1(a[1]).length-t.length)})),-1!==t.indexOf("0.")?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),a=t.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=t.match(/^#{1,3},##0(\.?)$/))return c+commaify$1(""+l);if(a=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+write_num_int$1(e,t,-r):commaify$1(""+r)+"."+fill$3("0",a[1].length);if(a=t.match(/^#,#*,#0/))return write_num_int$1(e,t.replace(/^#,#*,/,""),r);if(a=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=_strrev$1(write_num_int$1(e,t.replace(/[\\-]/g,""),r)),o=0,_strrev$1(_strrev$1(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return o<i.length?i.charAt(o++):"0"===e?"0":""})));if(t.match(phone$1))return"("+(i=write_num_int$1(e,"##########",r)).substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(a=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(a[4].length,7),s=SSF_frac$1(l,Math.pow(10,o)-1,!1),i=""+c," "==(u=write_num$1("n",a[1],s[1])).charAt(u.length-1)&&(u=u.substr(0,u.length-1)+"0"),i+=u+a[2]+"/"+a[3],(u=rpad_$1(s[2],o)).length<a[4].length&&(u=hashq$1(a[4].substr(a[4].length-u.length))+u),i+=u;if(a=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(a[1].length,a[4].length),7),c+((s=SSF_frac$1(l,Math.pow(10,o)-1,!0))[0]||(s[1]?"":"0"))+" "+(s[1]?pad_$1(s[1],o)+a[2]+"/"+a[3]+rpad_$1(s[2],o):fill$3(" ",2*o+1+a[2].length+a[3].length));if(a=t.match(/^[#0?]+$/))return i=""+r,t.length<=i.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(/^([#0]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var d=t.indexOf(".")-o,h=t.length-i.length-d;return hashq$1(t.substr(0,d)+i+t.substr(t.length-h))}if(a=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+write_num_int$1(e,t,-r):commaify$1(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?pad0$1(0,3-e.length):"")+e}))+"."+pad0$1(0,a[1].length);switch(t){case"###,###":case"##,###":case"#,###":var p=commaify$1(""+l);return"0"!==p?c+p:"";default:if(t.match(/\.[0#?]*$/))return write_num_int$1(e,t.slice(0,t.lastIndexOf(".")),r)+hashq$1(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function write_num$1(e,t,r){return(0|r)===r?write_num_int$1(e,t,r):write_num_flt$1(e,t,r)}function SSF_split_fmt$1(e){for(var t=[],r=!1,n=0,i=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(i,n-i),i=n+1}if(t[t.length]=e.substr(i),!0===r)throw new Error("Format |"+e+"| unterminated string ");return t}var SSF_abstime$1=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function fmt_is_date$1(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":SSF_isgeneral$1(e,t)&&(t+=6),t++;break;case'"':for(;34!==e.charCodeAt(++t)&&t<e.length;);++t;break;case"\\":case"_":t+=2;break;case"@":++t;break;case"B":case"b":if("1"===e.charAt(t+1)||"2"===e.charAt(t+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===e.substr(t,3).toUpperCase())return!0;if("AM/PM"===e.substr(t,5).toUpperCase())return!0;if("上午/下午"===e.substr(t,5).toUpperCase())return!0;++t;break;case"[":for(n=r;"]"!==e.charAt(t++)&&t<e.length;)n+=e.charAt(t);if(n.match(SSF_abstime$1))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||"\\"==r&&"-"==e.charAt(t+1)&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t," "!=e.charAt(t)&&"*"!=e.charAt(t)||++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;default:++t}return!1}function eval_fmt$1(e,t,r,n){for(var i,a,o,s=[],l="",c=0,u="",d="t",h="H";c<e.length;)switch(u=e.charAt(c)){case"G":if(!SSF_isgeneral$1(e,c))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"G",v:"General"},c+=7;break;case'"':for(l="";34!==(o=e.charCodeAt(++c))&&c<e.length;)l+=String.fromCharCode(o);s[s.length]={t:"t",v:l},++c;break;case"\\":var p=e.charAt(++c),f="("===p||")"===p?p:"t";s[s.length]={t:f,v:p},++c;break;case"_":s[s.length]={t:"t",v:" "},c+=2;break;case"@":s[s.length]={t:"T",v:t},++c;break;case"B":case"b":if("1"===e.charAt(c+1)||"2"===e.charAt(c+1)){if(null==i&&null==(i=SSF_parse_date_code$1(t,r,"2"===e.charAt(c+1))))return"";s[s.length]={t:"X",v:e.substr(c,2)},d=u,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":u=u.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0)return"";if(null==i&&null==(i=SSF_parse_date_code$1(t,r)))return"";for(l=u;++c<e.length&&e.charAt(c).toLowerCase()===u;)l+=u;"m"===u&&"h"===d.toLowerCase()&&(u="M"),"h"===u&&(u=h),s[s.length]={t:u,v:l},d=u;break;case"A":case"a":case"上":var m={t:u,v:u};if(null==i&&(i=SSF_parse_date_code$1(t,r)),"A/P"===e.substr(c,3).toUpperCase()?(null!=i&&(m.v=i.H>=12?"P":"A"),m.t="T",h="h",c+=3):"AM/PM"===e.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"PM":"AM"),m.t="T",c+=5,h="h"):"上午/下午"===e.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"下午":"上午"),m.t="T",c+=5,h="h"):(m.t="t",++c),null==i&&"T"===m.t)return"";s[s.length]=m,d=u;break;case"[":for(l=u;"]"!==e.charAt(c++)&&c<e.length;)l+=e.charAt(c);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(SSF_abstime$1)){if(null==i&&null==(i=SSF_parse_date_code$1(t,r)))return"";s[s.length]={t:"Z",v:l.toLowerCase()},d=l.charAt(1)}else l.indexOf("$")>-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",fmt_is_date$1(e)||(s[s.length]={t:"t",v:l}));break;case".":if(null!=i){for(l=u;++c<e.length&&"0"===(u=e.charAt(c));)l+=u;s[s.length]={t:"s",v:l};break}case"0":case"#":for(l=u;++c<e.length&&"0#?.,E+-%".indexOf(u=e.charAt(c))>-1;)l+=u;s[s.length]={t:"n",v:l};break;case"?":for(l=u;e.charAt(++c)===u;)l+=u;s[s.length]={t:u,v:l},d=u;break;case"*":++c," "!=e.charAt(c)&&"*"!=e.charAt(c)||++c;break;case"(":case")":s[s.length]={t:1===n?"t":u,v:u},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=u;c<e.length&&"0123456789".indexOf(e.charAt(++c))>-1;)l+=e.charAt(c);s[s.length]={t:"D",v:l};break;case" ":s[s.length]={t:u,v:u},++c;break;case"$":s[s.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(u))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"t",v:u},++c}var g,_=0,y=0;for(c=s.length-1,d="t";c>=0;--c)switch(s[c].t){case"h":case"H":s[c].t=h,d="h",_<1&&(_=1);break;case"s":(g=s[c].v.match(/\.0+$/))&&(y=Math.max(y,g[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":d=s[c].t;break;case"m":"s"===d&&(s[c].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&s[c].v.match(/[Hh]/)&&(_=1),_<2&&s[c].v.match(/[Mm]/)&&(_=2),_<3&&s[c].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M),i.M>=60&&(i.M=0,++i.H);break;case 2:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M)}var b,v="";for(c=0;c<s.length;++c)switch(s[c].t){case"t":case"T":case" ":case"D":break;case"X":s[c].v="",s[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[c].v=SSF_write_date$1(s[c].t.charCodeAt(0),s[c].v,i,y),s[c].t="t";break;case"n":case"?":for(b=c+1;null!=s[b]&&("?"===(u=s[b].t)||"D"===u||(" "===u||"t"===u)&&null!=s[b+1]&&("?"===s[b+1].t||"t"===s[b+1].t&&"/"===s[b+1].v)||"("===s[c].t&&(" "===u||"n"===u||")"===u)||"t"===u&&("/"===s[b].v||" "===s[b].v&&null!=s[b+1]&&"?"==s[b+1].t));)s[c].v+=s[b].v,s[b]={v:"",t:";"},++b;v+=s[c].v,c=b-1;break;case"G":s[c].t="t",s[c].v=SSF_general$1(t,r)}var S,w,T="";if(v.length>0){40==v.charCodeAt(0)?(S=t<0&&45===v.charCodeAt(0)?-t:t,w=write_num$1("n",v,S)):(w=write_num$1("n",v,S=t<0&&n>1?-t:t),S<0&&s[0]&&"t"==s[0].t&&(w=w.substr(1),s[0].v="-"+s[0].v)),b=w.length-1;var E=s.length;for(c=0;c<s.length;++c)if(null!=s[c]&&"t"!=s[c].t&&s[c].v.indexOf(".")>-1){E=c;break}var x=s.length;if(E===s.length&&-1===w.indexOf("E")){for(c=s.length-1;c>=0;--c)null!=s[c]&&-1!=="n?".indexOf(s[c].t)&&(b>=s[c].v.length-1?(b-=s[c].v.length,s[c].v=w.substr(b+1,s[c].v.length)):b<0?s[c].v="":(s[c].v=w.substr(0,b+1),b=-1),s[c].t="t",x=c);b>=0&&x<s.length&&(s[x].v=w.substr(0,b+1)+s[x].v)}else if(E!==s.length&&-1===w.indexOf("E")){for(b=w.indexOf(".")-1,c=E;c>=0;--c)if(null!=s[c]&&-1!=="n?".indexOf(s[c].t)){for(a=s[c].v.indexOf(".")>-1&&c===E?s[c].v.indexOf(".")-1:s[c].v.length-1,T=s[c].v.substr(a+1);a>=0;--a)b>=0&&("0"===s[c].v.charAt(a)||"#"===s[c].v.charAt(a))&&(T=w.charAt(b--)+T);s[c].v=T,s[c].t="t",x=c}for(b>=0&&x<s.length&&(s[x].v=w.substr(0,b+1)+s[x].v),b=w.indexOf(".")+1,c=E;c<s.length;++c)if(null!=s[c]&&(-1!=="n?(".indexOf(s[c].t)||c===E)){for(a=s[c].v.indexOf(".")>-1&&c===E?s[c].v.indexOf(".")+1:0,T=s[c].v.substr(0,a);a<s[c].v.length;++a)b<w.length&&(T+=w.charAt(b++));s[c].v=T,s[c].t="t",x=c}}}for(c=0;c<s.length;++c)null!=s[c]&&"n?".indexOf(s[c].t)>-1&&(S=n>1&&t<0&&c>0&&"-"===s[c-1].v?-t:t,s[c].v=write_num$1(s[c].t,s[c].v,S),s[c].t="t");var A="";for(c=0;c!==s.length;++c)null!=s[c]&&(A+=s[c].v);return A}var cfregex2$1=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function chkcond$1(e,t){if(null==t)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0}return!1}function choose_fmt$1(e,t){var r=SSF_split_fmt$1(e),n=r.length,i=r[n-1].indexOf("@");if(n<4&&i>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if("number"!=typeof t)return[4,4===r.length||i>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=i>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=i>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=i>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"]}var a=t>0?r[0]:t<0?r[1]:r[2];if(-1===r[0].indexOf("[")&&-1===r[1].indexOf("["))return[n,a];if(null!=r[0].match(/\[[=<>]/)||null!=r[1].match(/\[[=<>]/)){var o=r[0].match(cfregex2$1),s=r[1].match(cfregex2$1);return chkcond$1(t,o)?[n,r[0]]:chkcond$1(t,s)?[n,r[1]]:[n,r[null!=o&&null!=s?2:1]]}return[n,a]}function SSF_format$1(e,t,r){null==r&&(r={});var n="";switch(typeof e){case"string":n="m/d/yy"==e&&r.dateNF?r.dateNF:e;break;case"number":null==(n=14==e&&r.dateNF?r.dateNF:(null!=r.table?r.table:table_fmt$1)[e])&&(n=r.table&&r.table[SSF_default_map$1[e]]||table_fmt$1[SSF_default_map$1[e]]),null==n&&(n=SSF_default_str$1[e]||"General")}if(SSF_isgeneral$1(n,0))return SSF_general$1(t,r);t instanceof Date&&(t=datenum_local(t,r.date1904));var i=choose_fmt$1(n,t);if(SSF_isgeneral$1(i[1]))return SSF_general$1(t,r);if(!0===t)t="TRUE";else if(!1===t)t="FALSE";else if(""===t||null==t)return"";return eval_fmt$1(i[1],t,r,i[0])}function SSF_load$1(e,t){if("number"!=typeof t){t=+t||-1;for(var r=0;r<392;++r)if(null!=table_fmt$1[r]){if(table_fmt$1[r]==e){t=r;break}}else t<0&&(t=r);t<0&&(t=391)}return table_fmt$1[t]=e,t}function make_ssf$1(){table_fmt$1=SSF_init_table$1()}var SSFImplicit$1={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},dateNFregex$1=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function dateNF_regex$1(e){var t="number"==typeof e?table_fmt$1[e]:e;return t=t.replace(dateNFregex$1,"(\\d+)"),new RegExp("^"+t+"$")}function dateNF_fix$1(e,t,r){var n=-1,i=-1,a=-1,o=-1,s=-1,l=-1;(t.match(dateNFregex$1)||[]).forEach((function(e,t){var c=parseInt(r[t+1],10);switch(e.toLowerCase().charAt(0)){case"y":n=c;break;case"d":a=c;break;case"h":o=c;break;case"s":l=c;break;case"m":o>=0?s=c:i=c}})),l>=0&&-1==s&&i>=0&&(s=i,i=-1);var c=(""+(n>=0?n:(new Date).getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(a>=1?a:1)).slice(-2);7==c.length&&(c="0"+c),8==c.length&&(c="20"+c);var u=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return-1==o&&-1==s&&-1==l?c:-1==n&&-1==i&&-1==a?u:c+"T"+u}var CRC32$1=function(){var e={};e.version="1.2.0";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}();var r=function(e){var t=0,r=0,n=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)i[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=i[t]=r>>>8^e[255&r];var a=[];for(n=1;16!=n;++n)a[n-1]="undefined"!=typeof Int32Array?i.subarray(256*n,256*n+256):i.slice(256*n,256*n+256);return a}(t),n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],c=r[6],u=r[7],d=r[8],h=r[9],p=r[10],f=r[11],m=r[12],g=r[13],_=r[14];return e.table=t,e.bstr=function(e,r){for(var n=~r,i=0,a=e.length;i<a;)n=n>>>8^t[255&(n^e.charCodeAt(i++))];return~n},e.buf=function(e,r){for(var y=~r,b=e.length-15,v=0;v<b;)y=_[e[v++]^255&y]^g[e[v++]^y>>8&255]^m[e[v++]^y>>16&255]^f[e[v++]^y>>>24]^p[e[v++]]^h[e[v++]]^d[e[v++]]^u[e[v++]]^c[e[v++]]^l[e[v++]]^s[e[v++]]^o[e[v++]]^a[e[v++]]^i[e[v++]]^n[e[v++]]^t[e[v++]];for(b+=15;v<b;)y=y>>>8^t[255&(y^e[v++])];return~y},e.str=function(e,r){for(var n=~r,i=0,a=e.length,o=0,s=0;i<a;)(o=e.charCodeAt(i++))<128?n=n>>>8^t[255&(n^o)]:o<2048?n=(n=n>>>8^t[255&(n^(192|o>>6&31))])>>>8^t[255&(n^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),s=1023&e.charCodeAt(i++),n=(n=(n=(n=n>>>8^t[255&(n^(240|o>>8&7))])>>>8^t[255&(n^(128|o>>2&63))])>>>8^t[255&(n^(128|s>>6&15|(3&o)<<4))])>>>8^t[255&(n^(128|63&s))]):n=(n=(n=n>>>8^t[255&(n^(224|o>>12&15))])>>>8^t[255&(n^(128|o>>6&63))])>>>8^t[255&(n^(128|63&o))];return~n},e}(),CFB$1=function(){var e,t={};function r(e){if("/"==e.charAt(e.length-1))return-1===e.slice(0,-1).indexOf("/")?e:r(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(0,t+1)}function n(e){if("/"==e.charAt(e.length-1))return n(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(t+1)}function i(e,t){"string"==typeof t&&(t=new Date(t));var r=t.getHours();r=(r=r<<6|t.getMinutes())<<5|t.getSeconds()>>>1,e.write_shift(2,r);var n=t.getFullYear()-1980;n=(n=n<<4|t.getMonth()+1)<<5|t.getDate(),e.write_shift(2,n)}function a(e){prep_blob$1(e,0);for(var t={},r=0;e.l<=e.length-4;){var n=e.read_shift(2),i=e.read_shift(2),a=e.l+i,o={};if(21589===n)1&(r=e.read_shift(1))&&(o.mtime=e.read_shift(4)),i>5&&(2&r&&(o.atime=e.read_shift(4)),4&r&&(o.ctime=e.read_shift(4))),o.mtime&&(o.mt=new Date(1e3*o.mtime));e.l=a,t[n]=o}return t}function o(){return e||(e={})}function s(e,t){if(80==e[0]&&75==e[1])return ne(e,t);if(109==(32|e[0])&&105==(32|e[1]))return function(e,t){if("mime-version:"!=w(e.slice(0,13)).toLowerCase())throw new Error("Unsupported MAD header");var r=t&&t.root||"",n=(has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):w(e)).split("\r\n"),i=0,a="";for(i=0;i<n.length;++i)if(a=n[i],/^Content-Location:/i.test(a)&&(a=a.slice(a.indexOf("file")),r||(r=a.slice(0,a.lastIndexOf("/")+1)),a.slice(0,r.length)!=r))for(;r.length>0&&(r=(r=r.slice(0,r.length-1)).slice(0,r.lastIndexOf("/")+1),a.slice(0,r.length)!=r););var o=(n[1]||"").match(/boundary="(.*?)"/);if(!o)throw new Error("MAD cannot find boundary");var s="--"+(o[1]||""),l=[],c=[],u={FileIndex:l,FullPaths:c};h(u);var d,p=0;for(i=0;i<n.length;++i){var f=n[i];f!==s&&f!==s+"--"||(p++&&ce(u,n.slice(d,i),r),d=i)}return u}(e,t);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var r,n,i,a,o,s,p=512,f=[],m=e.slice(0,512);prep_blob$1(m,0);var g=function(e){if(80==e[e.l]&&75==e[e.l+1])return[0,0];e.chk(y,"Header Signature: "),e.l+=16;var t=e.read_shift(2,"u");return[e.read_shift(2,"u"),t]}(m);switch(r=g[0]){case 3:p=512;break;case 4:p=4096;break;case 0:if(0==g[1])return ne(e,t);default:throw new Error("Major Version: Expected 3 or 4 saw "+r)}512!==p&&prep_blob$1(m=e.slice(0,p),28);var b=e.slice(0,p);!function(e,t){var r=9;switch(e.l+=2,r=e.read_shift(2)){case 9:if(3!=t)throw new Error("Sector Shift: Expected 9 saw "+r);break;case 12:if(4!=t)throw new Error("Sector Shift: Expected 12 saw "+r);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+r)}e.chk("0600","Mini Sector Shift: "),e.chk("000000000000","Reserved: ")}(m,r);var v=m.read_shift(4,"i");if(3===r&&0!==v)throw new Error("# Directory Sectors: Expected 0 saw "+v);m.l+=4,a=m.read_shift(4,"i"),m.l+=4,m.chk("00100000","Mini Stream Cutoff Size: "),o=m.read_shift(4,"i"),n=m.read_shift(4,"i"),s=m.read_shift(4,"i"),i=m.read_shift(4,"i");for(var S=-1,T=0;T<109&&!((S=m.read_shift(4,"i"))<0);++T)f[T]=S;var E=function(e,t){for(var r=Math.ceil(e.length/t)-1,n=[],i=1;i<r;++i)n[i-1]=e.slice(i*t,(i+1)*t);return n[r-1]=e.slice(r*t),n}(e,p);c(s,i,E,p,f);var x=function(e,t,r,n){var i=e.length,a=[],o=[],s=[],l=[],c=n-1,u=0,d=0,h=0,p=0;for(u=0;u<i;++u)if(s=[],(h=u+t)>=i&&(h-=i),!o[h]){l=[];var f=[];for(d=h;d>=0;){f[d]=!0,o[d]=!0,s[s.length]=d,l.push(e[d]);var m=r[Math.floor(4*d/n)];if(n<4+(p=4*d&c))throw new Error("FAT boundary crossed: "+d+" 4 "+n);if(!e[m])break;if(f[d=__readInt32LE$1(e[m],p)])break}a[h]={nodes:s,data:__toBuffer$1([l])}}return a}(E,a,f,p);x[a].name="!Directory",n>0&&o!==_&&(x[o].name="!MiniFAT"),x[f[0]].name="!FAT",x.fat_addrs=f,x.ssz=p;var A=[],C=[],R=[];!function(e,t,r,n,i,a,o,s){for(var c,h=0,p=n.length?2:0,f=t[e].data,m=0,g=0;m<f.length;m+=128){var y=f.slice(m,m+128);prep_blob$1(y,64),g=y.read_shift(2),c=__utf16le$1(y,0,g-p),n.push(c);var b={name:c,type:y.read_shift(1),color:y.read_shift(1),L:y.read_shift(4,"i"),R:y.read_shift(4,"i"),C:y.read_shift(4,"i"),clsid:y.read_shift(16),state:y.read_shift(4,"i"),start:0,size:0};0!==y.read_shift(2)+y.read_shift(2)+y.read_shift(2)+y.read_shift(2)&&(b.ct=d(y,y.l-8)),0!==y.read_shift(2)+y.read_shift(2)+y.read_shift(2)+y.read_shift(2)&&(b.mt=d(y,y.l-8)),b.start=y.read_shift(4,"i"),b.size=y.read_shift(4,"i"),b.size<0&&b.start<0&&(b.size=b.type=0,b.start=_,b.name=""),5===b.type?(h=b.start,i>0&&h!==_&&(t[h].name="!StreamData")):b.size>=4096?(b.storage="fat",void 0===t[b.start]&&(t[b.start]=u(r,b.start,t.fat_addrs,t.ssz)),t[b.start].name=b.name,b.content=t[b.start].data.slice(0,b.size)):(b.storage="minifat",b.size<0?b.size=0:h!==_&&b.start!==_&&t[h]&&(b.content=l(b,t[h].data,(t[s]||{}).data))),b.content&&prep_blob$1(b.content,0),a[c]=b,o.push(b)}}(a,x,E,A,n,{},C,o),function(e,t,r){for(var n=0,i=0,a=0,o=0,s=0,l=r.length,c=[],u=[];n<l;++n)c[n]=u[n]=n,t[n]=r[n];for(;s<u.length;++s)i=e[n=u[s]].L,a=e[n].R,o=e[n].C,c[n]===n&&(-1!==i&&c[i]!==i&&(c[n]=c[i]),-1!==a&&c[a]!==a&&(c[n]=c[a])),-1!==o&&(c[o]=n),-1!==i&&n!=c[n]&&(c[i]=c[n],u.lastIndexOf(i)<s&&u.push(i)),-1!==a&&n!=c[n]&&(c[a]=c[n],u.lastIndexOf(a)<s&&u.push(a));for(n=1;n<l;++n)c[n]===n&&(-1!==a&&c[a]!==a?c[n]=c[a]:-1!==i&&c[i]!==i&&(c[n]=c[i]));for(n=1;n<l;++n)if(0!==e[n].type){if((s=n)!=c[s])do{s=c[s],t[n]=t[s]+"/"+t[n]}while(0!==s&&-1!==c[s]&&s!=c[s]);c[n]=-1}for(t[0]+="/",n=1;n<l;++n)2!==e[n].type&&(t[n]+="/")}(C,R,A),A.shift();var D={FileIndex:C,FullPaths:R};return t&&t.raw&&(D.raw={header:b,sectors:E}),D}function l(e,t,r){for(var n=e.start,i=e.size,a=[],o=n;r&&i>0&&o>=0;)a.push(t.slice(o*g,o*g+g)),i-=g,o=__readInt32LE$1(r,4*o);return 0===a.length?new_buf$1(0):bconcat$1(a).slice(0,e.size)}function c(e,t,r,n,i){var a=_;if(e===_){if(0!==t)throw new Error("DIFAT chain shorter than expected")}else if(-1!==e){var o=r[e],s=(n>>>2)-1;if(!o)return;for(var l=0;l<s&&(a=__readInt32LE$1(o,4*l))!==_;++l)i.push(a);c(__readInt32LE$1(o,n-4),t-1,r,n,i)}}function u(e,t,r,n,i){var a=[],o=[];i||(i=[]);var s=n-1,l=0,c=0;for(l=t;l>=0;){i[l]=!0,a[a.length]=l,o.push(e[l]);var u=r[Math.floor(4*l/n)];if(n<4+(c=4*l&s))throw new Error("FAT boundary crossed: "+l+" 4 "+n);if(!e[u])break;l=__readInt32LE$1(e[u],c)}return{nodes:a,data:__toBuffer$1([o])}}function d(e,t){return new Date(1e3*(__readUInt32LE$1(e,t+4)/1e7*Math.pow(2,32)+__readUInt32LE$1(e,t)/1e7-0x2b6109100))}function h(e,t){var r=t||{},n=r.root||"Root Entry";if(e.FullPaths||(e.FullPaths=[]),e.FileIndex||(e.FileIndex=[]),e.FullPaths.length!==e.FileIndex.length)throw new Error("inconsistent CFB structure");0===e.FullPaths.length&&(e.FullPaths[0]=n+"/",e.FileIndex[0]={name:n,type:5}),r.CLSID&&(e.FileIndex[0].clsid=r.CLSID),function(e){var t="\x01Sh33tJ5";if(CFB$1.find(e,"/"+t))return;var r=new_buf$1(4);r[0]=55,r[1]=r[3]=50,r[2]=54,e.FileIndex.push({name:t,type:2,content:r,size:4,L:69,R:69,C:69}),e.FullPaths.push(e.FullPaths[0]+t),p(e)}(e)}function p(e,t){h(e);for(var i=!1,a=!1,o=e.FullPaths.length-1;o>=0;--o){var s=e.FileIndex[o];switch(s.type){case 0:a?i=!0:(e.FileIndex.pop(),e.FullPaths.pop());break;case 1:case 2:case 5:a=!0,isNaN(s.R*s.L*s.C)&&(i=!0),s.R>-1&&s.L>-1&&s.R==s.L&&(i=!0);break;default:i=!0}}if(i||t){var l=new Date(1987,1,19),c=0,u=Object.create?Object.create(null):{},d=[];for(o=0;o<e.FullPaths.length;++o)u[e.FullPaths[o]]=!0,0!==e.FileIndex[o].type&&d.push([e.FullPaths[o],e.FileIndex[o]]);for(o=0;o<d.length;++o){var p=r(d[o][0]);(a=u[p])||(d.push([p,{name:n(p).replace("/",""),type:1,clsid:v,ct:l,mt:l,content:null}]),u[p]=!0)}for(d.sort((function(e,t){return function(e,t){for(var r=e.split("/"),n=t.split("/"),i=0,a=0,o=Math.min(r.length,n.length);i<o;++i){if(a=r[i].length-n[i].length)return a;if(r[i]!=n[i])return r[i]<n[i]?-1:1}return r.length-n.length}(e[0],t[0])})),e.FullPaths=[],e.FileIndex=[],o=0;o<d.length;++o)e.FullPaths[o]=d[o][0],e.FileIndex[o]=d[o][1];for(o=0;o<d.length;++o){var f=e.FileIndex[o],m=e.FullPaths[o];if(f.name=n(m).replace("/",""),f.L=f.R=f.C=-(f.color=1),f.size=f.content?f.content.length:0,f.start=0,f.clsid=f.clsid||v,0===o)f.C=d.length>1?1:-1,f.size=0,f.type=5;else if("/"==m.slice(-1)){for(c=o+1;c<d.length&&r(e.FullPaths[c])!=m;++c);for(f.C=c>=d.length?-1:c,c=o+1;c<d.length&&r(e.FullPaths[c])!=r(m);++c);f.R=c>=d.length?-1:c,f.type=1}else r(e.FullPaths[o+1]||"")==r(m)&&(f.R=o+1),f.type=2}}}function f(e,t){var r=t||{};if("mad"==r.fileType)return function(e,t){for(var r=t||{},n=r.boundary||"SheetJS",i=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+(n="------="+n).slice(2)+'"',"","",""],a=e.FullPaths[0],o=a,s=e.FileIndex[0],l=1;l<e.FullPaths.length;++l)if(o=e.FullPaths[l].slice(a.length),(s=e.FileIndex[l]).size&&s.content&&"\x01Sh33tJ5"!=o){o=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,(function(e){return"_x"+e.charCodeAt(0).toString(16)+"_"})).replace(/[\u0080-\uFFFF]/g,(function(e){return"_u"+e.charCodeAt(0).toString(16)+"_"}));for(var c=s.content,u=has_buf$1&&Buffer.isBuffer(c)?c.toString("binary"):w(c),d=0,h=Math.min(1024,u.length),p=0,f=0;f<=h;++f)(p=u.charCodeAt(f))>=32&&p<128&&++d;var m=d>=4*h/5;i.push(n),i.push("Content-Location: "+(r.root||"file:///C:/SheetJS/")+o),i.push("Content-Transfer-Encoding: "+(m?"quoted-printable":"base64")),i.push("Content-Type: "+oe(s,o)),i.push(""),i.push(m?le(u):se(u))}return i.push(n+"--\r\n"),i.join("\r\n")}(e,r);if(p(e),"zip"===r.fileType)return function(e,t){var r=t||{},n=[],a=[],o=new_buf$1(1),s=r.compression?8:0,l=0,c=0,u=0,d=0,h=0,p=e.FullPaths[0],f=p,m=e.FileIndex[0],g=[],_=0;for(c=1;c<e.FullPaths.length;++c)if(f=e.FullPaths[c].slice(p.length),(m=e.FileIndex[c]).size&&m.content&&"\x01Sh33tJ5"!=f){var y=d,b=new_buf$1(f.length);for(u=0;u<f.length;++u)b.write_shift(1,127&f.charCodeAt(u));b=b.slice(0,b.l),g[h]=CRC32$1.buf(m.content,0);var v=m.content;8==s&&(v=T(v)),(o=new_buf$1(30)).write_shift(4,0x4034b50),o.write_shift(2,20),o.write_shift(2,l),o.write_shift(2,s),m.mt?i(o,m.mt):o.write_shift(4,0),o.write_shift(-4,g[h]),o.write_shift(4,v.length),o.write_shift(4,m.content.length),o.write_shift(2,b.length),o.write_shift(2,0),d+=o.length,n.push(o),d+=b.length,n.push(b),d+=v.length,n.push(v),(o=new_buf$1(46)).write_shift(4,0x2014b50),o.write_shift(2,0),o.write_shift(2,20),o.write_shift(2,l),o.write_shift(2,s),o.write_shift(4,0),o.write_shift(-4,g[h]),o.write_shift(4,v.length),o.write_shift(4,m.content.length),o.write_shift(2,b.length),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(4,0),o.write_shift(4,y),_+=o.l,a.push(o),_+=b.length,a.push(b),++h}return o=new_buf$1(22),o.write_shift(4,0x6054b50),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,h),o.write_shift(2,h),o.write_shift(4,_),o.write_shift(4,d),o.write_shift(2,0),bconcat$1([bconcat$1(n),bconcat$1(a),o])}(e,r);var n=function(e){for(var t=0,r=0,n=0;n<e.FileIndex.length;++n){var i=e.FileIndex[n];if(i.content){var a=i.content.length;a>0&&(a<4096?t+=a+63>>6:r+=a+511>>9)}}for(var o=e.FullPaths.length+3>>2,s=t+127>>7,l=(t+7>>3)+r+o+s,c=l+127>>7,u=c<=109?0:Math.ceil((c-109)/127);l+c+u+127>>7>c;)u=++c<=109?0:Math.ceil((c-109)/127);var d=[1,u,c,s,o,r,t,0];return e.FileIndex[0].size=t<<6,d[7]=(e.FileIndex[0].start=d[0]+d[1]+d[2]+d[3]+d[4]+d[5])+(d[6]+7>>3),d}(e),a=new_buf$1(n[7]<<9),o=0,s=0;for(o=0;o<8;++o)a.write_shift(1,b[o]);for(o=0;o<8;++o)a.write_shift(2,0);for(a.write_shift(2,62),a.write_shift(2,3),a.write_shift(2,65534),a.write_shift(2,9),a.write_shift(2,6),o=0;o<3;++o)a.write_shift(2,0);for(a.write_shift(4,0),a.write_shift(4,n[2]),a.write_shift(4,n[0]+n[1]+n[2]+n[3]-1),a.write_shift(4,0),a.write_shift(4,4096),a.write_shift(4,n[3]?n[0]+n[1]+n[2]-1:_),a.write_shift(4,n[3]),a.write_shift(-4,n[1]?n[0]-1:_),a.write_shift(4,n[1]),o=0;o<109;++o)a.write_shift(-4,o<n[2]?n[1]+o:-1);if(n[1])for(s=0;s<n[1];++s){for(;o<236+127*s;++o)a.write_shift(-4,o<n[2]?n[1]+o:-1);a.write_shift(-4,s===n[1]-1?_:s+1)}var l=function(e){for(s+=e;o<s-1;++o)a.write_shift(-4,o+1);e&&(++o,a.write_shift(-4,_))};for(s=o=0,s+=n[1];o<s;++o)a.write_shift(-4,S.DIFSECT);for(s+=n[2];o<s;++o)a.write_shift(-4,S.FATSECT);l(n[3]),l(n[4]);for(var c=0,u=0,d=e.FileIndex[0];c<e.FileIndex.length;++c)(d=e.FileIndex[c]).content&&((u=d.content.length)<4096||(d.start=s,l(u+511>>9)));for(l(n[6]+7>>3);511&a.l;)a.write_shift(-4,S.ENDOFCHAIN);for(s=o=0,c=0;c<e.FileIndex.length;++c)(d=e.FileIndex[c]).content&&(!(u=d.content.length)||u>=4096||(d.start=s,l(u+63>>6)));for(;511&a.l;)a.write_shift(-4,S.ENDOFCHAIN);for(o=0;o<n[4]<<2;++o){var h=e.FullPaths[o];if(h&&0!==h.length){d=e.FileIndex[o],0===o&&(d.start=d.size?d.start-1:_);var f=0===o&&r.root||d.name;if(u=2*(f.length+1),a.write_shift(64,f,"utf16le"),a.write_shift(2,u),a.write_shift(1,d.type),a.write_shift(1,d.color),a.write_shift(-4,d.L),a.write_shift(-4,d.R),a.write_shift(-4,d.C),d.clsid)a.write_shift(16,d.clsid,"hex");else for(c=0;c<4;++c)a.write_shift(4,0);a.write_shift(4,d.state||0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,d.start),a.write_shift(4,d.size),a.write_shift(4,0)}else{for(c=0;c<17;++c)a.write_shift(4,0);for(c=0;c<3;++c)a.write_shift(4,-1);for(c=0;c<12;++c)a.write_shift(4,0)}}for(o=1;o<e.FileIndex.length;++o)if((d=e.FileIndex[o]).size>=4096)if(a.l=d.start+1<<9,has_buf$1&&Buffer.isBuffer(d.content))d.content.copy(a,a.l,0,d.size),a.l+=d.size+511&-512;else{for(c=0;c<d.size;++c)a.write_shift(1,d.content[c]);for(;511&c;++c)a.write_shift(1,0)}for(o=1;o<e.FileIndex.length;++o)if((d=e.FileIndex[o]).size>0&&d.size<4096)if(has_buf$1&&Buffer.isBuffer(d.content))d.content.copy(a,a.l,0,d.size),a.l+=d.size+63&-64;else{for(c=0;c<d.size;++c)a.write_shift(1,d.content[c]);for(;63&c;++c)a.write_shift(1,0)}if(has_buf$1)a.l=a.length;else for(;a.l<a.length;)a.write_shift(1,0);return a}t.version="1.2.1";var m,g=64,_=-2,y="d0cf11e0a1b11ae1",b=[208,207,17,224,161,177,26,225],v="00000000000000000000000000000000",S={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:_,FREESECT:-1,HEADER_SIGNATURE:y,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:v,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function w(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function T(e){return m?m.deflateRawSync(e):X(e)}var E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],x=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function C(e){var t=139536&(e<<1|e<<11)|558144&(e<<5|e<<15);return 255&(t>>16|t>>8|t)}for(var R="undefined"!=typeof Uint8Array,D=R?new Uint8Array(256):[],P=0;P<256;++P)D[P]=C(P);function I(e,t){var r=D[255&e];return t<=8?r>>>8-t:(r=r<<8|D[e>>8&255],t<=16?r>>>16-t:(r=r<<8|D[e>>16&255])>>>24-t)}function k(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=6?0:e[n+1]<<8))>>>r&3}function M(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=5?0:e[n+1]<<8))>>>r&7}function $(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=3?0:e[n+1]<<8))>>>r&31}function O(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=1?0:e[n+1]<<8))>>>r&127}function N(e,t,r){var n=7&t,i=t>>>3,a=(1<<r)-1,o=e[i]>>>n;return r<8-n?o&a:(o|=e[i+1]<<8-n,r<16-n?o&a:(o|=e[i+2]<<16-n,r<24-n?o&a:(o|=e[i+3]<<24-n)&a))}function F(e,t,r){var n=7&t,i=t>>>3;return n<=5?e[i]|=(7&r)<<n:(e[i]|=r<<n&255,e[i+1]=(7&r)>>8-n),t+3}function L(e,t,r){return r=(1&r)<<(7&t),e[t>>>3]|=r,t+1}function B(e,t,r){var n=t>>>3;return r<<=7&t,e[n]|=255&r,r>>>=8,e[n+1]=r,t+8}function V(e,t,r){var n=t>>>3;return r<<=7&t,e[n]|=255&r,r>>>=8,e[n+1]=255&r,e[n+2]=r>>>8,t+16}function U(e,t){var r=e.length,n=2*r>t?2*r:t+5,i=0;if(r>=t)return e;if(has_buf$1){var a=new_unsafe_buf$1(n);if(e.copy)e.copy(a);else for(;i<e.length;++i)a[i]=e[i];return a}if(R){var o=new Uint8Array(n);if(o.set)o.set(e);else for(;i<r;++i)o[i]=e[i];return o}return e.length=n,e}function z(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}function H(e,t,r){var n=1,i=0,a=0,o=0,s=0,l=e.length,c=R?new Uint16Array(32):z(32);for(a=0;a<32;++a)c[a]=0;for(a=l;a<r;++a)e[a]=0;l=e.length;var u=R?new Uint16Array(l):z(l);for(a=0;a<l;++a)c[i=e[a]]++,n<i&&(n=i),u[a]=0;for(c[0]=0,a=1;a<=n;++a)c[a+16]=s=s+c[a-1]<<1;for(a=0;a<l;++a)0!=(s=e[a])&&(u[a]=c[s+16]++);var d=0;for(a=0;a<l;++a)if(0!=(d=e[a]))for(s=I(u[a],n)>>n-d,o=(1<<n+4-d)-1;o>=0;--o)t[s|o<<d]=15&d|a<<4;return n}var j=R?new Uint16Array(512):z(512),G=R?new Uint16Array(32):z(32);if(!R){for(var W=0;W<512;++W)j[W]=0;for(W=0;W<32;++W)G[W]=0}!function(){for(var e=[],t=0;t<32;t++)e.push(5);H(e,G,32);var r=[];for(t=0;t<=143;t++)r.push(8);for(;t<=255;t++)r.push(9);for(;t<=279;t++)r.push(7);for(;t<=287;t++)r.push(8);H(r,j,288)}();var q=function(){for(var e=R?new Uint8Array(32768):[],t=0,r=0;t<A.length-1;++t)for(;r<A[t+1];++r)e[r]=t;for(;r<32768;++r)e[r]=29;var n=R?new Uint8Array(259):[];for(t=0,r=0;t<x.length-1;++t)for(;r<x[t+1];++r)n[r]=t;return function(t,r){return t.length<8?function(e,t){for(var r=0;r<e.length;){var n=Math.min(65535,e.length-r),i=r+n==e.length;for(t.write_shift(1,+i),t.write_shift(2,n),t.write_shift(2,65535&~n);n-- >0;)t[t.l++]=e[r++]}return t.l}(t,r):function(t,r){for(var i=0,a=0,o=R?new Uint16Array(32768):[];a<t.length;){var s=Math.min(65535,t.length-a);if(s<10){for(7&(i=F(r,i,+!(a+s!=t.length)))&&(i+=8-(7&i)),r.l=i/8|0,r.write_shift(2,s),r.write_shift(2,65535&~s);s-- >0;)r[r.l++]=t[a++];i=8*r.l}else{i=F(r,i,+!(a+s!=t.length)+2);for(var l=0;s-- >0;){var c=t[a],u=-1,d=0;if((u=o[l=32767&(l<<5^c)])&&((u|=-32768&a)>a&&(u-=32768),u<a))for(;t[u+d]==t[a+d]&&d<250;)++d;if(d>2){(c=n[d])<=22?i=B(r,i,D[c+1]>>1)-1:(B(r,i,3),B(r,i+=5,D[c-23]>>5),i+=3);var h=c<8?0:c-4>>2;h>0&&(V(r,i,d-x[c]),i+=h),c=e[a-u],i=B(r,i,D[c]>>3),i-=3;var p=c<4?0:c-2>>1;p>0&&(V(r,i,a-u-A[c]),i+=p);for(var f=0;f<d;++f)o[l]=32767&a,l=32767&(l<<5^t[a]),++a;s-=d-1}else c<=143?c+=48:i=L(r,i,1),i=B(r,i,D[c]),o[l]=32767&a,++a}i=B(r,i,0)-1}}return r.l=(i+7)/8|0,r.l}(t,r)}}();function X(e){var t=new_buf$1(50+Math.floor(1.1*e.length)),r=q(e,t);return t.slice(0,r)}var K=R?new Uint16Array(32768):z(32768),Y=R?new Uint16Array(32768):z(32768),J=R?new Uint16Array(128):z(128),Z=1,Q=1;function ee(e,t){var r=$(e,t)+257,n=$(e,t+=5)+1,i=function(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=4?0:e[n+1]<<8))>>>r&15}(e,t+=5)+4;t+=4;for(var a=0,o=R?new Uint8Array(19):z(19),s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=1,c=R?new Uint8Array(8):z(8),u=R?new Uint8Array(8):z(8),d=o.length,h=0;h<i;++h)o[E[h]]=a=M(e,t),l<a&&(l=a),c[a]++,t+=3;var p=0;for(c[0]=0,h=1;h<=l;++h)u[h]=p=p+c[h-1]<<1;for(h=0;h<d;++h)0!=(p=o[h])&&(s[h]=u[p]++);var f=0;for(h=0;h<d;++h)if(0!=(f=o[h])){p=D[s[h]]>>8-f;for(var m=(1<<7-f)-1;m>=0;--m)J[p|m<<f]=7&f|h<<3}var g=[];for(l=1;g.length<r+n;)switch(t+=7&(p=J[O(e,t)]),p>>>=3){case 16:for(a=3+k(e,t),t+=2,p=g[g.length-1];a-- >0;)g.push(p);break;case 17:for(a=3+M(e,t),t+=3;a-- >0;)g.push(0);break;case 18:for(a=11+O(e,t),t+=7;a-- >0;)g.push(0);break;default:g.push(p),l<p&&(l=p)}var _=g.slice(0,r),y=g.slice(r);for(h=r;h<286;++h)_[h]=0;for(h=n;h<30;++h)y[h]=0;return Z=H(_,K,286),Q=H(y,Y,30),t}function te(e,t){var r=function(e,t){if(3==e[0]&&!(3&e[1]))return[new_raw_buf$1(t),2];for(var r=0,n=0,i=new_unsafe_buf$1(t||1<<18),a=0,o=i.length>>>0,s=0,l=0;!(1&n);)if(n=M(e,r),r+=3,n>>>1!=0)for(n>>1==1?(s=9,l=5):(r=ee(e,r),s=Z,l=Q);;){!t&&o<a+32767&&(o=(i=U(i,a+32767)).length);var c=N(e,r,s),u=n>>>1==1?j[c]:K[c];if(r+=15&u,(u>>>=4)>>>8&255){if(256==u)break;var d=(u-=257)<8?0:u-4>>2;d>5&&(d=0);var h=a+x[u];d>0&&(h+=N(e,r,d),r+=d),c=N(e,r,l),r+=15&(u=n>>>1==1?G[c]:Y[c]);var p=(u>>>=4)<4?0:u-2>>1,f=A[u];for(p>0&&(f+=N(e,r,p),r+=p),!t&&o<h&&(o=(i=U(i,h+100)).length);a<h;)i[a]=i[a-f],++a}else i[a++]=u}else{7&r&&(r+=8-(7&r));var m=e[r>>>3]|e[1+(r>>>3)]<<8;if(r+=32,m>0)for(!t&&o<a+m&&(o=(i=U(i,a+m)).length);m-- >0;)i[a++]=e[r>>>3],r+=8}return t?[i,r+7>>>3]:[i.slice(0,a),r+7>>>3]}(e.slice(e.l||0),t);return e.l+=r[1],r[0]}function re(e,t){if(!e)throw new Error(t);"undefined"!=typeof console&&console.error(t)}function ne(e,t){var r=e;prep_blob$1(r,0);var n={FileIndex:[],FullPaths:[]};h(n,{root:t.root});for(var i=r.length-4;(80!=r[i]||75!=r[i+1]||5!=r[i+2]||6!=r[i+3])&&i>=0;)--i;r.l=i+4,r.l+=4;var o=r.read_shift(2);r.l+=6;var s=r.read_shift(4);for(r.l=s,i=0;i<o;++i){r.l+=20;var l=r.read_shift(4),c=r.read_shift(4),u=r.read_shift(2),d=r.read_shift(2),p=r.read_shift(2);r.l+=8;var f=r.read_shift(4),m=a(r.slice(r.l+u,r.l+u+d));r.l+=u+d+p;var g=r.l;r.l=f+4,ie(r,l,c,n,m),r.l=g}return n}function ie(e,t,r,n,i){e.l+=2;var o=e.read_shift(2),s=e.read_shift(2),l=function(e){var t=65535&e.read_shift(2),r=65535&e.read_shift(2),n=new Date,i=31&r,a=15&(r>>>=5);r>>>=4,n.setMilliseconds(0),n.setFullYear(r+1980),n.setMonth(a-1),n.setDate(i);var o=31&t,s=63&(t>>>=5);return t>>>=6,n.setHours(t),n.setMinutes(s),n.setSeconds(o<<1),n}(e);if(8257&o)throw new Error("Unsupported ZIP encryption");e.read_shift(4);for(var c=e.read_shift(4),u=e.read_shift(4),d=e.read_shift(2),h=e.read_shift(2),p="",f=0;f<d;++f)p+=String.fromCharCode(e[e.l++]);if(h){var g=a(e.slice(e.l,e.l+h));(g[21589]||{}).mt&&(l=g[21589].mt),((i||{})[21589]||{}).mt&&(l=i[21589].mt)}e.l+=h;var _=e.slice(e.l,e.l+c);switch(s){case 8:_=function(e,t){if(!m)return te(e,t);var r=new(0,m.InflateRaw),n=r._processChunk(e.slice(e.l),r._finishFlushFlag);return e.l+=r.bytesRead,n}(e,u);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+s)}var y=!1;8&o&&(0x8074b50==e.read_shift(4)&&(e.read_shift(4),y=!0),c=e.read_shift(4),u=e.read_shift(4)),c!=t&&re(y,"Bad compressed size: "+t+" != "+c),u!=r&&re(y,"Bad uncompressed size: "+r+" != "+u),ue(n,p,_,{unsafe:!0,mt:l})}var ae={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function oe(e,t){if(e.ctype)return e.ctype;var r=e.name||"",n=r.match(/\.([^\.]+)$/);return n&&ae[n[1]]||t&&(n=(r=t).match(/[\.\\]([^\.\\])+$/))&&ae[n[1]]?ae[n[1]]:"application/octet-stream"}function se(e){for(var t=Base64_encode$1(e),r=[],n=0;n<t.length;n+=76)r.push(t.slice(n,n+76));return r.join("\r\n")+"\r\n"}function le(e){var t=e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,(function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return"="+(1==t.length?"0"+t:t)}));"\n"==(t=t.replace(/ $/gm,"=20").replace(/\t$/gm,"=09")).charAt(0)&&(t="=0D"+t.slice(1));for(var r=[],n=(t=t.replace(/\r(?!\n)/gm,"=0D").replace(/\n\n/gm,"\n=0A").replace(/([^\r\n])\n/gm,"$1=0A")).split("\r\n"),i=0;i<n.length;++i){var a=n[i];if(0!=a.length)for(var o=0;o<a.length;){var s=76,l=a.slice(o,o+s);"="==l.charAt(s-1)?s--:"="==l.charAt(s-2)?s-=2:"="==l.charAt(s-3)&&(s-=3),l=a.slice(o,o+s),(o+=s)<a.length&&(l+="="),r.push(l)}else r.push("")}return r.join("\r\n")}function ce(e,t,r){for(var n,i="",a="",o="",s=0;s<10;++s){var l=t[s];if(!l||l.match(/^\s*$/))break;var c=l.match(/^(.*?):\s*([^\s].*)$/);if(c)switch(c[1].toLowerCase()){case"content-location":i=c[2].trim();break;case"content-type":o=c[2].trim();break;case"content-transfer-encoding":a=c[2].trim()}}switch(++s,a.toLowerCase()){case"base64":n=s2a$1(Base64_decode$1(t.slice(s).join("")));break;case"quoted-printable":n=function(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r];r<=e.length&&"="==n.charAt(n.length-1);)n=n.slice(0,n.length-1)+e[++r];t.push(n)}for(var i=0;i<t.length;++i)t[i]=t[i].replace(/[=][0-9A-Fa-f]{2}/g,(function(e){return String.fromCharCode(parseInt(e.slice(1),16))}));return s2a$1(t.join("\r\n"))}(t.slice(s));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+a)}var u=ue(e,i.slice(r.length),n,{unsafe:!0});o&&(u.ctype=o)}function ue(e,t,r,i){var a=i&&i.unsafe;a||h(e);var o=!a&&CFB$1.find(e,t);if(!o){var s=e.FullPaths[0];t.slice(0,s.length)==s?s=t:("/"!=s.slice(-1)&&(s+="/"),s=(s+t).replace("//","/")),o={name:n(t),type:2},e.FileIndex.push(o),e.FullPaths.push(s),a||CFB$1.utils.cfb_gc(e)}return o.content=r,o.size=r?r.length:0,i&&(i.CLSID&&(o.clsid=i.CLSID),i.mt&&(o.mt=i.mt),i.ct&&(o.ct=i.ct)),o}return t.find=function(e,t){var r=e.FullPaths.map((function(e){return e.toUpperCase()})),n=r.map((function(e){var t=e.split("/");return t[t.length-("/"==e.slice(-1)?2:1)]})),i=!1;47===t.charCodeAt(0)?(i=!0,t=r[0].slice(0,-1)+t):i=-1!==t.indexOf("/");var a=t.toUpperCase(),o=!0===i?r.indexOf(a):n.indexOf(a);if(-1!==o)return e.FileIndex[o];var s=!a.match(chr1$1);for(a=a.replace(chr0$1,""),s&&(a=a.replace(chr1$1,"!")),o=0;o<r.length;++o){if((s?r[o].replace(chr1$1,"!"):r[o]).replace(chr0$1,"")==a)return e.FileIndex[o];if((s?n[o].replace(chr1$1,"!"):n[o]).replace(chr0$1,"")==a)return e.FileIndex[o]}return null},t.read=function(t,r){var n=r&&r.type;switch(n||has_buf$1&&Buffer.isBuffer(t)&&(n="buffer"),n||"base64"){case"file":return function(t,r){return o(),s(e.readFileSync(t),r)}(t,r);case"base64":return s(s2a$1(Base64_decode$1(t)),r);case"binary":return s(s2a$1(t),r)}return s(t,r)},t.parse=s,t.write=function(t,r){var n=f(t,r);switch(r&&r.type||"buffer"){case"file":return o(),e.writeFileSync(r.filename,n),n;case"binary":return"string"==typeof n?n:w(n);case"base64":return Base64_encode$1("string"==typeof n?n:w(n));case"buffer":if(has_buf$1)return Buffer.isBuffer(n)?n:Buffer_from$1(n);case"array":return"string"==typeof n?s2a$1(n):n}return n},t.writeFile=function(t,r,n){o();var i=f(t,n);e.writeFileSync(r,i)},t.utils={cfb_new:function(e){var t={};return h(t,e),t},cfb_add:ue,cfb_del:function(e,t){h(e);var r=CFB$1.find(e,t);if(r)for(var n=0;n<e.FileIndex.length;++n)if(e.FileIndex[n]==r)return e.FileIndex.splice(n,1),e.FullPaths.splice(n,1),!0;return!1},cfb_mov:function(e,t,r){h(e);var i=CFB$1.find(e,t);if(i)for(var a=0;a<e.FileIndex.length;++a)if(e.FileIndex[a]==i)return e.FileIndex[a].name=n(r),e.FullPaths[a]=r,!0;return!1},cfb_gc:function(e){p(e,!0)},ReadShift:ReadShift$1,CheckField:CheckField$1,prep_blob:prep_blob$1,bconcat:bconcat$1,use_zlib:function(e){try{var t=new(0,e.InflateRaw);if(t._processChunk(new Uint8Array([3,0]),t._finishFlushFlag),!t.bytesRead)throw new Error("zlib does not expose bytesRead");m=e}catch(r){console.error("cannot use native zlib: "+(r.message||r))}},_deflateRaw:X,_inflateRaw:te,consts:S},t}();function read_binary$1(e){if("undefined"!=typeof Deno)return Deno.readFileSync(e);if("undefined"!=typeof $&&"undefined"!=typeof File&&"undefined"!=typeof Folder)try{var t=File(e);t.open("r"),t.encoding="binary";var r=t.read();return t.close(),r}catch(n){if(!n.message||!n.message.match(/onstruct/))throw n}throw new Error("Cannot access file "+e)}function keys$4(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;++n)Object.prototype.hasOwnProperty.call(e,t[n])&&r.push(t[n]);return r}function evert$1(e){for(var t=[],r=keys$4(e),n=0;n!==r.length;++n)t[e[r[n]]]=r[n];return t}var basedate=new Date(1899,11,30,0,0,0);function datenum$1(e,t){return(e.getTime()-(basedate.getTime()+6e4*(e.getTimezoneOffset()-basedate.getTimezoneOffset())))/864e5}var refdate=new Date,dnthresh$1=basedate.getTime()+6e4*(refdate.getTimezoneOffset()-basedate.getTimezoneOffset()),refoffset=refdate.getTimezoneOffset();function numdate$1(e){var t=new Date;return t.setTime(24*e*60*60*1e3+dnthresh$1),t.getTimezoneOffset()!==refoffset&&t.setTime(t.getTime()+6e4*(t.getTimezoneOffset()-refoffset)),t}function parse_isodur$1(e){var t=0,r=0,n=!1,i=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!i)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var a=1;a!=i.length;++a)if(i[a]){switch(r=1,a>3&&(n=!0),i[a].slice(i[a].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[a].slice(i[a].length-1));case"D":r*=24;case"H":r*=60;case"M":if(!n)throw new Error("Unsupported ISO Duration Field: M");r*=60}t+=r*parseInt(i[a],10)}return t}var good_pd_date_1=new Date("2017-02-19T19:06:09.000Z"),good_pd_date=isNaN(good_pd_date_1.getFullYear())?new Date("2/19/17"):good_pd_date_1,good_pd=2017==good_pd_date.getFullYear();function parseDate$1(e,t){var r=new Date(e);if(good_pd)return t>0?r.setTime(r.getTime()+60*r.getTimezoneOffset()*1e3):t<0&&r.setTime(r.getTime()-60*r.getTimezoneOffset()*1e3),r;if(e instanceof Date)return e;if(1917==good_pd_date.getFullYear()&&!isNaN(r.getFullYear())){var n=r.getFullYear();return e.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var i=e.match(/\d+/g)||["2017","2","19","0","0","0"],a=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return e.indexOf("Z")>-1&&(a=new Date(a.getTime()-60*a.getTimezoneOffset()*1e3)),a}function cc2str$1(e,t){if(has_buf$1&&Buffer.isBuffer(e)){if(t){if(255==e[0]&&254==e[1])return utf8write$1(e.slice(2).toString("utf16le"));if(254==e[1]&&255==e[2])return utf8write$1(utf16beread$1(e.slice(2).toString("binary")))}return e.toString("binary")}if("undefined"!=typeof TextDecoder)try{if(t){if(255==e[0]&&254==e[1])return utf8write$1(new TextDecoder("utf-16le").decode(e.slice(2)));if(254==e[0]&&255==e[1])return utf8write$1(new TextDecoder("utf-16be").decode(e.slice(2)))}var r={"€":"\x80","‚":"\x82","ƒ":"\x83","„":"\x84","…":"\x85","†":"\x86","‡":"\x87","ˆ":"\x88","‰":"\x89","Š":"\x8a","‹":"\x8b","Œ":"\x8c","Ž":"\x8e","‘":"\x91","’":"\x92","“":"\x93","”":"\x94","•":"\x95","–":"\x96","—":"\x97","˜":"\x98","™":"\x99","š":"\x9a","›":"\x9b","œ":"\x9c","ž":"\x9e","Ÿ":"\x9f"};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,(function(e){return r[e]||e}))}catch(a){}for(var n=[],i=0;i!=e.length;++i)n.push(String.fromCharCode(e[i]));return n.join("")}function dup$1(e){if("undefined"!=typeof JSON&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if("object"!=typeof e||null==e)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=dup$1(e[r]));return t}function fill$3(e,t){for(var r="";r.length<t;)r+=e;return r}function fuzzynum$1(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,n=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,(function(){return r*=100,""}));return isNaN(t=Number(n))?(n=n.replace(/[(](.*)[)]/,(function(e,t){return r=-r,t})),isNaN(t=Number(n))?t:t/r):t/r}var lower_months$1=["january","february","march","april","may","june","july","august","september","october","november","december"];function fuzzydate$1(e){var t=new Date(e),r=new Date(NaN),n=t.getYear(),i=t.getMonth(),a=t.getDate();if(isNaN(a))return r;var o=e.toLowerCase();if(o.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if((o=o.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"")).length>3&&-1==lower_months$1.indexOf(o))return r}else if(o.match(/[a-z]/))return r;return n<0||n>8099?r:(i>0||a>1)&&101!=n?t:e.match(/[^-0-9:,\/\\]/)?r:t}var split_regex$1=function(){var e=5=="abacaba".split(/(:?b)/i).length;return function(t,r,n){if(e||"string"==typeof r)return t.split(r);for(var i=t.split(r),a=[i[0]],o=1;o<i.length;++o)a.push(n),a.push(i[o]);return a}}();function getdatastr$1(e){return e?e.content&&e.type?cc2str$1(e.content,!0):e.data?debom$1(e.data):e.asNodeBuffer&&has_buf$1?debom$1(e.asNodeBuffer().toString("binary")):e.asBinary?debom$1(e.asBinary()):e._data&&e._data.getContent?debom$1(cc2str$1(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function getdatabin$1(e){if(!e)return null;if(e.data)return char_codes$1(e.data);if(e.asNodeBuffer&&has_buf$1)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return"string"==typeof t?char_codes$1(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}function getdata$1(e){return e&&".bin"===e.name.slice(-4)?getdatabin$1(e):getdatastr$1(e)}function safegetzipfile$1(e,t){for(var r=e.FullPaths||keys$4(e.files),n=t.toLowerCase().replace(/[\/]/g,"\\"),i=n.replace(/\\/g,"/"),a=0;a<r.length;++a){var o=r[a].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==o||i==o)return e.files?e.files[r[a]]:e.FileIndex[a]}return null}function getzipfile$1(e,t){var r=safegetzipfile$1(e,t);if(null==r)throw new Error("Cannot find file "+t+" in zip");return r}function getzipdata$1(e,t,r){if(!r)return getdata$1(getzipfile$1(e,t));if(!t)return null;try{return getzipdata$1(e,t)}catch(n){return null}}function getzipstr$1(e,t,r){if(!r)return getdatastr$1(getzipfile$1(e,t));if(!t)return null;try{return getzipstr$1(e,t)}catch(n){return null}}function getzipbin$1(e,t,r){return getdatabin$1(getzipfile$1(e,t))}function zipentries$1(e){for(var t=e.FullPaths||keys$4(e.files),r=[],n=0;n<t.length;++n)"/"!=t[n].slice(-1)&&r.push(t[n].replace(/^Root Entry[\/]/,""));return r.sort()}function zip_add_file$1(e,t,r){if(e.FullPaths){var n;if("string"==typeof r)return n=has_buf$1?Buffer_from$1(r):utf8decode$1(r),CFB$1.utils.cfb_add(e,t,n);CFB$1.utils.cfb_add(e,t,r)}else e.file(t,r)}function zip_read$1(e,t){switch(t.type){case"base64":return CFB$1.read(e,{type:"base64"});case"binary":return CFB$1.read(e,{type:"binary"});case"buffer":case"array":return CFB$1.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function resolve_path$1(e,t){if("/"==e.charAt(0))return e.slice(1);var r=t.split("/");"/"!=t.slice(-1)&&r.pop();for(var n=e.split("/");0!==n.length;){var i=n.shift();".."===i?r.pop():"."!==i&&r.push(i)}return r.join("/")}var XML_HEADER$1='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n',attregexg$1=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,tagregex1$1=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm,tagregex2$1=/<[^>]*>/g,tagregex$1=XML_HEADER$1.match(tagregex1$1)?tagregex1$1:tagregex2$1,nsregex$1=/<\w*:/,nsregex2$1=/<(\/?)\w+:/;function parsexmltag$1(e,t,r){for(var n={},i=0,a=0;i!==e.length&&(32!==(a=e.charCodeAt(i))&&10!==a&&13!==a);++i);if(t||(n[0]=e.slice(0,i)),i===e.length)return n;var o=e.match(attregexg$1),s=0,l="",c=0,u="",d="",h=1;if(o)for(c=0;c!=o.length;++c){for(d=o[c],a=0;a!=d.length&&61!==d.charCodeAt(a);++a);for(u=d.slice(0,a).trim();32==d.charCodeAt(a+1);)++a;for(h=34==(i=d.charCodeAt(a+1))||39==i?1:0,l=d.slice(a+1+h,d.length-h),s=0;s!=u.length&&58!==u.charCodeAt(s);++s);if(s===u.length)u.indexOf("_")>0&&(u=u.slice(0,u.indexOf("_"))),n[u]=l,n[u.toLowerCase()]=l;else{var p=(5===s&&"xmlns"===u.slice(0,5)?"xmlns":"")+u.slice(s+1);if(n[p]&&"ext"==u.slice(s-3,s))continue;n[p]=l,n[p.toLowerCase()]=l}}return n}function strip_ns$1(e){return e.replace(nsregex2$1,"<$1")}var encodings$1={""":'"',"'":"'",">":">","<":"<","&":"&"},rencoding$1=evert$1(encodings$1),unescapexml$1=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/gi,t=/_x([\da-fA-F]{4})_/gi;return function r(n){var i=n+"",a=i.indexOf("<![CDATA[");if(-1==a)return i.replace(e,(function(e,t){return encodings$1[e]||String.fromCharCode(parseInt(t,e.indexOf("x")>-1?16:10))||e})).replace(t,(function(e,t){return String.fromCharCode(parseInt(t,16))}));var o=i.indexOf("]]>");return r(i.slice(0,a))+i.slice(a+9,o)+r(i.slice(o+3))}}(),decregex$1=/[&<>'"]/g,htmlcharegex$1=/[\u0000-\u001f]/g;function escapehtml$1(e){return(e+"").replace(decregex$1,(function(e){return rencoding$1[e]})).replace(/\n/g,"<br/>").replace(htmlcharegex$1,(function(e){return"&#x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"}))}var xlml_fixstr$1=function(){var e=/&#(\d+);/g;function t(e,t){return String.fromCharCode(parseInt(t,10))}return function(r){return r.replace(e,t)}}();function parsexmlbool$1(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function utf8reada$1(e){for(var t="",r=0,n=0,i=0,a=0,o=0,s=0;r<e.length;)(n=e.charCodeAt(r++))<128?t+=String.fromCharCode(n):(i=e.charCodeAt(r++),n>191&&n<224?(o=(31&n)<<6,o|=63&i,t+=String.fromCharCode(o)):(a=e.charCodeAt(r++),n<240?t+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&a):(s=((7&n)<<18|(63&i)<<12|(63&a)<<6|63&(o=e.charCodeAt(r++)))-65536,t+=String.fromCharCode(55296+(s>>>10&1023)),t+=String.fromCharCode(56320+(1023&s)))));return t}function utf8readb$1(e){var t,r,n,i=new_raw_buf$1(2*e.length),a=1,o=0,s=0;for(r=0;r<e.length;r+=a)a=1,(n=e.charCodeAt(r))<128?t=n:n<224?(t=64*(31&n)+(63&e.charCodeAt(r+1)),a=2):n<240?(t=4096*(15&n)+64*(63&e.charCodeAt(r+1))+(63&e.charCodeAt(r+2)),a=3):(a=4,t=262144*(7&n)+4096*(63&e.charCodeAt(r+1))+64*(63&e.charCodeAt(r+2))+(63&e.charCodeAt(r+3)),s=55296+((t-=65536)>>>10&1023),t=56320+(1023&t)),0!==s&&(i[o++]=255&s,i[o++]=s>>>8,s=0),i[o++]=t%256,i[o++]=t>>>8;return i.slice(0,o).toString("ucs2")}function utf8readc$1(e){return Buffer_from$1(e,"binary").toString("utf8")}var utf8corpus$1="foo bar baz\xe2\x98\x83\xf0\x9f\x8d\xa3",utf8read$1=has_buf$1&&(utf8readc$1(utf8corpus$1)==utf8reada$1(utf8corpus$1)&&utf8readc$1||utf8readb$1(utf8corpus$1)==utf8reada$1(utf8corpus$1)&&utf8readb$1)||utf8reada$1,utf8write$1=has_buf$1?function(e){return Buffer_from$1(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,n=0,i=0;r<e.length;)switch(n=e.charCodeAt(r++),!0){case n<128:t.push(String.fromCharCode(n));break;case n<2048:t.push(String.fromCharCode(192+(n>>6))),t.push(String.fromCharCode(128+(63&n)));break;case n>=55296&&n<57344:n-=55296,i=e.charCodeAt(r++)-56320+(n<<10),t.push(String.fromCharCode(240+(i>>18&7))),t.push(String.fromCharCode(144+(i>>12&63))),t.push(String.fromCharCode(128+(i>>6&63))),t.push(String.fromCharCode(128+(63&i)));break;default:t.push(String.fromCharCode(224+(n>>12))),t.push(String.fromCharCode(128+(n>>6&63))),t.push(String.fromCharCode(128+(63&n)))}return t.join("")},matchtag=function(){var e={};return function(t,r){var n=t+"|"+(r||"");return e[n]?e[n]:e[n]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",r||"")}}(),htmldecode$1=function(){var e=[["nbsp"," "],["middot","\xb7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map((function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]}));return function(t){for(var r=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),n=0;n<e.length;++n)r=r.replace(e[n][0],e[n][1]);return r}}(),vtregex=function(){var e={};return function(t){return void 0!==e[t]?e[t]:e[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}(),vtvregex$1=/<\/?(?:vt:)?variant>/g,vtmregex$1=/<(?:vt:)([^>]*)>([\s\S]*)</;function parseVector$1(e,t){var r=parsexmltag$1(e),n=e.match(vtregex(r.baseType))||[],i=[];if(n.length!=r.size){if(t.WTF)throw new Error("unexpected vector length "+n.length+" != "+r.size);return i}return n.forEach((function(e){var t=e.replace(vtvregex$1,"").match(vtmregex$1);t&&i.push({v:utf8read$1(t[2]),t:t[1]})})),i}var wtregex$1=/(^\s|\s$|\n)/;function wxt_helper$1(e){return keys$4(e).map((function(t){return" "+t+'="'+e[t]+'"'})).join("")}function writextag$1(e,t,r){return"<"+e+(null!=r?wxt_helper$1(r):"")+(null!=t?(t.match(wtregex$1)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function xlml_normalize$1(e){if(has_buf$1&&Buffer.isBuffer(e))return e.toString("utf8");if("string"==typeof e)return e;if("undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return utf8read$1(a2s$1(ab2a$1(e)));throw new Error("Bad input format: expected Buffer or string")}var xlmlregex$1=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/gm,XMLNS$1={CT:"http://schemas.openxmlformats.org/package/2006/content-types"},XMLNS_main$1=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function read_double_le$1(e,t){for(var r=1-2*(e[t+7]>>>7),n=((127&e[t+7])<<4)+(e[t+6]>>>4&15),i=15&e[t+6],a=5;a>=0;--a)i=256*i+e[t+a];return 2047==n?0==i?r*(1/0):NaN:(0==n?n=-1022:(n-=1023,i+=Math.pow(2,52)),r*Math.pow(2,n-52)*i)}function write_double_le$1(e,t,r){var n=(t<0||1/t==-1/0?1:0)<<7,i=0,a=0,o=n?-t:t;isFinite(o)?0==o?i=a=0:(i=Math.floor(Math.log(o)/Math.LN2),a=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(a)||a<Math.pow(2,52))?i=-1022:(a-=Math.pow(2,52),i+=1023)):(i=2047,a=isNaN(t)?26985:0);for(var s=0;s<=5;++s,a/=256)e[r+s]=255&a;e[r+6]=(15&i)<<4|15&a,e[r+7]=i>>4|n}var ___toBuffer$1=function(e){for(var t=[],r=0;r<e[0].length;++r)if(e[0][r])for(var n=0,i=e[0][r].length;n<i;n+=10240)t.push.apply(t,e[0][r].slice(n,n+10240));return t},__toBuffer$1=has_buf$1?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map((function(e){return Buffer.isBuffer(e)?e:Buffer_from$1(e)}))):___toBuffer$1(e)}:___toBuffer$1,___utf16le$1=function(e,t,r){for(var n=[],i=t;i<r;i+=2)n.push(String.fromCharCode(__readUInt16LE$1(e,i)));return n.join("").replace(chr0$1,"")},__utf16le$1=has_buf$1?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(chr0$1,""):___utf16le$1(e,t,r)}:___utf16le$1,___hexlify$1=function(e,t,r){for(var n=[],i=t;i<t+r;++i)n.push(("0"+e[i].toString(16)).slice(-2));return n.join("")},__hexlify$1=has_buf$1?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):___hexlify$1(e,t,r)}:___hexlify$1,___utf8$1=function(e,t,r){for(var n=[],i=t;i<r;i++)n.push(String.fromCharCode(__readUInt8$1(e,i)));return n.join("")},__utf8$1=has_buf$1?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf8",t,r):___utf8$1(e,t,r)}:___utf8$1,___lpstr$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r-1):""},__lpstr$1=___lpstr$1,___cpstr$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r-1):""},__cpstr$1=___cpstr$1,___lpwstr$1=function(e,t){var r=2*__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r-1):""},__lpwstr$1=___lpwstr$1,___lpp4$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf16le$1(e,t+4,t+4+r):""},__lpp4$1=___lpp4$1,___8lpp4$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r):""},__8lpp4$1=___8lpp4$1,___double$1=function(e,t){return read_double_le$1(e,t)},__double$1=___double$1,is_buf$1=function(e){return Array.isArray(e)||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array};has_buf$1&&(__lpstr$1=function(e,t){if(!Buffer.isBuffer(e))return ___lpstr$1(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},__cpstr$1=function(e,t){if(!Buffer.isBuffer(e))return ___cpstr$1(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},__lpwstr$1=function(e,t){if(!Buffer.isBuffer(e))return ___lpwstr$1(e,t);var r=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r-1)},__lpp4$1=function(e,t){if(!Buffer.isBuffer(e))return ___lpp4$1(e,t);var r=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r)},__8lpp4$1=function(e,t){if(!Buffer.isBuffer(e))return ___8lpp4$1(e,t);var r=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+r)},__double$1=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):___double$1(e,t)},is_buf$1=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array});var __readUInt8$1=function(e,t){return e[t]},__readUInt16LE$1=function(e,t){return 256*e[t+1]+e[t]},__readInt16LE$1=function(e,t){var r=256*e[t+1]+e[t];return r<32768?r:-1*(65535-r+1)},__readUInt32LE$1=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},__readInt32LE$1=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},__readInt32BE$1=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function ReadShift$1(e,t){var r,n,i,a,o,s,l="",c=[];switch(t){case"dbcs":if(s=this.l,has_buf$1&&Buffer.isBuffer(this))l=this.slice(this.l,this.l+2*e).toString("utf16le");else for(o=0;o<e;++o)l+=String.fromCharCode(__readUInt16LE$1(this,s)),s+=2;e*=2;break;case"utf8":l=__utf8$1(this,this.l,this.l+e);break;case"utf16le":e*=2,l=__utf16le$1(this,this.l,this.l+e);break;case"wstr":return ReadShift$1.call(this,e,"dbcs");case"lpstr-ansi":l=__lpstr$1(this,this.l),e=4+__readUInt32LE$1(this,this.l);break;case"lpstr-cp":l=__cpstr$1(this,this.l),e=4+__readUInt32LE$1(this,this.l);break;case"lpwstr":l=__lpwstr$1(this,this.l),e=4+2*__readUInt32LE$1(this,this.l);break;case"lpp4":e=4+__readUInt32LE$1(this,this.l),l=__lpp4$1(this,this.l),2&e&&(e+=2);break;case"8lpp4":e=4+__readUInt32LE$1(this,this.l),l=__8lpp4$1(this,this.l),3&e&&(e+=4-(3&e));break;case"cstr":for(e=0,l="";0!==(i=__readUInt8$1(this,this.l+e++));)c.push(_getchar$1(i));l=c.join("");break;case"_wstr":for(e=0,l="";0!==(i=__readUInt16LE$1(this,this.l+e));)c.push(_getchar$1(i)),e+=2;e+=2,l=c.join("");break;case"dbcs-cont":for(l="",s=this.l,o=0;o<e;++o){if(this.lens&&-1!==this.lens.indexOf(s))return i=__readUInt8$1(this,s),this.l=s+1,a=ReadShift$1.call(this,e-o,i?"dbcs-cont":"sbcs-cont"),c.join("")+a;c.push(_getchar$1(__readUInt16LE$1(this,s))),s+=2}l=c.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(l="",s=this.l,o=0;o!=e;++o){if(this.lens&&-1!==this.lens.indexOf(s))return i=__readUInt8$1(this,s),this.l=s+1,a=ReadShift$1.call(this,e-o,i?"dbcs-cont":"sbcs-cont"),c.join("")+a;c.push(_getchar$1(__readUInt8$1(this,s))),s+=1}l=c.join("");break;default:switch(e){case 1:return r=__readUInt8$1(this,this.l),this.l++,r;case 2:return r=("i"===t?__readInt16LE$1:__readUInt16LE$1)(this,this.l),this.l+=2,r;case 4:case-4:return"i"!==t&&128&this[this.l+3]?(n=__readUInt32LE$1(this,this.l),this.l+=4,n):(r=(e>0?__readInt32LE$1:__readInt32BE$1)(this,this.l),this.l+=4,r);case 8:case-8:if("f"===t)return n=8==e?__double$1(this,this.l):__double$1([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,n;e=8;case 16:l=__hexlify$1(this,this.l,e)}}return this.l+=e,l}var __writeUInt32LE$1=function(e,t,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},__writeInt32LE$1=function(e,t,r){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},__writeUInt16LE$1=function(e,t,r){e[r]=255&t,e[r+1]=t>>>8&255};function WriteShift$1(e,t,r){var n=0,i=0;if("dbcs"===r){for(i=0;i!=t.length;++i)__writeUInt16LE$1(this,t.charCodeAt(i),this.l+2*i);n=2*t.length}else if("sbcs"===r){for(t=t.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=t.length;++i)this[this.l+i]=255&t.charCodeAt(i);n=t.length}else{if("hex"===r){for(;i<e;++i)this[this.l++]=parseInt(t.slice(2*i,2*i+2),16)||0;return this}if("utf16le"===r){var a=Math.min(this.l+e,this.length);for(i=0;i<Math.min(t.length,e);++i){var o=t.charCodeAt(i);this[this.l++]=255&o,this[this.l++]=o>>8}for(;this.l<a;)this[this.l++]=0;return this}switch(e){case 1:n=1,this[this.l]=255&t;break;case 2:n=2,this[this.l]=255&t,t>>>=8,this[this.l+1]=255&t;break;case 3:n=3,this[this.l]=255&t,t>>>=8,this[this.l+1]=255&t,t>>>=8,this[this.l+2]=255&t;break;case 4:n=4,__writeUInt32LE$1(this,t,this.l);break;case 8:if(n=8,"f"===r){write_double_le$1(this,t,this.l);break}case 16:break;case-4:n=4,__writeInt32LE$1(this,t,this.l)}}return this.l+=n,this}function CheckField$1(e,t){var r=__hexlify$1(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function prep_blob$1(e,t){e.l=t,e.read_shift=ReadShift$1,e.chk=CheckField$1,e.write_shift=WriteShift$1}function parsenoop$1(e,t){e.l+=t}function new_buf$1(e){var t=new_raw_buf$1(e);return prep_blob$1(t,0),t}function recordhopper$1(e,t,r){if(e){var n,i,a;prep_blob$1(e,e.l||0);for(var o=e.length,s=0,l=0;e.l<o;){128&(s=e.read_shift(1))&&(s=(127&s)+((127&e.read_shift(1))<<7));var c=XLSBRecordEnum$1[s]||XLSBRecordEnum$1[65535];for(a=127&(n=e.read_shift(1)),i=1;i<4&&128&n;++i)a+=(127&(n=e.read_shift(1)))<<7*i;l=e.l+a;var u=c.f&&c.f(e,a,r);if(e.l=l,t(u,c,s))return}}}function buf_array$1(){var e=[],t=has_buf$1?256:2048,r=function(e){var t=new_buf$1(e);return prep_blob$1(t,0),t},n=r(t),i=function(){n&&(n.length>n.l&&((n=n.slice(0,n.l)).l=n.length),n.length>0&&e.push(n),n=null)},a=function(e){return n&&e<n.length-n.l?n:(i(),n=r(Math.max(e+1,t)))};return{next:a,push:function(e){i(),null==(n=e).l&&(n.l=n.length),a(t)},end:function(){return i(),bconcat$1(e)},_bufs:e}}function shift_cell_xls$1(e,t,r){var n=dup$1(e);if(t.s?(n.cRel&&(n.c+=t.s.c),n.rRel&&(n.r+=t.s.r)):(n.cRel&&(n.c+=t.c),n.rRel&&(n.r+=t.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function shift_range_xls$1(e,t,r){var n=dup$1(e);return n.s=shift_cell_xls$1(n.s,t.s,r),n.e=shift_cell_xls$1(n.e,t.s,r),n}function encode_cell_xls$1(e,t){if(e.cRel&&e.c<0)for(e=dup$1(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=dup$1(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=encode_cell$1(e);return e.cRel||null==e.cRel||(r=fix_col$1(r)),e.rRel||null==e.rRel||(r=fix_row$1(r)),r}function encode_range_xls$1(e,t){return 0!=e.s.r||e.s.rRel||e.e.r!=(t.biff>=12?1048575:t.biff>=8?65536:16384)||e.e.rRel?0!=e.s.c||e.s.cRel||e.e.c!=(t.biff>=12?16383:255)||e.e.cRel?encode_cell_xls$1(e.s,t.biff)+":"+encode_cell_xls$1(e.e,t.biff):(e.s.rRel?"":"$")+encode_row$1(e.s.r)+":"+(e.e.rRel?"":"$")+encode_row$1(e.e.r):(e.s.cRel?"":"$")+encode_col$1(e.s.c)+":"+(e.e.cRel?"":"$")+encode_col$1(e.e.c)}function decode_row$1(e){return parseInt(unfix_row$1(e),10)-1}function encode_row$1(e){return""+(e+1)}function fix_row$1(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function unfix_row$1(e){return e.replace(/\$(\d+)$/,"$1")}function decode_col$1(e){for(var t=unfix_col$1(e),r=0,n=0;n!==t.length;++n)r=26*r+t.charCodeAt(n)-64;return r-1}function encode_col$1(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function fix_col$1(e){return e.replace(/^([A-Z])/,"$$$1")}function unfix_col$1(e){return e.replace(/^\$([A-Z])/,"$1")}function split_cell$1(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function decode_cell$1(e){for(var t=0,r=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);i>=48&&i<=57?t=10*t+(i-48):i>=65&&i<=90&&(r=26*r+(i-64))}return{c:r-1,r:t-1}}function encode_cell$1(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function decode_range$1(e){var t=e.indexOf(":");return-1==t?{s:decode_cell$1(e),e:decode_cell$1(e)}:{s:decode_cell$1(e.slice(0,t)),e:decode_cell$1(e.slice(t+1))}}function encode_range$1(e,t){return void 0===t||"number"==typeof t?encode_range$1(e.s,e.e):("string"!=typeof e&&(e=encode_cell$1(e)),"string"!=typeof t&&(t=encode_cell$1(t)),e==t?e:e+":"+t)}function safe_decode_range$1(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,i=0,a=e.length;for(r=0;n<a&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.s.c=--r,r=0;n<a&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;if(t.s.r=--r,n===a||10!=i)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++n,r=0;n!=a&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.e.c=--r,r=0;n!=a&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;return t.e.r=--r,t}function safe_format_cell$1(e,t){var r="d"==e.t&&t instanceof Date;if(null!=e.z)try{return e.w=SSF_format$1(e.z,r?datenum$1(t):t)}catch(n){}try{return e.w=SSF_format$1((e.XF||{}).numFmtId||(r?14:0),r?datenum$1(t):t)}catch(n){return""+t}}function format_cell$1(e,t,r){return null==e||null==e.t||"z"==e.t?"":void 0!==e.w?e.w:("d"==e.t&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),"e"==e.t?BErr$1[e.v]||e.v:safe_format_cell$1(e,null==t?e.v:t))}function sheet_to_workbook$1(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",n={};return n[r]=e,{SheetNames:[r],Sheets:n}}function sheet_add_aoa$1(e,t,r){var n=r||{},i=e?Array.isArray(e):n.dense,a=e||(i?[]:{}),o=0,s=0;if(a&&null!=n.origin){if("number"==typeof n.origin)o=n.origin;else{var l="string"==typeof n.origin?decode_cell$1(n.origin):n.origin;o=l.r,s=l.c}a["!ref"]||(a["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(a["!ref"]){var u=safe_decode_range$1(a["!ref"]);c.s.c=u.s.c,c.s.r=u.s.r,c.e.c=Math.max(c.e.c,u.e.c),c.e.r=Math.max(c.e.r,u.e.r),-1==o&&(c.e.r=o=u.e.r+1)}for(var d=0;d!=t.length;++d)if(t[d]){if(!Array.isArray(t[d]))throw new Error("aoa_to_sheet expects an array of arrays");for(var h=0;h!=t[d].length;++h)if(void 0!==t[d][h]){var p={v:t[d][h]},f=o+d,m=s+h;if(c.s.r>f&&(c.s.r=f),c.s.c>m&&(c.s.c=m),c.e.r<f&&(c.e.r=f),c.e.c<m&&(c.e.c=m),!t[d][h]||"object"!=typeof t[d][h]||Array.isArray(t[d][h])||t[d][h]instanceof Date)if(Array.isArray(p.v)&&(p.f=t[d][h][1],p.v=p.v[0]),null===p.v)if(p.f)p.t="n";else if(n.nullError)p.t="e",p.v=0;else{if(!n.sheetStubs)continue;p.t="z"}else"number"==typeof p.v?p.t="n":"boolean"==typeof p.v?p.t="b":p.v instanceof Date?(p.z=n.dateNF||table_fmt$1[14],n.cellDates?(p.t="d",p.w=SSF_format$1(p.z,datenum$1(p.v))):(p.t="n",p.v=datenum$1(p.v),p.w=SSF_format$1(p.z,p.v))):p.t="s";else p=t[d][h];if(i)a[f]||(a[f]=[]),a[f][m]&&a[f][m].z&&(p.z=a[f][m].z),a[f][m]=p;else{var g=encode_cell$1({c:m,r:f});a[g]&&a[g].z&&(p.z=a[g].z),a[g]=p}}}return c.s.c<1e7&&(a["!ref"]=encode_range$1(c)),a}function aoa_to_sheet$1(e,t){return sheet_add_aoa$1(null,e,t)}function parse_Int32LE$1(e){return e.read_shift(4,"i")}function parse_XLWideString$1(e){var t=e.read_shift(4);return 0===t?"":e.read_shift(t,"dbcs")}function parse_StrRun$1(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function parse_RichStr$1(e,t){var r=e.l,n=e.read_shift(1),i=parse_XLWideString$1(e),a=[],o={t:i,h:i};if(1&n){for(var s=e.read_shift(4),l=0;l!=s;++l)a.push(parse_StrRun$1(e));o.r=a}else o.r=[{ich:0,ifnt:0}];return e.l=r+t,o}var parse_BrtCommentText$1=parse_RichStr$1;function parse_XLSBCell$1(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function parse_XLSBShortCell$1(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}var parse_XLSBCodeName$1=parse_XLWideString$1;function parse_XLNullableWideString$1(e){var t=e.read_shift(4);return 0===t||0xffffffff===t?"":e.read_shift(t,"dbcs")}var parse_XLNameWideString$1=parse_XLWideString$1,parse_RelID$1=parse_XLNullableWideString$1;function parse_RkNumber$1(e){var t=e.slice(e.l,e.l+4),r=1&t[0],n=2&t[0];e.l+=4;var i=0===n?__double$1([0,0,0,0,252&t[0],t[1],t[2],t[3]],0):__readInt32LE$1(t,0)>>2;return r?i/100:i}function parse_RfX$1(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}var parse_UncheckedRfX$1=parse_RfX$1;function parse_Xnum$1(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function parse_BrtColor$1(e){var t={},r=e.read_shift(1)>>>1,n=e.read_shift(1),i=e.read_shift(2,"i"),a=e.read_shift(1),o=e.read_shift(1),s=e.read_shift(1);switch(e.l++,r){case 0:t.auto=1;break;case 1:t.index=n;var l=XLSIcv$1[n];l&&(t.rgb=rgb2Hex$1(l));break;case 2:t.rgb=rgb2Hex$1([a,o,s]);break;case 3:t.theme=n}return 0!=i&&(t.tint=i>0?i/32767:i/32768),t}function parse_FontFlags$1(e){var t=e.read_shift(1);return e.l++,{fBold:1&t,fItalic:2&t,fUnderline:4&t,fStrikeout:8&t,fOutline:16&t,fShadow:32&t,fCondense:64&t,fExtend:128&t}}function parse_ClipboardFormatOrString$1(e,t){var r=e.read_shift(4);switch(r){case 0:return"";case 0xffffffff:case 0xfffffffe:return{2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"}[e.read_shift(4)]||""}if(r>400)throw new Error("Unsupported Clipboard: "+r.toString(16));return e.l-=4,e.read_shift(0,1==t?"lpstr":"lpwstr")}function parse_ClipboardFormatOrAnsiString$1(e){return parse_ClipboardFormatOrString$1(e,1)}function parse_ClipboardFormatOrUnicodeString$1(e){return parse_ClipboardFormatOrString$1(e,2)}var VT_I2$1=2,VT_I4$1=3,VT_BOOL$1=11,VT_VARIANT$1=12,VT_UI4$1=19,VT_FILETIME$1=64,VT_BLOB$1=65,VT_CF$1=71,VT_VECTOR_VARIANT$1=4108,VT_VECTOR_LPSTR$1=4126,VT_STRING$1=80,VT_USTR$1=81,VT_CUSTOM$1=[VT_STRING$1,VT_USTR$1],DocSummaryPIDDSI$1={1:{n:"CodePage",t:VT_I2$1},2:{n:"Category",t:VT_STRING$1},3:{n:"PresentationFormat",t:VT_STRING$1},4:{n:"ByteCount",t:VT_I4$1},5:{n:"LineCount",t:VT_I4$1},6:{n:"ParagraphCount",t:VT_I4$1},7:{n:"SlideCount",t:VT_I4$1},8:{n:"NoteCount",t:VT_I4$1},9:{n:"HiddenCount",t:VT_I4$1},10:{n:"MultimediaClipCount",t:VT_I4$1},11:{n:"ScaleCrop",t:VT_BOOL$1},12:{n:"HeadingPairs",t:VT_VECTOR_VARIANT$1},13:{n:"TitlesOfParts",t:VT_VECTOR_LPSTR$1},14:{n:"Manager",t:VT_STRING$1},15:{n:"Company",t:VT_STRING$1},16:{n:"LinksUpToDate",t:VT_BOOL$1},17:{n:"CharacterCount",t:VT_I4$1},19:{n:"SharedDoc",t:VT_BOOL$1},22:{n:"HyperlinksChanged",t:VT_BOOL$1},23:{n:"AppVersion",t:VT_I4$1,p:"version"},24:{n:"DigSig",t:VT_BLOB$1},26:{n:"ContentType",t:VT_STRING$1},27:{n:"ContentStatus",t:VT_STRING$1},28:{n:"Language",t:VT_STRING$1},29:{n:"Version",t:VT_STRING$1},255:{},0x80000000:{n:"Locale",t:VT_UI4$1},0x80000003:{n:"Behavior",t:VT_UI4$1},0x72627262:{}},SummaryPIDSI$1={1:{n:"CodePage",t:VT_I2$1},2:{n:"Title",t:VT_STRING$1},3:{n:"Subject",t:VT_STRING$1},4:{n:"Author",t:VT_STRING$1},5:{n:"Keywords",t:VT_STRING$1},6:{n:"Comments",t:VT_STRING$1},7:{n:"Template",t:VT_STRING$1},8:{n:"LastAuthor",t:VT_STRING$1},9:{n:"RevNumber",t:VT_STRING$1},10:{n:"EditTime",t:VT_FILETIME$1},11:{n:"LastPrinted",t:VT_FILETIME$1},12:{n:"CreatedDate",t:VT_FILETIME$1},13:{n:"ModifiedDate",t:VT_FILETIME$1},14:{n:"PageCount",t:VT_I4$1},15:{n:"WordCount",t:VT_I4$1},16:{n:"CharCount",t:VT_I4$1},17:{n:"Thumbnail",t:VT_CF$1},18:{n:"Application",t:VT_STRING$1},19:{n:"DocSecurity",t:VT_I4$1},255:{},0x80000000:{n:"Locale",t:VT_UI4$1},0x80000003:{n:"Behavior",t:VT_UI4$1},0x72627262:{}},CountryEnum$1={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},XLSFillPattern$1=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function rgbify$1(e){return e.map((function(e){return[e>>16&255,e>>8&255,255&e]}))}var _XLSIcv$1=rgbify$1([0,0xffffff,0xff0000,65280,255,0xffff00,0xff00ff,65535,0,0xffffff,0xff0000,65280,255,0xffff00,0xff00ff,65535,8388608,32768,128,8421376,8388736,32896,0xc0c0c0,8421504,0x9999ff,0x993366,0xffffcc,0xccffff,6684774,0xff8080,26316,0xccccff,128,0xff00ff,0xffff00,65535,8388736,8388608,32896,255,52479,0xccffff,0xccffcc,0xffff99,0x99ccff,0xff99cc,0xcc99ff,0xffcc99,3368703,3394764,0x99cc00,0xffcc00,0xff9900,0xff6600,6710937,9868950,13158,3381606,13056,3355392,0x993300,0x993366,3355545,3355443,0xffffff,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),XLSIcv$1=dup$1(_XLSIcv$1),BErr$1={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},RBErr$1={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},ct2type$1={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};function new_ct$1(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function parse_ct$1(e){var t=new_ct$1();if(!e||!e.match)return t;var r={};if((e.match(tagregex$1)||[]).forEach((function(e){var n=parsexmltag$1(e);switch(n[0].replace(nsregex$1,"<")){case"<?xml":break;case"<Types":t.xmlns=n["xmlns"+(n[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[n.Extension]=n.ContentType;break;case"<Override":void 0!==t[ct2type$1[n.ContentType]]&&t[ct2type$1[n.ContentType]].push(n.PartName)}})),t.xmlns!==XMLNS$1.CT)throw new Error("Unknown Namespace: "+t.xmlns);return t.calcchain=t.calcchains.length>0?t.calcchains[0]:"",t.sst=t.strs.length>0?t.strs[0]:"",t.style=t.styles.length>0?t.styles[0]:"",t.defaults=r,delete t.calcchains,t}var RELS$1={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function get_rels_path$1(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function parse_rels$1(e,t){var r={"!id":{}};if(!e)return r;"/"!==t.charAt(0)&&(t="/"+t);var n={};return(e.match(tagregex$1)||[]).forEach((function(e){var i=parsexmltag$1(e);if("<Relationship"===i[0]){var a={};a.Type=i.Type,a.Target=i.Target,a.Id=i.Id,i.TargetMode&&(a.TargetMode=i.TargetMode);var o="External"===i.TargetMode?i.Target:resolve_path$1(i.Target,t);r[o]=a,n[i.Id]=a}})),r["!id"]=n,r}var CT_ODS$1="application/vnd.oasis.opendocument.spreadsheet";function parse_manifest$1(e,t){for(var r,n,i=xlml_normalize$1(e);r=xlmlregex$1.exec(i);)switch(r[3]){case"manifest":break;case"file-entry":if("/"==(n=parsexmltag$1(r[0],!1)).path&&n.type!==CT_ODS$1)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(t&&t.WTF)throw r}}var CORE_PROPS$1=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],CORE_PROPS_REGEX=function(){for(var e=new Array(CORE_PROPS$1.length),t=0;t<CORE_PROPS$1.length;++t){var r=CORE_PROPS$1[t],n="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);e[t]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return e}();function parse_core_props$1(e){var t={};e=utf8read$1(e);for(var r=0;r<CORE_PROPS$1.length;++r){var n=CORE_PROPS$1[r],i=e.match(CORE_PROPS_REGEX[r]);null!=i&&i.length>0&&(t[n[1]]=unescapexml$1(i[1])),"date"===n[2]&&t[n[1]]&&(t[n[1]]=parseDate$1(t[n[1]]))}return t}var EXT_PROPS$1=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function load_props_pairs$1(e,t,r,n){var i=[];if("string"==typeof e)i=parseVector$1(e,n);else for(var a=0;a<e.length;++a)i=i.concat(e[a].map((function(e){return{v:e}})));var o="string"==typeof t?parseVector$1(t,n).map((function(e){return e.v})):t,s=0,l=0;if(o.length>0)for(var c=0;c!==i.length;c+=2){switch(l=+i[c+1].v,i[c].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsbl\xe4tter":case"\xc7alışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de c\xe1lculo":case"Planilhas":case"Regneark":case"Hojas de c\xe1lculo":case"Werkbladen":r.Worksheets=l,r.SheetNames=o.slice(s,s+l);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne omr\xe5der":r.NamedRanges=l,r.DefinedNames=o.slice(s,s+l);break;case"Charts":case"Diagramme":r.Chartsheets=l,r.ChartNames=o.slice(s,s+l)}s+=l}}function parse_ext_props$1(e,t,r){var n={};return t||(t={}),e=utf8read$1(e),EXT_PROPS$1.forEach((function(r){var i=(e.match(matchtag(r[0]))||[])[1];switch(r[2]){case"string":i&&(t[r[1]]=unescapexml$1(i));break;case"bool":t[r[1]]="true"===i;break;case"raw":var a=e.match(new RegExp("<"+r[0]+"[^>]*>([\\s\\S]*?)</"+r[0]+">"));a&&a.length>0&&(n[r[1]]=a[1])}})),n.HeadingPairs&&n.TitlesOfParts&&load_props_pairs$1(n.HeadingPairs,n.TitlesOfParts,t,r),t}var custregex$1=/<[^>]+>[^<]*/g;function parse_cust_props$1(e,t){var r={},n="",i=e.match(custregex$1);if(i)for(var a=0;a!=i.length;++a){var o=i[a],s=parsexmltag$1(o);switch(s[0]){case"<?xml":case"<Properties":break;case"<property":n=unescapexml$1(s.name);break;case"</property>":n=null;break;default:if(0===o.indexOf("<vt:")){var l=o.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":case"cy":case"error":r[n]=unescapexml$1(u);break;case"bool":r[n]=parsexmlbool$1(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[n]=parseInt(u,10);break;case"r4":case"r8":case"decimal":r[n]=parseFloat(u);break;case"filetime":case"date":r[n]=parseDate$1(u);break;default:if("/"==c.slice(-1))break;t.WTF&&"undefined"!=typeof console&&console.warn("Unexpected",o,c,l)}}else if("</"===o.slice(0,2));else if(t.WTF)throw new Error(o)}}return r}var XLMLDocPropsMap$1={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},evert_XLMLDPM$1;function xlml_set_prop$1(e,t,r){evert_XLMLDPM$1||(evert_XLMLDPM$1=evert$1(XLMLDocPropsMap$1)),e[t=evert_XLMLDPM$1[t]||t]=r}function parse_FILETIME$1(e){var t=e.read_shift(4),r=e.read_shift(4);return new Date(1e3*(r/1e7*Math.pow(2,32)+t/1e7-0x2b6109100)).toISOString().replace(/\.000/,"")}function parse_lpstr$1(e,t,r){var n=e.l,i=e.read_shift(0,"lpstr-cp");if(r)for(;e.l-n&3;)++e.l;return i}function parse_lpwstr$1(e,t,r){return e.read_shift(0,"lpwstr")}function parse_VtStringBase$1(e,t,r){return 31===t?parse_lpwstr$1(e):parse_lpstr$1(e,t,r)}function parse_VtString$1(e,t,r){return parse_VtStringBase$1(e,t,!1===r?0:4)}function parse_VtUnalignedString$1(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return parse_VtStringBase$1(e,t,0)}function parse_VtVecLpwstrValue$1(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n){var i=e.l;r[n]=e.read_shift(0,"lpwstr").replace(chr0$1,""),e.l-i&2&&(e.l+=2)}return r}function parse_VtVecUnalignedLpstrValue$1(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n)r[n]=e.read_shift(0,"lpstr-cp").replace(chr0$1,"");return r}function parse_VtHeadingPair$1(e){var t=e.l,r=parse_TypedPropertyValue$1(e,VT_USTR$1);return 0==e[e.l]&&0==e[e.l+1]&&e.l-t&2&&(e.l+=2),[r,parse_TypedPropertyValue$1(e,VT_I4$1)]}function parse_VtVecHeadingPairValue$1(e){for(var t=e.read_shift(4),r=[],n=0;n<t/2;++n)r.push(parse_VtHeadingPair$1(e));return r}function parse_dictionary$1(e,t){for(var r=e.read_shift(4),n={},i=0;i!=r;++i){var a=e.read_shift(4),o=e.read_shift(4);n[a]=e.read_shift(o,1200===t?"utf16le":"utf8").replace(chr0$1,"").replace(chr1$1,"!"),1200===t&&o%2&&(e.l+=2)}return 3&e.l&&(e.l=e.l>>3<<2),n}function parse_BLOB$1(e){var t=e.read_shift(4),r=e.slice(e.l,e.l+t);return e.l+=t,(3&t)>0&&(e.l+=4-(3&t)&3),r}function parse_ClipboardData$1(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}function parse_TypedPropertyValue$1(e,t,r){var n,i=e.read_shift(2),a=r||{};if(e.l+=2,t!==VT_VARIANT$1&&i!==t&&-1===VT_CUSTOM$1.indexOf(t)&&(4126!=(65534&t)||4126!=(65534&i)))throw new Error("Expected type "+t+" saw "+i);switch(t===VT_VARIANT$1?i:t){case 2:return n=e.read_shift(2,"i"),a.raw||(e.l+=2),n;case 3:return n=e.read_shift(4,"i");case 11:return 0!==e.read_shift(4);case 19:return n=e.read_shift(4);case 30:return parse_lpstr$1(e,i,4).replace(chr0$1,"");case 31:return parse_lpwstr$1(e);case 64:return parse_FILETIME$1(e);case 65:return parse_BLOB$1(e);case 71:return parse_ClipboardData$1(e);case 80:return parse_VtString$1(e,i,!a.raw).replace(chr0$1,"");case 81:return parse_VtUnalignedString$1(e,i).replace(chr0$1,"");case 4108:return parse_VtVecHeadingPairValue$1(e);case 4126:case 4127:return 4127==i?parse_VtVecLpwstrValue$1(e):parse_VtVecUnalignedLpstrValue$1(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+i)}}function parse_PropertySet$1(e,t){var r=e.l,n=e.read_shift(4),i=e.read_shift(4),a=[],o=0,s=0,l=-1,c={};for(o=0;o!=i;++o){var u=e.read_shift(4),d=e.read_shift(4);a[o]=[u,d+r]}a.sort((function(e,t){return e[1]-t[1]}));var h={};for(o=0;o!=i;++o){if(e.l!==a[o][1]){var p=!0;if(o>0&&t)switch(t[a[o-1][0]].t){case 2:e.l+2===a[o][1]&&(e.l+=2,p=!1);break;case 80:case 4108:e.l<=a[o][1]&&(e.l=a[o][1],p=!1)}if((!t||0==o)&&e.l<=a[o][1]&&(p=!1,e.l=a[o][1]),p)throw new Error("Read Error: Expected address "+a[o][1]+" at "+e.l+" :"+o)}if(t){var f=t[a[o][0]];if(h[f.n]=parse_TypedPropertyValue$1(e,f.t,{raw:!0}),"version"===f.p&&(h[f.n]=String(h[f.n]>>16)+"."+("0000"+String(65535&h[f.n])).slice(-4)),"CodePage"==f.n)switch(h[f.n]){case 0:h[f.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:set_cp$1(s=h[f.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+h[f.n])}}else if(1===a[o][0]){if(s=h.CodePage=parse_TypedPropertyValue$1(e,VT_I2$1),set_cp$1(s),-1!==l){var m=e.l;e.l=a[l][1],c=parse_dictionary$1(e,s),e.l=m}}else if(0===a[o][0]){if(0===s){l=o,e.l=a[o+1][1];continue}c=parse_dictionary$1(e,s)}else{var g,_=c[a[o][0]];switch(e[e.l]){case 65:e.l+=4,g=parse_BLOB$1(e);break;case 30:case 31:e.l+=4,g=parse_VtString$1(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,g=e.read_shift(4,"i");break;case 19:e.l+=4,g=e.read_shift(4);break;case 5:e.l+=4,g=e.read_shift(8,"f");break;case 11:e.l+=4,g=parsebool$1(e,4);break;case 64:e.l+=4,g=parseDate$1(parse_FILETIME$1(e));break;default:throw new Error("unparsed value: "+e[e.l])}h[_]=g}}return e.l=r+n,h}function parse_PropertySetStream$1(e,t,r){var n=e.content;if(!n)return{};prep_blob$1(n,0);var i,a,o,s,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var c=n.read_shift(4),u=n.read_shift(16);if(u!==CFB$1.utils.consts.HEADER_CLSID&&u!==r)throw new Error("Bad PropertySet CLSID "+u);if(1!==(i=n.read_shift(4))&&2!==i)throw new Error("Unrecognized #Sets: "+i);if(a=n.read_shift(16),s=n.read_shift(4),1===i&&s!==n.l)throw new Error("Length mismatch: "+s+" !== "+n.l);2===i&&(o=n.read_shift(16),l=n.read_shift(4));var d,h=parse_PropertySet$1(n,t),p={SystemIdentifier:c};for(var f in h)p[f]=h[f];if(p.FMTID=a,1===i)return p;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);try{d=parse_PropertySet$1(n,null)}catch(m){}for(f in d)p[f]=d[f];return p.FMTID=[a,o],p}function parsenoop2$1(e,t){return e.read_shift(t),null}function parslurp$1(e,t,r){for(var n=[],i=e.l+t;e.l<i;)n.push(r(e,i-e.l));if(i!==e.l)throw new Error("Slurp error");return n}function parsebool$1(e,t){return 1===e.read_shift(t)}function parseuint16$1(e){return e.read_shift(2,"u")}function parseuint16a$1(e,t){return parslurp$1(e,t,parseuint16$1)}function parse_Bes$1(e){var t=e.read_shift(1);return 1===e.read_shift(1)?t:1===t}function parse_ShortXLUnicodeString$1(e,t,r){var n=e.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont";(r&&r.biff,r&&8!=r.biff)?12==r.biff&&(i="wstr"):e.read_shift(1)&&(i="dbcs-cont");return r.biff>=2&&r.biff<=5&&(i="cpstr"),n?e.read_shift(n,i):""}function parse_XLUnicodeRichExtendedString$1(e){var t,r=e.read_shift(2),n=e.read_shift(1),i=4&n,a=8&n,o=1+(1&n),s=0,l={};a&&(s=e.read_shift(2)),i&&(t=e.read_shift(4));var c=2==o?"dbcs-cont":"sbcs-cont",u=0===r?"":e.read_shift(r,c);return a&&(e.l+=4*s),i&&(e.l+=t),l.t=u,a||(l.raw="<t>"+l.t+"</t>",l.r=l.t),l}function parse_XLUnicodeStringNoCch$1(e,t,r){if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}return 0===e.read_shift(1)?e.read_shift(t,"sbcs-cont"):e.read_shift(t,"dbcs-cont")}function parse_XLUnicodeString$1(e,t,r){var n=e.read_shift(r&&2==r.biff?1:2);return 0===n?(e.l++,""):parse_XLUnicodeStringNoCch$1(e,n,r)}function parse_XLUnicodeString2$1(e,t,r){if(r.biff>5)return parse_XLUnicodeString$1(e,t,r);var n=e.read_shift(1);return 0===n?(e.l++,""):e.read_shift(n,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function parse_ControlInfo$1(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);return e.l+=2,[t,r]}function parse_URLMoniker$1(e){var t=e.read_shift(4),r=e.l,n=!1;t>24&&(e.l+=t-24,"795881f43b1d7f48af2c825dc4852763"===e.read_shift(16)&&(n=!0),e.l=r);var i=e.read_shift((n?t-24:t)>>1,"utf16le").replace(chr0$1,"");return n&&(e.l+=24),i}function parse_FileMoniker$1(e){for(var t=e.read_shift(2),r="";t-- >0;)r+="../";var n=e.read_shift(0,"lpstr-ansi");if(e.l+=2,57005!=e.read_shift(2))throw new Error("Bad FileMoniker");if(0===e.read_shift(4))return r+n.replace(/\\/g,"/");var i=e.read_shift(4);if(3!=e.read_shift(2))throw new Error("Bad FileMoniker");return r+e.read_shift(i>>1,"utf16le").replace(chr0$1,"")}function parse_HyperlinkMoniker$1(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return parse_URLMoniker$1(e);case"0303000000000000c000000000000046":return parse_FileMoniker$1(e);default:throw new Error("Unsupported Moniker "+r)}}function parse_HyperlinkString$1(e){var t=e.read_shift(4);return t>0?e.read_shift(t,"utf16le").replace(chr0$1,""):""}function parse_Hyperlink$1(e,t){var r=e.l+t,n=e.read_shift(4);if(2!==n)throw new Error("Unrecognized streamVersion: "+n);var i=e.read_shift(2);e.l+=2;var a,o,s,l,c,u,d="";16&i&&(a=parse_HyperlinkString$1(e,r-e.l)),128&i&&(o=parse_HyperlinkString$1(e,r-e.l)),257&~i||(s=parse_HyperlinkString$1(e,r-e.l)),1==(257&i)&&(l=parse_HyperlinkMoniker$1(e,r-e.l)),8&i&&(d=parse_HyperlinkString$1(e,r-e.l)),32&i&&(c=e.read_shift(16)),64&i&&(u=parse_FILETIME$1(e)),e.l=r;var h=o||s||l||"";h&&d&&(h+="#"+d),h||(h="#"+d),2&i&&"/"==h.charAt(0)&&"/"!=h.charAt(1)&&(h="file://"+h);var p={Target:h};return c&&(p.guid=c),u&&(p.time=u),a&&(p.Tooltip=a),p}function parse_LongRGBA$1(e){return[e.read_shift(1),e.read_shift(1),e.read_shift(1),e.read_shift(1)]}function parse_LongRGB$1(e,t){var r=parse_LongRGBA$1(e);return r[3]=0,r}function parse_XLSCell$1(e){return{r:e.read_shift(2),c:e.read_shift(2),ixfe:e.read_shift(2)}}function parse_frtHeader$1(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}function parse_OptXLUnicodeString$1(e,t,r){return 0===t?"":parse_XLUnicodeString2$1(e,t,r)}function parse_XTI$1(e,t,r){var n=r.biff>8?4:2;return[e.read_shift(n),e.read_shift(n,"i"),e.read_shift(n,"i")]}function parse_RkRec$1(e){return[e.read_shift(2),parse_RkNumber$1(e)]}function parse_AddinUdf$1(e,t,r){e.l+=4,t-=4;var n=e.l+t,i=parse_ShortXLUnicodeString$1(e,t,r),a=e.read_shift(2);if(a!==(n-=e.l))throw new Error("Malformed AddinUdf: padding = "+n+" != "+a);return e.l+=a,i}function parse_Ref8U$1(e){var t=e.read_shift(2),r=e.read_shift(2);return{s:{c:e.read_shift(2),r:t},e:{c:e.read_shift(2),r:r}}}function parse_RefU$1(e){var t=e.read_shift(2),r=e.read_shift(2);return{s:{c:e.read_shift(1),r:t},e:{c:e.read_shift(1),r:r}}}var parse_Ref$1=parse_RefU$1;function parse_FtCmo$1(e){e.l+=4;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2);return e.l+=12,[r,t,n]}function parse_FtNts$1(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t}function parse_FtCf$1(e){return e.l+=4,e.cf=e.read_shift(2),{}}function parse_FtSkip$1(e){e.l+=2,e.l+=e.read_shift(2)}var FtTab$1={0:parse_FtSkip$1,4:parse_FtSkip$1,5:parse_FtSkip$1,6:parse_FtSkip$1,7:parse_FtCf$1,8:parse_FtSkip$1,9:parse_FtSkip$1,10:parse_FtSkip$1,11:parse_FtSkip$1,12:parse_FtSkip$1,13:parse_FtNts$1,14:parse_FtSkip$1,15:parse_FtSkip$1,16:parse_FtSkip$1,17:parse_FtSkip$1,18:parse_FtSkip$1,19:parse_FtSkip$1,20:parse_FtSkip$1,21:parse_FtCmo$1};function parse_FtArray$1(e,t){for(var r=e.l+t,n=[];e.l<r;){var i=e.read_shift(2);e.l-=2;try{n.push(FtTab$1[i](e,r-e.l))}catch(a){return e.l=r,n}}return e.l!=r&&(e.l=r),n}function parse_BOF$1(e,t){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=e.read_shift(2),(t-=2)>=2&&(r.dt=e.read_shift(2),e.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(t>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return e.read_shift(t),r}function parse_InterfaceHdr$1(e,t){return 0===t||e.read_shift(2),1200}function parse_WriteAccess$1(e,t,r){if(r.enc)return e.l+=t,"";var n=e.l,i=parse_XLUnicodeString2$1(e,0,r);return e.read_shift(t+n-e.l),i}function parse_WsBool$1(e,t,r){var n=r&&8==r.biff||2==t?e.read_shift(2):(e.l+=t,0);return{fDialog:16&n,fBelow:64&n,fRight:128&n}}function parse_BoundSheet8$1(e,t,r){var n=e.read_shift(4),i=3&e.read_shift(1),a=e.read_shift(1);switch(a){case 0:a="Worksheet";break;case 1:a="Macrosheet";break;case 2:a="Chartsheet";break;case 6:a="VBAModule"}var o=parse_ShortXLUnicodeString$1(e,0,r);return 0===o.length&&(o="Sheet1"),{pos:n,hs:i,dt:a,name:o}}function parse_SST$1(e,t){for(var r=e.l+t,n=e.read_shift(4),i=e.read_shift(4),a=[],o=0;o!=i&&e.l<r;++o)a.push(parse_XLUnicodeRichExtendedString$1(e));return a.Count=n,a.Unique=i,a}function parse_ExtSST$1(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}function parse_Row$1(e){var t={};t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c;var r=e.read_shift(2);e.l+=4;var n=e.read_shift(1);return e.l+=3,7&n&&(t.level=7&n),32&n&&(t.hidden=!0),64&n&&(t.hpt=r/20),t}function parse_ForceFullCalculation$1(e){var t=parse_frtHeader$1(e);if(2211!=t.type)throw new Error("Invalid Future Record "+t.type);return 0!==e.read_shift(4)}function parse_RecalcId$1(e){return e.read_shift(2),e.read_shift(4)}function parse_DefaultRowHeight$1(e,t,r){var n=0;r&&2==r.biff||(n=e.read_shift(2));var i=e.read_shift(2);return r&&2==r.biff&&(n=1-(i>>15),i&=32767),[{Unsynced:1&n,DyZero:(2&n)>>1,ExAsc:(4&n)>>2,ExDsc:(8&n)>>3},i]}function parse_Window1$1(e){return{Pos:[e.read_shift(2),e.read_shift(2)],Dim:[e.read_shift(2),e.read_shift(2)],Flags:e.read_shift(2),CurTab:e.read_shift(2),FirstTab:e.read_shift(2),Selected:e.read_shift(2),TabRatio:e.read_shift(2)}}function parse_Window2$1(e,t,r){return r&&r.biff>=2&&r.biff<5?{}:{RTL:64&e.read_shift(2)}}function parse_Pane$1(){}function parse_Font$1(e,t,r){var n={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10}return n.name=parse_ShortXLUnicodeString$1(e,0,r),n}function parse_LabelSst$1(e){var t=parse_XLSCell$1(e);return t.isst=e.read_shift(4),t}function parse_Label$1(e,t,r){r.biffguess&&2==r.biff&&(r.biff=5);var n=e.l+t,i=parse_XLSCell$1(e);2==r.biff&&e.l++;var a=parse_XLUnicodeString$1(e,n-e.l,r);return i.val=a,i}function parse_Format$1(e,t,r){return[e.read_shift(2),parse_XLUnicodeString2$1(e,0,r)]}var parse_BIFF2Format$1=parse_XLUnicodeString2$1;function parse_Dimensions$1(e,t,r){var n=e.l+t,i=8!=r.biff&&r.biff?2:4,a=e.read_shift(i),o=e.read_shift(i),s=e.read_shift(2),l=e.read_shift(2);return e.l=n,{s:{r:a,c:s},e:{r:o,c:l}}}function parse_RK$1(e){var t=e.read_shift(2),r=e.read_shift(2),n=parse_RkRec$1(e);return{r:t,c:r,ixfe:n[0],rknum:n[1]}}function parse_MulRk$1(e,t){for(var r=e.l+t-2,n=e.read_shift(2),i=e.read_shift(2),a=[];e.l<r;)a.push(parse_RkRec$1(e));if(e.l!==r)throw new Error("MulRK read error");var o=e.read_shift(2);if(a.length!=o-i+1)throw new Error("MulRK length mismatch");return{r:n,c:i,C:o,rkrec:a}}function parse_MulBlank$1(e,t){for(var r=e.l+t-2,n=e.read_shift(2),i=e.read_shift(2),a=[];e.l<r;)a.push(e.read_shift(2));if(e.l!==r)throw new Error("MulBlank read error");var o=e.read_shift(2);if(a.length!=o-i+1)throw new Error("MulBlank length mismatch");return{r:n,c:i,C:o,ixfe:a}}function parse_CellStyleXF$1(e,t,r,n){var i={},a=e.read_shift(4),o=e.read_shift(4),s=e.read_shift(4),l=e.read_shift(2);return i.patternType=XLSFillPattern$1[s>>26],n.cellStyles?(i.alc=7&a,i.fWrap=a>>3&1,i.alcV=a>>4&7,i.fJustLast=a>>7&1,i.trot=a>>8&255,i.cIndent=a>>16&15,i.fShrinkToFit=a>>20&1,i.iReadOrder=a>>22&2,i.fAtrNum=a>>26&1,i.fAtrFnt=a>>27&1,i.fAtrAlc=a>>28&1,i.fAtrBdr=a>>29&1,i.fAtrPat=a>>30&1,i.fAtrProt=a>>31&1,i.dgLeft=15&o,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=127&s,i.icvBottom=s>>7&127,i.icvDiag=s>>14&127,i.dgDiag=s>>21&15,i.icvFore=127&l,i.icvBack=l>>7&127,i.fsxButton=l>>14&1,i):i}function parse_XF$1(e,t,r){var n={};return n.ifnt=e.read_shift(2),n.numFmtId=e.read_shift(2),n.flags=e.read_shift(2),n.fStyle=n.flags>>2&1,t-=6,n.data=parse_CellStyleXF$1(e,t,n.fStyle,r),n}function parse_Guts$1(e){e.l+=4;var t=[e.read_shift(2),e.read_shift(2)];if(0!==t[0]&&t[0]--,0!==t[1]&&t[1]--,t[0]>7||t[1]>7)throw new Error("Bad Gutters: "+t.join("|"));return t}function parse_BoolErr$1(e,t,r){var n=parse_XLSCell$1(e);2!=r.biff&&9!=t||++e.l;var i=parse_Bes$1(e);return n.val=i,n.t=!0===i||!1===i?"b":"e",n}function parse_Number$1(e,t,r){r.biffguess&&2==r.biff&&(r.biff=5);var n=parse_XLSCell$1(e),i=parse_Xnum$1(e);return n.val=i,n}var parse_XLHeaderFooter$1=parse_OptXLUnicodeString$1;function parse_SupBook$1(e,t,r){var n=e.l+t,i=e.read_shift(2),a=e.read_shift(2);if(r.sbcch=a,1025==a||14849==a)return[a,i];if(a<1||a>255)throw new Error("Unexpected SupBook type: "+a);for(var o=parse_XLUnicodeStringNoCch$1(e,a),s=[];n>e.l;)s.push(parse_XLUnicodeString$1(e));return[a,i,o,s]}function parse_ExternName$1(e,t,r){var n,i=e.read_shift(2),a={fBuiltIn:1&i,fWantAdvise:i>>>1&1,fWantPict:i>>>2&1,fOle:i>>>3&1,fOleLink:i>>>4&1,cf:i>>>5&1023,fIcon:i>>>15&1};return 14849===r.sbcch&&(n=parse_AddinUdf$1(e,t-2,r)),a.body=n||e.read_shift(t-2),"string"==typeof n&&(a.Name=n),a}var XLSLblBuiltIn$1=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function parse_Lbl$1(e,t,r){var n=e.l+t,i=e.read_shift(2),a=e.read_shift(1),o=e.read_shift(1),s=e.read_shift(r&&2==r.biff?1:2),l=0;(!r||r.biff>=5)&&(5!=r.biff&&(e.l+=2),l=e.read_shift(2),5==r.biff&&(e.l+=2),e.l+=4);var c=parse_XLUnicodeStringNoCch$1(e,o,r);32&i&&(c=XLSLblBuiltIn$1[c.charCodeAt(0)]);var u=n-e.l;return r&&2==r.biff&&--u,{chKey:a,Name:c,itab:l,rgce:n!=e.l&&0!==s&&u>0?parse_NameParsedFormula$1(e,u,r,s):[]}}function parse_ExternSheet$1(e,t,r){if(r.biff<8)return parse_BIFF5ExternSheet$1(e,t,r);for(var n=[],i=e.l+t,a=e.read_shift(r.biff>8?4:2);0!=a--;)n.push(parse_XTI$1(e,r.biff>8?12:6,r));if(e.l!=i)throw new Error("Bad ExternSheet: "+e.l+" != "+i);return n}function parse_BIFF5ExternSheet$1(e,t,r){3==e[e.l+1]&&e[e.l]++;var n=parse_ShortXLUnicodeString$1(e,t,r);return 3==n.charCodeAt(0)?n.slice(1):n}function parse_NameCmt$1(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),i=e.read_shift(2);return[parse_XLUnicodeStringNoCch$1(e,n,r),parse_XLUnicodeStringNoCch$1(e,i,r)]}e.l+=t}function parse_ShrFmla$1(e,t,r){var n=parse_RefU$1(e);e.l++;var i=e.read_shift(1);return[parse_SharedParsedFormula$1(e,t-=8,r),i,n]}function parse_Array$1(e,t,r){var n=parse_Ref$1(e);switch(r.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[n,parse_ArrayParsedFormula$1(e,t,r)]}function parse_MTRSettings$1(e){return[0!==e.read_shift(4),0!==e.read_shift(4),e.read_shift(4)]}function parse_NoteSh$1(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),i=e.read_shift(2),a=e.read_shift(2),o=e.read_shift(2),s=parse_XLUnicodeString2$1(e,0,r);return r.biff<8&&e.read_shift(1),[{r:n,c:i},s,o,a]}}function parse_Note$1(e,t,r){return parse_NoteSh$1(e,t,r)}function parse_MergeCells$1(e,t){for(var r=[],n=e.read_shift(2);n--;)r.push(parse_Ref8U$1(e));return r}function parse_Obj$1(e,t,r){if(r&&r.biff<8)return parse_BIFF5Obj$1(e,t,r);var n=parse_FtCmo$1(e);return{cmo:n,ft:parse_FtArray$1(e,t-22,n[1])}}var parse_BIFF5OT$1={8:function(e,t){var r=e.l+t;e.l+=10;var n=e.read_shift(2);e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4;var i=e.read_shift(1);return e.l+=i,e.l=r,{fmt:n}}};function parse_BIFF5Obj$1(e,t,r){e.l+=4;var n=e.read_shift(2),i=e.read_shift(2),a=e.read_shift(2);e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=6,t-=36;var o=[];return o.push((parse_BIFF5OT$1[n]||parsenoop$1)(e,t,r)),{cmo:[i,n,a],ft:o}}function parse_TxO$1(e,t,r){var n=e.l,i="";try{e.l+=4;var a=(r.lastobj||{cmo:[0,0]}).cmo[1];-1==[0,5,7,11,12,14].indexOf(a)?e.l+=6:parse_ControlInfo$1(e,6,r);var o=e.read_shift(2);e.read_shift(2),parseuint16$1(e,2);var s=e.read_shift(2);e.l+=s;for(var l=1;l<e.lens.length-1;++l){if(e.l-n!=e.lens[l])throw new Error("TxO: bad continue record");var c=e[e.l];if((i+=parse_XLUnicodeStringNoCch$1(e,e.lens[l+1]-e.lens[l]-1)).length>=(c?o:2*o))break}if(i.length!==o&&i.length!==2*o)throw new Error("cchText: "+o+" != "+i.length);return e.l=n+t,{t:i}}catch(u){return e.l=n+t,{t:i}}}function parse_HLink$1(e,t){var r=parse_Ref8U$1(e);return e.l+=16,[r,parse_Hyperlink$1(e,t-24)]}function parse_HLinkTooltip$1(e,t){e.read_shift(2);var r=parse_Ref8U$1(e),n=e.read_shift((t-10)/2,"dbcs-cont");return[r,n=n.replace(chr0$1,"")]}function parse_Country$1(e){var t,r=[0,0];return t=e.read_shift(2),r[0]=CountryEnum$1[t]||t,t=e.read_shift(2),r[1]=CountryEnum$1[t]||t,r}function parse_ClrtClient$1(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(parse_LongRGB$1(e));return r}function parse_Palette$1(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(parse_LongRGB$1(e));return r}function parse_XFCRC$1(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t}function parse_ColInfo$1(e,t,r){if(!r.cellStyles)return parsenoop$1(e,t);var n=r&&r.biff>=12?4:2,i=e.read_shift(n),a=e.read_shift(n),o=e.read_shift(n),s=e.read_shift(n),l=e.read_shift(2);2==n&&(e.l+=2);var c={s:i,e:a,w:o,ixfe:s,flags:l};return(r.biff>=5||!r.biff)&&(c.level=l>>8&7),c}function parse_Setup$1(e,t){var r={};return t<32||(e.l+=16,r.header=parse_Xnum$1(e),r.footer=parse_Xnum$1(e),e.l+=2),r}function parse_ShtProps$1(e,t,r){var n={area:!1};if(5!=r.biff)return e.l+=t,n;var i=e.read_shift(1);return e.l+=3,16&i&&(n.area=!0),n}var parse_Blank$1=parse_XLSCell$1,parse_Scl$1=parseuint16a$1,parse_String$1=parse_XLUnicodeString$1;function parse_ImData$1(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i={fmt:t,env:r,len:n,data:e.slice(e.l,e.l+n)};return e.l+=n,i}function parse_BIFF2STR$1(e,t,r){r.biffguess&&5==r.biff&&(r.biff=2);var n=parse_XLSCell$1(e);++e.l;var i=parse_XLUnicodeString2$1(e,t-7,r);return n.t="str",n.val=i,n}function parse_BIFF2NUM$1(e){var t=parse_XLSCell$1(e);++e.l;var r=parse_Xnum$1(e);return t.t="n",t.val=r,t}function parse_BIFF2INT$1(e){var t=parse_XLSCell$1(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}function parse_BIFF2STRING$1(e){var t=e.read_shift(1);return 0===t?(e.l++,""):e.read_shift(t,"sbcs-cont")}function parse_BIFF2FONTXTRA$1(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}function parse_RString$1(e,t,r){var n=e.l+t,i=parse_XLSCell$1(e),a=e.read_shift(2),o=parse_XLUnicodeStringNoCch$1(e,a,r);return e.l=n,i.t="str",i.val=o,i}var DBF_SUPPORTED_VERSIONS$1=[2,3,48,49,131,139,140,245],DBF$1=function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=evert$1({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(t,r){var n=r||{};n.dateNF||(n.dateNF="yyyymmdd");var i=aoa_to_sheet$1(function(t,r){var n=[],i=new_raw_buf$1(1);switch(r.type){case"base64":i=s2a$1(Base64_decode$1(t));break;case"binary":i=s2a$1(t);break;case"buffer":case"array":i=t}prep_blob$1(i,0);var a=i.read_shift(1),o=!!(136&a),s=!1,l=!1;switch(a){case 2:case 3:case 131:case 139:case 245:break;case 48:case 49:s=!0,o=!0;break;case 140:l=!0;break;default:throw new Error("DBF Unsupported Version: "+a.toString(16))}var c=0,u=521;2==a&&(c=i.read_shift(2)),i.l+=3,2!=a&&(c=i.read_shift(4)),c>1048576&&(c=1e6),2!=a&&(u=i.read_shift(2));var d=i.read_shift(2),h=r.codepage||1252;2!=a&&(i.l+=16,i.read_shift(1),0!==i[i.l]&&(h=e[i[i.l]]),i.l+=1,i.l+=2),l&&(i.l+=36);for(var p=[],f={},m=Math.min(i.length,2==a?521:u-10-(s?264:0)),g=l?32:11;i.l<m&&13!=i[i.l];)switch((f={}).name=$cptable.utils.decode(h,i.slice(i.l,i.l+g)).replace(/[\u0000\r\n].*$/g,""),i.l+=g,f.type=String.fromCharCode(i.read_shift(1)),2==a||l||(f.offset=i.read_shift(4)),f.len=i.read_shift(1),2==a&&(f.offset=i.read_shift(2)),f.dec=i.read_shift(1),f.name.length&&p.push(f),2!=a&&(i.l+=l?13:14),f.type){case"B":s&&8==f.len||!r.WTF||console.log("Skipping "+f.name+":"+f.type);break;case"G":case"P":r.WTF&&console.log("Skipping "+f.name+":"+f.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+f.type)}if(13!==i[i.l]&&(i.l=u-1),13!==i.read_shift(1))throw new Error("DBF Terminator not found "+i.l+" "+i[i.l]);i.l=u;var _=0,y=0;for(n[0]=[],y=0;y!=p.length;++y)n[0][y]=p[y].name;for(;c-- >0;)if(42!==i[i.l])for(++i.l,n[++_]=[],y=0,y=0;y!=p.length;++y){var b=i.slice(i.l,i.l+p[y].len);i.l+=p[y].len,prep_blob$1(b,0);var v=$cptable.utils.decode(h,b);switch(p[y].type){case"C":v.trim().length&&(n[_][y]=v.replace(/\s+$/,""));break;case"D":8===v.length?n[_][y]=new Date(+v.slice(0,4),+v.slice(4,6)-1,+v.slice(6,8)):n[_][y]=v;break;case"F":n[_][y]=parseFloat(v.trim());break;case"+":case"I":n[_][y]=l?0x80000000^b.read_shift(-4,"i"):b.read_shift(4,"i");break;case"L":switch(v.trim().toUpperCase()){case"Y":case"T":n[_][y]=!0;break;case"N":case"F":n[_][y]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+v+"|")}break;case"M":if(!o)throw new Error("DBF Unexpected MEMO for type "+a.toString(16));n[_][y]="##MEMO##"+(l?parseInt(v.trim(),10):b.read_shift(4));break;case"N":(v=v.replace(/\u0000/g,"").trim())&&"."!=v&&(n[_][y]=+v||0);break;case"@":n[_][y]=new Date(b.read_shift(-8,"f")-621356832e5);break;case"T":n[_][y]=new Date(864e5*(b.read_shift(4)-2440588)+b.read_shift(4));break;case"Y":n[_][y]=b.read_shift(4,"i")/1e4+b.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":n[_][y]=-b.read_shift(-8,"f");break;case"B":if(s&&8==p[y].len){n[_][y]=b.read_shift(8,"f");break}case"G":case"P":b.l+=p[y].len;break;case"0":if("_NullFlags"===p[y].name)break;default:throw new Error("DBF Unsupported data type "+p[y].type)}}else i.l+=d;if(2!=a&&i.l<i.length&&26!=i[i.l++])throw new Error("DBF EOF Marker missing "+(i.l-1)+" of "+i.length+" "+i[i.l-1].toString(16));return r&&r.sheetRows&&(n=n.slice(0,r.sheetRows)),r.DBF=p,n}(t,n),n);return i["!cols"]=n.DBF.map((function(e){return{wch:e.len,DBF:e}})),delete n.DBF,i}var n={B:8,C:250,L:1,D:8,"?":0,"":0};return{to_workbook:function(e,t){try{return sheet_to_workbook$1(r(e,t),t)}catch(n){if(t&&t.WTF)throw n}return{SheetNames:[],Sheets:{}}},to_sheet:r,from_sheet:function(e,r){var i=r||{};if(+i.codepage>=0&&set_cp$1(+i.codepage),"string"==i.type)throw new Error("Cannot write DBF to JS string");var a=buf_array$1(),o=sheet_to_json$1(e,{header:1,raw:!0,cellDates:!0}),s=o[0],l=o.slice(1),c=e["!cols"]||[],u=0,d=0,h=0,p=1;for(u=0;u<s.length;++u)if(((c[u]||{}).DBF||{}).name)s[u]=c[u].DBF.name,++h;else if(null!=s[u]){if(++h,"number"==typeof s[u]&&(s[u]=s[u].toString(10)),"string"!=typeof s[u])throw new Error("DBF Invalid column name "+s[u]+" |"+typeof s[u]+"|");if(s.indexOf(s[u])!==u)for(d=0;d<1024;++d)if(-1==s.indexOf(s[u]+"_"+d)){s[u]+="_"+d;break}}var f=safe_decode_range$1(e["!ref"]),m=[],g=[],_=[];for(u=0;u<=f.e.c-f.s.c;++u){var y="",b="",v=0,S=[];for(d=0;d<l.length;++d)null!=l[d][u]&&S.push(l[d][u]);if(0!=S.length&&null!=s[u]){for(d=0;d<S.length;++d){switch(typeof S[d]){case"number":b="B";break;case"string":default:b="C";break;case"boolean":b="L";break;case"object":b=S[d]instanceof Date?"D":"C"}v=Math.max(v,String(S[d]).length),y=y&&y!=b?"C":b}v>250&&(v=250),"C"==(b=((c[u]||{}).DBF||{}).type)&&c[u].DBF.len>v&&(v=c[u].DBF.len),"B"==y&&"N"==b&&(y="N",_[u]=c[u].DBF.dec,v=c[u].DBF.len),g[u]="C"==y||"N"==b?v:n[y]||0,p+=g[u],m[u]=y}else m[u]="?"}var w=a.next(32);for(w.write_shift(4,0x13021130),w.write_shift(4,l.length),w.write_shift(2,296+32*h),w.write_shift(2,p),u=0;u<4;++u)w.write_shift(4,0);for(w.write_shift(4,(+t[current_ansi]||3)<<8),u=0,d=0;u<s.length;++u)if(null!=s[u]){var T=a.next(32),E=(s[u].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);T.write_shift(1,E,"sbcs"),T.write_shift(1,"?"==m[u]?"C":m[u],"sbcs"),T.write_shift(4,d),T.write_shift(1,g[u]||n[m[u]]||0),T.write_shift(1,_[u]||0),T.write_shift(1,2),T.write_shift(4,0),T.write_shift(1,0),T.write_shift(4,0),T.write_shift(4,0),d+=g[u]||n[m[u]]||0}var x=a.next(264);for(x.write_shift(4,13),u=0;u<65;++u)x.write_shift(4,0);for(u=0;u<l.length;++u){var A=a.next(p);for(A.write_shift(1,0),d=0;d<s.length;++d)if(null!=s[d])switch(m[d]){case"L":A.write_shift(1,null==l[u][d]?63:l[u][d]?84:70);break;case"B":A.write_shift(8,l[u][d]||0,"f");break;case"N":var C="0";for("number"==typeof l[u][d]&&(C=l[u][d].toFixed(_[d]||0)),h=0;h<g[d]-C.length;++h)A.write_shift(1,32);A.write_shift(1,C,"sbcs");break;case"D":l[u][d]?(A.write_shift(4,("0000"+l[u][d].getFullYear()).slice(-4),"sbcs"),A.write_shift(2,("00"+(l[u][d].getMonth()+1)).slice(-2),"sbcs"),A.write_shift(2,("00"+l[u][d].getDate()).slice(-2),"sbcs")):A.write_shift(8,"00000000","sbcs");break;case"C":var R=String(null!=l[u][d]?l[u][d]:"").slice(0,g[d]);for(A.write_shift(1,R,"sbcs"),h=0;h<g[d]-R.length;++h)A.write_shift(1,32)}}return a.next(1).write_shift(1,26),a.end()}}}(),SYLK$1=function(){var e={AA:"\xc0",BA:"\xc1",CA:"\xc2",DA:195,HA:"\xc4",JA:197,AE:"\xc8",BE:"\xc9",CE:"\xca",HE:"\xcb",AI:"\xcc",BI:"\xcd",CI:"\xce",HI:"\xcf",AO:"\xd2",BO:"\xd3",CO:"\xd4",DO:213,HO:"\xd6",AU:"\xd9",BU:"\xda",CU:"\xdb",HU:"\xdc",Aa:"\xe0",Ba:"\xe1",Ca:"\xe2",Da:227,Ha:"\xe4",Ja:229,Ae:"\xe8",Be:"\xe9",Ce:"\xea",He:"\xeb",Ai:"\xec",Bi:"\xed",Ci:"\xee",Hi:"\xef",Ao:"\xf2",Bo:"\xf3",Co:"\xf4",Do:245,Ho:"\xf6",Au:"\xf9",Bu:"\xfa",Cu:"\xfb",Hu:"\xfc",KC:"\xc7",Kc:"\xe7",q:"\xe6",z:"œ",a:"\xc6",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1bN("+keys$4(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(t,r){var n=e[r];return"number"==typeof n?_getansi$1(n):n},n=function(e,t,r){var n=t.charCodeAt(0)-32<<4|r.charCodeAt(0)-48;return 59==n?e:_getansi$1(n)};function i(e,i){var a,o=e.split(/[\n\r]+/),s=-1,l=-1,c=0,u=0,d=[],h=[],p=null,f={},m=[],g=[],_=[],y=0;for(+i.codepage>=0&&set_cp$1(+i.codepage);c!==o.length;++c){y=0;var b,v=o[c].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(t,r),S=v.replace(/;;/g,"\0").split(";").map((function(e){return e.replace(/\u0000/g,";")})),w=S[0];if(v.length>0)switch(w){case"ID":case"E":case"B":case"O":case"W":break;case"P":"P"==S[1].charAt(0)&&h.push(v.slice(3).replace(/;;/g,";"));break;case"C":var T=!1,E=!1,x=!1,A=!1,C=-1,R=-1;for(u=1;u<S.length;++u)switch(S[u].charAt(0)){case"A":case"G":break;case"X":l=parseInt(S[u].slice(1))-1,E=!0;break;case"Y":for(s=parseInt(S[u].slice(1))-1,E||(l=0),a=d.length;a<=s;++a)d[a]=[];break;case"K":'"'===(b=S[u].slice(1)).charAt(0)?b=b.slice(1,b.length-1):"TRUE"===b?b=!0:"FALSE"===b?b=!1:isNaN(fuzzynum$1(b))?isNaN(fuzzydate$1(b).getDate())||(b=parseDate$1(b)):(b=fuzzynum$1(b),null!==p&&fmt_is_date$1(p)&&(b=numdate$1(b))),T=!0;break;case"E":A=!0;var D=rc_to_a1$1(S[u].slice(1),{r:s,c:l});d[s][l]=[d[s][l],D];break;case"S":x=!0,d[s][l]=[d[s][l],"S5S"];break;case"R":C=parseInt(S[u].slice(1))-1;break;case"C":R=parseInt(S[u].slice(1))-1;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+v)}if(T&&(d[s][l]&&2==d[s][l].length?d[s][l][0]=b:d[s][l]=b,p=null),x){if(A)throw new Error("SYLK shared formula cannot have own formula");var P=C>-1&&d[C][R];if(!P||!P[1])throw new Error("SYLK shared formula cannot find base");d[s][l][1]=shift_formula_str$1(P[1],{r:s-C,c:l-R})}break;case"F":var I=0;for(u=1;u<S.length;++u)switch(S[u].charAt(0)){case"X":l=parseInt(S[u].slice(1))-1,++I;break;case"Y":for(s=parseInt(S[u].slice(1))-1,a=d.length;a<=s;++a)d[a]=[];break;case"M":y=parseInt(S[u].slice(1))/20;break;case"F":case"G":case"S":case"D":case"N":break;case"P":p=h[parseInt(S[u].slice(1))];break;case"W":for(_=S[u].slice(1).split(" "),a=parseInt(_[0],10);a<=parseInt(_[1],10);++a)y=parseInt(_[2],10),g[a-1]=0===y?{hidden:!0}:{wch:y},process_col$1(g[a-1]);break;case"C":g[l=parseInt(S[u].slice(1))-1]||(g[l]={});break;case"R":m[s=parseInt(S[u].slice(1))-1]||(m[s]={}),y>0?(m[s].hpt=y,m[s].hpx=pt2px$1(y)):0===y&&(m[s].hidden=!0);break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+v)}I<1&&(p=null);break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+v)}}return m.length>0&&(f["!rows"]=m),g.length>0&&(f["!cols"]=g),i&&i.sheetRows&&(d=d.slice(0,i.sheetRows)),[d,f]}function a(e,t){var r=function(e,t){switch(t.type){case"base64":return i(Base64_decode$1(e),t);case"binary":return i(e,t);case"buffer":return i(has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):a2s$1(e),t);case"array":return i(cc2str$1(e),t)}throw new Error("Unrecognized type "+t.type)}(e,t),n=r[0],a=r[1],o=aoa_to_sheet$1(n,t);return keys$4(a).forEach((function(e){o[e]=a[e]})),o}function o(e,t,r,n){var i="C;Y"+(r+1)+";X"+(n+1)+";K";switch(e.t){case"n":i+=e.v||0,e.f&&!e.F&&(i+=";E"+a1_to_rc$1(e.f,{r:r,c:n}));break;case"b":i+=e.v?"TRUE":"FALSE";break;case"e":i+=e.w||e.v;break;case"d":i+='"'+(e.w||e.v)+'"';break;case"s":i+='"'+e.v.replace(/"/g,"").replace(/;/g,";;")+'"'}return i}return e["|"]=254,{to_workbook:function(e,t){return sheet_to_workbook$1(a(e,t),t)},to_sheet:a,from_sheet:function(e,t){var r,n,i=["ID;PWXL;N;E"],a=[],s=safe_decode_range$1(e["!ref"]),l=Array.isArray(e),c="\r\n";i.push("P;PGeneral"),i.push("F;P0;DG0G8;M255"),e["!cols"]&&(n=i,e["!cols"].forEach((function(e,t){var r="F;W"+(t+1)+" "+(t+1)+" ";e.hidden?r+="0":("number"!=typeof e.width||e.wpx||(e.wpx=width2px$1(e.width)),"number"!=typeof e.wpx||e.wch||(e.wch=px2char$1(e.wpx)),"number"==typeof e.wch&&(r+=Math.round(e.wch)))," "!=r.charAt(r.length-1)&&n.push(r)}))),e["!rows"]&&function(e,t){t.forEach((function(t,r){var n="F;";t.hidden?n+="M0;":t.hpt?n+="M"+20*t.hpt+";":t.hpx&&(n+="M"+20*px2pt$1(t.hpx)+";"),n.length>2&&e.push(n+"R"+(r+1))}))}(i,e["!rows"]),i.push("B;Y"+(s.e.r-s.s.r+1)+";X"+(s.e.c-s.s.c+1)+";D"+[s.s.c,s.s.r,s.e.c,s.e.r].join(" "));for(var u=s.s.r;u<=s.e.r;++u)for(var d=s.s.c;d<=s.e.c;++d){var h=encode_cell$1({r:u,c:d});(r=l?(e[u]||[])[d]:e[h])&&(null!=r.v||r.f&&!r.F)&&a.push(o(r,0,u,d))}return i.join(c)+c+a.join(c)+c+"E"+c}}}(),DIF$1=function(){function e(e,t){for(var r=e.split("\n"),n=-1,i=-1,a=0,o=[];a!==r.length;++a)if("BOT"!==r[a].trim()){if(!(n<0)){for(var s=r[a].trim().split(","),l=s[0],c=s[1],u=r[++a]||"";1&(u.match(/["]/g)||[]).length&&a<r.length-1;)u+="\n"+r[++a];switch(u=u.trim(),+l){case-1:if("BOT"===u){o[++n]=[],i=0;continue}if("EOD"!==u)throw new Error("Unrecognized DIF special command "+u);break;case 0:"TRUE"===u?o[n][i]=!0:"FALSE"===u?o[n][i]=!1:isNaN(fuzzynum$1(c))?isNaN(fuzzydate$1(c).getDate())?o[n][i]=c:o[n][i]=parseDate$1(c):o[n][i]=fuzzynum$1(c),++i;break;case 1:(u=(u=u.slice(1,u.length-1)).replace(/""/g,'"'))&&u.match(/^=".*"$/)&&(u=u.slice(2,-1)),o[n][i++]=""!==u?u:null}if("EOD"===u)break}}else o[++n]=[],i=0;return t&&t.sheetRows&&(o=o.slice(0,t.sheetRows)),o}function t(t,r){return aoa_to_sheet$1(function(t,r){switch(r.type){case"base64":return e(Base64_decode$1(t),r);case"binary":return e(t,r);case"buffer":return e(has_buf$1&&Buffer.isBuffer(t)?t.toString("binary"):a2s$1(t),r);case"array":return e(cc2str$1(t),r)}throw new Error("Unrecognized type "+r.type)}(t,r),r)}var r=function(){var e=function(e,t,r,n,i){e.push(t),e.push(r+","+n),e.push('"'+i.replace(/"/g,'""')+'"')},t=function(e,t,r,n){e.push(t+","+r),e.push(1==t?'"'+n.replace(/"/g,'""')+'"':n)};return function(r){var n,i=[],a=safe_decode_range$1(r["!ref"]),o=Array.isArray(r);e(i,"TABLE",0,1,"sheetjs"),e(i,"VECTORS",0,a.e.r-a.s.r+1,""),e(i,"TUPLES",0,a.e.c-a.s.c+1,""),e(i,"DATA",0,0,"");for(var s=a.s.r;s<=a.e.r;++s){t(i,-1,0,"BOT");for(var l=a.s.c;l<=a.e.c;++l){var c=encode_cell$1({r:s,c:l});if(n=o?(r[s]||[])[l]:r[c])switch(n.t){case"n":var u=n.w;u||null==n.v||(u=n.v),null==u?n.f&&!n.F?t(i,1,0,"="+n.f):t(i,1,0,""):t(i,0,u,"V");break;case"b":t(i,0,n.v?1:0,n.v?"TRUE":"FALSE");break;case"s":t(i,1,0,isNaN(n.v)?n.v:'="'+n.v+'"');break;case"d":n.w||(n.w=SSF_format$1(n.z||table_fmt$1[14],datenum$1(parseDate$1(n.v)))),t(i,0,n.w,"V");break;default:t(i,1,0,"")}else t(i,1,0,"")}}t(i,-1,0,"EOD");return i.join("\r\n")}}();return{to_workbook:function(e,r){return sheet_to_workbook$1(t(e,r),r)},to_sheet:t,from_sheet:r}}(),ETH$1=function(){function e(e){return e.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(e,t){return aoa_to_sheet$1(function(e,t){for(var r=e.split("\n"),n=-1,i=-1,a=0,o=[];a!==r.length;++a){var s=r[a].trim().split(":");if("cell"===s[0]){var l=decode_cell$1(s[1]);if(o.length<=l.r)for(n=o.length;n<=l.r;++n)o[n]||(o[n]=[]);switch(n=l.r,i=l.c,s[2]){case"t":o[n][i]=s[3].replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n");break;case"v":o[n][i]=+s[3];break;case"vtf":var c=s[s.length-1];case"vtc":"nl"===s[3]?o[n][i]=!!+s[4]:o[n][i]=+s[4],"vtf"==s[2]&&(o[n][i]=[o[n][i],c])}}}return t&&t.sheetRows&&(o=o.slice(0,t.sheetRows)),o}(e,t),t)}var r=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n"),n=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n",i=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n"),a="--SocialCalcSpreadsheetControlSave--";function o(t){if(!t||!t["!ref"])return"";for(var r,n=[],i=[],a="",o=decode_range$1(t["!ref"]),s=Array.isArray(t),l=o.s.r;l<=o.e.r;++l)for(var c=o.s.c;c<=o.e.c;++c)if(a=encode_cell$1({r:l,c:c}),(r=s?(t[l]||[])[c]:t[a])&&null!=r.v&&"z"!==r.t){switch(i=["cell",a,"t"],r.t){case"s":case"str":i.push(e(r.v));break;case"n":r.f?(i[2]="vtf",i[3]="n",i[4]=r.v,i[5]=e(r.f)):(i[2]="v",i[3]=r.v);break;case"b":i[2]="vt"+(r.f?"f":"c"),i[3]="nl",i[4]=r.v?"1":"0",i[5]=e(r.f||(r.v?"TRUE":"FALSE"));break;case"d":var u=datenum$1(parseDate$1(r.v));i[2]="vtc",i[3]="nd",i[4]=""+u,i[5]=r.w||SSF_format$1(r.z||table_fmt$1[14],u);break;case"e":continue}n.push(i.join(":"))}return n.push("sheet:c:"+(o.e.c-o.s.c+1)+":r:"+(o.e.r-o.s.r+1)+":tvf:1"),n.push("valueformat:1:text-wiki"),n.join("\n")}return{to_workbook:function(e,r){return sheet_to_workbook$1(t(e,r),r)},to_sheet:t,from_sheet:function(e){return[r,n,i,n,o(e),a].join("\n")}}}(),PRN$1=function(){function e(e,t,r,n,i){i.raw?t[r][n]=e:""===e||("TRUE"===e?t[r][n]=!0:"FALSE"===e?t[r][n]=!1:isNaN(fuzzynum$1(e))?isNaN(fuzzydate$1(e).getDate())?t[r][n]=e:t[r][n]=parseDate$1(e):t[r][n]=fuzzynum$1(e))}var t={44:",",9:" ",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function n(e){for(var n={},i=!1,a=0,o=0;a<e.length;++a)34==(o=e.charCodeAt(a))?i=!i:!i&&o in t&&(n[o]=(n[o]||0)+1);for(a in o=[],n)Object.prototype.hasOwnProperty.call(n,a)&&o.push([n[a],a]);if(!o.length)for(a in n=r)Object.prototype.hasOwnProperty.call(n,a)&&o.push([n[a],a]);return o.sort((function(e,t){return e[0]-t[0]||r[e[1]]-r[t[1]]})),t[o.pop()[1]]||44}function i(e,t){var r=t||{},i="",a=r.dense?[]:{},o={s:{c:0,r:0},e:{c:0,r:0}};"sep="==e.slice(0,4)?13==e.charCodeAt(5)&&10==e.charCodeAt(6)?(i=e.charAt(4),e=e.slice(7)):13==e.charCodeAt(5)||10==e.charCodeAt(5)?(i=e.charAt(4),e=e.slice(6)):i=n(e.slice(0,1024)):i=r&&r.FS?r.FS:n(e.slice(0,1024));var s=0,l=0,c=0,u=0,d=0,h=i.charCodeAt(0),p=!1,f=0,m=e.charCodeAt(0);e=e.replace(/\r\n/gm,"\n");var g=null!=r.dateNF?dateNF_regex$1(r.dateNF):null;function _(){var t=e.slice(u,d),n={};if('"'==t.charAt(0)&&'"'==t.charAt(t.length-1)&&(t=t.slice(1,-1).replace(/""/g,'"')),0===t.length)n.t="z";else if(r.raw)n.t="s",n.v=t;else if(0===t.trim().length)n.t="s",n.v=t;else if(61==t.charCodeAt(0))34==t.charCodeAt(1)&&34==t.charCodeAt(t.length-1)?(n.t="s",n.v=t.slice(2,-1).replace(/""/g,'"')):fuzzyfmla$1(t)?(n.t="n",n.f=t.slice(1)):(n.t="s",n.v=t);else if("TRUE"==t)n.t="b",n.v=!0;else if("FALSE"==t)n.t="b",n.v=!1;else if(isNaN(c=fuzzynum$1(t)))if(!isNaN(fuzzydate$1(t).getDate())||g&&t.match(g)){n.z=r.dateNF||table_fmt$1[14];var i=0;g&&t.match(g)&&(t=dateNF_fix$1(t,r.dateNF,t.match(g)||[]),i=1),r.cellDates?(n.t="d",n.v=parseDate$1(t,i)):(n.t="n",n.v=datenum$1(parseDate$1(t,i))),!1!==r.cellText&&(n.w=SSF_format$1(n.z,n.v instanceof Date?datenum$1(n.v):n.v)),r.cellNF||delete n.z}else n.t="s",n.v=t;else n.t="n",!1!==r.cellText&&(n.w=t),n.v=c;if("z"==n.t||(r.dense?(a[s]||(a[s]=[]),a[s][l]=n):a[encode_cell$1({c:l,r:s})]=n),u=d+1,m=e.charCodeAt(u),o.e.c<l&&(o.e.c=l),o.e.r<s&&(o.e.r=s),f==h)++l;else if(l=0,++s,r.sheetRows&&r.sheetRows<=s)return!0}e:for(;d<e.length;++d)switch(f=e.charCodeAt(d)){case 34:34===m&&(p=!p);break;case h:case 10:case 13:if(!p&&_())break e}return d-u>0&&_(),a["!ref"]=encode_range$1(o),a}function a(t,r){return r&&r.PRN?r.FS||"sep="==t.slice(0,4)||t.indexOf(" ")>=0||t.indexOf(",")>=0||t.indexOf(";")>=0?i(t,r):aoa_to_sheet$1(function(t,r){var n=r||{},i=[];if(!t||0===t.length)return i;for(var a=t.split(/[\r\n]/),o=a.length-1;o>=0&&0===a[o].length;)--o;for(var s=10,l=0,c=0;c<=o;++c)-1==(l=a[c].indexOf(" "))?l=a[c].length:l++,s=Math.max(s,l);for(c=0;c<=o;++c){i[c]=[];var u=0;for(e(a[c].slice(0,s).trim(),i,c,u,n),u=1;u<=(a[c].length-s)/10+1;++u)e(a[c].slice(s+10*(u-1),s+10*u).trim(),i,c,u,n)}return n.sheetRows&&(i=i.slice(0,n.sheetRows)),i}(t,r),r):i(t,r)}function o(e,t){var r="",n="string"==t.type?[0,0,0,0]:firstbyte$1(e,t);switch(t.type){case"base64":r=Base64_decode$1(e);break;case"binary":case"string":r=e;break;case"buffer":65001==t.codepage?r=e.toString("utf8"):t.codepage&&void 0!==$cptable||(r=has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):a2s$1(e));break;case"array":r=cc2str$1(e);break;default:throw new Error("Unrecognized type "+t.type)}return 239==n[0]&&187==n[1]&&191==n[2]?r=utf8read$1(r.slice(3)):"string"!=t.type&&"buffer"!=t.type&&65001==t.codepage?r=utf8read$1(r):t.type,"socialcalc:version:"==r.slice(0,19)?ETH$1.to_sheet("string"==t.type?r:utf8read$1(r),t):a(r,t)}return{to_workbook:function(e,t){return sheet_to_workbook$1(o(e,t),t)},to_sheet:o,from_sheet:function(e){for(var t,r=[],n=safe_decode_range$1(e["!ref"]),i=Array.isArray(e),a=n.s.r;a<=n.e.r;++a){for(var o=[],s=n.s.c;s<=n.e.c;++s){var l=encode_cell$1({r:a,c:s});if((t=i?(e[a]||[])[s]:e[l])&&null!=t.v){for(var c=(t.w||(format_cell$1(t),t.w)||"").slice(0,10);c.length<10;)c+=" ";o.push(c+(0===s?" ":""))}else o.push(" ")}r.push(o.join(""))}return r.join("\n")}}}();function read_wb_ID$1(e,t){var r=t||{},n=!!r.WTF;r.WTF=!0;try{var i=SYLK$1.to_workbook(e,r);return r.WTF=n,i}catch(a){if(r.WTF=n,!a.message.match(/SYLK bad record ID/)&&n)throw a;return PRN$1.to_workbook(e,t)}}var WK_$1=function(){function e(e,t,r){if(e){prep_blob$1(e,e.l||0);for(var n=r.Enum||_;e.l<e.length;){var i=e.read_shift(2),a=n[i]||n[65535],o=e.read_shift(2),s=e.l+o,l=a.f&&a.f(e,o,r);if(e.l=s,t(l,a,i))return}}}function t(t,r){if(!t)return t;var n=r||{},i=n.dense?[]:{},a="Sheet1",o="",s=0,l={},c=[],u=[],d={s:{r:0,c:0},e:{r:0,c:0}},h=n.sheetRows||0;if(0==t[2]&&(8==t[3]||9==t[3])&&t.length>=16&&5==t[14]&&108===t[15])throw new Error("Unsupported Works 3 for Mac file");if(2==t[2])n.Enum=_,e(t,(function(e,t,r){switch(r){case 0:n.vers=e,e>=4096&&(n.qpro=!0);break;case 6:d=e;break;case 204:e&&(o=e);break;case 222:o=e;break;case 15:case 51:n.qpro||(e[1].v=e[1].v.slice(1));case 13:case 14:case 16:14==r&&!(112&~e[2])&&(15&e[2])>1&&(15&e[2])<15&&(e[1].z=n.dateNF||table_fmt$1[14],n.cellDates&&(e[1].t="d",e[1].v=numdate$1(e[1].v))),n.qpro&&e[3]>s&&(i["!ref"]=encode_range$1(d),l[a]=i,c.push(a),i=n.dense?[]:{},d={s:{r:0,c:0},e:{r:0,c:0}},s=e[3],a=o||"Sheet"+(s+1),o="");var u=n.dense?(i[e[0].r]||[])[e[0].c]:i[encode_cell$1(e[0])];if(u){u.t=e[1].t,u.v=e[1].v,null!=e[1].z&&(u.z=e[1].z),null!=e[1].f&&(u.f=e[1].f);break}n.dense?(i[e[0].r]||(i[e[0].r]=[]),i[e[0].r][e[0].c]=e[1]):i[encode_cell$1(e[0])]=e[1]}}),n);else{if(26!=t[2]&&14!=t[2])throw new Error("Unrecognized LOTUS BOF "+t[2]);n.Enum=y,14==t[2]&&(n.qpro=!0,t.l=0),e(t,(function(e,t,r){switch(r){case 204:a=e;break;case 22:e[1].v=e[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(e[3]>s&&(i["!ref"]=encode_range$1(d),l[a]=i,c.push(a),i=n.dense?[]:{},d={s:{r:0,c:0},e:{r:0,c:0}},s=e[3],a="Sheet"+(s+1)),h>0&&e[0].r>=h)break;n.dense?(i[e[0].r]||(i[e[0].r]=[]),i[e[0].r][e[0].c]=e[1]):i[encode_cell$1(e[0])]=e[1],d.e.c<e[0].c&&(d.e.c=e[0].c),d.e.r<e[0].r&&(d.e.r=e[0].r);break;case 27:e[14e3]&&(u[e[14e3][0]]=e[14e3][1]);break;case 1537:u[e[0]]=e[1],e[0]==s&&(a=e[1])}}),n)}if(i["!ref"]=encode_range$1(d),l[o||a]=i,c.push(o||a),!u.length)return{SheetNames:c,Sheets:l};for(var p={},f=[],m=0;m<u.length;++m)l[c[m]]?(f.push(u[m]||c[m]),p[u[m]]=l[u[m]]||l[c[m]]):(f.push(u[m]),p[u[m]]={"!ref":"A1"});return{SheetNames:f,Sheets:p}}function r(e,t,r){var n=[{c:0,r:0},{t:"n",v:0},0,0];return r.qpro&&20768!=r.vers?(n[0].c=e.read_shift(1),n[3]=e.read_shift(1),n[0].r=e.read_shift(2),e.l+=2):(n[2]=e.read_shift(1),n[0].c=e.read_shift(2),n[0].r=e.read_shift(2)),n}function n(e,t,n){var i=e.l+t,a=r(e,0,n);if(a[1].t="s",20768==n.vers){e.l++;var o=e.read_shift(1);return a[1].v=e.read_shift(o,"utf8"),a}return n.qpro&&e.l++,a[1].v=e.read_shift(i-e.l,"cstr"),a}function i(e,t,r){var n=new_buf$1(7+r.length);n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(1,39);for(var i=0;i<n.length;++i){var a=r.charCodeAt(i);n.write_shift(1,a>=128?95:a)}return n.write_shift(1,0),n}function a(e,t,r){var n=new_buf$1(7);return n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(2,r,"i"),n}function o(e,t,r){var n=new_buf$1(13);return n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(8,r,"f"),n}function s(e,t,r){var n=32768&t;return t=(n?e:0)+((t&=-32769)>=8192?t-16384:t),(n?"":"$")+(r?encode_col$1(t):encode_row$1(t))}var l={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},c=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function u(e){var t=[{c:0,r:0},{t:"n",v:0},0];return t[0].r=e.read_shift(2),t[3]=e[e.l++],t[0].c=e[e.l++],t}function d(e,t,r,n){var i=new_buf$1(6+n.length);i.write_shift(2,e),i.write_shift(1,r),i.write_shift(1,t),i.write_shift(1,39);for(var a=0;a<n.length;++a){var o=n.charCodeAt(a);i.write_shift(1,o>=128?95:o)}return i.write_shift(1,0),i}function h(e,t){var r=u(e),n=e.read_shift(4),i=e.read_shift(4),a=e.read_shift(2);if(65535==a)return 0===n&&0xc0000000===i?(r[1].t="e",r[1].v=15):0===n&&0xd0000000===i?(r[1].t="e",r[1].v=42):r[1].v=0,r;var o=32768&a;return a=(32767&a)-16446,r[1].v=(1-2*o)*(i*Math.pow(2,a+32)+n*Math.pow(2,a)),r}function p(e,t,r,n){var i=new_buf$1(14);if(i.write_shift(2,e),i.write_shift(1,r),i.write_shift(1,t),0==n)return i.write_shift(4,0),i.write_shift(4,0),i.write_shift(2,65535),i;var a,o=0,s=0,l=0;return n<0&&(o=1,n=-n),s=0|Math.log2(n),0x80000000&(l=(n/=Math.pow(2,s-31))>>>0)||(++s,l=(n/=2)>>>0),n-=l,l|=0x80000000,l>>>=0,a=(n*=Math.pow(2,32))>>>0,i.write_shift(4,a),i.write_shift(4,l),s+=16383+(o?32768:0),i.write_shift(2,s),i}function f(e,t){var r=u(e),n=e.read_shift(8,"f");return r[1].v=n,r}function m(e,t){return 0==e[e.l+t-1]?e.read_shift(t,"cstr"):""}function g(e,t){var r=new_buf$1(5+e.length);r.write_shift(2,14e3),r.write_shift(2,t);for(var n=0;n<e.length;++n){var i=e.charCodeAt(n);r[r.l++]=i>127?95:i}return r[r.l++]=0,r}var _={0:{n:"BOF",f:parseuint16$1},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:function(e,t,r){var n={s:{c:0,r:0},e:{c:0,r:0}};return 8==t&&r.qpro?(n.s.c=e.read_shift(1),e.l++,n.s.r=e.read_shift(2),n.e.c=e.read_shift(1),e.l++,n.e.r=e.read_shift(2),n):(n.s.c=e.read_shift(2),n.s.r=e.read_shift(2),12==t&&r.qpro&&(e.l+=2),n.e.c=e.read_shift(2),n.e.r=e.read_shift(2),12==t&&r.qpro&&(e.l+=2),65535==n.s.c&&(n.s.c=n.e.c=n.s.r=n.e.r=0),n)}},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:function(e,t,n){var i=r(e,0,n);return i[1].v=e.read_shift(2,"i"),i}},14:{n:"NUMBER",f:function(e,t,n){var i=r(e,0,n);return i[1].v=e.read_shift(8,"f"),i}},15:{n:"LABEL",f:n},16:{n:"FORMULA",f:function(e,t,n){var i=e.l+t,a=r(e,0,n);if(a[1].v=e.read_shift(8,"f"),n.qpro)e.l=i;else{var o=e.read_shift(2);!function(e,t){prep_blob$1(e,0);var r=[],n=0,i="",a="",o="",u="";for(;e.l<e.length;){var d=e[e.l++];switch(d){case 0:r.push(e.read_shift(8,"f"));break;case 1:a=s(t[0].c,e.read_shift(2),!0),i=s(t[0].r,e.read_shift(2),!1),r.push(a+i);break;case 2:var h=s(t[0].c,e.read_shift(2),!0),p=s(t[0].r,e.read_shift(2),!1);a=s(t[0].c,e.read_shift(2),!0),i=s(t[0].r,e.read_shift(2),!1),r.push(h+p+":"+a+i);break;case 3:if(e.l<e.length)return void console.error("WK1 premature formula end");break;case 4:r.push("("+r.pop()+")");break;case 5:r.push(e.read_shift(2));break;case 6:for(var f="";d=e[e.l++];)f+=String.fromCharCode(d);r.push('"'+f.replace(/"/g,'""')+'"');break;case 8:r.push("-"+r.pop());break;case 23:r.push("+"+r.pop());break;case 22:r.push("NOT("+r.pop()+")");break;case 20:case 21:u=r.pop(),o=r.pop(),r.push(["AND","OR"][d-20]+"("+o+","+u+")");break;default:if(d<32&&c[d])u=r.pop(),o=r.pop(),r.push(o+c[d]+u);else{if(!l[d])return d<=7?console.error("WK1 invalid opcode "+d.toString(16)):d<=24?console.error("WK1 unsupported op "+d.toString(16)):d<=30?console.error("WK1 invalid opcode "+d.toString(16)):d<=115?console.error("WK1 unsupported function opcode "+d.toString(16)):console.error("WK1 unrecognized opcode "+d.toString(16));if(69==(n=l[d][1])&&(n=e[e.l++]),n>r.length)return void console.error("WK1 bad formula parse 0x"+d.toString(16)+":|"+r.join("|")+"|");var m=r.slice(-n);r.length-=n,r.push(l[d][0]+"("+m.join(",")+")")}}}1==r.length?t[1].f=""+r[0]:console.error("WK1 bad formula parse |"+r.join("|")+"|")}(e.slice(e.l,e.l+o),a),e.l+=o}return a}},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:n},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:m},222:{n:"SHEETNAMELP",f:function(e,t){var r=e[e.l++];r>t-1&&(r=t-1);for(var n="";n.length<r;)n+=String.fromCharCode(e[e.l++]);return n}},65535:{n:""}},y={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:function(e,t){var r=u(e);return r[1].t="s",r[1].v=e.read_shift(t-4,"cstr"),r}},23:{n:"NUMBER17",f:h},24:{n:"NUMBER18",f:function(e,t){var r=u(e);r[1].v=e.read_shift(2);var n=r[1].v>>1;if(1&r[1].v)switch(7&n){case 0:n=5e3*(n>>3);break;case 1:n=500*(n>>3);break;case 2:n=(n>>3)/20;break;case 3:n=(n>>3)/200;break;case 4:n=(n>>3)/2e3;break;case 5:n=(n>>3)/2e4;break;case 6:n=(n>>3)/16;break;case 7:n=(n>>3)/64}return r[1].v=n,r}},25:{n:"FORMULA19",f:function(e,t){var r=h(e);return e.l+=t-14,r}},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:function(e,t){for(var r={},n=e.l+t;e.l<n;){var i=e.read_shift(2);if(14e3==i){for(r[i]=[0,""],r[i][0]=e.read_shift(2);e[e.l];)r[i][1]+=String.fromCharCode(e[e.l]),e.l++;e.l++}}return r}},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:function(e,t){var r=u(e),n=e.read_shift(4);return r[1].v=n>>6,r}},38:{n:"??"},39:{n:"NUMBER27",f:f},40:{n:"FORMULA28",f:function(e,t){var r=f(e);return e.l+=t-10,r}},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:m},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:function(e,t,r){if(r.qpro&&!(t<21)){var n=e.read_shift(1);return e.l+=17,e.l+=1,e.l+=2,[n,e.read_shift(t-21,"cstr")]}}},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:function(e,t){var r=t||{};if(+r.codepage>=0&&set_cp$1(+r.codepage),"string"==r.type)throw new Error("Cannot write WK1 to JS string");var n=buf_array$1(),s=safe_decode_range$1(e["!ref"]),l=Array.isArray(e),c=[];write_biff_rec$1(n,0,function(e){var t=new_buf$1(2);return t.write_shift(2,e),t}(1030)),write_biff_rec$1(n,6,function(e){var t=new_buf$1(8);return t.write_shift(2,e.s.c),t.write_shift(2,e.s.r),t.write_shift(2,e.e.c),t.write_shift(2,e.e.r),t}(s));for(var u=Math.min(s.e.r,8191),d=s.s.r;d<=u;++d)for(var h=encode_row$1(d),p=s.s.c;p<=s.e.c;++p){d===s.s.r&&(c[p]=encode_col$1(p));var f=c[p]+h,m=l?(e[d]||[])[p]:e[f];if(m&&"z"!=m.t)if("n"==m.t)(0|m.v)==m.v&&m.v>=-32768&&m.v<=32767?write_biff_rec$1(n,13,a(d,p,m.v)):write_biff_rec$1(n,14,o(d,p,m.v));else write_biff_rec$1(n,15,i(d,p,format_cell$1(m).slice(0,239)))}return write_biff_rec$1(n,1),n.end()},book_to_wk3:function(e,t){var r=t||{};if(+r.codepage>=0&&set_cp$1(+r.codepage),"string"==r.type)throw new Error("Cannot write WK3 to JS string");var n=buf_array$1();write_biff_rec$1(n,0,function(e){var t=new_buf$1(26);t.write_shift(2,4096),t.write_shift(2,4),t.write_shift(4,0);for(var r=0,n=0,i=0,a=0;a<e.SheetNames.length;++a){var o=e.SheetNames[a],s=e.Sheets[o];if(s&&s["!ref"]){++i;var l=decode_range$1(s["!ref"]);r<l.e.r&&(r=l.e.r),n<l.e.c&&(n=l.e.c)}}r>8191&&(r=8191);return t.write_shift(2,r),t.write_shift(1,i),t.write_shift(1,n),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(1,1),t.write_shift(1,2),t.write_shift(4,0),t.write_shift(4,0),t}(e));for(var i=0,a=0;i<e.SheetNames.length;++i)(e.Sheets[e.SheetNames[i]]||{})["!ref"]&&write_biff_rec$1(n,27,g(e.SheetNames[i],a++));var o=0;for(i=0;i<e.SheetNames.length;++i){var s=e.Sheets[e.SheetNames[i]];if(s&&s["!ref"]){for(var l=safe_decode_range$1(s["!ref"]),c=Array.isArray(s),u=[],h=Math.min(l.e.r,8191),f=l.s.r;f<=h;++f)for(var m=encode_row$1(f),_=l.s.c;_<=l.e.c;++_){f===l.s.r&&(u[_]=encode_col$1(_));var y=u[_]+m,b=c?(s[f]||[])[_]:s[y];if(b&&"z"!=b.t)if("n"==b.t)write_biff_rec$1(n,23,p(f,_,o,b.v));else write_biff_rec$1(n,22,d(f,_,o,format_cell$1(b).slice(0,239)))}++o}}return write_biff_rec$1(n,1),n.end()},to_workbook:function(e,r){switch(r.type){case"base64":return t(s2a$1(Base64_decode$1(e)),r);case"binary":return t(s2a$1(e),r);case"buffer":case"array":return t(e,r)}throw"Unsupported type "+r.type}}}();function parse_rpr$1(e){var t={},r=e.match(tagregex$1),n=0,i=!1;if(r)for(;n!=r.length;++n){var a=parsexmltag$1(r[n]);switch(a[0].replace(/\w*:/g,"")){case"<condense":case"<extend":break;case"<shadow":if(!a.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":if("1"==a.val)break;t.cp=CS2CP$1[parseInt(a.val,10)];break;case"<outline":if(!a.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=a.val;break;case"<sz":t.sz=a.val;break;case"<strike":if(!a.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!a.val)break;switch(a.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting"}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if("0"==a.val)break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if("0"==a.val)break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":a.rgb&&(t.color=a.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":t.family=a.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":t.valign=a.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":case"<scheme":case"<scheme>":case"<scheme/>":case"</scheme>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(47!==a[0].charCodeAt(1)&&!i)throw new Error("Unrecognized rich format "+a[0])}}return t}var parse_rs$1=function(){var e=matchtag("t"),t=matchtag("rPr");function r(r){var n=r.match(e);if(!n)return{t:"s",v:""};var i={t:"s",v:unescapexml$1(n[1])},a=r.match(t);return a&&(i.s=parse_rpr$1(a[1])),i}var n=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(e){return e.replace(n,"").split(i).map(r).filter((function(e){return e.v}))}}(),rs_to_html$1=function(){var e=/(\r\n|\n)/g;function t(t){var r=[[],t.v,[]];return t.v?(t.s&&function(e,t,r){var n=[];e.u&&n.push("text-decoration: underline;"),e.uval&&n.push("text-underline-style:"+e.uval+";"),e.sz&&n.push("font-size:"+e.sz+"pt;"),e.outline&&n.push("text-effect: outline;"),e.shadow&&n.push("text-shadow: auto;"),t.push('<span style="'+n.join("")+'">'),e.b&&(t.push("<b>"),r.push("</b>")),e.i&&(t.push("<i>"),r.push("</i>")),e.strike&&(t.push("<s>"),r.push("</s>"));var i=e.valign||"";"superscript"==i||"super"==i?i="sup":"subscript"==i&&(i="sub"),""!=i&&(t.push("<"+i+">"),r.push("</"+i+">")),r.push("</span>")}(t.s,r[0],r[2]),r[0].join("")+r[1].replace(e,"<br/>")+r[2].join("")):""}return function(e){return e.map(t).join("")}}(),sitregex$1=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,sirregex$1=/<(?:\w+:)?r>/,sirphregex=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function parse_si$1(e,t){var r=!t||t.cellHTML,n={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=unescapexml$1(utf8read$1(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=utf8read$1(e),r&&(n.h=escapehtml$1(n.t))):e.match(sirregex$1)&&(n.r=utf8read$1(e),n.t=unescapexml$1(utf8read$1((e.replace(sirphregex,"").match(sitregex$1)||[]).join("").replace(tagregex$1,""))),r&&(n.h=rs_to_html$1(parse_rs$1(n.r)))),n):{t:""}}var sstr0=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,sstr1$1=/<(?:\w+:)?(?:si|sstItem)>/g,sstr2$1=/<\/(?:\w+:)?(?:si|sstItem)>/;function parse_sst_xml$1(e,t){var r=[],n="";if(!e)return r;var i=e.match(sstr0);if(i){n=i[2].replace(sstr1$1,"").split(sstr2$1);for(var a=0;a!=n.length;++a){var o=parse_si$1(n[a].trim(),t);null!=o&&(r[r.length]=o)}i=parsexmltag$1(i[1]),r.Count=i.count,r.Unique=i.uniqueCount}return r}function parse_BrtBeginSst$1(e){return[e.read_shift(4),e.read_shift(4)]}function parse_sst_bin$1(e,t){var r=[],n=!1;return recordhopper$1(e,(function(e,i,a){switch(a){case 159:r.Count=e[0],r.Unique=e[1];break;case 19:r.push(e);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(i.T,!n||t.WTF)throw new Error("Unexpected record 0x"+a.toString(16))}})),r}function _JS2ANSI$1(e){for(var t=[],r=e.split(""),n=0;n<r.length;++n)t[n]=r[n].charCodeAt(0);return t}function parse_CRYPTOVersion$1(e,t){var r={};return r.Major=e.read_shift(2),r.Minor=e.read_shift(2),t>=4&&(e.l+=t-4),r}function parse_DataSpaceVersionInfo$1(e){var t={};return t.id=e.read_shift(0,"lpp4"),t.R=parse_CRYPTOVersion$1(e,4),t.U=parse_CRYPTOVersion$1(e,4),t.W=parse_CRYPTOVersion$1(e,4),t}function parse_DataSpaceMapEntry$1(e){for(var t=e.read_shift(4),r=e.l+t-4,n={},i=e.read_shift(4),a=[];i-- >0;)a.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(n.name=e.read_shift(0,"lpp4"),n.comps=a,e.l!=r)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+r);return n}function parse_DataSpaceMap$1(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(parse_DataSpaceMapEntry$1(e));return t}function parse_DataSpaceDefinition$1(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(e.read_shift(0,"lpp4"));return t}function parse_TransformInfoHeader$1(e){var t={};return e.read_shift(4),e.l+=4,t.id=e.read_shift(0,"lpp4"),t.name=e.read_shift(0,"lpp4"),t.R=parse_CRYPTOVersion$1(e,4),t.U=parse_CRYPTOVersion$1(e,4),t.W=parse_CRYPTOVersion$1(e,4),t}function parse_Primary$1(e){var t=parse_TransformInfoHeader$1(e);if(t.ename=e.read_shift(0,"8lpp4"),t.blksz=e.read_shift(4),t.cmode=e.read_shift(4),4!=e.read_shift(4))throw new Error("Bad !Primary record");return t}function parse_EncryptionHeader$1(e,t){var r=e.l+t,n={};n.Flags=63&e.read_shift(4),e.l+=4,n.AlgID=e.read_shift(4);var i=!1;switch(n.AlgID){case 26126:case 26127:case 26128:i=36==n.Flags;break;case 26625:i=4==n.Flags;break;case 0:i=16==n.Flags||4==n.Flags||36==n.Flags;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=e.read_shift(4),n.KeySize=e.read_shift(4),n.ProviderType=e.read_shift(4),e.l+=8,n.CSPName=e.read_shift(r-e.l>>1,"utf16le"),e.l=r,n}function parse_EncryptionVerifier$1(e,t){var r={},n=e.l+t;return e.l+=4,r.Salt=e.slice(e.l,e.l+16),e.l+=16,r.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),r.VerifierHash=e.slice(e.l,n),e.l=n,r}function parse_EncryptionInfo$1(e){var t=parse_CRYPTOVersion$1(e);switch(t.Minor){case 2:return[t.Minor,parse_EncInfoStd$1(e)];case 3:return[t.Minor,parse_EncInfoExt$1()];case 4:return[t.Minor,parse_EncInfoAgl$1(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}function parse_EncInfoStd$1(e){if(36!=(63&e.read_shift(4)))throw new Error("EncryptionInfo mismatch");var t=e.read_shift(4);return{t:"Std",h:parse_EncryptionHeader$1(e,t),v:parse_EncryptionVerifier$1(e,e.length-e.l)}}function parse_EncInfoExt$1(){throw new Error("File is password-protected: ECMA-376 Extensible")}function parse_EncInfoAgl$1(e){var t=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var r=e.read_shift(e.length-e.l,"utf8"),n={};return r.replace(tagregex$1,(function(e){var r=parsexmltag$1(e);switch(strip_ns$1(r[0])){case"<?xml":case"<encryption":case"</encryption>":case"</keyEncryptors>":case"</keyEncryptor>":break;case"<keyData":t.forEach((function(e){n[e]=r[e]}));break;case"<dataIntegrity":n.encryptedHmacKey=r.encryptedHmacKey,n.encryptedHmacValue=r.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"<keyEncryptor":n.uri=r.uri;break;case"<encryptedKey":n.encs.push(r);break;default:throw r[0]}})),n}function parse_RC4CryptoHeader$1(e,t){var r={},n=r.EncryptionVersionInfo=parse_CRYPTOVersion$1(e,4);if(t-=4,2!=n.Minor)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);r.Flags=e.read_shift(4),t-=4;var i=e.read_shift(4);return t-=4,r.EncryptionHeader=parse_EncryptionHeader$1(e,i),t-=i,r.EncryptionVerifier=parse_EncryptionVerifier$1(e,t),r}function parse_RC4Header$1(e){var t={},r=t.EncryptionVersionInfo=parse_CRYPTOVersion$1(e,4);if(1!=r.Major||1!=r.Minor)throw"unrecognized version code "+r.Major+" : "+r.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}function crypto_CreatePasswordVerifier_Method1$1(e){var t,r,n=0,i=_JS2ANSI$1(e),a=i.length+1;for((t=new_raw_buf$1(a))[0]=i.length,r=1;r!=a;++r)t[r]=i[r-1];for(r=a-1;r>=0;--r)n=((16384&n?1:0)|n<<1&32767)^t[r];return 52811^n}var crypto_CreateXorArray_Method1$1=function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],t=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],n=function(e,t){return 255&((r=e^t)/2|128*r);var r};return function(i){for(var a,o,s,l=_JS2ANSI$1(i),c=function(e){for(var n=t[e.length-1],i=104,a=e.length-1;a>=0;--a)for(var o=e[a],s=0;7!=s;++s)64&o&&(n^=r[i]),o*=2,--i;return n}(l),u=l.length,d=new_raw_buf$1(16),h=0;16!=h;++h)d[h]=0;for(1&~u||(a=c>>8,d[u]=n(e[0],a),--u,a=255&c,o=l[l.length-1],d[u]=n(o,a));u>0;)a=c>>8,d[--u]=n(l[u],a),a=255&c,d[--u]=n(l[u],a);for(u=15,s=15-l.length;s>0;)a=c>>8,d[u]=n(e[s],a),--s,a=255&c,d[--u]=n(l[u],a),--u,--s;return d}}(),crypto_DecryptData_Method1$1=function(e,t,r,n,i){var a,o;for(i||(i=t),n||(n=crypto_CreateXorArray_Method1$1(e)),a=0;a!=t.length;++a)o=t[a],o=255&((o^=n[r])>>5|o<<3),i[a]=o,++r;return[i,r,n]},crypto_MakeXorDecryptor$1=function(e){var t=0,r=crypto_CreateXorArray_Method1$1(e);return function(e){var n=crypto_DecryptData_Method1$1("",e,t,r);return t=n[1],n[0]}};function parse_XORObfuscation$1(e,t,r,n){var i={key:parseuint16$1(e),verificationBytes:parseuint16$1(e)};return r.password&&(i.verifier=crypto_CreatePasswordVerifier_Method1$1(r.password)),n.valid=i.verificationBytes===i.verifier,n.valid&&(n.insitu=crypto_MakeXorDecryptor$1(r.password)),i}function parse_FilePassHeader$1(e,t,r){var n=r||{};return n.Info=e.read_shift(2),e.l-=2,1===n.Info?n.Data=parse_RC4Header$1(e):n.Data=parse_RC4CryptoHeader$1(e,t),n}function parse_FilePass$1(e,t,r){var n={Type:r.biff>=8?e.read_shift(2):0};return n.Type?parse_FilePassHeader$1(e,t-2,n):parse_XORObfuscation$1(e,r.biff>=8?t:t-2,r,n),n}var RTF=function(){function e(e,r){switch(r.type){case"base64":return t(Base64_decode$1(e),r);case"binary":return t(e,r);case"buffer":return t(has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):a2s$1(e),r);case"array":return t(cc2str$1(e),r)}throw new Error("Unrecognized type "+r.type)}function t(e,t){var r=(t||{}).dense?[]:{},n=e.match(/\\trowd.*?\\row\b/g);if(!n.length)throw new Error("RTF missing table");var i={s:{c:0,r:0},e:{c:0,r:n.length-1}};return n.forEach((function(e,t){Array.isArray(r)&&(r[t]=[]);for(var n,a=/\\\w+\b/g,o=0,s=-1;n=a.exec(e);){if("\\cell"===n[0]){var l=e.slice(o,a.lastIndex-n[0].length);if(" "==l[0]&&(l=l.slice(1)),++s,l.length){var c={v:l,t:"s"};Array.isArray(r)?r[t][s]=c:r[encode_cell$1({r:t,c:s})]=c}}o=a.lastIndex}s>i.e.c&&(i.e.c=s)})),r["!ref"]=encode_range$1(i),r}return{to_workbook:function(t,r){return sheet_to_workbook$1(e(t,r),r)},to_sheet:e,from_sheet:function(e){for(var t,r=["{\\rtf1\\ansi"],n=safe_decode_range$1(e["!ref"]),i=Array.isArray(e),a=n.s.r;a<=n.e.r;++a){r.push("\\trowd\\trautofit1");for(var o=n.s.c;o<=n.e.c;++o)r.push("\\cellx"+(o+1));for(r.push("\\pard\\intbl"),o=n.s.c;o<=n.e.c;++o){var s=encode_cell$1({r:a,c:o});(t=i?(e[a]||[])[o]:e[s])&&(null!=t.v||t.f&&!t.F)&&(r.push(" "+(t.w||(format_cell$1(t),t.w))),r.push("\\cell"))}r.push("\\pard\\intbl\\row")}return r.join("")+"}"}}}();function hex2RGB$1(e){var t=e.slice("#"===e[0]?1:0).slice(0,6);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function rgb2Hex$1(e){for(var t=0,r=1;3!=t;++t)r=256*r+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}function rgb2HSL$1(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(t,r,n),a=Math.min(t,r,n),o=i-a;if(0===o)return[0,0,t];var s,l=0,c=i+a;switch(s=o/(c>1?2-c:c),i){case t:l=((r-n)/o+6)%6;break;case r:l=(n-t)/o+2;break;case n:l=(t-r)/o+4}return[l/6,s,c/2]}function hsl2RGB$1(e){var t,r=e[0],n=e[1],i=e[2],a=2*n*(i<.5?i:1-i),o=i-a/2,s=[o,o,o],l=6*r;if(0!==n)switch(0|l){case 0:case 6:t=a*l,s[0]+=a,s[1]+=t;break;case 1:t=a*(2-l),s[0]+=t,s[1]+=a;break;case 2:t=a*(l-2),s[1]+=a,s[2]+=t;break;case 3:t=a*(4-l),s[1]+=t,s[2]+=a;break;case 4:t=a*(l-4),s[2]+=a,s[0]+=t;break;case 5:t=a*(6-l),s[2]+=t,s[0]+=a}for(var c=0;3!=c;++c)s[c]=Math.round(255*s[c]);return s}function rgb_tint$1(e,t){if(0===t)return e;var r=rgb2HSL$1(hex2RGB$1(e));return r[2]=t<0?r[2]*(1+t):1-(1-r[2])*(1-t),rgb2Hex$1(hsl2RGB$1(r))}var DEF_MDW$1=6,MAX_MDW$1=15,MIN_MDW$1=1,MDW$1=DEF_MDW$1;function width2px$1(e){return Math.floor((e+Math.round(128/MDW$1)/256)*MDW$1)}function px2char$1(e){return Math.floor((e-5)/MDW$1*100+.5)/100}function char2width$1(e){return Math.round((e*MDW$1+5)/MDW$1*256)/256}function cycle_width$1(e){return char2width$1(px2char$1(width2px$1(e)))}function find_mdw_colw$1(e){var t=Math.abs(e-cycle_width$1(e)),r=MDW$1;if(t>.005)for(MDW$1=MIN_MDW$1;MDW$1<MAX_MDW$1;++MDW$1)Math.abs(e-cycle_width$1(e))<=t&&(t=Math.abs(e-cycle_width$1(e)),r=MDW$1);MDW$1=r}function process_col$1(e){e.width?(e.wpx=width2px$1(e.width),e.wch=px2char$1(e.wpx),e.MDW=MDW$1):e.wpx?(e.wch=px2char$1(e.wpx),e.width=char2width$1(e.wch),e.MDW=MDW$1):"number"==typeof e.wch&&(e.width=char2width$1(e.wch),e.wpx=width2px$1(e.width),e.MDW=MDW$1),e.customWidth&&delete e.customWidth}var DEF_PPI$1=96,PPI$1=DEF_PPI$1;function px2pt$1(e){return 96*e/PPI$1}function pt2px$1(e){return e*PPI$1/96}var XLMLPatternTypeMap$1={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function parse_borders$1(e,t,r,n){t.Borders=[];var i={},a=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var r=parsexmltag$1(e);switch(strip_ns$1(r[0])){case"<borders":case"<borders>":case"</borders>":case"</border>":case"<left/>":case"<left":case"<left>":case"</left>":case"<right/>":case"<right":case"<right>":case"</right>":case"<top/>":case"<top":case"<top>":case"</top>":case"<bottom/>":case"<bottom":case"<bottom>":case"</bottom>":case"<diagonal":case"<diagonal>":case"<diagonal/>":case"</diagonal>":case"<horizontal":case"<horizontal>":case"<horizontal/>":case"</horizontal>":case"<vertical":case"<vertical>":case"<vertical/>":case"</vertical>":case"<start":case"<start>":case"<start/>":case"</start>":case"<end":case"<end>":case"<end/>":case"</end>":case"<color":case"<color>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<border":case"<border>":case"<border/>":i={},r.diagonalUp&&(i.diagonalUp=parsexmlbool$1(r.diagonalUp)),r.diagonalDown&&(i.diagonalDown=parsexmlbool$1(r.diagonalDown)),t.Borders.push(i);break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(n&&n.WTF&&!a)throw new Error("unrecognized "+r[0]+" in borders")}}))}function parse_fills$1(e,t,r,n){t.Fills=[];var i={},a=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var r=parsexmltag$1(e);switch(strip_ns$1(r[0])){case"<fills":case"<fills>":case"</fills>":case"</fill>":case"<gradientFill>":case"<patternFill/>":case"</patternFill>":case"<bgColor/>":case"</bgColor>":case"<fgColor/>":case"</fgColor>":case"<stop":case"<stop/>":case"</stop>":case"<color":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<fill>":case"<fill":case"<fill/>":i={},t.Fills.push(i);break;case"<gradientFill":case"</gradientFill>":t.Fills.push(i),i={};break;case"<patternFill":case"<patternFill>":r.patternType&&(i.patternType=r.patternType);break;case"<bgColor":i.bgColor||(i.bgColor={}),r.indexed&&(i.bgColor.indexed=parseInt(r.indexed,10)),r.theme&&(i.bgColor.theme=parseInt(r.theme,10)),r.tint&&(i.bgColor.tint=parseFloat(r.tint)),r.rgb&&(i.bgColor.rgb=r.rgb.slice(-6));break;case"<fgColor":i.fgColor||(i.fgColor={}),r.theme&&(i.fgColor.theme=parseInt(r.theme,10)),r.tint&&(i.fgColor.tint=parseFloat(r.tint)),null!=r.rgb&&(i.fgColor.rgb=r.rgb.slice(-6));break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(n&&n.WTF&&!a)throw new Error("unrecognized "+r[0]+" in fills")}}))}function parse_fonts$1(e,t,r,n){t.Fonts=[];var i={},a=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var o=parsexmltag$1(e);switch(strip_ns$1(o[0])){case"<fonts":case"<fonts>":case"</fonts>":case"<font":case"<font>":case"<name/>":case"</name>":case"<sz/>":case"</sz>":case"<vertAlign/>":case"</vertAlign>":case"<family/>":case"</family>":case"<scheme/>":case"</scheme>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"</font>":case"<font/>":t.Fonts.push(i),i={};break;case"<name":o.val&&(i.name=utf8read$1(o.val));break;case"<b":i.bold=o.val?parsexmlbool$1(o.val):1;break;case"<b/>":i.bold=1;break;case"<i":i.italic=o.val?parsexmlbool$1(o.val):1;break;case"<i/>":i.italic=1;break;case"<u":switch(o.val){case"none":i.underline=0;break;case"single":i.underline=1;break;case"double":i.underline=2;break;case"singleAccounting":i.underline=33;break;case"doubleAccounting":i.underline=34}break;case"<u/>":i.underline=1;break;case"<strike":i.strike=o.val?parsexmlbool$1(o.val):1;break;case"<strike/>":i.strike=1;break;case"<outline":i.outline=o.val?parsexmlbool$1(o.val):1;break;case"<outline/>":i.outline=1;break;case"<shadow":i.shadow=o.val?parsexmlbool$1(o.val):1;break;case"<shadow/>":i.shadow=1;break;case"<condense":i.condense=o.val?parsexmlbool$1(o.val):1;break;case"<condense/>":i.condense=1;break;case"<extend":i.extend=o.val?parsexmlbool$1(o.val):1;break;case"<extend/>":i.extend=1;break;case"<sz":o.val&&(i.sz=+o.val);break;case"<vertAlign":o.val&&(i.vertAlign=o.val);break;case"<family":o.val&&(i.family=parseInt(o.val,10));break;case"<scheme":o.val&&(i.scheme=o.val);break;case"<charset":if("1"==o.val)break;o.codepage=CS2CP$1[parseInt(o.val,10)];break;case"<color":if(i.color||(i.color={}),o.auto&&(i.color.auto=parsexmlbool$1(o.auto)),o.rgb)i.color.rgb=o.rgb.slice(-6);else if(o.indexed){i.color.index=parseInt(o.indexed,10);var s=XLSIcv$1[i.color.index];81==i.color.index&&(s=XLSIcv$1[1]),s||(s=XLSIcv$1[1]),i.color.rgb=s[0].toString(16)+s[1].toString(16)+s[2].toString(16)}else o.theme&&(i.color.theme=parseInt(o.theme,10),o.tint&&(i.color.tint=parseFloat(o.tint)),o.theme&&r.themeElements&&r.themeElements.clrScheme&&(i.color.rgb=rgb_tint$1(r.themeElements.clrScheme[i.color.theme].rgb,i.color.tint||0)));break;case"<AlternateContent":case"<ext":a=!0;break;case"</AlternateContent>":case"</ext>":a=!1;break;default:if(n&&n.WTF&&!a)throw new Error("unrecognized "+o[0]+" in fonts")}}))}function parse_numFmts$1(e,t,r){t.NumberFmt=[];for(var n=keys$4(table_fmt$1),i=0;i<n.length;++i)t.NumberFmt[n[i]]=table_fmt$1[n[i]];var a=e[0].match(tagregex$1);if(a)for(i=0;i<a.length;++i){var o=parsexmltag$1(a[i]);switch(strip_ns$1(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":case"</numFmt>":break;case"<numFmt":var s=unescapexml$1(utf8read$1(o.formatCode)),l=parseInt(o.numFmtId,10);if(t.NumberFmt[l]=s,l>0){if(l>392){for(l=392;l>60&&null!=t.NumberFmt[l];--l);t.NumberFmt[l]=s}SSF_load$1(s,l)}break;default:if(r.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}var cellXF_uint$1=["numFmtId","fillId","fontId","borderId","xfId"],cellXF_bool$1=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function parse_cellXfs$1(e,t,r){var n;t.CellXf=[];var i=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var a=parsexmltag$1(e),o=0;switch(strip_ns$1(a[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":case"</xf>":case"</alignment>":case"<protection":case"</protection>":case"<protection/>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<xf":case"<xf/>":for(delete(n=a)[0],o=0;o<cellXF_uint$1.length;++o)n[cellXF_uint$1[o]]&&(n[cellXF_uint$1[o]]=parseInt(n[cellXF_uint$1[o]],10));for(o=0;o<cellXF_bool$1.length;++o)n[cellXF_bool$1[o]]&&(n[cellXF_bool$1[o]]=parsexmlbool$1(n[cellXF_bool$1[o]]));if(t.NumberFmt&&n.numFmtId>392)for(o=392;o>60;--o)if(t.NumberFmt[n.numFmtId]==t.NumberFmt[o]){n.numFmtId=o;break}t.CellXf.push(n);break;case"<alignment":case"<alignment/>":var s={};a.vertical&&(s.vertical=a.vertical),a.horizontal&&(s.horizontal=a.horizontal),null!=a.textRotation&&(s.textRotation=a.textRotation),a.indent&&(s.indent=a.indent),a.wrapText&&(s.wrapText=parsexmlbool$1(a.wrapText)),n.alignment=s;break;case"<AlternateContent":case"<ext":i=!0;break;case"</AlternateContent>":case"</ext>":i=!1;break;default:if(r&&r.WTF&&!i)throw new Error("unrecognized "+a[0]+" in cellXfs")}}))}var parse_sty_xml$1=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,r=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,n=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,i=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(a,o,s){var l,c={};return a?((l=(a=a.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"")).match(e))&&parse_numFmts$1(l,c,s),(l=a.match(n))&&parse_fonts$1(l,c,o,s),(l=a.match(r))&&parse_fills$1(l,c,o,s),(l=a.match(i))&&parse_borders$1(l,c,o,s),(l=a.match(t))&&parse_cellXfs$1(l,c,s),c):c}}();function parse_BrtFmt$1(e,t){return[e.read_shift(2),parse_XLWideString$1(e)]}function parse_BrtFont$1(e,t,r){var n={};n.sz=e.read_shift(2)/20;var i=parse_FontFlags$1(e);switch(i.fItalic&&(n.italic=1),i.fCondense&&(n.condense=1),i.fExtend&&(n.extend=1),i.fShadow&&(n.shadow=1),i.fOutline&&(n.outline=1),i.fStrikeout&&(n.strike=1),700===e.read_shift(2)&&(n.bold=1),e.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript"}var a=e.read_shift(1);0!=a&&(n.underline=a);var o=e.read_shift(1);o>0&&(n.family=o);var s=e.read_shift(1);switch(s>0&&(n.charset=s),e.l++,n.color=parse_BrtColor$1(e),e.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor"}return n.name=parse_XLWideString$1(e),n}var parse_BrtFill$1=parsenoop$1;function parse_BrtXF$1(e,t){var r=e.l+t,n=e.read_shift(2),i=e.read_shift(2);return e.l=r,{ixfe:n,numFmtId:i}}var parse_BrtBorder$1=parsenoop$1;function parse_sty_bin$1(e,t,r){var n={NumberFmt:[]};for(var i in table_fmt$1)n.NumberFmt[i]=table_fmt$1[i];n.CellXf=[],n.Fonts=[];var a=[],o=!1;return recordhopper$1(e,(function(e,i,s){switch(s){case 44:n.NumberFmt[e[0]]=e[1],SSF_load$1(e[1],e[0]);break;case 43:n.Fonts.push(e),null!=e.color.theme&&t&&t.themeElements&&t.themeElements.clrScheme&&(e.color.rgb=rgb_tint$1(t.themeElements.clrScheme[e.color.theme].rgb,e.color.tint||0));break;case 1025:case 45:case 46:case 48:case 507:case 572:case 475:case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 47:617==a[a.length-1]&&n.CellXf.push(e);break;case 35:o=!0;break;case 36:o=!1;break;case 37:a.push(s),o=!0;break;case 38:a.pop(),o=!1;break;default:if(i.T>0)a.push(s);else if(i.T<0)a.pop();else if(!o||r.WTF&&37!=a[a.length-1])throw new Error("Unexpected record 0x"+s.toString(16))}})),n}var XLSXThemeClrScheme$1=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function parse_clrScheme$1(e,t,r){t.themeElements.clrScheme=[];var n={};(e[0].match(tagregex$1)||[]).forEach((function(e){var i=parsexmltag$1(e);switch(i[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=i.val;break;case"<a:sysClr":n.rgb=i.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":"/"===i[0].charAt(1)?(t.themeElements.clrScheme[XLSXThemeClrScheme$1.indexOf(i[0])]=n,n={}):n.name=i[0].slice(3,i[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+i[0]+" in clrScheme")}}))}function parse_fontScheme(){}function parse_fmtScheme(){}var clrsregex=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,fntsregex=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,fmtsregex=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function parse_themeElements$1(e,t,r){var n;t.themeElements={},[["clrScheme",clrsregex,parse_clrScheme$1],["fontScheme",fntsregex,parse_fontScheme],["fmtScheme",fmtsregex,parse_fmtScheme]].forEach((function(i){if(!(n=e.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](n,t,r)}))}var themeltregex=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function parse_theme_xml$1(e,t){var r;e&&0!==e.length||(e=write_theme$1());var n={};if(!(r=e.match(themeltregex)))throw new Error("themeElements not found in theme");return parse_themeElements$1(r[0],n,t),n.raw=e,n}function write_theme$1(e,t){var r=[XML_HEADER$1];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function parse_Theme$1(e,t,r){var n=e.l+t;if(124226!==e.read_shift(4))if(r.cellStyles){var i,a=e.slice(e.l);e.l=n;try{i=zip_read$1(a,{type:"array"})}catch(s){return}var o=getzipstr$1(i,"theme/theme/theme1.xml",!0);if(o)return parse_theme_xml$1(o,r)}else e.l=n}function parse_ColorTheme$1(e){return e.read_shift(4)}function parse_FullColorExt$1(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:case 4:e.l+=4;break;case 1:t.xclrValue=parse_IcvXF$1(e,4);break;case 2:t.xclrValue=parse_LongRGBA$1(e);break;case 3:t.xclrValue=parse_ColorTheme$1(e)}return e.l+=8,t}function parse_IcvXF$1(e,t){return parsenoop$1(e,t)}function parse_XFExtGradient$1(e,t){return parsenoop$1(e,t)}function parse_ExtProp$1(e){var t=e.read_shift(2),r=e.read_shift(2)-4,n=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=parse_FullColorExt$1(e);break;case 6:n[1]=parse_XFExtGradient$1(e,r);break;case 14:case 15:n[1]=e.read_shift(1===r?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return n}function parse_XFExt$1(e,t){var r=e.l+t;e.l+=2;var n=e.read_shift(2);e.l+=2;for(var i=e.read_shift(2),a=[];i-- >0;)a.push(parse_ExtProp$1(e,r-e.l));return{ixfe:n,ext:a}}function update_xfext$1(e,t){t.forEach((function(e){e[0]}))}function parse_BrtMdtinfo$1(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:parse_XLWideString$1(e)}}function parse_BrtMdb$1(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function parse_BrtBeginEsmdb$1(e){return e.l+=4,0!=e.read_shift(4)}function parse_xlmeta_bin$1(e,t,r){var n={Types:[],Cell:[],Value:[]},i=r||{},a=[],o=!1,s=2;return recordhopper$1(e,(function(e,t,r){switch(r){case 335:n.Types.push({name:e.name});break;case 51:e.forEach((function(e){1==s?n.Cell.push({type:n.Types[e[0]-1].name,index:e[1]}):0==s&&n.Value.push({type:n.Types[e[0]-1].name,index:e[1]})}));break;case 337:s=e?1:0;break;case 338:s=2;break;case 35:a.push(r),o=!0;break;case 36:a.pop(),o=!1;break;default:if(t.T);else if(!o||i.WTF&&35!=a[a.length-1])throw new Error("Unexpected record 0x"+r.toString(16))}})),n}function parse_xlmeta_xml$1(e,t,r){var n={Types:[],Cell:[],Value:[]};if(!e)return n;var i,a=!1,o=2;return e.replace(tagregex$1,(function(e){var t=parsexmltag$1(e);switch(strip_ns$1(t[0])){case"<?xml":case"<metadata":case"</metadata>":case"<metadataTypes":case"</metadataTypes>":case"</metadataType>":case"</futureMetadata>":case"<bk>":case"</bk>":case"</rc>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<metadataType":n.Types.push({name:t.name});break;case"<futureMetadata":for(var s=0;s<n.Types.length;++s)n.Types[s].name==t.name&&(i=n.Types[s]);break;case"<rc":1==o?n.Cell.push({type:n.Types[t.t-1].name,index:+t.v}):0==o&&n.Value.push({type:n.Types[t.t-1].name,index:+t.v});break;case"<cellMetadata":o=1;break;case"</cellMetadata>":case"</valueMetadata>":o=2;break;case"<valueMetadata":o=0;break;case"<ext":a=!0;break;case"</ext>":a=!1;break;case"<rvb":if(!i)break;i.offsets||(i.offsets=[]),i.offsets.push(+t.i);break;default:if(!a&&r.WTF)throw new Error("unrecognized "+t[0]+" in metadata")}return e})),n}function parse_cc_xml$1(e){var t=[];if(!e)return t;var r=1;return(e.match(tagregex$1)||[]).forEach((function(e){var n=parsexmltag$1(e);switch(n[0]){case"<?xml":case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete n[0],n.i?r=n.i:n.i=r,t.push(n)}})),t}function parse_BrtCalcChainItem$$1(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=encode_cell$1(r);var n=e.read_shift(1);return 2&n&&(t.l="1"),8&n&&(t.a="1"),t}function parse_cc_bin$1(e,t,r){var n=[];return recordhopper$1(e,(function(e,t,r){if(63===r)n.push(e);else if(!t.T)throw new Error("Unexpected record 0x"+r.toString(16))})),n}function parse_xlink_xml$1(){}function parse_xlink_bin$1(e,t,r,n){if(!e)return e;var i=n||{},a=!1;recordhopper$1(e,(function(e,t,r){switch(r){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:a=!0;break;case 36:a=!1;break;default:if(t.T);else if(!a||i.WTF)throw new Error("Unexpected record 0x"+r.toString(16))}}),i)}function parse_drawing$1(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}function sheet_insert_comments$1(e,t,r,n){var i,a=Array.isArray(e);t.forEach((function(t){var o=decode_cell$1(t.ref);if(a?(e[o.r]||(e[o.r]=[]),i=e[o.r][o.c]):i=e[t.ref],!i){i={t:"z"},a?e[o.r][o.c]=i:e[t.ref]=i;var s=safe_decode_range$1(e["!ref"]||"BDWGO1000001:A1");s.s.r>o.r&&(s.s.r=o.r),s.e.r<o.r&&(s.e.r=o.r),s.s.c>o.c&&(s.s.c=o.c),s.e.c<o.c&&(s.e.c=o.c);var l=encode_range$1(s);l!==e["!ref"]&&(e["!ref"]=l)}i.c||(i.c=[]);var c={a:t.author,t:t.t,r:t.r,T:r};t.h&&(c.h=t.h);for(var u=i.c.length-1;u>=0;--u){if(!r&&i.c[u].T)return;r&&!i.c[u].T&&i.c.splice(u,1)}if(r&&n)for(u=0;u<n.length;++u)if(c.a==n[u].id){c.a=n[u].name||c.a;break}i.c.push(c)}))}function parse_comments_xml$1(e,t){if(e.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],n=[],i=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach((function(e){if(""!==e&&""!==e.trim()){var t=e.match(/<(?:\w+:)?author[^>]*>(.*)/);t&&r.push(t[1])}}));var a=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return a&&a[1]&&a[1].split(/<\/\w*:?comment>/).forEach((function(e){if(""!==e&&""!==e.trim()){var i=e.match(/<(?:\w+:)?comment[^>]*>/);if(i){var a=parsexmltag$1(i[0]),o={author:a.authorId&&r[a.authorId]||"sheetjsghost",ref:a.ref,guid:a.guid},s=decode_cell$1(a.ref);if(!(t.sheetRows&&t.sheetRows<=s.r)){var l=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),c=!!l&&!!l[1]&&parse_si$1(l[1])||{r:"",t:"",h:""};o.r=c.r,"<t></t>"==c.r&&(c.t=c.h=""),o.t=(c.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),t.cellHTML&&(o.h=c.h),n.push(o)}}}})),n}function parse_tcmnt_xml$1(e,t){var r=[],n=!1,i={},a=0;return e.replace(tagregex$1,(function(o,s){var l=parsexmltag$1(o);switch(strip_ns$1(l[0])){case"<?xml":case"<ThreadedComments":case"</ThreadedComments>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<threadedComment":i={author:l.personId,guid:l.id,ref:l.ref,T:1};break;case"</threadedComment>":null!=i.t&&r.push(i);break;case"<text>":case"<text":a=s+o.length;break;case"</text>":i.t=e.slice(a,s).replace(/\r\n/g,"\n").replace(/\r/g,"\n");break;case"<mentions":case"<mentions>":case"<ext":n=!0;break;case"</mentions>":case"</ext>":n=!1;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+l[0]+" in threaded comments")}return o})),r}function parse_people_xml$1(e,t){var r=[],n=!1;return e.replace(tagregex$1,(function(e){var i=parsexmltag$1(e);switch(strip_ns$1(i[0])){case"<?xml":case"<personList":case"</personList>":case"</person>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<person":r.push({name:i.displayname,id:i.id});break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+i[0]+" in threaded comments")}return e})),r}function parse_BrtBeginComment$1(e){var t={};t.iauthor=e.read_shift(4);var r=parse_UncheckedRfX$1(e);return t.rfx=r.s,t.ref=encode_cell$1(r.s),e.l+=16,t}var parse_BrtCommentAuthor$1=parse_XLWideString$1;function parse_comments_bin$1(e,t){var r=[],n=[],i={},a=!1;return recordhopper$1(e,(function(e,o,s){switch(s){case 632:n.push(e);break;case 635:i=e;break;case 637:i.t=e.t,i.h=e.h,i.r=e.r;break;case 636:if(i.author=n[i.iauthor],delete i.iauthor,t.sheetRows&&i.rfx&&t.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,r.push(i);break;case 3072:case 37:case 38:break;case 35:a=!0;break;case 36:a=!1;break;default:if(o.T);else if(!a||t.WTF)throw new Error("Unexpected record 0x"+s.toString(16))}})),r}var CT_VBA$1="application/vnd.ms-office.vbaProject";function make_vba_xls$1(e){var t=CFB$1.utils.cfb_new({root:"R"});return e.FullPaths.forEach((function(r,n){if("/"!==r.slice(-1)&&r.match(/_VBA_PROJECT_CUR/)){var i=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");CFB$1.utils.cfb_add(t,i,e.FileIndex[n].content)}})),CFB$1.write(t)}function parse_ds_bin$1(){return{"!type":"dialog"}}function parse_ds_xml$1(){return{"!type":"dialog"}}function parse_ms_bin$1(){return{"!type":"macro"}}function parse_ms_xml$1(){return{"!type":"macro"}}var rc_to_a1$1=function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(e,r,n,i){var a=!1,o=!1;0==n.length?o=!0:"["==n.charAt(0)&&(o=!0,n=n.slice(1,-1)),0==i.length?a=!0:"["==i.charAt(0)&&(a=!0,i=i.slice(1,-1));var s=n.length>0?0|parseInt(n,10):0,l=i.length>0?0|parseInt(i,10):0;return a?l+=t.c:--l,o?s+=t.r:--s,r+(a?"":"$")+encode_col$1(l)+(o?"":"$")+encode_row$1(s)}return function(n,i){return t=i,n.replace(e,r)}}(),crefregex$1=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,a1_to_rc$1=function(){return function(e,t){return e.replace(crefregex$1,(function(e,r,n,i,a,o){var s=decode_col$1(i)-(n?0:t.c),l=decode_row$1(o)-(a?0:t.r);return r+"R"+(0==l?"":a?l+1:"["+l+"]")+"C"+(0==s?"":n?s+1:"["+s+"]")}))}}();function shift_formula_str$1(e,t){return e.replace(crefregex$1,(function(e,r,n,i,a,o){return r+("$"==n?n+i:encode_col$1(decode_col$1(i)+t.c))+("$"==a?a+o:encode_row$1(decode_row$1(o)+t.r))}))}function shift_formula_xlsx$1(e,t,r){var n=decode_range$1(t).s,i=decode_cell$1(r);return shift_formula_str$1(e,{r:i.r-n.r,c:i.c-n.c})}function fuzzyfmla$1(e){return 1!=e.length}function _xlfn$1(e){return e.replace(/_xlfn\./g,"")}function parseread1$1(e){e.l+=1}function parse_ColRelU$1(e,t){var r=e.read_shift(2);return[16383&r,r>>14&1,r>>15&1]}function parse_RgceArea$1(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return parse_RgceArea_BIFF2$1(e);12==r.biff&&(n=4)}var i=e.read_shift(n),a=e.read_shift(n),o=parse_ColRelU$1(e),s=parse_ColRelU$1(e);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:a,c:s[0],cRel:s[1],rRel:s[2]}}}function parse_RgceArea_BIFF2$1(e){var t=parse_ColRelU$1(e),r=parse_ColRelU$1(e),n=e.read_shift(1),i=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function parse_RgceAreaRel$1(e,t,r){if(r.biff<8)return parse_RgceArea_BIFF2$1(e);var n=e.read_shift(12==r.biff?4:2),i=e.read_shift(12==r.biff?4:2),a=parse_ColRelU$1(e),o=parse_ColRelU$1(e);return{s:{r:n,c:a[0],cRel:a[1],rRel:a[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function parse_RgceLoc$1(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return parse_RgceLoc_BIFF2$1(e);var n=e.read_shift(r&&12==r.biff?4:2),i=parse_ColRelU$1(e);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function parse_RgceLoc_BIFF2$1(e){var t=parse_ColRelU$1(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function parse_RgceElfLoc$1(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:255&r,fQuoted:!!(16384&r),cRel:r>>15,rRel:r>>15}}function parse_RgceLocRel$1(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return parse_RgceLocRel_BIFF2$1(e);var i=e.read_shift(n>=12?4:2),a=e.read_shift(2),o=(16384&a)>>14,s=(32768&a)>>15;if(a&=16383,1==s)for(;i>524287;)i-=1048576;if(1==o)for(;a>8191;)a-=16384;return{r:i,c:a,cRel:o,rRel:s}}function parse_RgceLocRel_BIFF2$1(e){var t=e.read_shift(2),r=e.read_shift(1),n=(32768&t)>>15,i=(16384&t)>>14;return t&=16383,1==n&&t>=8192&&(t-=16384),1==i&&r>=128&&(r-=256),{r:t,c:r,cRel:i,rRel:n}}function parse_PtgArea$1(e,t,r){return[(96&e[e.l++])>>5,parse_RgceArea$1(e,r.biff>=2&&r.biff<=5?6:8,r)]}function parse_PtgArea3d$1(e,t,r){var n=(96&e[e.l++])>>5,i=e.read_shift(2,"i"),a=8;if(r)switch(r.biff){case 5:e.l+=12,a=6;break;case 12:a=12}return[n,i,parse_RgceArea$1(e,a,r)]}function parse_PtgAreaErr$1(e,t,r){var n=(96&e[e.l++])>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function parse_PtgAreaErr3d$1(e,t,r){var n=(96&e[e.l++])>>5,i=e.read_shift(2),a=8;if(r)switch(r.biff){case 5:e.l+=12,a=6;break;case 12:a=12}return e.l+=a,[n,i]}function parse_PtgAreaN$1(e,t,r){return[(96&e[e.l++])>>5,parse_RgceAreaRel$1(e,t-1,r)]}function parse_PtgArray$1(e,t,r){var n=(96&e[e.l++])>>5;return e.l+=2==r.biff?6:12==r.biff?14:7,[n]}function parse_PtgAttrBaxcel$1(e){var t=1&e[e.l+1];return e.l+=4,[t,1]}function parse_PtgAttrChoose$1(e,t,r){e.l+=2;for(var n=e.read_shift(r&&2==r.biff?1:2),i=[],a=0;a<=n;++a)i.push(e.read_shift(r&&2==r.biff?1:2));return i}function parse_PtgAttrGoto$1(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=2,[n,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgAttrIf$1(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=2,[n,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgAttrIfError$1(e){var t=255&e[e.l+1]?1:0;return e.l+=2,[t,e.read_shift(2)]}function parse_PtgAttrSemi$1(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=r&&2==r.biff?3:4,[n]}function parse_PtgAttrSpaceType$1(e){return[e.read_shift(1),e.read_shift(1)]}function parse_PtgAttrSpace$1(e){return e.read_shift(2),parse_PtgAttrSpaceType$1(e)}function parse_PtgAttrSpaceSemi$1(e){return e.read_shift(2),parse_PtgAttrSpaceType$1(e)}function parse_PtgRef$1(e,t,r){var n=(96&e[e.l])>>5;return e.l+=1,[n,parse_RgceLoc$1(e,0,r)]}function parse_PtgRefN$1(e,t,r){var n=(96&e[e.l])>>5;return e.l+=1,[n,parse_RgceLocRel$1(e,0,r)]}function parse_PtgRef3d$1(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var i=e.read_shift(2);return r&&5==r.biff&&(e.l+=12),[n,i,parse_RgceLoc$1(e,0,r)]}function parse_PtgFunc$1(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var i=e.read_shift(r&&r.biff<=3?1:2);return[FtabArgc$1[i],Ftab$1[i],n]}function parse_PtgFuncVar$1(e,t,r){var n=e[e.l++],i=e.read_shift(1),a=r&&r.biff<=3?[88==n?-1:0,e.read_shift(1)]:parsetab$1(e);return[i,(0===a[0]?Ftab$1:Cetab$1)[a[1]]]}function parsetab$1(e){return[e[e.l+1]>>7,32767&e.read_shift(2)]}function parse_PtgAttrSum$1(e,t,r){e.l+=r&&2==r.biff?3:4}function parse_PtgExp$1(e,t,r){return e.l++,r&&12==r.biff?[e.read_shift(4,"i"),0]:[e.read_shift(2),e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgErr$1(e){return e.l++,BErr$1[e.read_shift(1)]}function parse_PtgInt$1(e){return e.l++,e.read_shift(2)}function parse_PtgBool$1(e){return e.l++,0!==e.read_shift(1)}function parse_PtgNum$1(e){return e.l++,parse_Xnum$1(e)}function parse_PtgStr$1(e,t,r){return e.l++,parse_ShortXLUnicodeString$1(e,t-1,r)}function parse_SerAr$1(e,t){var r=[e.read_shift(1)];if(12==t)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2}switch(r[0]){case 4:r[1]=parsebool$1(e,1)?"TRUE":"FALSE",12!=t&&(e.l+=7);break;case 37:case 16:r[1]=BErr$1[e[e.l]],e.l+=12==t?4:8;break;case 0:e.l+=8;break;case 1:r[1]=parse_Xnum$1(e);break;case 2:r[1]=parse_XLUnicodeString2$1(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function parse_PtgExtraMem$1(e,t,r){for(var n=e.read_shift(12==r.biff?4:2),i=[],a=0;a!=n;++a)i.push((12==r.biff?parse_UncheckedRfX$1:parse_Ref8U$1)(e));return i}function parse_PtgExtraArray$1(e,t,r){var n=0,i=0;12==r.biff?(n=e.read_shift(4),i=e.read_shift(4)):(i=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,0==--i&&(i=256));for(var a=0,o=[];a!=n&&(o[a]=[]);++a)for(var s=0;s!=i;++s)o[a][s]=parse_SerAr$1(e,r.biff);return o}function parse_PtgName$1(e,t,r){var n=e.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,a=e.read_shift(i);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12}return[n,0,a]}function parse_PtgNameX$1(e,t,r){return 5==r.biff?parse_PtgNameX_BIFF5$1(e):[e.read_shift(1)>>>5&3,e.read_shift(2),e.read_shift(4)]}function parse_PtgNameX_BIFF5$1(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}function parse_PtgMemArea$1(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=r&&2==r.biff?3:4,[n,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgMemFunc$1(e,t,r){return[e.read_shift(1)>>>5&3,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgRefErr$1(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,12==r.biff&&(e.l+=2),[n]}function parse_PtgRefErr3d$1(e,t,r){var n=(96&e[e.l++])>>5,i=e.read_shift(2),a=4;if(r)switch(r.biff){case 5:a=15;break;case 12:a=6}return e.l+=a,[n,i]}var parse_PtgMemErr$1=parsenoop$1,parse_PtgMemNoMem$1=parsenoop$1,parse_PtgTbl$1=parsenoop$1;function parse_PtgElfLoc$1(e,t,r){return e.l+=2,[parse_RgceElfLoc$1(e)]}function parse_PtgElfNoop$1(e){return e.l+=6,[]}var parse_PtgElfCol$1=parse_PtgElfLoc$1,parse_PtgElfColS$1=parse_PtgElfNoop$1,parse_PtgElfColSV$1=parse_PtgElfNoop$1,parse_PtgElfColV$1=parse_PtgElfLoc$1;function parse_PtgElfLel$1(e){return e.l+=2,[parseuint16$1(e),1&e.read_shift(2)]}var parse_PtgElfRadical$1=parse_PtgElfLoc$1,parse_PtgElfRadicalLel$1=parse_PtgElfLel$1,parse_PtgElfRadicalS$1=parse_PtgElfNoop$1,parse_PtgElfRw$1=parse_PtgElfLoc$1,parse_PtgElfRwV$1=parse_PtgElfLoc$1,PtgListRT$1=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function parse_PtgList$1(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i=e.read_shift(2),a=e.read_shift(2);return{ixti:t,coltype:3&r,rt:PtgListRT$1[r>>2&31],idx:n,c:i,C:a}}function parse_PtgSxName$1(e){return e.l+=2,[e.read_shift(4)]}function parse_PtgSheet$1(e,t,r){return e.l+=5,e.l+=2,e.l+=2==r.biff?1:4,["PTGSHEET"]}function parse_PtgEndSheet$1(e,t,r){return e.l+=2==r.biff?4:5,["PTGENDSHEET"]}function parse_PtgMemAreaN$1(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}function parse_PtgMemNoMemN$1(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}function parse_PtgAttrNoop$1(e){return e.l+=4,[0,0]}var PtgTypes$1={1:{n:"PtgExp",f:parse_PtgExp$1},2:{n:"PtgTbl",f:parse_PtgTbl$1},3:{n:"PtgAdd",f:parseread1$1},4:{n:"PtgSub",f:parseread1$1},5:{n:"PtgMul",f:parseread1$1},6:{n:"PtgDiv",f:parseread1$1},7:{n:"PtgPower",f:parseread1$1},8:{n:"PtgConcat",f:parseread1$1},9:{n:"PtgLt",f:parseread1$1},10:{n:"PtgLe",f:parseread1$1},11:{n:"PtgEq",f:parseread1$1},12:{n:"PtgGe",f:parseread1$1},13:{n:"PtgGt",f:parseread1$1},14:{n:"PtgNe",f:parseread1$1},15:{n:"PtgIsect",f:parseread1$1},16:{n:"PtgUnion",f:parseread1$1},17:{n:"PtgRange",f:parseread1$1},18:{n:"PtgUplus",f:parseread1$1},19:{n:"PtgUminus",f:parseread1$1},20:{n:"PtgPercent",f:parseread1$1},21:{n:"PtgParen",f:parseread1$1},22:{n:"PtgMissArg",f:parseread1$1},23:{n:"PtgStr",f:parse_PtgStr$1},26:{n:"PtgSheet",f:parse_PtgSheet$1},27:{n:"PtgEndSheet",f:parse_PtgEndSheet$1},28:{n:"PtgErr",f:parse_PtgErr$1},29:{n:"PtgBool",f:parse_PtgBool$1},30:{n:"PtgInt",f:parse_PtgInt$1},31:{n:"PtgNum",f:parse_PtgNum$1},32:{n:"PtgArray",f:parse_PtgArray$1},33:{n:"PtgFunc",f:parse_PtgFunc$1},34:{n:"PtgFuncVar",f:parse_PtgFuncVar$1},35:{n:"PtgName",f:parse_PtgName$1},36:{n:"PtgRef",f:parse_PtgRef$1},37:{n:"PtgArea",f:parse_PtgArea$1},38:{n:"PtgMemArea",f:parse_PtgMemArea$1},39:{n:"PtgMemErr",f:parse_PtgMemErr$1},40:{n:"PtgMemNoMem",f:parse_PtgMemNoMem$1},41:{n:"PtgMemFunc",f:parse_PtgMemFunc$1},42:{n:"PtgRefErr",f:parse_PtgRefErr$1},43:{n:"PtgAreaErr",f:parse_PtgAreaErr$1},44:{n:"PtgRefN",f:parse_PtgRefN$1},45:{n:"PtgAreaN",f:parse_PtgAreaN$1},46:{n:"PtgMemAreaN",f:parse_PtgMemAreaN$1},47:{n:"PtgMemNoMemN",f:parse_PtgMemNoMemN$1},57:{n:"PtgNameX",f:parse_PtgNameX$1},58:{n:"PtgRef3d",f:parse_PtgRef3d$1},59:{n:"PtgArea3d",f:parse_PtgArea3d$1},60:{n:"PtgRefErr3d",f:parse_PtgRefErr3d$1},61:{n:"PtgAreaErr3d",f:parse_PtgAreaErr3d$1},255:{}},PtgDupes$1={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},Ptg18$1={1:{n:"PtgElfLel",f:parse_PtgElfLel$1},2:{n:"PtgElfRw",f:parse_PtgElfRw$1},3:{n:"PtgElfCol",f:parse_PtgElfCol$1},6:{n:"PtgElfRwV",f:parse_PtgElfRwV$1},7:{n:"PtgElfColV",f:parse_PtgElfColV$1},10:{n:"PtgElfRadical",f:parse_PtgElfRadical$1},11:{n:"PtgElfRadicalS",f:parse_PtgElfRadicalS$1},13:{n:"PtgElfColS",f:parse_PtgElfColS$1},15:{n:"PtgElfColSV",f:parse_PtgElfColSV$1},16:{n:"PtgElfRadicalLel",f:parse_PtgElfRadicalLel$1},25:{n:"PtgList",f:parse_PtgList$1},29:{n:"PtgSxName",f:parse_PtgSxName$1},255:{}},Ptg19$1={0:{n:"PtgAttrNoop",f:parse_PtgAttrNoop$1},1:{n:"PtgAttrSemi",f:parse_PtgAttrSemi$1},2:{n:"PtgAttrIf",f:parse_PtgAttrIf$1},4:{n:"PtgAttrChoose",f:parse_PtgAttrChoose$1},8:{n:"PtgAttrGoto",f:parse_PtgAttrGoto$1},16:{n:"PtgAttrSum",f:parse_PtgAttrSum$1},32:{n:"PtgAttrBaxcel",f:parse_PtgAttrBaxcel$1},33:{n:"PtgAttrBaxcel",f:parse_PtgAttrBaxcel$1},64:{n:"PtgAttrSpace",f:parse_PtgAttrSpace$1},65:{n:"PtgAttrSpaceSemi",f:parse_PtgAttrSpaceSemi$1},128:{n:"PtgAttrIfError",f:parse_PtgAttrIfError$1},255:{}};function parse_RgbExtra$1(e,t,r,n){if(n.biff<8)return parsenoop$1(e,t);for(var i=e.l+t,a=[],o=0;o!==r.length;++o)switch(r[o][0]){case"PtgArray":r[o][1]=parse_PtgExtraArray$1(e,0,n),a.push(r[o][1]);break;case"PtgMemArea":r[o][2]=parse_PtgExtraMem$1(e,r[o][1],n),a.push(r[o][2]);break;case"PtgExp":n&&12==n.biff&&(r[o][1][1]=e.read_shift(4),a.push(r[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[o][0]}return 0!==(t=i-e.l)&&a.push(parsenoop$1(e,t)),a}function parse_Rgce$1(e,t,r){for(var n,i,a=e.l+t,o=[];a!=e.l;)t=a-e.l,i=e[e.l],n=PtgTypes$1[i]||PtgTypes$1[PtgDupes$1[i]],24!==i&&25!==i||(n=(24===i?Ptg18$1:Ptg19$1)[e[e.l+1]]),n&&n.f?o.push([n.n,n.f(e,t,r)]):parsenoop$1(e,t);return o}function stringify_array$1(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r],i=[],a=0;a<n.length;++a){var o=n[a];if(o)if(2===o[0])i.push('"'+o[1].replace(/"/g,'""')+'"');else i.push(o[1]);else i.push("")}t.push(i.join(","))}return t.join(";")}var PtgBinOp$1={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function formula_quote_sheet_name$1(e,t){if(!(e||t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function get_ixti_raw$1(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),0==t?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(e[n[0]][0]){case 357:return i=-1==n[1]?"#REF":e.SheetNames[n[1]],n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 358:return null!=r.SID?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return i=-1==n[1]?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map((function(e){return e.Name})).join(";;");default:return e[n[0]][0][3]?(i=-1==n[1]?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function get_ixti$1(e,t,r){var n=get_ixti_raw$1(e,t,r);return"#REF"==n?n:formula_quote_sheet_name$1(n,r)}function stringify_formula$1(e,t,r,n,i){var a,o,s,l,c=i&&i.biff||8,u={s:{c:0,r:0}},d=[],h=0,p=0,f="";if(!e[0]||!e[0][0])return"";for(var m=-1,g="",_=0,y=e[0].length;_<y;++_){var b=e[0][_];switch(b[0]){case"PtgUminus":d.push("-"+d.pop());break;case"PtgUplus":d.push("+"+d.pop());break;case"PtgPercent":d.push(d.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(a=d.pop(),o=d.pop(),m>=0){switch(e[0][m][1][0]){case 0:g=fill$3(" ",e[0][m][1][1]);break;case 1:g=fill$3("\r",e[0][m][1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}o+=g,m=-1}d.push(o+PtgBinOp$1[b[0]]+a);break;case"PtgIsect":a=d.pop(),o=d.pop(),d.push(o+" "+a);break;case"PtgUnion":a=d.pop(),o=d.pop(),d.push(o+","+a);break;case"PtgRange":a=d.pop(),o=d.pop(),d.push(o+":"+a);break;case"PtgAttrChoose":case"PtgAttrGoto":case"PtgAttrIf":case"PtgAttrIfError":case"PtgAttrBaxcel":case"PtgAttrSemi":case"PtgMemArea":case"PtgTbl":case"PtgMemErr":case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":case"PtgMemFunc":case"PtgMemNoMem":break;case"PtgRef":s=shift_cell_xls$1(b[1][1],u,i),d.push(encode_cell_xls$1(s,c));break;case"PtgRefN":s=r?shift_cell_xls$1(b[1][1],r,i):b[1][1],d.push(encode_cell_xls$1(s,c));break;case"PtgRef3d":h=b[1][1],s=shift_cell_xls$1(b[1][2],u,i),f=get_ixti$1(n,h,i),d.push(f+"!"+encode_cell_xls$1(s,c));break;case"PtgFunc":case"PtgFuncVar":var v=b[1][0],S=b[1][1];v||(v=0);var w=0==(v&=127)?[]:d.slice(-v);d.length-=v,"User"===S&&(S=w.shift()),d.push(S+"("+w.join(",")+")");break;case"PtgBool":d.push(b[1]?"TRUE":"FALSE");break;case"PtgInt":case"PtgErr":d.push(b[1]);break;case"PtgNum":d.push(String(b[1]));break;case"PtgStr":d.push('"'+b[1].replace(/"/g,'""')+'"');break;case"PtgAreaN":l=shift_range_xls$1(b[1][1],r?{s:r}:u,i),d.push(encode_range_xls$1(l,i));break;case"PtgArea":l=shift_range_xls$1(b[1][1],u,i),d.push(encode_range_xls$1(l,i));break;case"PtgArea3d":h=b[1][1],l=b[1][2],f=get_ixti$1(n,h,i),d.push(f+"!"+encode_range_xls$1(l,i));break;case"PtgAttrSum":d.push("SUM("+d.pop()+")");break;case"PtgName":p=b[1][2];var T=(n.names||[])[p-1]||(n[0]||[])[p],E=T?T.Name:"SH33TJSNAME"+String(p);E&&"_xlfn."==E.slice(0,6)&&!i.xlfn&&(E=E.slice(6)),d.push(E);break;case"PtgNameX":var x,A=b[1][1];if(p=b[1][2],!(i.biff<=5)){var C="";if(14849==((n[A]||[])[0]||[])[0]||(1025==((n[A]||[])[0]||[])[0]?n[A][p]&&n[A][p].itab>0&&(C=n.SheetNames[n[A][p].itab-1]+"!"):C=n.SheetNames[p-1]+"!"),n[A]&&n[A][p])C+=n[A][p].Name;else if(n[0]&&n[0][p])C+=n[0][p].Name;else{var R=(get_ixti_raw$1(n,A,i)||"").split(";;");R[p-1]?C=R[p-1]:C+="SH33TJSERRX"}d.push(C);break}A<0&&(A=-A),n[A]&&(x=n[A][p]),x||(x={Name:"SH33TJSERRY"}),d.push(x.Name);break;case"PtgParen":var D="(",P=")";if(m>=0){switch(g="",e[0][m][1][0]){case 2:D=fill$3(" ",e[0][m][1][1])+D;break;case 3:D=fill$3("\r",e[0][m][1][1])+D;break;case 4:P=fill$3(" ",e[0][m][1][1])+P;break;case 5:P=fill$3("\r",e[0][m][1][1])+P;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}m=-1}d.push(D+d.pop()+P);break;case"PtgRefErr":case"PtgRefErr3d":case"PtgAreaErr":case"PtgAreaErr3d":d.push("#REF!");break;case"PtgExp":s={c:b[1][1],r:b[1][0]};var I={c:r.c,r:r.r};if(n.sharedf[encode_cell$1(s)]){var k=n.sharedf[encode_cell$1(s)];d.push(stringify_formula$1(k,u,I,n,i))}else{var M=!1;for(a=0;a!=n.arrayf.length;++a)if(o=n.arrayf[a],!(s.c<o[0].s.c||s.c>o[0].e.c||s.r<o[0].s.r||s.r>o[0].e.r)){d.push(stringify_formula$1(o[1],u,I,n,i)),M=!0;break}M||d.push(b[1])}break;case"PtgArray":d.push("{"+stringify_array$1(b[1])+"}");break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=_;break;case"PtgMissArg":d.push("");break;case"PtgList":d.push("Table"+b[1].idx+"[#"+b[1].rt+"]");break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");default:throw new Error("Unrecognized Formula Token: "+String(b))}if(3!=i.biff&&m>=0&&-1==["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"].indexOf(e[0][_][0])){var $=!0;switch((b=e[0][m])[1][0]){case 4:$=!1;case 0:g=fill$3(" ",b[1][1]);break;case 5:$=!1;case 1:g=fill$3("\r",b[1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+b[1][0])}d.push(($?g:"")+d.pop()+($?"":g)),m=-1}}if(d.length>1&&i.WTF)throw new Error("bad formula stack");return d[0]}function parse_ArrayParsedFormula$1(e,t,r){var n,i=e.l+t,a=2==r.biff?1:2,o=e.read_shift(a);if(65535==o)return[[],parsenoop$1(e,t-2)];var s=parse_Rgce$1(e,o,r);return t!==o+a&&(n=parse_RgbExtra$1(e,t-o-a,s,r)),e.l=i,[s,n]}function parse_XLSCellParsedFormula$1(e,t,r){var n,i=e.l+t,a=2==r.biff?1:2,o=e.read_shift(a);if(65535==o)return[[],parsenoop$1(e,t-2)];var s=parse_Rgce$1(e,o,r);return t!==o+a&&(n=parse_RgbExtra$1(e,t-o-a,s,r)),e.l=i,[s,n]}function parse_NameParsedFormula$1(e,t,r,n){var i,a=e.l+t,o=parse_Rgce$1(e,n,r);return a!==e.l&&(i=parse_RgbExtra$1(e,a-e.l,o,r)),[o,i]}function parse_SharedParsedFormula$1(e,t,r){var n,i=e.l+t,a=e.read_shift(2),o=parse_Rgce$1(e,a,r);return 65535==a?[[],parsenoop$1(e,t-2)]:(t!==a+2&&(n=parse_RgbExtra$1(e,i-a-2,o,r)),[o,n])}function parse_FormulaValue$1(e){var t;if(65535!==__readUInt16LE$1(e,e.l+6))return[parse_Xnum$1(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=1===e[e.l+2],e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}function parse_Formula$1(e,t,r){var n=e.l+t,i=parse_XLSCell$1(e);2==r.biff&&++e.l;var a=parse_FormulaValue$1(e),o=e.read_shift(1);2!=r.biff&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var s=parse_XLSCellParsedFormula$1(e,n-e.l,r);return{cell:i,val:a[0],formula:s,shared:o>>3&1,tt:a[1]}}function parse_XLSBParsedFormula$1(e,t,r){var n=e.read_shift(4),i=parse_Rgce$1(e,n,r),a=e.read_shift(4);return[i,a>0?parse_RgbExtra$1(e,a,i,r):null]}var parse_XLSBArrayParsedFormula$1=parse_XLSBParsedFormula$1,parse_XLSBCellParsedFormula$1=parse_XLSBParsedFormula$1,parse_XLSBNameParsedFormula$1=parse_XLSBParsedFormula$1,parse_XLSBSharedParsedFormula$1=parse_XLSBParsedFormula$1,Cetab$1={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},Ftab$1={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},FtabArgc$1={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function ods_to_csf_formula$1(e){return"of:"==e.slice(0,3)&&(e=e.slice(3)),61==e.charCodeAt(0)&&61==(e=e.slice(1)).charCodeAt(0)&&(e=e.slice(1)),(e=(e=(e=e.replace(/COM\.MICROSOFT\./g,"")).replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,(function(e,t){return t.replace(/\./g,"")}))).replace(/\[.(#[A-Z]*[?!])\]/g,"$1")).replace(/[;~]/g,",").replace(/\|/g,";")}function ods_to_csf_3D$1(e){var t=e.split(":");return[t[0].split(".")[0],t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}var strs$1={},_ssfopts$1={};function default_margins$1(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];"xlml"==t&&(r=[1,1,1,1,.5,.5]),null==e.left&&(e.left=r[0]),null==e.right&&(e.right=r[1]),null==e.top&&(e.top=r[2]),null==e.bottom&&(e.bottom=r[3]),null==e.header&&(e.header=r[4]),null==e.footer&&(e.footer=r[5])}}function safe_format$1(e,t,r,n,i,a){try{n.cellNF&&(e.z=table_fmt$1[t])}catch(s){if(n.WTF)throw s}if("z"!==e.t||n.cellStyles){if("d"===e.t&&"string"==typeof e.v&&(e.v=parseDate$1(e.v)),(!n||!1!==n.cellText)&&"z"!==e.t)try{if(null==table_fmt$1[t]&&SSF_load$1(SSFImplicit$1[t]||"General",t),"e"===e.t)e.w=e.w||BErr$1[e.v];else if(0===t)if("n"===e.t)(0|e.v)===e.v?e.w=e.v.toString(10):e.w=SSF_general_num$1(e.v);else if("d"===e.t){var o=datenum$1(e.v);e.w=(0|o)===o?o.toString(10):SSF_general_num$1(o)}else{if(void 0===e.v)return"";e.w=SSF_general$1(e.v,_ssfopts$1)}else"d"===e.t?e.w=SSF_format$1(t,datenum$1(e.v),_ssfopts$1):e.w=SSF_format$1(t,e.v,_ssfopts$1)}catch(s){if(n.WTF)throw s}if(n.cellStyles&&null!=r)try{e.s=a.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=rgb_tint$1(i.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),n.WTF&&(e.s.fgColor.raw_rgb=i.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=rgb_tint$1(i.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),n.WTF&&(e.s.bgColor.raw_rgb=i.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(s){if(n.WTF&&a.Fills)throw s}}}function parse_ws_xml_dim$1(e,t){var r=safe_decode_range$1(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=encode_range$1(r))}var mergecregex$1=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,sheetdataregex=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,hlinkregex$1=/<(?:\w:)?hyperlink [^>]*>/gm,dimregex$1=/"(\w*:\w*)"/,colregex$1=/<(?:\w:)?col\b[^>]*[\/]?>/g,afregex$1=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,marginregex$1=/<(?:\w:)?pageMargins[^>]*\/>/g,sheetprregex$1=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,sheetprregex2=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,svsregex=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function parse_ws_xml$1(e,t,r,n,i,a,o){if(!e)return e;n||(n={"!id":{}});var s=t.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},c="",u="",d=e.match(sheetdataregex);d?(c=e.slice(0,d.index),u=e.slice(d.index+d[0].length)):c=u=e;var h=c.match(sheetprregex$1);h?parse_ws_xml_sheetpr$1(h[0],s,i,r):(h=c.match(sheetprregex2))&&parse_ws_xml_sheetpr2$1(h[0],h[1]||"",s,i,r);var p=(c.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(p>0){var f=c.slice(p,p+50).match(dimregex$1);f&&parse_ws_xml_dim$1(s,f[1])}var m=c.match(svsregex);m&&m[1]&&parse_ws_xml_sheetviews$1(m[1],i);var g=[];if(t.cellStyles){var _=c.match(colregex$1);_&&parse_ws_xml_cols$1(g,_)}d&&parse_ws_xml_data$1(d[1],s,t,l,a,o);var y=u.match(afregex$1);y&&(s["!autofilter"]=parse_ws_xml_autofilter$1(y[0]));var b=[],v=u.match(mergecregex$1);if(v)for(p=0;p!=v.length;++p)b[p]=safe_decode_range$1(v[p].slice(v[p].indexOf('"')+1));var S=u.match(hlinkregex$1);S&&parse_ws_xml_hlinks$1(s,S,n);var w=u.match(marginregex$1);if(w&&(s["!margins"]=parse_ws_xml_margins$1(parsexmltag$1(w[0]))),!s["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(s["!ref"]=encode_range$1(l)),t.sheetRows>0&&s["!ref"]){var T=safe_decode_range$1(s["!ref"]);t.sheetRows<=+T.e.r&&(T.e.r=t.sheetRows-1,T.e.r>l.e.r&&(T.e.r=l.e.r),T.e.r<T.s.r&&(T.s.r=T.e.r),T.e.c>l.e.c&&(T.e.c=l.e.c),T.e.c<T.s.c&&(T.s.c=T.e.c),s["!fullref"]=s["!ref"],s["!ref"]=encode_range$1(T))}return g.length>0&&(s["!cols"]=g),b.length>0&&(s["!merges"]=b),s}function parse_ws_xml_sheetpr$1(e,t,r,n){var i=parsexmltag$1(e);r.Sheets[n]||(r.Sheets[n]={}),i.codeName&&(r.Sheets[n].CodeName=unescapexml$1(utf8read$1(i.codeName)))}function parse_ws_xml_sheetpr2$1(e,t,r,n,i){parse_ws_xml_sheetpr$1(e.slice(0,e.indexOf(">")),r,n,i)}function parse_ws_xml_hlinks$1(e,t,r){for(var n=Array.isArray(e),i=0;i!=t.length;++i){var a=parsexmltag$1(utf8read$1(t[i]),!0);if(!a.ref)return;var o=((r||{})["!id"]||[])[a.id];o?(a.Target=o.Target,a.location&&(a.Target+="#"+unescapexml$1(a.location))):(a.Target="#"+unescapexml$1(a.location),o={Target:a.Target,TargetMode:"Internal"}),a.Rel=o,a.tooltip&&(a.Tooltip=a.tooltip,delete a.tooltip);for(var s=safe_decode_range$1(a.ref),l=s.s.r;l<=s.e.r;++l)for(var c=s.s.c;c<=s.e.c;++c){var u=encode_cell$1({c:c,r:l});n?(e[l]||(e[l]=[]),e[l][c]||(e[l][c]={t:"z",v:void 0}),e[l][c].l=a):(e[u]||(e[u]={t:"z",v:void 0}),e[u].l=a)}}}function parse_ws_xml_margins$1(e){var t={};return["left","right","top","bottom","header","footer"].forEach((function(r){e[r]&&(t[r]=parseFloat(e[r]))})),t}function parse_ws_xml_cols$1(e,t){for(var r=!1,n=0;n!=t.length;++n){var i=parsexmltag$1(t[n],!0);i.hidden&&(i.hidden=parsexmlbool$1(i.hidden));var a=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!r&&i.width&&(r=!0,find_mdw_colw$1(i.width)),process_col$1(i);a<=o;)e[a++]=dup$1(i)}}function parse_ws_xml_autofilter$1(e){return{ref:(e.match(/ref="([^"]*)"/)||[])[1]}}var sviewregex$1=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function parse_ws_xml_sheetviews$1(e,t){t.Views||(t.Views=[{}]),(e.match(sviewregex$1)||[]).forEach((function(e,r){var n=parsexmltag$1(e);t.Views[r]||(t.Views[r]={}),+n.zoomScale&&(t.Views[r].zoom=+n.zoomScale),parsexmlbool$1(n.rightToLeft)&&(t.Views[r].RTL=!0)}))}var parse_ws_xml_data$1=function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,n=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,a=matchtag("v"),o=matchtag("f");return function(s,l,c,u,d,h){for(var p,f,m,g,_,y=0,b="",v=[],S=[],w=0,T=0,E=0,x="",A=0,C=0,R=0,D=0,P=Array.isArray(h.CellXf),I=[],k=[],M=Array.isArray(l),$=[],O={},N=!1,F=!!c.sheetStubs,L=s.split(t),B=0,V=L.length;B!=V;++B){var U=(b=L[B].trim()).length;if(0!==U){var z=0;e:for(y=0;y<U;++y)switch(b[y]){case">":if("/"!=b[y-1]){++y;break e}if(c&&c.cellStyles){if(A=null!=(f=parsexmltag$1(b.slice(z,y),!0)).r?parseInt(f.r,10):A+1,C=-1,c.sheetRows&&c.sheetRows<A)continue;O={},N=!1,f.ht&&(N=!0,O.hpt=parseFloat(f.ht),O.hpx=pt2px$1(O.hpt)),"1"==f.hidden&&(N=!0,O.hidden=!0),null!=f.outlineLevel&&(N=!0,O.level=+f.outlineLevel),N&&($[A-1]=O)}break;case"<":z=y}if(z>=y)break;if(A=null!=(f=parsexmltag$1(b.slice(z,y),!0)).r?parseInt(f.r,10):A+1,C=-1,!(c.sheetRows&&c.sheetRows<A)){u.s.r>A-1&&(u.s.r=A-1),u.e.r<A-1&&(u.e.r=A-1),c&&c.cellStyles&&(O={},N=!1,f.ht&&(N=!0,O.hpt=parseFloat(f.ht),O.hpx=pt2px$1(O.hpt)),"1"==f.hidden&&(N=!0,O.hidden=!0),null!=f.outlineLevel&&(N=!0,O.level=+f.outlineLevel),N&&($[A-1]=O)),v=b.slice(y).split(e);for(var H=0;H!=v.length&&"<"==v[H].trim().charAt(0);++H);for(v=v.slice(H),y=0;y!=v.length;++y)if(0!==(b=v[y].trim()).length){if(S=b.match(r),w=y,T=0,E=0,b="<c "+("<"==b.slice(0,1)?">":"")+b,null!=S&&2===S.length){for(w=0,x=S[1],T=0;T!=x.length&&!((E=x.charCodeAt(T)-64)<1||E>26);++T)w=26*w+E;C=--w}else++C;for(T=0;T!=b.length&&62!==b.charCodeAt(T);++T);if(++T,(f=parsexmltag$1(b.slice(0,T),!0)).r||(f.r=encode_cell$1({r:A-1,c:C})),p={t:""},null!=(S=(x=b.slice(T)).match(a))&&""!==S[1]&&(p.v=unescapexml$1(S[1])),c.cellFormula){if(null!=(S=x.match(o))&&""!==S[1]){if(p.f=unescapexml$1(utf8read$1(S[1])).replace(/\r\n/g,"\n"),c.xlfn||(p.f=_xlfn$1(p.f)),S[0].indexOf('t="array"')>-1)p.F=(x.match(i)||[])[1],p.F.indexOf(":")>-1&&I.push([safe_decode_range$1(p.F),p.F]);else if(S[0].indexOf('t="shared"')>-1){g=parsexmltag$1(S[0]);var j=unescapexml$1(utf8read$1(S[1]));c.xlfn||(j=_xlfn$1(j)),k[parseInt(g.si,10)]=[g,j,f.r]}}else(S=x.match(/<f[^>]*\/>/))&&k[(g=parsexmltag$1(S[0])).si]&&(p.f=shift_formula_xlsx$1(k[g.si][1],k[g.si][2],f.r));var G=decode_cell$1(f.r);for(T=0;T<I.length;++T)G.r>=I[T][0].s.r&&G.r<=I[T][0].e.r&&G.c>=I[T][0].s.c&&G.c<=I[T][0].e.c&&(p.F=I[T][1])}if(null==f.t&&void 0===p.v)if(p.f||p.F)p.v=0,p.t="n";else{if(!F)continue;p.t="z"}else p.t=f.t||"n";switch(u.s.c>C&&(u.s.c=C),u.e.c<C&&(u.e.c=C),p.t){case"n":if(""==p.v||null==p.v){if(!F)continue;p.t="z"}else p.v=parseFloat(p.v);break;case"s":if(void 0===p.v){if(!F)continue;p.t="z"}else m=strs$1[parseInt(p.v,10)],p.v=m.t,p.r=m.r,c.cellHTML&&(p.h=m.h);break;case"str":p.t="s",p.v=null!=p.v?utf8read$1(p.v):"",c.cellHTML&&(p.h=escapehtml$1(p.v));break;case"inlineStr":S=x.match(n),p.t="s",null!=S&&(m=parse_si$1(S[1]))?(p.v=m.t,c.cellHTML&&(p.h=m.h)):p.v="";break;case"b":p.v=parsexmlbool$1(p.v);break;case"d":c.cellDates?p.v=parseDate$1(p.v,1):(p.v=datenum$1(parseDate$1(p.v,1)),p.t="n");break;case"e":c&&!1===c.cellText||(p.w=p.v),p.v=RBErr$1[p.v]}if(R=D=0,_=null,P&&void 0!==f.s&&null!=(_=h.CellXf[f.s])&&(null!=_.numFmtId&&(R=_.numFmtId),c.cellStyles&&null!=_.fillId&&(D=_.fillId)),safe_format$1(p,R,D,c,d,h),c.cellDates&&P&&"n"==p.t&&fmt_is_date$1(table_fmt$1[R])&&(p.t="d",p.v=numdate$1(p.v)),f.cm&&c.xlmeta){var W=(c.xlmeta.Cell||[])[+f.cm-1];W&&"XLDAPR"==W.type&&(p.D=!0)}if(M){var q=decode_cell$1(f.r);l[q.r]||(l[q.r]=[]),l[q.r][q.c]=p}else l[f.r]=p}}}}$.length>0&&(l["!rows"]=$)}}();function parse_BrtRowHdr$1(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var i=e.read_shift(2);e.l+=1;var a=e.read_shift(1);return e.l=n,7&a&&(r.level=7&a),16&a&&(r.hidden=!0),32&a&&(r.hpt=i/20),r}var parse_BrtWsDim$1=parse_UncheckedRfX$1;function parse_BrtWsFmtInfo$1(){}function parse_BrtWsProp$1(e,t){var r={},n=e[e.l];return++e.l,r.above=!(64&n),r.left=!(128&n),e.l+=18,r.name=parse_XLSBCodeName$1(e),r}function parse_BrtCellBlank$1(e){return[parse_XLSBCell$1(e)]}function parse_BrtShortBlank$1(e){return[parse_XLSBShortCell$1(e)]}function parse_BrtCellBool$1(e){return[parse_XLSBCell$1(e),e.read_shift(1),"b"]}function parse_BrtShortBool$1(e){return[parse_XLSBShortCell$1(e),e.read_shift(1),"b"]}function parse_BrtCellError$1(e){return[parse_XLSBCell$1(e),e.read_shift(1),"e"]}function parse_BrtShortError$1(e){return[parse_XLSBShortCell$1(e),e.read_shift(1),"e"]}function parse_BrtCellIsst$1(e){return[parse_XLSBCell$1(e),e.read_shift(4),"s"]}function parse_BrtShortIsst$1(e){return[parse_XLSBShortCell$1(e),e.read_shift(4),"s"]}function parse_BrtCellReal$1(e){return[parse_XLSBCell$1(e),parse_Xnum$1(e),"n"]}function parse_BrtShortReal$1(e){return[parse_XLSBShortCell$1(e),parse_Xnum$1(e),"n"]}function parse_BrtCellRk$1(e){return[parse_XLSBCell$1(e),parse_RkNumber$1(e),"n"]}function parse_BrtShortRk$1(e){return[parse_XLSBShortCell$1(e),parse_RkNumber$1(e),"n"]}function parse_BrtCellRString$1(e){return[parse_XLSBCell$1(e),parse_RichStr$1(e),"is"]}function parse_BrtCellSt$1(e){return[parse_XLSBCell$1(e),parse_XLWideString$1(e),"str"]}function parse_BrtShortSt$1(e){return[parse_XLSBShortCell$1(e),parse_XLWideString$1(e),"str"]}function parse_BrtFmlaBool$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,e.read_shift(1),"b"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}function parse_BrtFmlaError$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,e.read_shift(1),"e"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}function parse_BrtFmlaNum$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,parse_Xnum$1(e),"n"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}function parse_BrtFmlaString$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,parse_XLWideString$1(e),"str"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}var parse_BrtMergeCell$1=parse_UncheckedRfX$1;function parse_BrtHLink$1(e,t){var r=e.l+t,n=parse_UncheckedRfX$1(e),i=parse_XLNullableWideString$1(e),a=parse_XLWideString$1(e),o=parse_XLWideString$1(e),s=parse_XLWideString$1(e);e.l=r;var l={rfx:n,relId:i,loc:a,display:s};return o&&(l.Tooltip=o),l}function parse_BrtPane$1(){}function parse_BrtArrFmla$1(e,t,r){var n=e.l+t,i=parse_RfX$1(e),a=e.read_shift(1),o=[i];if(o[2]=a,r.cellFormula){var s=parse_XLSBArrayParsedFormula$1(e,n-e.l,r);o[1]=s}else e.l=n;return o}function parse_BrtShrFmla$1(e,t,r){var n=e.l+t,i=[parse_UncheckedRfX$1(e)];if(r.cellFormula){var a=parse_XLSBSharedParsedFormula$1(e,n-e.l,r);i[1]=a,e.l=n}else e.l=n;return i}var BrtMarginKeys$1=["left","right","top","bottom","header","footer"];function parse_BrtMargins$1(e){var t={};return BrtMarginKeys$1.forEach((function(r){t[r]=parse_Xnum$1(e)})),t}function parse_BrtBeginWsView$1(e){var t=e.read_shift(2);return e.l+=28,{RTL:32&t}}function parse_BrtDVal$1(){}function parse_BrtDVal14$1(){}function parse_ws_bin$1(e,t,r,n,i,a,o){if(!e)return e;var s=t||{};n||(n={"!id":{}});var l,c,u,d,h,p,f,m,g,_,y=s.dense?[]:{},b={s:{r:2e6,c:2e6},e:{r:0,c:0}},v=!1,S=!1,w=[];s.biff=12,s["!row"]=0;var T=0,E=!1,x=[],A={},C=s.supbooks||i.supbooks||[[]];if(C.sharedf=A,C.arrayf=x,C.SheetNames=i.SheetNames||i.Sheets.map((function(e){return e.name})),!s.supbooks&&(s.supbooks=C,i.Names))for(var R=0;R<i.Names.length;++R)C[0][R+1]=i.Names[R];var D,P=[],I=[],k=!1;if(XLSBRecordEnum$1[16]={n:"BrtShortReal",f:parse_BrtShortReal$1},recordhopper$1(e,(function(e,t,R){if(!S)switch(R){case 148:l=e;break;case 0:c=e,s.sheetRows&&s.sheetRows<=c.r&&(S=!0),g=encode_row$1(h=c.r),s["!row"]=c.r,(e.hidden||e.hpt||null!=e.level)&&(e.hpt&&(e.hpx=pt2px$1(e.hpt)),I[e.r]=e);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(u={t:e[2]},e[2]){case"n":u.v=e[1];break;case"s":m=strs$1[e[1]],u.v=m.t,u.r=m.r;break;case"b":u.v=!!e[1];break;case"e":u.v=e[1],!1!==s.cellText&&(u.w=BErr$1[u.v]);break;case"str":u.t="s",u.v=e[1];break;case"is":u.t="s",u.v=e[1].t}if((d=o.CellXf[e[0].iStyleRef])&&safe_format$1(u,d.numFmtId,null,s,a,o),p=-1==e[0].c?p+1:e[0].c,s.dense?(y[h]||(y[h]=[]),y[h][p]=u):y[encode_col$1(p)+g]=u,s.cellFormula){for(E=!1,T=0;T<x.length;++T){var M=x[T];c.r>=M[0].s.r&&c.r<=M[0].e.r&&p>=M[0].s.c&&p<=M[0].e.c&&(u.F=encode_range$1(M[0]),E=!0)}!E&&e.length>3&&(u.f=e[3])}if(b.s.r>c.r&&(b.s.r=c.r),b.s.c>p&&(b.s.c=p),b.e.r<c.r&&(b.e.r=c.r),b.e.c<p&&(b.e.c=p),s.cellDates&&d&&"n"==u.t&&fmt_is_date$1(table_fmt$1[d.numFmtId])){var $=SSF_parse_date_code$1(u.v);$&&(u.t="d",u.v=new Date($.y,$.m-1,$.d,$.H,$.M,$.S,$.u))}D&&("XLDAPR"==D.type&&(u.D=!0),D=void 0);break;case 1:case 12:if(!s.sheetStubs||v)break;u={t:"z",v:void 0},p=-1==e[0].c?p+1:e[0].c,s.dense?(y[h]||(y[h]=[]),y[h][p]=u):y[encode_col$1(p)+g]=u,b.s.r>c.r&&(b.s.r=c.r),b.s.c>p&&(b.s.c=p),b.e.r<c.r&&(b.e.r=c.r),b.e.c<p&&(b.e.c=p),D&&("XLDAPR"==D.type&&(u.D=!0),D=void 0);break;case 176:w.push(e);break;case 49:D=((s.xlmeta||{}).Cell||[])[e-1];break;case 494:var O=n["!id"][e.relId];for(O?(e.Target=O.Target,e.loc&&(e.Target+="#"+e.loc),e.Rel=O):""==e.relId&&(e.Target="#"+e.loc),h=e.rfx.s.r;h<=e.rfx.e.r;++h)for(p=e.rfx.s.c;p<=e.rfx.e.c;++p)s.dense?(y[h]||(y[h]=[]),y[h][p]||(y[h][p]={t:"z",v:void 0}),y[h][p].l=e):(f=encode_cell$1({c:p,r:h}),y[f]||(y[f]={t:"z",v:void 0}),y[f].l=e);break;case 426:if(!s.cellFormula)break;x.push(e),(_=s.dense?y[h][p]:y[encode_col$1(p)+g]).f=stringify_formula$1(e[1],b,{r:c.r,c:p},C,s),_.F=encode_range$1(e[0]);break;case 427:if(!s.cellFormula)break;A[encode_cell$1(e[0].s)]=e[1],(_=s.dense?y[h][p]:y[encode_col$1(p)+g]).f=stringify_formula$1(e[1],b,{r:c.r,c:p},C,s);break;case 60:if(!s.cellStyles)break;for(;e.e>=e.s;)P[e.e--]={width:e.w/256,hidden:!!(1&e.flags),level:e.level},k||(k=!0,find_mdw_colw$1(e.w/256)),process_col$1(P[e.e+1]);break;case 161:y["!autofilter"]={ref:encode_range$1(e)};break;case 476:y["!margins"]=e;break;case 147:i.Sheets[r]||(i.Sheets[r]={}),e.name&&(i.Sheets[r].CodeName=e.name),(e.above||e.left)&&(y["!outline"]={above:e.above,left:e.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),e.RTL&&(i.Views[0].RTL=!0);break;case 485:case 64:case 1053:case 151:case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:case 37:v=!0;break;case 36:case 38:v=!1;break;default:if(t.T);else if(!v||s.WTF)throw new Error("Unexpected record 0x"+R.toString(16))}}),s),delete s.supbooks,delete s["!row"],!y["!ref"]&&(b.s.r<2e6||l&&(l.e.r>0||l.e.c>0||l.s.r>0||l.s.c>0))&&(y["!ref"]=encode_range$1(l||b)),s.sheetRows&&y["!ref"]){var M=safe_decode_range$1(y["!ref"]);s.sheetRows<=+M.e.r&&(M.e.r=s.sheetRows-1,M.e.r>b.e.r&&(M.e.r=b.e.r),M.e.r<M.s.r&&(M.s.r=M.e.r),M.e.c>b.e.c&&(M.e.c=b.e.c),M.e.c<M.s.c&&(M.s.c=M.e.c),y["!fullref"]=y["!ref"],y["!ref"]=encode_range$1(M))}return w.length>0&&(y["!merges"]=w),P.length>0&&(y["!cols"]=P),I.length>0&&(y["!rows"]=I),y}function parse_Cache$1(e){var t,r=[],n=e.match(/^<c:numCache>/);(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm)||[]).forEach((function(e){var t=e.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);t&&(r[+t[1]]=n?+t[2]:t[2])}));var i=unescapexml$1((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(e.match(/<c:f>(.*?)<\/c:f>/gm)||[]).forEach((function(e){t=e.replace(/<.*?>/g,"")})),[r,i,t]}function parse_chart$1(e,t,r,n,i,a){var o=a||{"!type":"chart"};if(!e)return a;var s=0,l=0,c="A",u={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach((function(e){var t=parse_Cache$1(e);u.s.r=u.s.c=0,u.e.c=s,c=encode_col$1(s),t[0].forEach((function(e,r){o[c+encode_row$1(r)]={t:"n",v:e,z:t[1]},l=r})),u.e.r<l&&(u.e.r=l),++s})),s>0&&(o["!ref"]=encode_range$1(u)),o}function parse_cs_xml$1(e,t,r,n,i){if(!e)return e;n||(n={"!id":{}});var a,o={"!type":"chart","!drawel":null,"!rel":""},s=e.match(sheetprregex$1);return s&&parse_ws_xml_sheetpr$1(s[0],o,i,r),(a=e.match(/drawing r:id="(.*?)"/))&&(o["!rel"]=a[1]),n["!id"][o["!rel"]]&&(o["!drawel"]=n["!id"][o["!rel"]]),o}function parse_BrtCsProp$1(e,t){return e.l+=10,{name:parse_XLWideString$1(e)}}function parse_cs_bin$1(e,t,r,n,i){if(!e)return e;n||(n={"!id":{}});var a={"!type":"chart","!drawel":null,"!rel":""},o=!1;return recordhopper$1(e,(function(e,n,s){switch(s){case 550:a["!rel"]=e;break;case 651:i.Sheets[r]||(i.Sheets[r]={}),e.name&&(i.Sheets[r].CodeName=e.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:case 37:case 38:break;case 35:o=!0;break;case 36:o=!1;break;default:if(n.T>0);else if(n.T<0);else if(!o||t.WTF)throw new Error("Unexpected record 0x"+s.toString(16))}}),t),n["!id"][a["!rel"]]&&(a["!drawel"]=n["!id"][a["!rel"]]),a}var WBPropsDef$1=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],WBViewDef$1=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],SheetDef$1=[],CalcPrDef$1=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function push_defaults_array$1(e,t){for(var r=0;r!=e.length;++r)for(var n=e[r],i=0;i!=t.length;++i){var a=t[i];if(null==n[a[0]])n[a[0]]=a[1];else switch(a[2]){case"bool":"string"==typeof n[a[0]]&&(n[a[0]]=parsexmlbool$1(n[a[0]]));break;case"int":"string"==typeof n[a[0]]&&(n[a[0]]=parseInt(n[a[0]],10))}}}function push_defaults$1(e,t){for(var r=0;r!=t.length;++r){var n=t[r];if(null==e[n[0]])e[n[0]]=n[1];else switch(n[2]){case"bool":"string"==typeof e[n[0]]&&(e[n[0]]=parsexmlbool$1(e[n[0]]));break;case"int":"string"==typeof e[n[0]]&&(e[n[0]]=parseInt(e[n[0]],10))}}}function parse_wb_defaults$1(e){push_defaults$1(e.WBProps,WBPropsDef$1),push_defaults$1(e.CalcPr,CalcPrDef$1),push_defaults_array$1(e.WBView,WBViewDef$1),push_defaults_array$1(e.Sheets,SheetDef$1),_ssfopts$1.date1904=parsexmlbool$1(e.WBProps.date1904)}var badchars$1="][*?/\\".split("");function check_ws_name$1(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");return badchars$1.forEach((function(t){if(-1!=e.indexOf(t))throw new Error("Sheet name cannot contain : \\ / ? * [ ]")})),!0}var wbnsregex$1=/<\w+:workbook/;function parse_wb_xml$1(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,i="xmlns",a={},o=0;if(e.replace(tagregex$1,(function(s,l){var c=parsexmltag$1(s);switch(strip_ns$1(c[0])){case"<?xml":case"</workbook>":case"<fileVersion/>":case"</fileVersion>":case"<fileSharing":case"<fileSharing/>":case"</workbookPr>":case"<workbookProtection":case"<workbookProtection/>":case"<bookViews":case"<bookViews>":case"</bookViews>":case"</workbookView>":case"<sheets":case"<sheets>":case"</sheets>":case"</sheet>":case"<functionGroups":case"<functionGroups/>":case"<functionGroup":case"<externalReferences":case"</externalReferences>":case"<externalReferences>":case"<externalReference":case"<definedNames/>":case"<definedName/>":case"</calcPr>":case"<oleSize":case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":case"<customWorkbookView":case"</customWorkbookView>":case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":case"<pivotCache":case"<smartTagPr":case"<smartTagPr/>":case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":case"<smartTagType":case"<webPublishing":case"<webPublishing/>":case"<fileRecoveryPr":case"<fileRecoveryPr/>":case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":case"<webPublishObject":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":case"<ArchID":case"<revisionPtr":break;case"<workbook":s.match(wbnsregex$1)&&(i="xmlns"+s.match(/<(\w+):/)[1]),r.xmlns=c[i];break;case"<fileVersion":delete c[0],r.AppVersion=c;break;case"<workbookPr":case"<workbookPr/>":WBPropsDef$1.forEach((function(e){if(null!=c[e[0]])switch(e[2]){case"bool":r.WBProps[e[0]]=parsexmlbool$1(c[e[0]]);break;case"int":r.WBProps[e[0]]=parseInt(c[e[0]],10);break;default:r.WBProps[e[0]]=c[e[0]]}})),c.codeName&&(r.WBProps.CodeName=utf8read$1(c.codeName));break;case"<workbookView":case"<workbookView/>":delete c[0],r.WBView.push(c);break;case"<sheet":switch(c.state){case"hidden":c.Hidden=1;break;case"veryHidden":c.Hidden=2;break;default:c.Hidden=0}delete c.state,c.name=unescapexml$1(utf8read$1(c.name)),delete c[0],r.Sheets.push(c);break;case"<definedNames>":case"<definedNames":case"<ext":case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</definedNames>":case"</ext>":case"</AlternateContent>":n=!1;break;case"<definedName":(a={}).Name=utf8read$1(c.name),c.comment&&(a.Comment=c.comment),c.localSheetId&&(a.Sheet=+c.localSheetId),parsexmlbool$1(c.hidden||"0")&&(a.Hidden=!0),o=l+s.length;break;case"</definedName>":a.Ref=unescapexml$1(utf8read$1(e.slice(o,l))),r.Names.push(a);break;case"<calcPr":case"<calcPr/>":delete c[0],r.CalcPr=c;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+c[0]+" in workbook")}return s})),-1===XMLNS_main$1.indexOf(r.xmlns))throw new Error("Unknown Namespace: "+r.xmlns);return parse_wb_defaults$1(r),r}function parse_BrtBundleSh$1(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=parse_RelID$1(e),r.name=parse_XLWideString$1(e),r}function parse_BrtWbProp$1(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var i=t>8?parse_XLWideString$1(e):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(65536&n),r.backupFile=!!(64&n),r.checkCompatibility=!!(4096&n),r.date1904=!!(1&n),r.filterPrivacy=!!(8&n),r.hidePivotFieldList=!!(1024&n),r.promptedSolutions=!!(16&n),r.publishItems=!!(2048&n),r.refreshAllConnections=!!(262144&n),r.saveExternalLinkValues=!!(128&n),r.showBorderUnselectedTables=!!(4&n),r.showInkAnnotation=!!(32&n),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(32768&n),r.updateLinks=["userSet","never","always"][n>>8&3],r}function parse_BrtFRTArchID$$1(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function parse_BrtName$1(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var i=e.read_shift(4),a=parse_XLNameWideString$1(e),o=parse_XLSBNameParsedFormula$1(e,0,r),s=parse_XLNullableWideString$1(e);e.l=n;var l={Name:a,Ptg:o};return i<0xfffffff&&(l.Sheet=i),s&&(l.Comment=s),l}function parse_wb_bin$1(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],i=!1;t||(t={}),t.biff=12;var a=[],o=[[]];return o.SheetNames=[],o.XTI=[],XLSBRecordEnum$1[16]={n:"BrtFRTArchID$",f:parse_BrtFRTArchID$$1},recordhopper$1(e,(function(e,s,l){switch(l){case 156:o.SheetNames.push(e.name),r.Sheets.push(e);break;case 153:r.WBProps=e;break;case 39:null!=e.Sheet&&(t.SID=e.Sheet),e.Ref=stringify_formula$1(e.Ptg,null,null,o,t),delete t.SID,delete e.Ptg,a.push(e);break;case 1036:case 361:case 2071:case 158:case 143:case 664:case 353:case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:case 16:break;case 357:case 358:case 355:case 667:o[0].length?o.push([l,e]):o[0]=[l,e],o[o.length-1].XTI=[];break;case 362:0===o.length&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(e),o.XTI=o.XTI.concat(e);break;case 35:case 37:n.push(l),i=!0;break;case 36:case 38:n.pop(),i=!1;break;default:if(s.T);else if(!i||t.WTF&&37!=n[n.length-1]&&35!=n[n.length-1])throw new Error("Unexpected record 0x"+l.toString(16))}}),t),parse_wb_defaults$1(r),r.Names=a,r.supbooks=o,r}function parse_wb$1(e,t,r){return".bin"===t.slice(-4)?parse_wb_bin$1(e,r):parse_wb_xml$1(e,r)}function parse_ws$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_ws_bin$1(e,n,r,i,a,o,s):parse_ws_xml$1(e,n,r,i,a,o,s)}function parse_cs$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_cs_bin$1(e,n,r,i,a):parse_cs_xml$1(e,n,r,i,a)}function parse_ms$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_ms_bin$1():parse_ms_xml$1()}function parse_ds$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_ds_bin$1():parse_ds_xml$1()}function parse_sty$1(e,t,r,n){return".bin"===t.slice(-4)?parse_sty_bin$1(e,r,n):parse_sty_xml$1(e,r,n)}function parse_theme(e,t,r){return parse_theme_xml$1(e,r)}function parse_sst$1(e,t,r){return".bin"===t.slice(-4)?parse_sst_bin$1(e,r):parse_sst_xml$1(e,r)}function parse_cmnt$1(e,t,r){return".bin"===t.slice(-4)?parse_comments_bin$1(e,r):parse_comments_xml$1(e,r)}function parse_cc$1(e,t,r){return".bin"===t.slice(-4)?parse_cc_bin$1(e):parse_cc_xml$1(e)}function parse_xlink$1(e,t,r,n){return".bin"===r.slice(-4)?parse_xlink_bin$1(e,t,r,n):parse_xlink_xml$1()}function parse_xlmeta$1(e,t,r){return".bin"===t.slice(-4)?parse_xlmeta_bin$1(e,t,r):parse_xlmeta_xml$1(e,t,r)}var attregexg2$1=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,attregex2$1=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/,XLMLFormatMap$1;function xlml_parsexmltag$1(e,t){var r=e.split(/\s+/),n=[];if(n[0]=r[0],1===r.length)return n;var i,a,o,s=e.match(attregexg2$1);if(s)for(o=0;o!=s.length;++o)-1===(a=(i=s[o].match(attregex2$1))[1].indexOf(":"))?n[i[1]]=i[2].slice(1,i[2].length-1):n["xmlns:"===i[1].slice(0,6)?"xmlns"+i[1].slice(6):i[1].slice(a+1)]=i[2].slice(1,i[2].length-1);return n}function xlml_parsexmltagobj$1(e){var t={};if(1===e.split(/\s+/).length)return t;var r,n,i,a=e.match(attregexg2$1);if(a)for(i=0;i!=a.length;++i)-1===(n=(r=a[i].match(attregex2$1))[1].indexOf(":"))?t[r[1]]=r[2].slice(1,r[2].length-1):t["xmlns:"===r[1].slice(0,6)?"xmlns"+r[1].slice(6):r[1].slice(n+1)]=r[2].slice(1,r[2].length-1);return t}function xlml_format$1(e,t){var r=XLMLFormatMap$1[e]||unescapexml$1(e);return"General"===r?SSF_general$1(t):SSF_format$1(r,t)}function xlml_set_custprop$1(e,t,r,n){var i=n;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=parsexmlbool$1(n);break;case"i2":case"int":i=parseInt(n,10);break;case"r4":case"float":i=parseFloat(n);break;case"date":case"dateTime.tz":i=parseDate$1(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[unescapexml$1(t)]=i}function safe_format_xlml$1(e,t,r){if("z"!==e.t){if(!r||!1!==r.cellText)try{"e"===e.t?e.w=e.w||BErr$1[e.v]:"General"===t?"n"===e.t?(0|e.v)===e.v?e.w=e.v.toString(10):e.w=SSF_general_num$1(e.v):e.w=SSF_general$1(e.v):e.w=xlml_format$1(t||"General",e.v)}catch(a){if(r.WTF)throw a}try{var n=XLMLFormatMap$1[t]||t||"General";if(r.cellNF&&(e.z=n),r.cellDates&&"n"==e.t&&fmt_is_date$1(n)){var i=SSF_parse_date_code$1(e.v);i&&(e.t="d",e.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(a){if(r.WTF)throw a}}}function process_style_xlml$1(e,t,r){if(r.cellStyles&&t.Interior){var n=t.Interior;n.Pattern&&(n.patternType=XLMLPatternTypeMap$1[n.Pattern]||n.Pattern)}e[t.ID]=t}function parse_xlml_data$1(e,t,r,n,i,a,o,s,l,c){var u="General",d=n.StyleID,h={};c=c||{};var p=[],f=0;for(void 0===d&&s&&(d=s.StyleID),void 0===d&&o&&(d=o.StyleID);void 0!==a[d]&&(a[d].nf&&(u=a[d].nf),a[d].Interior&&p.push(a[d].Interior),a[d].Parent);)d=a[d].Parent;switch(r.Type){case"Boolean":n.t="b",n.v=parsexmlbool$1(e);break;case"String":n.t="s",n.r=xlml_fixstr$1(unescapexml$1(e)),n.v=e.indexOf("<")>-1?unescapexml$1(t||e).replace(/<.*?>/g,""):n.r;break;case"DateTime":"Z"!=e.slice(-1)&&(e+="Z"),n.v=(parseDate$1(e)-new Date(Date.UTC(1899,11,30)))/864e5,n.v!=n.v?n.v=unescapexml$1(e):n.v<60&&(n.v=n.v-1),u&&"General"!=u||(u="yyyy-mm-dd");case"Number":void 0===n.v&&(n.v=+e),n.t||(n.t="n");break;case"Error":n.t="e",n.v=RBErr$1[e],!1!==c.cellText&&(n.w=e);break;default:""==e&&""==t?n.t="z":(n.t="s",n.v=xlml_fixstr$1(t||e))}if(safe_format_xlml$1(n,u,c),!1!==c.cellFormula)if(n.Formula){var m=unescapexml$1(n.Formula);61==m.charCodeAt(0)&&(m=m.slice(1)),n.f=rc_to_a1$1(m,i),delete n.Formula,"RC"==n.ArrayRange?n.F=rc_to_a1$1("RC:RC",i):n.ArrayRange&&(n.F=rc_to_a1$1(n.ArrayRange,i),l.push([safe_decode_range$1(n.F),n.F]))}else for(f=0;f<l.length;++f)i.r>=l[f][0].s.r&&i.r<=l[f][0].e.r&&i.c>=l[f][0].s.c&&i.c<=l[f][0].e.c&&(n.F=l[f][1]);c.cellStyles&&(p.forEach((function(e){!h.patternType&&e.patternType&&(h.patternType=e.patternType)})),n.s=h),void 0!==n.StyleID&&(n.ixfe=n.StyleID)}function xlml_clean_comment$1(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e.v=e.w=e.ixfe=void 0}function parse_xlml_xml$1(e,t){var r=t||{};make_ssf$1();var n=debom$1(xlml_normalize$1(e));"binary"!=r.type&&"array"!=r.type&&"base64"!=r.type||(n=utf8read$1(n));var i,a=n.slice(0,1024).toLowerCase(),o=!1;if((1023&(a=a.replace(/".*?"/g,"")).indexOf(">"))>Math.min(1023&a.indexOf(","),1023&a.indexOf(";"))){var s=dup$1(r);return s.type="string",PRN$1.to_workbook(n,s)}if(-1==a.indexOf("<?xml")&&["html","table","head","meta","script","style","div"].forEach((function(e){a.indexOf("<"+e)>=0&&(o=!0)})),o)return html_to_workbook$1(n,r);XLMLFormatMap$1={"General Number":"General","General Date":table_fmt$1[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":table_fmt$1[15],"Short Date":table_fmt$1[14],"Long Time":table_fmt$1[19],"Medium Time":table_fmt$1[18],"Short Time":table_fmt$1[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:table_fmt$1[2],Standard:table_fmt$1[4],Percent:table_fmt$1[10],Scientific:table_fmt$1[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var l,c,u=[],d={},h=[],p=r.dense?[]:{},f="",m={},g={},_=xlml_parsexmltag$1('<Data ss:Type="String">'),y=0,b=0,v=0,S={s:{r:2e6,c:2e6},e:{r:0,c:0}},w={},T={},E="",x=0,A=[],C={},R={},D=0,P=[],I=[],k={},M=[],$=!1,O=[],N=[],F={},L=0,B=0,V={Sheets:[],WBProps:{date1904:!1}},U={};xlmlregex$1.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/gm,"");for(var z="";i=xlmlregex$1.exec(n);)switch(i[3]=(z=i[3]).toLowerCase()){case"data":if("data"==z){if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==i[0].charAt(i[0].length-2)&&u.push([i[3],!0]);break}if(u[u.length-1][1])break;"/"===i[1]?parse_xlml_data$1(n.slice(y,i.index),E,_,"comment"==u[u.length-1][0]?k:m,{c:b,r:v},w,M[b],g,O,r):(E="",_=xlml_parsexmltag$1(i[0]),y=i.index+i[0].length);break;case"cell":if("/"===i[1])if(I.length>0&&(m.c=I),(!r.sheetRows||r.sheetRows>v)&&void 0!==m.v&&(r.dense?(p[v]||(p[v]=[]),p[v][b]=m):p[encode_col$1(b)+encode_row$1(v)]=m),m.HRef&&(m.l={Target:unescapexml$1(m.HRef)},m.HRefScreenTip&&(m.l.Tooltip=m.HRefScreenTip),delete m.HRef,delete m.HRefScreenTip),(m.MergeAcross||m.MergeDown)&&(L=b+(0|parseInt(m.MergeAcross,10)),B=v+(0|parseInt(m.MergeDown,10)),A.push({s:{c:b,r:v},e:{c:L,r:B}})),r.sheetStubs)if(m.MergeAcross||m.MergeDown){for(var H=b;H<=L;++H)for(var j=v;j<=B;++j)(H>b||j>v)&&(r.dense?(p[j]||(p[j]=[]),p[j][H]={t:"z"}):p[encode_col$1(H)+encode_row$1(j)]={t:"z"});b=L+1}else++b;else m.MergeAcross?b=L+1:++b;else(m=xlml_parsexmltagobj$1(i[0])).Index&&(b=+m.Index-1),b<S.s.c&&(S.s.c=b),b>S.e.c&&(S.e.c=b),"/>"===i[0].slice(-2)&&++b,I=[];break;case"row":"/"===i[1]||"/>"===i[0].slice(-2)?(v<S.s.r&&(S.s.r=v),v>S.e.r&&(S.e.r=v),"/>"===i[0].slice(-2)&&(g=xlml_parsexmltag$1(i[0])).Index&&(v=+g.Index-1),b=0,++v):((g=xlml_parsexmltag$1(i[0])).Index&&(v=+g.Index-1),F={},("0"==g.AutoFitHeight||g.Height)&&(F.hpx=parseInt(g.Height,10),F.hpt=px2pt$1(F.hpx),N[v]=F),"1"==g.Hidden&&(F.hidden=!0,N[v]=F));break;case"worksheet":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"));h.push(f),S.s.r<=S.e.r&&S.s.c<=S.e.c&&(p["!ref"]=encode_range$1(S),r.sheetRows&&r.sheetRows<=S.e.r&&(p["!fullref"]=p["!ref"],S.e.r=r.sheetRows-1,p["!ref"]=encode_range$1(S))),A.length&&(p["!merges"]=A),M.length>0&&(p["!cols"]=M),N.length>0&&(p["!rows"]=N),d[f]=p}else S={s:{r:2e6,c:2e6},e:{r:0,c:0}},v=b=0,u.push([i[3],!1]),l=xlml_parsexmltag$1(i[0]),f=unescapexml$1(l.Name),p=r.dense?[]:{},A=[],O=[],N=[],U={name:f,Hidden:0},V.Sheets.push(U);break;case"table":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else{if("/>"==i[0].slice(-2))break;u.push([i[3],!1]),M=[],$=!1}break;case"style":"/"===i[1]?process_style_xlml$1(w,T,r):T=xlml_parsexmltag$1(i[0]);break;case"numberformat":T.nf=unescapexml$1(xlml_parsexmltag$1(i[0]).Format||"General"),XLMLFormatMap$1[T.nf]&&(T.nf=XLMLFormatMap$1[T.nf]);for(var G=0;392!=G&&table_fmt$1[G]!=T.nf;++G);if(392==G)for(G=57;392!=G;++G)if(null==table_fmt$1[G]){SSF_load$1(T.nf,G);break}break;case"column":if("table"!==u[u.length-1][0])break;if((c=xlml_parsexmltag$1(i[0])).Hidden&&(c.hidden=!0,delete c.Hidden),c.Width&&(c.wpx=parseInt(c.Width,10)),!$&&c.wpx>10){$=!0,MDW$1=DEF_MDW$1;for(var W=0;W<M.length;++W)M[W]&&process_col$1(M[W])}$&&process_col$1(c),M[c.Index-1||M.length]=c;for(var q=0;q<+c.Span;++q)M[M.length]=dup$1(c);break;case"namedrange":if("/"===i[1])break;V.Names||(V.Names=[]);var X=parsexmltag$1(i[0]),K={Name:X.Name,Ref:rc_to_a1$1(X.RefersTo.slice(1),{r:0,c:0})};V.Sheets.length>0&&(K.Sheet=V.Sheets.length-1),V.Names.push(K);break;case"namedcell":case"b":case"i":case"u":case"s":case"em":case"h2":case"h3":case"sub":case"sup":case"span":case"alignment":case"borders":case"border":case"protection":case"paragraphs":case"name":case"pixelsperinch":case"null":break;case"font":if("/>"===i[0].slice(-2))break;"/"===i[1]?E+=n.slice(x,i.index):x=i.index+i[0].length;break;case"interior":if(!r.cellStyles)break;T.Interior=xlml_parsexmltag$1(i[0]);break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if("/>"===i[0].slice(-2))break;"/"===i[1]?xlml_set_prop$1(C,z,n.slice(D,i.index)):D=i.index+i[0].length;break;case"styles":case"workbook":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else u.push([i[3],!1]);break;case"comment":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"));xlml_clean_comment$1(k),I.push(k)}else u.push([i[3],!1]),k={a:(l=xlml_parsexmltag$1(i[0])).Author};break;case"autofilter":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else if("/"!==i[0].charAt(i[0].length-2)){var Y=xlml_parsexmltag$1(i[0]);p["!autofilter"]={ref:rc_to_a1$1(Y.Range).replace(/\$/g,"")},u.push([i[3],!0])}break;case"datavalidation":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==i[0].charAt(i[0].length-2)&&u.push([i[3],!0]);break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==i[0].charAt(i[0].length-2)&&u.push([i[3],!0]);break;default:if(0==u.length&&"document"==i[3])return parse_fods$1(n,r);if(0==u.length&&"uof"==i[3])return parse_fods$1(n,r);var J=!0;switch(u[u.length-1][0]){case"officedocumentsettings":switch(i[3]){case"allowpng":case"removepersonalinformation":case"downloadcomponents":case"locationofcomponents":case"colors":case"color":case"index":case"rgb":case"targetscreensize":case"readonlyrecommended":break;default:J=!1}break;case"componentoptions":switch(i[3]){case"toolbar":case"hideofficelogo":case"spreadsheetautofit":case"label":case"caption":case"maxheight":case"maxwidth":case"nextsheetnumber":break;default:J=!1}break;case"excelworkbook":switch(i[3]){case"date1904":V.WBProps.date1904=!0;break;case"windowheight":case"windowwidth":case"windowtopx":case"windowtopy":case"tabratio":case"protectstructure":case"protectwindow":case"protectwindows":case"activesheet":case"displayinknotes":case"firstvisiblesheet":case"supbook":case"sheetname":case"sheetindex":case"sheetindexfirst":case"sheetindexlast":case"dll":case"acceptlabelsinformulas":case"donotsavelinkvalues":case"iteration":case"maxiterations":case"maxchange":case"path":case"xct":case"count":case"selectedsheets":case"calculation":case"uncalced":case"startupprompt":case"crn":case"externname":case"formula":case"colfirst":case"collast":case"wantadvise":case"boolean":case"error":case"text":case"ole":case"noautorecover":case"publishobjects":case"donotcalculatebeforesave":case"number":case"refmoder1c1":case"embedsavesmarttags":break;default:J=!1}break;case"workbookoptions":switch(i[3]){case"owcversion":case"height":case"width":break;default:J=!1}break;case"worksheetoptions":switch(i[3]){case"visible":if("/>"===i[0].slice(-2));else if("/"===i[1])switch(n.slice(D,i.index)){case"SheetHidden":U.Hidden=1;break;case"SheetVeryHidden":U.Hidden=2}else D=i.index+i[0].length;break;case"header":p["!margins"]||default_margins$1(p["!margins"]={},"xlml"),isNaN(+parsexmltag$1(i[0]).Margin)||(p["!margins"].header=+parsexmltag$1(i[0]).Margin);break;case"footer":p["!margins"]||default_margins$1(p["!margins"]={},"xlml"),isNaN(+parsexmltag$1(i[0]).Margin)||(p["!margins"].footer=+parsexmltag$1(i[0]).Margin);break;case"pagemargins":var Z=parsexmltag$1(i[0]);p["!margins"]||default_margins$1(p["!margins"]={},"xlml"),isNaN(+Z.Top)||(p["!margins"].top=+Z.Top),isNaN(+Z.Left)||(p["!margins"].left=+Z.Left),isNaN(+Z.Right)||(p["!margins"].right=+Z.Right),isNaN(+Z.Bottom)||(p["!margins"].bottom=+Z.Bottom);break;case"displayrighttoleft":V.Views||(V.Views=[]),V.Views[0]||(V.Views[0]={}),V.Views[0].RTL=!0;break;case"freezepanes":case"frozennosplit":case"splithorizontal":case"splitvertical":case"donotdisplaygridlines":case"activerow":case"activecol":case"toprowbottompane":case"leftcolumnrightpane":case"unsynced":case"print":case"printerrors":case"panes":case"scale":case"pane":case"number":case"layout":case"pagesetup":case"selected":case"protectobjects":case"enableselection":case"protectscenarios":case"validprinterinfo":case"horizontalresolution":case"verticalresolution":case"numberofcopies":case"activepane":case"toprowvisible":case"leftcolumnvisible":case"fittopage":case"rangeselection":case"papersizeindex":case"pagelayoutzoom":case"pagebreakzoom":case"filteron":case"fitwidth":case"fitheight":case"commentslayout":case"zoom":case"lefttoright":case"gridlines":case"allowsort":case"allowfilter":case"allowinsertrows":case"allowdeleterows":case"allowinsertcols":case"allowdeletecols":case"allowinserthyperlinks":case"allowformatcells":case"allowsizecols":case"allowsizerows":case"tabcolorindex":case"donotdisplayheadings":case"showpagelayoutzoom":case"blackandwhite":case"donotdisplayzeros":case"displaypagebreak":case"rowcolheadings":case"donotdisplayoutline":case"noorientation":case"allowusepivottables":case"zeroheight":case"viewablerange":case"selection":case"protectcontents":break;case"nosummaryrowsbelowdetail":p["!outline"]||(p["!outline"]={}),p["!outline"].above=!0;break;case"nosummarycolumnsrightdetail":p["!outline"]||(p["!outline"]={}),p["!outline"].left=!0;break;default:J=!1}break;case"pivottable":case"pivotcache":switch(i[3]){case"immediateitemsondrop":case"showpagemultipleitemlabel":case"compactrowindent":case"location":case"pivotfield":case"orientation":case"layoutform":case"layoutsubtotallocation":case"layoutcompactrow":case"position":case"pivotitem":case"datatype":case"datafield":case"sourcename":case"parentfield":case"ptlineitems":case"ptlineitem":case"countofsameitems":case"item":case"itemtype":case"ptsource":case"cacheindex":case"consolidationreference":case"filename":case"reference":case"nocolumngrand":case"norowgrand":case"blanklineafteritems":case"hidden":case"subtotal":case"basefield":case"mapchilditems":case"function":case"refreshonfileopen":case"printsettitles":case"mergelabels":case"defaultversion":case"refreshname":case"refreshdate":case"refreshdatecopy":case"versionlastrefresh":case"versionlastupdate":case"versionupdateablemin":case"versionrefreshablemin":case"calculation":break;default:J=!1}break;case"pagebreaks":switch(i[3]){case"colbreaks":case"colbreak":case"rowbreaks":case"rowbreak":case"colstart":case"colend":case"rowend":break;default:J=!1}break;case"autofilter":switch(i[3]){case"autofiltercolumn":case"autofiltercondition":case"autofilterand":case"autofilteror":break;default:J=!1}break;case"querytable":switch(i[3]){case"id":case"autoformatfont":case"autoformatpattern":case"querysource":case"querytype":case"enableredirections":case"refreshedinxl9":case"urlstring":case"htmltables":case"connection":case"commandtext":case"refreshinfo":case"notitles":case"nextid":case"columninfo":case"overwritecells":case"donotpromptforfile":case"textwizardsettings":case"source":case"number":case"decimal":case"thousandseparator":case"trailingminusnumbers":case"formatsettings":case"fieldtype":case"delimiters":case"tab":case"comma":case"autoformatname":case"versionlastedit":case"versionlastrefresh":break;default:J=!1}break;case"datavalidation":switch(i[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":case"cellrangelist":break;default:J=!1}break;case"sorting":case"conditionalformatting":switch(i[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"cellrangelist":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":break;default:J=!1}break;case"mapinfo":case"schema":case"data":switch(i[3]){case"map":case"entry":case"range":case"xpath":case"field":case"xsdtype":case"filteron":case"aggregate":case"elementtype":case"attributetype":case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":case"row":break;default:J=!1}break;case"smarttags":break;default:J=!1}if(J)break;if(i[3].match(/!\[CDATA/))break;if(!u[u.length-1][1])throw"Unrecognized tag: "+i[3]+"|"+u.join("|");if("customdocumentproperties"===u[u.length-1][0]){if("/>"===i[0].slice(-2))break;"/"===i[1]?xlml_set_custprop$1(R,z,P,n.slice(D,i.index)):(P=i,D=i.index+i[0].length);break}if(r.WTF)throw"Unrecognized tag: "+i[3]+"|"+u.join("|")}var Q={};return r.bookSheets||r.bookProps||(Q.Sheets=d),Q.SheetNames=h,Q.Workbook=V,Q.SSF=dup$1(table_fmt$1),Q.Props=C,Q.Custprops=R,Q}function parse_xlml$1(e,t){switch(fix_read_opts$1(t=t||{}),t.type||"base64"){case"base64":return parse_xlml_xml$1(Base64_decode$1(e),t);case"binary":case"buffer":case"file":return parse_xlml_xml$1(e,t);case"array":return parse_xlml_xml$1(a2s$1(e),t)}}function parse_compobj$1(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=parse_ClipboardFormatOrAnsiString$1(r),r.length-r.l<=4)return t;var n=r.read_shift(4);return 0==n||n>40?t:(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4||0x71b239f4!==(n=r.read_shift(4))?t:(t.UnicodeClipboardFormat=parse_ClipboardFormatOrUnicodeString$1(r),0==(n=r.read_shift(4))||n>40?t:(r.l-=4,void(t.Reserved2=r.read_shift(0,"lpwstr")))))}var CONTINUE_RT$1=[60,1084,2066,2165,2175];function slurp$1(e,t,r,n,i){var a=n,o=[],s=r.slice(r.l,r.l+a);if(i&&i.enc&&i.enc.insitu&&s.length>0)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:case 133:break;default:i.enc.insitu(s)}o.push(s),r.l+=a;for(var l=__readUInt16LE$1(r,r.l),c=XLSRecordEnum$1[l],u=0;null!=c&&CONTINUE_RT$1.indexOf(l)>-1;)a=__readUInt16LE$1(r,r.l+2),u=r.l+4,2066==l?u+=4:2165!=l&&2175!=l||(u+=12),s=r.slice(u,r.l+4+a),o.push(s),r.l+=4+a,c=XLSRecordEnum$1[l=__readUInt16LE$1(r,r.l)];var d=bconcat$1(o);prep_blob$1(d,0);var h=0;d.lens=[];for(var p=0;p<o.length;++p)d.lens.push(h),h+=o[p].length;if(d.length<n)throw"XLS Record 0x"+e.toString(16)+" Truncated: "+d.length+" < "+n;return t.f(d,d.length,i)}function safe_format_xf$1(e,t,r){if("z"!==e.t&&e.XF){var n=0;try{n=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=table_fmt$1[n])}catch(a){if(t.WTF)throw a}if(!t||!1!==t.cellText)try{"e"===e.t?e.w=e.w||BErr$1[e.v]:0===n||"General"==n?"n"===e.t?(0|e.v)===e.v?e.w=e.v.toString(10):e.w=SSF_general_num$1(e.v):e.w=SSF_general$1(e.v):e.w=SSF_format$1(n,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(a){if(t.WTF)throw a}if(t.cellDates&&n&&"n"==e.t&&fmt_is_date$1(table_fmt$1[n]||String(n))){var i=SSF_parse_date_code$1(e.v);i&&(e.t="d",e.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}}function make_cell$1(e,t,r){return{v:e,ixfe:t,t:r}}function parse_workbook$1(e,t){var r,n,i,a,o,s,l,c,u={opts:{}},d={},h=t.dense?[]:{},p={},f={},m=null,g=[],_="",y={},b="",v={},S=[],w=[],T=[],E={Sheets:[],WBProps:{date1904:!1},Views:[{}]},x={},A=function(e){return e<8?XLSIcv$1[e]:e<64&&T[e-8]||XLSIcv$1[e]},C=function(e,t,n){if(!(F>1||n.sheetRows&&e.r>=n.sheetRows)){if(n.cellStyles&&t.XF&&t.XF.data&&function(e,t,r){var n,i=t.XF.data;i&&i.patternType&&r&&r.cellStyles&&(t.s={},t.s.patternType=i.patternType,(n=rgb2Hex$1(A(i.icvFore)))&&(t.s.fgColor={rgb:n}),(n=rgb2Hex$1(A(i.icvBack)))&&(t.s.bgColor={rgb:n}))}(0,t,n),delete t.ixfe,delete t.XF,r=e,b=encode_cell$1(e),f&&f.s&&f.e||(f={s:{r:0,c:0},e:{r:0,c:0}}),e.r<f.s.r&&(f.s.r=e.r),e.c<f.s.c&&(f.s.c=e.c),e.r+1>f.e.r&&(f.e.r=e.r+1),e.c+1>f.e.c&&(f.e.c=e.c+1),n.cellFormula&&t.f)for(var i=0;i<S.length;++i)if(!(S[i][0].s.c>e.c||S[i][0].s.r>e.r||S[i][0].e.c<e.c||S[i][0].e.r<e.r)){t.F=encode_range$1(S[i][0]),S[i][0].s.c==e.c&&S[i][0].s.r==e.r||delete t.f,t.f&&(t.f=""+stringify_formula$1(S[i][1],f,e,$,R));break}n.dense?(h[e.r]||(h[e.r]=[]),h[e.r][e.c]=t):h[b]=t}},R={enc:!1,sbcch:0,snames:[],sharedf:v,arrayf:S,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf};t.password&&(R.password=t.password);var D=[],P=[],I=[],k=[],M=!1,$=[];$.SheetNames=R.snames,$.sharedf=R.sharedf,$.arrayf=R.arrayf,$.names=[],$.XTI=[];var O,N=0,F=0,L=0,B=[],V=[];R.codepage=1200,set_cp$1(1200);for(var U=!1;e.l<e.length-1;){var z=e.l,H=e.read_shift(2);if(0===H&&10===N)break;var j=e.l===e.length?0:e.read_shift(2),G=XLSRecordEnum$1[H];if(G&&G.f){if(t.bookSheets&&133===N&&133!==H)break;if(N=H,2===G.r||12==G.r){var W=e.read_shift(2);if(j-=2,!R.enc&&W!==H&&((255&W)<<8|W>>8)!==H)throw new Error("rt mismatch: "+W+"!="+H);12==G.r&&(e.l+=10,j-=10)}var q={};if(q=10===H?G.f(e,j,R):slurp$1(H,G,e,j,R),0==F&&-1===[9,521,1033,2057].indexOf(N))continue;switch(H){case 34:u.opts.Date1904=E.WBProps.date1904=q;break;case 134:u.opts.WriteProtect=!0;break;case 47:if(R.enc||(e.l=0),R.enc=q,!t.password)throw new Error("File is password-protected");if(null==q.valid)throw new Error("Encryption scheme unsupported");if(!q.valid)throw new Error("Password is incorrect");break;case 92:R.lastuser=q;break;case 66:var X=Number(q);switch(X){case 21010:X=1200;break;case 32768:X=1e4;break;case 32769:X=1252}set_cp$1(R.codepage=X),U=!0;break;case 317:R.rrtabid=q;break;case 25:R.winlocked=q;break;case 439:u.opts.RefreshAll=q;break;case 12:u.opts.CalcCount=q;break;case 16:u.opts.CalcDelta=q;break;case 17:u.opts.CalcIter=q;break;case 13:u.opts.CalcMode=q;break;case 14:u.opts.CalcPrecision=q;break;case 95:u.opts.CalcSaveRecalc=q;break;case 15:R.CalcRefMode=q;break;case 2211:u.opts.FullCalc=q;break;case 129:q.fDialog&&(h["!type"]="dialog"),q.fBelow||((h["!outline"]||(h["!outline"]={})).above=!0),q.fRight||((h["!outline"]||(h["!outline"]={})).left=!0);break;case 224:w.push(q);break;case 430:$.push([q]),$[$.length-1].XTI=[];break;case 35:case 547:$[$.length-1].push(q);break;case 24:case 536:O={Name:q.Name,Ref:stringify_formula$1(q.rgce,f,null,$,R)},q.itab>0&&(O.Sheet=q.itab-1),$.names.push(O),$[0]||($[0]=[],$[0].XTI=[]),$[$.length-1].push(q),"_xlnm._FilterDatabase"==q.Name&&q.itab>0&&q.rgce&&q.rgce[0]&&q.rgce[0][0]&&"PtgArea3d"==q.rgce[0][0][0]&&(V[q.itab-1]={ref:encode_range$1(q.rgce[0][0][1][2])});break;case 22:R.ExternCount=q;break;case 23:0==$.length&&($[0]=[],$[0].XTI=[]),$[$.length-1].XTI=$[$.length-1].XTI.concat(q),$.XTI=$.XTI.concat(q);break;case 2196:if(R.biff<8)break;null!=O&&(O.Comment=q[1]);break;case 18:h["!protect"]=q;break;case 19:0!==q&&R.WTF&&console.error("Password verifier: "+q);break;case 133:p[q.pos]=q,R.snames.push(q.name);break;case 10:if(--F)break;if(f.e){if(f.e.r>0&&f.e.c>0){if(f.e.r--,f.e.c--,h["!ref"]=encode_range$1(f),t.sheetRows&&t.sheetRows<=f.e.r){var K=f.e.r;f.e.r=t.sheetRows-1,h["!fullref"]=h["!ref"],h["!ref"]=encode_range$1(f),f.e.r=K}f.e.r++,f.e.c++}D.length>0&&(h["!merges"]=D),P.length>0&&(h["!objects"]=P),I.length>0&&(h["!cols"]=I),k.length>0&&(h["!rows"]=k),E.Sheets.push(x)}""===_?y=h:d[_]=h,h=t.dense?[]:{};break;case 9:case 521:case 1033:case 2057:if(8===R.biff&&(R.biff={9:2,521:3,1033:4}[H]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[q.BIFFVer]||8),R.biffguess=0==q.BIFFVer,0==q.BIFFVer&&4096==q.dt&&(R.biff=5,U=!0,set_cp$1(R.codepage=28591)),8==R.biff&&0==q.BIFFVer&&16==q.dt&&(R.biff=2),F++)break;if(h=t.dense?[]:{},R.biff<8&&!U&&(U=!0,set_cp$1(R.codepage=t.codepage||1252)),R.biff<5||0==q.BIFFVer&&4096==q.dt){""===_&&(_="Sheet1"),f={s:{r:0,c:0},e:{r:0,c:0}};var Y={pos:e.l-j,name:_};p[Y.pos]=Y,R.snames.push(_)}else _=(p[z]||{name:""}).name;32==q.dt&&(h["!type"]="chart"),64==q.dt&&(h["!type"]="macro"),D=[],P=[],R.arrayf=S=[],I=[],k=[],M=!1,x={Hidden:(p[z]||{hs:0}).hs,name:_};break;case 515:case 3:case 2:"chart"==h["!type"]&&(t.dense?(h[q.r]||[])[q.c]:h[encode_cell$1({c:q.c,r:q.r})])&&++q.c,s={ixfe:q.ixfe,XF:w[q.ixfe]||{},v:q.val,t:"n"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 5:case 517:s={ixfe:q.ixfe,XF:w[q.ixfe],v:q.val,t:q.t},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 638:s={ixfe:q.ixfe,XF:w[q.ixfe],v:q.rknum,t:"n"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 189:for(var J=q.c;J<=q.C;++J){var Z=q.rkrec[J-q.c][0];s={ixfe:Z,XF:w[Z],v:q.rkrec[J-q.c][1],t:"n"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:J,r:q.r},s,t)}break;case 6:case 518:case 1030:if("String"==q.val){m=q;break}if((s=make_cell$1(q.val,q.cell.ixfe,q.tt)).XF=w[s.ixfe],t.cellFormula){var Q=q.formula;if(Q&&Q[0]&&Q[0][0]&&"PtgExp"==Q[0][0][0]){var ee=Q[0][0][1][0],te=Q[0][0][1][1],re=encode_cell$1({r:ee,c:te});v[re]?s.f=""+stringify_formula$1(q.formula,f,q.cell,$,R):s.F=((t.dense?(h[ee]||[])[te]:h[re])||{}).F}else s.f=""+stringify_formula$1(q.formula,f,q.cell,$,R)}L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C(q.cell,s,t),m=q;break;case 7:case 519:if(!m)throw new Error("String record expects Formula");m.val=q,(s=make_cell$1(q,m.cell.ixfe,"s")).XF=w[s.ixfe],t.cellFormula&&(s.f=""+stringify_formula$1(m.formula,f,m.cell,$,R)),L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C(m.cell,s,t),m=null;break;case 33:case 545:S.push(q);var ne=encode_cell$1(q[0].s);if(n=t.dense?(h[q[0].s.r]||[])[q[0].s.c]:h[ne],t.cellFormula&&n){if(!m)break;if(!ne||!n)break;n.f=""+stringify_formula$1(q[1],f,q[0],$,R),n.F=encode_range$1(q[0])}break;case 1212:if(!t.cellFormula)break;if(b){if(!m)break;v[encode_cell$1(m.cell)]=q[0],((n=t.dense?(h[m.cell.r]||[])[m.cell.c]:h[encode_cell$1(m.cell)])||{}).f=""+stringify_formula$1(q[0],f,r,$,R)}break;case 253:s=make_cell$1(g[q.isst].t,q.ixfe,"s"),g[q.isst].h&&(s.h=g[q.isst].h),s.XF=w[s.ixfe],L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 513:t.sheetStubs&&(s={ixfe:q.ixfe,XF:w[q.ixfe],t:"z"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t));break;case 190:if(t.sheetStubs)for(var ie=q.c;ie<=q.C;++ie){var ae=q.ixfe[ie-q.c];s={ixfe:ae,XF:w[ae],t:"z"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:ie,r:q.r},s,t)}break;case 214:case 516:case 4:(s=make_cell$1(q.val,q.ixfe,"s")).XF=w[s.ixfe],L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 0:case 512:1===F&&(f=q);break;case 252:g=q;break;case 1054:if(4==R.biff){B[L++]=q[1];for(var oe=0;oe<L+163&&table_fmt$1[oe]!=q[1];++oe);oe>=163&&SSF_load$1(q[1],L+163)}else SSF_load$1(q[1],q[0]);break;case 30:B[L++]=q;for(var se=0;se<L+163&&table_fmt$1[se]!=q;++se);se>=163&&SSF_load$1(q,L+163);break;case 229:D=D.concat(q);break;case 93:P[q.cmo[0]]=R.lastobj=q;break;case 438:R.lastobj.TxO=q;break;case 127:R.lastobj.ImData=q;break;case 440:for(o=q[0].s.r;o<=q[0].e.r;++o)for(a=q[0].s.c;a<=q[0].e.c;++a)(n=t.dense?(h[o]||[])[a]:h[encode_cell$1({c:a,r:o})])&&(n.l=q[1]);break;case 2048:for(o=q[0].s.r;o<=q[0].e.r;++o)for(a=q[0].s.c;a<=q[0].e.c;++a)(n=t.dense?(h[o]||[])[a]:h[encode_cell$1({c:a,r:o})])&&n.l&&(n.l.Tooltip=q[1]);break;case 28:if(R.biff<=5&&R.biff>=2)break;n=t.dense?(h[q[0].r]||[])[q[0].c]:h[encode_cell$1(q[0])];var le=P[q[2]];n||(t.dense?(h[q[0].r]||(h[q[0].r]=[]),n=h[q[0].r][q[0].c]={t:"z"}):n=h[encode_cell$1(q[0])]={t:"z"},f.e.r=Math.max(f.e.r,q[0].r),f.s.r=Math.min(f.s.r,q[0].r),f.e.c=Math.max(f.e.c,q[0].c),f.s.c=Math.min(f.s.c,q[0].c)),n.c||(n.c=[]),i={a:q[1],t:le.TxO.t},n.c.push(i);break;case 2173:update_xfext$1(w[q.ixfe],q.ext);break;case 125:if(!R.cellStyles)break;for(;q.e>=q.s;)I[q.e--]={width:q.w/256,level:q.level||0,hidden:!!(1&q.flags)},M||(M=!0,find_mdw_colw$1(q.w/256)),process_col$1(I[q.e+1]);break;case 520:var ce={};null!=q.level&&(k[q.r]=ce,ce.level=q.level),q.hidden&&(k[q.r]=ce,ce.hidden=!0),q.hpt&&(k[q.r]=ce,ce.hpt=q.hpt,ce.hpx=pt2px$1(q.hpt));break;case 38:case 39:case 40:case 41:h["!margins"]||default_margins$1(h["!margins"]={}),h["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[H]]=q;break;case 161:h["!margins"]||default_margins$1(h["!margins"]={}),h["!margins"].header=q.header,h["!margins"].footer=q.footer;break;case 574:q.RTL&&(E.Views[0].RTL=!0);break;case 146:T=q;break;case 2198:c=q;break;case 140:l=q;break;case 442:_?x.CodeName=q||x.name:E.WBProps.CodeName=q||"ThisWorkbook"}}else G||console.error("Missing Info for XLS Record 0x"+H.toString(16)),e.l+=j}return u.SheetNames=keys$4(p).sort((function(e,t){return Number(e)-Number(t)})).map((function(e){return p[e].name})),t.bookSheets||(u.Sheets=d),!u.SheetNames.length&&y["!ref"]?(u.SheetNames.push("Sheet1"),u.Sheets&&(u.Sheets.Sheet1=y)):u.Preamble=y,u.Sheets&&V.forEach((function(e,t){u.Sheets[u.SheetNames[t]]["!autofilter"]=e})),u.Strings=g,u.SSF=dup$1(table_fmt$1),R.enc&&(u.Encryption=R.enc),c&&(u.Themes=c),u.Metadata={},void 0!==l&&(u.Metadata.Country=l),$.names.length>0&&(E.Names=$.names),u.Workbook=E,u}var PSCLSID$1={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function parse_xls_props$1(e,t,r){var n=CFB$1.find(e,"/!DocumentSummaryInformation");if(n&&n.size>0)try{var i=parse_PropertySetStream$1(n,DocSummaryPIDDSI$1,PSCLSID$1.DSI);for(var a in i)t[a]=i[a]}catch(c){if(r.WTF)throw c}var o=CFB$1.find(e,"/!SummaryInformation");if(o&&o.size>0)try{var s=parse_PropertySetStream$1(o,SummaryPIDSI$1,PSCLSID$1.SI);for(var l in s)null==t[l]&&(t[l]=s[l])}catch(c){if(r.WTF)throw c}t.HeadingPairs&&t.TitlesOfParts&&(load_props_pairs$1(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function parse_xlscfb$1(e,t){var r,n,i,a;if(t||(t={}),fix_read_opts$1(t),reset_cp$1(),t.codepage&&set_ansi$1(t.codepage),e.FullPaths){if(CFB$1.find(e,"/encryption"))throw new Error("File is password-protected");r=CFB$1.find(e,"!CompObj"),n=CFB$1.find(e,"/Workbook")||CFB$1.find(e,"/Book")}else{switch(t.type){case"base64":e=s2a$1(Base64_decode$1(e));break;case"binary":e=s2a$1(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e))}prep_blob$1(e,0),n={content:e}}if(r&&parse_compobj$1(r),t.bookProps&&!t.bookSheets)i={};else{var o=has_buf$1?"buffer":"array";if(n&&n.content)i=parse_workbook$1(n.content,t);else if((a=CFB$1.find(e,"PerfectOffice_MAIN"))&&a.content)i=WK_$1.to_workbook(a.content,(t.type=o,t));else{if(!(a=CFB$1.find(e,"NativeContent_MAIN"))||!a.content)throw(a=CFB$1.find(e,"MN0"))&&a.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");i=WK_$1.to_workbook(a.content,(t.type=o,t))}t.bookVBA&&e.FullPaths&&CFB$1.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=make_vba_xls$1(e))}var s={};return e.FullPaths&&parse_xls_props$1(e,s,t),i.Props=i.Custprops=s,t.bookFiles&&(i.cfb=e),i}var XLSBRecordEnum$1={0:{f:parse_BrtRowHdr$1},1:{f:parse_BrtCellBlank$1},2:{f:parse_BrtCellRk$1},3:{f:parse_BrtCellError$1},4:{f:parse_BrtCellBool$1},5:{f:parse_BrtCellReal$1},6:{f:parse_BrtCellSt$1},7:{f:parse_BrtCellIsst$1},8:{f:parse_BrtFmlaString$1},9:{f:parse_BrtFmlaNum$1},10:{f:parse_BrtFmlaBool$1},11:{f:parse_BrtFmlaError$1},12:{f:parse_BrtShortBlank$1},13:{f:parse_BrtShortRk$1},14:{f:parse_BrtShortError$1},15:{f:parse_BrtShortBool$1},16:{f:parse_BrtShortReal$1},17:{f:parse_BrtShortSt$1},18:{f:parse_BrtShortIsst$1},19:{f:parse_RichStr$1},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:parse_BrtName$1},40:{},42:{},43:{f:parse_BrtFont$1},44:{f:parse_BrtFmt$1},45:{f:parse_BrtFill$1},46:{f:parse_BrtBorder$1},47:{f:parse_BrtXF$1},48:{},49:{f:parse_Int32LE$1},50:{},51:{f:parse_BrtMdb$1},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:parse_ColInfo$1},62:{f:parse_BrtCellRString$1},63:{f:parse_BrtCalcChainItem$$1},64:{f:parse_BrtDVal$1},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:parsenoop$1,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:parse_BrtBeginWsView$1},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:parse_BrtWsProp$1},148:{f:parse_BrtWsDim$1,p:16},151:{f:parse_BrtPane$1},152:{},153:{f:parse_BrtWbProp$1},154:{},155:{},156:{f:parse_BrtBundleSh$1},157:{},158:{},159:{T:1,f:parse_BrtBeginSst$1},160:{T:-1},161:{T:1,f:parse_UncheckedRfX$1},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:parse_BrtMergeCell$1},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:parse_BrtMdtinfo$1},336:{T:-1},337:{f:parse_BrtBeginEsmdb$1,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:parse_RelID$1},357:{},358:{},359:{},360:{T:1},361:{},362:{f:parse_ExternSheet$1},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:parse_BrtArrFmla$1},427:{f:parse_BrtShrFmla$1},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:parse_BrtMargins$1},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:parse_BrtWsFmtInfo$1},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:parse_BrtHLink$1},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:parse_RelID$1},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:parse_BrtCommentAuthor$1},633:{T:1},634:{T:-1},635:{T:1,f:parse_BrtBeginComment$1},636:{T:-1},637:{f:parse_BrtCommentText$1},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:parse_BrtCsProp$1},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:parse_BrtDVal14$1},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},XLSRecordEnum$1={6:{f:parse_Formula$1},10:{f:parsenoop2$1},12:{f:parseuint16$1},13:{f:parseuint16$1},14:{f:parsebool$1},15:{f:parsebool$1},16:{f:parse_Xnum$1},17:{f:parsebool$1},18:{f:parsebool$1},19:{f:parseuint16$1},20:{f:parse_XLHeaderFooter$1},21:{f:parse_XLHeaderFooter$1},23:{f:parse_ExternSheet$1},24:{f:parse_Lbl$1},25:{f:parsebool$1},26:{},27:{},28:{f:parse_Note$1},29:{},34:{f:parsebool$1},35:{f:parse_ExternName$1},38:{f:parse_Xnum$1},39:{f:parse_Xnum$1},40:{f:parse_Xnum$1},41:{f:parse_Xnum$1},42:{f:parsebool$1},43:{f:parsebool$1},47:{f:parse_FilePass$1},49:{f:parse_Font$1},51:{f:parseuint16$1},60:{},61:{f:parse_Window1$1},64:{f:parsebool$1},65:{f:parse_Pane$1},66:{f:parseuint16$1},77:{},80:{},81:{},82:{},85:{f:parseuint16$1},89:{},90:{},91:{},92:{f:parse_WriteAccess$1},93:{f:parse_Obj$1},94:{},95:{f:parsebool$1},96:{},97:{},99:{f:parsebool$1},125:{f:parse_ColInfo$1},128:{f:parse_Guts$1},129:{f:parse_WsBool$1},130:{f:parseuint16$1},131:{f:parsebool$1},132:{f:parsebool$1},133:{f:parse_BoundSheet8$1},134:{},140:{f:parse_Country$1},141:{f:parseuint16$1},144:{},146:{f:parse_Palette$1},151:{},152:{},153:{},154:{},155:{},156:{f:parseuint16$1},157:{},158:{},160:{f:parse_Scl$1},161:{f:parse_Setup$1},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:parse_MulRk$1},190:{f:parse_MulBlank$1},193:{f:parsenoop2$1},197:{},198:{},199:{},200:{},201:{},202:{f:parsebool$1},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:parseuint16$1},220:{},221:{f:parsebool$1},222:{},224:{f:parse_XF$1},225:{f:parse_InterfaceHdr$1},226:{f:parsenoop2$1},227:{},229:{f:parse_MergeCells$1},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:parse_SST$1},253:{f:parse_LabelSst$1},255:{f:parse_ExtSST$1},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:parseuint16a$1},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:parsebool$1},353:{f:parsenoop2$1},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:parse_SupBook$1},431:{f:parsebool$1},432:{},433:{},434:{},437:{},438:{f:parse_TxO$1},439:{f:parsebool$1},440:{f:parse_HLink$1},441:{},442:{f:parse_XLUnicodeString$1},443:{},444:{f:parseuint16$1},445:{},446:{},448:{f:parsenoop2$1},449:{f:parse_RecalcId$1,r:2},450:{f:parsenoop2$1},512:{f:parse_Dimensions$1},513:{f:parse_Blank$1},515:{f:parse_Number$1},516:{f:parse_Label$1},517:{f:parse_BoolErr$1},519:{f:parse_String$1},520:{f:parse_Row$1},523:{},545:{f:parse_Array$1},549:{f:parse_DefaultRowHeight$1},566:{},574:{f:parse_Window2$1},638:{f:parse_RK$1},659:{},1048:{},1054:{f:parse_Format$1},1084:{},1212:{f:parse_ShrFmla$1},2048:{f:parse_HLinkTooltip$1},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:parse_BOF$1},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:parsenoop2$1},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:parse_XFCRC$1,r:12},2173:{f:parse_XFExt$1,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:parsebool$1,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:parse_NameCmt$1,r:12},2197:{},2198:{f:parse_Theme$1,r:12},2199:{},2200:{},2201:{},2202:{f:parse_MTRSettings$1,r:12},2203:{f:parsenoop2$1},2204:{},2205:{},2206:{},2207:{},2211:{f:parse_ForceFullCalculation$1},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:parseuint16$1},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:parse_ShtProps$1},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:parse_ClrtClient$1},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:parse_Dimensions$1},1:{},2:{f:parse_BIFF2INT$1},3:{f:parse_BIFF2NUM$1},4:{f:parse_BIFF2STR$1},5:{f:parse_BoolErr$1},7:{f:parse_BIFF2STRING$1},8:{},9:{f:parse_BOF$1},11:{},22:{f:parseuint16$1},30:{f:parse_BIFF2Format$1},31:{},32:{},33:{f:parse_Array$1},36:{},37:{f:parse_DefaultRowHeight$1},50:{f:parse_BIFF2FONTXTRA$1},62:{},52:{},67:{},68:{f:parseuint16$1},69:{},86:{},126:{},127:{f:parse_ImData$1},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:parse_RString$1},223:{},234:{},354:{},421:{},518:{f:parse_Formula$1},521:{f:parse_BOF$1},536:{f:parse_Lbl$1},547:{f:parse_ExternName$1},561:{},579:{},1030:{f:parse_Formula$1},1033:{f:parse_BOF$1},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function write_biff_rec$1(e,t,r,n){var i=t;if(!isNaN(i)){var a=(r||[]).length||0,o=e.next(4);o.write_shift(2,i),o.write_shift(2,a),a>0&&is_buf$1(r)&&e.push(r)}}function html_to_sheet$1(e,t){var r=t||{},n=r.dense?[]:{},i=(e=e.replace(/<!--.*?-->/g,"")).match(/<table/i);if(!i)throw new Error("Invalid HTML: could not find <table>");var a=e.match(/<\/table/i),o=i.index,s=a&&a.index||e.length,l=split_regex$1(e.slice(o,s),/(:?<tr[^>]*>)/i,"<tr>"),c=-1,u=0,d=0,h=0,p={s:{r:1e7,c:1e7},e:{r:0,c:0}},f=[];for(o=0;o<l.length;++o){var m=l[o].trim(),g=m.slice(0,3).toLowerCase();if("<tr"!=g){if("<td"==g||"<th"==g){var _=m.split(/<\/t[dh]>/i);for(s=0;s<_.length;++s){var y=_[s].trim();if(y.match(/<t[dh]/i)){for(var b=y,v=0;"<"==b.charAt(0)&&(v=b.indexOf(">"))>-1;)b=b.slice(v+1);for(var S=0;S<f.length;++S){var w=f[S];w.s.c==u&&w.s.r<c&&c<=w.e.r&&(u=w.e.c+1,S=-1)}var T=parsexmltag$1(y.slice(0,y.indexOf(">")));h=T.colspan?+T.colspan:1,((d=+T.rowspan)>1||h>1)&&f.push({s:{r:c,c:u},e:{r:c+(d||1)-1,c:u+h-1}});var E=T.t||T["data-t"]||"";if(b.length)if(b=htmldecode$1(b),p.s.r>c&&(p.s.r=c),p.e.r<c&&(p.e.r=c),p.s.c>u&&(p.s.c=u),p.e.c<u&&(p.e.c=u),b.length){var x={t:"s",v:b};r.raw||!b.trim().length||"s"==E||("TRUE"===b?x={t:"b",v:!0}:"FALSE"===b?x={t:"b",v:!1}:isNaN(fuzzynum$1(b))?isNaN(fuzzydate$1(b).getDate())||(x={t:"d",v:parseDate$1(b)},r.cellDates||(x={t:"n",v:datenum$1(x.v)}),x.z=r.dateNF||table_fmt$1[14]):x={t:"n",v:fuzzynum$1(b)}),r.dense?(n[c]||(n[c]=[]),n[c][u]=x):n[encode_cell$1({r:c,c:u})]=x,u+=h}else u+=h;else u+=h}}}}else{if(++c,r.sheetRows&&r.sheetRows<=c){--c;break}u=0}}return n["!ref"]=encode_range$1(p),f.length&&(n["!merges"]=f),n}function make_html_row$1(e,t,r,n){for(var i=e["!merges"]||[],a=[],o=t.s.c;o<=t.e.c;++o){for(var s=0,l=0,c=0;c<i.length;++c)if(!(i[c].s.r>r||i[c].s.c>o||i[c].e.r<r||i[c].e.c<o)){if(i[c].s.r<r||i[c].s.c<o){s=-1;break}s=i[c].e.r-i[c].s.r+1,l=i[c].e.c-i[c].s.c+1;break}if(!(s<0)){var u=encode_cell$1({r:r,c:o}),d=n.dense?(e[r]||[])[o]:e[u],h=d&&null!=d.v&&(d.h||escapehtml$1(d.w||(format_cell$1(d),d.w)||""))||"",p={};s>1&&(p.rowspan=s),l>1&&(p.colspan=l),n.editable?h='<span contenteditable="true">'+h+"</span>":d&&(p["data-t"]=d&&d.t||"z",null!=d.v&&(p["data-v"]=d.v),null!=d.z&&(p["data-z"]=d.z),d.l&&"#"!=(d.l.Target||"#").charAt(0)&&(h='<a href="'+d.l.Target+'">'+h+"</a>")),p.id=(n.id||"sjs")+"-"+u,a.push(writextag$1("td",h,p))}}return"<tr>"+a.join("")+"</tr>"}var HTML_BEGIN$1='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',HTML_END$1="</body></html>";function html_to_workbook$1(e,t){var r=e.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||0==r.length)throw new Error("Invalid HTML: could not find <table>");if(1==r.length)return sheet_to_workbook$1(html_to_sheet$1(r[0],t),t);var n=book_new$1();return r.forEach((function(e,r){book_append_sheet$1(n,html_to_sheet$1(e,t),"Sheet"+(r+1))})),n}function make_html_preamble$1(e,t,r){return[].join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function sheet_to_html$1(e,t){var r=t||{},n=null!=r.header?r.header:HTML_BEGIN$1,i=null!=r.footer?r.footer:HTML_END$1,a=[n],o=decode_range$1(e["!ref"]);r.dense=Array.isArray(e),a.push(make_html_preamble$1(e,o,r));for(var s=o.s.r;s<=o.e.r;++s)a.push(make_html_row$1(e,o,s,r));return a.push("</table>"+i),a.join("")}function sheet_add_dom$1(e,t,r){var n=r||{},i=0,a=0;if(null!=n.origin)if("number"==typeof n.origin)i=n.origin;else{var o="string"==typeof n.origin?decode_cell$1(n.origin):n.origin;i=o.r,a=o.c}var s=t.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,s.length),c={s:{r:0,c:0},e:{r:i,c:a}};if(e["!ref"]){var u=decode_range$1(e["!ref"]);c.s.r=Math.min(c.s.r,u.s.r),c.s.c=Math.min(c.s.c,u.s.c),c.e.r=Math.max(c.e.r,u.e.r),c.e.c=Math.max(c.e.c,u.e.c),-1==i&&(c.e.r=i=u.e.r+1)}var d=[],h=0,p=e["!rows"]||(e["!rows"]=[]),f=0,m=0,g=0,_=0,y=0,b=0;for(e["!cols"]||(e["!cols"]=[]);f<s.length&&m<l;++f){var v=s[f];if(is_dom_element_hidden$1(v)){if(n.display)continue;p[m]={hidden:!0}}var S=v.children;for(g=_=0;g<S.length;++g){var w=S[g];if(!n.display||!is_dom_element_hidden$1(w)){var T=w.hasAttribute("data-v")?w.getAttribute("data-v"):w.hasAttribute("v")?w.getAttribute("v"):htmldecode$1(w.innerHTML),E=w.getAttribute("data-z")||w.getAttribute("z");for(h=0;h<d.length;++h){var x=d[h];x.s.c==_+a&&x.s.r<m+i&&m+i<=x.e.r&&(_=x.e.c+1-a,h=-1)}b=+w.getAttribute("colspan")||1,((y=+w.getAttribute("rowspan")||1)>1||b>1)&&d.push({s:{r:m+i,c:_+a},e:{r:m+i+(y||1)-1,c:_+a+(b||1)-1}});var A={t:"s",v:T},C=w.getAttribute("data-t")||w.getAttribute("t")||"";null!=T&&(0==T.length?A.t=C||"z":n.raw||0==T.trim().length||"s"==C||("TRUE"===T?A={t:"b",v:!0}:"FALSE"===T?A={t:"b",v:!1}:isNaN(fuzzynum$1(T))?isNaN(fuzzydate$1(T).getDate())||(A={t:"d",v:parseDate$1(T)},n.cellDates||(A={t:"n",v:datenum$1(A.v)}),A.z=n.dateNF||table_fmt$1[14]):A={t:"n",v:fuzzynum$1(T)})),void 0===A.z&&null!=E&&(A.z=E);var R="",D=w.getElementsByTagName("A");if(D&&D.length)for(var P=0;P<D.length&&(!D[P].hasAttribute("href")||"#"==(R=D[P].getAttribute("href")).charAt(0));++P);R&&"#"!=R.charAt(0)&&(A.l={Target:R}),n.dense?(e[m+i]||(e[m+i]=[]),e[m+i][_+a]=A):e[encode_cell$1({c:_+a,r:m+i})]=A,c.e.c<_+a&&(c.e.c=_+a),_+=b}}++m}return d.length&&(e["!merges"]=(e["!merges"]||[]).concat(d)),c.e.r=Math.max(c.e.r,m-1+i),e["!ref"]=encode_range$1(c),m>=l&&(e["!fullref"]=encode_range$1((c.e.r=s.length-f+m-1+i,c))),e}function parse_dom_table$1(e,t){return sheet_add_dom$1((t||{}).dense?[]:{},e,t)}function table_to_book$1(e,t){return sheet_to_workbook$1(parse_dom_table$1(e,t),t)}function is_dom_element_hidden$1(e){var t="",r=get_get_computed_style_function$1(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),"none"===t}function get_get_computed_style_function$1(e){return e.ownerDocument.defaultView&&"function"==typeof e.ownerDocument.defaultView.getComputedStyle?e.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null}function parse_text_p$1(e){var t=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,(function(e,t){return Array(parseInt(t,10)+1).join(" ")})).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,"\n");return[unescapexml$1(t.replace(/<[^>]*>/g,""))]}var number_formats_ods={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function parse_content_xml$1(e,t){var r,n,i,a,o,s,l=t||{},c=xlml_normalize$1(e),u=[],d={name:""},h="",p=0,f={},m=[],g=l.dense?[]:{},_={value:""},y="",b=0,v=[],S=-1,w=-1,T={s:{r:1e6,c:1e7},e:{r:0,c:0}},E=0,x={},A=[],C={},R=[],D=1,P=1,I=[],k={Names:[]},M={},$=["",""],O=[],N={},F="",L=0,B=!1,V=!1,U=0;for(xlmlregex$1.lastIndex=0,c=c.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");o=xlmlregex$1.exec(c);)switch(o[3]=o[3].replace(/_.*$/,"")){case"table":case"工作表":"/"===o[1]?(T.e.c>=T.s.c&&T.e.r>=T.s.r?g["!ref"]=encode_range$1(T):g["!ref"]="A1:A1",l.sheetRows>0&&l.sheetRows<=T.e.r&&(g["!fullref"]=g["!ref"],T.e.r=l.sheetRows-1,g["!ref"]=encode_range$1(T)),A.length&&(g["!merges"]=A),R.length&&(g["!rows"]=R),i.name=i["名称"]||i.name,"undefined"!=typeof JSON&&JSON.stringify(i),m.push(i.name),f[i.name]=g,V=!1):"/"!==o[0].charAt(o[0].length-2)&&(i=parsexmltag$1(o[0],!1),S=w=-1,T.s.r=T.s.c=1e7,T.e.r=T.e.c=0,g=l.dense?[]:{},A=[],R=[],V=!0);break;case"table-row-group":"/"===o[1]?--E:++E;break;case"table-row":case"行":if("/"===o[1]){S+=D,D=1;break}if((a=parsexmltag$1(o[0],!1))["行号"]?S=a["行号"]-1:-1==S&&(S=0),(D=+a["number-rows-repeated"]||1)<10)for(U=0;U<D;++U)E>0&&(R[S+U]={level:E});w=-1;break;case"covered-table-cell":"/"!==o[1]&&++w,l.sheetStubs&&(l.dense?(g[S]||(g[S]=[]),g[S][w]={t:"z"}):g[encode_cell$1({r:S,c:w})]={t:"z"}),y="",v=[];break;case"table-cell":case"数据":if("/"===o[0].charAt(o[0].length-2))++w,_=parsexmltag$1(o[0],!1),P=parseInt(_["number-columns-repeated"]||"1",10),s={t:"z",v:null},_.formula&&0!=l.cellFormula&&(s.f=ods_to_csf_formula$1(unescapexml$1(_.formula))),"string"==(_["数据类型"]||_["value-type"])&&(s.t="s",s.v=unescapexml$1(_["string-value"]||""),l.dense?(g[S]||(g[S]=[]),g[S][w]=s):g[encode_cell$1({r:S,c:w})]=s),w+=P-1;else if("/"!==o[1]){y="",b=0,v=[],P=1;var z=D?S+D-1:S;if(++w>T.e.c&&(T.e.c=w),w<T.s.c&&(T.s.c=w),S<T.s.r&&(T.s.r=S),z>T.e.r&&(T.e.r=z),O=[],N={},s={t:(_=parsexmltag$1(o[0],!1))["数据类型"]||_["value-type"],v:null},l.cellFormula)if(_.formula&&(_.formula=unescapexml$1(_.formula)),_["number-matrix-columns-spanned"]&&_["number-matrix-rows-spanned"]&&(C={s:{r:S,c:w},e:{r:S+(parseInt(_["number-matrix-rows-spanned"],10)||0)-1,c:w+(parseInt(_["number-matrix-columns-spanned"],10)||0)-1}},s.F=encode_range$1(C),I.push([C,s.F])),_.formula)s.f=ods_to_csf_formula$1(_.formula);else for(U=0;U<I.length;++U)S>=I[U][0].s.r&&S<=I[U][0].e.r&&w>=I[U][0].s.c&&w<=I[U][0].e.c&&(s.F=I[U][1]);switch((_["number-columns-spanned"]||_["number-rows-spanned"])&&(C={s:{r:S,c:w},e:{r:S+(parseInt(_["number-rows-spanned"],10)||0)-1,c:w+(parseInt(_["number-columns-spanned"],10)||0)-1}},A.push(C)),_["number-columns-repeated"]&&(P=parseInt(_["number-columns-repeated"],10)),s.t){case"boolean":s.t="b",s.v=parsexmlbool$1(_["boolean-value"]);break;case"float":case"percentage":case"currency":s.t="n",s.v=parseFloat(_.value);break;case"date":s.t="d",s.v=parseDate$1(_["date-value"]),l.cellDates||(s.t="n",s.v=datenum$1(s.v)),s.z="m/d/yy";break;case"time":s.t="n",s.v=parse_isodur$1(_["time-value"])/86400,l.cellDates&&(s.t="d",s.v=numdate$1(s.v)),s.z="HH:MM:SS";break;case"number":s.t="n",s.v=parseFloat(_["数据数值"]);break;default:if("string"!==s.t&&"text"!==s.t&&s.t)throw new Error("Unsupported value type "+s.t);s.t="s",null!=_["string-value"]&&(y=unescapexml$1(_["string-value"]),v=[])}}else{if(B=!1,"s"===s.t&&(s.v=y||"",v.length&&(s.R=v),B=0==b),M.Target&&(s.l=M),O.length>0&&(s.c=O,O=[]),y&&!1!==l.cellText&&(s.w=y),B&&(s.t="z",delete s.v),(!B||l.sheetStubs)&&!(l.sheetRows&&l.sheetRows<=S))for(var H=0;H<D;++H){if(P=parseInt(_["number-columns-repeated"]||"1",10),l.dense)for(g[S+H]||(g[S+H]=[]),g[S+H][w]=0==H?s:dup$1(s);--P>0;)g[S+H][w+P]=dup$1(s);else for(g[encode_cell$1({r:S+H,c:w})]=s;--P>0;)g[encode_cell$1({r:S+H,c:w+P})]=dup$1(s);T.e.c<=w&&(T.e.c=w)}w+=(P=parseInt(_["number-columns-repeated"]||"1",10))-1,P=0,s={},y="",v=[]}M={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if("/"===o[1]){if((r=u.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&u.push([o[3],!0]);break;case"annotation":if("/"===o[1]){if((r=u.pop())[0]!==o[3])throw"Bad state: "+r;N.t=y,v.length&&(N.R=v),N.a=F,O.push(N)}else"/"!==o[0].charAt(o[0].length-2)&&u.push([o[3],!1]);F="",L=0,y="",b=0,v=[];break;case"creator":"/"===o[1]?F=c.slice(L,o.index):L=o.index+o[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if("/"===o[1]){if((r=u.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&u.push([o[3],!1]);y="",b=0,v=[];break;case"scientific-number":case"currency-symbol":case"currency-style":case"script":case"libraries":case"automatic-styles":case"default-style":case"page-layout":case"style":case"map":case"font-face":case"paragraph-properties":case"table-properties":case"table-column-properties":case"table-row-properties":case"table-cell-properties":case"fraction":case"boolean-style":case"boolean":case"text-style":case"text-content":case"text-properties":case"embedded-text":case"body":case"电子表格":case"forms":case"table-column":case"table-header-rows":case"table-rows":case"table-column-group":case"table-header-columns":case"table-columns":case"null-date":case"graphic-properties":case"calculation-settings":case"named-expressions":case"label-range":case"label-ranges":case"named-expression":case"sort":case"sort-by":case"sort-groups":case"tab":case"line-break":case"span":case"s":case"date":case"object":case"title":case"标题":case"desc":case"binary-data":case"table-source":case"scenario":case"iteration":case"content-validations":case"content-validation":case"help-message":case"error-message":case"database-ranges":case"filter":case"filter-and":case"filter-or":case"filter-condition":case"list-level-style-bullet":case"list-level-style-number":case"list-level-properties":case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":case"event-listener":case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":case"config-item":case"page-number":case"page-count":case"time":case"cell-range-source":case"detective":case"operation":case"highlighted-range":case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":case"rect":case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":case"properties":case"property":case"table-protection":case"data-pilot-grand-total":case"office-document-common-attrs":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if("/"===o[1]){if(x[d.name]=h,(r=u.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&(h="",d=parsexmltag$1(o[0],!1),u.push([o[3],!0]));break;case"number":case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(u[u.length-1][0]){case"time-style":case"date-style":n=parsexmltag$1(o[0],!1),h+=number_formats_ods[o[3]]["long"===n.style?1:0]}break;case"text":if("/>"===o[0].slice(-2))break;if("/"===o[1])switch(u[u.length-1][0]){case"number-style":case"date-style":case"time-style":h+=c.slice(p,o.index)}else p=o.index+o[0].length;break;case"named-range":$=ods_to_csf_3D$1((n=parsexmltag$1(o[0],!1))["cell-range-address"]);var j={Name:n.name,Ref:$[0]+"!"+$[1]};V&&(j.Sheet=m.length),k.Names.push(j);break;case"p":case"文本串":if(["master-styles"].indexOf(u[u.length-1][0])>-1)break;if("/"!==o[1]||_&&_["string-value"])parsexmltag$1(o[0],!1),b=o.index+o[0].length;else{var G=parse_text_p$1(c.slice(b,o.index));y=(y.length>0?y+"\n":"")+G[0]}break;case"database-range":if("/"===o[1])break;try{f[($=ods_to_csf_3D$1(parsexmltag$1(o[0])["target-range-address"]))[0]]["!autofilter"]={ref:$[1]}}catch(q){}break;case"a":if("/"!==o[1]){if(!(M=parsexmltag$1(o[0],!1)).href)break;M.Target=unescapexml$1(M.href),delete M.href,"#"==M.Target.charAt(0)&&M.Target.indexOf(".")>-1?($=ods_to_csf_3D$1(M.Target.slice(1)),M.Target="#"+$[0]+"!"+$[1]):M.Target.match(/^\.\.[\\\/]/)&&(M.Target=M.Target.slice(3))}break;default:switch(o[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(l.WTF)throw new Error(o)}}var W={Sheets:f,SheetNames:m,Workbook:k};return l.bookSheets&&delete W.Sheets,W}function parse_ods$1(e,t){t=t||{},safegetzipfile$1(e,"META-INF/manifest.xml")&&parse_manifest$1(getzipdata$1(e,"META-INF/manifest.xml"),t);var r=getzipstr$1(e,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var n=parse_content_xml$1(utf8read$1(r),t);return safegetzipfile$1(e,"meta.xml")&&(n.Props=parse_core_props$1(getzipdata$1(e,"meta.xml"))),n}function parse_fods$1(e,t){return parse_content_xml$1(e,t)}function u8_to_dataview$1(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u8str$1(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):utf8read$1(a2s$1(e))}function u8concat$1(e){var t=e.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(t),n=0;return e.forEach((function(e){r.set(e,n),n+=e.length})),r}function popcnt$1(e){return 0x1010101*((e=(0x33333333&(e-=e>>1&0x55555555))+(e>>2&0x33333333))+(e>>4)&0xf0f0f0f)>>>24}function readDecimal128LE$1(e,t){for(var r=(127&e[t+15])<<7|e[t+14]>>1,n=1&e[t+14],i=t+13;i>=t;--i)n=256*n+e[i];return(128&e[t+15]?-n:n)*Math.pow(10,r-6176)}function parse_varint49$1(e,t){var r=t?t[0]:0,n=127&e[r];e:if(e[r++]>=128){if(n|=(127&e[r])<<7,e[r++]<128)break e;if(n|=(127&e[r])<<14,e[r++]<128)break e;if(n|=(127&e[r])<<21,e[r++]<128)break e;if(n+=(127&e[r])*Math.pow(2,28),++r,e[r++]<128)break e;if(n+=(127&e[r])*Math.pow(2,35),++r,e[r++]<128)break e;if(n+=(127&e[r])*Math.pow(2,42),++r,e[r++]<128)break e}return t&&(t[0]=r),n}function varint_to_i32$1(e){var t=0,r=127&e[t];e:if(e[t++]>=128){if(r|=(127&e[t])<<7,e[t++]<128)break e;if(r|=(127&e[t])<<14,e[t++]<128)break e;if(r|=(127&e[t])<<21,e[t++]<128)break e;r|=(127&e[t])<<28}return r}function parse_shallow$1(e){for(var t=[],r=[0];r[0]<e.length;){var n,i=r[0],a=parse_varint49$1(e,r),o=7&a,s=0;if(0==(a=Math.floor(a/8)))break;switch(o){case 0:for(var l=r[0];e[r[0]++]>=128;);n=e.slice(l,r[0]);break;case 5:s=4,n=e.slice(r[0],r[0]+s),r[0]+=s;break;case 1:s=8,n=e.slice(r[0],r[0]+s),r[0]+=s;break;case 2:s=parse_varint49$1(e,r),n=e.slice(r[0],r[0]+s),r[0]+=s;break;default:throw new Error("PB Type ".concat(o," for Field ").concat(a," at offset ").concat(i))}var c={data:n,type:o};null==t[a]?t[a]=[c]:t[a].push(c)}return t}function mappa$1(e,t){return(null==e?void 0:e.map((function(e){return t(e.data)})))||[]}function parse_iwa_file$1(e){for(var t,r=[],n=[0];n[0]<e.length;){var i=parse_varint49$1(e,n),a=parse_shallow$1(e.slice(n[0],n[0]+i));n[0]+=i;var o={id:varint_to_i32$1(a[1][0].data),messages:[]};a[2].forEach((function(t){var r=parse_shallow$1(t.data),i=varint_to_i32$1(r[3][0].data);o.messages.push({meta:r,data:e.slice(n[0],n[0]+i)}),n[0]+=i})),(null==(t=a[3])?void 0:t[0])&&(o.merge=varint_to_i32$1(a[3][0].data)>>>0>0),r.push(o)}return r}function parse_snappy_chunk$1(e,t){if(0!=e)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=parse_varint49$1(t,r),i=[];r[0]<t.length;){var a=3&t[r[0]];if(0!=a){var o=0,s=0;if(1==a?(s=4+(t[r[0]]>>2&7),o=(224&t[r[0]++])<<3,o|=t[r[0]++]):(s=1+(t[r[0]++]>>2),2==a?(o=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(o=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[u8concat$1(i)],0==o)throw new Error("Invalid offset 0");if(o>i[0].length)throw new Error("Invalid offset beyond length");if(s>=o)for(i.push(i[0].slice(-o)),s-=o;s>=i[i.length-1].length;)i.push(i[i.length-1]),s-=i[i.length-1].length;i.push(i[0].slice(-o,-o+s))}else{var l=t[r[0]++]>>2;if(l<60)++l;else{var c=l-59;l=t[r[0]],c>1&&(l|=t[r[0]+1]<<8),c>2&&(l|=t[r[0]+2]<<16),c>3&&(l|=t[r[0]+3]<<24),l>>>=0,l++,r[0]+=c}i.push(t.slice(r[0],r[0]+l)),r[0]+=l}}var u=u8concat$1(i);if(u.length!=n)throw new Error("Unexpected length: ".concat(u.length," != ").concat(n));return u}function decompress_iwa_file$1(e){for(var t=[],r=0;r<e.length;){var n=e[r++],i=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(parse_snappy_chunk$1(n,e.slice(r,r+i))),r+=i}if(r!==e.length)throw new Error("data is not a valid framed stream!");return u8concat$1(t)}function parse_old_storage$1(e,t,r,n){var i,a=u8_to_dataview$1(e),o=a.getUint32(4,!0),s=(n>1?12:8)+4*popcnt$1(o&(n>1?3470:398)),l=-1,c=-1,u=NaN,d=new Date(2001,0,1);switch(512&o&&(l=a.getUint32(s,!0),s+=4),s+=4*popcnt$1(o&(n>1?12288:4096)),16&o&&(c=a.getUint32(s,!0),s+=4),32&o&&(u=a.getFloat64(s,!0),s+=8),64&o&&(d.setTime(d.getTime()+1e3*a.getFloat64(s,!0)),s+=8),e[2]){case 0:break;case 2:i={t:"n",v:u};break;case 3:i={t:"s",v:t[c]};break;case 5:i={t:"d",v:d};break;case 6:i={t:"b",v:u>0};break;case 7:i={t:"n",v:u/86400};break;case 8:i={t:"e",v:0};break;case 9:if(l>-1)i={t:"s",v:r[l]};else if(c>-1)i={t:"s",v:t[c]};else{if(isNaN(u))throw new Error("Unsupported cell type ".concat(e.slice(0,4)));i={t:"n",v:u}}break;default:throw new Error("Unsupported cell type ".concat(e.slice(0,4)))}return i}function parse_new_storage$1(e,t,r){var n,i=u8_to_dataview$1(e),a=i.getUint32(8,!0),o=12,s=-1,l=-1,c=NaN,u=NaN,d=new Date(2001,0,1);switch(1&a&&(c=readDecimal128LE$1(e,o),o+=16),2&a&&(u=i.getFloat64(o,!0),o+=8),4&a&&(d.setTime(d.getTime()+1e3*i.getFloat64(o,!0)),o+=8),8&a&&(l=i.getUint32(o,!0),o+=4),16&a&&(s=i.getUint32(o,!0),o+=4),e[1]){case 0:break;case 2:case 10:n={t:"n",v:c};break;case 3:n={t:"s",v:t[l]};break;case 5:n={t:"d",v:d};break;case 6:n={t:"b",v:u>0};break;case 7:n={t:"n",v:u/86400};break;case 8:n={t:"e",v:0};break;case 9:if(!(s>-1))throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(31&a," : ").concat(e.slice(0,4)));n={t:"s",v:r[s]};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(31&a," : ").concat(e.slice(0,4)))}return n}function parse_cell_storage$1(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:return parse_old_storage$1(e,t,r,e[0]);case 5:return parse_new_storage$1(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function parse_TSP_Reference$1(e){return parse_varint49$1(parse_shallow$1(e)[1][0].data)}function parse_TST_TableDataList$1(e,t){var r=parse_shallow$1(t.data),n=varint_to_i32$1(r[1][0].data),i=r[3],a=[];return(i||[]).forEach((function(t){var r=parse_shallow$1(t.data),i=varint_to_i32$1(r[1][0].data)>>>0;switch(n){case 1:a[i]=u8str$1(r[3][0].data);break;case 8:var o=parse_shallow$1(e[parse_TSP_Reference$1(r[9][0].data)][0].data),s=e[parse_TSP_Reference$1(o[1][0].data)][0],l=varint_to_i32$1(s.meta[1][0].data);if(2001!=l)throw new Error("2000 unexpected reference to ".concat(l));var c=parse_shallow$1(s.data);a[i]=c[3].map((function(e){return u8str$1(e.data)})).join("")}})),a}function parse_TST_TileRowInfo$1(e,t){var r,n,i,a,o,s,l,c,u,d,h,p,f,m,g,_,y=parse_shallow$1(e),b=varint_to_i32$1(y[1][0].data)>>>0,v=varint_to_i32$1(y[2][0].data)>>>0,S=(null==(n=null==(r=y[8])?void 0:r[0])?void 0:n.data)&&varint_to_i32$1(y[8][0].data)>0||!1;if((null==(a=null==(i=y[7])?void 0:i[0])?void 0:a.data)&&0!=t)g=null==(s=null==(o=y[7])?void 0:o[0])?void 0:s.data,_=null==(c=null==(l=y[6])?void 0:l[0])?void 0:c.data;else{if(!(null==(d=null==(u=y[4])?void 0:u[0])?void 0:d.data)||1==t)throw"NUMBERS Tile missing ".concat(t," cell storage");g=null==(p=null==(h=y[4])?void 0:h[0])?void 0:p.data,_=null==(m=null==(f=y[3])?void 0:f[0])?void 0:m.data}for(var w=S?4:1,T=u8_to_dataview$1(g),E=[],x=0;x<g.length/2;++x){var A=T.getUint16(2*x,!0);A<65535&&E.push([x,A])}if(E.length!=v)throw"Expected ".concat(v," cells, found ").concat(E.length);var C=[];for(x=0;x<E.length-1;++x)C[E[x][0]]=_.subarray(E[x][1]*w,E[x+1][1]*w);return E.length>=1&&(C[E[E.length-1][0]]=_.subarray(E[E.length-1][1]*w)),{R:b,cells:C}}function parse_TST_Tile$1(e,t){var r,n=parse_shallow$1(t.data),i=(null==(r=null==n?void 0:n[7])?void 0:r[0])?varint_to_i32$1(n[7][0].data)>>>0>0?1:0:-1,a=mappa$1(n[5],(function(e){return parse_TST_TileRowInfo$1(e,i)}));return{nrows:varint_to_i32$1(n[4][0].data)>>>0,data:a.reduce((function(e,t){return e[t.R]||(e[t.R]=[]),t.cells.forEach((function(r,n){if(e[t.R][n])throw new Error("Duplicate cell r=".concat(t.R," c=").concat(n));e[t.R][n]=r})),e}),[])}}function parse_TST_TableModelArchive$1(e,t,r){var n,i=parse_shallow$1(t.data),a={s:{r:0,c:0},e:{r:0,c:0}};if(a.e.r=(varint_to_i32$1(i[6][0].data)>>>0)-1,a.e.r<0)throw new Error("Invalid row varint ".concat(i[6][0].data));if(a.e.c=(varint_to_i32$1(i[7][0].data)>>>0)-1,a.e.c<0)throw new Error("Invalid col varint ".concat(i[7][0].data));r["!ref"]=encode_range$1(a);var o=parse_shallow$1(i[4][0].data),s=parse_TST_TableDataList$1(e,e[parse_TSP_Reference$1(o[4][0].data)][0]),l=(null==(n=o[17])?void 0:n[0])?parse_TST_TableDataList$1(e,e[parse_TSP_Reference$1(o[17][0].data)][0]):[],c=parse_shallow$1(o[3][0].data),u=0;c[1].forEach((function(t){var n=parse_shallow$1(t.data),i=e[parse_TSP_Reference$1(n[2][0].data)][0],a=varint_to_i32$1(i.meta[1][0].data);if(6002!=a)throw new Error("6001 unexpected reference to ".concat(a));var o=parse_TST_Tile$1(e,i);o.data.forEach((function(e,t){e.forEach((function(e,n){var i=encode_cell$1({r:u+t,c:n}),a=parse_cell_storage$1(e,s,l);a&&(r[i]=a)}))})),u+=o.nrows}))}function parse_TST_TableInfoArchive$1(e,t){var r={"!ref":"A1"},n=e[parse_TSP_Reference$1(parse_shallow$1(t.data)[2][0].data)],i=varint_to_i32$1(n[0].meta[1][0].data);if(6001!=i)throw new Error("6000 unexpected reference to ".concat(i));return parse_TST_TableModelArchive$1(e,n[0],r),r}function parse_TN_SheetArchive$1(e,t){var r,n=parse_shallow$1(t.data),i={name:(null==(r=n[1])?void 0:r[0])?u8str$1(n[1][0].data):"",sheets:[]};return mappa$1(n[2],parse_TSP_Reference$1).forEach((function(t){e[t].forEach((function(t){6e3==varint_to_i32$1(t.meta[1][0].data)&&i.sheets.push(parse_TST_TableInfoArchive$1(e,t))}))})),i}function parse_TN_DocumentArchive$1(e,t){var r=book_new$1();if(mappa$1(parse_shallow$1(t.data)[1],parse_TSP_Reference$1).forEach((function(t){e[t].forEach((function(t){if(2==varint_to_i32$1(t.meta[1][0].data)){var n=parse_TN_SheetArchive$1(e,t);n.sheets.forEach((function(e,t){book_append_sheet$1(r,e,0==t?n.name:n.name+"_"+t,!0)}))}}))})),0==r.SheetNames.length)throw new Error("Empty NUMBERS file");return r}function parse_numbers_iwa$1(e){var t,r,n,i,a={},o=[];if(e.FullPaths.forEach((function(e){if(e.match(/\.iwpv2/))throw new Error("Unsupported password protection")})),e.FileIndex.forEach((function(e){if(e.name.match(/\.iwa$/)){var t,r;try{t=decompress_iwa_file$1(e.content)}catch(n){return console.log("?? "+e.content.length+" "+(n.message||n))}try{r=parse_iwa_file$1(t)}catch(n){return console.log("## "+(n.message||n))}r.forEach((function(e){a[e.id]=e.messages,o.push(e.id)}))}})),!o.length)throw new Error("File has no messages");var s=(null==(i=null==(n=null==(r=null==(t=null==a?void 0:a[1])?void 0:t[0])?void 0:r.meta)?void 0:n[1])?void 0:i[0].data)&&1==varint_to_i32$1(a[1][0].meta[1][0].data)&&a[1][0];if(s||o.forEach((function(e){a[e].forEach((function(e){if(1==varint_to_i32$1(e.meta[1][0].data)>>>0){if(s)throw new Error("Document has multiple roots");s=e}}))})),!s)throw new Error("Cannot find Document root");return parse_TN_DocumentArchive$1(a,s)}function fix_opts_func$1(e){return function(t){for(var r=0;r!=e.length;++r){var n=e[r];void 0===t[n[0]]&&(t[n[0]]=n[1]),"n"===n[2]&&(t[n[0]]=Number(t[n[0]]))}}}function fix_read_opts$1(e){fix_opts_func$1([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function get_sheet_type$1(e){return RELS$1.WS.indexOf(e)>-1?"sheet":e==RELS$1.CS?"chart":e==RELS$1.DS?"dialog":e==RELS$1.MS?"macro":e&&e.length?e:"sheet"}function safe_parse_wbrels$1(e,t){if(!e)return 0;try{e=t.map((function(t){return t.id||(t.id=t.strRelID),[t.name,e["!id"][t.id].Target,get_sheet_type$1(e["!id"][t.id].Type)]}))}catch(r){return null}return e&&0!==e.length?e:null}function safe_parse_sheet$1(e,t,r,n,i,a,o,s,l,c,u,d){try{a[n]=parse_rels$1(getzipstr$1(e,r,!0),t);var h,p=getzipdata$1(e,t);switch(s){case"sheet":h=parse_ws$1(p,t,i,l,a[n],c,u,d);break;case"chart":if(!(h=parse_cs$1(p,t,i,l,a[n],c,u,d))||!h["!drawel"])break;var f=resolve_path$1(h["!drawel"].Target,t),m=get_rels_path$1(f),g=resolve_path$1(parse_drawing$1(getzipstr$1(e,f,!0),parse_rels$1(getzipstr$1(e,m,!0),f)),f),_=get_rels_path$1(g);h=parse_chart$1(getzipstr$1(e,g,!0),g,l,parse_rels$1(getzipstr$1(e,_,!0),g),c,h);break;case"macro":h=parse_ms$1(p,t,i,l,a[n],c,u,d);break;case"dialog":h=parse_ds$1(p,t,i,l,a[n],c,u,d);break;default:throw new Error("Unrecognized sheet type "+s)}o[n]=h;var y=[];a&&a[n]&&keys$4(a[n]).forEach((function(r){var i="";if(a[n][r].Type==RELS$1.CMNT){i=resolve_path$1(a[n][r].Target,t);var o=parse_cmnt$1(getzipdata$1(e,i,!0),i,l);if(!o||!o.length)return;sheet_insert_comments$1(h,o,!1)}a[n][r].Type==RELS$1.TCMNT&&(i=resolve_path$1(a[n][r].Target,t),y=y.concat(parse_tcmnt_xml$1(getzipdata$1(e,i,!0),l)))})),y&&y.length&&sheet_insert_comments$1(h,y,!0,l.people||[])}catch(b){if(l.WTF)throw b}}function strip_front_slash$1(e){return"/"==e.charAt(0)?e.slice(1):e}function parse_zip$1(e,t){if(make_ssf$1(),fix_read_opts$1(t=t||{}),safegetzipfile$1(e,"META-INF/manifest.xml"))return parse_ods$1(e,t);if(safegetzipfile$1(e,"objectdata.xml"))return parse_ods$1(e,t);if(safegetzipfile$1(e,"Index/Document.iwa")){if("undefined"==typeof Uint8Array)throw new Error("NUMBERS file parsing requires Uint8Array support");if(void 0!==parse_numbers_iwa$1){if(e.FileIndex)return parse_numbers_iwa$1(e);var r=CFB$1.utils.cfb_new();return zipentries$1(e).forEach((function(t){zip_add_file$1(r,t,getzipbin$1(e,t))})),parse_numbers_iwa$1(r)}throw new Error("Unsupported NUMBERS file")}if(!safegetzipfile$1(e,"[Content_Types].xml")){if(safegetzipfile$1(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(safegetzipfile$1(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");throw new Error("Unsupported ZIP file")}var n,i,a=zipentries$1(e),o=parse_ct$1(getzipstr$1(e,"[Content_Types].xml")),s=!1;if(0===o.workbooks.length&&getzipdata$1(e,i="xl/workbook.xml",!0)&&o.workbooks.push(i),0===o.workbooks.length){if(!getzipdata$1(e,i="xl/workbook.bin",!0))throw new Error("Could not find workbook");o.workbooks.push(i),s=!0}"bin"==o.workbooks[0].slice(-3)&&(s=!0);var l={},c={};if(!t.bookSheets&&!t.bookProps){if(strs$1=[],o.sst)try{strs$1=parse_sst$1(getzipdata$1(e,strip_front_slash$1(o.sst)),o.sst,t)}catch(P){if(t.WTF)throw P}t.cellStyles&&o.themes.length&&(l=parse_theme(getzipstr$1(e,o.themes[0].replace(/^\//,""),!0)||"",o.themes[0],t)),o.style&&(c=parse_sty$1(getzipdata$1(e,strip_front_slash$1(o.style)),o.style,l,t))}o.links.map((function(r){try{var n=parse_rels$1(getzipstr$1(e,get_rels_path$1(strip_front_slash$1(r))),r);return parse_xlink$1(getzipdata$1(e,strip_front_slash$1(r)),n,r,t)}catch(P){}}));var u=parse_wb$1(getzipdata$1(e,strip_front_slash$1(o.workbooks[0])),o.workbooks[0],t),d={},h="";o.coreprops.length&&((h=getzipdata$1(e,strip_front_slash$1(o.coreprops[0]),!0))&&(d=parse_core_props$1(h)),0!==o.extprops.length&&(h=getzipdata$1(e,strip_front_slash$1(o.extprops[0]),!0))&&parse_ext_props$1(h,d,t));var p={};t.bookSheets&&!t.bookProps||0!==o.custprops.length&&(h=getzipstr$1(e,strip_front_slash$1(o.custprops[0]),!0))&&(p=parse_cust_props$1(h,t));var f={};if((t.bookSheets||t.bookProps)&&(u.Sheets?n=u.Sheets.map((function(e){return e.name})):d.Worksheets&&d.SheetNames.length>0&&(n=d.SheetNames),t.bookProps&&(f.Props=d,f.Custprops=p),t.bookSheets&&void 0!==n&&(f.SheetNames=n),t.bookSheets?f.SheetNames:t.bookProps))return f;n={};var m={};t.bookDeps&&o.calcchain&&(m=parse_cc$1(getzipdata$1(e,strip_front_slash$1(o.calcchain)),o.calcchain));var g,_,y=0,b={},v=u.Sheets;d.Worksheets=v.length,d.SheetNames=[];for(var S=0;S!=v.length;++S)d.SheetNames[S]=v[S].name;var w=s?"bin":"xml",T=o.workbooks[0].lastIndexOf("/"),E=(o.workbooks[0].slice(0,T+1)+"_rels/"+o.workbooks[0].slice(T+1)+".rels").replace(/^\//,"");safegetzipfile$1(e,E)||(E="xl/_rels/workbook."+w+".rels");var x=parse_rels$1(getzipstr$1(e,E,!0),E.replace(/_rels.*/,"s5s"));(o.metadata||[]).length>=1&&(t.xlmeta=parse_xlmeta$1(getzipdata$1(e,strip_front_slash$1(o.metadata[0])),o.metadata[0],t)),(o.people||[]).length>=1&&(t.people=parse_people_xml$1(getzipdata$1(e,strip_front_slash$1(o.people[0])),t)),x&&(x=safe_parse_wbrels$1(x,u.Sheets));var A=getzipdata$1(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(y=0;y!=d.Worksheets;++y){var C="sheet";if(x&&x[y]?(g="xl/"+x[y][1].replace(/[\/]?xl\//,""),safegetzipfile$1(e,g)||(g=x[y][1]),safegetzipfile$1(e,g)||(g=E.replace(/_rels\/.*$/,"")+x[y][1]),C=x[y][2]):g=(g="xl/worksheets/sheet"+(y+1-A)+"."+w).replace(/sheet0\./,"sheet."),_=g.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&null!=t.sheets)switch(typeof t.sheets){case"number":if(y!=t.sheets)continue e;break;case"string":if(d.SheetNames[y].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var R=!1,D=0;D!=t.sheets.length;++D)"number"==typeof t.sheets[D]&&t.sheets[D]==y&&(R=1),"string"==typeof t.sheets[D]&&t.sheets[D].toLowerCase()==d.SheetNames[y].toLowerCase()&&(R=1);if(!R)continue e}}safe_parse_sheet$1(e,g,_,d.SheetNames[y],y,b,n,C,t,u,l,c)}return f={Directory:o,Workbook:u,Props:d,Custprops:p,Deps:m,Sheets:n,SheetNames:d.SheetNames,Strings:strs$1,Styles:c,Themes:l,SSF:dup$1(table_fmt$1)},t&&t.bookFiles&&(e.files?(f.keys=a,f.files=e.files):(f.keys=[],f.files={},e.FullPaths.forEach((function(t,r){t=t.replace(/^Root Entry[\/]/,""),f.keys.push(t),f.files[t]=e.FileIndex[r]})))),t&&t.bookVBA&&(o.vba.length>0?f.vbaraw=getzipdata$1(e,strip_front_slash$1(o.vba[0]),!0):o.defaults&&o.defaults.bin===CT_VBA$1&&(f.vbaraw=getzipdata$1(e,"xl/vbaProject.bin",!0))),f}function parse_xlsxcfb$1(e,t){var r=t||{},n="Workbook",i=CFB$1.find(e,n);try{if(n="/!DataSpaces/Version",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(parse_DataSpaceVersionInfo$1(i.content),n="/!DataSpaces/DataSpaceMap",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var a=parse_DataSpaceMap$1(i.content);if(1!==a.length||1!==a[0].comps.length||0!==a[0].comps[0].t||"StrongEncryptionDataSpace"!==a[0].name||"EncryptedPackage"!==a[0].comps[0].v)throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=parse_DataSpaceDefinition$1(i.content);if(1!=o.length||"StrongEncryptionTransform"!=o[0])throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);parse_Primary$1(i.content)}catch(l){}if(n="/EncryptionInfo",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var s=parse_EncryptionInfo$1(i.content);if(n="/EncryptedPackage",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(4==s[0]&&"undefined"!=typeof decrypt_agile)return decrypt_agile(s[1],i.content,r.password||"",r);if(2==s[0]&&"undefined"!=typeof decrypt_std76)return decrypt_std76(s[1],i.content,r.password||"",r);throw new Error("File is password-protected")}function firstbyte$1(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Base64_decode$1(e.slice(0,12));break;case"binary":r=e;break;default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function read_cfb$1(e,t){return CFB$1.find(e,"EncryptedPackage")?parse_xlsxcfb$1(e,t):parse_xlscfb$1(e,t)}function read_zip$1(e,t){var r=e,n=t||{};return n.type||(n.type=has_buf$1&&Buffer.isBuffer(e)?"buffer":"base64"),parse_zip$1(zip_read$1(r,n),n)}function read_plaintext$1(e,t){var r=0;e:for(;r<e.length;)switch(e.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return parse_xlml$1(e.slice(r),t);default:break e}return PRN$1.to_workbook(e,t)}function read_plaintext_raw$1(e,t){var r="",n=firstbyte$1(e,t);switch(t.type){case"base64":r=Base64_decode$1(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=cc2str$1(e);break;default:throw new Error("Unrecognized type "+t.type)}return 239==n[0]&&187==n[1]&&191==n[2]&&(r=utf8read$1(r)),t.type="binary",read_plaintext$1(r,t)}function read_utf16$1(e,t){var r=e;return"base64"==t.type&&(r=Base64_decode$1(r)),r=$cptable.utils.decode(1200,r.slice(2),"str"),t.type="binary",read_plaintext$1(r,t)}function bstrify$1(e){return e.match(/[^\x00-\x7F]/)?utf8write$1(e):e}function read_prn$1(e,t,r,n){return n?(r.type="string",PRN$1.to_workbook(e,r)):PRN$1.to_workbook(t,r)}function readSync$1(e,t){reset_cp$1();var r=t||{};if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return readSync$1(new Uint8Array(e),((r=dup$1(r)).type="array",r));"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&!r.type&&(r.type="undefined"!=typeof Deno?"buffer":"array");var n,i=e,a=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),_ssfopts$1={},r.dateNF&&(_ssfopts$1.dateNF=r.dateNF),r.type||(r.type=has_buf$1&&Buffer.isBuffer(e)?"buffer":"base64"),"file"==r.type&&(r.type=has_buf$1?"buffer":"binary",i=read_binary$1(e),"undefined"==typeof Uint8Array||has_buf$1||(r.type="array")),"string"==r.type&&(a=!0,r.type="binary",r.codepage=65001,i=bstrify$1(e)),"array"==r.type&&"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&"undefined"!=typeof ArrayBuffer){var o=new ArrayBuffer(3),s=new Uint8Array(o);if(s.foo="bar",!s.foo)return(r=dup$1(r)).type="array",readSync$1(ab2a$1(i),r)}switch((n=firstbyte$1(i,r))[0]){case 208:if(207===n[1]&&17===n[2]&&224===n[3]&&161===n[4]&&177===n[5]&&26===n[6]&&225===n[7])return read_cfb$1(CFB$1.read(i,r),r);break;case 9:if(n[1]<=8)return parse_xlscfb$1(i,r);break;case 60:return parse_xlml$1(i,r);case 73:if(73===n[1]&&42===n[2]&&0===n[3])throw new Error("TIFF Image File is not a spreadsheet");if(68===n[1])return read_wb_ID$1(i,r);break;case 84:if(65===n[1]&&66===n[2]&&76===n[3])return DIF$1.to_workbook(i,r);break;case 80:return 75===n[1]&&n[2]<9&&n[3]<9?read_zip$1(i,r):read_prn$1(e,i,r,a);case 239:return 60===n[3]?parse_xlml$1(i,r):read_prn$1(e,i,r,a);case 255:if(254===n[1])return read_utf16$1(i,r);if(0===n[1]&&2===n[2]&&0===n[3])return WK_$1.to_workbook(i,r);break;case 0:if(0===n[1]){if(n[2]>=2&&0===n[3])return WK_$1.to_workbook(i,r);if(0===n[2]&&(8===n[3]||9===n[3]))return WK_$1.to_workbook(i,r)}break;case 3:case 131:case 139:case 140:return DBF$1.to_workbook(i,r);case 123:if(92===n[1]&&114===n[2]&&116===n[3])return RTF.to_workbook(i,r);break;case 10:case 13:case 32:return read_plaintext_raw$1(i,r);case 137:if(80===n[1]&&78===n[2]&&71===n[3])throw new Error("PNG Image File is not a spreadsheet")}return DBF_SUPPORTED_VERSIONS$1.indexOf(n[0])>-1&&n[2]<=12&&n[3]<=31?DBF$1.to_workbook(i,r):read_prn$1(e,i,r,a)}function make_json_row$1(e,t,r,n,i,a,o,s){var l=encode_row$1(r),c=s.defval,u=s.raw||!Object.prototype.hasOwnProperty.call(s,"raw"),d=!0,h=1===i?[]:{};if(1!==i)if(Object.defineProperty)try{Object.defineProperty(h,"__rowNum__",{value:r,enumerable:!1})}catch(g){h.__rowNum__=r}else h.__rowNum__=r;if(!o||e[r])for(var p=t.s.c;p<=t.e.c;++p){var f=o?e[r][p]:e[n[p]+l];if(void 0!==f&&void 0!==f.t){var m=f.v;switch(f.t){case"z":if(null==m)break;continue;case"e":m=0==m?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+f.t)}if(null!=a[p]){if(null==m)if("e"==f.t&&null===m)h[a[p]]=null;else if(void 0!==c)h[a[p]]=c;else{if(!u||null!==m)continue;h[a[p]]=null}else h[a[p]]=u&&("n"!==f.t||"n"===f.t&&!1!==s.rawNumbers)?m:format_cell$1(f,m,s);null!=m&&(d=!1)}}else{if(void 0===c)continue;null!=a[p]&&(h[a[p]]=c)}}return{row:h,isempty:d}}function sheet_to_json$1(e,t){if(null==e||null==e["!ref"])return[];var r={t:"n",v:0},n=0,i=1,a=[],o=0,s="",l={s:{r:0,c:0},e:{r:0,c:0}},c=t||{},u=null!=c.range?c.range:e["!ref"];switch(1===c.header?n=1:"A"===c.header?n=2:Array.isArray(c.header)?n=3:null==c.header&&(n=0),typeof u){case"string":l=safe_decode_range$1(u);break;case"number":(l=safe_decode_range$1(e["!ref"])).s.r=u;break;default:l=u}n>0&&(i=0);var d=encode_row$1(l.s.r),h=[],p=[],f=0,m=0,g=Array.isArray(e),_=l.s.r,y=0,b={};g&&!e[_]&&(e[_]=[]);var v=c.skipHidden&&e["!cols"]||[],S=c.skipHidden&&e["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(v[y]||{}).hidden)switch(h[y]=encode_col$1(y),r=g?e[_][y]:e[h[y]+d],n){case 1:a[y]=y-l.s.c;break;case 2:a[y]=h[y];break;case 3:a[y]=c.header[y-l.s.c];break;default:if(null==r&&(r={w:"__EMPTY",t:"s"}),s=o=format_cell$1(r,null,c),m=b[o]||0){do{s=o+"_"+m++}while(b[s]);b[o]=m,b[s]=1}else b[o]=1;a[y]=s}for(_=l.s.r+i;_<=l.e.r;++_)if(!(S[_]||{}).hidden){var w=make_json_row$1(e,l,_,h,n,a,g,c);(!1===w.isempty||(1===n?!1!==c.blankrows:c.blankrows))&&(p[f++]=w.row)}return p.length=f,p}var qreg$1=/"/g;function make_csv_row$1(e,t,r,n,i,a,o,s){for(var l=!0,c=[],u="",d=encode_row$1(r),h=t.s.c;h<=t.e.c;++h)if(n[h]){var p=s.dense?(e[r]||[])[h]:e[n[h]+d];if(null==p)u="";else if(null!=p.v){l=!1,u=""+(s.rawNumbers&&"n"==p.t?p.v:format_cell$1(p,null,s));for(var f=0,m=0;f!==u.length;++f)if((m=u.charCodeAt(f))===i||m===a||34===m||s.forceQuotes){u='"'+u.replace(qreg$1,'""')+'"';break}"ID"==u&&(u='"ID"')}else null==p.f||p.F?u="":(l=!1,(u="="+p.f).indexOf(",")>=0&&(u='"'+u.replace(qreg$1,'""')+'"'));c.push(u)}return!1===s.blankrows&&l?null:c.join(o)}function sheet_to_csv$1(e,t){var r=[],n=null==t?{}:t;if(null==e||null==e["!ref"])return"";var i=safe_decode_range$1(e["!ref"]),a=void 0!==n.FS?n.FS:",",o=a.charCodeAt(0),s=void 0!==n.RS?n.RS:"\n",l=s.charCodeAt(0),c=new RegExp(("|"==a?"\\|":a)+"+$"),u="",d=[];n.dense=Array.isArray(e);for(var h=n.skipHidden&&e["!cols"]||[],p=n.skipHidden&&e["!rows"]||[],f=i.s.c;f<=i.e.c;++f)(h[f]||{}).hidden||(d[f]=encode_col$1(f));for(var m=0,g=i.s.r;g<=i.e.r;++g)(p[g]||{}).hidden||null!=(u=make_csv_row$1(e,i,g,d,o,l,a,n))&&(n.strip&&(u=u.replace(c,"")),(u||!1!==n.blankrows)&&r.push((m++?s:"")+u));return delete n.dense,r.join("")}function sheet_to_txt$1(e,t){return t||(t={}),t.FS=" ",t.RS="\n",sheet_to_csv$1(e,t)}function sheet_to_formulae$1(e){var t,r="",n="";if(null==e||null==e["!ref"])return[];var i,a=safe_decode_range$1(e["!ref"]),o="",s=[],l=[],c=Array.isArray(e);for(i=a.s.c;i<=a.e.c;++i)s[i]=encode_col$1(i);for(var u=a.s.r;u<=a.e.r;++u)for(o=encode_row$1(u),i=a.s.c;i<=a.e.c;++i)if(r=s[i]+o,n="",void 0!==(t=c?(e[u]||[])[i]:e[r])){if(null!=t.F){if(r=t.F,!t.f)continue;n=t.f,-1==r.indexOf(":")&&(r=r+":"+r)}if(null!=t.f)n=t.f;else{if("z"==t.t)continue;if("n"==t.t&&null!=t.v)n=""+t.v;else if("b"==t.t)n=t.v?"TRUE":"FALSE";else if(void 0!==t.w)n="'"+t.w;else{if(void 0===t.v)continue;n="s"==t.t?"'"+t.v:""+t.v}}l[l.length]=r+"="+n}return l}function sheet_add_json$1(e,t,r){var n,i=r||{},a=+!i.skipHeader,o=e||{},s=0,l=0;if(o&&null!=i.origin)if("number"==typeof i.origin)s=i.origin;else{var c="string"==typeof i.origin?decode_cell$1(i.origin):i.origin;s=c.r,l=c.c}var u={s:{c:0,r:0},e:{c:l,r:s+t.length-1+a}};if(o["!ref"]){var d=safe_decode_range$1(o["!ref"]);u.e.c=Math.max(u.e.c,d.e.c),u.e.r=Math.max(u.e.r,d.e.r),-1==s&&(s=d.e.r+1,u.e.r=s+t.length-1+a)}else-1==s&&(s=0,u.e.r=t.length-1+a);var h=i.header||[],p=0;t.forEach((function(e,t){keys$4(e).forEach((function(r){-1==(p=h.indexOf(r))&&(h[p=h.length]=r);var c=e[r],u="z",d="",f=encode_cell$1({c:l+p,r:s+t+a});n=ws_get_cell_stub$1(o,f),!c||"object"!=typeof c||c instanceof Date?("number"==typeof c?u="n":"boolean"==typeof c?u="b":"string"==typeof c?u="s":c instanceof Date?(u="d",i.cellDates||(u="n",c=datenum$1(c)),d=i.dateNF||table_fmt$1[14]):null===c&&i.nullError&&(u="e",c=0),n?(n.t=u,n.v=c,delete n.w,delete n.R,d&&(n.z=d)):o[f]=n={t:u,v:c},d&&(n.z=d)):o[f]=c}))})),u.e.c=Math.max(u.e.c,l+h.length-1);var f=encode_row$1(s);if(a)for(p=0;p<h.length;++p)o[encode_col$1(p+l)+f]={t:"s",v:h[p]};return o["!ref"]=encode_range$1(u),o}function json_to_sheet$1(e,t){return sheet_add_json$1(null,e,t)}function ws_get_cell_stub$1(e,t,r){if("string"==typeof t){if(Array.isArray(e)){var n=decode_cell$1(t);return e[n.r]||(e[n.r]=[]),e[n.r][n.c]||(e[n.r][n.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return ws_get_cell_stub$1(e,encode_cell$1("number"!=typeof t?t:{r:t,c:r||0}))}function wb_sheet_idx$1(e,t){if("number"==typeof t){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}if("string"==typeof t){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}throw new Error("Cannot find sheet |"+t+"|")}function book_new$1(){return{SheetNames:[],Sheets:{}}}function book_append_sheet$1(e,t,r,n){var i=1;if(!r)for(;i<=65535&&-1!=e.SheetNames.indexOf(r="Sheet"+i);++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var a=r.match(/(^.*?)(\d+)$/);i=a&&+a[2]||0;var o=a&&a[1]||r;for(++i;i<=65535&&-1!=e.SheetNames.indexOf(r=o+i);++i);}if(check_ws_name$1(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function book_set_sheet_visibility$1(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=wb_sheet_idx$1(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function cell_set_number_format$1(e,t){return e.z=t,e}function cell_set_hyperlink$1(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function cell_set_internal_link$1(e,t,r){return cell_set_hyperlink$1(e,"#"+t,r)}function cell_add_comment$1(e,t,r){e.c||(e.c=[]),e.c.push({t:t,a:r||"SheetJS"})}function sheet_set_array_formula$1(e,t,r,n){for(var i="string"!=typeof t?t:safe_decode_range$1(t),a="string"==typeof t?t:encode_range$1(t),o=i.s.r;o<=i.e.r;++o)for(var s=i.s.c;s<=i.e.c;++s){var l=ws_get_cell_stub$1(e,o,s);l.t="n",l.F=a,delete l.v,o==i.s.r&&s==i.s.c&&(l.f=r,n&&(l.D=!0))}return e}var utils$a={encode_col:encode_col$1,encode_row:encode_row$1,encode_cell:encode_cell$1,encode_range:encode_range$1,decode_col:decode_col$1,decode_row:decode_row$1,split_cell:split_cell$1,decode_cell:decode_cell$1,decode_range:decode_range$1,format_cell:format_cell$1,sheet_add_aoa:sheet_add_aoa$1,sheet_add_json:sheet_add_json$1,sheet_add_dom:sheet_add_dom$1,aoa_to_sheet:aoa_to_sheet$1,json_to_sheet:json_to_sheet$1,table_to_sheet:parse_dom_table$1,table_to_book:table_to_book$1,sheet_to_csv:sheet_to_csv$1,sheet_to_txt:sheet_to_txt$1,sheet_to_json:sheet_to_json$1,sheet_to_html:sheet_to_html$1,sheet_to_formulae:sheet_to_formulae$1,sheet_to_row_object_array:sheet_to_json$1,sheet_get_cell:ws_get_cell_stub$1,book_new:book_new$1,book_append_sheet:book_append_sheet$1,book_set_sheet_visibility:book_set_sheet_visibility$1,cell_set_number_format:cell_set_number_format$1,cell_set_hyperlink:cell_set_hyperlink$1,cell_set_internal_link:cell_set_internal_link$1,cell_add_comment:cell_add_comment$1,sheet_set_array_formula:sheet_set_array_formula$1,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};let mix=e=>new MixinBuilder(e);class MixinBuilder{constructor(e){this.superclass=e}with(...e){return e.reduce(((e,t)=>t(e)),this.superclass)}}function promiseToTupple(e){return e.then((e=>[null,e])).catch((e=>[e,null]))}function makeUuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function getErrorStack(){try{throw Error("")}catch(error){let t=error.stack.split("\n");return t.splice(1,1),JSON.stringify(t.join("\n"))}}function isEmpty$1(e){return void 0===e||!!Array.isArray(e)&&(0===e.length||1===e.length&&void 0===e[0])}function detectBrowser$1(){const e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0;if(e)return"Opera";if("undefined"!=typeof InstallTrigger)return"Firefox";if(/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString())return"Safari";const t=!!document.documentMode;if(t)return"IE";if(!t&&!!window.StyleMedia)return"Edge";const r=window.chrome;if(r)return"Chrome";if(r&&-1!==navigator.userAgent.indexOf("Edg"))return"EdgeChromium";return(r||e)&&!!window.CSS?"Blink":"unknown"}function toNumerical(e){const t={origin:"util.toNumerical",context:"when converting an object to its numerical form"};try{if(null===e)throw"unable to convert null to a number";if(void 0===e)throw"unable to convert undefined to a number";if("number"==typeof e)return e;const t=e=>{const t=Number.parseFloat(e);if(Number.isNaN(t))throw`unable to convert ${e} to a number`;return t};if(Array.isArray(e))return e.map(t);const r=turnSquareBracketsIntoArrays(e);if(Array.isArray(r))return r.map(t);if("string"==typeof e)return t(e);throw"unable to convert the object to a number"}catch(error){throw Object.assign(t,{error:error})}}function isNumeric(e){return!1===Number.isNaN(Number(e))}function IsPointInsidePolygon(e,t){const r=e[0],n=e[1];let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const e=t[a][0],s=t[a][1],l=t[o][0],c=t[o][1];s>n!=c>n&&r<(l-e)*(n-s)/(c-s)+e&&(i=!i)}return i}function shuffle$2(e,t=void 0){void 0===t&&(t=Math.random);for(let r=e.length-1;r>0;r--){const n=Math.floor(t()*(r+1));[e[r],e[n]]=[e[n],e[r]]}return e}function randchoice(e,t=void 0){void 0===t&&(t=Math.random);return e[Math.floor(t()*e.length)]}function getPositionFromObject(e,t){const r={origin:"util.getPositionFromObject",context:"when getting the position of an object"};try{if(void 0===e)throw"cannot get the position of an undefined object";let r;return"function"==typeof e.getPos&&(t=e.units,r=e.win,e=e.getPos()),to_px$1(e,t,r)}catch(error){throw Object.assign(r,{error:error})}}function to_px$1(e,t,r,n=!1){const i={origin:"util.to_px",context:"when converting a position to pixel units"};let a;if("pix"===t)a=e;else if("norm"===t)a=[e[0]*r.size[0]/2,e[1]*r.size[1]/2];else{if("height"!==t)throw Object.assign(i,{error:`unknown position units: ${t}`});{const t=Math.min(r.size[0],r.size[1]);a=[e[0]*t,e[1]*t]}}return n?[Math.round(a[0]),Math.round(a[1])]:a}function to_norm(e,t,r){if("norm"===t)return e;if("pix"===t)return[e[0]/(r.size[0]/2),e[1]/(r.size[1]/2)];if("height"===t){const t=Math.min(r.size[0],r.size[1]);return[e[0]*t/(r.size[0]/2),e[1]*t/(r.size[1]/2)]}throw Object.assign({origin:"util.to_norm",context:"when converting a position to norm units"},{error:`unknown position units: ${t}`})}function to_height(e,t,r){if("height"===t)return e;if("pix"===t){const t=Math.min(r.size[0],r.size[1]);return[e[0]/t,e[1]/t]}if("norm"===t){const t=Math.min(r.size[0],r.size[1]);return[e[0]*r.size[0]/2/t,e[1]*r.size[1]/2/t]}throw Object.assign({origin:"util.to_height",context:"when converting a position to height units"},{error:`unknown position units: ${t}`})}function to_win(e,t,r){const n={origin:"util.to_win",context:"when converting a position to window units"};try{if("pix"===r._units)return to_px$1(e,t,r);if("norm"===r._units)return to_norm(e,t,r);if("height"===r._units)return to_height(e,t,r);throw`unknown window units: ${r._units}`}catch(error){throw Object.assign(n,{response:n,error:error})}}function to_unit(e,t,r,n){const i={origin:"util.to_unit",context:"when converting a position to different units"};try{if("pix"===n)return to_px$1(e,t,r);if("norm"===n)return to_norm(e,t,r);if("height"===n)return to_height(e,t,r);throw`unknown target units: ${n}`}catch(error){throw Object.assign(i,{error:error})}}function toString$p(e){if(void 0===e)return"undefined";if(!e)return"null";if("string"==typeof e)return e;if("class"===e.constructor.toString().substring(0,5)&&"function"==typeof e.toString)return e.toString();try{const t=(e,t)=>("symbol"==typeof t&&(t=Symbol.keyFor(t)),t);return JSON.stringify(e,t)}catch(t){return"Object (circular)"}}function getRequestError(e,t,r){let n="unknown error";return void 0!==e.responseJSON?"object"==typeof e.responseJSON?e.responseJSON.error?(n=e.responseJSON.error,e.responseJSON.details&&(n+=" - "+e.responseJSON.details),e.responseJSON.code&&(n+=" (Code: "+e.responseJSON.code+")")):n=JSON.stringify(e.responseJSON):n=e.responseJSON:void 0!==e.responseText?n=e.responseText:void 0!==r&&(n=r),n}function isInt(e){if(isNaN(e))return!1;const t=parseFloat(e);return(0|t)===t}function getUrlParameters(){const e=window.location.search.slice(1);return new URLSearchParams(e)}function addInfoFromUrl(e){return getUrlParameters().forEach(((t,r)=>{0!==r.indexOf("__")&&(e[r]=t)})),e}function selectFromArray(e,t){if(isInt(t))return[e[parseInt(t)]];if(Array.isArray(t))return t.map((t=>e[t]));if("string"!=typeof t)throw{origin:"selectFromArray",context:"when selecting entries from an array",error:"unknown selection type: "+typeof t};if(t.indexOf(",")>-1){const r=t.split(",").map((e=>parseInt(e)));return selectFromArray(e,r)}if(t.indexOf(":")>-1){let r=t.split(":").map((e=>parseInt(e)));return 3===r.length?sliceArray(e,r[0],r[2],r[1]):sliceArray(e,...r)}}function flattenArray(e){return e.reduce(((e,t)=>(e.push(Array.isArray(t)&&Array.isArray(t[0])?flattenArray(t):t),e)),[])}function sliceArray(e,t=NaN,r=NaN,n=NaN){isNaN(t)&&(t=0),isNaN(r)&&(r=e.length);let i=e.slice(t,r);return isNaN(n)?i:(n<0&&i.reverse(),1===(n=Math.abs(n))?i:i.filter(((e,t)=>t%n==0)))}function offerDataForDownload(e,t,r){const n=new Blob([t],{type:r});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,e);else{const t=document.createElement("a");t.href=window.URL.createObjectURL(n),t.download=e,document.body.appendChild(t),t.click(),document.body.removeChild(t)}}function turnSquareBracketsIntoArrays(e,t=1){if(String(e)!==e)return;const r=e.match(/\[(.*?)\]/g);if(null===r)return;const n=r.map((e=>e.replace(/[\[\]]+/g,"").split(/[, ]+/)));return t<2?n[0]:n}function randint(e=0,t){let r=e,n=t;if(void 0===t&&(n=r,r=0),n<r)throw{origin:"util.randint",context:"when generating a random integer",error:"min should be <= max"};return Math.floor(Math.random()*(n-r))+r}function round$4(e,t=0){return+(Math.round(`${e}e+${t}`)+`e-${t}`)}function sum$2(e=[],t=0){if(!Array.isArray(e))return t;return e.map((e=>Number(e))).filter((e=>!1===Number.isNaN(e))).reduce(((e,t)=>e+t),t)}function average$1(e=[]){return Array.isArray(e)?0===e.length?0:sum$2(e,0)/e.length:0}function sort(e){const t={origin:"util.sort",context:"when sorting the elements of an array"};try{if(!Array.isArray(e))throw"the input argument should be an array";if(e.every((e=>"number"==typeof e)))return e.sort(((e,t)=>e-t));if(e.every((e=>"string"==typeof e)))return e.sort();throw"the input array should either consist entirely of strings or of numbers"}catch(error){throw{...t,error:error}}}function range$1(...e){const t={origin:"util.range",context:"when building a range of numbers"};try{let t,r,n;switch(e.length){case 0:throw"at least one argument is required";case 1:t=0,r=e[0],n=1;break;case 2:t=e[0],r=e[1],n=1;break;case 3:t=e[0],r=e[1],n=e[2];break;default:throw"range requires at least one and at most 3 arguments"}if(!Number.isInteger(t))throw"start should be an integer";if(!Number.isInteger(r))throw"stop should be an integer";if(!Number.isInteger(n))throw"step should be an integer";if(t>=r)return[];let i=[];for(let e=t;e<r;e+=n)i.push(e);return i}catch(error){throw{...t,error:error}}}function _match(e){const t={origin:"util._match",context:"when creating a function that compares an input element to the given value"};try{if("function"==typeof e)throw"the value cannot be a function";if(Number.isNaN(e))return e=>Number.isNaN(e);if(null===e)return e=>null===e;if("object"==typeof e){const t=JSON.stringify(e);if(void 0===t)throw"value could not be converted to a JSON string";return e=>JSON.stringify(e)===t}return t=>t===e}catch(error){throw{...t,error:error}}}function count(e,t){const r={origin:"util.count",context:"when counting how many elements in the input array match the given value"};try{if(!Array.isArray(e))throw"the input argument should be an array";const r=_match(t);let n=0;return e.forEach((e=>{r(e)&&++n})),n}catch(error){throw{...r,error:error}}}function index$2(e,t){const r={origin:"util.index",context:"when getting the index in the input array of the first element that matches the given value"};try{if(!Array.isArray(e))throw"the input argument should be an array";const r=_match(t),n=e.findIndex(r);if(-1===n)throw"no element in the input array matches the value";return n}catch(error){throw{...r,error:error}}}function extensionFromMimeType(e){return"string"!=typeof e?".dat":0===e.indexOf("audio/webm")?".webm":0===e.indexOf("audio/ogg")?".ogg":0===e.indexOf("audio/wav")?".wav":0===e.indexOf("video/webm")?".webm":".dat"}async function getDownloadSpeed(e,t=1){const r="https://upload.wikimedia.org/wikipedia/commons/a/a6/Brandenburger_Tor_abends.jpg";return new Promise(((n,i)=>{let a=0,o=0;const s=new Image;s.onload=()=>{const e=performance.now();if(a+=e-l,++o,o===t){n(0x14a8018*t/(a/1e3)/1024/1024)}else l=performance.now(),s.src=`${r}?salt=${l}`},s.onerror=t=>{const r=`unable to estimate the download speed: ${JSON.stringify(t)}`;e.logger.error(r),i(r)};let l=performance.now();s.src=`${r}?salt=${l}`}))}String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,(function(t,r){return void 0!==e[r]?e[r]:t})).replace(/{([$_a-zA-Z][$_a-zA-Z0-9]*)}/g,(function(t,r){return e.length>0&&void 0!==e[0][r]?e[0][r]:t}))});const repeatEveryElement=(e,t)=>e.map((e=>[...[...new Array(t).keys()].map((t=>e))])).flat(),getTimezoneName=()=>{const e=new Date,t=e.toLocaleDateString(void 0),r=e.toLocaleDateString(void 0,{timeZoneName:"short"}),n=r.indexOf(t);if(n>=0){return(r.substring(0,n)+r.substring(n+t.length)).replace(/^[\s,.\-:;]+|[\s,.\-:;]+$/g,"")}return r};let EventEmitter$2=class{constructor(){this._listeners=new Map,this._onceUuids=new Map}on(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");let r=makeUuid();return this._listeners.has(e)||this._listeners.set(e,[]),this._listeners.get(e).push({uuid:r,listener:t}),r}once(e,t){let r=this.on(e,t);return this._onceUuids.has(e)||this._onceUuids.set(e,[]),this._onceUuids.get(e).push(r),r}off(e,t){let r=this._listeners.get(e);return!(!r||!r.length)&&(this._listeners.set(e,r.filter((e=>e.uuid!=t))),!0)}emit(e,t){let r=this._listeners.get(e);if(r&&r.length){let n=this._onceUuids.get(e),i=this;return r.forEach((({uuid:r,listener:a})=>{a(t),void 0!==n&&n.includes(r)&&i.off(e,r)})),!0}return!1}};class PsychObject extends EventEmitter$2{constructor(e,t){super(),this._psychoJS=e,this._userAttributes=new Set,void 0===t&&(t=this.constructor.name),this._addAttribute("name",t)}get psychoJS(){return this._psychoJS}set psychoJS(e){this._psychoJS=e}toString(){let e=this.constructor.name+"( ",t=!1;for(const r of this._userAttributes){t&&(e+=", "),t=!0;let n=toString$p(this["_"+r]);const i=n.length;i>50&&(n=")"===n[i-1]?n.substring(0,50)+"~)":n.substring(0,50)+"~"),e+=r+"="+n}return e+=" )",e}_setAttribute(e,t,r=!1,n=void 0,i=!1){const a={origin:"PsychObject.setAttribute",context:"when setting the attribute of an object"};if(void 0===e)throw Object.assign(a,{error:"the attribute name cannot be undefined"});if(void 0!==n&&this.hasOwnProperty("_"+e)){let r=this["_"+e];if("number"!=typeof t&&(!Array.isArray(t)||0!==t.length&&"number"!=typeof t[0]))throw Object.assign(a,{error:"operation: "+n+" is invalid for old value: "+JSON.stringify(r)+" and new value: "+JSON.stringify(t)});if(Array.isArray(t))if(Array.isArray(r)){if(t.length!==r.length)throw Object.assign(a,{error:"old and new value should have the same size when they are both arrays"});switch(n){case"":break;case"+":t=t.map(((e,t)=>r[t]+e));break;case"*":t=t.map(((e,t)=>r[t]*e));break;case"-":t=t.map(((e,t)=>r[t]-e));break;case"/":t=t.map(((e,t)=>r[t]/e));break;case"**":t=t.map(((e,t)=>r[t]**e));break;case"%":t=t.map(((e,t)=>r[t]%e));break;default:throw Object.assign(a,{error:"unsupported operation: "+n+" when setting: "+e+" in: "+this.name})}}else switch(n){case"":break;case"+":t=t.map((e=>r+e));break;case"*":t=t.map((e=>r*e));break;case"-":t=t.map((e=>r-e));break;case"/":t=t.map((e=>r/e));break;case"**":t=t.map((e=>r**e));break;case"%":t=t.map((e=>r%e));break;default:throw Object.assign(a,{error:"unsupported value: "+JSON.stringify(t)+" for operation: "+n+" when setting: "+e+" in: "+this.name})}else if(Array.isArray(r))switch(n){case"":t=r.map((e=>t));break;case"+":t=r.map((e=>e+t));break;case"*":t=r.map((e=>e*t));break;case"-":t=r.map((e=>e-t));break;case"/":t=r.map((e=>e/t));break;case"**":t=r.map((e=>e**t));break;case"%":t=r.map((e=>e%t));break;default:throw Object.assign(a,{error:"unsupported operation: "+n+" when setting: "+e+" in: "+this.name})}else switch(n){case"":break;case"+":t=r+t;break;case"*":t*=r;break;case"-":t=r-t;break;case"/":t=r/t;break;case"**":t=r**t;break;case"%":t=r%t;break;default:throw Object.assign(a,{error:"unsupported value: "+JSON.stringify(t)+" for operation: "+n+" when setting: "+e+" in: "+this.name})}}if(!i&&(r||this._autoLog)&&void 0!==this.win){const r=this.name+": "+e+" = "+toString$p(t);this.win.logOnFlip({msg:r})}const o=this["_"+e];if(this["_"+e]=t,void 0===o)return!1;const s=toString$p(o),l=toString$p(t);return"Object (circular)"===s||"Object (circular)"===l||s!==l}_addAttribute(e,t,r=void 0,n=()=>{}){const i="get"+e[0].toUpperCase()+e.substr(1);void 0===this[i]&&(this[i]=()=>this["_"+e]);const a="set"+e[0].toUpperCase()+e.substr(1);void 0===this[a]?this[a]=(t,i=!1)=>{null==t&&(t=r);this._setAttribute(e,t,i)&&n()}:null==t&&(t=r),Object.defineProperty(this,e,{configurable:!0,get(){return this[i]()},set(e){this[a](e)}}),this[e]=t,this._userAttributes.add(e)}}const SPACED=", $1",excelSafeCellValue=e=>{try{return Array.isArray(e)?JSON.stringify(e).replace(/,(\S)/g,SPACED):"string"==typeof e?e.replace(/,(\S)/g,SPACED):e}catch(t){return e}},excelSafeRows=e=>Array.isArray(e)?e.map((e=>{try{return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,excelSafeCellValue(t)])))}catch(t){return e}})):e;class ExperimentHandler extends PsychObject{get experimentEnded(){return this._experimentEnded}set experimentEnded(e){this._experimentEnded=e}get _thisEntry(){return this._currentTrialData}get _entries(){return this._trialsData}constructor({psychoJS:e,name:t,extraInfo:r,dataFileName:n}={}){super(e,t),this._addAttribute("extraInfo",r),this._experimentName=this.psychoJS.config.experiment.name,this._participant="string"==typeof r.participant&&r.participant.length>0?r.participant:"PARTICIPANT";const i=r.ProlificParticipantID?r.ProlificParticipantID:void 0;this._session="string"==typeof r.session&&r.session.length>0?r.session:"SESSION",this._datetime=void 0!==r.date?r.date:MonotonicClock.getDateStr(),this._addAttribute("dataFileName",n,`${this._participant}_${i?`${i}_`:""}${this._experimentName}_${this._datetime}`),this._loops=[],this._unfinishedLoops=[],this._trialsKeys=[],this._trialsData=[],this._currentTrialData={},this.experimentClock=new MonotonicClock,this._experimentEnded=!1}isEntryEmpty(){return Object.keys(this._currentTrialData).length>0}addLoop(e){this._loops.push(e),this._unfinishedLoops.push(e),e.experimentHandler=this}removeLoop(e){const t=this._unfinishedLoops.indexOf(e);-1!==t&&this._unfinishedLoops.splice(t,1)}addData(e,t){-1===this._trialsKeys.indexOf(e)&&this._trialsKeys.push(e),Array.isArray(t)&&(t=JSON.stringify(t)),this._currentTrialData[e]=t}nextEntry(e){if(void 0!==e){Array.isArray(e)||(e=[e]);for(const t of e){const e=ExperimentHandler._getLoopAttributes(t);for(let t in e)e.hasOwnProperty(t)&&(this._currentTrialData[t]=e[t])}}else for(const t of this._unfinishedLoops){const e=ExperimentHandler._getLoopAttributes(t);for(const t in e)e.hasOwnProperty(t)&&(this._currentTrialData[t]=e[t])}for(let t in this.extraInfo)if(this.extraInfo.hasOwnProperty(t)){const e="date"===t?this.getDateTimeString():this.extraInfo[t];this._currentTrialData[t]=e}this._trialsData.push(this._currentTrialData),this._currentTrialData={},this._currentTrialData.secs=this.experimentClock.getTime()}getDateTimeString(){return MonotonicClock.getDateStr()+" "+MonotonicClock.getTimeZone()}async save({attributes:e=[],sync:t=!1,tag:r="",clear:n=!1}={}){if(this._psychoJS.logger.info("[PsychoJS] Save experiment results."),this.extraInfo.dataSaved=!0,0===e.length){e=this._trialsKeys.slice();for(let t=0;t<this._loops.length;t++){const r=this._loops[t],n=ExperimentHandler._getLoopAttributes(r);for(let t in n)n.hasOwnProperty(t)&&e.push(t)}for(let t in this.extraInfo)this.extraInfo.hasOwnProperty(t)&&e.push(t)}let i;if(({data:i,attributes:e}=this._orderOutput(this._trialsData,e)),n&&(this._trialsData=[]),i=excelSafeRows(i),this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.CSV){const e=utils$a.json_to_sheet(i),n="\uFEFF"+utils$a.sheet_to_csv(e),a=this._psychoJS.experiment.getExtraInfo(),o=a.participant||"PARTICIPANT",s=a.ProlificParticipantID||void 0,l=`${`${o}_${s?`${s}_`:""}${this._psychoJS.config.experiment.name}_${a.session||"SESSION"}_${a.date||MonotonicClock.getDateStr()}`}${r}.csv`;if(this._psychoJS.getEnvironment()===ExperimentHandler.Environment.SERVER&&"RUNNING"===this._psychoJS.config.experiment.status&&!this._psychoJS._serverMsg.has("__pilotToken"))return this._psychoJS.serverManager.uploadData(l,n,t);offerDataForDownload(l,n,"text/csv")}else if(this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.DATABASE){const r=this._psychoJS.config.gitlab,n=void 0!==r&&void 0!==r.projectId?r.projectId:void 0;let a=[];for(let t=0;t<i.length;t++){let r={__projectId:n,__experimentName:this._experimentName,__participant:this._participant,__session:this._session,__datetime:this._datetime};for(let n=0;n<e.length;n++)r[e[n]]=i[t][e[n]];a.push(r)}if(this._psychoJS.getEnvironment()===ExperimentHandler.Environment.SERVER&&"RUNNING"===this._psychoJS.config.experiment.status&&!this._psychoJS._serverMsg.has("__pilotToken")){console.log("documents",a);const e="results";return this._psychoJS.serverManager.uploadData(e,JSON.stringify(a),t)}offerDataForDownload("results.json",JSON.stringify(a),"application/json")}}saveCSV(e,t="stimulus",r=!1,n=!1){console.log(e);const i=utils$a.json_to_sheet(excelSafeRows(e)),a="\uFEFF"+utils$a.sheet_to_csv(i),o=this._psychoJS.experiment.getExtraInfo(),s=o.participant||"PARTICIPANT",l=o.ProlificParticipantID||void 0,c=this._psychoJS.config.experiment.name,u=o.session||"SESSION",d=o.date||MonotonicClock.getDateStr(),h=`${n?t:`${s}_${l?`${l}_`:""}${c}_${u}_${d}_${t}`}.csv`,p=this._psychoJS.config.gitlab,f=void 0!==p&&void 0!==p.projectId?p.projectId:void 0;for(let g=0;g<e.length;g++)e[g].__projectId=f,e[g].__experimentName=this.psychoJS.config.experiment.name,e[g].__participant=this._participant,e[g].__session=this._session,e[g].__datetime=this._datetime;if(this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.CSV)if(r)try{this._psychoJS.serverManager.uploadData(h,a,!1)}catch(m){console.error("Error saving csv data to online.",m)}else offerDataForDownload(h,a,"text/csv");else if(this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.DATABASE)if(r)try{this._psychoJS.serverManager.uploadData("results",JSON.stringify(excelSafeRows(e)),!1)}catch(m){console.error("Error saving to results.",m)}else offerDataForDownload(h,a,"text/csv")}downloadJSON(e,t){const r=this._psychoJS.experiment.getExtraInfo(),n=r.participant||"PARTICIPANT",i=r.session||"SESSION",a=calibrationTime.current,o=`${this._psychoJS.config.experiment.name}_${n}_${i}_${a}_${0==t?"sound":`M${t}`}.json`,s=document.createElement("a");return s.href="data:application/json;charset=utf-8;,"+encodeURIComponent(JSON.stringify(e)),s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s),this._psychoJS.getEnvironment()!==ExperimentHandler.Environment.SERVER||"RUNNING"!==this._psychoJS.config.experiment.status||this._psychoJS._serverMsg.has("__pilotToken")||this._psychoJS.serverManager.uploadData(o,JSON.stringify(e),!1),o}static _getLoopAttributes(e){const t=["thisRepN","thisTrialN","thisN","thisIndex","stepSizeCurrent","ran","order"];let r={};const n=e.name;for(const i in e)if(t.includes(i)){r["stepSizeCurrent"===i?n+".stepSize":n+"."+i]=e[i]}if("function"==typeof e.getCurrentTrial){const t=e.getCurrentTrial();for(const e in t)r[e]=t[e]}return r}_orderOutput(e,t){if(0===e.length||0===t.length||!this._psychoJS)return{data:e,attributes:t};const r=[...this._psychoJS.inputParameters],n=["expName","name","blockNumber","_s","setSession","targetMeasuredDurationFrames","label","!experimentFilename"];t=t.filter((e=>!n.includes(e)));const i=["URL","experiment","date"],a=r.filter((e=>t.includes(e))),o=t.filter((e=>!r.includes(e)&&!i.includes(e))),s=[...i,...a,...o],l={};for(const c of s)l[c]=null;for(let c=0;c<e.length;c++){for(const t of n)e[c].hasOwnProperty(t)&&delete e[c][t];e[c]=Object.assign({},l,e[c])}return{data:e,attributes:s}}}ExperimentHandler.SaveFormat={CSV:Symbol.for("CSV"),DATABASE:Symbol.for("DATABASE")},ExperimentHandler.Environment={SERVER:Symbol.for("SERVER"),LOCAL:Symbol.for("LOCAL")};let Scheduler$1=class e{constructor(t){this._psychoJS=t,this._taskList=[],this._currentTask=void 0,this._argsList=[],this._currentArgs=void 0,this._stopAtNextUpdate=!1,this._stopAtNextTask=!1,this._status=e.Status.STOPPED}get status(){return this._status}add(e,...t){this._taskList.push(e),this._argsList.push(t)}unshift(e,...t){this._taskList.unshift(e),this._argsList.unshift(t)}addConditional(t,r,n){const i=this;this.add((function(){return t()?i.add(r):i.add(n),e.Event.NEXT}))}async start(){const t=this,r=async n=>{if(t._stopAtNextUpdate)return void(t._status=e.Status.STOPPED);if(await t._runNextTasks()===e.Event.QUIT)return void(t._status=e.Status.STOPPED);const i=void 0===t._lastTimestamp?n:t._lastTimestamp;t._lastDelta=n-i,t._lastTimestamp=n,t._psychoJS.window.render(),requestAnimationFrame(r)};requestAnimationFrame(r)}stop(){this._status=e.Status.STOPPED,this._stopAtNextTask=!0,this._stopAtNextUpdate=!0}async _runNextTasks(){this._status=e.Status.RUNNING;let t=e.Event.NEXT;for(;t===e.Event.NEXT;){if(this._stopAtNextTask)return e.Event.QUIT;if(void 0===this._currentTask){if(!(this._taskList.length>0))return this._currentTask=void 0,this._currentArgs=void 0,e.Event.QUIT;this._currentTask=this._taskList.shift(),this._currentArgs=this._argsList.shift()}this._currentTask instanceof Function?t=await this._currentTask(...this._currentArgs):(t=await this._currentTask._runNextTasks(),t===e.Event.QUIT&&(this._psychoJS.experiment.experimentEnded||(t=e.Event.NEXT))),t!==e.Event.FLIP_REPEAT&&(this._currentTask=void 0,this._currentArgs=void 0)}return t}};Scheduler$1.Event={NEXT:Symbol.for("NEXT"),FLIP_REPEAT:Symbol.for("FLIP_REPEAT"),FLIP_NEXT:Symbol.for("FLIP_NEXT"),QUIT:Symbol.for("QUIT")},Scheduler$1.Status={RUNNING:Symbol.for("RUNNING"),STOPPED:Symbol.for("STOPPED")};const version$6="14.7.77",createExtendedExponentialRampToValueAutomationEvent=(e,t,r)=>({endTime:t,insertTime:r,type:"exponentialRampToValue",value:e}),createExtendedLinearRampToValueAutomationEvent=(e,t,r)=>({endTime:t,insertTime:r,type:"linearRampToValue",value:e}),createSetValueAutomationEvent=(e,t)=>({startTime:t,type:"setValue",value:e}),createSetValueCurveAutomationEvent=(e,t,r)=>({duration:r,startTime:t,type:"setValueCurve",values:e}),getTargetValueAtTime=(e,t,{startTime:r,target:n,timeConstant:i})=>n+(t-n)*Math.exp((r-e)/i),isExponentialRampToValueAutomationEvent=e=>"exponentialRampToValue"===e.type,isLinearRampToValueAutomationEvent=e=>"linearRampToValue"===e.type,isAnyRampToValueAutomationEvent=e=>isExponentialRampToValueAutomationEvent(e)||isLinearRampToValueAutomationEvent(e),isSetValueAutomationEvent=e=>"setValue"===e.type,isSetValueCurveAutomationEvent=e=>"setValueCurve"===e.type,getValueOfAutomationEventAtIndexAtTime=(e,t,r,n)=>{const i=e[t];return void 0===i?n:isAnyRampToValueAutomationEvent(i)||isSetValueAutomationEvent(i)?i.value:isSetValueCurveAutomationEvent(i)?i.values[i.values.length-1]:getTargetValueAtTime(r,getValueOfAutomationEventAtIndexAtTime(e,t-1,i.startTime,n),i)},getEndTimeAndValueOfPreviousAutomationEvent=(e,t,r,n,i)=>void 0===r?[n.insertTime,i]:isAnyRampToValueAutomationEvent(r)?[r.endTime,r.value]:isSetValueAutomationEvent(r)?[r.startTime,r.value]:isSetValueCurveAutomationEvent(r)?[r.startTime+r.duration,r.values[r.values.length-1]]:[r.startTime,getValueOfAutomationEventAtIndexAtTime(e,t-1,r.startTime,i)],isCancelAndHoldAutomationEvent=e=>"cancelAndHold"===e.type,isCancelScheduledValuesAutomationEvent=e=>"cancelScheduledValues"===e.type,getEventTime=e=>isCancelAndHoldAutomationEvent(e)||isCancelScheduledValuesAutomationEvent(e)?e.cancelTime:isExponentialRampToValueAutomationEvent(e)||isLinearRampToValueAutomationEvent(e)?e.endTime:e.startTime,getExponentialRampValueAtTime=(e,t,r,{endTime:n,value:i})=>r===i?i:0<r&&0<i||r<0&&i<0?r*(i/r)**((e-t)/(n-t)):0,getLinearRampValueAtTime=(e,t,r,{endTime:n,value:i})=>r+(e-t)/(n-t)*(i-r),interpolateValue=(e,t)=>{const r=Math.floor(t),n=Math.ceil(t);return r===n?e[r]:(1-(t-r))*e[r]+(1-(n-t))*e[n]},getValueCurveValueAtTime=(e,{duration:t,startTime:r,values:n})=>{const i=(e-r)/t*(n.length-1);return interpolateValue(n,i)},isSetTargetAutomationEvent=e=>"setTarget"===e.type;class AutomationEventList{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=getEventTime(e);if(isCancelAndHoldAutomationEvent(e)||isCancelScheduledValuesAutomationEvent(e)){const r=this._automationEvents.findIndex((r=>isCancelScheduledValuesAutomationEvent(e)&&isSetValueCurveAutomationEvent(r)?r.startTime+r.duration>=t:getEventTime(r)>=t)),n=this._automationEvents[r];if(-1!==r&&(this._automationEvents=this._automationEvents.slice(0,r)),isCancelAndHoldAutomationEvent(e)){const e=this._automationEvents[this._automationEvents.length-1];if(void 0!==n&&isAnyRampToValueAutomationEvent(n)){if(isSetTargetAutomationEvent(e))throw new Error("The internal list is malformed.");const r=isSetValueCurveAutomationEvent(e)?e.startTime+e.duration:getEventTime(e),i=isSetValueCurveAutomationEvent(e)?e.values[e.values.length-1]:e.value,a=isExponentialRampToValueAutomationEvent(n)?getExponentialRampValueAtTime(t,r,i,n):getLinearRampValueAtTime(t,r,i,n),o=isExponentialRampToValueAutomationEvent(n)?createExtendedExponentialRampToValueAutomationEvent(a,t,this._currenTime):createExtendedLinearRampToValueAutomationEvent(a,t,this._currenTime);this._automationEvents.push(o)}void 0!==e&&isSetTargetAutomationEvent(e)&&this._automationEvents.push(createSetValueAutomationEvent(this.getValue(t),t)),void 0!==e&&isSetValueCurveAutomationEvent(e)&&e.startTime+e.duration>t&&(this._automationEvents[this._automationEvents.length-1]=createSetValueCurveAutomationEvent(new Float32Array([6,7]),e.startTime,t-e.startTime))}}else{const r=this._automationEvents.findIndex((e=>getEventTime(e)>t)),n=-1===r?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[r-1];if(void 0!==n&&isSetValueCurveAutomationEvent(n)&&getEventTime(n)+n.duration>t)return!1;const i=isExponentialRampToValueAutomationEvent(e)?createExtendedExponentialRampToValueAutomationEvent(e.value,e.endTime,this._currenTime):isLinearRampToValueAutomationEvent(e)?createExtendedLinearRampToValueAutomationEvent(e.value,t,this._currenTime):e;if(-1===r)this._automationEvents.push(i);else{if(isSetValueCurveAutomationEvent(e)&&t+e.duration>getEventTime(this._automationEvents[r]))return!1;this._automationEvents.splice(r,0,i)}}return!0}flush(e){const t=this._automationEvents.findIndex((t=>getEventTime(t)>e));if(t>1){const e=this._automationEvents.slice(t-1),r=e[0];isSetTargetAutomationEvent(r)&&e.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=e}}getValue(e){if(0===this._automationEvents.length)return this._defaultValue;const t=this._automationEvents.findIndex((t=>getEventTime(t)>e)),r=this._automationEvents[t],n=(-1===t?this._automationEvents.length:t)-1,i=this._automationEvents[n];if(void 0!==i&&isSetTargetAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)||r.insertTime>e))return getTargetValueAtTime(e,getValueOfAutomationEventAtIndexAtTime(this._automationEvents,n-1,i.startTime,this._defaultValue),i);if(void 0!==i&&isSetValueAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)))return i.value;if(void 0!==i&&isSetValueCurveAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)||i.startTime+i.duration>e))return e<i.startTime+i.duration?getValueCurveValueAtTime(e,i):i.values[i.values.length-1];if(void 0!==i&&isAnyRampToValueAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)))return i.value;if(void 0!==r&&isExponentialRampToValueAutomationEvent(r)){const[t,a]=getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents,n,i,r,this._defaultValue);return getExponentialRampValueAtTime(e,t,a,r)}if(void 0!==r&&isLinearRampToValueAutomationEvent(r)){const[t,a]=getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents,n,i,r,this._defaultValue);return getLinearRampValueAtTime(e,t,a,r)}return this._defaultValue}}const createCancelAndHoldAutomationEvent=e=>({cancelTime:e,type:"cancelAndHold"}),createCancelScheduledValuesAutomationEvent=e=>({cancelTime:e,type:"cancelScheduledValues"}),createExponentialRampToValueAutomationEvent=(e,t)=>({endTime:t,type:"exponentialRampToValue",value:e}),createLinearRampToValueAutomationEvent=(e,t)=>({endTime:t,type:"linearRampToValue",value:e}),createSetTargetAutomationEvent=(e,t,r)=>({startTime:t,target:e,timeConstant:r,type:"setTarget"}),createAbortError=()=>new DOMException("","AbortError"),createAddActiveInputConnectionToAudioNode=e=>(t,r,[n,i,a],o)=>{e(t[i],[r,n,a],(e=>e[0]===r&&e[1]===n),o)},createAddAudioNodeConnections=e=>(t,r,n)=>{const i=[];for(let e=0;e<n.numberOfInputs;e+=1)i.push(new Set);e.set(t,{activeInputs:i,outputs:new Set,passiveInputs:new WeakMap,renderer:r})},createAddAudioParamConnections=e=>(t,r)=>{e.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:r})},ACTIVE_AUDIO_NODE_STORE=new WeakSet,AUDIO_NODE_CONNECTIONS_STORE=new WeakMap,AUDIO_NODE_STORE=new WeakMap,AUDIO_PARAM_CONNECTIONS_STORE=new WeakMap,AUDIO_PARAM_STORE=new WeakMap,CONTEXT_STORE=new WeakMap,EVENT_LISTENERS=new WeakMap,CYCLE_COUNTERS=new WeakMap,NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS=new WeakMap,NODE_TO_PROCESSOR_MAPS=new WeakMap,handler={construct:()=>handler},isConstructible=e=>{try{new new Proxy(e,handler)}catch{return!1}return!0},IMPORT_STATEMENT_REGEX=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,splitImportStatements=(e,t)=>{const r=[];let n=e.replace(/^[\s]+/,""),i=n.match(IMPORT_STATEMENT_REGEX);for(;null!==i;){const e=i[1].slice(1,-1),a=i[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());r.push(a),n=n.slice(i[0].length).replace(/^[\s]+/,""),i=n.match(IMPORT_STATEMENT_REGEX)}return[r.join(";"),n]},verifyParameterDescriptors=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},verifyProcessorCtor=e=>{if(!isConstructible(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},createAddAudioWorkletModule=(e,t,r,n,i,a,o,s,l,c,u,d,h)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const _=u.get(f);if(void 0!==_&&_.has(m))return Promise.resolve();const y=c.get(f);if(void 0!==y){const e=y.get(m);if(void 0!==e)return e}const b=a(f),v=void 0===b.audioWorklet?i(m).then((([e,t])=>{const[n,i]=splitImportStatements(e,t);return r(`${n};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${i}
|
|
1
|
+
let getAugmentedNamespace;let __tla=(async()=>{!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68aa853a-0cd5-47e7-a10b-1f521a4eccf3",e._sentryDebugIdIdentifier="sentry-dbid-68aa853a-0cd5-47e7-a10b-1f521a4eccf3")}catch(e){}}();const DEBUG_BUILD$1="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,GLOBAL_OBJ$1=globalThis,SDK_VERSION$2="10.38.0";function getMainCarrier$1(){return getSentryCarrier$1(GLOBAL_OBJ$1),GLOBAL_OBJ$1}function getSentryCarrier$1(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||SDK_VERSION$2,t[SDK_VERSION$2]=t[SDK_VERSION$2]||{}}function getGlobalSingleton$1(e,t,r=GLOBAL_OBJ$1){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[SDK_VERSION$2]=n[SDK_VERSION$2]||{};return i[e]||(i[e]=t())}const PREFIX$1="Sentry Logger ",originalConsoleMethods$1={};function consoleSandbox$1(e){if(!("console"in GLOBAL_OBJ$1))return e();const t=GLOBAL_OBJ$1.console,r={},n=Object.keys(originalConsoleMethods$1);n.forEach((e=>{const n=originalConsoleMethods$1[e];r[e]=t[e],t[e]=n}));try{return e()}finally{n.forEach((e=>{t[e]=r[e]}))}}function enable$2(){_getLoggerSettings$1().enabled=!0}function disable$1(){_getLoggerSettings$1().enabled=!1}function isEnabled$1(){return _getLoggerSettings$1().enabled}function log$4(...e){_maybeLog$1("log",...e)}function warn$3(...e){_maybeLog$1("warn",...e)}function error$2(...e){_maybeLog$1("error",...e)}function _maybeLog$1(e,...t){DEBUG_BUILD$1&&isEnabled$1()&&consoleSandbox$1((()=>{GLOBAL_OBJ$1.console[e](`${PREFIX$1}[${e}]:`,...t)}))}function _getLoggerSettings$1(){return DEBUG_BUILD$1?getGlobalSingleton$1("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const debug$2={enable:enable$2,disable:disable$1,isEnabled:isEnabled$1,log:log$4,warn:warn$3,error:error$2},objectToString$3=Object.prototype.toString;function isBuiltin$1(e,t){return objectToString$3.call(e)===`[object ${t}]`}function isPlainObject$3(e){return isBuiltin$1(e,"Object")}function isThenable$3(e){return Boolean(e?.then&&"function"==typeof e.then)}function addNonEnumerableProperty$1(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{DEBUG_BUILD$1&&debug$2.log(`Failed to add non-enumerable property "${t}" to object`,e)}}let RESOLVED_RUNNER,emptyUuid$1;function withRandomSafeContext(e){if(void 0!==RESOLVED_RUNNER)return RESOLVED_RUNNER?RESOLVED_RUNNER(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=GLOBAL_OBJ$1;return t in r&&"function"==typeof r[t]?(RESOLVED_RUNNER=r[t],RESOLVED_RUNNER(e)):(RESOLVED_RUNNER=null,e())}function safeMathRandom(){return withRandomSafeContext((()=>Math.random()))}function safeDateNow(){return withRandomSafeContext((()=>Date.now()))}function truncate$2(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function getCrypto$1(){const e=GLOBAL_OBJ$1;return e.crypto||e.msCrypto}function getRandomByte$1(){return 16*safeMathRandom()}function uuid4$1(e=getCrypto$1()){try{if(e?.randomUUID)return withRandomSafeContext((()=>e.randomUUID())).replace(/-/g,"")}catch{}return emptyUuid$1||(emptyUuid$1=[1e7]+1e3+4e3+8e3+1e11),emptyUuid$1.replace(/[018]/g,(e=>(e^(15&getRandomByte$1())>>e/4).toString(16)))}const ONE_SECOND_IN_MS$1=1e3;function dateTimestampInSeconds$1(){return safeDateNow()/ONE_SECOND_IN_MS$1}function createUnixTimestampInSecondsFunc$1(){const{performance:e}=GLOBAL_OBJ$1;if(!e?.now||!e.timeOrigin)return dateTimestampInSeconds$1;const t=e.timeOrigin;return()=>(t+withRandomSafeContext((()=>e.now())))/ONE_SECOND_IN_MS$1}let _cachedTimestampInSeconds$1;function timestampInSeconds$1(){return(_cachedTimestampInSeconds$1??(_cachedTimestampInSeconds$1=createUnixTimestampInSecondsFunc$1()))()}function updateSession$1(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||timestampInSeconds$1(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:uuid4$1()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function merge$4(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&0===Object.keys(t).length)return e;const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=merge$4(n[i],t[i],r-1));return n}function generateTraceId$1(){return uuid4$1()}const SCOPE_SPAN_FIELD$1="_sentrySpan";function _setSpanForScope$1(e,t){t?addNonEnumerableProperty$1(e,SCOPE_SPAN_FIELD$1,t):delete e[SCOPE_SPAN_FIELD$1]}function _getSpanForScope$1(e){return e[SCOPE_SPAN_FIELD$1]}const DEFAULT_MAX_BREADCRUMBS$1=100;let Scope$1=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId$1(),sampleRand:safeMathRandom()}}clone(){const t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,_setSpanForScope$1(t,_getSpanForScope$1(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession$1(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const r="function"==typeof t?t(this):t,n=r instanceof e?r.getScopeData():isPlainObject$3(r)?t:void 0,{tags:i,attributes:a,extra:o,user:s,contexts:l,level:c,fingerprint:u=[],propagationContext:d,conversationId:h}=n||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...a},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),h&&(this._conversationId=h),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,_setSpanForScope$1(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId$1(),sampleRand:safeMathRandom()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:DEFAULT_MAX_BREADCRUMBS$1;if(r<=0)return this;const n={timestamp:dateTimestampInSeconds$1(),...e,message:e.message?truncate$2(e.message,2048):e.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope$1(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=merge$4(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t?.event_id||uuid4$1();if(!this._client)return DEBUG_BUILD$1&&debug$2.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r?.event_id||uuid4$1();if(!this._client)return DEBUG_BUILD$1&&debug$2.warn("No client configured on scope - will not capture message!"),n;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=t?.event_id||uuid4$1();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(DEBUG_BUILD$1&&debug$2.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}};function getDefaultCurrentScope$1(){return getGlobalSingleton$1("defaultCurrentScope",(()=>new Scope$1))}function getDefaultIsolationScope$1(){return getGlobalSingleton$1("defaultIsolationScope",(()=>new Scope$1))}let AsyncContextStack$1=class{constructor(e,t){let r,n;r=e||new Scope$1,n=t||new Scope$1,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(n){throw this._popScope(),n}return isThenable$3(r)?r.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function getAsyncContextStack$1(){const e=getSentryCarrier$1(getMainCarrier$1());return e.stack=e.stack||new AsyncContextStack$1(getDefaultCurrentScope$1(),getDefaultIsolationScope$1())}function withScope$1(e){return getAsyncContextStack$1().withScope(e)}function withSetScope$1(e,t){const r=getAsyncContextStack$1();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function withIsolationScope$1(e){return getAsyncContextStack$1().withScope((()=>e(getAsyncContextStack$1().getIsolationScope())))}function getStackAsyncContextStrategy$1(){return{withIsolationScope:withIsolationScope$1,withScope:withScope$1,withSetScope:withSetScope$1,withSetIsolationScope:(e,t)=>withIsolationScope$1(t),getCurrentScope:()=>getAsyncContextStack$1().getScope(),getIsolationScope:()=>getAsyncContextStack$1().getIsolationScope()}}function getAsyncContextStrategy$1(e){const t=getSentryCarrier$1(e);return t.acs?t.acs:getStackAsyncContextStrategy$1()}function getCurrentScope$1(){return getAsyncContextStrategy$1(getMainCarrier$1()).getCurrentScope()}function parseEventHintOrCaptureContext$1(e){if(e)return hintIsScopeOrFunction$1(e)||hintIsScopeContext$1(e)?{captureContext:e}:e}function hintIsScopeOrFunction$1(e){return e instanceof Scope$1||"function"==typeof e}const captureContextKeys$1=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function hintIsScopeContext$1(e){return Object.keys(e).some((e=>captureContextKeys$1.includes(e)))}function captureException$1(e,t){return getCurrentScope$1().captureException(e,parseEventHintOrCaptureContext$1(t))}const SENSITIVE_KEY$1=/token|authorization|password|secret|spreadsheet|workbook|content|participant/i,sanitize$1=(e,t=0)=>t>4?"[Truncated]":null==e?e:"string"==typeof e?e.replace(/(access_token|oauthToken|authorization)=([^&\s]+)/gi,"$1=[Filtered]").replace(/Bearer\s+[A-Za-z0-9._~-]+/gi,"Bearer [Filtered]"):["number","boolean"].includes(typeof e)?e:Array.isArray(e)?e.slice(0,50).map((e=>sanitize$1(e,t+1))):"object"!=typeof e?String(e):Object.fromEntries(Object.entries(e).map((([e,r])=>[e,SENSITIVE_KEY$1.test(e)?"[Filtered]":sanitize$1(r,t+1)])));function captureError$1(e,t="",r={}){console.error(t,e),captureException$1(e,{tags:{context:t},extra:sanitize$1(r)})}function mulberry32(e){let t=e>>>0;return function(){t|=0,t=t+0x6d2b79f5|0;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/0x100000000}}function selectTypedResponse(e,t=Math.random){const r=e.validCharsTyped.split(""),n=e.correctResponse??r[0];switch(e.simulationModel??"right"){case"right":case"ideal":default:return n;case"wrong":{const e=r.filter((e=>e!==n));return e.length>0?e[Math.floor(t()*e.length)]:n}case"blind":return r[Math.floor(t()*r.length)];case"weibull":{const i=parseFloat(e.trialLevel??"0"),a=Math.log10(parseFloat(e.simulationThreshold??"2")),o=parseFloat(e.simulationBeta??"2.3"),s=parseFloat(e.simulationDelta??"0.01"),l=parseFloat(e.thresholdProportionCorrect??"0.816");if(isNaN(i)||isNaN(a)||isNaN(o)||isNaN(s)||isNaN(l))return console.warn(`[sim:weibull] NaN param — trialLevel=${e.trialLevel} threshold=${e.simulationThreshold} beta=${e.simulationBeta} delta=${e.simulationDelta} tpc=${e.thresholdProportionCorrect}. Falling back to blind.`),r[Math.floor(t()*r.length)];const c=1/r.length,u=i-a+Math.log10(-Math.log(-(l-s*c)/(1-s)+1)/(1-c))/o,d=s*c+(1-s)*(1-(1-c)*Math.exp(-Math.pow(10,o*u)));if(t()<d)return n;const h=r.filter((e=>e!==n));return h.length>0?h[Math.floor(t()*h.length)]:n}}}function selectClickedIndex(e,t,r=Math.random){const n=t.simulationModel??"right",i=t.correctResponse?.toLowerCase()??null,a=i?e.findIndex((e=>e.toLowerCase()===i)):-1;switch(n){case"right":case"ideal":return a>=0?a:Math.floor(r()*e.length);case"wrong":{const t=e.map(((e,t)=>t)).filter((e=>e!==a));return t.length>0?t[Math.floor(r()*t.length)]:0}case"blind":return Math.floor(r()*e.length);case"weibull":{const n=selectTypedResponse(t,r),i=e.findIndex((e=>e.toLowerCase()===n.toLowerCase()));return i>=0?i:0}default:return a>=0?a:0}}let masterSeed=null,seedSource="unseeded",initAttempted=!1;const streams=new Map;function hash32(e){let t=0x811c9dc5;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,0x1000193);return t>>>0}function substreamSeed(e){return(masterSeed^hash32(e))>>>0}function initRng(e,t){masterSeed=e>>>0,seedSource=t,streams.clear(),initAttempted=!0}function ensureInit(){if(initAttempted||"undefined"==typeof window)return void(initAttempted=!0);initAttempted=!0;const e=window;if("number"==typeof e.__SIM_SEED__&&Number.isFinite(e.__SIM_SEED__))return void initRng(e.__SIM_SEED__,"sim");const t=new URLSearchParams(window.location.search).get("rngSeed");null!==t&&""!==t&&Number.isFinite(Number(t))&&initRng(Number(t),"url")}function getSeedSource(){return ensureInit(),seedSource}function getMasterSeed(){return ensureInit(),masterSeed}function random$1(e="misc"){if(ensureInit(),null===masterSeed)return Math.random();let t=streams.get(e);return t||(t=mulberry32(substreamSeed(e)),streams.set(e,t)),t()}function rngFor(e){return()=>random$1(e)}function handlerSeed(e){return ensureInit(),null===masterSeed?Math.floor(Math.random()*2**31):substreamSeed(e)}const BASE_DELAY_SEC=.2,MAX_DELAY_SEC=30,wait=e=>new Promise((t=>setTimeout(t,e))),getRetryDelayMs=e=>1e3*Math.min(BASE_DELAY_SEC*Math.pow(1.75,e),MAX_DELAY_SEC)*(.8+.4*Math.random()),waitForRetryDelay=e=>{const t=globalThis.window;return t?.addEventListener?new Promise((r=>{const n=()=>{clearTimeout(i),t.removeEventListener?.("online",n),r()},i=setTimeout(n,e);t.addEventListener("online",n)})):wait(e)};let retryObserver=null;const setRetryObserver=e=>{retryObserver=e},notifyRetryAttempt=(e,t={})=>{try{retryObserver?.(e,t)}catch(r){}};let registry$2=null;function initPhrases(e){registry$2=e}function getPhrases(){if(null===registry$2)throw new Error("getPhrases() called before initPhrases()");return registry$2.phrases}const LOCALHOST_BASE_URL="http://localhost:8888",PRODUCTION_BASE_URL="https://easyeyes.app";let localhostBaseUrlPromise;const resolveLocalhostBaseUrl=async()=>{try{return await fetch(LOCALHOST_BASE_URL,{method:"HEAD",mode:"no-cors"}),LOCALHOST_BASE_URL}catch{return PRODUCTION_BASE_URL}},getEasyEyesBaseUrl=async()=>{const e=new URLSearchParams(window.location.search).get("preview-deploy");return e||(/--easyeyes\.netlify\.app$/.test(window.location.hostname)?window.location.origin:"localhost"!==window.location.hostname?PRODUCTION_BASE_URL:(localhostBaseUrlPromise||(localhostBaseUrlPromise=resolveLocalhostBaseUrl()),localhostBaseUrlPromise))};async function loadPhrases(e){const[t,r]=e.split("/").filter(Boolean),n=await getEasyEyesBaseUrl(),i=`${n}/.netlify/functions/phrases?pinned=${t}/${r}`;let a,o=0;for(;;){let e;try{e=await fetch(i)}catch{await wait(getRetryDelayMs(o++));continue}if(404!==e.status){if(e.ok){a=(await e.json()).version;break}await wait(getRetryDelayMs(o++))}else{if("No pinned version"===(await e.json()).error)throw new Error(`No phrasesVersion pinned for ${t}/${r}. Recompile the experiment.`);await wait(getRetryDelayMs(o++))}}const s=`${n}/.netlify/functions/phrases?v=${a}`;for(;;){let e;try{e=await fetch(s)}catch{await wait(getRetryDelayMs(o++));continue}if(!e.ok){await wait(getRetryDelayMs(o++));continue}const t=await e.json();return initPhrases(t),t}}const phrasesData=await loadPhrases(window.location.pathname);let DefaultMap$1=class extends Map{constructor(e,t){super(t),this.default=e}get(e){return this.has(e)||this.set(e,this.default()),super.get(e)}};const status={block:0,nthBlock:void 0,trial:void 0,block_condition:void 0,condition:void 0,trialCorrect_thisBlock:0,trialCompleted_thisBlock:0,trialAttempted_thisBlock:0,nthTrialCorrectThisBlockByCondition:new DefaultMap$1((()=>0),null),nthTrialCompletedThisBlockByCondition:new DefaultMap$1((()=>0),null),nthTrialByCondition:new DefaultMap$1((()=>1),null),nthTrialAttemptedByCondition:new DefaultMap$1((()=>0),null),currentFunction:"",terminated:!1,retryThisTrialBool:!1,consentGiven:void 0},withBreadcrumb=async(e,t)=>{const r=status.currentFunction;status.currentFunction=e;try{return await t()}finally{status.currentFunction=r}},resetBlockScopedStatus=()=>{status.trial=void 0,status.block_condition=void 0,status.condition=void 0,status.trialCorrect_thisBlock=0,status.trialCompleted_thisBlock=0,status.trialAttempted_thisBlock=0,status.nthTrialCorrectThisBlockByCondition.clear(),status.nthTrialCompletedThisBlockByCondition.clear(),status.nthTrialByCondition.clear(),status.nthTrialAttemptedByCondition.clear(),status.currentFunction="",status.retryThisTrialBool=!1};class DefaultMap extends Map{constructor(e,t){super(t),this.default=e}get(e){return this.has(e)||this.set(e,this.default()),super.get(e)}}const thisExperimentInfo={name:"threshold",expName:"threshold",psychopyVersion:void 0,participant:void 0,_s:1,EasyEyesID:void 0,PavloviaSessionID:void 0,actualPavloviaSessionID:void 0,ProlificParticipantID:void 0,ProlificSessionID:void 0,ProlificStudyID:void 0,experimentFilename:void 0,experiment:void 0,date:void 0,hardwareConcurrency:void 0,deviceType:void 0,deviceSystem:void 0,deviceSystemFamily:void 0,deviceBrowser:void 0,deviceBrowserVersion:void 0,deviceLanguage:void 0,psychojsWindowDimensions:void 0,monitorFrameRate:void 0,get session(){return this._s.toString().padStart(4,"0")},set session(e){},setSession(e){this._s=e}},localStorageKey="__EASYEYES__",_key_resp_allKeys={current:[]},_key_resp_event_handlers={current:[]},handler$1={set:function(e,t,r){return e[t]=r,_key_resp_event_handlers.current.forEach((e=>e(r))),!0}},proxyVariable_key_resp_allKeys=new Proxy(_key_resp_allKeys.current,handler$1);if("undefined"==typeof RemoteCalibrator){const e="RemoteCalibrator resource failed to load.",t="Please check your internet connection and refresh the page.";throw window.showCriticalLoadError?window.showCriticalLoadError(e,t):setTimeout((()=>window.showCriticalLoadError?.(e,t)),50),new Error("RemoteCalibrator is not defined")}const rc=RemoteCalibrator;await rc.init({languagePhrasesJSON:phrasesData.phrases},void 0,{easyEyesKeypadHandler:{event_handlers:_key_resp_event_handlers,all_keys:_key_resp_allKeys}});const websiteRepoLastCommitDeploy={current:void 0};await fetch("CompatibilityRequirements.txt").then((e=>e?.ok?e.json():"")).then((e=>{e&&e.compilerUpdateDate&&(websiteRepoLastCommitDeploy.current=e.compilerUpdateDate)})).catch((e=>{}));const stats={current:void 0,on:!1},usingGaze={current:void 0};Object.seal({window:void 0,windowWidthCm:void 0,windowWidthPx:void 0,pixPerCm:void 0,nearPointXYDeg:[void 0,void 0],nearPointXYPix:[void 0,void 0]});const grid={current:void 0,units:void 0},totalBlocks={current:void 0},totalTrialsThisBlock={current:void 0},blockOrder={current:void 0},targetTask={current:void 0},targetKind={current:void 0},correctAns={current:[]},font={name:void 0,source:void 0,direction:"ltr",language:"en",punctuationRTL:"none",colorRGBA:void 0,padding:void 0,letterSpacing:0,kerning:void 0,textRendering:void 0,featureSettings:void 0,variantLigatures:void 0,medialShapeResponse:void 0,medialShapeTarget:void 0,fontPositionalShapeResponse:void 0},typekit={kitId:void 0,fonts:new Map},fontCharacterSet={current:void 0,where:void 0},showTimingBarsBool={current:!1},screenBackground={defaultColorRGBA:"0.933,0.933,0.933,1",colorRGBA:void 0},measureMeters={canMeasureMeters:0,needMeasureMeters:0},targetEccentricityDeg={x:void 0,y:void 0},showConditionNameConfig$1={name:void 0,show:!1,targetSpecs:void 0,showTargetSpecs:!1},letterConfig=Object.seal({targetDurationSec:void 0,targetSizeIsHeightBool:void 0,targetMinimumPix:void 0,targetSizeDeg:void 0,targetCharacter:void 0,targetEccentricityXYDeg:[void 0,void 0],thresholdParameter:void 0,spacingDirection:void 0,spacingSymmetry:void 0,spacingOverSizeRatio:void 0,spacingRelationToSize:void 0,flankerCharacters:[void 0,void 0],delayBeforeStimOnsetSec:void 0,targetSafetyMarginSec:void 0,markingOnsetAfterTargetOffsetSecs:void 0,flankerXYDegs:[],thresholdAllowedBlackoutBool:void 0,fontMaxPxShrinkage:1,useFontMaxPxShrinkageBool:!1,currentNominalFontSize:void 0,fontMaxPx:void 0,responseMaxOptions:99}),imageFolders={folders:new Map},imageConfig=Object.seal({targetSizeDeg:0,targetDurationSec:0,targetEccentricityXDeg:0,targetEccentricityYDeg:0,thresholdParameter:"",targetSizeIsHeightBool:!1,targetImageFolder:"",targetImageReplacementBool:!1,currentImageFileName:"",currentImageFile:void 0,delayAfterStimOnsetSec:0,delayBeforeStimOnsetSec:0,responseMaxOptions:99,responsePositiveFeedbackBool:!0,currentImageFullFileName:"",targetImageExclude:"none",targetImageFoilsExclude:"none",targetImageSpareFraction:0,targetImageWhere:"top"}),pastImages={targets:new Map,foils:new Map},imageQuestionAndAnswer=Object.seal({current:{}}),repeatedLettersConfig=Object.seal({targetRepeatsBorderCharacter:void 0,targetRepeatsMaxLines:void 0,stims:void 0,level:void 0,stimulusParameters:void 0}),repeatedLettersResponse=Object.seal({current:[],clickTime:[],rt:[],correct:[]}),instructionFont={current:void 0},customInstructionText={current:void 0},tolerances=Object.seal({allowed:{thresholdAllowedDurationRatio:void 0,thresholdAllowedGazeXErrorDeg:void 0,thresholdAllowedGazeYErrorDeg:void 0,thresholdAllowedGazeRErrorDeg:void 0,thresholdAllowedLatenessSec:void 0},measured:{thresholdDurationRatio:void 0,gazeMeasuredXDeg:void 0,gazeMeasuredYDeg:void 0,gazeMeasuredRDeg:void 0,gazeMeasuredRawDeg:[],gazeMeasurementLatencySec:void 0,targetMeasuredLatenessSec:void 0,targetMeasuredDurationSec:void 0,targetMeasuredDurationFrames:void 0,targetMeasuredPreRenderSec:void 0}}),skipTrialOrBlock={blockId:null,trialId:null,skipTrial:!1,skipBlock:!1,restartBlock:!1},timing=Object.seal({clickToStimulusOnsetSec:void 0,stimulusOnsetToOffset:void 0}),letterTiming=Object.seal({trialFirstFrameSec:void 0,targetStartSec:void 0,targetFinishSec:void 0,targetDrawnConfirmedTimestamp:void 0,crosshairClickedTimestamp:void 0,targetRequestedTimestamp:void 0,blackoutDetectedBool:!1,preRenderStartSec:void 0,preRenderEndSec:void 0,preRenderOpacifyStartSec:void 0,preRenderOpacifyEndSec:void 0}),letterHeapData={heapUsedBeforeDrawingMB:void 0,heapTotalBeforeDrawingMB:void 0,heapLimitBeforeDrawingMB:void 0,heapUsedAfterDrawingMB:void 0,heapTotalAfterDrawingMB:void 0,heapLimitAfterDrawingMB:void 0,heapTotalPreLatenessMB:void 0,heapTotalPostLatenessMB:void 0},viewingDistanceCm={current:40,desired:40,max:40},responseType={current:2,original:2,numberOfResponses:1},clickedContinue={current:!1,timestamps:[]},showCharacterSetResponse={current:[],onsetTime:[],clickTime:[],alreadyClickedCharacters:[]},phraseIdentificationResponse=Object.seal({current:[],correct:[],targetWord:[],categoriesResponded:[],onsetTime:void 0,onsetT:void 0,clickTime:[]}),markingShowCursorBool={current:!0},readingCorpusArchive={},readingWordListArchive={},readingWordFrequencyArchive={},readingFrequencyToWordArchive={},readingCorpusFoilsArchive=new DefaultMap((()=>[])),readingCorpusPastTargets=new Set,readingCorpusPastFoils=new Set,readingUsedText={},readingThisBlockPages=new DefaultMap((()=>[])),readingPageIndex={current:0},readingQuestions={current:void 0},readingCurrentQuestionIndex={current:0},readingClickableAnswersSetup={current:!1},readingClickableAnswersUpdate={current:!1},readingConfig={height:void 0,actualLinesPerPage:void 0},readingTiming=Object.seal({onsets:[]}),readingPageStats=Object.seal({readingPageSkipCorpusWords:new DefaultMap((()=>[])),readingPageDurationSec:new DefaultMap((()=>[])),readingPageLines:new DefaultMap((()=>[])),readingPageWords:new DefaultMap((()=>[])),readingPageNonblankCharacters:new DefaultMap((()=>[]))}),readingCorpusDepleted=new DefaultMap((()=>!1)),readingLineLengthUnit=new DefaultMap((()=>"character")),questionsThisBlock={current:[]},qaPlanThisBlock={current:null},uniComponentConfig={text:"",units:"pix",alignHoriz:"left",ori:0,opacity:1,isInstruction:!1},instructionsConfig={...uniComponentConfig,height:25,wrapWidth:.8*window.innerWidth,depth:-12,isInstruction:!0},conditionNameConfig={...uniComponentConfig,height:30,wrapWidth:window.innerWidth,depth:-20,name:"conditionName",alignVert:"bottom",pos:[-window.innerWidth/2,-window.innerHeight/2],autoDraw:!1},targetSpecsConfig$1={...uniComponentConfig,height:20,wrapWidth:window.innerWidth,depth:-21,name:"targetSpecs",alignVert:"bottom",pos:[-window.innerWidth/2,-window.innerHeight/2],autoDraw:!1},trialCounterConfig={...uniComponentConfig,height:20,wrapWidth:window.innerWidth,depth:-22,name:"trialCounter",alignVert:"bottom",alignHoriz:"right",pos:[window.innerWidth/2,-window.innerHeight/2],autoDraw:!1},targetTextStimConfig={text:"",font:"Arial",units:"pix",pos:[0,0],height:1,wrapWidth:void 0,ori:0,opacity:1,depth:-7,alignVert:"center",alignHoriz:"center",isInstruction:!1,medialForm:!1},deviceType={isSmartphone:!1,isLoudspeaker:!0,isParticipant:!1,profileFetchedFromLibrary:!1,showSystemCorrection:!0},targetIsPresentBool={current:void 0},ProposedVolumeLevelFromQuest={current:void 0,adjusted:void 0},maskerVolumeDbSPL={current:void 0},soundGainDBSPL={current:void 0},invertedImpulseResponse={current:void 0},whiteNoiseLevel={current:void 0},maskerSoundFolder={current:void 0},targetSoundFolder={current:void 0},targetSoundListFiles={},targetSoundListMap={},targetSoundListTrialData={left:void 0,right:void 0,targetVolume:void 0,whiteNoiseLevel:void 0,trialSound:void 0},speechInNoiseTargetList={current:void 0},speechInNoiseShowClickable={current:!0},vocoderPhrases={targetPhrase:void 0,maskerPhrase:void 0},actualSamplingRate={current:""},actualBitsPerSample={current:""},microphoneActualSamplingRate={current:""},vocoderPhraseCategories={chosen:void 0,all:void 0},vocoderPhraseShowClickable={current:!0},vocoderPhraseCorrectResponse={current:void 0},soundCalibrationResults={current:void 0},qualityMetrics={current:{}},sdOfRecordingOfFilteredMLS={current:void 0},currentFirestoreProfileDocumentID={microphone:void 0,loudspeaker:void 0},allHzCalibrationResults={x_unconv:void 0,y_unconv:void 0,x_conv:void 0,y_conv:void 0,knownIr:void 0,x_background:void 0,y_background:void 0,system:{},component:{},background:{},mls_psd:{},microphoneGain:{Freq:[],Gain:[]},loudspeakerGain:{Freq:[],Gain:[]},filteredMLSRange:{system:{Min:null,Max:null},component:{Min:null,Max:null}},timestamps:""},flags={current:{autoGainControl:"",echoCancellation:"",noiseSuppression:""}},calibrationRound={current:0},loudspeakerIR={Freq:[],Gain:[]},webAudioDeviceNames={loudspeaker:"",microphone:"",loudspeakerText:"",microphoneText:""},IDsToSaveInSoundProfileLibrary={ProlificParticipantID:"",PavloviaSessionID:""},parseJsonSaveTargets=e=>{const t=(e||"").toLowerCase().split(",").map((e=>e.trim())).filter(Boolean);return{wantsLocal:t.includes("local"),wantsOnline:t.includes("online")}},calibrateSoundSamplingDesiredBits={current:16},_calibrateSoundShowParametersBool={current:!0},_calibrateSoundAllHzBool={current:!1},_calibrateSoundSaveJSON={current:""},calibrateSoundSmoothOctaves={current:.3333333},calibrateSoundSmoothMinBandwidthHz={current:200},calibrateSoundPowerBinDesiredSec={current:.2},calibrateSoundPowerDbSDToleratedDb={current:1},calibrateSoundTaperSec={current:.01},calibrateSoundBackgroundSecs={current:0},calibrateSoundBurstRepeats={current:4},calibrateSoundBurstSec={current:1},_calibrateSoundBurstPreSec={current:1},_calibrateSoundBurstPostSec={current:1},calibrateSoundHz={current:48e3},calibrateSoundBurstMLSVersions={current:4},_calibrateSound1000HzBool={current:!1},_calibrateSound1000HzDB={current:"-50, -40, -30, -20, -10"},_calibrateSound1000HzSec={current:1},_calibrateSound1000HzPreSec={current:3.5},_calibrateSound1000HzPostSec={current:.5},calibrateSoundIIRSec={current:.2},calibrateSoundIIRPhase={current:"linear"},calibrateSoundIRSec={current:.2},calibrateSoundBurstDb={current:-18},calibrateSoundBurstFilteredExtraDb={current:6},calibrateSoundBurstScalarDB={current:71},calibrateSoundBurstLevelReTBool={current:!1},calibrateSoundBurstNormalizeBy1000HzGainBool={current:!1},_calibrateSound1000HzMaxSD_dB={current:4},_calibrateSound1000HzMaxTries={current:4},_calibrateSoundBurstMaxSD_dB={current:4},calibrateSoundBurstDownsample={current:1},timeoutNewPhoneSec={current:15},timeoutSoundCalibrationSec={current:1e6},calibrateSoundCheck={current:"speakerOrMic"},_calibrateSoundShowResultsBool={current:!1},_calibrateSoundShowTestPageBool={current:!1},microphoneCalibrationResults=[],microphoneCalibrationResult={current:void 0},_calibrateSoundMaxHz={current:void 0},_calibrateSoundMinHz={current:void 0},fMaxHz={system:void 0,component:void 0},calibrateSoundSimulateLoudspeaker={type:"impulseResponse",frequencies:null,gains:null,amplitudes:null,fileName:void 0,time:null,enabled:!1},calibrateSoundSimulateMicrophone={type:"impulseResponse",frequencies:null,gains:null,amplitudes:null,fileName:void 0,time:null,enabled:!1},attenuatorGainDB={system:void 0,component:void 0},debugBool={current:!1},calibrateMicrophonesBool={current:!1},rsvpReadingWordsForThisBlock={current:void 0},timeToCalibrate={current:1,timeAtTheStartOfCalibration:0,timeAtTheEndOfCalibration:0,calibrationDuration:0},calibrateSoundUMIKBase_dB={umik1:-75.11,umik2:-99.96},calibrateSoundLimit={current:1},filteredMLSAttenuation={component:1,system:1,maxAbsSystem:1,maxAbsComponent:1,attenuationDbSystem:0,attenuationDbComponent:0},micsForSoundTestPage={list:[]},thisDevice={current:void 0},gotLoudspeakerMatch={current:!1},loudspeakerInfo$1={current:{}},loudspeakerBrowserDetails={current:{browser:void 0,browserVersion:void 0}},microphoneBrowserDetails={current:{browser:void 0,browserVersion:void 0}},microphoneInfo$1={current:{}},calibrationTime={current:void 0},needPhoneSurvey={current:!1},needComputerSurveyBool={current:!1},authorEmail={current:void 0},rsvpReadingTargetSets={numberOfSets:void 0,numberOfIdentifications:void 0,identificationTargetSets:void 0,current:void 0,upcoming:[],past:[],skippedDueToBadTracking:0},rsvpReadingResponse={categories:void 0,identificationCategories:void 0,screen:void 0,displayStatus:!1,responseType:void 0,responseTypeForCurrentBlock:[]},rsvpSpeechPreflight={completed:!1,required:!1,status:"idle",block:void 0,lastFailureCode:void 0},rsvpSpeechRuntime$1={controller:void 0,status:"idle",simulated:!1,blockCondition:void 0,utteranceId:void 0,result:void 0,error:void 0,preparationStartedAtMs:void 0,readyAtMs:void 0,captureStartedAtMs:void 0,finalizationAllowedAtMs:void 0,responseRegistrationStatus:"pending",responseRegistrationError:void 0,responseDiagnostics:void 0},rsvpReadingTiming={current:{finishSec:void 0},past:[]},dummyStim={current:void 0},eyeTrackingStimulusRecords=[],cursorTracking={records:[],target:void 0},measureLuminance={records:[],movieStart:void 0,measureLuminanceDelaySec:0,measurementShouldStartAt:void 0,movieValues:[],colorimeter:void 0,currentMovieValueIndex:0,pretendBool:!1,movieSec:0},keypad={handler:void 0},thresholdParacticeUntilCorrect={doneWithPractice:new DefaultMap((()=>!1))};class MonotonicClock{constructor(e=MonotonicClock.getReferenceTime()){this._timeAtLastReset=e}getTime(){return MonotonicClock.getReferenceTime()-this._timeAtLastReset}getLastResetTime(){return this._timeAtLastReset}static getReferenceTime(){return performance.now()/1e3-MonotonicClock._referenceTime}static getDate(e="en-CA",t){const r=new Date,n=Object.assign({hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3},t);return new Intl.DateTimeFormat(e,n).format(r)}static getTimeZone(e="en-CA",t={}){const r=new Date,n=Object.assign({timeZoneName:"shortOffset"},t);return new Intl.DateTimeFormat(e,n).formatToParts(r).find((e=>"timeZoneName"===e.type)).value.replace("GMT","UTC")}static getDateStr(){return MonotonicClock.getDate().replace(", ","_").replace(":","h").replace(":",".")}}MonotonicClock._referenceTime=performance.now()/1e3;let Clock$1=class extends MonotonicClock{constructor(){super()}reset(e=0){this._timeAtLastReset=MonotonicClock.getReferenceTime()+e}add(e){this._timeAtLastReset+=e}};class CountdownTimer extends Clock$1{constructor(e=0){super(),this._timeAtLastReset=MonotonicClock.getReferenceTime(),this._countdown_duration=e,e&&this.add(e)}add(e){this._timeAtLastReset+=e}reset(e=void 0){void 0===e?this._timeAtLastReset=MonotonicClock.getReferenceTime()+this._countdown_duration:(this._countdown_duration=e,this._timeAtLastReset=MonotonicClock.getReferenceTime()+e)}getTime(){return this._timeAtLastReset-MonotonicClock.getReferenceTime()}}var commonjsGlobal$2="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}getAugmentedNamespace=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r};var log4javascript$1={exports:{}};(function(module,exports$1){!function(e,t){module.exports=e()}((function(){function isUndefined(e){return void 0===e}function EventSupport(){}Array.prototype.push||(Array.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)this[this.length]=arguments[e];return this.length}),Array.prototype.shift||(Array.prototype.shift=function(){if(this.length>0){for(var e=this[0],t=0,r=this.length-1;t<r;t++)this[t]=this[t+1];return this.length=this.length-1,e}}),Array.prototype.splice||(Array.prototype.splice=function(e,t){var r=this.slice(e+t),n=this.slice(e,e+t);this.length=e;for(var i=[],a=0,o=arguments.length;a<o;a++)i[a]=arguments[a];var s=i.length>2?r=i.slice(2).concat(r):r;for(a=0,o=s.length;a<o;a++)this.push(s[a]);return n}),EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(e){if(e instanceof Array){this.eventTypes=e,this.eventListeners={};for(var t=0,r=this.eventTypes.length;t<r;t++)this.eventListeners[this.eventTypes[t]]=[]}else handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array")},addEventListener:function(e,t){"function"==typeof t?(array_contains(this.eventTypes,e)||handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+e+"'"),this.eventListeners[e].push(t)):handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function")},removeEventListener:function(e,t){"function"==typeof t?(array_contains(this.eventTypes,e)||handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+e+"'"),array_remove(this.eventListeners[e],t)):handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function")},dispatchEvent:function(e,t){if(array_contains(this.eventTypes,e))for(var r=this.eventListeners[e],n=0,i=r.length;n<i;n++)r[n](this,e,t);else handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+e+"'")}};var applicationStartDate=new Date,uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+Math.floor(1e8*Math.random()),emptyFunction=function(){},newLine="\r\n",pageLoaded=!1;function Log4JavaScript(){}Log4JavaScript.prototype=new EventSupport;var log4javascript=new Log4JavaScript;function toStr(e){return e&&e.toString?e.toString():String(e)}function getExceptionMessage(e){return e.message?e.message:e.description?e.description:toStr(e)}function getUrlFileName(e){var t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return e.substr(t+1)}function getExceptionStringRep(e){if(e){var t="Exception: "+getExceptionMessage(e);try{e.lineNumber&&(t+=" on line number "+e.lineNumber),e.fileName&&(t+=" in file "+getUrlFileName(e.fileName))}catch(r){logLog.warn("Unable to obtain file and line information for error")}return showStackTraces&&e.stack&&(t+=newLine+"Stack trace:"+newLine+e.stack),t}return null}function bool(e){return Boolean(e)}function trim(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function splitIntoLines(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n")}log4javascript.version="1.4.13",log4javascript.edition="log4javascript";var urlEncode=void 0!==window.encodeURIComponent?function(e){return encodeURIComponent(e)}:function(e){return escape(e).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D")};function array_remove(e,t){for(var r=-1,n=0,i=e.length;n<i;n++)if(e[n]===t){r=n;break}return r>=0&&(e.splice(r,1),!0)}function array_contains(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]==t)return!0;return!1}function extractBooleanFromParam(e,t){return isUndefined(e)?t:bool(e)}function extractStringFromParam(e,t){return isUndefined(e)?t:String(e)}function extractIntFromParam(e,t){if(isUndefined(e))return t;try{var r=parseInt(e,10);return isNaN(r)?t:r}catch(n){return logLog.warn("Invalid int param "+e,n),t}}function extractFunctionFromParam(e,t){return"function"==typeof e?e:t}function isError(e){return e instanceof Error}Function.prototype.apply||(Function.prototype.apply=function(obj,args){var methodName="__apply__";void 0!==obj[methodName]&&(methodName+=String(Math.random()).substr(2)),obj[methodName]=this;for(var argsStrings=[],i=0,len=args.length;i<len;i++)argsStrings[i]="args["+i+"]";var script="obj."+methodName+"("+argsStrings.join(",")+")",returnValue=eval(script);return delete obj[methodName],returnValue}),Function.prototype.call||(Function.prototype.call=function(e){for(var t=[],r=1,n=arguments.length;r<n;r++)t[r-1]=arguments[r];return this.apply(e,t)});var logLog={quietMode:!1,debugMessages:[],setQuietMode:function(e){this.quietMode=bool(e)},numberOfErrors:0,alertAllErrors:!1,setAlertAllErrors:function(e){this.alertAllErrors=e},debug:function(e){this.debugMessages.push(e)},displayDebug:function(){alert(this.debugMessages.join(newLine))},warn:function(e,t){},error:function(e,t){if((1==++this.numberOfErrors||this.alertAllErrors)&&!this.quietMode){var r="log4javascript error: "+e;t&&(r+=newLine+newLine+"Original error: "+getExceptionStringRep(t)),alert(r)}}};function handleError(e,t){logLog.error(e,t),log4javascript.dispatchEvent("error",{message:e,exception:t})}log4javascript.logLog=logLog,log4javascript.setEventTypes(["load","error"]),log4javascript.handleError=handleError;var enabled=!("undefined"!=typeof log4javascript_disabled&&log4javascript_disabled);log4javascript.setEnabled=function(e){enabled=bool(e)},log4javascript.isEnabled=function(){return enabled};var useTimeStampsInMilliseconds=!0;log4javascript.setTimeStampsInMilliseconds=function(e){useTimeStampsInMilliseconds=bool(e)},log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds},log4javascript.evalInScope=function(expr){return eval(expr)};var showStackTraces=!1;log4javascript.setShowStackTraces=function(e){showStackTraces=bool(e)};var Level=function(e,t){this.level=e,this.name=t};function Timer(e,t){this.name=e,this.level=isUndefined(t)?Level.INFO:t,this.start=new Date}Level.prototype={toString:function(){return this.name},equals:function(e){return this.level==e.level},isGreaterOrEqual:function(e){return this.level>=e.level}},Level.ALL=new Level(Number.MIN_VALUE,"ALL"),Level.TRACE=new Level(1e4,"TRACE"),Level.DEBUG=new Level(2e4,"DEBUG"),Level.INFO=new Level(3e4,"INFO"),Level.WARN=new Level(4e4,"WARN"),Level.ERROR=new Level(5e4,"ERROR"),Level.FATAL=new Level(6e4,"FATAL"),Level.OFF=new Level(Number.MAX_VALUE,"OFF"),log4javascript.Level=Level,Timer.prototype.getElapsedTime=function(){return(new Date).getTime()-this.start.getTime()};var anonymousLoggerName="[anonymous]",defaultLoggerName="[default]",nullLoggerName="[null]",rootLoggerName="root";function Logger(e){this.name=e,this.parent=null,this.children=[];var t=[],r=null,n=this.name===rootLoggerName,i=this.name===nullLoggerName,a=null,o=!1;this.addChild=function(e){this.children.push(e),e.parent=this,e.invalidateAppenderCache()};var s=!0;this.getAdditivity=function(){return s},this.setAdditivity=function(e){var t=s!=e;s=e,t&&this.invalidateAppenderCache()},this.addAppender=function(e){i?handleError("Logger.addAppender: you may not add an appender to the null logger"):e instanceof log4javascript.Appender?array_contains(t,e)||(t.push(e),e.setAddedToLogger(this),this.invalidateAppenderCache()):handleError("Logger.addAppender: appender supplied ('"+toStr(e)+"') is not a subclass of Appender")},this.removeAppender=function(e){array_remove(t,e),e.setRemovedFromLogger(this),this.invalidateAppenderCache()},this.removeAllAppenders=function(){var e=t.length;if(e>0){for(var r=0;r<e;r++)t[r].setRemovedFromLogger(this);t.length=0,this.invalidateAppenderCache()}},this.getEffectiveAppenders=function(){if(null===a||o){var e=n||!this.getAdditivity()?[]:this.parent.getEffectiveAppenders();a=e.concat(t),o=!1}return a},this.invalidateAppenderCache=function(){o=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].invalidateAppenderCache()},this.log=function(e,t){if(enabled&&e.isGreaterOrEqual(this.getEffectiveLevel())){var r,n=t.length-1,i=t[n];t.length>1&&isError(i)&&(r=i,n--);for(var a=[],o=0;o<=n;o++)a[o]=t[o];var s=new LoggingEvent(this,new Date,e,a,r);this.callAppenders(s)}},this.callAppenders=function(e){for(var t=this.getEffectiveAppenders(),r=0,n=t.length;r<n;r++)t[r].doAppend(e)},this.setLevel=function(e){n&&null===e?handleError("Logger.setLevel: you cannot set the level of the root logger to null"):e instanceof Level?r=e:handleError("Logger.setLevel: level supplied to logger "+this.name+" is not an instance of log4javascript.Level")},this.getLevel=function(){return r},this.getEffectiveLevel=function(){for(var e=this;null!==e;e=e.parent){var t=e.getLevel();if(null!==t)return t}},this.group=function(e,t){if(enabled)for(var r=this.getEffectiveAppenders(),n=0,i=r.length;n<i;n++)r[n].group(e,t)},this.groupEnd=function(){if(enabled)for(var e=this.getEffectiveAppenders(),t=0,r=e.length;t<r;t++)e[t].groupEnd()};var l={};this.time=function(e,t){enabled&&(isUndefined(e)?handleError("Logger.time: a name for the timer must be supplied"):!t||t instanceof Level?l[e]=new Timer(e,t):handleError("Logger.time: level supplied to timer "+e+" is not an instance of log4javascript.Level"))},this.timeEnd=function(e){if(enabled)if(isUndefined(e))handleError("Logger.timeEnd: a name for the timer must be supplied");else if(l[e]){var t=l[e],r=t.getElapsedTime();this.log(t.level,["Timer "+toStr(e)+" completed in "+r+"ms"]),delete l[e]}else logLog.warn("Logger.timeEnd: no timer found with name "+e)},this.assert=function(e){if(enabled&&!e){for(var t=[],r=1,n=arguments.length;r<n;r++)t.push(arguments[r]);(t=t.length>0?t:["Assertion Failure"]).push(newLine),t.push(e),this.log(Level.ERROR,t)}},this.toString=function(){return"Logger["+this.name+"]"}}Logger.prototype={trace:function(){this.log(Level.TRACE,arguments)},debug:function(){this.log(Level.DEBUG,arguments)},info:function(){this.log(Level.INFO,arguments)},warn:function(){this.log(Level.WARN,arguments)},error:function(){this.log(Level.ERROR,arguments)},fatal:function(){this.log(Level.FATAL,arguments)},isEnabledFor:function(e){return e.isGreaterOrEqual(this.getEffectiveLevel())},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE)},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG)},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO)},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN)},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR)},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL)}},Logger.prototype.trace.isEntryPoint=!0,Logger.prototype.debug.isEntryPoint=!0,Logger.prototype.info.isEntryPoint=!0,Logger.prototype.warn.isEntryPoint=!0,Logger.prototype.error.isEntryPoint=!0,Logger.prototype.fatal.isEntryPoint=!0;var loggers={},ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG,rootLogger=new Logger(rootLoggerName);rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),log4javascript.getRootLogger=function(){return rootLogger},log4javascript.getLogger=function(e){if("string"!=typeof e&&(e=anonymousLoggerName,logLog.warn("log4javascript.getLogger: non-string logger name "+toStr(e)+" supplied, returning anonymous logger")),e==rootLoggerName&&handleError("log4javascript.getLogger: root logger may not be obtained by name"),!loggers[e]){var t=new Logger(e);loggers[e]=t;var r,n=e.lastIndexOf(".");if(n>-1){var i=e.substring(0,n);r=log4javascript.getLogger(i)}else r=rootLogger;r.addChild(t)}return loggers[e]};var defaultLogger=null;log4javascript.getDefaultLogger=function(){return defaultLogger||(defaultLogger=createDefaultLogger()),defaultLogger};var nullLogger=null;log4javascript.getNullLogger=function(){return nullLogger||(nullLogger=new Logger(nullLoggerName)).setLevel(Level.OFF),nullLogger},log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),loggers={}};var LoggingEvent=function(e,t,r,n,i){this.logger=e,this.timeStamp=t,this.timeStampInMilliseconds=t.getTime(),this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1e3),this.milliseconds=this.timeStamp.getMilliseconds(),this.level=r,this.messages=n,this.exception=i};LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):""},getCombinedMessages:function(){return 1==this.messages.length?this.messages[0]:this.messages.join(newLine)},toString:function(){return"LoggingEvent["+this.level+"]"}},log4javascript.LoggingEvent=LoggingEvent;var Layout=function(){};Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:!1,overrideTimeStampsSetting:!1,useTimeStampsInMilliseconds:null,format:function(){handleError("Layout.format: layout supplied has no format() method")},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method")},getContentType:function(){return"text/plain"},allowBatching:function(){return!0},setTimeStampsInMilliseconds:function(e){this.overrideTimeStampsSetting=!0,this.useTimeStampsInMilliseconds=bool(e)},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds},getTimeStampValue:function(e){return this.isTimeStampsInMilliseconds()?e.timeStampInMilliseconds:e.timeStampInSeconds},getDataValues:function(e,t){var r=[[this.loggerKey,e.logger.name],[this.timeStampKey,this.getTimeStampValue(e)],[this.levelKey,e.level.name],[this.urlKey,window.location.href],[this.messageKey,t?e.getCombinedMessages():e.messages]];if(this.isTimeStampsInMilliseconds()||r.push([this.millisecondsKey,e.milliseconds]),e.exception&&r.push([this.exceptionKey,getExceptionStringRep(e.exception)]),this.hasCustomFields())for(var n=0,i=this.customFields.length;n<i;n++){var a=this.customFields[n].value;"function"==typeof a&&(a=a(this,e)),r.push([this.customFields[n].name,a])}return r},setKeys:function(e,t,r,n,i,a,o){this.loggerKey=extractStringFromParam(e,this.defaults.loggerKey),this.timeStampKey=extractStringFromParam(t,this.defaults.timeStampKey),this.levelKey=extractStringFromParam(r,this.defaults.levelKey),this.messageKey=extractStringFromParam(n,this.defaults.messageKey),this.exceptionKey=extractStringFromParam(i,this.defaults.exceptionKey),this.urlKey=extractStringFromParam(a,this.defaults.urlKey),this.millisecondsKey=extractStringFromParam(o,this.defaults.millisecondsKey)},setCustomField:function(e,t){for(var r=!1,n=0,i=this.customFields.length;n<i;n++)this.customFields[n].name===e&&(this.customFields[n].value=t,r=!0);r||this.customFields.push({name:e,value:t})},hasCustomFields:function(){return this.customFields.length>0},formatWithException:function(e){var t=this.format(e);return e.exception&&this.ignoresThrowable()&&(t+=e.getThrowableStrRep()),t},toString:function(){handleError("Layout.toString: all layouts must override this method")}},log4javascript.Layout=Layout;var Appender=function(){},SimpleDateFormat;function SimpleLayout(){this.customFields=[]}function NullLayout(){this.customFields=[]}function XmlLayout(e){this.combineMessages=extractBooleanFromParam(e,!0),this.customFields=[]}function escapeNewLines(e){return e.replace(/\r\n|\r|\n/g,"\\r\\n")}function JsonLayout(e,t){this.readable=extractBooleanFromParam(e,!1),this.combineMessages=extractBooleanFromParam(t,!0),this.batchHeader=this.readable?"["+newLine:"[",this.batchFooter=this.readable?"]"+newLine:"]",this.batchSeparator=this.readable?","+newLine:",",this.setKeys(),this.colon=this.readable?": ":":",this.tab=this.readable?" ":"",this.lineBreak=this.readable?newLine:"",this.customFields=[]}function HttpPostDataLayout(){this.setKeys(),this.customFields=[],this.returnsPostData=!0}function formatObjectExpansion(e,t,r){var n=[];return function e(t,r,i){var a,o,s,l,c,u,d;function h(e){for(var t=splitIntoLines(e),r=1,n=t.length;r<n;r++)t[r]=i+t[r];return t.join(newLine)}if(i||(i=""),null===t)return"null";if(void 0===t)return"undefined";if("string"==typeof t)return h(t);if("object"==typeof t&&array_contains(n,t)){try{u=toStr(t)}catch(p){u="Error formatting property. Details: "+getExceptionStringRep(p)}return u+" [already expanded]"}if(t instanceof Array&&r>0){for(n.push(t),u="["+newLine,s=r-1,l=i+" ",c=[],a=0,o=t.length;a<o;a++)try{d=e(t[a],s,l),c.push(l+d)}catch(p){c.push(l+"Error formatting array member. Details: "+getExceptionStringRep(p))}return u+=c.join(","+newLine)+newLine+i+"]"}if("[object Date]"==Object.prototype.toString.call(t))return t.toString();if("object"==typeof t&&r>0){for(a in n.push(t),u="{"+newLine,s=r-1,l=i+" ",c=[],t)try{d=e(t[a],s,l),c.push(l+a+": "+d)}catch(p){c.push(l+a+": Error formatting property. Details: "+getExceptionStringRep(p))}return u+=c.join(","+newLine)+newLine+i+"}"}return h(toStr(t))}(e,t,r)}function PatternLayout(e){this.pattern=e||PatternLayout.DEFAULT_CONVERSION_PATTERN,this.customFields=[]}function AlertAppender(){}function BrowserConsoleAppender(){}Appender.prototype=new EventSupport,Appender.prototype.layout=new PatternLayout,Appender.prototype.threshold=Level.ALL,Appender.prototype.loggers=[],Appender.prototype.doAppend=function(e){enabled&&e.level.level>=this.threshold.level&&this.append(e)},Appender.prototype.append=function(e){},Appender.prototype.setLayout=function(e){e instanceof Layout?this.layout=e:handleError("Appender.setLayout: layout supplied to "+this.toString()+" is not a subclass of Layout")},Appender.prototype.getLayout=function(){return this.layout},Appender.prototype.setThreshold=function(e){e instanceof Level?this.threshold=e:handleError("Appender.setThreshold: threshold supplied to "+this.toString()+" is not a subclass of Level")},Appender.prototype.getThreshold=function(){return this.threshold},Appender.prototype.setAddedToLogger=function(e){this.loggers.push(e)},Appender.prototype.setRemovedFromLogger=function(e){array_remove(this.loggers,e)},Appender.prototype.group=emptyFunction,Appender.prototype.groupEnd=emptyFunction,Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method")},log4javascript.Appender=Appender,SimpleLayout.prototype=new Layout,SimpleLayout.prototype.format=function(e){return e.level.name+" - "+e.getCombinedMessages()},SimpleLayout.prototype.ignoresThrowable=function(){return!0},SimpleLayout.prototype.toString=function(){return"SimpleLayout"},log4javascript.SimpleLayout=SimpleLayout,NullLayout.prototype=new Layout,NullLayout.prototype.format=function(e){return e.messages},NullLayout.prototype.ignoresThrowable=function(){return!0},NullLayout.prototype.formatWithException=function(e){var t=e.messages,r=e.exception;return r?t.concat([r]):t},NullLayout.prototype.toString=function(){return"NullLayout"},log4javascript.NullLayout=NullLayout,XmlLayout.prototype=new Layout,XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages},XmlLayout.prototype.getContentType=function(){return"text/xml"},XmlLayout.prototype.escapeCdata=function(e){return e.replace(/\]\]>/,"]]>]]><![CDATA[")},XmlLayout.prototype.format=function(e){var t,r,n=this;function i(e){return e="string"==typeof e?e:toStr(e),"<log4javascript:message><![CDATA["+n.escapeCdata(e)+"]]></log4javascript:message>"}var a='<log4javascript:event logger="'+e.logger.name+'" timestamp="'+this.getTimeStampValue(e)+'"';if(this.isTimeStampsInMilliseconds()||(a+=' milliseconds="'+e.milliseconds+'"'),a+=' level="'+e.level.name+'">'+newLine,this.combineMessages)a+=i(e.getCombinedMessages());else{for(a+="<log4javascript:messages>"+newLine,t=0,r=e.messages.length;t<r;t++)a+=i(e.messages[t])+newLine;a+="</log4javascript:messages>"+newLine}if(this.hasCustomFields())for(t=0,r=this.customFields.length;t<r;t++)a+='<log4javascript:customfield name="'+this.customFields[t].name+'"><![CDATA['+this.customFields[t].value.toString()+"]]></log4javascript:customfield>"+newLine;return e.exception&&(a+="<log4javascript:exception><![CDATA["+getExceptionStringRep(e.exception)+"]]></log4javascript:exception>"+newLine),a+="</log4javascript:event>"+newLine+newLine},XmlLayout.prototype.ignoresThrowable=function(){return!1},XmlLayout.prototype.toString=function(){return"XmlLayout"},log4javascript.XmlLayout=XmlLayout,JsonLayout.prototype=new Layout,JsonLayout.prototype.isReadable=function(){return this.readable},JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages},JsonLayout.prototype.format=function(e){var t,r,n=this,i=this.getDataValues(e,this.combineMessages),a="{"+this.lineBreak;function o(e,t,r){var i,a=typeof e;if(e instanceof Date)i=String(e.getTime());else if(r&&e instanceof Array){i="["+n.lineBreak;for(var s=0,l=e.length;s<l;s++){var c=t+n.tab;i+=c+o(e[s],c,!1),s<e.length-1&&(i+=","),i+=n.lineBreak}i+=t+"]"}else i="number"!==a&&"boolean"!==a?'"'+escapeNewLines(toStr(e).replace(/\"/g,'\\"'))+'"':e;return i}for(t=0,r=i.length-1;t<=r;t++)a+=this.tab+'"'+i[t][0]+'"'+this.colon+o(i[t][1],this.tab,!0),t<r&&(a+=","),a+=this.lineBreak;return a+="}"+this.lineBreak},JsonLayout.prototype.ignoresThrowable=function(){return!1},JsonLayout.prototype.toString=function(){return"JsonLayout"},JsonLayout.prototype.getContentType=function(){return"application/json"},log4javascript.JsonLayout=JsonLayout,HttpPostDataLayout.prototype=new Layout,HttpPostDataLayout.prototype.allowBatching=function(){return!1},HttpPostDataLayout.prototype.format=function(e){for(var t=this.getDataValues(e),r=[],n=0,i=t.length;n<i;n++){var a=t[n][1]instanceof Date?String(t[n][1].getTime()):t[n][1];r.push(urlEncode(t[n][0])+"="+urlEncode(a))}return r.join("&")},HttpPostDataLayout.prototype.ignoresThrowable=function(e){return!1},HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout"},log4javascript.HttpPostDataLayout=HttpPostDataLayout,function(){var e=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/,t=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={G:0,y:3,M:4,w:2,W:2,D:2,d:2,F:2,E:1,a:0,H:2,k:2,K:2,h:2,m:2,s:2,S:2,Z:5},i=864e5,a=6048e5,o=function(e,t,r){var n=new Date(e,t,r,0,0,0);return n.setMilliseconds(0),n};Date.prototype.getDifference=function(e){return this.getTime()-e.getTime()},Date.prototype.isBefore=function(e){return this.getTime()<e.getTime()},Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())},Date.prototype.getTimeSince=function(e){return this.getUTCTime()-e.getUTCTime()},Date.prototype.getPreviousSunday=function(){var e=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0),t=new Date(e.getTime()-this.getDay()*i);return o(t.getFullYear(),t.getMonth(),t.getDate())},Date.prototype.getWeekInYear=function(e){isUndefined(this.minimalDaysInFirstWeek)&&(e=1);var t=this.getPreviousSunday(),r=o(this.getFullYear(),0,1),n=t.isBefore(r)?0:1+Math.floor(t.getTimeSince(r)/a);return 7-r.getDay()<e&&n--,n},Date.prototype.getWeekInMonth=function(e){isUndefined(this.minimalDaysInFirstWeek)&&(e=1);var t=this.getPreviousSunday(),r=o(this.getFullYear(),this.getMonth(),1),n=t.isBefore(r)?0:1+Math.floor(t.getTimeSince(r)/a);return 7-r.getDay()>=e&&n++,n},Date.prototype.getDayInYear=function(){var e=o(this.getFullYear(),0,1);return 1+Math.floor(this.getTimeSince(e)/i)},(SimpleDateFormat=function(e){this.formatString=e}).prototype.setMinimalDaysInFirstWeek=function(e){this.minimalDaysInFirstWeek=e},SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?1:this.minimalDaysInFirstWeek};var s=function(e,t){for(;e.length<t;)e="0"+e;return e},l=function(e,t,r){return t>=4?e:e.substr(0,Math.max(r,t))},c=function(e,t){return s(""+e,t)};SimpleDateFormat.prototype.format=function(i){for(var a,o="",u=this.formatString;a=e.exec(u);){var d=a[1],h=a[2],p=a[3],f=a[4];if(d)o+="''"==d?"'":d.substring(1,d.length-1);else if(p);else if(f)o+=f;else if(h){var m=h.charAt(0),g=h.length,_="";switch(m){case"G":_="AD";break;case"y":_=i.getFullYear();break;case"M":_=i.getMonth();break;case"w":_=i.getWeekInYear(this.getMinimalDaysInFirstWeek());break;case"W":_=i.getWeekInMonth(this.getMinimalDaysInFirstWeek());break;case"D":_=i.getDayInYear();break;case"d":_=i.getDate();break;case"F":_=1+Math.floor((i.getDate()-1)/7);break;case"E":_=r[i.getDay()];break;case"a":_=i.getHours()>=12?"PM":"AM";break;case"H":_=i.getHours();break;case"k":_=i.getHours()||24;break;case"K":_=i.getHours()%12;break;case"h":_=i.getHours()%12||12;break;case"m":_=i.getMinutes();break;case"s":_=i.getSeconds();break;case"S":_=i.getMilliseconds();break;case"Z":_=i.getTimezoneOffset()}switch(n[m]){case 0:o+=l(_,g,2);break;case 1:o+=l(_,g,3);break;case 2:o+=c(_,g);break;case 3:if(g<=3)o+=(""+_).substr(2,2);else o+=c(_,g);break;case 4:o+=g>=3?l(t[_],g,g):c(_+1,g);break;case 5:var y=_>0?"-":"+",b=Math.abs(_),v=""+Math.floor(b/60),S=""+b%60;o+=y+(v=s(v,2))+(S=s(S,2))}}u=u.substr(a.index+a[0].length)}return o}}(),log4javascript.SimpleDateFormat=SimpleDateFormat,PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n",PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n",PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS",PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS",PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS",PatternLayout.prototype=new Layout,PatternLayout.prototype.format=function(e){for(var t,r=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/,n="",i=this.pattern;t=r.exec(i);){var a=t[0],o=t[1],s=t[2],l=t[3],c=t[5],u=t[6];if(u)n+=""+u;else{var d,h="";switch(l){case"a":case"m":var p=0;c&&(p=parseInt(c,10),isNaN(p)&&(handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character '"+l+"' - should be a number"),p=0));for(var f="a"===l?e.messages[0]:e.messages,m=0,g=f.length;m<g;m++)m>0&&" "!==h.charAt(h.length-1)&&(h+=" "),h+=0===p?f[m]:formatObjectExpansion(f[m],p);break;case"c":var _=e.logger.name;if(c){var y=parseInt(c,10),b=e.logger.name.split(".");h=y>=b.length?_:b.slice(b.length-y).join(".")}else h=_;break;case"d":var v=PatternLayout.ISO8601_DATEFORMAT;c&&("ISO8601"==(v=c)?v=PatternLayout.ISO8601_DATEFORMAT:"ABSOLUTE"==v?v=PatternLayout.ABSOLUTETIME_DATEFORMAT:"DATE"==v&&(v=PatternLayout.DATETIME_DATEFORMAT)),h=new SimpleDateFormat(v).format(e.timeStamp);break;case"f":if(this.hasCustomFields()){var S=0;c&&(S=parseInt(c,10),isNaN(S)?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - should be a number"):0===S?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - must be greater than zero"):S>this.customFields.length?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - there aren't that many custom fields"):S-=1);var w=this.customFields[S].value;"function"==typeof w&&(w=w(this,e)),h=w}break;case"n":h=newLine;break;case"p":h=e.level.name;break;case"r":h=""+e.timeStamp.getDifference(applicationStartDate);break;case"%":h="%";break;default:h=a}if(s){d=parseInt(s.substr(1),10);var T=h.length;d<T&&(h=h.substring(T-d,T))}if(o)if("-"==o.charAt(0))for(d=parseInt(o.substr(1),10);h.length<d;)h+=" ";else for(d=parseInt(o,10);h.length<d;)h=" "+h;n+=h}i=i.substr(t.index+t[0].length)}return n},PatternLayout.prototype.ignoresThrowable=function(){return!0},PatternLayout.prototype.toString=function(){return"PatternLayout"},log4javascript.PatternLayout=PatternLayout,AlertAppender.prototype=new Appender,AlertAppender.prototype.layout=new SimpleLayout,AlertAppender.prototype.append=function(e){alert(this.getLayout().formatWithException(e))},AlertAppender.prototype.toString=function(){return"AlertAppender"},log4javascript.AlertAppender=AlertAppender,BrowserConsoleAppender.prototype=new log4javascript.Appender,BrowserConsoleAppender.prototype.layout=new NullLayout,BrowserConsoleAppender.prototype.threshold=Level.DEBUG,BrowserConsoleAppender.prototype.append=function(e){var t,r=this,n=function(t){var n=r.getLayout().formatWithException(e);return"string"==typeof n?t?n:[n]:t?n.join(" "):n},i=window.console;i&&i.log?"function"==typeof i[t=i.debug&&Level.DEBUG.isGreaterOrEqual(e.level)?"debug":i.info&&Level.INFO.equals(e.level)?"info":i.warn&&Level.WARN.equals(e.level)?"warn":i.error&&e.level.isGreaterOrEqual(Level.ERROR)?"error":"log"].apply?i[t].apply(i,n(!1)):i[t](n(!0)):"undefined"!=typeof opera&&opera.postError&&opera.postError(n(!0))},BrowserConsoleAppender.prototype.group=function(e){window.console&&window.console.group&&window.console.group(e)},BrowserConsoleAppender.prototype.groupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},BrowserConsoleAppender.prototype.toString=function(){return"BrowserConsoleAppender"},log4javascript.BrowserConsoleAppender=BrowserConsoleAppender;var xhrFactory=function(){return new XMLHttpRequest},xmlHttpFactories=[xhrFactory,function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],withCredentialsSupported=!1,getXmlHttp=function(e){for(var t,r=null,n=0,i=xmlHttpFactories.length;n<i;n++){t=xmlHttpFactories[n];try{return r=t(),withCredentialsSupported=t==xhrFactory&&"withCredentials"in r,getXmlHttp=t,r}catch(a){}}e?e():handleError("getXmlHttp: unable to obtain XMLHttpRequest object")},ConsoleAppender;function isHttpRequestSuccessful(e){return isUndefined(e.status)||0===e.status||e.status>=200&&e.status<300||1223==e.status}function AjaxAppender(e,t){var r=this,n=!0;e||(handleError("AjaxAppender: URL must be specified in constructor"),n=!1);var i=this.defaults.timed,a=this.defaults.waitForResponse,o=this.defaults.batchSize,s=this.defaults.timerInterval,l=this.defaults.requestSuccessCallback,c=this.defaults.failCallback,u=this.defaults.postVarName,d=this.defaults.sendAllOnUnload,h=this.defaults.contentType,p=null,f=[],m=[],g=[],_=!1,y=!1;function b(e){return!y||(handleError("AjaxAppender: configuration option '"+e+"' may not be set after the appender has been initialized"),!1)}function v(){var e;if(n&&enabled)if(_=!0,a)m.length>0?x(w(e=m.shift()),v):(_=!1,i&&T());else{for(;e=m.shift();)x(w(e));_=!1,i&&T()}}function S(){var e=!1;if(n&&enabled){for(var t,s=r.getLayout().allowBatching()?o:1,l=[];t=f.shift();)l.push(t),f.length>=s&&(m.push(l),l=[]);l.length>0&&m.push(l),e=m.length>0,a=!1,i=!1,v()}return e}function w(e){for(var t,n=[],i="";t=e.shift();)n.push(r.getLayout().formatWithException(t));return i=1==e.length?n.join(""):r.getLayout().batchHeader+n.join(r.getLayout().batchSeparator)+r.getLayout().batchFooter,h==r.defaults.contentType&&((i=r.getLayout().returnsPostData?i:urlEncode(u)+"="+urlEncode(i)).length>0&&(i+="&"),i+="layout="+urlEncode(r.getLayout().toString())),i}function T(){window.setTimeout(v,s)}function E(){var e="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";handleError(e),n=!1,c&&c(e)}function x(r,i){try{var a=getXmlHttp(E);if(n){a.onreadystatechange=function(){if(4==a.readyState){if(isHttpRequestSuccessful(a))l&&l(a),i&&i(a);else{var t="AjaxAppender.append: XMLHttpRequest request to URL "+e+" returned status code "+a.status;handleError(t),c&&c(t)}a.onreadystatechange=emptyFunction,a=null}},a.open("POST",e,!0),t&&withCredentialsSupported&&(a.withCredentials=!0);try{for(var o,s=0;o=g[s++];)a.setRequestHeader(o.name,o.value);a.setRequestHeader("Content-Type",h)}catch(p){var u="AjaxAppender.append: your browser's XMLHttpRequest implementation does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";return handleError(u),n=!1,void(c&&c(u))}a.send(r)}}catch(f){var d="AjaxAppender.append: error sending log message to "+e;handleError(d,f),n=!1,c&&c(d+". Details: "+getExceptionStringRep(f))}}this.getSessionId=function(){return p},this.setSessionId=function(e){p=extractStringFromParam(e,null),this.layout.setCustomField("sessionid",p)},this.setLayout=function(e){b("layout")&&(this.layout=e,null!==p&&this.setSessionId(p))},this.isTimed=function(){return i},this.setTimed=function(e){b("timed")&&(i=bool(e))},this.getTimerInterval=function(){return s},this.setTimerInterval=function(e){b("timerInterval")&&(s=extractIntFromParam(e,s))},this.isWaitForResponse=function(){return a},this.setWaitForResponse=function(e){b("waitForResponse")&&(a=bool(e))},this.getBatchSize=function(){return o},this.setBatchSize=function(e){b("batchSize")&&(o=extractIntFromParam(e,o))},this.isSendAllOnUnload=function(){return d},this.setSendAllOnUnload=function(e){b("sendAllOnUnload")&&(d=extractBooleanFromParam(e,d))},this.setRequestSuccessCallback=function(e){l=extractFunctionFromParam(e,l)},this.setFailCallback=function(e){c=extractFunctionFromParam(e,c)},this.getPostVarName=function(){return u},this.setPostVarName=function(e){b("postVarName")&&(u=extractStringFromParam(e,u))},this.getHeaders=function(){return g},this.addHeader=function(e,t){"content-type"==e.toLowerCase()?h=t:g.push({name:e,value:t})},this.sendAll=v,this.sendAllRemaining=S,this.append=function(e){if(n){y||function(){if(y=!0,d){var e=window.onbeforeunload;window.onbeforeunload=function(){e&&e(),S()}}i&&T()}(),f.push(e);var t=this.getLayout().allowBatching()?o:1;if(f.length>=t){for(var r,s=[];r=f.shift();)s.push(r);m.push(s),i||a&&(!a||_)||v()}}}}function setCookie(e,t,r,n){n=n?"; path="+n:"",document.cookie=escape(e)+"="+escape(t)+n}function getCookie(e){for(var t=escape(e)+"=",r=document.cookie.split(";"),n=0,i=r.length;n<i;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return unescape(a.substring(t.length,a.length))}return null}function getBaseUrl(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t)if(-1!=e[t].src.indexOf("log4javascript")){var n=e[t].src.lastIndexOf("/");return-1==n?"":e[t].src.substr(0,n+1)}return null}function isLoaded(e){try{return bool(e.loaded)}catch(t){return!1}}function padWithSpaces(e,t){if(e.length<t){for(var r=[],n=Math.max(0,t-e.length),i=0;i<n;i++)r[i]=" ";e+=r.join("")}return e}function createDefaultLogger(){var e=log4javascript.getLogger(defaultLoggerName),t=new log4javascript.PopUpAppender;return e.addAppender(t),e}if(AjaxAppender.prototype=new Appender,AjaxAppender.prototype.defaults={waitForResponse:!1,timed:!1,timerInterval:1e3,batchSize:1,sendAllOnUnload:!1,requestSuccessCallback:null,failCallback:null,postVarName:"data",contentType:"application/x-www-form-urlencoded"},AjaxAppender.prototype.layout=new HttpPostDataLayout,AjaxAppender.prototype.toString=function(){return"AjaxAppender"},log4javascript.AjaxAppender=AjaxAppender,function(){var e=[],t=1;function r(e,t,r,n,i){this.create(!1,null,e,t,r,n,i,this.defaults.focusPopUp)}function n(e,t,r,n,i,a){this.create(!0,e,t,r,n,i,a,!1)}(ConsoleAppender=function(){}).prototype=new Appender,ConsoleAppender.prototype.create=function(r,n,i,a,o,s,l,c){var u=this,d=!1,h=!1,p=!1,f=!1,m=[],g=!0,_=t++;a=extractBooleanFromParam(a,this.defaults.initiallyMinimized),i=extractBooleanFromParam(i,this.defaults.lazyInit),o=extractBooleanFromParam(o,this.defaults.useDocumentWrite);var y=this.defaults.newestMessageAtTop,b=this.defaults.scrollToLatestMessage;s=s||this.defaults.width,l=l||this.defaults.height;var v,S,w,T,E,x=this.defaults.maxMessages,A=this.defaults.showCommandLine,C=this.defaults.commandLineObjectExpansionDepth,R=this.defaults.showHideButton,D=this.defaults.showCloseButton;this.setLayout(this.defaults.layout);var P=r?"InPageAppender":"PopUpAppender",I=function(e){return!h||(handleError(P+": configuration option '"+e+"' may not be set after the appender has been initialized"),!1)},k=function(){return p&&g&&!f};this.isNewestMessageAtTop=function(){return y},this.setNewestMessageAtTop=function(e){y=bool(e),k()&&T().setNewestAtTop(y)},this.isScrollToLatestMessage=function(){return b},this.setScrollToLatestMessage=function(e){b=bool(e),k()&&T().setScrollToLatest(b)},this.getWidth=function(){return s},this.setWidth=function(e){I("width")&&(s=extractStringFromParam(e,s))},this.getHeight=function(){return l},this.setHeight=function(e){I("height")&&(l=extractStringFromParam(e,l))},this.getMaxMessages=function(){return x},this.setMaxMessages=function(e){x=extractIntFromParam(e,x),k()&&T().setMaxMessages(x)},this.isShowCommandLine=function(){return A},this.setShowCommandLine=function(e){A=bool(e),k()&&T().setShowCommandLine(A)},this.isShowHideButton=function(){return R},this.setShowHideButton=function(e){R=bool(e),k()&&T().setShowHideButton(R)},this.isShowCloseButton=function(){return D},this.setShowCloseButton=function(e){D=bool(e),k()&&T().setShowCloseButton(D)},this.getCommandLineObjectExpansionDepth=function(){return C},this.setCommandLineObjectExpansionDepth=function(e){C=extractIntFromParam(e,C)};var M=a;function $(e,t){this.loggingEvent=e,this.levelName=e.level.name,this.formattedMessage=t}function O(e,t){this.name=e,this.initiallyExpanded=t}function N(){}this.isInitiallyMinimized=function(){return a},this.setInitiallyMinimized=function(e){I("initiallyMinimized")&&(a=bool(e),M=a)},this.isUseDocumentWrite=function(){return o},this.setUseDocumentWrite=function(e){I("useDocumentWrite")&&(o=bool(e))},$.prototype.append=function(){T().log(this.levelName,this.formattedMessage)},O.prototype.append=function(){T().group(this.name,this.initiallyExpanded)},N.prototype.append=function(){T().groupEnd()};var F=function(){w(),d?f&&te&&S():v(),w()&&L()};this.append=function(e){if(g){var t=u.getLayout().formatWithException(e);m.push(new $(e,t)),F()}},this.group=function(e,t){g&&(m.push(new O(e,t)),F())},this.groupEnd=function(){g&&(m.push(new N),F())};var L=function(){for(;m.length>0;)m.shift().append();c&&T().focus()};this.setAddedToLogger=function(e){this.loggers.push(e),enabled&&!i&&v()},this.clear=function(){k()&&T().clearLog(),m.length=0},this.focus=function(){k()&&T().focus()},this.focusCommandLine=function(){k()&&T().focusCommandLine()},this.focusSearch=function(){k()&&T().focusSearch()};var B=window;this.getCommandWindow=function(){return B},this.setCommandWindow=function(e){B=e},this.executeLastCommand=function(){k()&&T().evalLastCommand()};var V=new PatternLayout("%m");this.getCommandLayout=function(){return V},this.setCommandLayout=function(e){V=e},this.evalCommandAndAppend=function(e){var t={appendResult:!0,isError:!1},r="";try{var n,i;!B.eval&&B.execScript&&B.execScript("null");var a={};for(i=0,len=U.length;i<len;i++)a[U[i][0]]=U[i][1];var o=[],s=function(e){o.push([e,B[e]])};s("appender"),B.appender=u,s("commandReturnValue"),B.commandReturnValue=t,s("commandLineFunctionsHash"),B.commandLineFunctionsHash=a;var l=function(e){s(e),B[e]=function(){return this.commandLineFunctionsHash[e](u,arguments,t)}};for(i=0,len=U.length;i<len;i++)l(U[i][0]);for(B===window&&B.execScript?(s("evalExpr"),s("result"),window.evalExpr=e,B.execScript("window.result=eval(window.evalExpr);"),n=window.result):n=B.eval(e),r=isUndefined(n)?n:formatObjectExpansion(n,C),i=0,len=o.length;i<len;i++)B[o[i][0]]=o[i][1]}catch(f){r="Error evaluating command: "+getExceptionStringRep(f),t.isError=!0}if(t.appendResult){var c=">>> "+e;isUndefined(r)||(c+=newLine+r);var d=t.isError?Level.ERROR:Level.INFO,h=new LoggingEvent(null,new Date,d,[c],null),p=this.getLayout();this.setLayout(V),this.append(h),this.setLayout(p)}};var U=e.concat([]);this.addCommandLineFunction=function(e,t){U.push([e,t])};var z="log4javascriptCommandHistory";this.storeCommandHistory=function(e){setCookie(z,e.join(","))};var H=function(e){var t=['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">',"<head>","<title>log4javascript</title>",'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',"<!-- Make IE8 behave like IE7, having gone to all the trouble of making IE work -->",'<meta http-equiv="X-UA-Compatible" content="IE=7" />','<script type="text/javascript">var isIe = false, isIePre7 = false;</script>','<!--[if IE]><script type="text/javascript">isIe = true</script><![endif]-->','<!--[if lt IE 7]><script type="text/javascript">isIePre7 = true</script><![endif]-->','<script type="text/javascript">',"//<![CDATA[","var loggingEnabled=true;var logQueuedEventsTimer=null;var logEntries=[];var logEntriesAndSeparators=[];var logItems=[];var renderDelay=100;var unrenderedLogItemsExist=false;var rootGroup,currentGroup=null;var loaded=false;var currentLogItem=null;var logMainContainer;function copyProperties(obj,props){for(var i in props){obj[i]=props[i];}}","function LogItem(){}","LogItem.prototype={mainContainer:null,wrappedContainer:null,unwrappedContainer:null,group:null,appendToLog:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].appendToLog();}","this.group.update();},doRemove:function(doUpdate,removeFromGroup){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].remove();}","this.unwrappedElementContainer=null;this.wrappedElementContainer=null;this.mainElementContainer=null;}","if(this.group&&removeFromGroup){this.group.removeChild(this,doUpdate);}","if(this===currentLogItem){currentLogItem=null;}},remove:function(doUpdate,removeFromGroup){this.doRemove(doUpdate,removeFromGroup);},render:function(){},accept:function(visitor){visitor.visit(this);},getUnwrappedDomContainer:function(){return this.group.unwrappedElementContainer.contentDiv;},getWrappedDomContainer:function(){return this.group.wrappedElementContainer.contentDiv;},getMainDomContainer:function(){return this.group.mainElementContainer.contentDiv;}};LogItem.serializedItemKeys={LOG_ENTRY:0,GROUP_START:1,GROUP_END:2};function LogItemContainerElement(){}",'LogItemContainerElement.prototype={appendToLog:function(){var insertBeforeFirst=(newestAtTop&&this.containerDomNode.hasChildNodes());if(insertBeforeFirst){this.containerDomNode.insertBefore(this.mainDiv,this.containerDomNode.firstChild);}else{this.containerDomNode.appendChild(this.mainDiv);}}};function SeparatorElementContainer(containerDomNode){this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="separator";this.mainDiv.innerHTML=" ";}',"SeparatorElementContainer.prototype=new LogItemContainerElement();SeparatorElementContainer.prototype.remove=function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;};function Separator(){this.rendered=false;}","Separator.prototype=new LogItem();copyProperties(Separator.prototype,{render:function(){var containerDomNode=this.group.contentDiv;if(isIe){this.unwrappedElementContainer=new SeparatorElementContainer(this.getUnwrappedDomContainer());this.wrappedElementContainer=new SeparatorElementContainer(this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new SeparatorElementContainer(this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}",'this.content=this.formattedMessage;this.rendered=true;}});function GroupElementContainer(group,containerDomNode,isRoot,isWrapped){this.group=group;this.containerDomNode=containerDomNode;this.isRoot=isRoot;this.isWrapped=isWrapped;this.expandable=false;if(this.isRoot){if(isIe){this.contentDiv=logMainContainer.appendChild(document.createElement("div"));this.contentDiv.id=this.isWrapped?"log_wrapped":"log_unwrapped";}else{this.contentDiv=logMainContainer;}}else{var groupElementContainer=this;this.mainDiv=document.createElement("div");this.mainDiv.className="group";this.headingDiv=this.mainDiv.appendChild(document.createElement("div"));this.headingDiv.className="groupheading";this.expander=this.headingDiv.appendChild(document.createElement("span"));this.expander.className="expander unselectable greyedout";this.expander.unselectable=true;var expanderText=this.group.expanded?"-":"+";this.expanderTextNode=this.expander.appendChild(document.createTextNode(expanderText));this.headingDiv.appendChild(document.createTextNode(" "+this.group.name));this.contentDiv=this.mainDiv.appendChild(document.createElement("div"));var contentCssClass=this.group.expanded?"expanded":"collapsed";this.contentDiv.className="groupcontent "+contentCssClass;this.expander.onclick=function(){if(groupElementContainer.group.expandable){groupElementContainer.group.toggleExpanded();}};}}','GroupElementContainer.prototype=new LogItemContainerElement();copyProperties(GroupElementContainer.prototype,{toggleExpanded:function(){if(!this.isRoot){var oldCssClass,newCssClass,expanderText;if(this.group.expanded){newCssClass="expanded";oldCssClass="collapsed";expanderText="-";}else{newCssClass="collapsed";oldCssClass="expanded";expanderText="+";}',"replaceClass(this.contentDiv,newCssClass,oldCssClass);this.expanderTextNode.nodeValue=expanderText;}},remove:function(){if(!this.isRoot){this.headingDiv=null;this.expander.onclick=null;this.expander=null;this.expanderTextNode=null;this.contentDiv=null;this.containerDomNode=null;this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;}},reverseChildren:function(){var node=null;var childDomNodes=[];while((node=this.contentDiv.firstChild)){this.contentDiv.removeChild(node);childDomNodes.push(node);}",'while((node=childDomNodes.pop())){this.contentDiv.appendChild(node);}},update:function(){if(!this.isRoot){if(this.group.expandable){removeClass(this.expander,"greyedout");}else{addClass(this.expander,"greyedout");}}},clear:function(){if(this.isRoot){this.contentDiv.innerHTML="";}}});function Group(name,isRoot,initiallyExpanded){this.name=name;this.group=null;this.isRoot=isRoot;this.initiallyExpanded=initiallyExpanded;this.elementContainers=[];this.children=[];this.expanded=initiallyExpanded;this.rendered=false;this.expandable=false;}',"Group.prototype=new LogItem();copyProperties(Group.prototype,{addChild:function(logItem){this.children.push(logItem);logItem.group=this;},render:function(){if(isIe){var unwrappedDomContainer,wrappedDomContainer;if(this.isRoot){unwrappedDomContainer=logMainContainer;wrappedDomContainer=logMainContainer;}else{unwrappedDomContainer=this.getUnwrappedDomContainer();wrappedDomContainer=this.getWrappedDomContainer();}","this.unwrappedElementContainer=new GroupElementContainer(this,unwrappedDomContainer,this.isRoot,false);this.wrappedElementContainer=new GroupElementContainer(this,wrappedDomContainer,this.isRoot,true);this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{var mainDomContainer=this.isRoot?logMainContainer:this.getMainDomContainer();this.mainElementContainer=new GroupElementContainer(this,mainDomContainer,this.isRoot,false);this.elementContainers=[this.mainElementContainer];}","this.rendered=true;},toggleExpanded:function(){this.expanded=!this.expanded;for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].toggleExpanded();}},expand:function(){if(!this.expanded){this.toggleExpanded();}},accept:function(visitor){visitor.visitGroup(this);},reverseChildren:function(){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].reverseChildren();}}},update:function(){var previouslyExpandable=this.expandable;this.expandable=(this.children.length!==0);if(this.expandable!==previouslyExpandable){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].update();}}},flatten:function(){var visitor=new GroupFlattener();this.accept(visitor);return visitor.logEntriesAndSeparators;},removeChild:function(child,doUpdate){array_remove(this.children,child);child.group=null;if(doUpdate){this.update();}},remove:function(doUpdate,removeFromGroup){for(var i=0,len=this.children.length;i<len;i++){this.children[i].remove(false,false);}","this.children=[];this.update();if(this===currentGroup){currentGroup=this.group;}","this.doRemove(doUpdate,removeFromGroup);},serialize:function(items){items.push([LogItem.serializedItemKeys.GROUP_START,this.name]);for(var i=0,len=this.children.length;i<len;i++){this.children[i].serialize(items);}","if(this!==currentGroup){items.push([LogItem.serializedItemKeys.GROUP_END]);}},clear:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clear();}}});function LogEntryElementContainer(){}",'LogEntryElementContainer.prototype=new LogItemContainerElement();copyProperties(LogEntryElementContainer.prototype,{remove:function(){this.doRemove();},doRemove:function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;this.contentElement=null;this.containerDomNode=null;},setContent:function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=content;}},setSearchMatch:function(isMatch){var oldCssClass=isMatch?"searchnonmatch":"searchmatch";var newCssClass=isMatch?"searchmatch":"searchnonmatch";replaceClass(this.mainDiv,newCssClass,oldCssClass);},clearSearch:function(){removeClass(this.mainDiv,"searchmatch");removeClass(this.mainDiv,"searchnonmatch");}});function LogEntryWrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.mainDiv.className="logentry wrapped "+this.logEntry.level;this.contentElement=this.mainDiv;}','LogEntryWrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryWrappedElementContainer.prototype.setContent=function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=wrappedContent;}};function LogEntryUnwrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry unwrapped "+this.logEntry.level;this.pre=this.mainDiv.appendChild(document.createElement("pre"));this.pre.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.pre.className="unwrapped";this.contentElement=this.pre;}','LogEntryUnwrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryUnwrappedElementContainer.prototype.remove=function(){this.doRemove();this.pre=null;};function LogEntryMainElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry nonielogentry "+this.logEntry.level;this.contentElement=this.mainDiv.appendChild(document.createElement("span"));this.contentElement.appendChild(document.createTextNode(this.logEntry.formattedMessage));}',"LogEntryMainElementContainer.prototype=new LogEntryElementContainer();function LogEntry(level,formattedMessage){this.level=level;this.formattedMessage=formattedMessage;this.rendered=false;}",'LogEntry.prototype=new LogItem();copyProperties(LogEntry.prototype,{render:function(){var logEntry=this;var containerDomNode=this.group.contentDiv;if(isIe){this.formattedMessage=this.formattedMessage.replace(/\\r\\n/g,"\\r");this.unwrappedElementContainer=new LogEntryUnwrappedElementContainer(this,this.getUnwrappedDomContainer());this.wrappedElementContainer=new LogEntryWrappedElementContainer(this,this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new LogEntryMainElementContainer(this,this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;},setContent:function(content,wrappedContent){if(content!=this.content){if(isIe&&(content!==this.formattedMessage)){content=content.replace(/\\r\\n/g,"\\r");}',"for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setContent(content,wrappedContent);}",'this.content=content;}},getSearchMatches:function(){var matches=[];var i,len;if(isIe){var unwrappedEls=getElementsByClass(this.unwrappedElementContainer.mainDiv,"searchterm","span");var wrappedEls=getElementsByClass(this.wrappedElementContainer.mainDiv,"searchterm","span");for(i=0,len=unwrappedEls.length;i<len;i++){matches[i]=new Match(this.level,null,unwrappedEls[i],wrappedEls[i]);}}else{var els=getElementsByClass(this.mainElementContainer.mainDiv,"searchterm","span");for(i=0,len=els.length;i<len;i++){matches[i]=new Match(this.level,els[i]);}}',"return matches;},setSearchMatch:function(isMatch){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setSearchMatch(isMatch);}},clearSearch:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clearSearch();}},accept:function(visitor){visitor.visitLogEntry(this);},serialize:function(items){items.push([LogItem.serializedItemKeys.LOG_ENTRY,this.level,this.formattedMessage]);}});function LogItemVisitor(){}","LogItemVisitor.prototype={visit:function(logItem){},visitParent:function(logItem){if(logItem.group){logItem.group.accept(this);}},visitChildren:function(logItem){for(var i=0,len=logItem.children.length;i<len;i++){logItem.children[i].accept(this);}},visitLogEntry:function(logEntry){this.visit(logEntry);},visitSeparator:function(separator){this.visit(separator);},visitGroup:function(group){this.visit(group);}};function GroupFlattener(){this.logEntriesAndSeparators=[];}",'GroupFlattener.prototype=new LogItemVisitor();GroupFlattener.prototype.visitGroup=function(group){this.visitChildren(group);};GroupFlattener.prototype.visitLogEntry=function(logEntry){this.logEntriesAndSeparators.push(logEntry);};GroupFlattener.prototype.visitSeparator=function(separator){this.logEntriesAndSeparators.push(separator);};window.onload=function(){if(location.search){var queryBits=unescape(location.search).substr(1).split("&"),nameValueBits;for(var i=0,len=queryBits.length;i<len;i++){nameValueBits=queryBits[i].split("=");if(nameValueBits[0]=="log4javascript_domain"){document.domain=nameValueBits[1];break;}}}','logMainContainer=$("log");if(isIePre7){addClass(logMainContainer,"oldIe");}','rootGroup=new Group("root",true);rootGroup.render();currentGroup=rootGroup;setCommandInputWidth();setLogContainerHeight();toggleLoggingEnabled();toggleSearchEnabled();toggleSearchFilter();toggleSearchHighlight();applyFilters();checkAllLevels();toggleWrap();toggleNewestAtTop();toggleScrollToLatest();renderQueuedLogItems();loaded=true;$("command").value="";$("command").autocomplete="off";$("command").onkeydown=function(evt){evt=getEvent(evt);if(evt.keyCode==10||evt.keyCode==13){evalCommandLine();stopPropagation(evt);}else if(evt.keyCode==27){this.value="";this.focus();}else if(evt.keyCode==38&&commandHistory.length>0){currentCommandIndex=Math.max(0,currentCommandIndex-1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}else if(evt.keyCode==40&&commandHistory.length>0){currentCommandIndex=Math.min(commandHistory.length-1,currentCommandIndex+1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}};$("command").onkeypress=function(evt){evt=getEvent(evt);if(evt.keyCode==38&&commandHistory.length>0&&evt.preventDefault){evt.preventDefault();}};$("command").onkeyup=function(evt){evt=getEvent(evt);if(evt.keyCode==27&&evt.preventDefault){evt.preventDefault();this.focus();}};document.onkeydown=function keyEventHandler(evt){evt=getEvent(evt);switch(evt.keyCode){case 69:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){evalLastCommand();cancelKeyEvent(evt);return false;}',"break;case 75:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusSearch();cancelKeyEvent(evt);return false;}","break;case 40:case 76:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusCommandLine();cancelKeyEvent(evt);return false;}","break;}};setTimeout(setLogContainerHeight,20);setShowCommandLine(showCommandLine);doSearch();};window.onunload=function(){if(mainWindowExists()){appender.unload();}",'appender=null;};function toggleLoggingEnabled(){setLoggingEnabled($("enableLogging").checked);}',"function setLoggingEnabled(enable){loggingEnabled=enable;}","var appender=null;function setAppender(appenderParam){appender=appenderParam;}",'function setShowCloseButton(showCloseButton){$("closeButton").style.display=showCloseButton?"inline":"none";}','function setShowHideButton(showHideButton){$("hideButton").style.display=showHideButton?"inline":"none";}',"var newestAtTop=false;function LogItemContentReverser(){}","LogItemContentReverser.prototype=new LogItemVisitor();LogItemContentReverser.prototype.visitGroup=function(group){group.reverseChildren();this.visitChildren(group);};function setNewestAtTop(isNewestAtTop){var oldNewestAtTop=newestAtTop;var i,iLen,j,jLen;newestAtTop=Boolean(isNewestAtTop);if(oldNewestAtTop!=newestAtTop){var visitor=new LogItemContentReverser();rootGroup.accept(visitor);if(currentSearch){var currentMatch=currentSearch.matches[currentMatchIndex];var matchIndex=0;var matches=[];var actOnLogEntry=function(logEntry){var logEntryMatches=logEntry.getSearchMatches();for(j=0,jLen=logEntryMatches.length;j<jLen;j++){matches[matchIndex]=logEntryMatches[j];if(currentMatch&&logEntryMatches[j].equals(currentMatch)){currentMatchIndex=matchIndex;}","matchIndex++;}};if(newestAtTop){for(i=logEntries.length-1;i>=0;i--){actOnLogEntry(logEntries[i]);}}else{for(i=0,iLen=logEntries.length;i<iLen;i++){actOnLogEntry(logEntries[i]);}}","currentSearch.matches=matches;if(currentMatch){currentMatch.setCurrent();}}else if(scrollToLatest){doScrollToLatest();}}",'$("newestAtTop").checked=isNewestAtTop;}','function toggleNewestAtTop(){var isNewestAtTop=$("newestAtTop").checked;setNewestAtTop(isNewestAtTop);}',"var scrollToLatest=true;function setScrollToLatest(isScrollToLatest){scrollToLatest=isScrollToLatest;if(scrollToLatest){doScrollToLatest();}",'$("scrollToLatest").checked=isScrollToLatest;}','function toggleScrollToLatest(){var isScrollToLatest=$("scrollToLatest").checked;setScrollToLatest(isScrollToLatest);}','function doScrollToLatest(){var l=logMainContainer;if(typeof l.scrollTop!="undefined"){if(newestAtTop){l.scrollTop=0;}else{var latestLogEntry=l.lastChild;if(latestLogEntry){l.scrollTop=l.scrollHeight;}}}}',"var closeIfOpenerCloses=true;function setCloseIfOpenerCloses(isCloseIfOpenerCloses){closeIfOpenerCloses=isCloseIfOpenerCloses;}","var maxMessages=null;function setMaxMessages(max){maxMessages=max;pruneLogEntries();}",'var showCommandLine=false;function setShowCommandLine(isShowCommandLine){showCommandLine=isShowCommandLine;if(loaded){$("commandLine").style.display=showCommandLine?"block":"none";setCommandInputWidth();setLogContainerHeight();}}','function focusCommandLine(){if(loaded){$("command").focus();}}','function focusSearch(){if(loaded){$("searchBox").focus();}}',"function getLogItems(){var items=[];for(var i=0,len=logItems.length;i<len;i++){logItems[i].serialize(items);}","return items;}","function setLogItems(items){var loggingReallyEnabled=loggingEnabled;loggingEnabled=true;for(var i=0,len=items.length;i<len;i++){switch(items[i][0]){case LogItem.serializedItemKeys.LOG_ENTRY:log(items[i][1],items[i][2]);break;case LogItem.serializedItemKeys.GROUP_START:group(items[i][1]);break;case LogItem.serializedItemKeys.GROUP_END:groupEnd();break;}}","loggingEnabled=loggingReallyEnabled;}","function log(logLevel,formattedMessage){if(loggingEnabled){var logEntry=new LogEntry(logLevel,formattedMessage);logEntries.push(logEntry);logEntriesAndSeparators.push(logEntry);logItems.push(logEntry);currentGroup.addChild(logEntry);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}","logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function renderQueuedLogItems(){logQueuedEventsTimer=null;var pruned=pruneLogEntries();var initiallyHasMatches=currentSearch?currentSearch.hasMatches():false;for(var i=0,len=logItems.length;i<len;i++){if(!logItems[i].rendered){logItems[i].render();logItems[i].appendToLog();if(currentSearch&&(logItems[i]instanceof LogEntry)){currentSearch.applyTo(logItems[i]);}}}","if(currentSearch){if(pruned){if(currentSearch.hasVisibleMatches()){if(currentMatchIndex===null){setCurrentMatchIndex(0);}","displayMatches();}else{displayNoMatches();}}else if(!initiallyHasMatches&¤tSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}}","if(scrollToLatest){doScrollToLatest();}","unrenderedLogItemsExist=false;}","function pruneLogEntries(){if((maxMessages!==null)&&(logEntriesAndSeparators.length>maxMessages)){var numberToDelete=logEntriesAndSeparators.length-maxMessages;var prunedLogEntries=logEntriesAndSeparators.slice(0,numberToDelete);if(currentSearch){currentSearch.removeMatches(prunedLogEntries);}","var group;for(var i=0;i<numberToDelete;i++){group=logEntriesAndSeparators[i].group;array_remove(logItems,logEntriesAndSeparators[i]);array_remove(logEntries,logEntriesAndSeparators[i]);logEntriesAndSeparators[i].remove(true,true);if(group.children.length===0&&group!==currentGroup&&group!==rootGroup){array_remove(logItems,group);group.remove(true,true);}}","logEntriesAndSeparators=array_removeFromStart(logEntriesAndSeparators,numberToDelete);return true;}","return false;}",'function group(name,startExpanded){if(loggingEnabled){initiallyExpanded=(typeof startExpanded==="undefined")?true:Boolean(startExpanded);var newGroup=new Group(name,false,initiallyExpanded);currentGroup.addChild(newGroup);currentGroup=newGroup;logItems.push(newGroup);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}',"logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function groupEnd(){currentGroup=(currentGroup===rootGroup)?rootGroup:currentGroup.group;}","function mainPageReloaded(){currentGroup=rootGroup;var separator=new Separator();logEntriesAndSeparators.push(separator);logItems.push(separator);currentGroup.addChild(separator);}","function closeWindow(){if(appender&&mainWindowExists()){appender.close(true);}else{window.close();}}","function hide(){if(appender&&mainWindowExists()){appender.hide();}}",'var mainWindow=window;var windowId="log4javascriptConsoleWindow_"+new Date().getTime()+"_"+(""+Math.random()).substr(2);function setMainWindow(win){mainWindow=win;mainWindow[windowId]=window;if(opener&&closeIfOpenerCloses){pollOpener();}}',"function pollOpener(){if(closeIfOpenerCloses){if(mainWindowExists()){setTimeout(pollOpener,500);}else{closeWindow();}}}","function mainWindowExists(){try{return(mainWindow&&!mainWindow.closed&&mainWindow[windowId]==window);}catch(ex){}","return false;}",'var logLevels=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function getCheckBox(logLevel){return $("switch_"+logLevel);}','function getIeWrappedLogContainer(){return $("log_wrapped");}','function getIeUnwrappedLogContainer(){return $("log_unwrapped");}',"function applyFilters(){for(var i=0;i<logLevels.length;i++){if(getCheckBox(logLevels[i]).checked){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}","updateSearchFromFilters();}",'function toggleAllLevels(){var turnOn=$("switch_ALL").checked;for(var i=0;i<logLevels.length;i++){getCheckBox(logLevels[i]).checked=turnOn;if(turnOn){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}}','function checkAllLevels(){for(var i=0;i<logLevels.length;i++){if(!getCheckBox(logLevels[i]).checked){getCheckBox("ALL").checked=false;return;}}','getCheckBox("ALL").checked=true;}',"function clearLog(){rootGroup.clear();currentGroup=rootGroup;logEntries=[];logItems=[];logEntriesAndSeparators=[];doSearch();}",'function toggleWrap(){var enable=$("wrap").checked;if(enable){addClass(logMainContainer,"wrap");}else{removeClass(logMainContainer,"wrap");}',"refreshCurrentMatch();}","var searchTimer=null;function scheduleSearch(){try{clearTimeout(searchTimer);}catch(ex){}","searchTimer=setTimeout(doSearch,500);}","function Search(searchTerm,isRegex,searchRegex,isCaseSensitive){this.searchTerm=searchTerm;this.isRegex=isRegex;this.searchRegex=searchRegex;this.isCaseSensitive=isCaseSensitive;this.matches=[];}","Search.prototype={hasMatches:function(){return this.matches.length>0;},hasVisibleMatches:function(){if(this.hasMatches()){for(var i=0;i<this.matches.length;i++){if(this.matches[i].isVisible()){return true;}}}","return false;},match:function(logEntry){var entryText=String(logEntry.formattedMessage);var matchesSearch=false;if(this.isRegex){matchesSearch=this.searchRegex.test(entryText);}else if(this.isCaseSensitive){matchesSearch=(entryText.indexOf(this.searchTerm)>-1);}else{matchesSearch=(entryText.toLowerCase().indexOf(this.searchTerm.toLowerCase())>-1);}","return matchesSearch;},getNextVisibleMatchIndex:function(){for(var i=currentMatchIndex+1;i<this.matches.length;i++){if(this.matches[i].isVisible()){return i;}}","for(i=0;i<=currentMatchIndex;i++){if(this.matches[i].isVisible()){return i;}}","return-1;},getPreviousVisibleMatchIndex:function(){for(var i=currentMatchIndex-1;i>=0;i--){if(this.matches[i].isVisible()){return i;}}","for(var i=this.matches.length-1;i>=currentMatchIndex;i--){if(this.matches[i].isVisible()){return i;}}",'return-1;},applyTo:function(logEntry){var doesMatch=this.match(logEntry);if(doesMatch){logEntry.group.expand();logEntry.setSearchMatch(true);var logEntryContent;var wrappedLogEntryContent;var searchTermReplacementStartTag="<span class=\\"searchterm\\">";var searchTermReplacementEndTag="<"+"/span>";var preTagName=isIe?"pre":"span";var preStartTag="<"+preTagName+" class=\\"pre\\">";var preEndTag="<"+"/"+preTagName+">";var startIndex=0;var searchIndex,matchedText,textBeforeMatch;if(this.isRegex){var flags=this.isCaseSensitive?"g":"gi";var capturingRegex=new RegExp("("+this.searchRegex.source+")",flags);var rnd=(""+Math.random()).substr(2);var startToken="%%s"+rnd+"%%";var endToken="%%e"+rnd+"%%";logEntryContent=logEntry.formattedMessage.replace(capturingRegex,startToken+"$1"+endToken);logEntryContent=escapeHtml(logEntryContent);var result;var searchString=logEntryContent;logEntryContent="";wrappedLogEntryContent="";while((searchIndex=searchString.indexOf(startToken,startIndex))>-1){var endTokenIndex=searchString.indexOf(endToken,searchIndex);matchedText=searchString.substring(searchIndex+startToken.length,endTokenIndex);textBeforeMatch=searchString.substring(startIndex,searchIndex);logEntryContent+=preStartTag+textBeforeMatch+preEndTag;logEntryContent+=searchTermReplacementStartTag+preStartTag+matchedText+',"preEndTag+searchTermReplacementEndTag;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=endTokenIndex+endToken.length;}",'logEntryContent+=preStartTag+searchString.substr(startIndex)+preEndTag;if(isIe){wrappedLogEntryContent+=searchString.substr(startIndex);}}else{logEntryContent="";wrappedLogEntryContent="";var searchTermReplacementLength=searchTermReplacementStartTag.length+',"this.searchTerm.length+searchTermReplacementEndTag.length;var searchTermLength=this.searchTerm.length;var searchTermLowerCase=this.searchTerm.toLowerCase();var logTextLowerCase=logEntry.formattedMessage.toLowerCase();while((searchIndex=logTextLowerCase.indexOf(searchTermLowerCase,startIndex))>-1){matchedText=escapeHtml(logEntry.formattedMessage.substr(searchIndex,this.searchTerm.length));textBeforeMatch=escapeHtml(logEntry.formattedMessage.substring(startIndex,searchIndex));var searchTermReplacement=searchTermReplacementStartTag+","preStartTag+matchedText+preEndTag+searchTermReplacementEndTag;logEntryContent+=preStartTag+textBeforeMatch+preEndTag+searchTermReplacement;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=searchIndex+searchTermLength;}","var textAfterLastMatch=escapeHtml(logEntry.formattedMessage.substr(startIndex));logEntryContent+=preStartTag+textAfterLastMatch+preEndTag;if(isIe){wrappedLogEntryContent+=textAfterLastMatch;}}","logEntry.setContent(logEntryContent,wrappedLogEntryContent);var logEntryMatches=logEntry.getSearchMatches();this.matches=this.matches.concat(logEntryMatches);}else{logEntry.setSearchMatch(false);logEntry.setContent(logEntry.formattedMessage,logEntry.formattedMessage);}","return doesMatch;},removeMatches:function(logEntries){var matchesToRemoveCount=0;var currentMatchRemoved=false;var matchesToRemove=[];var i,iLen,j,jLen;for(i=0,iLen=this.matches.length;i<iLen;i++){for(j=0,jLen=logEntries.length;j<jLen;j++){if(this.matches[i].belongsTo(logEntries[j])){matchesToRemove.push(this.matches[i]);if(i===currentMatchIndex){currentMatchRemoved=true;}}}}","var newMatch=currentMatchRemoved?null:this.matches[currentMatchIndex];if(currentMatchRemoved){for(i=currentMatchIndex,iLen=this.matches.length;i<iLen;i++){if(this.matches[i].isVisible()&&!array_contains(matchesToRemove,this.matches[i])){newMatch=this.matches[i];break;}}}","for(i=0,iLen=matchesToRemove.length;i<iLen;i++){array_remove(this.matches,matchesToRemove[i]);matchesToRemove[i].remove();}","if(this.hasVisibleMatches()){if(newMatch===null){setCurrentMatchIndex(0);}else{var newMatchIndex=0;for(i=0,iLen=this.matches.length;i<iLen;i++){if(newMatch===this.matches[i]){newMatchIndex=i;break;}}","setCurrentMatchIndex(newMatchIndex);}}else{currentMatchIndex=null;displayNoMatches();}}};function getPageOffsetTop(el,container){var currentEl=el;var y=0;while(currentEl&¤tEl!=container){y+=currentEl.offsetTop;currentEl=currentEl.offsetParent;}","return y;}",'function scrollIntoView(el){var logContainer=logMainContainer;if(!$("wrap").checked){var logContainerLeft=logContainer.scrollLeft;var logContainerRight=logContainerLeft+logContainer.offsetWidth;var elLeft=el.offsetLeft;var elRight=elLeft+el.offsetWidth;if(elLeft<logContainerLeft||elRight>logContainerRight){logContainer.scrollLeft=elLeft-(logContainer.offsetWidth-el.offsetWidth)/2;}}',"var logContainerTop=logContainer.scrollTop;var logContainerBottom=logContainerTop+logContainer.offsetHeight;var elTop=getPageOffsetTop(el)-getToolBarsHeight();var elBottom=elTop+el.offsetHeight;if(elTop<logContainerTop||elBottom>logContainerBottom){logContainer.scrollTop=elTop-(logContainer.offsetHeight-el.offsetHeight)/2;}}","function Match(logEntryLevel,spanInMainDiv,spanInUnwrappedPre,spanInWrappedDiv){this.logEntryLevel=logEntryLevel;this.spanInMainDiv=spanInMainDiv;if(isIe){this.spanInUnwrappedPre=spanInUnwrappedPre;this.spanInWrappedDiv=spanInWrappedDiv;}","this.mainSpan=isIe?spanInUnwrappedPre:spanInMainDiv;}",'Match.prototype={equals:function(match){return this.mainSpan===match.mainSpan;},setCurrent:function(){if(isIe){addClass(this.spanInUnwrappedPre,"currentmatch");addClass(this.spanInWrappedDiv,"currentmatch");var elementToScroll=$("wrap").checked?this.spanInWrappedDiv:this.spanInUnwrappedPre;scrollIntoView(elementToScroll);}else{addClass(this.spanInMainDiv,"currentmatch");scrollIntoView(this.spanInMainDiv);}},belongsTo:function(logEntry){if(isIe){return isDescendant(this.spanInUnwrappedPre,logEntry.unwrappedPre);}else{return isDescendant(this.spanInMainDiv,logEntry.mainDiv);}},setNotCurrent:function(){if(isIe){removeClass(this.spanInUnwrappedPre,"currentmatch");removeClass(this.spanInWrappedDiv,"currentmatch");}else{removeClass(this.spanInMainDiv,"currentmatch");}},isOrphan:function(){return isOrphan(this.mainSpan);},isVisible:function(){return getCheckBox(this.logEntryLevel).checked;},remove:function(){if(isIe){this.spanInUnwrappedPre=null;this.spanInWrappedDiv=null;}else{this.spanInMainDiv=null;}}};var currentSearch=null;var currentMatchIndex=null;function doSearch(){var searchBox=$("searchBox");var searchTerm=searchBox.value;var isRegex=$("searchRegex").checked;var isCaseSensitive=$("searchCaseSensitive").checked;var i;if(searchTerm===""){$("searchReset").disabled=true;$("searchNav").style.display="none";removeClass(document.body,"searching");removeClass(searchBox,"hasmatches");removeClass(searchBox,"nomatches");for(i=0;i<logEntries.length;i++){logEntries[i].clearSearch();logEntries[i].setContent(logEntries[i].formattedMessage,logEntries[i].formattedMessage);}','currentSearch=null;setLogContainerHeight();}else{$("searchReset").disabled=false;$("searchNav").style.display="block";var searchRegex;var regexValid;if(isRegex){try{searchRegex=isCaseSensitive?new RegExp(searchTerm,"g"):new RegExp(searchTerm,"gi");regexValid=true;replaceClass(searchBox,"validregex","invalidregex");searchBox.title="Valid regex";}catch(ex){regexValid=false;replaceClass(searchBox,"invalidregex","validregex");searchBox.title="Invalid regex: "+(ex.message?ex.message:(ex.description?ex.description:"unknown error"));return;}}else{searchBox.title="";removeClass(searchBox,"validregex");removeClass(searchBox,"invalidregex");}','addClass(document.body,"searching");currentSearch=new Search(searchTerm,isRegex,searchRegex,isCaseSensitive);for(i=0;i<logEntries.length;i++){currentSearch.applyTo(logEntries[i]);}',"setLogContainerHeight();if(currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}else{displayNoMatches();}}}","function updateSearchFromFilters(){if(currentSearch){if(currentSearch.hasMatches()){if(currentMatchIndex===null){currentMatchIndex=0;}","var currentMatch=currentSearch.matches[currentMatchIndex];if(currentMatch.isVisible()){displayMatches();setCurrentMatchIndex(currentMatchIndex);}else{currentMatch.setNotCurrent();var nextVisibleMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextVisibleMatchIndex>-1){setCurrentMatchIndex(nextVisibleMatchIndex);displayMatches();}else{displayNoMatches();}}}else{displayNoMatches();}}}","function refreshCurrentMatch(){if(currentSearch&¤tSearch.hasVisibleMatches()){setCurrentMatchIndex(currentMatchIndex);}}",'function displayMatches(){replaceClass($("searchBox"),"hasmatches","nomatches");$("searchBox").title=""+currentSearch.matches.length+" matches found";$("searchNav").style.display="block";setLogContainerHeight();}','function displayNoMatches(){replaceClass($("searchBox"),"nomatches","hasmatches");$("searchBox").title="No matches found";$("searchNav").style.display="none";setLogContainerHeight();}','function toggleSearchEnabled(enable){enable=(typeof enable=="undefined")?!$("searchDisable").checked:enable;$("searchBox").disabled=!enable;$("searchReset").disabled=!enable;$("searchRegex").disabled=!enable;$("searchNext").disabled=!enable;$("searchPrevious").disabled=!enable;$("searchCaseSensitive").disabled=!enable;$("searchNav").style.display=(enable&&($("searchBox").value!=="")&¤tSearch&¤tSearch.hasVisibleMatches())?"block":"none";if(enable){removeClass($("search"),"greyedout");addClass(document.body,"searching");if($("searchHighlight").checked){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}','if($("searchFilter").checked){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','$("searchDisable").checked=!enable;}else{addClass($("search"),"greyedout");removeClass(document.body,"searching");removeClass(logMainContainer,"searchhighlight");removeClass(logMainContainer,"searchfilter");}',"setLogContainerHeight();}",'function toggleSearchFilter(){var enable=$("searchFilter").checked;if(enable){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}',"refreshCurrentMatch();}",'function toggleSearchHighlight(){var enable=$("searchHighlight").checked;if(enable){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}}','function clearSearch(){$("searchBox").value="";doSearch();}','function searchNext(){if(currentSearch!==null&¤tMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var nextMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextMatchIndex>currentMatchIndex||confirm("Reached the end of the page. Start from the top?")){setCurrentMatchIndex(nextMatchIndex);}}}','function searchPrevious(){if(currentSearch!==null&¤tMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var previousMatchIndex=currentSearch.getPreviousVisibleMatchIndex();if(previousMatchIndex<currentMatchIndex||confirm("Reached the start of the page. Continue from the bottom?")){setCurrentMatchIndex(previousMatchIndex);}}}',"function setCurrentMatchIndex(index){currentMatchIndex=index;currentSearch.matches[currentMatchIndex].setCurrent();}",'function addClass(el,cssClass){if(!hasClass(el,cssClass)){if(el.className){el.className+=" "+cssClass;}else{el.className=cssClass;}}}','function hasClass(el,cssClass){if(el.className){var classNames=el.className.split(" ");return array_contains(classNames,cssClass);}',"return false;}",'function removeClass(el,cssClass){if(hasClass(el,cssClass)){var existingClasses=el.className.split(" ");var newClasses=[];for(var i=0,len=existingClasses.length;i<len;i++){if(existingClasses[i]!=cssClass){newClasses[newClasses.length]=existingClasses[i];}}','el.className=newClasses.join(" ");}}',"function replaceClass(el,newCssClass,oldCssClass){removeClass(el,oldCssClass);addClass(el,newCssClass);}","function getElementsByClass(el,cssClass,tagName){var elements=el.getElementsByTagName(tagName);var matches=[];for(var i=0,len=elements.length;i<len;i++){if(hasClass(elements[i],cssClass)){matches.push(elements[i]);}}","return matches;}","function $(id){return document.getElementById(id);}","function isDescendant(node,ancestorNode){while(node!=null){if(node===ancestorNode){return true;}","node=node.parentNode;}","return false;}","function isOrphan(node){var currentNode=node;while(currentNode){if(currentNode==document.body){return false;}","currentNode=currentNode.parentNode;}","return true;}",'function escapeHtml(str){return str.replace(/&/g,"&").replace(/[<]/g,"<").replace(/>/g,">");}',"function getWindowWidth(){if(window.innerWidth){return window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth;}else if(document.body){return document.body.clientWidth;}","return 0;}","function getWindowHeight(){if(window.innerHeight){return window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}","return 0;}",'function getToolBarsHeight(){return $("switches").offsetHeight;}','function getChromeHeight(){var height=getToolBarsHeight();if(showCommandLine){height+=$("commandLine").offsetHeight;}',"return height;}",'function setLogContainerHeight(){if(logMainContainer){var windowHeight=getWindowHeight();$("body").style.height=getWindowHeight()+"px";logMainContainer.style.height=""+','Math.max(0,windowHeight-getChromeHeight())+"px";}}','function setCommandInputWidth(){if(showCommandLine){$("command").style.width=""+Math.max(0,$("commandLineContainer").offsetWidth-','($("evaluateButton").offsetWidth+13))+"px";}}',"window.onresize=function(){setCommandInputWidth();setLogContainerHeight();};if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];}","return this.length;};}","if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length>0){var val=this[this.length-1];this.length=this.length-1;return val;}};}","if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];}","this.length=this.length-1;return firstItem;}};}","if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];}","var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);}","return itemsDeleted;};}","function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}}","if(index>=0){arr.splice(index,1);return index;}else{return false;}}","function array_removeFromStart(array,numberToRemove){if(Array.prototype.splice){array.splice(0,numberToRemove);}else{for(var i=numberToRemove,len=array.length;i<len;i++){array[i-numberToRemove]=array[i];}","array.length=array.length-numberToRemove;}","return array;}","function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}}","return false;}","function getErrorMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}",'return""+ex;}',"function moveCaretToEnd(input){if(input.setSelectionRange){input.focus();var length=input.value.length;input.setSelectionRange(length,length);}else if(input.createTextRange){var range=input.createTextRange();range.collapse(false);range.select();}","input.focus();}",'function stopPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;}}',"function getEvent(evt){return evt?evt:event;}","function getTarget(evt){return evt.target?evt.target:evt.srcElement;}",'function getRelatedTarget(evt){if(evt.relatedTarget){return evt.relatedTarget;}else if(evt.srcElement){switch(evt.type){case"mouseover":return evt.fromElement;case"mouseout":return evt.toElement;default:return evt.srcElement;}}}',"function cancelKeyEvent(evt){evt.returnValue=false;stopPropagation(evt);}",'function evalCommandLine(){var expr=$("command").value;evalCommand(expr);$("command").value="";}',"function evalLastCommand(){if(lastCommand!=null){evalCommand(lastCommand);}}",'var lastCommand=null;var commandHistory=[];var currentCommandIndex=0;function evalCommand(expr){if(appender){appender.evalCommandAndAppend(expr);}else{var prefix=">>> "+expr+"\\r\\n";try{log("INFO",prefix+eval(expr));}catch(ex){log("ERROR",prefix+"Error: "+getErrorMessage(ex));}}',"if(expr!=commandHistory[commandHistory.length-1]){commandHistory.push(expr);if(appender){appender.storeCommandHistory(commandHistory);}}","currentCommandIndex=(expr==commandHistory[currentCommandIndex])?currentCommandIndex+1:commandHistory.length;lastCommand=expr;}","//]]>","</script>",'<style type="text/css">',"body{background-color:white;color:black;padding:0;margin:0;font-family:tahoma,verdana,arial,helvetica,sans-serif;overflow:hidden}div#switchesContainer input{margin-bottom:0}div.toolbar{border-top:solid #ffffff 1px;border-bottom:solid #aca899 1px;background-color:#f1efe7;padding:3px 5px;font-size:68.75%}div.toolbar,div#search input{font-family:tahoma,verdana,arial,helvetica,sans-serif}div.toolbar input.button{padding:0 5px;font-size:100%}div.toolbar input.hidden{display:none}div#switches input#clearButton{margin-left:20px}div#levels label{font-weight:bold}div#levels label,div#options label{margin-right:5px}div#levels label#wrapLabel{font-weight:normal}div#search label{margin-right:10px}div#search label.searchboxlabel{margin-right:0}div#search input{font-size:100%}div#search input.validregex{color:green}div#search input.invalidregex{color:red}div#search input.nomatches{color:white;background-color:#ff6666}div#search input.nomatches{color:white;background-color:#ff6666}div#searchNav{display:none}div#commandLine{display:none}div#commandLine input#command{font-size:100%;font-family:Courier New,Courier}div#commandLine input#evaluateButton{}*.greyedout{color:gray !important;border-color:gray !important}*.greyedout *.alwaysenabled{color:black}*.unselectable{-khtml-user-select:none;-moz-user-select:none;user-select:none}div#log{font-family:Courier New,Courier;font-size:75%;width:100%;overflow:auto;clear:both;position:relative}div.group{border-color:#cccccc;border-style:solid;border-width:1px 0 1px 1px;overflow:visible}div.oldIe div.group,div.oldIe div.group *,div.oldIe *.logentry{height:1%}div.group div.groupheading span.expander{border:solid black 1px;font-family:Courier New,Courier;font-size:0.833em;background-color:#eeeeee;position:relative;top:-1px;color:black;padding:0 2px;cursor:pointer;cursor:hand;height:1%}div.group div.groupcontent{margin-left:10px;padding-bottom:2px;overflow:visible}div.group div.expanded{display:block}div.group div.collapsed{display:none}*.logentry{overflow:visible;display:none;white-space:pre}span.pre{white-space:pre}pre.unwrapped{display:inline !important}pre.unwrapped pre.pre,div.wrapped pre.pre{display:inline}div.wrapped pre.pre{white-space:normal}div.wrapped{display:none}body.searching *.logentry span.currentmatch{color:white !important;background-color:green !important}body.searching div.searchhighlight *.logentry span.searchterm{color:black;background-color:yellow}div.wrap *.logentry{white-space:normal !important;border-width:0 0 1px 0;border-color:#dddddd;border-style:dotted}div.wrap #log_wrapped,#log_unwrapped{display:block}div.wrap #log_unwrapped,#log_wrapped{display:none}div.wrap *.logentry span.pre{overflow:visible;white-space:normal}div.wrap *.logentry pre.unwrapped{display:none}div.wrap *.logentry span.wrapped{display:inline}div.searchfilter *.searchnonmatch{display:none !important}div#log *.TRACE,label#label_TRACE{color:#666666}div#log *.DEBUG,label#label_DEBUG{color:green}div#log *.INFO,label#label_INFO{color:#000099}div#log *.WARN,label#label_WARN{color:#999900}div#log *.ERROR,label#label_ERROR{color:red}div#log *.FATAL,label#label_FATAL{color:#660066}div.TRACE#log *.TRACE,div.DEBUG#log *.DEBUG,div.INFO#log *.INFO,div.WARN#log *.WARN,div.ERROR#log *.ERROR,div.FATAL#log *.FATAL{display:block}div#log div.separator{background-color:#cccccc;margin:5px 0;line-height:1px}","</style>","</head>",'<body id="body">','<div id="switchesContainer">','<div id="switches">','<div id="levels" class="toolbar">',"Filters:",'<input type="checkbox" id="switch_TRACE" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide trace messages" /><label for="switch_TRACE" id="label_TRACE">trace</label>','<input type="checkbox" id="switch_DEBUG" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide debug messages" /><label for="switch_DEBUG" id="label_DEBUG">debug</label>','<input type="checkbox" id="switch_INFO" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide info messages" /><label for="switch_INFO" id="label_INFO">info</label>','<input type="checkbox" id="switch_WARN" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide warn messages" /><label for="switch_WARN" id="label_WARN">warn</label>','<input type="checkbox" id="switch_ERROR" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide error messages" /><label for="switch_ERROR" id="label_ERROR">error</label>','<input type="checkbox" id="switch_FATAL" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide fatal messages" /><label for="switch_FATAL" id="label_FATAL">fatal</label>','<input type="checkbox" id="switch_ALL" onclick="toggleAllLevels(); applyFilters()" checked="checked" title="Show/hide all messages" /><label for="switch_ALL" id="label_ALL">all</label>',"</div>",'<div id="search" class="toolbar">','<label for="searchBox" class="searchboxlabel">Search:</label> <input type="text" id="searchBox" onclick="toggleSearchEnabled(true)" onkeyup="scheduleSearch()" size="20" />','<input type="button" id="searchReset" disabled="disabled" value="Reset" onclick="clearSearch()" class="button" title="Reset the search" />','<input type="checkbox" id="searchRegex" onclick="doSearch()" title="If checked, search is treated as a regular expression" /><label for="searchRegex">Regex</label>','<input type="checkbox" id="searchCaseSensitive" onclick="doSearch()" title="If checked, search is case sensitive" /><label for="searchCaseSensitive">Match case</label>','<input type="checkbox" id="searchDisable" onclick="toggleSearchEnabled()" title="Enable/disable search" /><label for="searchDisable" class="alwaysenabled">Disable</label>','<div id="searchNav">','<input type="button" id="searchNext" disabled="disabled" value="Next" onclick="searchNext()" class="button" title="Go to the next matching log entry" />','<input type="button" id="searchPrevious" disabled="disabled" value="Previous" onclick="searchPrevious()" class="button" title="Go to the previous matching log entry" />','<input type="checkbox" id="searchFilter" onclick="toggleSearchFilter()" title="If checked, non-matching log entries are filtered out" /><label for="searchFilter">Filter</label>','<input type="checkbox" id="searchHighlight" onclick="toggleSearchHighlight()" title="Highlight matched search terms" /><label for="searchHighlight" class="alwaysenabled">Highlight all</label>',"</div>","</div>",'<div id="options" class="toolbar">',"Options:",'<input type="checkbox" id="enableLogging" onclick="toggleLoggingEnabled()" checked="checked" title="Enable/disable logging" /><label for="enableLogging" id="enableLoggingLabel">Log</label>','<input type="checkbox" id="wrap" onclick="toggleWrap()" title="Enable / disable word wrap" /><label for="wrap" id="wrapLabel">Wrap</label>','<input type="checkbox" id="newestAtTop" onclick="toggleNewestAtTop()" title="If checked, causes newest messages to appear at the top" /><label for="newestAtTop" id="newestAtTopLabel">Newest at the top</label>','<input type="checkbox" id="scrollToLatest" onclick="toggleScrollToLatest()" checked="checked" title="If checked, window automatically scrolls to a new message when it is added" /><label for="scrollToLatest" id="scrollToLatestLabel">Scroll to latest</label>','<input type="button" id="clearButton" value="Clear" onclick="clearLog()" class="button" title="Clear all log messages" />','<input type="button" id="hideButton" value="Hide" onclick="hide()" class="hidden button" title="Hide the console" />','<input type="button" id="closeButton" value="Close" onclick="closeWindow()" class="hidden button" title="Close the window" />',"</div>","</div>","</div>",'<div id="log" class="TRACE DEBUG INFO WARN ERROR FATAL"></div>','<div id="commandLine" class="toolbar">','<div id="commandLineContainer">','<input type="text" id="command" title="Enter a JavaScript command here and hit return or press \'Evaluate\'" />','<input type="button" id="evaluateButton" value="Evaluate" class="button" title="Evaluate the command" onclick="evalCommandLine()" />',"</div>","</div>","</body>","</html>",""];e.open();for(var r=0,n=t.length;r<n;r++)e.writeln(t[r]);e.close()};this.setEventTypes(["load","unload"]);var j=function(){var e=T();e.setAppender(u),e.setNewestAtTop(y),e.setScrollToLatest(b),e.setMaxMessages(x),e.setShowCommandLine(A),e.setShowHideButton(R),e.setShowCloseButton(D),e.setMainWindow(window);var t=getCookie(z);t&&(e.commandHistory=t.split(","),e.currentCommandIndex=e.commandHistory.length),u.dispatchEvent("load",{win:e})};this.unload=function(){logLog.debug("unload "+this+", caller: "+this.unload.caller),f||(logLog.debug("really doing unload "+this),f=!0,p=!1,h=!1,u.dispatchEvent("unload",{}))};var G=function(e,t,r,n){var i=setInterval((function(){try{f&&clearInterval(i),e(T())&&(clearInterval(i),r())}catch(t){clearInterval(i),g=!1,handleError(n,t)}}),t)},W=function(){var e=document.domain!=location.hostname;return o?"":getBaseUrl()+"console.html"+(e?"?log4javascript_domain="+escape(document.domain):"")};if(r){var q=null,X=[];this.addCssProperty=function(e,t){I("cssProperties")&&X.push([e,t])};var K,Y=!1,J=uniqueId+"_InPageAppender_"+_;this.hide=function(){d&&h&&(k()&&T().$("command").blur(),K.style.display="none",M=!0)},this.show=function(){d&&(h?(K.style.display="block",this.setShowCommandLine(A),M=!1):Y||S(!0))},this.isVisible=function(){return!M&&!f},this.close=function(e){f||e&&!confirm("This will permanently remove the console from the page. No more messages will be logged. Do you wish to continue?")||(K.parentNode.removeChild(K),this.unload())},E=function(){var e="InPageAppender.open: unable to create console iframe";function t(){try{a||u.show(),j(),p=!0,L()}catch(t){g=!1,handleError(e,t)}}function r(){try{var r=function(e){return isLoaded(e)};o&&H(T().document),r(T())?t():G(r,100,t,e)}catch(n){g=!1,handleError(e,n)}}M=!1,(K=q.appendChild(document.createElement("div"))).style.width=s,K.style.height=l,K.style.border="solid gray 1px";for(var n=0,i=X.length;n<i;n++)K.style[X[n][0]]=X[n][1];var c=o?"":" src='"+W()+"'";K.innerHTML="<iframe id='"+J+"' name='"+J+"' width='100%' height='100%' frameborder='0'"+c+" scrolling='no'></iframe>",f=!1;var d=function(e){try{return bool(e)&&bool(e.document)}catch(t){return!1}};d(T())?r():G(d,100,r,e),h=!0},S=function(e){if(e||!a){var t=function(){if(n)try{var e=document.getElementById(n);1==e.nodeType&&(q=e),E()}catch(t){handleError("InPageAppender.init: invalid container element '"+n+"' supplied",t)}else(q=document.createElement("div")).style.position="fixed",q.style.left="0",q.style.right="0",q.style.bottom="0",document.body.appendChild(q),u.addCssProperty("borderWidth","1px 0 0 0"),u.addCssProperty("zIndex",1e6),E()};pageLoaded&&n&&n.appendChild?(q=n,E()):pageLoaded?t():log4javascript.addEventListener("load",t),Y=!0}},v=function(){S(),d=!0},T=function(){var e=window.frames[J];if(e)return e},w=function(){return!(!g||f)&&(h&&!p&&T()&&isLoaded(T())&&(p=!0),p)}}else{var Z,Q=u.defaults.useOldPopUp,ee=u.defaults.complainAboutPopUpBlocking,te=this.defaults.reopenWhenClosed;this.isUseOldPopUp=function(){return Q},this.setUseOldPopUp=function(e){I("useOldPopUp")&&(Q=bool(e))},this.isComplainAboutPopUpBlocking=function(){return ee},this.setComplainAboutPopUpBlocking=function(e){I("complainAboutPopUpBlocking")&&(ee=bool(e))},this.isFocusPopUp=function(){return c},this.setFocusPopUp=function(e){c=bool(e)},this.isReopenWhenClosed=function(){return te},this.setReopenWhenClosed=function(e){te=bool(e)},this.close=function(){logLog.debug("close "+this);try{Z.close(),this.unload()}catch(e){}},this.hide=function(){logLog.debug("hide "+this),k()&&this.close()},this.show=function(){logLog.debug("show "+this),h||E()},this.isVisible=function(){return w()},E=function(){var e="width="+s+",height="+l+",status,resizable",t="";try{var r=window.frameElement;r&&(t="_"+r.tagName+"_"+(r.name||r.id||""))}catch(d){t="_inaccessibleParentFrame"}var n="PopUp_"+location.host.replace(/[^a-z0-9]/gi,"_")+"_"+_+t;Q&&o||(n=n+"_"+uniqueId);var i=function(e){if(f)return!0;try{return bool(e)&&e.closed}catch(t){}return!1},a=function(){f||u.unload()};function c(){T().setCloseIfOpenerCloses(!Q||!o),j(),p=!0,L(),G(i,500,a,"PopUpAppender.checkPopUpClosed: error checking pop-up window")}try{if(Z=window.open(W(),n,e),f=!1,h=!0,Z&&Z.document)if(o&&Q&&isLoaded(Z))Z.mainPageReloaded(),c();else{o&&H(Z.document);isLoaded(Z)?c():G((function(e){return bool(e)&&isLoaded(e)}),100,c,"PopUpAppender.init: unable to create console window")}else g=!1,logLog.warn("PopUpAppender.init: pop-ups blocked, please unblock to use PopUpAppender"),ee&&handleError("log4javascript: pop-up windows appear to be blocked. Please unblock them to use pop-up logging.")}catch(m){handleError("PopUpAppender.init: error creating pop-up",m)}},S=function(){a||E()},v=function(){S(),d=!0},T=function(){return Z},w=function(){if(g&&!isUndefined(Z)&&!f){if(Z.closed||p&&isUndefined(Z.closed))return u.unload(),logLog.debug("PopUpAppender: pop-up closed"),!1;!p&&isLoaded(Z)&&(p=!0)}return g&&p&&!f}}this.getConsoleWindow=T},ConsoleAppender.addGlobalCommandLineFunction=function(t,r){e.push([t,r])},r.prototype=new ConsoleAppender,r.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:!1,focusPopUp:!1,lazyInit:!0,useOldPopUp:!0,complainAboutPopUpBlocking:!0,newestMessageAtTop:!1,scrollToLatestMessage:!0,width:"600",height:"400",reopenWhenClosed:!1,maxMessages:null,showCommandLine:!0,commandLineObjectExpansionDepth:1,showHideButton:!1,showCloseButton:!0,useDocumentWrite:!0},r.prototype.toString=function(){return"PopUpAppender"},log4javascript.PopUpAppender=r,n.prototype=new ConsoleAppender,n.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:!1,lazyInit:!0,newestMessageAtTop:!1,scrollToLatestMessage:!0,width:"100%",height:"220px",maxMessages:null,showCommandLine:!0,commandLineObjectExpansionDepth:1,showHideButton:!1,showCloseButton:!1,showLogEntryDeleteButtons:!0,useDocumentWrite:!0},n.prototype.toString=function(){return"InPageAppender"},log4javascript.InPageAppender=n,log4javascript.InlineAppender=n}(),function(){function e(e){var t=0;for(var r in e)t=Math.max(toStr(r).length,t);var n=[];for(r in e){var i,a=" "+padWithSpaces(toStr(r),t+2);try{i=splitIntoLines(toStr(e[r])).join(padWithSpaces(newLine,t+6))}catch(o){i="[Error obtaining property. Details: "+getExceptionMessage(o)+"]"}n.push(a+i)}return n.join(newLine)}var t=1,r=3,n=4,i=9,a=11,o=["script","pre"],s=["br","img","hr","param","link","area","input","col","base","meta"];function l(e,c,u,d,h){var p;function f(e){for(var t=e.style.cssText.split(";"),r="",n=0,i=t.length;n<i;n++){var a=t[n].split(":"),o=[];/^\s*$/.test(a[0])||o.push(trim(a[0]).toLowerCase()+":"+trim(a[1])),r=o.join(";")}return r}"string"!=typeof u&&(u=""),d=!!d,h=!!h;var m,g;if(!(c=void 0===c||!!c)||e.nodeType==a){for(p="",m=0,g=e.childNodes.length;m<g;m++)p+=l(e.childNodes[m],!0,u+" ");return p}switch(e.nodeType){case t:var _=e.tagName.toLowerCase();p=d?newLine+u:"",p+="<";var y=function(e){return e.prefix?e.prefix:e.outerHTML&&new RegExp("<([^:]+):"+e.tagName+"[^>]*>","i").test(e.outerHTML)?RegExp.$1.toLowerCase():""}(e),b=!!y;for(b&&(p+=y+":"),p+=_,m=0,g=e.attributes.length;m<g;m++){var v=e.attributes[m];v.specified&&null!==v.nodeValue&&"style"!==v.nodeName.toLowerCase()&&"string"==typeof v.nodeValue&&0!==v.nodeName.indexOf("_moz")&&(p+=" "+v.nodeName.toLowerCase()+'="',p+=v.nodeValue.toString().replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),p+='"')}if(e.style.cssText)""!==f(e)&&(p+=' style="'+f(e)+'"');if(array_contains(s,_)||b&&!e.hasChildNodes())p+="/>";else{p+=">";var S=!(1===e.childNodes.length&&e.childNodes[0].nodeType===r),w=array_contains(o,_);for(m=0,g=e.childNodes.length;m<g;m++)p+=l(e.childNodes[m],!0,u+" ",S,w);var T="</"+_+">";p+=S?newLine+u+T:T}return p;case r:if(function(e){return e.nodeType==r&&/^[ \t\r\n]*$/.test(e.nodeValue)}(e))p="";else{if(h)p=e.nodeValue;else{var E=splitIntoLines(trim(e.nodeValue)),x=[];for(m=0,g=E.length;m<g;m++)x[m]=trim(E[m]);p=x.join(newLine+u)}d&&(p=newLine+u+p)}return p;case n:return"<![CDATA["+e.nodeValue+"]]>"+newLine;case i:for(p="",m=0,g=e.childNodes.length;m<g;m++)p+=l(e.childNodes[m],!0,u);return p;default:return""}}ConsoleAppender.addGlobalCommandLineFunction("$",(function(e,t,r){return document.getElementById(t[0])})),ConsoleAppender.addGlobalCommandLineFunction("dir",(function(t,r,n){for(var i=[],a=0,o=r.length;a<o;a++)i[a]=e(r[a]);return i.join(newLine+newLine)})),ConsoleAppender.addGlobalCommandLineFunction("dirxml",(function(e,t,r){for(var n=[],i=0,a=t.length;i<a;i++)n[i]=l(t[i]);return n.join(newLine+newLine)})),ConsoleAppender.addGlobalCommandLineFunction("cd",(function(e,t,r){var n,i;return 0===t.length||""===t[0]?(n=window,i="Command line set to run in main window"):t[0].window==t[0]?(n=t[0],i="Command line set to run in frame '"+t[0].name+"'"):(n=window.frames[t[0]])?i="Command line set to run in frame '"+t[0]+"'":(r.isError=!0,i="Frame '"+t[0]+"' does not exist",n=e.getCommandWindow()),e.setCommandWindow(n),i})),ConsoleAppender.addGlobalCommandLineFunction("clear",(function(e,t,r){r.appendResult=!1,e.clear()})),ConsoleAppender.addGlobalCommandLineFunction("keys",(function(e,t,r){var n=[];for(var i in t[0])n.push(i);return n})),ConsoleAppender.addGlobalCommandLineFunction("values",(function(e,t,r){var n=[];for(var i in t[0])try{n.push(t[0][i])}catch(a){logLog.warn("values(): Unable to obtain value for key "+i+". Details: "+getExceptionMessage(a))}return n})),ConsoleAppender.addGlobalCommandLineFunction("expansionDepth",(function(e,t,r){var n=parseInt(t[0],10);return isNaN(n)||n<0?(r.isError=!0,t[0]+" is not a valid expansion depth"):(e.setCommandLineObjectExpansionDepth(n),"Object expansion depth set to "+n)}))}(),log4javascript.setDocumentReady=function(){pageLoaded=!0,log4javascript.dispatchEvent("load",{})},window.addEventListener)window.addEventListener("load",log4javascript.setDocumentReady,!1);else if(window.attachEvent)window.attachEvent("onload",log4javascript.setDocumentReady);else{var oldOnload=window.onload;"function"!=typeof window.onload?window.onload=log4javascript.setDocumentReady:window.onload=function(e){oldOnload&&oldOnload(e),log4javascript.setDocumentReady()}}return log4javascript}))})(log4javascript$1);var log4javascriptExports=log4javascript$1.exports;const log4javascript=getDefaultExportFromCjs(log4javascriptExports);var current_ansi=1252,VALID_ANSI$1=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],CS2CP$1={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},set_ansi$1=function(e){-1!=VALID_ANSI$1.indexOf(e)&&(current_ansi=CS2CP$1[0]=e)};function reset_ansi$1(){set_ansi$1(1252)}var set_cp$1=function(e){set_ansi$1(e)};function reset_cp$1(){set_cp$1(1200),reset_ansi$1()}function char_codes$1(e){for(var t=[],r=0,n=e.length;r<n;++r)t[r]=e.charCodeAt(r);return t}function utf16leread$1(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}function utf16beread$1(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}var debom$1=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return 255==t&&254==r?utf16leread$1(e.slice(2)):254==t&&255==r?utf16beread$1(e.slice(2)):65279==t?e.slice(1):e},_getchar$1=function(e){return String.fromCharCode(e)},_getansi$1=function(e){return String.fromCharCode(e)},$cptable,Base64_map$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Base64_encode$1(e){for(var t="",r=0,n=0,i=0,a=0,o=0,s=0,l=0,c=0;c<e.length;)a=(r=e.charCodeAt(c++))>>2,o=(3&r)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(i=e.charCodeAt(c++))>>6,l=63&i,isNaN(n)?s=l=64:isNaN(i)&&(l=64),t+=Base64_map$1.charAt(a)+Base64_map$1.charAt(o)+Base64_map$1.charAt(s)+Base64_map$1.charAt(l);return t}function Base64_decode$1(e){var t="",r=0,n=0,i=0,a=0,o=0,s=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var l=0;l<e.length;)r=Base64_map$1.indexOf(e.charAt(l++))<<2|(a=Base64_map$1.indexOf(e.charAt(l++)))>>4,t+=String.fromCharCode(r),n=(15&a)<<4|(o=Base64_map$1.indexOf(e.charAt(l++)))>>2,64!==o&&(t+=String.fromCharCode(n)),i=(3&o)<<6|(s=Base64_map$1.indexOf(e.charAt(l++))),64!==s&&(t+=String.fromCharCode(i));return t}var has_buf$1=function(){return"undefined"!=typeof Buffer&&"undefined"!=typeof process&&void 0!==process.versions&&!!process.versions.node}(),Buffer_from$1=function(){if("undefined"!=typeof Buffer){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(t){e=!0}return e?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function new_raw_buf$1(e){return has_buf$1?Buffer.alloc?Buffer.alloc(e):new Buffer(e):"undefined"!=typeof Uint8Array?new Uint8Array(e):new Array(e)}function new_unsafe_buf$1(e){return has_buf$1?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):"undefined"!=typeof Uint8Array?new Uint8Array(e):new Array(e)}var s2a$1=function(e){return has_buf$1?Buffer_from$1(e,"binary"):e.split("").map((function(e){return 255&e.charCodeAt(0)}))};function a2s$1(e){if(Array.isArray(e))return e.map((function(e){return String.fromCharCode(e)})).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function ab2a$1(e){if("undefined"==typeof ArrayBuffer)throw new Error("Unsupported");if(e instanceof ArrayBuffer)return ab2a$1(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var bconcat$1=has_buf$1?function(e){return Buffer.concat(e.map((function(e){return Buffer.isBuffer(e)?e:Buffer_from$1(e)})))}:function(e){if("undefined"!=typeof Uint8Array){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var n=new Uint8Array(r),i=0;for(t=0,r=0;t<e.length;r+=i,++t)if(i=e[t].length,e[t]instanceof Uint8Array)n.set(e[t],r);else{if("string"==typeof e[t])throw"wtf";n.set(new Uint8Array(e[t]),r)}return n}return[].concat.apply([],e.map((function(e){return Array.isArray(e)?e:[].slice.call(e)})))};function utf8decode$1(e){for(var t=[],r=0,n=e.length+250,i=new_raw_buf$1(e.length+255),a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o<128)i[r++]=o;else if(o<2048)i[r++]=192|o>>6&31,i[r++]=128|63&o;else if(o>=55296&&o<57344){o=64+(1023&o);var s=1023&e.charCodeAt(++a);i[r++]=240|o>>8&7,i[r++]=128|o>>2&63,i[r++]=128|s>>6&15|(3&o)<<4,i[r++]=128|63&s}else i[r++]=224|o>>12&15,i[r++]=128|o>>6&63,i[r++]=128|63&o;r>n&&(t.push(i.slice(0,r)),r=0,i=new_raw_buf$1(65535),n=65530)}return t.push(i.slice(0,r)),bconcat$1(t)}var chr0$1=/\u0000/g,chr1$1=/[\u0001-\u0006]/g;function _strrev$1(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function pad0$1(e,t){var r=""+e;return r.length>=t?r:fill$3("0",t-r.length)+r}function pad_$1(e,t){var r=""+e;return r.length>=t?r:fill$3(" ",t-r.length)+r}function rpad_$1(e,t){var r=""+e;return r.length>=t?r:r+fill$3(" ",t-r.length)}function pad0r1$1(e,t){var r=""+Math.round(e);return r.length>=t?r:fill$3("0",t-r.length)+r}function pad0r2$1(e,t){var r=""+e;return r.length>=t?r:fill$3("0",t-r.length)+r}var p2_32$1=Math.pow(2,32);function pad0r$1(e,t){return e>p2_32$1||e<-p2_32$1?pad0r1$1(e,t):pad0r2$1(Math.round(e),t)}function SSF_isgeneral$1(e,t){return t=t||0,e.length>=7+t&&103==(32|e.charCodeAt(t))&&101==(32|e.charCodeAt(t+1))&&110==(32|e.charCodeAt(t+2))&&101==(32|e.charCodeAt(t+3))&&114==(32|e.charCodeAt(t+4))&&97==(32|e.charCodeAt(t+5))&&108==(32|e.charCodeAt(t+6))}var days$1=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],months$1=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function SSF_init_table$1(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var table_fmt$1={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},SSF_default_map$1={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},SSF_default_str$1={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function SSF_frac$1(e,t,r){for(var n=e<0?-1:1,i=e*n,a=0,o=1,s=0,l=1,c=0,u=0,d=Math.floor(i);c<t&&(s=(d=Math.floor(i))*o+a,u=d*c+l,!(i-d<5e-8));)i=1/(i-d),a=o,o=s,l=c,c=u;if(u>t&&(c>t?(u=l,s=a):(u=c,s=o)),!r)return[0,n*s,u];var h=Math.floor(n*s/u);return[h,n*s-h*u,u]}function SSF_parse_date_code$1(e,t,r){if(e>2958465||e<0)return null;var n=0|e,i=Math.floor(86400*(e-n)),a=0,o=[],s={D:n,T:i,u:86400*(e-n)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),t&&t.date1904&&(n+=1462),s.u>.9999&&(s.u=0,86400==++i&&(s.T=i=0,++n,++s.D)),60===n)o=r?[1317,10,29]:[1900,2,29],a=3;else if(0===n)o=r?[1317,8,29]:[1900,1,0],a=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],a=l.getDay(),n<60&&(a=(a+6)%7),r&&(a=SSF_fix_hijri$1(l,o))}return s.y=o[0],s.m=o[1],s.d=o[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=a,s}var SSFbasedate=new Date(1899,11,31,0,0,0),SSFdnthresh=SSFbasedate.getTime(),SSFbase1904=new Date(1900,2,1,0,0,0);function datenum_local(e,t){var r=e.getTime();return t?r-=1262304e5:e>=SSFbase1904&&(r+=864e5),(r-(SSFdnthresh+6e4*(e.getTimezoneOffset()-SSFbasedate.getTimezoneOffset())))/864e5}function SSF_strip_decimal$1(e){return-1==e.indexOf(".")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function SSF_normalize_exp$1(e){return-1==e.indexOf("E")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function SSF_small_exp$1(e){var t=e<0?12:11,r=SSF_strip_decimal$1(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10)).length<=t?r:e.toExponential(5)}function SSF_large_exp$1(e){var t=SSF_strip_decimal$1(e.toFixed(11));return t.length>(e<0?12:11)||"0"===t||"-0"===t?e.toPrecision(6):t}function SSF_general_num$1(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return SSF_strip_decimal$1(SSF_normalize_exp$1((t>=-4&&t<=-1?e.toPrecision(10+t):Math.abs(t)<=9?SSF_small_exp$1(e):10===t?e.toFixed(10).substr(0,12):SSF_large_exp$1(e)).toUpperCase()))}function SSF_general$1(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?e.toString(10):SSF_general_num$1(e);case"undefined":return"";case"object":if(null==e)return"";if(e instanceof Date)return SSF_format$1(14,datenum_local(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function SSF_fix_hijri$1(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function SSF_write_date$1(e,t,r,n){var i,a="",o=0,s=0,l=r.y,c=0;switch(e){case 98:l=r.y+543;case 121:switch(t.length){case 1:case 2:i=l%100,c=2;break;default:i=l%1e4,c=4}break;case 109:switch(t.length){case 1:case 2:i=r.m,c=t.length;break;case 3:return months$1[r.m-1][1];case 5:return months$1[r.m-1][0];default:return months$1[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:i=r.d,c=t.length;break;case 3:return days$1[r.q][0];default:return days$1[r.q][1]}break;case 104:switch(t.length){case 1:case 2:i=1+(r.H+11)%12,c=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:i=r.H,c=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:i=r.M,c=t.length;break;default:throw"bad minute format: "+t}break;case 115:if("s"!=t&&"ss"!=t&&".0"!=t&&".00"!=t&&".000"!=t)throw"bad second format: "+t;return 0!==r.u||"s"!=t&&"ss"!=t?(s=n>=2?3===n?1e3:100:1===n?10:1,(o=Math.round(s*(r.S+r.u)))>=60*s&&(o=0),"s"===t?0===o?"0":""+o/s:(a=pad0$1(o,2+n),"ss"===t?a.substr(0,2):"."+a.substr(2,t.length-1))):pad0$1(r.S,t.length);case 90:switch(t){case"[h]":case"[hh]":i=24*r.D+r.H;break;case"[m]":case"[mm]":i=60*(24*r.D+r.H)+r.M;break;case"[s]":case"[ss]":i=60*(60*(24*r.D+r.H)+r.M)+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}c=3===t.length?1:2;break;case 101:i=l,c=1}return c>0?pad0$1(i,c):""}function commaify$1(e){if(e.length<=3)return e;for(var t=e.length%3,r=e.substr(0,t);t!=e.length;t+=3)r+=(r.length>0?",":"")+e.substr(t,3);return r}var pct1$1=/%/g;function write_num_pct$1(e,t,r){var n=t.replace(pct1$1,""),i=t.length-n.length;return write_num$1(e,n,r*Math.pow(10,2*i))+fill$3("%",i)}function write_num_cm$1(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return write_num$1(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function write_num_exp$1(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+write_num_exp$1(e,-t);var i=e.indexOf(".");-1===i&&(i=e.indexOf("E"));var a=Math.floor(Math.log(t)*Math.LOG10E)%i;if(a<0&&(a+=i),-1===(r=(t/Math.pow(10,a)).toPrecision(n+1+(i+a)%i)).indexOf("e")){var o=Math.floor(Math.log(t)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+a):r+="E+"+(o-a);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,i)+"."+r.substr(2+i)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,r,n){return t+r+n.substr(0,(i+a)%i)+"."+n.substr(a)+"E"}))}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var frac1$1=/# (\?+)( ?)\/( ?)(\d+)/;function write_num_f1$1(e,t,r){var n=parseInt(e[4],10),i=Math.round(t*n),a=Math.floor(i/n),o=i-a*n,s=n;return r+(0===a?"":""+a)+" "+(0===o?fill$3(" ",e[1].length+1+e[4].length):pad_$1(o,e[1].length)+e[2]+"/"+e[3]+pad0$1(s,e[4].length))}function write_num_f2$1(e,t,r){return r+(0===t?"":""+t)+fill$3(" ",e[1].length+2+e[4].length)}var dec1$1=/^#*0*\.([0#]+)/,closeparen$1=/\).*[0#]/,phone$1=/\(###\) ###\\?-####/;function hashq$1(e){for(var t,r="",n=0;n!=e.length;++n)switch(t=e.charCodeAt(n)){case 35:break;case 63:r+=" ";break;case 48:r+="0";break;default:r+=String.fromCharCode(t)}return r}function rnd$1(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function dec$1(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function carry$1(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function flr$1(e){return e<0x7fffffff&&e>-0x80000000?""+(e>=0?0|e:e-1|0):""+Math.floor(e)}function write_num_flt$1(e,t,r){if(40===e.charCodeAt(0)&&!t.match(closeparen$1)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?write_num_flt$1("n",n,r):"("+write_num_flt$1("n",n,-r)+")"}if(44===t.charCodeAt(t.length-1))return write_num_cm$1(e,t,r);if(-1!==t.indexOf("%"))return write_num_pct$1(e,t,r);if(-1!==t.indexOf("E"))return write_num_exp$1(t,r);if(36===t.charCodeAt(0))return"$"+write_num_flt$1(e,t.substr(" "==t.charAt(1)?2:1),r);var i,a,o,s,l=Math.abs(r),c=r<0?"-":"";if(t.match(/^00+$/))return c+pad0r$1(l,t.length);if(t.match(/^[#?]+$/))return"0"===(i=pad0r$1(r,0))&&(i=""),i.length>t.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(frac1$1))return write_num_f1$1(a,l,c);if(t.match(/^#+0+$/))return c+pad0r$1(l,t.length-t.indexOf("0"));if(a=t.match(dec1$1))return i=rnd$1(r,a[1].length).replace(/^([^\.]+)$/,"$1."+hashq$1(a[1])).replace(/\.$/,"."+hashq$1(a[1])).replace(/\.(\d*)$/,(function(e,t){return"."+t+fill$3("0",hashq$1(a[1]).length-t.length)})),-1!==t.indexOf("0.")?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),a=t.match(/^(0*)\.(#*)$/))return c+rnd$1(l,a[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=t.match(/^#{1,3},##0(\.?)$/))return c+commaify$1(pad0r$1(l,0));if(a=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+write_num_flt$1(e,t,-r):commaify$1(""+(Math.floor(r)+carry$1(r,a[1].length)))+"."+pad0$1(dec$1(r,a[1].length),a[1].length);if(a=t.match(/^#,#*,#0/))return write_num_flt$1(e,t.replace(/^#,#*,/,""),r);if(a=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=_strrev$1(write_num_flt$1(e,t.replace(/[\\-]/g,""),r)),o=0,_strrev$1(_strrev$1(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return o<i.length?i.charAt(o++):"0"===e?"0":""})));if(t.match(phone$1))return"("+(i=write_num_flt$1(e,"##########",r)).substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(a=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(a[4].length,7),s=SSF_frac$1(l,Math.pow(10,o)-1,!1),i=""+c," "==(u=write_num$1("n",a[1],s[1])).charAt(u.length-1)&&(u=u.substr(0,u.length-1)+"0"),i+=u+a[2]+"/"+a[3],(u=rpad_$1(s[2],o)).length<a[4].length&&(u=hashq$1(a[4].substr(a[4].length-u.length))+u),i+=u;if(a=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(a[1].length,a[4].length),7),c+((s=SSF_frac$1(l,Math.pow(10,o)-1,!0))[0]||(s[1]?"":"0"))+" "+(s[1]?pad_$1(s[1],o)+a[2]+"/"+a[3]+rpad_$1(s[2],o):fill$3(" ",2*o+1+a[2].length+a[3].length));if(a=t.match(/^[#0?]+$/))return i=pad0r$1(r,0),t.length<=i.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(/^([#0?]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var d=t.indexOf(".")-o,h=t.length-i.length-d;return hashq$1(t.substr(0,d)+i+t.substr(t.length-h))}if(a=t.match(/^00,000\.([#0]*0)$/))return o=dec$1(r,a[1].length),r<0?"-"+write_num_flt$1(e,t,-r):commaify$1(flr$1(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?pad0$1(0,3-e.length):"")+e}))+"."+pad0$1(o,a[1].length);switch(t){case"###,##0.00":return write_num_flt$1(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var p=commaify$1(pad0r$1(l,0));return"0"!==p?c+p:"";case"###,###.00":return write_num_flt$1(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return write_num_flt$1(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function write_num_cm2$1(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return write_num$1(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function write_num_pct2$1(e,t,r){var n=t.replace(pct1$1,""),i=t.length-n.length;return write_num$1(e,n,r*Math.pow(10,2*i))+fill$3("%",i)}function write_num_exp2$1(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+write_num_exp2$1(e,-t);var i=e.indexOf(".");-1===i&&(i=e.indexOf("E"));var a=Math.floor(Math.log(t)*Math.LOG10E)%i;if(a<0&&(a+=i),!(r=(t/Math.pow(10,a)).toPrecision(n+1+(i+a)%i)).match(/[Ee]/)){var o=Math.floor(Math.log(t)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+a):r+="E+"+(o-a),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,r,n){return t+r+n.substr(0,(i+a)%i)+"."+n.substr(a)+"E"}))}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function write_num_int$1(e,t,r){if(40===e.charCodeAt(0)&&!t.match(closeparen$1)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?write_num_int$1("n",n,r):"("+write_num_int$1("n",n,-r)+")"}if(44===t.charCodeAt(t.length-1))return write_num_cm2$1(e,t,r);if(-1!==t.indexOf("%"))return write_num_pct2$1(e,t,r);if(-1!==t.indexOf("E"))return write_num_exp2$1(t,r);if(36===t.charCodeAt(0))return"$"+write_num_int$1(e,t.substr(" "==t.charAt(1)?2:1),r);var i,a,o,s,l=Math.abs(r),c=r<0?"-":"";if(t.match(/^00+$/))return c+pad0$1(l,t.length);if(t.match(/^[#?]+$/))return i=""+r,0===r&&(i=""),i.length>t.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(frac1$1))return write_num_f2$1(a,l,c);if(t.match(/^#+0+$/))return c+pad0$1(l,t.length-t.indexOf("0"));if(a=t.match(dec1$1))return i=(i=(""+r).replace(/^([^\.]+)$/,"$1."+hashq$1(a[1])).replace(/\.$/,"."+hashq$1(a[1]))).replace(/\.(\d*)$/,(function(e,t){return"."+t+fill$3("0",hashq$1(a[1]).length-t.length)})),-1!==t.indexOf("0.")?i:i.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),a=t.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=t.match(/^#{1,3},##0(\.?)$/))return c+commaify$1(""+l);if(a=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+write_num_int$1(e,t,-r):commaify$1(""+r)+"."+fill$3("0",a[1].length);if(a=t.match(/^#,#*,#0/))return write_num_int$1(e,t.replace(/^#,#*,/,""),r);if(a=t.match(/^([0#]+)(\\?-([0#]+))+$/))return i=_strrev$1(write_num_int$1(e,t.replace(/[\\-]/g,""),r)),o=0,_strrev$1(_strrev$1(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return o<i.length?i.charAt(o++):"0"===e?"0":""})));if(t.match(phone$1))return"("+(i=write_num_int$1(e,"##########",r)).substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(a=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(a[4].length,7),s=SSF_frac$1(l,Math.pow(10,o)-1,!1),i=""+c," "==(u=write_num$1("n",a[1],s[1])).charAt(u.length-1)&&(u=u.substr(0,u.length-1)+"0"),i+=u+a[2]+"/"+a[3],(u=rpad_$1(s[2],o)).length<a[4].length&&(u=hashq$1(a[4].substr(a[4].length-u.length))+u),i+=u;if(a=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(a[1].length,a[4].length),7),c+((s=SSF_frac$1(l,Math.pow(10,o)-1,!0))[0]||(s[1]?"":"0"))+" "+(s[1]?pad_$1(s[1],o)+a[2]+"/"+a[3]+rpad_$1(s[2],o):fill$3(" ",2*o+1+a[2].length+a[3].length));if(a=t.match(/^[#0?]+$/))return i=""+r,t.length<=i.length?i:hashq$1(t.substr(0,t.length-i.length))+i;if(a=t.match(/^([#0]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var d=t.indexOf(".")-o,h=t.length-i.length-d;return hashq$1(t.substr(0,d)+i+t.substr(t.length-h))}if(a=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+write_num_int$1(e,t,-r):commaify$1(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?pad0$1(0,3-e.length):"")+e}))+"."+pad0$1(0,a[1].length);switch(t){case"###,###":case"##,###":case"#,###":var p=commaify$1(""+l);return"0"!==p?c+p:"";default:if(t.match(/\.[0#?]*$/))return write_num_int$1(e,t.slice(0,t.lastIndexOf(".")),r)+hashq$1(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function write_num$1(e,t,r){return(0|r)===r?write_num_int$1(e,t,r):write_num_flt$1(e,t,r)}function SSF_split_fmt$1(e){for(var t=[],r=!1,n=0,i=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(i,n-i),i=n+1}if(t[t.length]=e.substr(i),!0===r)throw new Error("Format |"+e+"| unterminated string ");return t}var SSF_abstime$1=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function fmt_is_date$1(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":SSF_isgeneral$1(e,t)&&(t+=6),t++;break;case'"':for(;34!==e.charCodeAt(++t)&&t<e.length;);++t;break;case"\\":case"_":t+=2;break;case"@":++t;break;case"B":case"b":if("1"===e.charAt(t+1)||"2"===e.charAt(t+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===e.substr(t,3).toUpperCase())return!0;if("AM/PM"===e.substr(t,5).toUpperCase())return!0;if("上午/下午"===e.substr(t,5).toUpperCase())return!0;++t;break;case"[":for(n=r;"]"!==e.charAt(t++)&&t<e.length;)n+=e.charAt(t);if(n.match(SSF_abstime$1))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||"\\"==r&&"-"==e.charAt(t+1)&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t," "!=e.charAt(t)&&"*"!=e.charAt(t)||++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;default:++t}return!1}function eval_fmt$1(e,t,r,n){for(var i,a,o,s=[],l="",c=0,u="",d="t",h="H";c<e.length;)switch(u=e.charAt(c)){case"G":if(!SSF_isgeneral$1(e,c))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"G",v:"General"},c+=7;break;case'"':for(l="";34!==(o=e.charCodeAt(++c))&&c<e.length;)l+=String.fromCharCode(o);s[s.length]={t:"t",v:l},++c;break;case"\\":var p=e.charAt(++c),f="("===p||")"===p?p:"t";s[s.length]={t:f,v:p},++c;break;case"_":s[s.length]={t:"t",v:" "},c+=2;break;case"@":s[s.length]={t:"T",v:t},++c;break;case"B":case"b":if("1"===e.charAt(c+1)||"2"===e.charAt(c+1)){if(null==i&&null==(i=SSF_parse_date_code$1(t,r,"2"===e.charAt(c+1))))return"";s[s.length]={t:"X",v:e.substr(c,2)},d=u,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":u=u.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0)return"";if(null==i&&null==(i=SSF_parse_date_code$1(t,r)))return"";for(l=u;++c<e.length&&e.charAt(c).toLowerCase()===u;)l+=u;"m"===u&&"h"===d.toLowerCase()&&(u="M"),"h"===u&&(u=h),s[s.length]={t:u,v:l},d=u;break;case"A":case"a":case"上":var m={t:u,v:u};if(null==i&&(i=SSF_parse_date_code$1(t,r)),"A/P"===e.substr(c,3).toUpperCase()?(null!=i&&(m.v=i.H>=12?"P":"A"),m.t="T",h="h",c+=3):"AM/PM"===e.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"PM":"AM"),m.t="T",c+=5,h="h"):"上午/下午"===e.substr(c,5).toUpperCase()?(null!=i&&(m.v=i.H>=12?"下午":"上午"),m.t="T",c+=5,h="h"):(m.t="t",++c),null==i&&"T"===m.t)return"";s[s.length]=m,d=u;break;case"[":for(l=u;"]"!==e.charAt(c++)&&c<e.length;)l+=e.charAt(c);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(SSF_abstime$1)){if(null==i&&null==(i=SSF_parse_date_code$1(t,r)))return"";s[s.length]={t:"Z",v:l.toLowerCase()},d=l.charAt(1)}else l.indexOf("$")>-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",fmt_is_date$1(e)||(s[s.length]={t:"t",v:l}));break;case".":if(null!=i){for(l=u;++c<e.length&&"0"===(u=e.charAt(c));)l+=u;s[s.length]={t:"s",v:l};break}case"0":case"#":for(l=u;++c<e.length&&"0#?.,E+-%".indexOf(u=e.charAt(c))>-1;)l+=u;s[s.length]={t:"n",v:l};break;case"?":for(l=u;e.charAt(++c)===u;)l+=u;s[s.length]={t:u,v:l},d=u;break;case"*":++c," "!=e.charAt(c)&&"*"!=e.charAt(c)||++c;break;case"(":case")":s[s.length]={t:1===n?"t":u,v:u},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=u;c<e.length&&"0123456789".indexOf(e.charAt(++c))>-1;)l+=e.charAt(c);s[s.length]={t:"D",v:l};break;case" ":s[s.length]={t:u,v:u},++c;break;case"$":s[s.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(u))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"t",v:u},++c}var g,_=0,y=0;for(c=s.length-1,d="t";c>=0;--c)switch(s[c].t){case"h":case"H":s[c].t=h,d="h",_<1&&(_=1);break;case"s":(g=s[c].v.match(/\.0+$/))&&(y=Math.max(y,g[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":d=s[c].t;break;case"m":"s"===d&&(s[c].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&s[c].v.match(/[Hh]/)&&(_=1),_<2&&s[c].v.match(/[Mm]/)&&(_=2),_<3&&s[c].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M),i.M>=60&&(i.M=0,++i.H);break;case 2:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M)}var b,v="";for(c=0;c<s.length;++c)switch(s[c].t){case"t":case"T":case" ":case"D":break;case"X":s[c].v="",s[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[c].v=SSF_write_date$1(s[c].t.charCodeAt(0),s[c].v,i,y),s[c].t="t";break;case"n":case"?":for(b=c+1;null!=s[b]&&("?"===(u=s[b].t)||"D"===u||(" "===u||"t"===u)&&null!=s[b+1]&&("?"===s[b+1].t||"t"===s[b+1].t&&"/"===s[b+1].v)||"("===s[c].t&&(" "===u||"n"===u||")"===u)||"t"===u&&("/"===s[b].v||" "===s[b].v&&null!=s[b+1]&&"?"==s[b+1].t));)s[c].v+=s[b].v,s[b]={v:"",t:";"},++b;v+=s[c].v,c=b-1;break;case"G":s[c].t="t",s[c].v=SSF_general$1(t,r)}var S,w,T="";if(v.length>0){40==v.charCodeAt(0)?(S=t<0&&45===v.charCodeAt(0)?-t:t,w=write_num$1("n",v,S)):(w=write_num$1("n",v,S=t<0&&n>1?-t:t),S<0&&s[0]&&"t"==s[0].t&&(w=w.substr(1),s[0].v="-"+s[0].v)),b=w.length-1;var E=s.length;for(c=0;c<s.length;++c)if(null!=s[c]&&"t"!=s[c].t&&s[c].v.indexOf(".")>-1){E=c;break}var x=s.length;if(E===s.length&&-1===w.indexOf("E")){for(c=s.length-1;c>=0;--c)null!=s[c]&&-1!=="n?".indexOf(s[c].t)&&(b>=s[c].v.length-1?(b-=s[c].v.length,s[c].v=w.substr(b+1,s[c].v.length)):b<0?s[c].v="":(s[c].v=w.substr(0,b+1),b=-1),s[c].t="t",x=c);b>=0&&x<s.length&&(s[x].v=w.substr(0,b+1)+s[x].v)}else if(E!==s.length&&-1===w.indexOf("E")){for(b=w.indexOf(".")-1,c=E;c>=0;--c)if(null!=s[c]&&-1!=="n?".indexOf(s[c].t)){for(a=s[c].v.indexOf(".")>-1&&c===E?s[c].v.indexOf(".")-1:s[c].v.length-1,T=s[c].v.substr(a+1);a>=0;--a)b>=0&&("0"===s[c].v.charAt(a)||"#"===s[c].v.charAt(a))&&(T=w.charAt(b--)+T);s[c].v=T,s[c].t="t",x=c}for(b>=0&&x<s.length&&(s[x].v=w.substr(0,b+1)+s[x].v),b=w.indexOf(".")+1,c=E;c<s.length;++c)if(null!=s[c]&&(-1!=="n?(".indexOf(s[c].t)||c===E)){for(a=s[c].v.indexOf(".")>-1&&c===E?s[c].v.indexOf(".")+1:0,T=s[c].v.substr(0,a);a<s[c].v.length;++a)b<w.length&&(T+=w.charAt(b++));s[c].v=T,s[c].t="t",x=c}}}for(c=0;c<s.length;++c)null!=s[c]&&"n?".indexOf(s[c].t)>-1&&(S=n>1&&t<0&&c>0&&"-"===s[c-1].v?-t:t,s[c].v=write_num$1(s[c].t,s[c].v,S),s[c].t="t");var A="";for(c=0;c!==s.length;++c)null!=s[c]&&(A+=s[c].v);return A}var cfregex2$1=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function chkcond$1(e,t){if(null==t)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0}return!1}function choose_fmt$1(e,t){var r=SSF_split_fmt$1(e),n=r.length,i=r[n-1].indexOf("@");if(n<4&&i>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if("number"!=typeof t)return[4,4===r.length||i>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=i>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=i>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=i>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"]}var a=t>0?r[0]:t<0?r[1]:r[2];if(-1===r[0].indexOf("[")&&-1===r[1].indexOf("["))return[n,a];if(null!=r[0].match(/\[[=<>]/)||null!=r[1].match(/\[[=<>]/)){var o=r[0].match(cfregex2$1),s=r[1].match(cfregex2$1);return chkcond$1(t,o)?[n,r[0]]:chkcond$1(t,s)?[n,r[1]]:[n,r[null!=o&&null!=s?2:1]]}return[n,a]}function SSF_format$1(e,t,r){null==r&&(r={});var n="";switch(typeof e){case"string":n="m/d/yy"==e&&r.dateNF?r.dateNF:e;break;case"number":null==(n=14==e&&r.dateNF?r.dateNF:(null!=r.table?r.table:table_fmt$1)[e])&&(n=r.table&&r.table[SSF_default_map$1[e]]||table_fmt$1[SSF_default_map$1[e]]),null==n&&(n=SSF_default_str$1[e]||"General")}if(SSF_isgeneral$1(n,0))return SSF_general$1(t,r);t instanceof Date&&(t=datenum_local(t,r.date1904));var i=choose_fmt$1(n,t);if(SSF_isgeneral$1(i[1]))return SSF_general$1(t,r);if(!0===t)t="TRUE";else if(!1===t)t="FALSE";else if(""===t||null==t)return"";return eval_fmt$1(i[1],t,r,i[0])}function SSF_load$1(e,t){if("number"!=typeof t){t=+t||-1;for(var r=0;r<392;++r)if(null!=table_fmt$1[r]){if(table_fmt$1[r]==e){t=r;break}}else t<0&&(t=r);t<0&&(t=391)}return table_fmt$1[t]=e,t}function make_ssf$1(){table_fmt$1=SSF_init_table$1()}var SSFImplicit$1={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},dateNFregex$1=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function dateNF_regex$1(e){var t="number"==typeof e?table_fmt$1[e]:e;return t=t.replace(dateNFregex$1,"(\\d+)"),new RegExp("^"+t+"$")}function dateNF_fix$1(e,t,r){var n=-1,i=-1,a=-1,o=-1,s=-1,l=-1;(t.match(dateNFregex$1)||[]).forEach((function(e,t){var c=parseInt(r[t+1],10);switch(e.toLowerCase().charAt(0)){case"y":n=c;break;case"d":a=c;break;case"h":o=c;break;case"s":l=c;break;case"m":o>=0?s=c:i=c}})),l>=0&&-1==s&&i>=0&&(s=i,i=-1);var c=(""+(n>=0?n:(new Date).getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(a>=1?a:1)).slice(-2);7==c.length&&(c="0"+c),8==c.length&&(c="20"+c);var u=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return-1==o&&-1==s&&-1==l?c:-1==n&&-1==i&&-1==a?u:c+"T"+u}var CRC32$1=function(){var e={};e.version="1.2.0";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}();var r=function(e){var t=0,r=0,n=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)i[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=i[t]=r>>>8^e[255&r];var a=[];for(n=1;16!=n;++n)a[n-1]="undefined"!=typeof Int32Array?i.subarray(256*n,256*n+256):i.slice(256*n,256*n+256);return a}(t),n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],c=r[6],u=r[7],d=r[8],h=r[9],p=r[10],f=r[11],m=r[12],g=r[13],_=r[14];return e.table=t,e.bstr=function(e,r){for(var n=~r,i=0,a=e.length;i<a;)n=n>>>8^t[255&(n^e.charCodeAt(i++))];return~n},e.buf=function(e,r){for(var y=~r,b=e.length-15,v=0;v<b;)y=_[e[v++]^255&y]^g[e[v++]^y>>8&255]^m[e[v++]^y>>16&255]^f[e[v++]^y>>>24]^p[e[v++]]^h[e[v++]]^d[e[v++]]^u[e[v++]]^c[e[v++]]^l[e[v++]]^s[e[v++]]^o[e[v++]]^a[e[v++]]^i[e[v++]]^n[e[v++]]^t[e[v++]];for(b+=15;v<b;)y=y>>>8^t[255&(y^e[v++])];return~y},e.str=function(e,r){for(var n=~r,i=0,a=e.length,o=0,s=0;i<a;)(o=e.charCodeAt(i++))<128?n=n>>>8^t[255&(n^o)]:o<2048?n=(n=n>>>8^t[255&(n^(192|o>>6&31))])>>>8^t[255&(n^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),s=1023&e.charCodeAt(i++),n=(n=(n=(n=n>>>8^t[255&(n^(240|o>>8&7))])>>>8^t[255&(n^(128|o>>2&63))])>>>8^t[255&(n^(128|s>>6&15|(3&o)<<4))])>>>8^t[255&(n^(128|63&s))]):n=(n=(n=n>>>8^t[255&(n^(224|o>>12&15))])>>>8^t[255&(n^(128|o>>6&63))])>>>8^t[255&(n^(128|63&o))];return~n},e}(),CFB$1=function(){var e,t={};function r(e){if("/"==e.charAt(e.length-1))return-1===e.slice(0,-1).indexOf("/")?e:r(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(0,t+1)}function n(e){if("/"==e.charAt(e.length-1))return n(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(t+1)}function i(e,t){"string"==typeof t&&(t=new Date(t));var r=t.getHours();r=(r=r<<6|t.getMinutes())<<5|t.getSeconds()>>>1,e.write_shift(2,r);var n=t.getFullYear()-1980;n=(n=n<<4|t.getMonth()+1)<<5|t.getDate(),e.write_shift(2,n)}function a(e){prep_blob$1(e,0);for(var t={},r=0;e.l<=e.length-4;){var n=e.read_shift(2),i=e.read_shift(2),a=e.l+i,o={};if(21589===n)1&(r=e.read_shift(1))&&(o.mtime=e.read_shift(4)),i>5&&(2&r&&(o.atime=e.read_shift(4)),4&r&&(o.ctime=e.read_shift(4))),o.mtime&&(o.mt=new Date(1e3*o.mtime));e.l=a,t[n]=o}return t}function o(){return e||(e={})}function s(e,t){if(80==e[0]&&75==e[1])return ne(e,t);if(109==(32|e[0])&&105==(32|e[1]))return function(e,t){if("mime-version:"!=w(e.slice(0,13)).toLowerCase())throw new Error("Unsupported MAD header");var r=t&&t.root||"",n=(has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):w(e)).split("\r\n"),i=0,a="";for(i=0;i<n.length;++i)if(a=n[i],/^Content-Location:/i.test(a)&&(a=a.slice(a.indexOf("file")),r||(r=a.slice(0,a.lastIndexOf("/")+1)),a.slice(0,r.length)!=r))for(;r.length>0&&(r=(r=r.slice(0,r.length-1)).slice(0,r.lastIndexOf("/")+1),a.slice(0,r.length)!=r););var o=(n[1]||"").match(/boundary="(.*?)"/);if(!o)throw new Error("MAD cannot find boundary");var s="--"+(o[1]||""),l=[],c=[],u={FileIndex:l,FullPaths:c};h(u);var d,p=0;for(i=0;i<n.length;++i){var f=n[i];f!==s&&f!==s+"--"||(p++&&ce(u,n.slice(d,i),r),d=i)}return u}(e,t);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var r,n,i,a,o,s,p=512,f=[],m=e.slice(0,512);prep_blob$1(m,0);var g=function(e){if(80==e[e.l]&&75==e[e.l+1])return[0,0];e.chk(y,"Header Signature: "),e.l+=16;var t=e.read_shift(2,"u");return[e.read_shift(2,"u"),t]}(m);switch(r=g[0]){case 3:p=512;break;case 4:p=4096;break;case 0:if(0==g[1])return ne(e,t);default:throw new Error("Major Version: Expected 3 or 4 saw "+r)}512!==p&&prep_blob$1(m=e.slice(0,p),28);var b=e.slice(0,p);!function(e,t){var r=9;switch(e.l+=2,r=e.read_shift(2)){case 9:if(3!=t)throw new Error("Sector Shift: Expected 9 saw "+r);break;case 12:if(4!=t)throw new Error("Sector Shift: Expected 12 saw "+r);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+r)}e.chk("0600","Mini Sector Shift: "),e.chk("000000000000","Reserved: ")}(m,r);var v=m.read_shift(4,"i");if(3===r&&0!==v)throw new Error("# Directory Sectors: Expected 0 saw "+v);m.l+=4,a=m.read_shift(4,"i"),m.l+=4,m.chk("00100000","Mini Stream Cutoff Size: "),o=m.read_shift(4,"i"),n=m.read_shift(4,"i"),s=m.read_shift(4,"i"),i=m.read_shift(4,"i");for(var S=-1,T=0;T<109&&!((S=m.read_shift(4,"i"))<0);++T)f[T]=S;var E=function(e,t){for(var r=Math.ceil(e.length/t)-1,n=[],i=1;i<r;++i)n[i-1]=e.slice(i*t,(i+1)*t);return n[r-1]=e.slice(r*t),n}(e,p);c(s,i,E,p,f);var x=function(e,t,r,n){var i=e.length,a=[],o=[],s=[],l=[],c=n-1,u=0,d=0,h=0,p=0;for(u=0;u<i;++u)if(s=[],(h=u+t)>=i&&(h-=i),!o[h]){l=[];var f=[];for(d=h;d>=0;){f[d]=!0,o[d]=!0,s[s.length]=d,l.push(e[d]);var m=r[Math.floor(4*d/n)];if(n<4+(p=4*d&c))throw new Error("FAT boundary crossed: "+d+" 4 "+n);if(!e[m])break;if(f[d=__readInt32LE$1(e[m],p)])break}a[h]={nodes:s,data:__toBuffer$1([l])}}return a}(E,a,f,p);x[a].name="!Directory",n>0&&o!==_&&(x[o].name="!MiniFAT"),x[f[0]].name="!FAT",x.fat_addrs=f,x.ssz=p;var A=[],C=[],R=[];!function(e,t,r,n,i,a,o,s){for(var c,h=0,p=n.length?2:0,f=t[e].data,m=0,g=0;m<f.length;m+=128){var y=f.slice(m,m+128);prep_blob$1(y,64),g=y.read_shift(2),c=__utf16le$1(y,0,g-p),n.push(c);var b={name:c,type:y.read_shift(1),color:y.read_shift(1),L:y.read_shift(4,"i"),R:y.read_shift(4,"i"),C:y.read_shift(4,"i"),clsid:y.read_shift(16),state:y.read_shift(4,"i"),start:0,size:0};0!==y.read_shift(2)+y.read_shift(2)+y.read_shift(2)+y.read_shift(2)&&(b.ct=d(y,y.l-8)),0!==y.read_shift(2)+y.read_shift(2)+y.read_shift(2)+y.read_shift(2)&&(b.mt=d(y,y.l-8)),b.start=y.read_shift(4,"i"),b.size=y.read_shift(4,"i"),b.size<0&&b.start<0&&(b.size=b.type=0,b.start=_,b.name=""),5===b.type?(h=b.start,i>0&&h!==_&&(t[h].name="!StreamData")):b.size>=4096?(b.storage="fat",void 0===t[b.start]&&(t[b.start]=u(r,b.start,t.fat_addrs,t.ssz)),t[b.start].name=b.name,b.content=t[b.start].data.slice(0,b.size)):(b.storage="minifat",b.size<0?b.size=0:h!==_&&b.start!==_&&t[h]&&(b.content=l(b,t[h].data,(t[s]||{}).data))),b.content&&prep_blob$1(b.content,0),a[c]=b,o.push(b)}}(a,x,E,A,n,{},C,o),function(e,t,r){for(var n=0,i=0,a=0,o=0,s=0,l=r.length,c=[],u=[];n<l;++n)c[n]=u[n]=n,t[n]=r[n];for(;s<u.length;++s)i=e[n=u[s]].L,a=e[n].R,o=e[n].C,c[n]===n&&(-1!==i&&c[i]!==i&&(c[n]=c[i]),-1!==a&&c[a]!==a&&(c[n]=c[a])),-1!==o&&(c[o]=n),-1!==i&&n!=c[n]&&(c[i]=c[n],u.lastIndexOf(i)<s&&u.push(i)),-1!==a&&n!=c[n]&&(c[a]=c[n],u.lastIndexOf(a)<s&&u.push(a));for(n=1;n<l;++n)c[n]===n&&(-1!==a&&c[a]!==a?c[n]=c[a]:-1!==i&&c[i]!==i&&(c[n]=c[i]));for(n=1;n<l;++n)if(0!==e[n].type){if((s=n)!=c[s])do{s=c[s],t[n]=t[s]+"/"+t[n]}while(0!==s&&-1!==c[s]&&s!=c[s]);c[n]=-1}for(t[0]+="/",n=1;n<l;++n)2!==e[n].type&&(t[n]+="/")}(C,R,A),A.shift();var D={FileIndex:C,FullPaths:R};return t&&t.raw&&(D.raw={header:b,sectors:E}),D}function l(e,t,r){for(var n=e.start,i=e.size,a=[],o=n;r&&i>0&&o>=0;)a.push(t.slice(o*g,o*g+g)),i-=g,o=__readInt32LE$1(r,4*o);return 0===a.length?new_buf$1(0):bconcat$1(a).slice(0,e.size)}function c(e,t,r,n,i){var a=_;if(e===_){if(0!==t)throw new Error("DIFAT chain shorter than expected")}else if(-1!==e){var o=r[e],s=(n>>>2)-1;if(!o)return;for(var l=0;l<s&&(a=__readInt32LE$1(o,4*l))!==_;++l)i.push(a);c(__readInt32LE$1(o,n-4),t-1,r,n,i)}}function u(e,t,r,n,i){var a=[],o=[];i||(i=[]);var s=n-1,l=0,c=0;for(l=t;l>=0;){i[l]=!0,a[a.length]=l,o.push(e[l]);var u=r[Math.floor(4*l/n)];if(n<4+(c=4*l&s))throw new Error("FAT boundary crossed: "+l+" 4 "+n);if(!e[u])break;l=__readInt32LE$1(e[u],c)}return{nodes:a,data:__toBuffer$1([o])}}function d(e,t){return new Date(1e3*(__readUInt32LE$1(e,t+4)/1e7*Math.pow(2,32)+__readUInt32LE$1(e,t)/1e7-0x2b6109100))}function h(e,t){var r=t||{},n=r.root||"Root Entry";if(e.FullPaths||(e.FullPaths=[]),e.FileIndex||(e.FileIndex=[]),e.FullPaths.length!==e.FileIndex.length)throw new Error("inconsistent CFB structure");0===e.FullPaths.length&&(e.FullPaths[0]=n+"/",e.FileIndex[0]={name:n,type:5}),r.CLSID&&(e.FileIndex[0].clsid=r.CLSID),function(e){var t="\x01Sh33tJ5";if(CFB$1.find(e,"/"+t))return;var r=new_buf$1(4);r[0]=55,r[1]=r[3]=50,r[2]=54,e.FileIndex.push({name:t,type:2,content:r,size:4,L:69,R:69,C:69}),e.FullPaths.push(e.FullPaths[0]+t),p(e)}(e)}function p(e,t){h(e);for(var i=!1,a=!1,o=e.FullPaths.length-1;o>=0;--o){var s=e.FileIndex[o];switch(s.type){case 0:a?i=!0:(e.FileIndex.pop(),e.FullPaths.pop());break;case 1:case 2:case 5:a=!0,isNaN(s.R*s.L*s.C)&&(i=!0),s.R>-1&&s.L>-1&&s.R==s.L&&(i=!0);break;default:i=!0}}if(i||t){var l=new Date(1987,1,19),c=0,u=Object.create?Object.create(null):{},d=[];for(o=0;o<e.FullPaths.length;++o)u[e.FullPaths[o]]=!0,0!==e.FileIndex[o].type&&d.push([e.FullPaths[o],e.FileIndex[o]]);for(o=0;o<d.length;++o){var p=r(d[o][0]);(a=u[p])||(d.push([p,{name:n(p).replace("/",""),type:1,clsid:v,ct:l,mt:l,content:null}]),u[p]=!0)}for(d.sort((function(e,t){return function(e,t){for(var r=e.split("/"),n=t.split("/"),i=0,a=0,o=Math.min(r.length,n.length);i<o;++i){if(a=r[i].length-n[i].length)return a;if(r[i]!=n[i])return r[i]<n[i]?-1:1}return r.length-n.length}(e[0],t[0])})),e.FullPaths=[],e.FileIndex=[],o=0;o<d.length;++o)e.FullPaths[o]=d[o][0],e.FileIndex[o]=d[o][1];for(o=0;o<d.length;++o){var f=e.FileIndex[o],m=e.FullPaths[o];if(f.name=n(m).replace("/",""),f.L=f.R=f.C=-(f.color=1),f.size=f.content?f.content.length:0,f.start=0,f.clsid=f.clsid||v,0===o)f.C=d.length>1?1:-1,f.size=0,f.type=5;else if("/"==m.slice(-1)){for(c=o+1;c<d.length&&r(e.FullPaths[c])!=m;++c);for(f.C=c>=d.length?-1:c,c=o+1;c<d.length&&r(e.FullPaths[c])!=r(m);++c);f.R=c>=d.length?-1:c,f.type=1}else r(e.FullPaths[o+1]||"")==r(m)&&(f.R=o+1),f.type=2}}}function f(e,t){var r=t||{};if("mad"==r.fileType)return function(e,t){for(var r=t||{},n=r.boundary||"SheetJS",i=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+(n="------="+n).slice(2)+'"',"","",""],a=e.FullPaths[0],o=a,s=e.FileIndex[0],l=1;l<e.FullPaths.length;++l)if(o=e.FullPaths[l].slice(a.length),(s=e.FileIndex[l]).size&&s.content&&"\x01Sh33tJ5"!=o){o=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,(function(e){return"_x"+e.charCodeAt(0).toString(16)+"_"})).replace(/[\u0080-\uFFFF]/g,(function(e){return"_u"+e.charCodeAt(0).toString(16)+"_"}));for(var c=s.content,u=has_buf$1&&Buffer.isBuffer(c)?c.toString("binary"):w(c),d=0,h=Math.min(1024,u.length),p=0,f=0;f<=h;++f)(p=u.charCodeAt(f))>=32&&p<128&&++d;var m=d>=4*h/5;i.push(n),i.push("Content-Location: "+(r.root||"file:///C:/SheetJS/")+o),i.push("Content-Transfer-Encoding: "+(m?"quoted-printable":"base64")),i.push("Content-Type: "+oe(s,o)),i.push(""),i.push(m?le(u):se(u))}return i.push(n+"--\r\n"),i.join("\r\n")}(e,r);if(p(e),"zip"===r.fileType)return function(e,t){var r=t||{},n=[],a=[],o=new_buf$1(1),s=r.compression?8:0,l=0,c=0,u=0,d=0,h=0,p=e.FullPaths[0],f=p,m=e.FileIndex[0],g=[],_=0;for(c=1;c<e.FullPaths.length;++c)if(f=e.FullPaths[c].slice(p.length),(m=e.FileIndex[c]).size&&m.content&&"\x01Sh33tJ5"!=f){var y=d,b=new_buf$1(f.length);for(u=0;u<f.length;++u)b.write_shift(1,127&f.charCodeAt(u));b=b.slice(0,b.l),g[h]=CRC32$1.buf(m.content,0);var v=m.content;8==s&&(v=T(v)),(o=new_buf$1(30)).write_shift(4,0x4034b50),o.write_shift(2,20),o.write_shift(2,l),o.write_shift(2,s),m.mt?i(o,m.mt):o.write_shift(4,0),o.write_shift(-4,g[h]),o.write_shift(4,v.length),o.write_shift(4,m.content.length),o.write_shift(2,b.length),o.write_shift(2,0),d+=o.length,n.push(o),d+=b.length,n.push(b),d+=v.length,n.push(v),(o=new_buf$1(46)).write_shift(4,0x2014b50),o.write_shift(2,0),o.write_shift(2,20),o.write_shift(2,l),o.write_shift(2,s),o.write_shift(4,0),o.write_shift(-4,g[h]),o.write_shift(4,v.length),o.write_shift(4,m.content.length),o.write_shift(2,b.length),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(4,0),o.write_shift(4,y),_+=o.l,a.push(o),_+=b.length,a.push(b),++h}return o=new_buf$1(22),o.write_shift(4,0x6054b50),o.write_shift(2,0),o.write_shift(2,0),o.write_shift(2,h),o.write_shift(2,h),o.write_shift(4,_),o.write_shift(4,d),o.write_shift(2,0),bconcat$1([bconcat$1(n),bconcat$1(a),o])}(e,r);var n=function(e){for(var t=0,r=0,n=0;n<e.FileIndex.length;++n){var i=e.FileIndex[n];if(i.content){var a=i.content.length;a>0&&(a<4096?t+=a+63>>6:r+=a+511>>9)}}for(var o=e.FullPaths.length+3>>2,s=t+127>>7,l=(t+7>>3)+r+o+s,c=l+127>>7,u=c<=109?0:Math.ceil((c-109)/127);l+c+u+127>>7>c;)u=++c<=109?0:Math.ceil((c-109)/127);var d=[1,u,c,s,o,r,t,0];return e.FileIndex[0].size=t<<6,d[7]=(e.FileIndex[0].start=d[0]+d[1]+d[2]+d[3]+d[4]+d[5])+(d[6]+7>>3),d}(e),a=new_buf$1(n[7]<<9),o=0,s=0;for(o=0;o<8;++o)a.write_shift(1,b[o]);for(o=0;o<8;++o)a.write_shift(2,0);for(a.write_shift(2,62),a.write_shift(2,3),a.write_shift(2,65534),a.write_shift(2,9),a.write_shift(2,6),o=0;o<3;++o)a.write_shift(2,0);for(a.write_shift(4,0),a.write_shift(4,n[2]),a.write_shift(4,n[0]+n[1]+n[2]+n[3]-1),a.write_shift(4,0),a.write_shift(4,4096),a.write_shift(4,n[3]?n[0]+n[1]+n[2]-1:_),a.write_shift(4,n[3]),a.write_shift(-4,n[1]?n[0]-1:_),a.write_shift(4,n[1]),o=0;o<109;++o)a.write_shift(-4,o<n[2]?n[1]+o:-1);if(n[1])for(s=0;s<n[1];++s){for(;o<236+127*s;++o)a.write_shift(-4,o<n[2]?n[1]+o:-1);a.write_shift(-4,s===n[1]-1?_:s+1)}var l=function(e){for(s+=e;o<s-1;++o)a.write_shift(-4,o+1);e&&(++o,a.write_shift(-4,_))};for(s=o=0,s+=n[1];o<s;++o)a.write_shift(-4,S.DIFSECT);for(s+=n[2];o<s;++o)a.write_shift(-4,S.FATSECT);l(n[3]),l(n[4]);for(var c=0,u=0,d=e.FileIndex[0];c<e.FileIndex.length;++c)(d=e.FileIndex[c]).content&&((u=d.content.length)<4096||(d.start=s,l(u+511>>9)));for(l(n[6]+7>>3);511&a.l;)a.write_shift(-4,S.ENDOFCHAIN);for(s=o=0,c=0;c<e.FileIndex.length;++c)(d=e.FileIndex[c]).content&&(!(u=d.content.length)||u>=4096||(d.start=s,l(u+63>>6)));for(;511&a.l;)a.write_shift(-4,S.ENDOFCHAIN);for(o=0;o<n[4]<<2;++o){var h=e.FullPaths[o];if(h&&0!==h.length){d=e.FileIndex[o],0===o&&(d.start=d.size?d.start-1:_);var f=0===o&&r.root||d.name;if(u=2*(f.length+1),a.write_shift(64,f,"utf16le"),a.write_shift(2,u),a.write_shift(1,d.type),a.write_shift(1,d.color),a.write_shift(-4,d.L),a.write_shift(-4,d.R),a.write_shift(-4,d.C),d.clsid)a.write_shift(16,d.clsid,"hex");else for(c=0;c<4;++c)a.write_shift(4,0);a.write_shift(4,d.state||0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,0),a.write_shift(4,d.start),a.write_shift(4,d.size),a.write_shift(4,0)}else{for(c=0;c<17;++c)a.write_shift(4,0);for(c=0;c<3;++c)a.write_shift(4,-1);for(c=0;c<12;++c)a.write_shift(4,0)}}for(o=1;o<e.FileIndex.length;++o)if((d=e.FileIndex[o]).size>=4096)if(a.l=d.start+1<<9,has_buf$1&&Buffer.isBuffer(d.content))d.content.copy(a,a.l,0,d.size),a.l+=d.size+511&-512;else{for(c=0;c<d.size;++c)a.write_shift(1,d.content[c]);for(;511&c;++c)a.write_shift(1,0)}for(o=1;o<e.FileIndex.length;++o)if((d=e.FileIndex[o]).size>0&&d.size<4096)if(has_buf$1&&Buffer.isBuffer(d.content))d.content.copy(a,a.l,0,d.size),a.l+=d.size+63&-64;else{for(c=0;c<d.size;++c)a.write_shift(1,d.content[c]);for(;63&c;++c)a.write_shift(1,0)}if(has_buf$1)a.l=a.length;else for(;a.l<a.length;)a.write_shift(1,0);return a}t.version="1.2.1";var m,g=64,_=-2,y="d0cf11e0a1b11ae1",b=[208,207,17,224,161,177,26,225],v="00000000000000000000000000000000",S={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:_,FREESECT:-1,HEADER_SIGNATURE:y,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:v,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function w(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function T(e){return m?m.deflateRawSync(e):X(e)}var E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],x=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function C(e){var t=139536&(e<<1|e<<11)|558144&(e<<5|e<<15);return 255&(t>>16|t>>8|t)}for(var R="undefined"!=typeof Uint8Array,D=R?new Uint8Array(256):[],P=0;P<256;++P)D[P]=C(P);function I(e,t){var r=D[255&e];return t<=8?r>>>8-t:(r=r<<8|D[e>>8&255],t<=16?r>>>16-t:(r=r<<8|D[e>>16&255])>>>24-t)}function k(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=6?0:e[n+1]<<8))>>>r&3}function M(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=5?0:e[n+1]<<8))>>>r&7}function $(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=3?0:e[n+1]<<8))>>>r&31}function O(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=1?0:e[n+1]<<8))>>>r&127}function N(e,t,r){var n=7&t,i=t>>>3,a=(1<<r)-1,o=e[i]>>>n;return r<8-n?o&a:(o|=e[i+1]<<8-n,r<16-n?o&a:(o|=e[i+2]<<16-n,r<24-n?o&a:(o|=e[i+3]<<24-n)&a))}function F(e,t,r){var n=7&t,i=t>>>3;return n<=5?e[i]|=(7&r)<<n:(e[i]|=r<<n&255,e[i+1]=(7&r)>>8-n),t+3}function L(e,t,r){return r=(1&r)<<(7&t),e[t>>>3]|=r,t+1}function B(e,t,r){var n=t>>>3;return r<<=7&t,e[n]|=255&r,r>>>=8,e[n+1]=r,t+8}function V(e,t,r){var n=t>>>3;return r<<=7&t,e[n]|=255&r,r>>>=8,e[n+1]=255&r,e[n+2]=r>>>8,t+16}function U(e,t){var r=e.length,n=2*r>t?2*r:t+5,i=0;if(r>=t)return e;if(has_buf$1){var a=new_unsafe_buf$1(n);if(e.copy)e.copy(a);else for(;i<e.length;++i)a[i]=e[i];return a}if(R){var o=new Uint8Array(n);if(o.set)o.set(e);else for(;i<r;++i)o[i]=e[i];return o}return e.length=n,e}function z(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}function H(e,t,r){var n=1,i=0,a=0,o=0,s=0,l=e.length,c=R?new Uint16Array(32):z(32);for(a=0;a<32;++a)c[a]=0;for(a=l;a<r;++a)e[a]=0;l=e.length;var u=R?new Uint16Array(l):z(l);for(a=0;a<l;++a)c[i=e[a]]++,n<i&&(n=i),u[a]=0;for(c[0]=0,a=1;a<=n;++a)c[a+16]=s=s+c[a-1]<<1;for(a=0;a<l;++a)0!=(s=e[a])&&(u[a]=c[s+16]++);var d=0;for(a=0;a<l;++a)if(0!=(d=e[a]))for(s=I(u[a],n)>>n-d,o=(1<<n+4-d)-1;o>=0;--o)t[s|o<<d]=15&d|a<<4;return n}var j=R?new Uint16Array(512):z(512),G=R?new Uint16Array(32):z(32);if(!R){for(var W=0;W<512;++W)j[W]=0;for(W=0;W<32;++W)G[W]=0}!function(){for(var e=[],t=0;t<32;t++)e.push(5);H(e,G,32);var r=[];for(t=0;t<=143;t++)r.push(8);for(;t<=255;t++)r.push(9);for(;t<=279;t++)r.push(7);for(;t<=287;t++)r.push(8);H(r,j,288)}();var q=function(){for(var e=R?new Uint8Array(32768):[],t=0,r=0;t<A.length-1;++t)for(;r<A[t+1];++r)e[r]=t;for(;r<32768;++r)e[r]=29;var n=R?new Uint8Array(259):[];for(t=0,r=0;t<x.length-1;++t)for(;r<x[t+1];++r)n[r]=t;return function(t,r){return t.length<8?function(e,t){for(var r=0;r<e.length;){var n=Math.min(65535,e.length-r),i=r+n==e.length;for(t.write_shift(1,+i),t.write_shift(2,n),t.write_shift(2,65535&~n);n-- >0;)t[t.l++]=e[r++]}return t.l}(t,r):function(t,r){for(var i=0,a=0,o=R?new Uint16Array(32768):[];a<t.length;){var s=Math.min(65535,t.length-a);if(s<10){for(7&(i=F(r,i,+!(a+s!=t.length)))&&(i+=8-(7&i)),r.l=i/8|0,r.write_shift(2,s),r.write_shift(2,65535&~s);s-- >0;)r[r.l++]=t[a++];i=8*r.l}else{i=F(r,i,+!(a+s!=t.length)+2);for(var l=0;s-- >0;){var c=t[a],u=-1,d=0;if((u=o[l=32767&(l<<5^c)])&&((u|=-32768&a)>a&&(u-=32768),u<a))for(;t[u+d]==t[a+d]&&d<250;)++d;if(d>2){(c=n[d])<=22?i=B(r,i,D[c+1]>>1)-1:(B(r,i,3),B(r,i+=5,D[c-23]>>5),i+=3);var h=c<8?0:c-4>>2;h>0&&(V(r,i,d-x[c]),i+=h),c=e[a-u],i=B(r,i,D[c]>>3),i-=3;var p=c<4?0:c-2>>1;p>0&&(V(r,i,a-u-A[c]),i+=p);for(var f=0;f<d;++f)o[l]=32767&a,l=32767&(l<<5^t[a]),++a;s-=d-1}else c<=143?c+=48:i=L(r,i,1),i=B(r,i,D[c]),o[l]=32767&a,++a}i=B(r,i,0)-1}}return r.l=(i+7)/8|0,r.l}(t,r)}}();function X(e){var t=new_buf$1(50+Math.floor(1.1*e.length)),r=q(e,t);return t.slice(0,r)}var K=R?new Uint16Array(32768):z(32768),Y=R?new Uint16Array(32768):z(32768),J=R?new Uint16Array(128):z(128),Z=1,Q=1;function ee(e,t){var r=$(e,t)+257,n=$(e,t+=5)+1,i=function(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=4?0:e[n+1]<<8))>>>r&15}(e,t+=5)+4;t+=4;for(var a=0,o=R?new Uint8Array(19):z(19),s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=1,c=R?new Uint8Array(8):z(8),u=R?new Uint8Array(8):z(8),d=o.length,h=0;h<i;++h)o[E[h]]=a=M(e,t),l<a&&(l=a),c[a]++,t+=3;var p=0;for(c[0]=0,h=1;h<=l;++h)u[h]=p=p+c[h-1]<<1;for(h=0;h<d;++h)0!=(p=o[h])&&(s[h]=u[p]++);var f=0;for(h=0;h<d;++h)if(0!=(f=o[h])){p=D[s[h]]>>8-f;for(var m=(1<<7-f)-1;m>=0;--m)J[p|m<<f]=7&f|h<<3}var g=[];for(l=1;g.length<r+n;)switch(t+=7&(p=J[O(e,t)]),p>>>=3){case 16:for(a=3+k(e,t),t+=2,p=g[g.length-1];a-- >0;)g.push(p);break;case 17:for(a=3+M(e,t),t+=3;a-- >0;)g.push(0);break;case 18:for(a=11+O(e,t),t+=7;a-- >0;)g.push(0);break;default:g.push(p),l<p&&(l=p)}var _=g.slice(0,r),y=g.slice(r);for(h=r;h<286;++h)_[h]=0;for(h=n;h<30;++h)y[h]=0;return Z=H(_,K,286),Q=H(y,Y,30),t}function te(e,t){var r=function(e,t){if(3==e[0]&&!(3&e[1]))return[new_raw_buf$1(t),2];for(var r=0,n=0,i=new_unsafe_buf$1(t||1<<18),a=0,o=i.length>>>0,s=0,l=0;!(1&n);)if(n=M(e,r),r+=3,n>>>1!=0)for(n>>1==1?(s=9,l=5):(r=ee(e,r),s=Z,l=Q);;){!t&&o<a+32767&&(o=(i=U(i,a+32767)).length);var c=N(e,r,s),u=n>>>1==1?j[c]:K[c];if(r+=15&u,(u>>>=4)>>>8&255){if(256==u)break;var d=(u-=257)<8?0:u-4>>2;d>5&&(d=0);var h=a+x[u];d>0&&(h+=N(e,r,d),r+=d),c=N(e,r,l),r+=15&(u=n>>>1==1?G[c]:Y[c]);var p=(u>>>=4)<4?0:u-2>>1,f=A[u];for(p>0&&(f+=N(e,r,p),r+=p),!t&&o<h&&(o=(i=U(i,h+100)).length);a<h;)i[a]=i[a-f],++a}else i[a++]=u}else{7&r&&(r+=8-(7&r));var m=e[r>>>3]|e[1+(r>>>3)]<<8;if(r+=32,m>0)for(!t&&o<a+m&&(o=(i=U(i,a+m)).length);m-- >0;)i[a++]=e[r>>>3],r+=8}return t?[i,r+7>>>3]:[i.slice(0,a),r+7>>>3]}(e.slice(e.l||0),t);return e.l+=r[1],r[0]}function re(e,t){if(!e)throw new Error(t);"undefined"!=typeof console&&console.error(t)}function ne(e,t){var r=e;prep_blob$1(r,0);var n={FileIndex:[],FullPaths:[]};h(n,{root:t.root});for(var i=r.length-4;(80!=r[i]||75!=r[i+1]||5!=r[i+2]||6!=r[i+3])&&i>=0;)--i;r.l=i+4,r.l+=4;var o=r.read_shift(2);r.l+=6;var s=r.read_shift(4);for(r.l=s,i=0;i<o;++i){r.l+=20;var l=r.read_shift(4),c=r.read_shift(4),u=r.read_shift(2),d=r.read_shift(2),p=r.read_shift(2);r.l+=8;var f=r.read_shift(4),m=a(r.slice(r.l+u,r.l+u+d));r.l+=u+d+p;var g=r.l;r.l=f+4,ie(r,l,c,n,m),r.l=g}return n}function ie(e,t,r,n,i){e.l+=2;var o=e.read_shift(2),s=e.read_shift(2),l=function(e){var t=65535&e.read_shift(2),r=65535&e.read_shift(2),n=new Date,i=31&r,a=15&(r>>>=5);r>>>=4,n.setMilliseconds(0),n.setFullYear(r+1980),n.setMonth(a-1),n.setDate(i);var o=31&t,s=63&(t>>>=5);return t>>>=6,n.setHours(t),n.setMinutes(s),n.setSeconds(o<<1),n}(e);if(8257&o)throw new Error("Unsupported ZIP encryption");e.read_shift(4);for(var c=e.read_shift(4),u=e.read_shift(4),d=e.read_shift(2),h=e.read_shift(2),p="",f=0;f<d;++f)p+=String.fromCharCode(e[e.l++]);if(h){var g=a(e.slice(e.l,e.l+h));(g[21589]||{}).mt&&(l=g[21589].mt),((i||{})[21589]||{}).mt&&(l=i[21589].mt)}e.l+=h;var _=e.slice(e.l,e.l+c);switch(s){case 8:_=function(e,t){if(!m)return te(e,t);var r=new(0,m.InflateRaw),n=r._processChunk(e.slice(e.l),r._finishFlushFlag);return e.l+=r.bytesRead,n}(e,u);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+s)}var y=!1;8&o&&(0x8074b50==e.read_shift(4)&&(e.read_shift(4),y=!0),c=e.read_shift(4),u=e.read_shift(4)),c!=t&&re(y,"Bad compressed size: "+t+" != "+c),u!=r&&re(y,"Bad uncompressed size: "+r+" != "+u),ue(n,p,_,{unsafe:!0,mt:l})}var ae={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function oe(e,t){if(e.ctype)return e.ctype;var r=e.name||"",n=r.match(/\.([^\.]+)$/);return n&&ae[n[1]]||t&&(n=(r=t).match(/[\.\\]([^\.\\])+$/))&&ae[n[1]]?ae[n[1]]:"application/octet-stream"}function se(e){for(var t=Base64_encode$1(e),r=[],n=0;n<t.length;n+=76)r.push(t.slice(n,n+76));return r.join("\r\n")+"\r\n"}function le(e){var t=e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,(function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return"="+(1==t.length?"0"+t:t)}));"\n"==(t=t.replace(/ $/gm,"=20").replace(/\t$/gm,"=09")).charAt(0)&&(t="=0D"+t.slice(1));for(var r=[],n=(t=t.replace(/\r(?!\n)/gm,"=0D").replace(/\n\n/gm,"\n=0A").replace(/([^\r\n])\n/gm,"$1=0A")).split("\r\n"),i=0;i<n.length;++i){var a=n[i];if(0!=a.length)for(var o=0;o<a.length;){var s=76,l=a.slice(o,o+s);"="==l.charAt(s-1)?s--:"="==l.charAt(s-2)?s-=2:"="==l.charAt(s-3)&&(s-=3),l=a.slice(o,o+s),(o+=s)<a.length&&(l+="="),r.push(l)}else r.push("")}return r.join("\r\n")}function ce(e,t,r){for(var n,i="",a="",o="",s=0;s<10;++s){var l=t[s];if(!l||l.match(/^\s*$/))break;var c=l.match(/^(.*?):\s*([^\s].*)$/);if(c)switch(c[1].toLowerCase()){case"content-location":i=c[2].trim();break;case"content-type":o=c[2].trim();break;case"content-transfer-encoding":a=c[2].trim()}}switch(++s,a.toLowerCase()){case"base64":n=s2a$1(Base64_decode$1(t.slice(s).join("")));break;case"quoted-printable":n=function(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r];r<=e.length&&"="==n.charAt(n.length-1);)n=n.slice(0,n.length-1)+e[++r];t.push(n)}for(var i=0;i<t.length;++i)t[i]=t[i].replace(/[=][0-9A-Fa-f]{2}/g,(function(e){return String.fromCharCode(parseInt(e.slice(1),16))}));return s2a$1(t.join("\r\n"))}(t.slice(s));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+a)}var u=ue(e,i.slice(r.length),n,{unsafe:!0});o&&(u.ctype=o)}function ue(e,t,r,i){var a=i&&i.unsafe;a||h(e);var o=!a&&CFB$1.find(e,t);if(!o){var s=e.FullPaths[0];t.slice(0,s.length)==s?s=t:("/"!=s.slice(-1)&&(s+="/"),s=(s+t).replace("//","/")),o={name:n(t),type:2},e.FileIndex.push(o),e.FullPaths.push(s),a||CFB$1.utils.cfb_gc(e)}return o.content=r,o.size=r?r.length:0,i&&(i.CLSID&&(o.clsid=i.CLSID),i.mt&&(o.mt=i.mt),i.ct&&(o.ct=i.ct)),o}return t.find=function(e,t){var r=e.FullPaths.map((function(e){return e.toUpperCase()})),n=r.map((function(e){var t=e.split("/");return t[t.length-("/"==e.slice(-1)?2:1)]})),i=!1;47===t.charCodeAt(0)?(i=!0,t=r[0].slice(0,-1)+t):i=-1!==t.indexOf("/");var a=t.toUpperCase(),o=!0===i?r.indexOf(a):n.indexOf(a);if(-1!==o)return e.FileIndex[o];var s=!a.match(chr1$1);for(a=a.replace(chr0$1,""),s&&(a=a.replace(chr1$1,"!")),o=0;o<r.length;++o){if((s?r[o].replace(chr1$1,"!"):r[o]).replace(chr0$1,"")==a)return e.FileIndex[o];if((s?n[o].replace(chr1$1,"!"):n[o]).replace(chr0$1,"")==a)return e.FileIndex[o]}return null},t.read=function(t,r){var n=r&&r.type;switch(n||has_buf$1&&Buffer.isBuffer(t)&&(n="buffer"),n||"base64"){case"file":return function(t,r){return o(),s(e.readFileSync(t),r)}(t,r);case"base64":return s(s2a$1(Base64_decode$1(t)),r);case"binary":return s(s2a$1(t),r)}return s(t,r)},t.parse=s,t.write=function(t,r){var n=f(t,r);switch(r&&r.type||"buffer"){case"file":return o(),e.writeFileSync(r.filename,n),n;case"binary":return"string"==typeof n?n:w(n);case"base64":return Base64_encode$1("string"==typeof n?n:w(n));case"buffer":if(has_buf$1)return Buffer.isBuffer(n)?n:Buffer_from$1(n);case"array":return"string"==typeof n?s2a$1(n):n}return n},t.writeFile=function(t,r,n){o();var i=f(t,n);e.writeFileSync(r,i)},t.utils={cfb_new:function(e){var t={};return h(t,e),t},cfb_add:ue,cfb_del:function(e,t){h(e);var r=CFB$1.find(e,t);if(r)for(var n=0;n<e.FileIndex.length;++n)if(e.FileIndex[n]==r)return e.FileIndex.splice(n,1),e.FullPaths.splice(n,1),!0;return!1},cfb_mov:function(e,t,r){h(e);var i=CFB$1.find(e,t);if(i)for(var a=0;a<e.FileIndex.length;++a)if(e.FileIndex[a]==i)return e.FileIndex[a].name=n(r),e.FullPaths[a]=r,!0;return!1},cfb_gc:function(e){p(e,!0)},ReadShift:ReadShift$1,CheckField:CheckField$1,prep_blob:prep_blob$1,bconcat:bconcat$1,use_zlib:function(e){try{var t=new(0,e.InflateRaw);if(t._processChunk(new Uint8Array([3,0]),t._finishFlushFlag),!t.bytesRead)throw new Error("zlib does not expose bytesRead");m=e}catch(r){console.error("cannot use native zlib: "+(r.message||r))}},_deflateRaw:X,_inflateRaw:te,consts:S},t}();function read_binary$1(e){if("undefined"!=typeof Deno)return Deno.readFileSync(e);if("undefined"!=typeof $&&"undefined"!=typeof File&&"undefined"!=typeof Folder)try{var t=File(e);t.open("r"),t.encoding="binary";var r=t.read();return t.close(),r}catch(n){if(!n.message||!n.message.match(/onstruct/))throw n}throw new Error("Cannot access file "+e)}function keys$4(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;++n)Object.prototype.hasOwnProperty.call(e,t[n])&&r.push(t[n]);return r}function evert$1(e){for(var t=[],r=keys$4(e),n=0;n!==r.length;++n)t[e[r[n]]]=r[n];return t}var basedate=new Date(1899,11,30,0,0,0);function datenum$1(e,t){return(e.getTime()-(basedate.getTime()+6e4*(e.getTimezoneOffset()-basedate.getTimezoneOffset())))/864e5}var refdate=new Date,dnthresh$1=basedate.getTime()+6e4*(refdate.getTimezoneOffset()-basedate.getTimezoneOffset()),refoffset=refdate.getTimezoneOffset();function numdate$1(e){var t=new Date;return t.setTime(24*e*60*60*1e3+dnthresh$1),t.getTimezoneOffset()!==refoffset&&t.setTime(t.getTime()+6e4*(t.getTimezoneOffset()-refoffset)),t}function parse_isodur$1(e){var t=0,r=0,n=!1,i=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!i)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var a=1;a!=i.length;++a)if(i[a]){switch(r=1,a>3&&(n=!0),i[a].slice(i[a].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[a].slice(i[a].length-1));case"D":r*=24;case"H":r*=60;case"M":if(!n)throw new Error("Unsupported ISO Duration Field: M");r*=60}t+=r*parseInt(i[a],10)}return t}var good_pd_date_1=new Date("2017-02-19T19:06:09.000Z"),good_pd_date=isNaN(good_pd_date_1.getFullYear())?new Date("2/19/17"):good_pd_date_1,good_pd=2017==good_pd_date.getFullYear();function parseDate$1(e,t){var r=new Date(e);if(good_pd)return t>0?r.setTime(r.getTime()+60*r.getTimezoneOffset()*1e3):t<0&&r.setTime(r.getTime()-60*r.getTimezoneOffset()*1e3),r;if(e instanceof Date)return e;if(1917==good_pd_date.getFullYear()&&!isNaN(r.getFullYear())){var n=r.getFullYear();return e.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var i=e.match(/\d+/g)||["2017","2","19","0","0","0"],a=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return e.indexOf("Z")>-1&&(a=new Date(a.getTime()-60*a.getTimezoneOffset()*1e3)),a}function cc2str$1(e,t){if(has_buf$1&&Buffer.isBuffer(e)){if(t){if(255==e[0]&&254==e[1])return utf8write$1(e.slice(2).toString("utf16le"));if(254==e[1]&&255==e[2])return utf8write$1(utf16beread$1(e.slice(2).toString("binary")))}return e.toString("binary")}if("undefined"!=typeof TextDecoder)try{if(t){if(255==e[0]&&254==e[1])return utf8write$1(new TextDecoder("utf-16le").decode(e.slice(2)));if(254==e[0]&&255==e[1])return utf8write$1(new TextDecoder("utf-16be").decode(e.slice(2)))}var r={"€":"\x80","‚":"\x82","ƒ":"\x83","„":"\x84","…":"\x85","†":"\x86","‡":"\x87","ˆ":"\x88","‰":"\x89","Š":"\x8a","‹":"\x8b","Œ":"\x8c","Ž":"\x8e","‘":"\x91","’":"\x92","“":"\x93","”":"\x94","•":"\x95","–":"\x96","—":"\x97","˜":"\x98","™":"\x99","š":"\x9a","›":"\x9b","œ":"\x9c","ž":"\x9e","Ÿ":"\x9f"};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,(function(e){return r[e]||e}))}catch(a){}for(var n=[],i=0;i!=e.length;++i)n.push(String.fromCharCode(e[i]));return n.join("")}function dup$1(e){if("undefined"!=typeof JSON&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if("object"!=typeof e||null==e)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=dup$1(e[r]));return t}function fill$3(e,t){for(var r="";r.length<t;)r+=e;return r}function fuzzynum$1(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,n=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,(function(){return r*=100,""}));return isNaN(t=Number(n))?(n=n.replace(/[(](.*)[)]/,(function(e,t){return r=-r,t})),isNaN(t=Number(n))?t:t/r):t/r}var lower_months$1=["january","february","march","april","may","june","july","august","september","october","november","december"];function fuzzydate$1(e){var t=new Date(e),r=new Date(NaN),n=t.getYear(),i=t.getMonth(),a=t.getDate();if(isNaN(a))return r;var o=e.toLowerCase();if(o.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if((o=o.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"")).length>3&&-1==lower_months$1.indexOf(o))return r}else if(o.match(/[a-z]/))return r;return n<0||n>8099?r:(i>0||a>1)&&101!=n?t:e.match(/[^-0-9:,\/\\]/)?r:t}var split_regex$1=function(){var e=5=="abacaba".split(/(:?b)/i).length;return function(t,r,n){if(e||"string"==typeof r)return t.split(r);for(var i=t.split(r),a=[i[0]],o=1;o<i.length;++o)a.push(n),a.push(i[o]);return a}}();function getdatastr$1(e){return e?e.content&&e.type?cc2str$1(e.content,!0):e.data?debom$1(e.data):e.asNodeBuffer&&has_buf$1?debom$1(e.asNodeBuffer().toString("binary")):e.asBinary?debom$1(e.asBinary()):e._data&&e._data.getContent?debom$1(cc2str$1(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function getdatabin$1(e){if(!e)return null;if(e.data)return char_codes$1(e.data);if(e.asNodeBuffer&&has_buf$1)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return"string"==typeof t?char_codes$1(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}function getdata$1(e){return e&&".bin"===e.name.slice(-4)?getdatabin$1(e):getdatastr$1(e)}function safegetzipfile$1(e,t){for(var r=e.FullPaths||keys$4(e.files),n=t.toLowerCase().replace(/[\/]/g,"\\"),i=n.replace(/\\/g,"/"),a=0;a<r.length;++a){var o=r[a].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==o||i==o)return e.files?e.files[r[a]]:e.FileIndex[a]}return null}function getzipfile$1(e,t){var r=safegetzipfile$1(e,t);if(null==r)throw new Error("Cannot find file "+t+" in zip");return r}function getzipdata$1(e,t,r){if(!r)return getdata$1(getzipfile$1(e,t));if(!t)return null;try{return getzipdata$1(e,t)}catch(n){return null}}function getzipstr$1(e,t,r){if(!r)return getdatastr$1(getzipfile$1(e,t));if(!t)return null;try{return getzipstr$1(e,t)}catch(n){return null}}function getzipbin$1(e,t,r){return getdatabin$1(getzipfile$1(e,t))}function zipentries$1(e){for(var t=e.FullPaths||keys$4(e.files),r=[],n=0;n<t.length;++n)"/"!=t[n].slice(-1)&&r.push(t[n].replace(/^Root Entry[\/]/,""));return r.sort()}function zip_add_file$1(e,t,r){if(e.FullPaths){var n;if("string"==typeof r)return n=has_buf$1?Buffer_from$1(r):utf8decode$1(r),CFB$1.utils.cfb_add(e,t,n);CFB$1.utils.cfb_add(e,t,r)}else e.file(t,r)}function zip_read$1(e,t){switch(t.type){case"base64":return CFB$1.read(e,{type:"base64"});case"binary":return CFB$1.read(e,{type:"binary"});case"buffer":case"array":return CFB$1.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function resolve_path$1(e,t){if("/"==e.charAt(0))return e.slice(1);var r=t.split("/");"/"!=t.slice(-1)&&r.pop();for(var n=e.split("/");0!==n.length;){var i=n.shift();".."===i?r.pop():"."!==i&&r.push(i)}return r.join("/")}var XML_HEADER$1='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n',attregexg$1=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,tagregex1$1=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm,tagregex2$1=/<[^>]*>/g,tagregex$1=XML_HEADER$1.match(tagregex1$1)?tagregex1$1:tagregex2$1,nsregex$1=/<\w*:/,nsregex2$1=/<(\/?)\w+:/;function parsexmltag$1(e,t,r){for(var n={},i=0,a=0;i!==e.length&&(32!==(a=e.charCodeAt(i))&&10!==a&&13!==a);++i);if(t||(n[0]=e.slice(0,i)),i===e.length)return n;var o=e.match(attregexg$1),s=0,l="",c=0,u="",d="",h=1;if(o)for(c=0;c!=o.length;++c){for(d=o[c],a=0;a!=d.length&&61!==d.charCodeAt(a);++a);for(u=d.slice(0,a).trim();32==d.charCodeAt(a+1);)++a;for(h=34==(i=d.charCodeAt(a+1))||39==i?1:0,l=d.slice(a+1+h,d.length-h),s=0;s!=u.length&&58!==u.charCodeAt(s);++s);if(s===u.length)u.indexOf("_")>0&&(u=u.slice(0,u.indexOf("_"))),n[u]=l,n[u.toLowerCase()]=l;else{var p=(5===s&&"xmlns"===u.slice(0,5)?"xmlns":"")+u.slice(s+1);if(n[p]&&"ext"==u.slice(s-3,s))continue;n[p]=l,n[p.toLowerCase()]=l}}return n}function strip_ns$1(e){return e.replace(nsregex2$1,"<$1")}var encodings$1={""":'"',"'":"'",">":">","<":"<","&":"&"},rencoding$1=evert$1(encodings$1),unescapexml$1=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/gi,t=/_x([\da-fA-F]{4})_/gi;return function r(n){var i=n+"",a=i.indexOf("<![CDATA[");if(-1==a)return i.replace(e,(function(e,t){return encodings$1[e]||String.fromCharCode(parseInt(t,e.indexOf("x")>-1?16:10))||e})).replace(t,(function(e,t){return String.fromCharCode(parseInt(t,16))}));var o=i.indexOf("]]>");return r(i.slice(0,a))+i.slice(a+9,o)+r(i.slice(o+3))}}(),decregex$1=/[&<>'"]/g,htmlcharegex$1=/[\u0000-\u001f]/g;function escapehtml$1(e){return(e+"").replace(decregex$1,(function(e){return rencoding$1[e]})).replace(/\n/g,"<br/>").replace(htmlcharegex$1,(function(e){return"&#x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"}))}var xlml_fixstr$1=function(){var e=/&#(\d+);/g;function t(e,t){return String.fromCharCode(parseInt(t,10))}return function(r){return r.replace(e,t)}}();function parsexmlbool$1(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function utf8reada$1(e){for(var t="",r=0,n=0,i=0,a=0,o=0,s=0;r<e.length;)(n=e.charCodeAt(r++))<128?t+=String.fromCharCode(n):(i=e.charCodeAt(r++),n>191&&n<224?(o=(31&n)<<6,o|=63&i,t+=String.fromCharCode(o)):(a=e.charCodeAt(r++),n<240?t+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&a):(s=((7&n)<<18|(63&i)<<12|(63&a)<<6|63&(o=e.charCodeAt(r++)))-65536,t+=String.fromCharCode(55296+(s>>>10&1023)),t+=String.fromCharCode(56320+(1023&s)))));return t}function utf8readb$1(e){var t,r,n,i=new_raw_buf$1(2*e.length),a=1,o=0,s=0;for(r=0;r<e.length;r+=a)a=1,(n=e.charCodeAt(r))<128?t=n:n<224?(t=64*(31&n)+(63&e.charCodeAt(r+1)),a=2):n<240?(t=4096*(15&n)+64*(63&e.charCodeAt(r+1))+(63&e.charCodeAt(r+2)),a=3):(a=4,t=262144*(7&n)+4096*(63&e.charCodeAt(r+1))+64*(63&e.charCodeAt(r+2))+(63&e.charCodeAt(r+3)),s=55296+((t-=65536)>>>10&1023),t=56320+(1023&t)),0!==s&&(i[o++]=255&s,i[o++]=s>>>8,s=0),i[o++]=t%256,i[o++]=t>>>8;return i.slice(0,o).toString("ucs2")}function utf8readc$1(e){return Buffer_from$1(e,"binary").toString("utf8")}var utf8corpus$1="foo bar baz\xe2\x98\x83\xf0\x9f\x8d\xa3",utf8read$1=has_buf$1&&(utf8readc$1(utf8corpus$1)==utf8reada$1(utf8corpus$1)&&utf8readc$1||utf8readb$1(utf8corpus$1)==utf8reada$1(utf8corpus$1)&&utf8readb$1)||utf8reada$1,utf8write$1=has_buf$1?function(e){return Buffer_from$1(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,n=0,i=0;r<e.length;)switch(n=e.charCodeAt(r++),!0){case n<128:t.push(String.fromCharCode(n));break;case n<2048:t.push(String.fromCharCode(192+(n>>6))),t.push(String.fromCharCode(128+(63&n)));break;case n>=55296&&n<57344:n-=55296,i=e.charCodeAt(r++)-56320+(n<<10),t.push(String.fromCharCode(240+(i>>18&7))),t.push(String.fromCharCode(144+(i>>12&63))),t.push(String.fromCharCode(128+(i>>6&63))),t.push(String.fromCharCode(128+(63&i)));break;default:t.push(String.fromCharCode(224+(n>>12))),t.push(String.fromCharCode(128+(n>>6&63))),t.push(String.fromCharCode(128+(63&n)))}return t.join("")},matchtag=function(){var e={};return function(t,r){var n=t+"|"+(r||"");return e[n]?e[n]:e[n]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",r||"")}}(),htmldecode$1=function(){var e=[["nbsp"," "],["middot","\xb7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map((function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]}));return function(t){for(var r=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),n=0;n<e.length;++n)r=r.replace(e[n][0],e[n][1]);return r}}(),vtregex=function(){var e={};return function(t){return void 0!==e[t]?e[t]:e[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}(),vtvregex$1=/<\/?(?:vt:)?variant>/g,vtmregex$1=/<(?:vt:)([^>]*)>([\s\S]*)</;function parseVector$1(e,t){var r=parsexmltag$1(e),n=e.match(vtregex(r.baseType))||[],i=[];if(n.length!=r.size){if(t.WTF)throw new Error("unexpected vector length "+n.length+" != "+r.size);return i}return n.forEach((function(e){var t=e.replace(vtvregex$1,"").match(vtmregex$1);t&&i.push({v:utf8read$1(t[2]),t:t[1]})})),i}var wtregex$1=/(^\s|\s$|\n)/;function wxt_helper$1(e){return keys$4(e).map((function(t){return" "+t+'="'+e[t]+'"'})).join("")}function writextag$1(e,t,r){return"<"+e+(null!=r?wxt_helper$1(r):"")+(null!=t?(t.match(wtregex$1)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function xlml_normalize$1(e){if(has_buf$1&&Buffer.isBuffer(e))return e.toString("utf8");if("string"==typeof e)return e;if("undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return utf8read$1(a2s$1(ab2a$1(e)));throw new Error("Bad input format: expected Buffer or string")}var xlmlregex$1=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/gm,XMLNS$1={CT:"http://schemas.openxmlformats.org/package/2006/content-types"},XMLNS_main$1=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function read_double_le$1(e,t){for(var r=1-2*(e[t+7]>>>7),n=((127&e[t+7])<<4)+(e[t+6]>>>4&15),i=15&e[t+6],a=5;a>=0;--a)i=256*i+e[t+a];return 2047==n?0==i?r*(1/0):NaN:(0==n?n=-1022:(n-=1023,i+=Math.pow(2,52)),r*Math.pow(2,n-52)*i)}function write_double_le$1(e,t,r){var n=(t<0||1/t==-1/0?1:0)<<7,i=0,a=0,o=n?-t:t;isFinite(o)?0==o?i=a=0:(i=Math.floor(Math.log(o)/Math.LN2),a=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(a)||a<Math.pow(2,52))?i=-1022:(a-=Math.pow(2,52),i+=1023)):(i=2047,a=isNaN(t)?26985:0);for(var s=0;s<=5;++s,a/=256)e[r+s]=255&a;e[r+6]=(15&i)<<4|15&a,e[r+7]=i>>4|n}var ___toBuffer$1=function(e){for(var t=[],r=0;r<e[0].length;++r)if(e[0][r])for(var n=0,i=e[0][r].length;n<i;n+=10240)t.push.apply(t,e[0][r].slice(n,n+10240));return t},__toBuffer$1=has_buf$1?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map((function(e){return Buffer.isBuffer(e)?e:Buffer_from$1(e)}))):___toBuffer$1(e)}:___toBuffer$1,___utf16le$1=function(e,t,r){for(var n=[],i=t;i<r;i+=2)n.push(String.fromCharCode(__readUInt16LE$1(e,i)));return n.join("").replace(chr0$1,"")},__utf16le$1=has_buf$1?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(chr0$1,""):___utf16le$1(e,t,r)}:___utf16le$1,___hexlify$1=function(e,t,r){for(var n=[],i=t;i<t+r;++i)n.push(("0"+e[i].toString(16)).slice(-2));return n.join("")},__hexlify$1=has_buf$1?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):___hexlify$1(e,t,r)}:___hexlify$1,___utf8$1=function(e,t,r){for(var n=[],i=t;i<r;i++)n.push(String.fromCharCode(__readUInt8$1(e,i)));return n.join("")},__utf8$1=has_buf$1?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf8",t,r):___utf8$1(e,t,r)}:___utf8$1,___lpstr$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r-1):""},__lpstr$1=___lpstr$1,___cpstr$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r-1):""},__cpstr$1=___cpstr$1,___lpwstr$1=function(e,t){var r=2*__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r-1):""},__lpwstr$1=___lpwstr$1,___lpp4$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf16le$1(e,t+4,t+4+r):""},__lpp4$1=___lpp4$1,___8lpp4$1=function(e,t){var r=__readUInt32LE$1(e,t);return r>0?__utf8$1(e,t+4,t+4+r):""},__8lpp4$1=___8lpp4$1,___double$1=function(e,t){return read_double_le$1(e,t)},__double$1=___double$1,is_buf$1=function(e){return Array.isArray(e)||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array};has_buf$1&&(__lpstr$1=function(e,t){if(!Buffer.isBuffer(e))return ___lpstr$1(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},__cpstr$1=function(e,t){if(!Buffer.isBuffer(e))return ___cpstr$1(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},__lpwstr$1=function(e,t){if(!Buffer.isBuffer(e))return ___lpwstr$1(e,t);var r=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r-1)},__lpp4$1=function(e,t){if(!Buffer.isBuffer(e))return ___lpp4$1(e,t);var r=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r)},__8lpp4$1=function(e,t){if(!Buffer.isBuffer(e))return ___8lpp4$1(e,t);var r=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+r)},__double$1=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):___double$1(e,t)},is_buf$1=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array});var __readUInt8$1=function(e,t){return e[t]},__readUInt16LE$1=function(e,t){return 256*e[t+1]+e[t]},__readInt16LE$1=function(e,t){var r=256*e[t+1]+e[t];return r<32768?r:-1*(65535-r+1)},__readUInt32LE$1=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},__readInt32LE$1=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},__readInt32BE$1=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function ReadShift$1(e,t){var r,n,i,a,o,s,l="",c=[];switch(t){case"dbcs":if(s=this.l,has_buf$1&&Buffer.isBuffer(this))l=this.slice(this.l,this.l+2*e).toString("utf16le");else for(o=0;o<e;++o)l+=String.fromCharCode(__readUInt16LE$1(this,s)),s+=2;e*=2;break;case"utf8":l=__utf8$1(this,this.l,this.l+e);break;case"utf16le":e*=2,l=__utf16le$1(this,this.l,this.l+e);break;case"wstr":return ReadShift$1.call(this,e,"dbcs");case"lpstr-ansi":l=__lpstr$1(this,this.l),e=4+__readUInt32LE$1(this,this.l);break;case"lpstr-cp":l=__cpstr$1(this,this.l),e=4+__readUInt32LE$1(this,this.l);break;case"lpwstr":l=__lpwstr$1(this,this.l),e=4+2*__readUInt32LE$1(this,this.l);break;case"lpp4":e=4+__readUInt32LE$1(this,this.l),l=__lpp4$1(this,this.l),2&e&&(e+=2);break;case"8lpp4":e=4+__readUInt32LE$1(this,this.l),l=__8lpp4$1(this,this.l),3&e&&(e+=4-(3&e));break;case"cstr":for(e=0,l="";0!==(i=__readUInt8$1(this,this.l+e++));)c.push(_getchar$1(i));l=c.join("");break;case"_wstr":for(e=0,l="";0!==(i=__readUInt16LE$1(this,this.l+e));)c.push(_getchar$1(i)),e+=2;e+=2,l=c.join("");break;case"dbcs-cont":for(l="",s=this.l,o=0;o<e;++o){if(this.lens&&-1!==this.lens.indexOf(s))return i=__readUInt8$1(this,s),this.l=s+1,a=ReadShift$1.call(this,e-o,i?"dbcs-cont":"sbcs-cont"),c.join("")+a;c.push(_getchar$1(__readUInt16LE$1(this,s))),s+=2}l=c.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(l="",s=this.l,o=0;o!=e;++o){if(this.lens&&-1!==this.lens.indexOf(s))return i=__readUInt8$1(this,s),this.l=s+1,a=ReadShift$1.call(this,e-o,i?"dbcs-cont":"sbcs-cont"),c.join("")+a;c.push(_getchar$1(__readUInt8$1(this,s))),s+=1}l=c.join("");break;default:switch(e){case 1:return r=__readUInt8$1(this,this.l),this.l++,r;case 2:return r=("i"===t?__readInt16LE$1:__readUInt16LE$1)(this,this.l),this.l+=2,r;case 4:case-4:return"i"!==t&&128&this[this.l+3]?(n=__readUInt32LE$1(this,this.l),this.l+=4,n):(r=(e>0?__readInt32LE$1:__readInt32BE$1)(this,this.l),this.l+=4,r);case 8:case-8:if("f"===t)return n=8==e?__double$1(this,this.l):__double$1([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,n;e=8;case 16:l=__hexlify$1(this,this.l,e)}}return this.l+=e,l}var __writeUInt32LE$1=function(e,t,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},__writeInt32LE$1=function(e,t,r){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},__writeUInt16LE$1=function(e,t,r){e[r]=255&t,e[r+1]=t>>>8&255};function WriteShift$1(e,t,r){var n=0,i=0;if("dbcs"===r){for(i=0;i!=t.length;++i)__writeUInt16LE$1(this,t.charCodeAt(i),this.l+2*i);n=2*t.length}else if("sbcs"===r){for(t=t.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=t.length;++i)this[this.l+i]=255&t.charCodeAt(i);n=t.length}else{if("hex"===r){for(;i<e;++i)this[this.l++]=parseInt(t.slice(2*i,2*i+2),16)||0;return this}if("utf16le"===r){var a=Math.min(this.l+e,this.length);for(i=0;i<Math.min(t.length,e);++i){var o=t.charCodeAt(i);this[this.l++]=255&o,this[this.l++]=o>>8}for(;this.l<a;)this[this.l++]=0;return this}switch(e){case 1:n=1,this[this.l]=255&t;break;case 2:n=2,this[this.l]=255&t,t>>>=8,this[this.l+1]=255&t;break;case 3:n=3,this[this.l]=255&t,t>>>=8,this[this.l+1]=255&t,t>>>=8,this[this.l+2]=255&t;break;case 4:n=4,__writeUInt32LE$1(this,t,this.l);break;case 8:if(n=8,"f"===r){write_double_le$1(this,t,this.l);break}case 16:break;case-4:n=4,__writeInt32LE$1(this,t,this.l)}}return this.l+=n,this}function CheckField$1(e,t){var r=__hexlify$1(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function prep_blob$1(e,t){e.l=t,e.read_shift=ReadShift$1,e.chk=CheckField$1,e.write_shift=WriteShift$1}function parsenoop$1(e,t){e.l+=t}function new_buf$1(e){var t=new_raw_buf$1(e);return prep_blob$1(t,0),t}function recordhopper$1(e,t,r){if(e){var n,i,a;prep_blob$1(e,e.l||0);for(var o=e.length,s=0,l=0;e.l<o;){128&(s=e.read_shift(1))&&(s=(127&s)+((127&e.read_shift(1))<<7));var c=XLSBRecordEnum$1[s]||XLSBRecordEnum$1[65535];for(a=127&(n=e.read_shift(1)),i=1;i<4&&128&n;++i)a+=(127&(n=e.read_shift(1)))<<7*i;l=e.l+a;var u=c.f&&c.f(e,a,r);if(e.l=l,t(u,c,s))return}}}function buf_array$1(){var e=[],t=has_buf$1?256:2048,r=function(e){var t=new_buf$1(e);return prep_blob$1(t,0),t},n=r(t),i=function(){n&&(n.length>n.l&&((n=n.slice(0,n.l)).l=n.length),n.length>0&&e.push(n),n=null)},a=function(e){return n&&e<n.length-n.l?n:(i(),n=r(Math.max(e+1,t)))};return{next:a,push:function(e){i(),null==(n=e).l&&(n.l=n.length),a(t)},end:function(){return i(),bconcat$1(e)},_bufs:e}}function shift_cell_xls$1(e,t,r){var n=dup$1(e);if(t.s?(n.cRel&&(n.c+=t.s.c),n.rRel&&(n.r+=t.s.r)):(n.cRel&&(n.c+=t.c),n.rRel&&(n.r+=t.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function shift_range_xls$1(e,t,r){var n=dup$1(e);return n.s=shift_cell_xls$1(n.s,t.s,r),n.e=shift_cell_xls$1(n.e,t.s,r),n}function encode_cell_xls$1(e,t){if(e.cRel&&e.c<0)for(e=dup$1(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=dup$1(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=encode_cell$1(e);return e.cRel||null==e.cRel||(r=fix_col$1(r)),e.rRel||null==e.rRel||(r=fix_row$1(r)),r}function encode_range_xls$1(e,t){return 0!=e.s.r||e.s.rRel||e.e.r!=(t.biff>=12?1048575:t.biff>=8?65536:16384)||e.e.rRel?0!=e.s.c||e.s.cRel||e.e.c!=(t.biff>=12?16383:255)||e.e.cRel?encode_cell_xls$1(e.s,t.biff)+":"+encode_cell_xls$1(e.e,t.biff):(e.s.rRel?"":"$")+encode_row$1(e.s.r)+":"+(e.e.rRel?"":"$")+encode_row$1(e.e.r):(e.s.cRel?"":"$")+encode_col$1(e.s.c)+":"+(e.e.cRel?"":"$")+encode_col$1(e.e.c)}function decode_row$1(e){return parseInt(unfix_row$1(e),10)-1}function encode_row$1(e){return""+(e+1)}function fix_row$1(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function unfix_row$1(e){return e.replace(/\$(\d+)$/,"$1")}function decode_col$1(e){for(var t=unfix_col$1(e),r=0,n=0;n!==t.length;++n)r=26*r+t.charCodeAt(n)-64;return r-1}function encode_col$1(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function fix_col$1(e){return e.replace(/^([A-Z])/,"$$$1")}function unfix_col$1(e){return e.replace(/^\$([A-Z])/,"$1")}function split_cell$1(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function decode_cell$1(e){for(var t=0,r=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);i>=48&&i<=57?t=10*t+(i-48):i>=65&&i<=90&&(r=26*r+(i-64))}return{c:r-1,r:t-1}}function encode_cell$1(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function decode_range$1(e){var t=e.indexOf(":");return-1==t?{s:decode_cell$1(e),e:decode_cell$1(e)}:{s:decode_cell$1(e.slice(0,t)),e:decode_cell$1(e.slice(t+1))}}function encode_range$1(e,t){return void 0===t||"number"==typeof t?encode_range$1(e.s,e.e):("string"!=typeof e&&(e=encode_cell$1(e)),"string"!=typeof t&&(t=encode_cell$1(t)),e==t?e:e+":"+t)}function safe_decode_range$1(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,i=0,a=e.length;for(r=0;n<a&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.s.c=--r,r=0;n<a&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;if(t.s.r=--r,n===a||10!=i)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++n,r=0;n!=a&&!((i=e.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(t.e.c=--r,r=0;n!=a&&!((i=e.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;return t.e.r=--r,t}function safe_format_cell$1(e,t){var r="d"==e.t&&t instanceof Date;if(null!=e.z)try{return e.w=SSF_format$1(e.z,r?datenum$1(t):t)}catch(n){}try{return e.w=SSF_format$1((e.XF||{}).numFmtId||(r?14:0),r?datenum$1(t):t)}catch(n){return""+t}}function format_cell$1(e,t,r){return null==e||null==e.t||"z"==e.t?"":void 0!==e.w?e.w:("d"==e.t&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),"e"==e.t?BErr$1[e.v]||e.v:safe_format_cell$1(e,null==t?e.v:t))}function sheet_to_workbook$1(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",n={};return n[r]=e,{SheetNames:[r],Sheets:n}}function sheet_add_aoa$1(e,t,r){var n=r||{},i=e?Array.isArray(e):n.dense,a=e||(i?[]:{}),o=0,s=0;if(a&&null!=n.origin){if("number"==typeof n.origin)o=n.origin;else{var l="string"==typeof n.origin?decode_cell$1(n.origin):n.origin;o=l.r,s=l.c}a["!ref"]||(a["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(a["!ref"]){var u=safe_decode_range$1(a["!ref"]);c.s.c=u.s.c,c.s.r=u.s.r,c.e.c=Math.max(c.e.c,u.e.c),c.e.r=Math.max(c.e.r,u.e.r),-1==o&&(c.e.r=o=u.e.r+1)}for(var d=0;d!=t.length;++d)if(t[d]){if(!Array.isArray(t[d]))throw new Error("aoa_to_sheet expects an array of arrays");for(var h=0;h!=t[d].length;++h)if(void 0!==t[d][h]){var p={v:t[d][h]},f=o+d,m=s+h;if(c.s.r>f&&(c.s.r=f),c.s.c>m&&(c.s.c=m),c.e.r<f&&(c.e.r=f),c.e.c<m&&(c.e.c=m),!t[d][h]||"object"!=typeof t[d][h]||Array.isArray(t[d][h])||t[d][h]instanceof Date)if(Array.isArray(p.v)&&(p.f=t[d][h][1],p.v=p.v[0]),null===p.v)if(p.f)p.t="n";else if(n.nullError)p.t="e",p.v=0;else{if(!n.sheetStubs)continue;p.t="z"}else"number"==typeof p.v?p.t="n":"boolean"==typeof p.v?p.t="b":p.v instanceof Date?(p.z=n.dateNF||table_fmt$1[14],n.cellDates?(p.t="d",p.w=SSF_format$1(p.z,datenum$1(p.v))):(p.t="n",p.v=datenum$1(p.v),p.w=SSF_format$1(p.z,p.v))):p.t="s";else p=t[d][h];if(i)a[f]||(a[f]=[]),a[f][m]&&a[f][m].z&&(p.z=a[f][m].z),a[f][m]=p;else{var g=encode_cell$1({c:m,r:f});a[g]&&a[g].z&&(p.z=a[g].z),a[g]=p}}}return c.s.c<1e7&&(a["!ref"]=encode_range$1(c)),a}function aoa_to_sheet$1(e,t){return sheet_add_aoa$1(null,e,t)}function parse_Int32LE$1(e){return e.read_shift(4,"i")}function parse_XLWideString$1(e){var t=e.read_shift(4);return 0===t?"":e.read_shift(t,"dbcs")}function parse_StrRun$1(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function parse_RichStr$1(e,t){var r=e.l,n=e.read_shift(1),i=parse_XLWideString$1(e),a=[],o={t:i,h:i};if(1&n){for(var s=e.read_shift(4),l=0;l!=s;++l)a.push(parse_StrRun$1(e));o.r=a}else o.r=[{ich:0,ifnt:0}];return e.l=r+t,o}var parse_BrtCommentText$1=parse_RichStr$1;function parse_XLSBCell$1(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function parse_XLSBShortCell$1(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}var parse_XLSBCodeName$1=parse_XLWideString$1;function parse_XLNullableWideString$1(e){var t=e.read_shift(4);return 0===t||0xffffffff===t?"":e.read_shift(t,"dbcs")}var parse_XLNameWideString$1=parse_XLWideString$1,parse_RelID$1=parse_XLNullableWideString$1;function parse_RkNumber$1(e){var t=e.slice(e.l,e.l+4),r=1&t[0],n=2&t[0];e.l+=4;var i=0===n?__double$1([0,0,0,0,252&t[0],t[1],t[2],t[3]],0):__readInt32LE$1(t,0)>>2;return r?i/100:i}function parse_RfX$1(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}var parse_UncheckedRfX$1=parse_RfX$1;function parse_Xnum$1(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function parse_BrtColor$1(e){var t={},r=e.read_shift(1)>>>1,n=e.read_shift(1),i=e.read_shift(2,"i"),a=e.read_shift(1),o=e.read_shift(1),s=e.read_shift(1);switch(e.l++,r){case 0:t.auto=1;break;case 1:t.index=n;var l=XLSIcv$1[n];l&&(t.rgb=rgb2Hex$1(l));break;case 2:t.rgb=rgb2Hex$1([a,o,s]);break;case 3:t.theme=n}return 0!=i&&(t.tint=i>0?i/32767:i/32768),t}function parse_FontFlags$1(e){var t=e.read_shift(1);return e.l++,{fBold:1&t,fItalic:2&t,fUnderline:4&t,fStrikeout:8&t,fOutline:16&t,fShadow:32&t,fCondense:64&t,fExtend:128&t}}function parse_ClipboardFormatOrString$1(e,t){var r=e.read_shift(4);switch(r){case 0:return"";case 0xffffffff:case 0xfffffffe:return{2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"}[e.read_shift(4)]||""}if(r>400)throw new Error("Unsupported Clipboard: "+r.toString(16));return e.l-=4,e.read_shift(0,1==t?"lpstr":"lpwstr")}function parse_ClipboardFormatOrAnsiString$1(e){return parse_ClipboardFormatOrString$1(e,1)}function parse_ClipboardFormatOrUnicodeString$1(e){return parse_ClipboardFormatOrString$1(e,2)}var VT_I2$1=2,VT_I4$1=3,VT_BOOL$1=11,VT_VARIANT$1=12,VT_UI4$1=19,VT_FILETIME$1=64,VT_BLOB$1=65,VT_CF$1=71,VT_VECTOR_VARIANT$1=4108,VT_VECTOR_LPSTR$1=4126,VT_STRING$1=80,VT_USTR$1=81,VT_CUSTOM$1=[VT_STRING$1,VT_USTR$1],DocSummaryPIDDSI$1={1:{n:"CodePage",t:VT_I2$1},2:{n:"Category",t:VT_STRING$1},3:{n:"PresentationFormat",t:VT_STRING$1},4:{n:"ByteCount",t:VT_I4$1},5:{n:"LineCount",t:VT_I4$1},6:{n:"ParagraphCount",t:VT_I4$1},7:{n:"SlideCount",t:VT_I4$1},8:{n:"NoteCount",t:VT_I4$1},9:{n:"HiddenCount",t:VT_I4$1},10:{n:"MultimediaClipCount",t:VT_I4$1},11:{n:"ScaleCrop",t:VT_BOOL$1},12:{n:"HeadingPairs",t:VT_VECTOR_VARIANT$1},13:{n:"TitlesOfParts",t:VT_VECTOR_LPSTR$1},14:{n:"Manager",t:VT_STRING$1},15:{n:"Company",t:VT_STRING$1},16:{n:"LinksUpToDate",t:VT_BOOL$1},17:{n:"CharacterCount",t:VT_I4$1},19:{n:"SharedDoc",t:VT_BOOL$1},22:{n:"HyperlinksChanged",t:VT_BOOL$1},23:{n:"AppVersion",t:VT_I4$1,p:"version"},24:{n:"DigSig",t:VT_BLOB$1},26:{n:"ContentType",t:VT_STRING$1},27:{n:"ContentStatus",t:VT_STRING$1},28:{n:"Language",t:VT_STRING$1},29:{n:"Version",t:VT_STRING$1},255:{},0x80000000:{n:"Locale",t:VT_UI4$1},0x80000003:{n:"Behavior",t:VT_UI4$1},0x72627262:{}},SummaryPIDSI$1={1:{n:"CodePage",t:VT_I2$1},2:{n:"Title",t:VT_STRING$1},3:{n:"Subject",t:VT_STRING$1},4:{n:"Author",t:VT_STRING$1},5:{n:"Keywords",t:VT_STRING$1},6:{n:"Comments",t:VT_STRING$1},7:{n:"Template",t:VT_STRING$1},8:{n:"LastAuthor",t:VT_STRING$1},9:{n:"RevNumber",t:VT_STRING$1},10:{n:"EditTime",t:VT_FILETIME$1},11:{n:"LastPrinted",t:VT_FILETIME$1},12:{n:"CreatedDate",t:VT_FILETIME$1},13:{n:"ModifiedDate",t:VT_FILETIME$1},14:{n:"PageCount",t:VT_I4$1},15:{n:"WordCount",t:VT_I4$1},16:{n:"CharCount",t:VT_I4$1},17:{n:"Thumbnail",t:VT_CF$1},18:{n:"Application",t:VT_STRING$1},19:{n:"DocSecurity",t:VT_I4$1},255:{},0x80000000:{n:"Locale",t:VT_UI4$1},0x80000003:{n:"Behavior",t:VT_UI4$1},0x72627262:{}},CountryEnum$1={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},XLSFillPattern$1=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function rgbify$1(e){return e.map((function(e){return[e>>16&255,e>>8&255,255&e]}))}var _XLSIcv$1=rgbify$1([0,0xffffff,0xff0000,65280,255,0xffff00,0xff00ff,65535,0,0xffffff,0xff0000,65280,255,0xffff00,0xff00ff,65535,8388608,32768,128,8421376,8388736,32896,0xc0c0c0,8421504,0x9999ff,0x993366,0xffffcc,0xccffff,6684774,0xff8080,26316,0xccccff,128,0xff00ff,0xffff00,65535,8388736,8388608,32896,255,52479,0xccffff,0xccffcc,0xffff99,0x99ccff,0xff99cc,0xcc99ff,0xffcc99,3368703,3394764,0x99cc00,0xffcc00,0xff9900,0xff6600,6710937,9868950,13158,3381606,13056,3355392,0x993300,0x993366,3355545,3355443,0xffffff,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),XLSIcv$1=dup$1(_XLSIcv$1),BErr$1={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},RBErr$1={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},ct2type$1={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};function new_ct$1(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function parse_ct$1(e){var t=new_ct$1();if(!e||!e.match)return t;var r={};if((e.match(tagregex$1)||[]).forEach((function(e){var n=parsexmltag$1(e);switch(n[0].replace(nsregex$1,"<")){case"<?xml":break;case"<Types":t.xmlns=n["xmlns"+(n[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[n.Extension]=n.ContentType;break;case"<Override":void 0!==t[ct2type$1[n.ContentType]]&&t[ct2type$1[n.ContentType]].push(n.PartName)}})),t.xmlns!==XMLNS$1.CT)throw new Error("Unknown Namespace: "+t.xmlns);return t.calcchain=t.calcchains.length>0?t.calcchains[0]:"",t.sst=t.strs.length>0?t.strs[0]:"",t.style=t.styles.length>0?t.styles[0]:"",t.defaults=r,delete t.calcchains,t}var RELS$1={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function get_rels_path$1(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function parse_rels$1(e,t){var r={"!id":{}};if(!e)return r;"/"!==t.charAt(0)&&(t="/"+t);var n={};return(e.match(tagregex$1)||[]).forEach((function(e){var i=parsexmltag$1(e);if("<Relationship"===i[0]){var a={};a.Type=i.Type,a.Target=i.Target,a.Id=i.Id,i.TargetMode&&(a.TargetMode=i.TargetMode);var o="External"===i.TargetMode?i.Target:resolve_path$1(i.Target,t);r[o]=a,n[i.Id]=a}})),r["!id"]=n,r}var CT_ODS$1="application/vnd.oasis.opendocument.spreadsheet";function parse_manifest$1(e,t){for(var r,n,i=xlml_normalize$1(e);r=xlmlregex$1.exec(i);)switch(r[3]){case"manifest":break;case"file-entry":if("/"==(n=parsexmltag$1(r[0],!1)).path&&n.type!==CT_ODS$1)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(t&&t.WTF)throw r}}var CORE_PROPS$1=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],CORE_PROPS_REGEX=function(){for(var e=new Array(CORE_PROPS$1.length),t=0;t<CORE_PROPS$1.length;++t){var r=CORE_PROPS$1[t],n="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);e[t]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return e}();function parse_core_props$1(e){var t={};e=utf8read$1(e);for(var r=0;r<CORE_PROPS$1.length;++r){var n=CORE_PROPS$1[r],i=e.match(CORE_PROPS_REGEX[r]);null!=i&&i.length>0&&(t[n[1]]=unescapexml$1(i[1])),"date"===n[2]&&t[n[1]]&&(t[n[1]]=parseDate$1(t[n[1]]))}return t}var EXT_PROPS$1=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function load_props_pairs$1(e,t,r,n){var i=[];if("string"==typeof e)i=parseVector$1(e,n);else for(var a=0;a<e.length;++a)i=i.concat(e[a].map((function(e){return{v:e}})));var o="string"==typeof t?parseVector$1(t,n).map((function(e){return e.v})):t,s=0,l=0;if(o.length>0)for(var c=0;c!==i.length;c+=2){switch(l=+i[c+1].v,i[c].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsbl\xe4tter":case"\xc7alışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de c\xe1lculo":case"Planilhas":case"Regneark":case"Hojas de c\xe1lculo":case"Werkbladen":r.Worksheets=l,r.SheetNames=o.slice(s,s+l);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne omr\xe5der":r.NamedRanges=l,r.DefinedNames=o.slice(s,s+l);break;case"Charts":case"Diagramme":r.Chartsheets=l,r.ChartNames=o.slice(s,s+l)}s+=l}}function parse_ext_props$1(e,t,r){var n={};return t||(t={}),e=utf8read$1(e),EXT_PROPS$1.forEach((function(r){var i=(e.match(matchtag(r[0]))||[])[1];switch(r[2]){case"string":i&&(t[r[1]]=unescapexml$1(i));break;case"bool":t[r[1]]="true"===i;break;case"raw":var a=e.match(new RegExp("<"+r[0]+"[^>]*>([\\s\\S]*?)</"+r[0]+">"));a&&a.length>0&&(n[r[1]]=a[1])}})),n.HeadingPairs&&n.TitlesOfParts&&load_props_pairs$1(n.HeadingPairs,n.TitlesOfParts,t,r),t}var custregex$1=/<[^>]+>[^<]*/g;function parse_cust_props$1(e,t){var r={},n="",i=e.match(custregex$1);if(i)for(var a=0;a!=i.length;++a){var o=i[a],s=parsexmltag$1(o);switch(s[0]){case"<?xml":case"<Properties":break;case"<property":n=unescapexml$1(s.name);break;case"</property>":n=null;break;default:if(0===o.indexOf("<vt:")){var l=o.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":case"cy":case"error":r[n]=unescapexml$1(u);break;case"bool":r[n]=parsexmlbool$1(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[n]=parseInt(u,10);break;case"r4":case"r8":case"decimal":r[n]=parseFloat(u);break;case"filetime":case"date":r[n]=parseDate$1(u);break;default:if("/"==c.slice(-1))break;t.WTF&&"undefined"!=typeof console&&console.warn("Unexpected",o,c,l)}}else if("</"===o.slice(0,2));else if(t.WTF)throw new Error(o)}}return r}var XLMLDocPropsMap$1={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},evert_XLMLDPM$1;function xlml_set_prop$1(e,t,r){evert_XLMLDPM$1||(evert_XLMLDPM$1=evert$1(XLMLDocPropsMap$1)),e[t=evert_XLMLDPM$1[t]||t]=r}function parse_FILETIME$1(e){var t=e.read_shift(4),r=e.read_shift(4);return new Date(1e3*(r/1e7*Math.pow(2,32)+t/1e7-0x2b6109100)).toISOString().replace(/\.000/,"")}function parse_lpstr$1(e,t,r){var n=e.l,i=e.read_shift(0,"lpstr-cp");if(r)for(;e.l-n&3;)++e.l;return i}function parse_lpwstr$1(e,t,r){return e.read_shift(0,"lpwstr")}function parse_VtStringBase$1(e,t,r){return 31===t?parse_lpwstr$1(e):parse_lpstr$1(e,t,r)}function parse_VtString$1(e,t,r){return parse_VtStringBase$1(e,t,!1===r?0:4)}function parse_VtUnalignedString$1(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return parse_VtStringBase$1(e,t,0)}function parse_VtVecLpwstrValue$1(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n){var i=e.l;r[n]=e.read_shift(0,"lpwstr").replace(chr0$1,""),e.l-i&2&&(e.l+=2)}return r}function parse_VtVecUnalignedLpstrValue$1(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n)r[n]=e.read_shift(0,"lpstr-cp").replace(chr0$1,"");return r}function parse_VtHeadingPair$1(e){var t=e.l,r=parse_TypedPropertyValue$1(e,VT_USTR$1);return 0==e[e.l]&&0==e[e.l+1]&&e.l-t&2&&(e.l+=2),[r,parse_TypedPropertyValue$1(e,VT_I4$1)]}function parse_VtVecHeadingPairValue$1(e){for(var t=e.read_shift(4),r=[],n=0;n<t/2;++n)r.push(parse_VtHeadingPair$1(e));return r}function parse_dictionary$1(e,t){for(var r=e.read_shift(4),n={},i=0;i!=r;++i){var a=e.read_shift(4),o=e.read_shift(4);n[a]=e.read_shift(o,1200===t?"utf16le":"utf8").replace(chr0$1,"").replace(chr1$1,"!"),1200===t&&o%2&&(e.l+=2)}return 3&e.l&&(e.l=e.l>>3<<2),n}function parse_BLOB$1(e){var t=e.read_shift(4),r=e.slice(e.l,e.l+t);return e.l+=t,(3&t)>0&&(e.l+=4-(3&t)&3),r}function parse_ClipboardData$1(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}function parse_TypedPropertyValue$1(e,t,r){var n,i=e.read_shift(2),a=r||{};if(e.l+=2,t!==VT_VARIANT$1&&i!==t&&-1===VT_CUSTOM$1.indexOf(t)&&(4126!=(65534&t)||4126!=(65534&i)))throw new Error("Expected type "+t+" saw "+i);switch(t===VT_VARIANT$1?i:t){case 2:return n=e.read_shift(2,"i"),a.raw||(e.l+=2),n;case 3:return n=e.read_shift(4,"i");case 11:return 0!==e.read_shift(4);case 19:return n=e.read_shift(4);case 30:return parse_lpstr$1(e,i,4).replace(chr0$1,"");case 31:return parse_lpwstr$1(e);case 64:return parse_FILETIME$1(e);case 65:return parse_BLOB$1(e);case 71:return parse_ClipboardData$1(e);case 80:return parse_VtString$1(e,i,!a.raw).replace(chr0$1,"");case 81:return parse_VtUnalignedString$1(e,i).replace(chr0$1,"");case 4108:return parse_VtVecHeadingPairValue$1(e);case 4126:case 4127:return 4127==i?parse_VtVecLpwstrValue$1(e):parse_VtVecUnalignedLpstrValue$1(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+i)}}function parse_PropertySet$1(e,t){var r=e.l,n=e.read_shift(4),i=e.read_shift(4),a=[],o=0,s=0,l=-1,c={};for(o=0;o!=i;++o){var u=e.read_shift(4),d=e.read_shift(4);a[o]=[u,d+r]}a.sort((function(e,t){return e[1]-t[1]}));var h={};for(o=0;o!=i;++o){if(e.l!==a[o][1]){var p=!0;if(o>0&&t)switch(t[a[o-1][0]].t){case 2:e.l+2===a[o][1]&&(e.l+=2,p=!1);break;case 80:case 4108:e.l<=a[o][1]&&(e.l=a[o][1],p=!1)}if((!t||0==o)&&e.l<=a[o][1]&&(p=!1,e.l=a[o][1]),p)throw new Error("Read Error: Expected address "+a[o][1]+" at "+e.l+" :"+o)}if(t){var f=t[a[o][0]];if(h[f.n]=parse_TypedPropertyValue$1(e,f.t,{raw:!0}),"version"===f.p&&(h[f.n]=String(h[f.n]>>16)+"."+("0000"+String(65535&h[f.n])).slice(-4)),"CodePage"==f.n)switch(h[f.n]){case 0:h[f.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:set_cp$1(s=h[f.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+h[f.n])}}else if(1===a[o][0]){if(s=h.CodePage=parse_TypedPropertyValue$1(e,VT_I2$1),set_cp$1(s),-1!==l){var m=e.l;e.l=a[l][1],c=parse_dictionary$1(e,s),e.l=m}}else if(0===a[o][0]){if(0===s){l=o,e.l=a[o+1][1];continue}c=parse_dictionary$1(e,s)}else{var g,_=c[a[o][0]];switch(e[e.l]){case 65:e.l+=4,g=parse_BLOB$1(e);break;case 30:case 31:e.l+=4,g=parse_VtString$1(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,g=e.read_shift(4,"i");break;case 19:e.l+=4,g=e.read_shift(4);break;case 5:e.l+=4,g=e.read_shift(8,"f");break;case 11:e.l+=4,g=parsebool$1(e,4);break;case 64:e.l+=4,g=parseDate$1(parse_FILETIME$1(e));break;default:throw new Error("unparsed value: "+e[e.l])}h[_]=g}}return e.l=r+n,h}function parse_PropertySetStream$1(e,t,r){var n=e.content;if(!n)return{};prep_blob$1(n,0);var i,a,o,s,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var c=n.read_shift(4),u=n.read_shift(16);if(u!==CFB$1.utils.consts.HEADER_CLSID&&u!==r)throw new Error("Bad PropertySet CLSID "+u);if(1!==(i=n.read_shift(4))&&2!==i)throw new Error("Unrecognized #Sets: "+i);if(a=n.read_shift(16),s=n.read_shift(4),1===i&&s!==n.l)throw new Error("Length mismatch: "+s+" !== "+n.l);2===i&&(o=n.read_shift(16),l=n.read_shift(4));var d,h=parse_PropertySet$1(n,t),p={SystemIdentifier:c};for(var f in h)p[f]=h[f];if(p.FMTID=a,1===i)return p;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);try{d=parse_PropertySet$1(n,null)}catch(m){}for(f in d)p[f]=d[f];return p.FMTID=[a,o],p}function parsenoop2$1(e,t){return e.read_shift(t),null}function parslurp$1(e,t,r){for(var n=[],i=e.l+t;e.l<i;)n.push(r(e,i-e.l));if(i!==e.l)throw new Error("Slurp error");return n}function parsebool$1(e,t){return 1===e.read_shift(t)}function parseuint16$1(e){return e.read_shift(2,"u")}function parseuint16a$1(e,t){return parslurp$1(e,t,parseuint16$1)}function parse_Bes$1(e){var t=e.read_shift(1);return 1===e.read_shift(1)?t:1===t}function parse_ShortXLUnicodeString$1(e,t,r){var n=e.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont";(r&&r.biff,r&&8!=r.biff)?12==r.biff&&(i="wstr"):e.read_shift(1)&&(i="dbcs-cont");return r.biff>=2&&r.biff<=5&&(i="cpstr"),n?e.read_shift(n,i):""}function parse_XLUnicodeRichExtendedString$1(e){var t,r=e.read_shift(2),n=e.read_shift(1),i=4&n,a=8&n,o=1+(1&n),s=0,l={};a&&(s=e.read_shift(2)),i&&(t=e.read_shift(4));var c=2==o?"dbcs-cont":"sbcs-cont",u=0===r?"":e.read_shift(r,c);return a&&(e.l+=4*s),i&&(e.l+=t),l.t=u,a||(l.raw="<t>"+l.t+"</t>",l.r=l.t),l}function parse_XLUnicodeStringNoCch$1(e,t,r){if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}return 0===e.read_shift(1)?e.read_shift(t,"sbcs-cont"):e.read_shift(t,"dbcs-cont")}function parse_XLUnicodeString$1(e,t,r){var n=e.read_shift(r&&2==r.biff?1:2);return 0===n?(e.l++,""):parse_XLUnicodeStringNoCch$1(e,n,r)}function parse_XLUnicodeString2$1(e,t,r){if(r.biff>5)return parse_XLUnicodeString$1(e,t,r);var n=e.read_shift(1);return 0===n?(e.l++,""):e.read_shift(n,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function parse_ControlInfo$1(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);return e.l+=2,[t,r]}function parse_URLMoniker$1(e){var t=e.read_shift(4),r=e.l,n=!1;t>24&&(e.l+=t-24,"795881f43b1d7f48af2c825dc4852763"===e.read_shift(16)&&(n=!0),e.l=r);var i=e.read_shift((n?t-24:t)>>1,"utf16le").replace(chr0$1,"");return n&&(e.l+=24),i}function parse_FileMoniker$1(e){for(var t=e.read_shift(2),r="";t-- >0;)r+="../";var n=e.read_shift(0,"lpstr-ansi");if(e.l+=2,57005!=e.read_shift(2))throw new Error("Bad FileMoniker");if(0===e.read_shift(4))return r+n.replace(/\\/g,"/");var i=e.read_shift(4);if(3!=e.read_shift(2))throw new Error("Bad FileMoniker");return r+e.read_shift(i>>1,"utf16le").replace(chr0$1,"")}function parse_HyperlinkMoniker$1(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return parse_URLMoniker$1(e);case"0303000000000000c000000000000046":return parse_FileMoniker$1(e);default:throw new Error("Unsupported Moniker "+r)}}function parse_HyperlinkString$1(e){var t=e.read_shift(4);return t>0?e.read_shift(t,"utf16le").replace(chr0$1,""):""}function parse_Hyperlink$1(e,t){var r=e.l+t,n=e.read_shift(4);if(2!==n)throw new Error("Unrecognized streamVersion: "+n);var i=e.read_shift(2);e.l+=2;var a,o,s,l,c,u,d="";16&i&&(a=parse_HyperlinkString$1(e,r-e.l)),128&i&&(o=parse_HyperlinkString$1(e,r-e.l)),257&~i||(s=parse_HyperlinkString$1(e,r-e.l)),1==(257&i)&&(l=parse_HyperlinkMoniker$1(e,r-e.l)),8&i&&(d=parse_HyperlinkString$1(e,r-e.l)),32&i&&(c=e.read_shift(16)),64&i&&(u=parse_FILETIME$1(e)),e.l=r;var h=o||s||l||"";h&&d&&(h+="#"+d),h||(h="#"+d),2&i&&"/"==h.charAt(0)&&"/"!=h.charAt(1)&&(h="file://"+h);var p={Target:h};return c&&(p.guid=c),u&&(p.time=u),a&&(p.Tooltip=a),p}function parse_LongRGBA$1(e){return[e.read_shift(1),e.read_shift(1),e.read_shift(1),e.read_shift(1)]}function parse_LongRGB$1(e,t){var r=parse_LongRGBA$1(e);return r[3]=0,r}function parse_XLSCell$1(e){return{r:e.read_shift(2),c:e.read_shift(2),ixfe:e.read_shift(2)}}function parse_frtHeader$1(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}function parse_OptXLUnicodeString$1(e,t,r){return 0===t?"":parse_XLUnicodeString2$1(e,t,r)}function parse_XTI$1(e,t,r){var n=r.biff>8?4:2;return[e.read_shift(n),e.read_shift(n,"i"),e.read_shift(n,"i")]}function parse_RkRec$1(e){return[e.read_shift(2),parse_RkNumber$1(e)]}function parse_AddinUdf$1(e,t,r){e.l+=4,t-=4;var n=e.l+t,i=parse_ShortXLUnicodeString$1(e,t,r),a=e.read_shift(2);if(a!==(n-=e.l))throw new Error("Malformed AddinUdf: padding = "+n+" != "+a);return e.l+=a,i}function parse_Ref8U$1(e){var t=e.read_shift(2),r=e.read_shift(2);return{s:{c:e.read_shift(2),r:t},e:{c:e.read_shift(2),r:r}}}function parse_RefU$1(e){var t=e.read_shift(2),r=e.read_shift(2);return{s:{c:e.read_shift(1),r:t},e:{c:e.read_shift(1),r:r}}}var parse_Ref$1=parse_RefU$1;function parse_FtCmo$1(e){e.l+=4;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2);return e.l+=12,[r,t,n]}function parse_FtNts$1(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t}function parse_FtCf$1(e){return e.l+=4,e.cf=e.read_shift(2),{}}function parse_FtSkip$1(e){e.l+=2,e.l+=e.read_shift(2)}var FtTab$1={0:parse_FtSkip$1,4:parse_FtSkip$1,5:parse_FtSkip$1,6:parse_FtSkip$1,7:parse_FtCf$1,8:parse_FtSkip$1,9:parse_FtSkip$1,10:parse_FtSkip$1,11:parse_FtSkip$1,12:parse_FtSkip$1,13:parse_FtNts$1,14:parse_FtSkip$1,15:parse_FtSkip$1,16:parse_FtSkip$1,17:parse_FtSkip$1,18:parse_FtSkip$1,19:parse_FtSkip$1,20:parse_FtSkip$1,21:parse_FtCmo$1};function parse_FtArray$1(e,t){for(var r=e.l+t,n=[];e.l<r;){var i=e.read_shift(2);e.l-=2;try{n.push(FtTab$1[i](e,r-e.l))}catch(a){return e.l=r,n}}return e.l!=r&&(e.l=r),n}function parse_BOF$1(e,t){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=e.read_shift(2),(t-=2)>=2&&(r.dt=e.read_shift(2),e.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(t>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return e.read_shift(t),r}function parse_InterfaceHdr$1(e,t){return 0===t||e.read_shift(2),1200}function parse_WriteAccess$1(e,t,r){if(r.enc)return e.l+=t,"";var n=e.l,i=parse_XLUnicodeString2$1(e,0,r);return e.read_shift(t+n-e.l),i}function parse_WsBool$1(e,t,r){var n=r&&8==r.biff||2==t?e.read_shift(2):(e.l+=t,0);return{fDialog:16&n,fBelow:64&n,fRight:128&n}}function parse_BoundSheet8$1(e,t,r){var n=e.read_shift(4),i=3&e.read_shift(1),a=e.read_shift(1);switch(a){case 0:a="Worksheet";break;case 1:a="Macrosheet";break;case 2:a="Chartsheet";break;case 6:a="VBAModule"}var o=parse_ShortXLUnicodeString$1(e,0,r);return 0===o.length&&(o="Sheet1"),{pos:n,hs:i,dt:a,name:o}}function parse_SST$1(e,t){for(var r=e.l+t,n=e.read_shift(4),i=e.read_shift(4),a=[],o=0;o!=i&&e.l<r;++o)a.push(parse_XLUnicodeRichExtendedString$1(e));return a.Count=n,a.Unique=i,a}function parse_ExtSST$1(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}function parse_Row$1(e){var t={};t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c;var r=e.read_shift(2);e.l+=4;var n=e.read_shift(1);return e.l+=3,7&n&&(t.level=7&n),32&n&&(t.hidden=!0),64&n&&(t.hpt=r/20),t}function parse_ForceFullCalculation$1(e){var t=parse_frtHeader$1(e);if(2211!=t.type)throw new Error("Invalid Future Record "+t.type);return 0!==e.read_shift(4)}function parse_RecalcId$1(e){return e.read_shift(2),e.read_shift(4)}function parse_DefaultRowHeight$1(e,t,r){var n=0;r&&2==r.biff||(n=e.read_shift(2));var i=e.read_shift(2);return r&&2==r.biff&&(n=1-(i>>15),i&=32767),[{Unsynced:1&n,DyZero:(2&n)>>1,ExAsc:(4&n)>>2,ExDsc:(8&n)>>3},i]}function parse_Window1$1(e){return{Pos:[e.read_shift(2),e.read_shift(2)],Dim:[e.read_shift(2),e.read_shift(2)],Flags:e.read_shift(2),CurTab:e.read_shift(2),FirstTab:e.read_shift(2),Selected:e.read_shift(2),TabRatio:e.read_shift(2)}}function parse_Window2$1(e,t,r){return r&&r.biff>=2&&r.biff<5?{}:{RTL:64&e.read_shift(2)}}function parse_Pane$1(){}function parse_Font$1(e,t,r){var n={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10}return n.name=parse_ShortXLUnicodeString$1(e,0,r),n}function parse_LabelSst$1(e){var t=parse_XLSCell$1(e);return t.isst=e.read_shift(4),t}function parse_Label$1(e,t,r){r.biffguess&&2==r.biff&&(r.biff=5);var n=e.l+t,i=parse_XLSCell$1(e);2==r.biff&&e.l++;var a=parse_XLUnicodeString$1(e,n-e.l,r);return i.val=a,i}function parse_Format$1(e,t,r){return[e.read_shift(2),parse_XLUnicodeString2$1(e,0,r)]}var parse_BIFF2Format$1=parse_XLUnicodeString2$1;function parse_Dimensions$1(e,t,r){var n=e.l+t,i=8!=r.biff&&r.biff?2:4,a=e.read_shift(i),o=e.read_shift(i),s=e.read_shift(2),l=e.read_shift(2);return e.l=n,{s:{r:a,c:s},e:{r:o,c:l}}}function parse_RK$1(e){var t=e.read_shift(2),r=e.read_shift(2),n=parse_RkRec$1(e);return{r:t,c:r,ixfe:n[0],rknum:n[1]}}function parse_MulRk$1(e,t){for(var r=e.l+t-2,n=e.read_shift(2),i=e.read_shift(2),a=[];e.l<r;)a.push(parse_RkRec$1(e));if(e.l!==r)throw new Error("MulRK read error");var o=e.read_shift(2);if(a.length!=o-i+1)throw new Error("MulRK length mismatch");return{r:n,c:i,C:o,rkrec:a}}function parse_MulBlank$1(e,t){for(var r=e.l+t-2,n=e.read_shift(2),i=e.read_shift(2),a=[];e.l<r;)a.push(e.read_shift(2));if(e.l!==r)throw new Error("MulBlank read error");var o=e.read_shift(2);if(a.length!=o-i+1)throw new Error("MulBlank length mismatch");return{r:n,c:i,C:o,ixfe:a}}function parse_CellStyleXF$1(e,t,r,n){var i={},a=e.read_shift(4),o=e.read_shift(4),s=e.read_shift(4),l=e.read_shift(2);return i.patternType=XLSFillPattern$1[s>>26],n.cellStyles?(i.alc=7&a,i.fWrap=a>>3&1,i.alcV=a>>4&7,i.fJustLast=a>>7&1,i.trot=a>>8&255,i.cIndent=a>>16&15,i.fShrinkToFit=a>>20&1,i.iReadOrder=a>>22&2,i.fAtrNum=a>>26&1,i.fAtrFnt=a>>27&1,i.fAtrAlc=a>>28&1,i.fAtrBdr=a>>29&1,i.fAtrPat=a>>30&1,i.fAtrProt=a>>31&1,i.dgLeft=15&o,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=127&s,i.icvBottom=s>>7&127,i.icvDiag=s>>14&127,i.dgDiag=s>>21&15,i.icvFore=127&l,i.icvBack=l>>7&127,i.fsxButton=l>>14&1,i):i}function parse_XF$1(e,t,r){var n={};return n.ifnt=e.read_shift(2),n.numFmtId=e.read_shift(2),n.flags=e.read_shift(2),n.fStyle=n.flags>>2&1,t-=6,n.data=parse_CellStyleXF$1(e,t,n.fStyle,r),n}function parse_Guts$1(e){e.l+=4;var t=[e.read_shift(2),e.read_shift(2)];if(0!==t[0]&&t[0]--,0!==t[1]&&t[1]--,t[0]>7||t[1]>7)throw new Error("Bad Gutters: "+t.join("|"));return t}function parse_BoolErr$1(e,t,r){var n=parse_XLSCell$1(e);2!=r.biff&&9!=t||++e.l;var i=parse_Bes$1(e);return n.val=i,n.t=!0===i||!1===i?"b":"e",n}function parse_Number$1(e,t,r){r.biffguess&&2==r.biff&&(r.biff=5);var n=parse_XLSCell$1(e),i=parse_Xnum$1(e);return n.val=i,n}var parse_XLHeaderFooter$1=parse_OptXLUnicodeString$1;function parse_SupBook$1(e,t,r){var n=e.l+t,i=e.read_shift(2),a=e.read_shift(2);if(r.sbcch=a,1025==a||14849==a)return[a,i];if(a<1||a>255)throw new Error("Unexpected SupBook type: "+a);for(var o=parse_XLUnicodeStringNoCch$1(e,a),s=[];n>e.l;)s.push(parse_XLUnicodeString$1(e));return[a,i,o,s]}function parse_ExternName$1(e,t,r){var n,i=e.read_shift(2),a={fBuiltIn:1&i,fWantAdvise:i>>>1&1,fWantPict:i>>>2&1,fOle:i>>>3&1,fOleLink:i>>>4&1,cf:i>>>5&1023,fIcon:i>>>15&1};return 14849===r.sbcch&&(n=parse_AddinUdf$1(e,t-2,r)),a.body=n||e.read_shift(t-2),"string"==typeof n&&(a.Name=n),a}var XLSLblBuiltIn$1=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function parse_Lbl$1(e,t,r){var n=e.l+t,i=e.read_shift(2),a=e.read_shift(1),o=e.read_shift(1),s=e.read_shift(r&&2==r.biff?1:2),l=0;(!r||r.biff>=5)&&(5!=r.biff&&(e.l+=2),l=e.read_shift(2),5==r.biff&&(e.l+=2),e.l+=4);var c=parse_XLUnicodeStringNoCch$1(e,o,r);32&i&&(c=XLSLblBuiltIn$1[c.charCodeAt(0)]);var u=n-e.l;return r&&2==r.biff&&--u,{chKey:a,Name:c,itab:l,rgce:n!=e.l&&0!==s&&u>0?parse_NameParsedFormula$1(e,u,r,s):[]}}function parse_ExternSheet$1(e,t,r){if(r.biff<8)return parse_BIFF5ExternSheet$1(e,t,r);for(var n=[],i=e.l+t,a=e.read_shift(r.biff>8?4:2);0!=a--;)n.push(parse_XTI$1(e,r.biff>8?12:6,r));if(e.l!=i)throw new Error("Bad ExternSheet: "+e.l+" != "+i);return n}function parse_BIFF5ExternSheet$1(e,t,r){3==e[e.l+1]&&e[e.l]++;var n=parse_ShortXLUnicodeString$1(e,t,r);return 3==n.charCodeAt(0)?n.slice(1):n}function parse_NameCmt$1(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),i=e.read_shift(2);return[parse_XLUnicodeStringNoCch$1(e,n,r),parse_XLUnicodeStringNoCch$1(e,i,r)]}e.l+=t}function parse_ShrFmla$1(e,t,r){var n=parse_RefU$1(e);e.l++;var i=e.read_shift(1);return[parse_SharedParsedFormula$1(e,t-=8,r),i,n]}function parse_Array$1(e,t,r){var n=parse_Ref$1(e);switch(r.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[n,parse_ArrayParsedFormula$1(e,t,r)]}function parse_MTRSettings$1(e){return[0!==e.read_shift(4),0!==e.read_shift(4),e.read_shift(4)]}function parse_NoteSh$1(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),i=e.read_shift(2),a=e.read_shift(2),o=e.read_shift(2),s=parse_XLUnicodeString2$1(e,0,r);return r.biff<8&&e.read_shift(1),[{r:n,c:i},s,o,a]}}function parse_Note$1(e,t,r){return parse_NoteSh$1(e,t,r)}function parse_MergeCells$1(e,t){for(var r=[],n=e.read_shift(2);n--;)r.push(parse_Ref8U$1(e));return r}function parse_Obj$1(e,t,r){if(r&&r.biff<8)return parse_BIFF5Obj$1(e,t,r);var n=parse_FtCmo$1(e);return{cmo:n,ft:parse_FtArray$1(e,t-22,n[1])}}var parse_BIFF5OT$1={8:function(e,t){var r=e.l+t;e.l+=10;var n=e.read_shift(2);e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4;var i=e.read_shift(1);return e.l+=i,e.l=r,{fmt:n}}};function parse_BIFF5Obj$1(e,t,r){e.l+=4;var n=e.read_shift(2),i=e.read_shift(2),a=e.read_shift(2);e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=6,t-=36;var o=[];return o.push((parse_BIFF5OT$1[n]||parsenoop$1)(e,t,r)),{cmo:[i,n,a],ft:o}}function parse_TxO$1(e,t,r){var n=e.l,i="";try{e.l+=4;var a=(r.lastobj||{cmo:[0,0]}).cmo[1];-1==[0,5,7,11,12,14].indexOf(a)?e.l+=6:parse_ControlInfo$1(e,6,r);var o=e.read_shift(2);e.read_shift(2),parseuint16$1(e,2);var s=e.read_shift(2);e.l+=s;for(var l=1;l<e.lens.length-1;++l){if(e.l-n!=e.lens[l])throw new Error("TxO: bad continue record");var c=e[e.l];if((i+=parse_XLUnicodeStringNoCch$1(e,e.lens[l+1]-e.lens[l]-1)).length>=(c?o:2*o))break}if(i.length!==o&&i.length!==2*o)throw new Error("cchText: "+o+" != "+i.length);return e.l=n+t,{t:i}}catch(u){return e.l=n+t,{t:i}}}function parse_HLink$1(e,t){var r=parse_Ref8U$1(e);return e.l+=16,[r,parse_Hyperlink$1(e,t-24)]}function parse_HLinkTooltip$1(e,t){e.read_shift(2);var r=parse_Ref8U$1(e),n=e.read_shift((t-10)/2,"dbcs-cont");return[r,n=n.replace(chr0$1,"")]}function parse_Country$1(e){var t,r=[0,0];return t=e.read_shift(2),r[0]=CountryEnum$1[t]||t,t=e.read_shift(2),r[1]=CountryEnum$1[t]||t,r}function parse_ClrtClient$1(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(parse_LongRGB$1(e));return r}function parse_Palette$1(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(parse_LongRGB$1(e));return r}function parse_XFCRC$1(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t}function parse_ColInfo$1(e,t,r){if(!r.cellStyles)return parsenoop$1(e,t);var n=r&&r.biff>=12?4:2,i=e.read_shift(n),a=e.read_shift(n),o=e.read_shift(n),s=e.read_shift(n),l=e.read_shift(2);2==n&&(e.l+=2);var c={s:i,e:a,w:o,ixfe:s,flags:l};return(r.biff>=5||!r.biff)&&(c.level=l>>8&7),c}function parse_Setup$1(e,t){var r={};return t<32||(e.l+=16,r.header=parse_Xnum$1(e),r.footer=parse_Xnum$1(e),e.l+=2),r}function parse_ShtProps$1(e,t,r){var n={area:!1};if(5!=r.biff)return e.l+=t,n;var i=e.read_shift(1);return e.l+=3,16&i&&(n.area=!0),n}var parse_Blank$1=parse_XLSCell$1,parse_Scl$1=parseuint16a$1,parse_String$1=parse_XLUnicodeString$1;function parse_ImData$1(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i={fmt:t,env:r,len:n,data:e.slice(e.l,e.l+n)};return e.l+=n,i}function parse_BIFF2STR$1(e,t,r){r.biffguess&&5==r.biff&&(r.biff=2);var n=parse_XLSCell$1(e);++e.l;var i=parse_XLUnicodeString2$1(e,t-7,r);return n.t="str",n.val=i,n}function parse_BIFF2NUM$1(e){var t=parse_XLSCell$1(e);++e.l;var r=parse_Xnum$1(e);return t.t="n",t.val=r,t}function parse_BIFF2INT$1(e){var t=parse_XLSCell$1(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}function parse_BIFF2STRING$1(e){var t=e.read_shift(1);return 0===t?(e.l++,""):e.read_shift(t,"sbcs-cont")}function parse_BIFF2FONTXTRA$1(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}function parse_RString$1(e,t,r){var n=e.l+t,i=parse_XLSCell$1(e),a=e.read_shift(2),o=parse_XLUnicodeStringNoCch$1(e,a,r);return e.l=n,i.t="str",i.val=o,i}var DBF_SUPPORTED_VERSIONS$1=[2,3,48,49,131,139,140,245],DBF$1=function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=evert$1({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(t,r){var n=r||{};n.dateNF||(n.dateNF="yyyymmdd");var i=aoa_to_sheet$1(function(t,r){var n=[],i=new_raw_buf$1(1);switch(r.type){case"base64":i=s2a$1(Base64_decode$1(t));break;case"binary":i=s2a$1(t);break;case"buffer":case"array":i=t}prep_blob$1(i,0);var a=i.read_shift(1),o=!!(136&a),s=!1,l=!1;switch(a){case 2:case 3:case 131:case 139:case 245:break;case 48:case 49:s=!0,o=!0;break;case 140:l=!0;break;default:throw new Error("DBF Unsupported Version: "+a.toString(16))}var c=0,u=521;2==a&&(c=i.read_shift(2)),i.l+=3,2!=a&&(c=i.read_shift(4)),c>1048576&&(c=1e6),2!=a&&(u=i.read_shift(2));var d=i.read_shift(2),h=r.codepage||1252;2!=a&&(i.l+=16,i.read_shift(1),0!==i[i.l]&&(h=e[i[i.l]]),i.l+=1,i.l+=2),l&&(i.l+=36);for(var p=[],f={},m=Math.min(i.length,2==a?521:u-10-(s?264:0)),g=l?32:11;i.l<m&&13!=i[i.l];)switch((f={}).name=$cptable.utils.decode(h,i.slice(i.l,i.l+g)).replace(/[\u0000\r\n].*$/g,""),i.l+=g,f.type=String.fromCharCode(i.read_shift(1)),2==a||l||(f.offset=i.read_shift(4)),f.len=i.read_shift(1),2==a&&(f.offset=i.read_shift(2)),f.dec=i.read_shift(1),f.name.length&&p.push(f),2!=a&&(i.l+=l?13:14),f.type){case"B":s&&8==f.len||!r.WTF||console.log("Skipping "+f.name+":"+f.type);break;case"G":case"P":r.WTF&&console.log("Skipping "+f.name+":"+f.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+f.type)}if(13!==i[i.l]&&(i.l=u-1),13!==i.read_shift(1))throw new Error("DBF Terminator not found "+i.l+" "+i[i.l]);i.l=u;var _=0,y=0;for(n[0]=[],y=0;y!=p.length;++y)n[0][y]=p[y].name;for(;c-- >0;)if(42!==i[i.l])for(++i.l,n[++_]=[],y=0,y=0;y!=p.length;++y){var b=i.slice(i.l,i.l+p[y].len);i.l+=p[y].len,prep_blob$1(b,0);var v=$cptable.utils.decode(h,b);switch(p[y].type){case"C":v.trim().length&&(n[_][y]=v.replace(/\s+$/,""));break;case"D":8===v.length?n[_][y]=new Date(+v.slice(0,4),+v.slice(4,6)-1,+v.slice(6,8)):n[_][y]=v;break;case"F":n[_][y]=parseFloat(v.trim());break;case"+":case"I":n[_][y]=l?0x80000000^b.read_shift(-4,"i"):b.read_shift(4,"i");break;case"L":switch(v.trim().toUpperCase()){case"Y":case"T":n[_][y]=!0;break;case"N":case"F":n[_][y]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+v+"|")}break;case"M":if(!o)throw new Error("DBF Unexpected MEMO for type "+a.toString(16));n[_][y]="##MEMO##"+(l?parseInt(v.trim(),10):b.read_shift(4));break;case"N":(v=v.replace(/\u0000/g,"").trim())&&"."!=v&&(n[_][y]=+v||0);break;case"@":n[_][y]=new Date(b.read_shift(-8,"f")-621356832e5);break;case"T":n[_][y]=new Date(864e5*(b.read_shift(4)-2440588)+b.read_shift(4));break;case"Y":n[_][y]=b.read_shift(4,"i")/1e4+b.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":n[_][y]=-b.read_shift(-8,"f");break;case"B":if(s&&8==p[y].len){n[_][y]=b.read_shift(8,"f");break}case"G":case"P":b.l+=p[y].len;break;case"0":if("_NullFlags"===p[y].name)break;default:throw new Error("DBF Unsupported data type "+p[y].type)}}else i.l+=d;if(2!=a&&i.l<i.length&&26!=i[i.l++])throw new Error("DBF EOF Marker missing "+(i.l-1)+" of "+i.length+" "+i[i.l-1].toString(16));return r&&r.sheetRows&&(n=n.slice(0,r.sheetRows)),r.DBF=p,n}(t,n),n);return i["!cols"]=n.DBF.map((function(e){return{wch:e.len,DBF:e}})),delete n.DBF,i}var n={B:8,C:250,L:1,D:8,"?":0,"":0};return{to_workbook:function(e,t){try{return sheet_to_workbook$1(r(e,t),t)}catch(n){if(t&&t.WTF)throw n}return{SheetNames:[],Sheets:{}}},to_sheet:r,from_sheet:function(e,r){var i=r||{};if(+i.codepage>=0&&set_cp$1(+i.codepage),"string"==i.type)throw new Error("Cannot write DBF to JS string");var a=buf_array$1(),o=sheet_to_json$1(e,{header:1,raw:!0,cellDates:!0}),s=o[0],l=o.slice(1),c=e["!cols"]||[],u=0,d=0,h=0,p=1;for(u=0;u<s.length;++u)if(((c[u]||{}).DBF||{}).name)s[u]=c[u].DBF.name,++h;else if(null!=s[u]){if(++h,"number"==typeof s[u]&&(s[u]=s[u].toString(10)),"string"!=typeof s[u])throw new Error("DBF Invalid column name "+s[u]+" |"+typeof s[u]+"|");if(s.indexOf(s[u])!==u)for(d=0;d<1024;++d)if(-1==s.indexOf(s[u]+"_"+d)){s[u]+="_"+d;break}}var f=safe_decode_range$1(e["!ref"]),m=[],g=[],_=[];for(u=0;u<=f.e.c-f.s.c;++u){var y="",b="",v=0,S=[];for(d=0;d<l.length;++d)null!=l[d][u]&&S.push(l[d][u]);if(0!=S.length&&null!=s[u]){for(d=0;d<S.length;++d){switch(typeof S[d]){case"number":b="B";break;case"string":default:b="C";break;case"boolean":b="L";break;case"object":b=S[d]instanceof Date?"D":"C"}v=Math.max(v,String(S[d]).length),y=y&&y!=b?"C":b}v>250&&(v=250),"C"==(b=((c[u]||{}).DBF||{}).type)&&c[u].DBF.len>v&&(v=c[u].DBF.len),"B"==y&&"N"==b&&(y="N",_[u]=c[u].DBF.dec,v=c[u].DBF.len),g[u]="C"==y||"N"==b?v:n[y]||0,p+=g[u],m[u]=y}else m[u]="?"}var w=a.next(32);for(w.write_shift(4,0x13021130),w.write_shift(4,l.length),w.write_shift(2,296+32*h),w.write_shift(2,p),u=0;u<4;++u)w.write_shift(4,0);for(w.write_shift(4,(+t[current_ansi]||3)<<8),u=0,d=0;u<s.length;++u)if(null!=s[u]){var T=a.next(32),E=(s[u].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);T.write_shift(1,E,"sbcs"),T.write_shift(1,"?"==m[u]?"C":m[u],"sbcs"),T.write_shift(4,d),T.write_shift(1,g[u]||n[m[u]]||0),T.write_shift(1,_[u]||0),T.write_shift(1,2),T.write_shift(4,0),T.write_shift(1,0),T.write_shift(4,0),T.write_shift(4,0),d+=g[u]||n[m[u]]||0}var x=a.next(264);for(x.write_shift(4,13),u=0;u<65;++u)x.write_shift(4,0);for(u=0;u<l.length;++u){var A=a.next(p);for(A.write_shift(1,0),d=0;d<s.length;++d)if(null!=s[d])switch(m[d]){case"L":A.write_shift(1,null==l[u][d]?63:l[u][d]?84:70);break;case"B":A.write_shift(8,l[u][d]||0,"f");break;case"N":var C="0";for("number"==typeof l[u][d]&&(C=l[u][d].toFixed(_[d]||0)),h=0;h<g[d]-C.length;++h)A.write_shift(1,32);A.write_shift(1,C,"sbcs");break;case"D":l[u][d]?(A.write_shift(4,("0000"+l[u][d].getFullYear()).slice(-4),"sbcs"),A.write_shift(2,("00"+(l[u][d].getMonth()+1)).slice(-2),"sbcs"),A.write_shift(2,("00"+l[u][d].getDate()).slice(-2),"sbcs")):A.write_shift(8,"00000000","sbcs");break;case"C":var R=String(null!=l[u][d]?l[u][d]:"").slice(0,g[d]);for(A.write_shift(1,R,"sbcs"),h=0;h<g[d]-R.length;++h)A.write_shift(1,32)}}return a.next(1).write_shift(1,26),a.end()}}}(),SYLK$1=function(){var e={AA:"\xc0",BA:"\xc1",CA:"\xc2",DA:195,HA:"\xc4",JA:197,AE:"\xc8",BE:"\xc9",CE:"\xca",HE:"\xcb",AI:"\xcc",BI:"\xcd",CI:"\xce",HI:"\xcf",AO:"\xd2",BO:"\xd3",CO:"\xd4",DO:213,HO:"\xd6",AU:"\xd9",BU:"\xda",CU:"\xdb",HU:"\xdc",Aa:"\xe0",Ba:"\xe1",Ca:"\xe2",Da:227,Ha:"\xe4",Ja:229,Ae:"\xe8",Be:"\xe9",Ce:"\xea",He:"\xeb",Ai:"\xec",Bi:"\xed",Ci:"\xee",Hi:"\xef",Ao:"\xf2",Bo:"\xf3",Co:"\xf4",Do:245,Ho:"\xf6",Au:"\xf9",Bu:"\xfa",Cu:"\xfb",Hu:"\xfc",KC:"\xc7",Kc:"\xe7",q:"\xe6",z:"œ",a:"\xc6",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1bN("+keys$4(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(t,r){var n=e[r];return"number"==typeof n?_getansi$1(n):n},n=function(e,t,r){var n=t.charCodeAt(0)-32<<4|r.charCodeAt(0)-48;return 59==n?e:_getansi$1(n)};function i(e,i){var a,o=e.split(/[\n\r]+/),s=-1,l=-1,c=0,u=0,d=[],h=[],p=null,f={},m=[],g=[],_=[],y=0;for(+i.codepage>=0&&set_cp$1(+i.codepage);c!==o.length;++c){y=0;var b,v=o[c].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(t,r),S=v.replace(/;;/g,"\0").split(";").map((function(e){return e.replace(/\u0000/g,";")})),w=S[0];if(v.length>0)switch(w){case"ID":case"E":case"B":case"O":case"W":break;case"P":"P"==S[1].charAt(0)&&h.push(v.slice(3).replace(/;;/g,";"));break;case"C":var T=!1,E=!1,x=!1,A=!1,C=-1,R=-1;for(u=1;u<S.length;++u)switch(S[u].charAt(0)){case"A":case"G":break;case"X":l=parseInt(S[u].slice(1))-1,E=!0;break;case"Y":for(s=parseInt(S[u].slice(1))-1,E||(l=0),a=d.length;a<=s;++a)d[a]=[];break;case"K":'"'===(b=S[u].slice(1)).charAt(0)?b=b.slice(1,b.length-1):"TRUE"===b?b=!0:"FALSE"===b?b=!1:isNaN(fuzzynum$1(b))?isNaN(fuzzydate$1(b).getDate())||(b=parseDate$1(b)):(b=fuzzynum$1(b),null!==p&&fmt_is_date$1(p)&&(b=numdate$1(b))),T=!0;break;case"E":A=!0;var D=rc_to_a1$1(S[u].slice(1),{r:s,c:l});d[s][l]=[d[s][l],D];break;case"S":x=!0,d[s][l]=[d[s][l],"S5S"];break;case"R":C=parseInt(S[u].slice(1))-1;break;case"C":R=parseInt(S[u].slice(1))-1;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+v)}if(T&&(d[s][l]&&2==d[s][l].length?d[s][l][0]=b:d[s][l]=b,p=null),x){if(A)throw new Error("SYLK shared formula cannot have own formula");var P=C>-1&&d[C][R];if(!P||!P[1])throw new Error("SYLK shared formula cannot find base");d[s][l][1]=shift_formula_str$1(P[1],{r:s-C,c:l-R})}break;case"F":var I=0;for(u=1;u<S.length;++u)switch(S[u].charAt(0)){case"X":l=parseInt(S[u].slice(1))-1,++I;break;case"Y":for(s=parseInt(S[u].slice(1))-1,a=d.length;a<=s;++a)d[a]=[];break;case"M":y=parseInt(S[u].slice(1))/20;break;case"F":case"G":case"S":case"D":case"N":break;case"P":p=h[parseInt(S[u].slice(1))];break;case"W":for(_=S[u].slice(1).split(" "),a=parseInt(_[0],10);a<=parseInt(_[1],10);++a)y=parseInt(_[2],10),g[a-1]=0===y?{hidden:!0}:{wch:y},process_col$1(g[a-1]);break;case"C":g[l=parseInt(S[u].slice(1))-1]||(g[l]={});break;case"R":m[s=parseInt(S[u].slice(1))-1]||(m[s]={}),y>0?(m[s].hpt=y,m[s].hpx=pt2px$1(y)):0===y&&(m[s].hidden=!0);break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+v)}I<1&&(p=null);break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+v)}}return m.length>0&&(f["!rows"]=m),g.length>0&&(f["!cols"]=g),i&&i.sheetRows&&(d=d.slice(0,i.sheetRows)),[d,f]}function a(e,t){var r=function(e,t){switch(t.type){case"base64":return i(Base64_decode$1(e),t);case"binary":return i(e,t);case"buffer":return i(has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):a2s$1(e),t);case"array":return i(cc2str$1(e),t)}throw new Error("Unrecognized type "+t.type)}(e,t),n=r[0],a=r[1],o=aoa_to_sheet$1(n,t);return keys$4(a).forEach((function(e){o[e]=a[e]})),o}function o(e,t,r,n){var i="C;Y"+(r+1)+";X"+(n+1)+";K";switch(e.t){case"n":i+=e.v||0,e.f&&!e.F&&(i+=";E"+a1_to_rc$1(e.f,{r:r,c:n}));break;case"b":i+=e.v?"TRUE":"FALSE";break;case"e":i+=e.w||e.v;break;case"d":i+='"'+(e.w||e.v)+'"';break;case"s":i+='"'+e.v.replace(/"/g,"").replace(/;/g,";;")+'"'}return i}return e["|"]=254,{to_workbook:function(e,t){return sheet_to_workbook$1(a(e,t),t)},to_sheet:a,from_sheet:function(e,t){var r,n,i=["ID;PWXL;N;E"],a=[],s=safe_decode_range$1(e["!ref"]),l=Array.isArray(e),c="\r\n";i.push("P;PGeneral"),i.push("F;P0;DG0G8;M255"),e["!cols"]&&(n=i,e["!cols"].forEach((function(e,t){var r="F;W"+(t+1)+" "+(t+1)+" ";e.hidden?r+="0":("number"!=typeof e.width||e.wpx||(e.wpx=width2px$1(e.width)),"number"!=typeof e.wpx||e.wch||(e.wch=px2char$1(e.wpx)),"number"==typeof e.wch&&(r+=Math.round(e.wch)))," "!=r.charAt(r.length-1)&&n.push(r)}))),e["!rows"]&&function(e,t){t.forEach((function(t,r){var n="F;";t.hidden?n+="M0;":t.hpt?n+="M"+20*t.hpt+";":t.hpx&&(n+="M"+20*px2pt$1(t.hpx)+";"),n.length>2&&e.push(n+"R"+(r+1))}))}(i,e["!rows"]),i.push("B;Y"+(s.e.r-s.s.r+1)+";X"+(s.e.c-s.s.c+1)+";D"+[s.s.c,s.s.r,s.e.c,s.e.r].join(" "));for(var u=s.s.r;u<=s.e.r;++u)for(var d=s.s.c;d<=s.e.c;++d){var h=encode_cell$1({r:u,c:d});(r=l?(e[u]||[])[d]:e[h])&&(null!=r.v||r.f&&!r.F)&&a.push(o(r,0,u,d))}return i.join(c)+c+a.join(c)+c+"E"+c}}}(),DIF$1=function(){function e(e,t){for(var r=e.split("\n"),n=-1,i=-1,a=0,o=[];a!==r.length;++a)if("BOT"!==r[a].trim()){if(!(n<0)){for(var s=r[a].trim().split(","),l=s[0],c=s[1],u=r[++a]||"";1&(u.match(/["]/g)||[]).length&&a<r.length-1;)u+="\n"+r[++a];switch(u=u.trim(),+l){case-1:if("BOT"===u){o[++n]=[],i=0;continue}if("EOD"!==u)throw new Error("Unrecognized DIF special command "+u);break;case 0:"TRUE"===u?o[n][i]=!0:"FALSE"===u?o[n][i]=!1:isNaN(fuzzynum$1(c))?isNaN(fuzzydate$1(c).getDate())?o[n][i]=c:o[n][i]=parseDate$1(c):o[n][i]=fuzzynum$1(c),++i;break;case 1:(u=(u=u.slice(1,u.length-1)).replace(/""/g,'"'))&&u.match(/^=".*"$/)&&(u=u.slice(2,-1)),o[n][i++]=""!==u?u:null}if("EOD"===u)break}}else o[++n]=[],i=0;return t&&t.sheetRows&&(o=o.slice(0,t.sheetRows)),o}function t(t,r){return aoa_to_sheet$1(function(t,r){switch(r.type){case"base64":return e(Base64_decode$1(t),r);case"binary":return e(t,r);case"buffer":return e(has_buf$1&&Buffer.isBuffer(t)?t.toString("binary"):a2s$1(t),r);case"array":return e(cc2str$1(t),r)}throw new Error("Unrecognized type "+r.type)}(t,r),r)}var r=function(){var e=function(e,t,r,n,i){e.push(t),e.push(r+","+n),e.push('"'+i.replace(/"/g,'""')+'"')},t=function(e,t,r,n){e.push(t+","+r),e.push(1==t?'"'+n.replace(/"/g,'""')+'"':n)};return function(r){var n,i=[],a=safe_decode_range$1(r["!ref"]),o=Array.isArray(r);e(i,"TABLE",0,1,"sheetjs"),e(i,"VECTORS",0,a.e.r-a.s.r+1,""),e(i,"TUPLES",0,a.e.c-a.s.c+1,""),e(i,"DATA",0,0,"");for(var s=a.s.r;s<=a.e.r;++s){t(i,-1,0,"BOT");for(var l=a.s.c;l<=a.e.c;++l){var c=encode_cell$1({r:s,c:l});if(n=o?(r[s]||[])[l]:r[c])switch(n.t){case"n":var u=n.w;u||null==n.v||(u=n.v),null==u?n.f&&!n.F?t(i,1,0,"="+n.f):t(i,1,0,""):t(i,0,u,"V");break;case"b":t(i,0,n.v?1:0,n.v?"TRUE":"FALSE");break;case"s":t(i,1,0,isNaN(n.v)?n.v:'="'+n.v+'"');break;case"d":n.w||(n.w=SSF_format$1(n.z||table_fmt$1[14],datenum$1(parseDate$1(n.v)))),t(i,0,n.w,"V");break;default:t(i,1,0,"")}else t(i,1,0,"")}}t(i,-1,0,"EOD");return i.join("\r\n")}}();return{to_workbook:function(e,r){return sheet_to_workbook$1(t(e,r),r)},to_sheet:t,from_sheet:r}}(),ETH$1=function(){function e(e){return e.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(e,t){return aoa_to_sheet$1(function(e,t){for(var r=e.split("\n"),n=-1,i=-1,a=0,o=[];a!==r.length;++a){var s=r[a].trim().split(":");if("cell"===s[0]){var l=decode_cell$1(s[1]);if(o.length<=l.r)for(n=o.length;n<=l.r;++n)o[n]||(o[n]=[]);switch(n=l.r,i=l.c,s[2]){case"t":o[n][i]=s[3].replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n");break;case"v":o[n][i]=+s[3];break;case"vtf":var c=s[s.length-1];case"vtc":"nl"===s[3]?o[n][i]=!!+s[4]:o[n][i]=+s[4],"vtf"==s[2]&&(o[n][i]=[o[n][i],c])}}}return t&&t.sheetRows&&(o=o.slice(0,t.sheetRows)),o}(e,t),t)}var r=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n"),n=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n",i=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n"),a="--SocialCalcSpreadsheetControlSave--";function o(t){if(!t||!t["!ref"])return"";for(var r,n=[],i=[],a="",o=decode_range$1(t["!ref"]),s=Array.isArray(t),l=o.s.r;l<=o.e.r;++l)for(var c=o.s.c;c<=o.e.c;++c)if(a=encode_cell$1({r:l,c:c}),(r=s?(t[l]||[])[c]:t[a])&&null!=r.v&&"z"!==r.t){switch(i=["cell",a,"t"],r.t){case"s":case"str":i.push(e(r.v));break;case"n":r.f?(i[2]="vtf",i[3]="n",i[4]=r.v,i[5]=e(r.f)):(i[2]="v",i[3]=r.v);break;case"b":i[2]="vt"+(r.f?"f":"c"),i[3]="nl",i[4]=r.v?"1":"0",i[5]=e(r.f||(r.v?"TRUE":"FALSE"));break;case"d":var u=datenum$1(parseDate$1(r.v));i[2]="vtc",i[3]="nd",i[4]=""+u,i[5]=r.w||SSF_format$1(r.z||table_fmt$1[14],u);break;case"e":continue}n.push(i.join(":"))}return n.push("sheet:c:"+(o.e.c-o.s.c+1)+":r:"+(o.e.r-o.s.r+1)+":tvf:1"),n.push("valueformat:1:text-wiki"),n.join("\n")}return{to_workbook:function(e,r){return sheet_to_workbook$1(t(e,r),r)},to_sheet:t,from_sheet:function(e){return[r,n,i,n,o(e),a].join("\n")}}}(),PRN$1=function(){function e(e,t,r,n,i){i.raw?t[r][n]=e:""===e||("TRUE"===e?t[r][n]=!0:"FALSE"===e?t[r][n]=!1:isNaN(fuzzynum$1(e))?isNaN(fuzzydate$1(e).getDate())?t[r][n]=e:t[r][n]=parseDate$1(e):t[r][n]=fuzzynum$1(e))}var t={44:",",9:" ",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function n(e){for(var n={},i=!1,a=0,o=0;a<e.length;++a)34==(o=e.charCodeAt(a))?i=!i:!i&&o in t&&(n[o]=(n[o]||0)+1);for(a in o=[],n)Object.prototype.hasOwnProperty.call(n,a)&&o.push([n[a],a]);if(!o.length)for(a in n=r)Object.prototype.hasOwnProperty.call(n,a)&&o.push([n[a],a]);return o.sort((function(e,t){return e[0]-t[0]||r[e[1]]-r[t[1]]})),t[o.pop()[1]]||44}function i(e,t){var r=t||{},i="",a=r.dense?[]:{},o={s:{c:0,r:0},e:{c:0,r:0}};"sep="==e.slice(0,4)?13==e.charCodeAt(5)&&10==e.charCodeAt(6)?(i=e.charAt(4),e=e.slice(7)):13==e.charCodeAt(5)||10==e.charCodeAt(5)?(i=e.charAt(4),e=e.slice(6)):i=n(e.slice(0,1024)):i=r&&r.FS?r.FS:n(e.slice(0,1024));var s=0,l=0,c=0,u=0,d=0,h=i.charCodeAt(0),p=!1,f=0,m=e.charCodeAt(0);e=e.replace(/\r\n/gm,"\n");var g=null!=r.dateNF?dateNF_regex$1(r.dateNF):null;function _(){var t=e.slice(u,d),n={};if('"'==t.charAt(0)&&'"'==t.charAt(t.length-1)&&(t=t.slice(1,-1).replace(/""/g,'"')),0===t.length)n.t="z";else if(r.raw)n.t="s",n.v=t;else if(0===t.trim().length)n.t="s",n.v=t;else if(61==t.charCodeAt(0))34==t.charCodeAt(1)&&34==t.charCodeAt(t.length-1)?(n.t="s",n.v=t.slice(2,-1).replace(/""/g,'"')):fuzzyfmla$1(t)?(n.t="n",n.f=t.slice(1)):(n.t="s",n.v=t);else if("TRUE"==t)n.t="b",n.v=!0;else if("FALSE"==t)n.t="b",n.v=!1;else if(isNaN(c=fuzzynum$1(t)))if(!isNaN(fuzzydate$1(t).getDate())||g&&t.match(g)){n.z=r.dateNF||table_fmt$1[14];var i=0;g&&t.match(g)&&(t=dateNF_fix$1(t,r.dateNF,t.match(g)||[]),i=1),r.cellDates?(n.t="d",n.v=parseDate$1(t,i)):(n.t="n",n.v=datenum$1(parseDate$1(t,i))),!1!==r.cellText&&(n.w=SSF_format$1(n.z,n.v instanceof Date?datenum$1(n.v):n.v)),r.cellNF||delete n.z}else n.t="s",n.v=t;else n.t="n",!1!==r.cellText&&(n.w=t),n.v=c;if("z"==n.t||(r.dense?(a[s]||(a[s]=[]),a[s][l]=n):a[encode_cell$1({c:l,r:s})]=n),u=d+1,m=e.charCodeAt(u),o.e.c<l&&(o.e.c=l),o.e.r<s&&(o.e.r=s),f==h)++l;else if(l=0,++s,r.sheetRows&&r.sheetRows<=s)return!0}e:for(;d<e.length;++d)switch(f=e.charCodeAt(d)){case 34:34===m&&(p=!p);break;case h:case 10:case 13:if(!p&&_())break e}return d-u>0&&_(),a["!ref"]=encode_range$1(o),a}function a(t,r){return r&&r.PRN?r.FS||"sep="==t.slice(0,4)||t.indexOf(" ")>=0||t.indexOf(",")>=0||t.indexOf(";")>=0?i(t,r):aoa_to_sheet$1(function(t,r){var n=r||{},i=[];if(!t||0===t.length)return i;for(var a=t.split(/[\r\n]/),o=a.length-1;o>=0&&0===a[o].length;)--o;for(var s=10,l=0,c=0;c<=o;++c)-1==(l=a[c].indexOf(" "))?l=a[c].length:l++,s=Math.max(s,l);for(c=0;c<=o;++c){i[c]=[];var u=0;for(e(a[c].slice(0,s).trim(),i,c,u,n),u=1;u<=(a[c].length-s)/10+1;++u)e(a[c].slice(s+10*(u-1),s+10*u).trim(),i,c,u,n)}return n.sheetRows&&(i=i.slice(0,n.sheetRows)),i}(t,r),r):i(t,r)}function o(e,t){var r="",n="string"==t.type?[0,0,0,0]:firstbyte$1(e,t);switch(t.type){case"base64":r=Base64_decode$1(e);break;case"binary":case"string":r=e;break;case"buffer":65001==t.codepage?r=e.toString("utf8"):t.codepage&&void 0!==$cptable||(r=has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):a2s$1(e));break;case"array":r=cc2str$1(e);break;default:throw new Error("Unrecognized type "+t.type)}return 239==n[0]&&187==n[1]&&191==n[2]?r=utf8read$1(r.slice(3)):"string"!=t.type&&"buffer"!=t.type&&65001==t.codepage?r=utf8read$1(r):t.type,"socialcalc:version:"==r.slice(0,19)?ETH$1.to_sheet("string"==t.type?r:utf8read$1(r),t):a(r,t)}return{to_workbook:function(e,t){return sheet_to_workbook$1(o(e,t),t)},to_sheet:o,from_sheet:function(e){for(var t,r=[],n=safe_decode_range$1(e["!ref"]),i=Array.isArray(e),a=n.s.r;a<=n.e.r;++a){for(var o=[],s=n.s.c;s<=n.e.c;++s){var l=encode_cell$1({r:a,c:s});if((t=i?(e[a]||[])[s]:e[l])&&null!=t.v){for(var c=(t.w||(format_cell$1(t),t.w)||"").slice(0,10);c.length<10;)c+=" ";o.push(c+(0===s?" ":""))}else o.push(" ")}r.push(o.join(""))}return r.join("\n")}}}();function read_wb_ID$1(e,t){var r=t||{},n=!!r.WTF;r.WTF=!0;try{var i=SYLK$1.to_workbook(e,r);return r.WTF=n,i}catch(a){if(r.WTF=n,!a.message.match(/SYLK bad record ID/)&&n)throw a;return PRN$1.to_workbook(e,t)}}var WK_$1=function(){function e(e,t,r){if(e){prep_blob$1(e,e.l||0);for(var n=r.Enum||_;e.l<e.length;){var i=e.read_shift(2),a=n[i]||n[65535],o=e.read_shift(2),s=e.l+o,l=a.f&&a.f(e,o,r);if(e.l=s,t(l,a,i))return}}}function t(t,r){if(!t)return t;var n=r||{},i=n.dense?[]:{},a="Sheet1",o="",s=0,l={},c=[],u=[],d={s:{r:0,c:0},e:{r:0,c:0}},h=n.sheetRows||0;if(0==t[2]&&(8==t[3]||9==t[3])&&t.length>=16&&5==t[14]&&108===t[15])throw new Error("Unsupported Works 3 for Mac file");if(2==t[2])n.Enum=_,e(t,(function(e,t,r){switch(r){case 0:n.vers=e,e>=4096&&(n.qpro=!0);break;case 6:d=e;break;case 204:e&&(o=e);break;case 222:o=e;break;case 15:case 51:n.qpro||(e[1].v=e[1].v.slice(1));case 13:case 14:case 16:14==r&&!(112&~e[2])&&(15&e[2])>1&&(15&e[2])<15&&(e[1].z=n.dateNF||table_fmt$1[14],n.cellDates&&(e[1].t="d",e[1].v=numdate$1(e[1].v))),n.qpro&&e[3]>s&&(i["!ref"]=encode_range$1(d),l[a]=i,c.push(a),i=n.dense?[]:{},d={s:{r:0,c:0},e:{r:0,c:0}},s=e[3],a=o||"Sheet"+(s+1),o="");var u=n.dense?(i[e[0].r]||[])[e[0].c]:i[encode_cell$1(e[0])];if(u){u.t=e[1].t,u.v=e[1].v,null!=e[1].z&&(u.z=e[1].z),null!=e[1].f&&(u.f=e[1].f);break}n.dense?(i[e[0].r]||(i[e[0].r]=[]),i[e[0].r][e[0].c]=e[1]):i[encode_cell$1(e[0])]=e[1]}}),n);else{if(26!=t[2]&&14!=t[2])throw new Error("Unrecognized LOTUS BOF "+t[2]);n.Enum=y,14==t[2]&&(n.qpro=!0,t.l=0),e(t,(function(e,t,r){switch(r){case 204:a=e;break;case 22:e[1].v=e[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(e[3]>s&&(i["!ref"]=encode_range$1(d),l[a]=i,c.push(a),i=n.dense?[]:{},d={s:{r:0,c:0},e:{r:0,c:0}},s=e[3],a="Sheet"+(s+1)),h>0&&e[0].r>=h)break;n.dense?(i[e[0].r]||(i[e[0].r]=[]),i[e[0].r][e[0].c]=e[1]):i[encode_cell$1(e[0])]=e[1],d.e.c<e[0].c&&(d.e.c=e[0].c),d.e.r<e[0].r&&(d.e.r=e[0].r);break;case 27:e[14e3]&&(u[e[14e3][0]]=e[14e3][1]);break;case 1537:u[e[0]]=e[1],e[0]==s&&(a=e[1])}}),n)}if(i["!ref"]=encode_range$1(d),l[o||a]=i,c.push(o||a),!u.length)return{SheetNames:c,Sheets:l};for(var p={},f=[],m=0;m<u.length;++m)l[c[m]]?(f.push(u[m]||c[m]),p[u[m]]=l[u[m]]||l[c[m]]):(f.push(u[m]),p[u[m]]={"!ref":"A1"});return{SheetNames:f,Sheets:p}}function r(e,t,r){var n=[{c:0,r:0},{t:"n",v:0},0,0];return r.qpro&&20768!=r.vers?(n[0].c=e.read_shift(1),n[3]=e.read_shift(1),n[0].r=e.read_shift(2),e.l+=2):(n[2]=e.read_shift(1),n[0].c=e.read_shift(2),n[0].r=e.read_shift(2)),n}function n(e,t,n){var i=e.l+t,a=r(e,0,n);if(a[1].t="s",20768==n.vers){e.l++;var o=e.read_shift(1);return a[1].v=e.read_shift(o,"utf8"),a}return n.qpro&&e.l++,a[1].v=e.read_shift(i-e.l,"cstr"),a}function i(e,t,r){var n=new_buf$1(7+r.length);n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(1,39);for(var i=0;i<n.length;++i){var a=r.charCodeAt(i);n.write_shift(1,a>=128?95:a)}return n.write_shift(1,0),n}function a(e,t,r){var n=new_buf$1(7);return n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(2,r,"i"),n}function o(e,t,r){var n=new_buf$1(13);return n.write_shift(1,255),n.write_shift(2,t),n.write_shift(2,e),n.write_shift(8,r,"f"),n}function s(e,t,r){var n=32768&t;return t=(n?e:0)+((t&=-32769)>=8192?t-16384:t),(n?"":"$")+(r?encode_col$1(t):encode_row$1(t))}var l={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},c=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function u(e){var t=[{c:0,r:0},{t:"n",v:0},0];return t[0].r=e.read_shift(2),t[3]=e[e.l++],t[0].c=e[e.l++],t}function d(e,t,r,n){var i=new_buf$1(6+n.length);i.write_shift(2,e),i.write_shift(1,r),i.write_shift(1,t),i.write_shift(1,39);for(var a=0;a<n.length;++a){var o=n.charCodeAt(a);i.write_shift(1,o>=128?95:o)}return i.write_shift(1,0),i}function h(e,t){var r=u(e),n=e.read_shift(4),i=e.read_shift(4),a=e.read_shift(2);if(65535==a)return 0===n&&0xc0000000===i?(r[1].t="e",r[1].v=15):0===n&&0xd0000000===i?(r[1].t="e",r[1].v=42):r[1].v=0,r;var o=32768&a;return a=(32767&a)-16446,r[1].v=(1-2*o)*(i*Math.pow(2,a+32)+n*Math.pow(2,a)),r}function p(e,t,r,n){var i=new_buf$1(14);if(i.write_shift(2,e),i.write_shift(1,r),i.write_shift(1,t),0==n)return i.write_shift(4,0),i.write_shift(4,0),i.write_shift(2,65535),i;var a,o=0,s=0,l=0;return n<0&&(o=1,n=-n),s=0|Math.log2(n),0x80000000&(l=(n/=Math.pow(2,s-31))>>>0)||(++s,l=(n/=2)>>>0),n-=l,l|=0x80000000,l>>>=0,a=(n*=Math.pow(2,32))>>>0,i.write_shift(4,a),i.write_shift(4,l),s+=16383+(o?32768:0),i.write_shift(2,s),i}function f(e,t){var r=u(e),n=e.read_shift(8,"f");return r[1].v=n,r}function m(e,t){return 0==e[e.l+t-1]?e.read_shift(t,"cstr"):""}function g(e,t){var r=new_buf$1(5+e.length);r.write_shift(2,14e3),r.write_shift(2,t);for(var n=0;n<e.length;++n){var i=e.charCodeAt(n);r[r.l++]=i>127?95:i}return r[r.l++]=0,r}var _={0:{n:"BOF",f:parseuint16$1},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:function(e,t,r){var n={s:{c:0,r:0},e:{c:0,r:0}};return 8==t&&r.qpro?(n.s.c=e.read_shift(1),e.l++,n.s.r=e.read_shift(2),n.e.c=e.read_shift(1),e.l++,n.e.r=e.read_shift(2),n):(n.s.c=e.read_shift(2),n.s.r=e.read_shift(2),12==t&&r.qpro&&(e.l+=2),n.e.c=e.read_shift(2),n.e.r=e.read_shift(2),12==t&&r.qpro&&(e.l+=2),65535==n.s.c&&(n.s.c=n.e.c=n.s.r=n.e.r=0),n)}},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:function(e,t,n){var i=r(e,0,n);return i[1].v=e.read_shift(2,"i"),i}},14:{n:"NUMBER",f:function(e,t,n){var i=r(e,0,n);return i[1].v=e.read_shift(8,"f"),i}},15:{n:"LABEL",f:n},16:{n:"FORMULA",f:function(e,t,n){var i=e.l+t,a=r(e,0,n);if(a[1].v=e.read_shift(8,"f"),n.qpro)e.l=i;else{var o=e.read_shift(2);!function(e,t){prep_blob$1(e,0);var r=[],n=0,i="",a="",o="",u="";for(;e.l<e.length;){var d=e[e.l++];switch(d){case 0:r.push(e.read_shift(8,"f"));break;case 1:a=s(t[0].c,e.read_shift(2),!0),i=s(t[0].r,e.read_shift(2),!1),r.push(a+i);break;case 2:var h=s(t[0].c,e.read_shift(2),!0),p=s(t[0].r,e.read_shift(2),!1);a=s(t[0].c,e.read_shift(2),!0),i=s(t[0].r,e.read_shift(2),!1),r.push(h+p+":"+a+i);break;case 3:if(e.l<e.length)return void console.error("WK1 premature formula end");break;case 4:r.push("("+r.pop()+")");break;case 5:r.push(e.read_shift(2));break;case 6:for(var f="";d=e[e.l++];)f+=String.fromCharCode(d);r.push('"'+f.replace(/"/g,'""')+'"');break;case 8:r.push("-"+r.pop());break;case 23:r.push("+"+r.pop());break;case 22:r.push("NOT("+r.pop()+")");break;case 20:case 21:u=r.pop(),o=r.pop(),r.push(["AND","OR"][d-20]+"("+o+","+u+")");break;default:if(d<32&&c[d])u=r.pop(),o=r.pop(),r.push(o+c[d]+u);else{if(!l[d])return d<=7?console.error("WK1 invalid opcode "+d.toString(16)):d<=24?console.error("WK1 unsupported op "+d.toString(16)):d<=30?console.error("WK1 invalid opcode "+d.toString(16)):d<=115?console.error("WK1 unsupported function opcode "+d.toString(16)):console.error("WK1 unrecognized opcode "+d.toString(16));if(69==(n=l[d][1])&&(n=e[e.l++]),n>r.length)return void console.error("WK1 bad formula parse 0x"+d.toString(16)+":|"+r.join("|")+"|");var m=r.slice(-n);r.length-=n,r.push(l[d][0]+"("+m.join(",")+")")}}}1==r.length?t[1].f=""+r[0]:console.error("WK1 bad formula parse |"+r.join("|")+"|")}(e.slice(e.l,e.l+o),a),e.l+=o}return a}},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:n},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:m},222:{n:"SHEETNAMELP",f:function(e,t){var r=e[e.l++];r>t-1&&(r=t-1);for(var n="";n.length<r;)n+=String.fromCharCode(e[e.l++]);return n}},65535:{n:""}},y={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:function(e,t){var r=u(e);return r[1].t="s",r[1].v=e.read_shift(t-4,"cstr"),r}},23:{n:"NUMBER17",f:h},24:{n:"NUMBER18",f:function(e,t){var r=u(e);r[1].v=e.read_shift(2);var n=r[1].v>>1;if(1&r[1].v)switch(7&n){case 0:n=5e3*(n>>3);break;case 1:n=500*(n>>3);break;case 2:n=(n>>3)/20;break;case 3:n=(n>>3)/200;break;case 4:n=(n>>3)/2e3;break;case 5:n=(n>>3)/2e4;break;case 6:n=(n>>3)/16;break;case 7:n=(n>>3)/64}return r[1].v=n,r}},25:{n:"FORMULA19",f:function(e,t){var r=h(e);return e.l+=t-14,r}},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:function(e,t){for(var r={},n=e.l+t;e.l<n;){var i=e.read_shift(2);if(14e3==i){for(r[i]=[0,""],r[i][0]=e.read_shift(2);e[e.l];)r[i][1]+=String.fromCharCode(e[e.l]),e.l++;e.l++}}return r}},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:function(e,t){var r=u(e),n=e.read_shift(4);return r[1].v=n>>6,r}},38:{n:"??"},39:{n:"NUMBER27",f:f},40:{n:"FORMULA28",f:function(e,t){var r=f(e);return e.l+=t-10,r}},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:m},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:function(e,t,r){if(r.qpro&&!(t<21)){var n=e.read_shift(1);return e.l+=17,e.l+=1,e.l+=2,[n,e.read_shift(t-21,"cstr")]}}},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:function(e,t){var r=t||{};if(+r.codepage>=0&&set_cp$1(+r.codepage),"string"==r.type)throw new Error("Cannot write WK1 to JS string");var n=buf_array$1(),s=safe_decode_range$1(e["!ref"]),l=Array.isArray(e),c=[];write_biff_rec$1(n,0,function(e){var t=new_buf$1(2);return t.write_shift(2,e),t}(1030)),write_biff_rec$1(n,6,function(e){var t=new_buf$1(8);return t.write_shift(2,e.s.c),t.write_shift(2,e.s.r),t.write_shift(2,e.e.c),t.write_shift(2,e.e.r),t}(s));for(var u=Math.min(s.e.r,8191),d=s.s.r;d<=u;++d)for(var h=encode_row$1(d),p=s.s.c;p<=s.e.c;++p){d===s.s.r&&(c[p]=encode_col$1(p));var f=c[p]+h,m=l?(e[d]||[])[p]:e[f];if(m&&"z"!=m.t)if("n"==m.t)(0|m.v)==m.v&&m.v>=-32768&&m.v<=32767?write_biff_rec$1(n,13,a(d,p,m.v)):write_biff_rec$1(n,14,o(d,p,m.v));else write_biff_rec$1(n,15,i(d,p,format_cell$1(m).slice(0,239)))}return write_biff_rec$1(n,1),n.end()},book_to_wk3:function(e,t){var r=t||{};if(+r.codepage>=0&&set_cp$1(+r.codepage),"string"==r.type)throw new Error("Cannot write WK3 to JS string");var n=buf_array$1();write_biff_rec$1(n,0,function(e){var t=new_buf$1(26);t.write_shift(2,4096),t.write_shift(2,4),t.write_shift(4,0);for(var r=0,n=0,i=0,a=0;a<e.SheetNames.length;++a){var o=e.SheetNames[a],s=e.Sheets[o];if(s&&s["!ref"]){++i;var l=decode_range$1(s["!ref"]);r<l.e.r&&(r=l.e.r),n<l.e.c&&(n=l.e.c)}}r>8191&&(r=8191);return t.write_shift(2,r),t.write_shift(1,i),t.write_shift(1,n),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(1,1),t.write_shift(1,2),t.write_shift(4,0),t.write_shift(4,0),t}(e));for(var i=0,a=0;i<e.SheetNames.length;++i)(e.Sheets[e.SheetNames[i]]||{})["!ref"]&&write_biff_rec$1(n,27,g(e.SheetNames[i],a++));var o=0;for(i=0;i<e.SheetNames.length;++i){var s=e.Sheets[e.SheetNames[i]];if(s&&s["!ref"]){for(var l=safe_decode_range$1(s["!ref"]),c=Array.isArray(s),u=[],h=Math.min(l.e.r,8191),f=l.s.r;f<=h;++f)for(var m=encode_row$1(f),_=l.s.c;_<=l.e.c;++_){f===l.s.r&&(u[_]=encode_col$1(_));var y=u[_]+m,b=c?(s[f]||[])[_]:s[y];if(b&&"z"!=b.t)if("n"==b.t)write_biff_rec$1(n,23,p(f,_,o,b.v));else write_biff_rec$1(n,22,d(f,_,o,format_cell$1(b).slice(0,239)))}++o}}return write_biff_rec$1(n,1),n.end()},to_workbook:function(e,r){switch(r.type){case"base64":return t(s2a$1(Base64_decode$1(e)),r);case"binary":return t(s2a$1(e),r);case"buffer":case"array":return t(e,r)}throw"Unsupported type "+r.type}}}();function parse_rpr$1(e){var t={},r=e.match(tagregex$1),n=0,i=!1;if(r)for(;n!=r.length;++n){var a=parsexmltag$1(r[n]);switch(a[0].replace(/\w*:/g,"")){case"<condense":case"<extend":break;case"<shadow":if(!a.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":if("1"==a.val)break;t.cp=CS2CP$1[parseInt(a.val,10)];break;case"<outline":if(!a.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=a.val;break;case"<sz":t.sz=a.val;break;case"<strike":if(!a.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!a.val)break;switch(a.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting"}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if("0"==a.val)break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if("0"==a.val)break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":a.rgb&&(t.color=a.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":t.family=a.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":t.valign=a.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":case"<scheme":case"<scheme>":case"<scheme/>":case"</scheme>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(47!==a[0].charCodeAt(1)&&!i)throw new Error("Unrecognized rich format "+a[0])}}return t}var parse_rs$1=function(){var e=matchtag("t"),t=matchtag("rPr");function r(r){var n=r.match(e);if(!n)return{t:"s",v:""};var i={t:"s",v:unescapexml$1(n[1])},a=r.match(t);return a&&(i.s=parse_rpr$1(a[1])),i}var n=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(e){return e.replace(n,"").split(i).map(r).filter((function(e){return e.v}))}}(),rs_to_html$1=function(){var e=/(\r\n|\n)/g;function t(t){var r=[[],t.v,[]];return t.v?(t.s&&function(e,t,r){var n=[];e.u&&n.push("text-decoration: underline;"),e.uval&&n.push("text-underline-style:"+e.uval+";"),e.sz&&n.push("font-size:"+e.sz+"pt;"),e.outline&&n.push("text-effect: outline;"),e.shadow&&n.push("text-shadow: auto;"),t.push('<span style="'+n.join("")+'">'),e.b&&(t.push("<b>"),r.push("</b>")),e.i&&(t.push("<i>"),r.push("</i>")),e.strike&&(t.push("<s>"),r.push("</s>"));var i=e.valign||"";"superscript"==i||"super"==i?i="sup":"subscript"==i&&(i="sub"),""!=i&&(t.push("<"+i+">"),r.push("</"+i+">")),r.push("</span>")}(t.s,r[0],r[2]),r[0].join("")+r[1].replace(e,"<br/>")+r[2].join("")):""}return function(e){return e.map(t).join("")}}(),sitregex$1=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,sirregex$1=/<(?:\w+:)?r>/,sirphregex=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function parse_si$1(e,t){var r=!t||t.cellHTML,n={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=unescapexml$1(utf8read$1(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=utf8read$1(e),r&&(n.h=escapehtml$1(n.t))):e.match(sirregex$1)&&(n.r=utf8read$1(e),n.t=unescapexml$1(utf8read$1((e.replace(sirphregex,"").match(sitregex$1)||[]).join("").replace(tagregex$1,""))),r&&(n.h=rs_to_html$1(parse_rs$1(n.r)))),n):{t:""}}var sstr0=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,sstr1$1=/<(?:\w+:)?(?:si|sstItem)>/g,sstr2$1=/<\/(?:\w+:)?(?:si|sstItem)>/;function parse_sst_xml$1(e,t){var r=[],n="";if(!e)return r;var i=e.match(sstr0);if(i){n=i[2].replace(sstr1$1,"").split(sstr2$1);for(var a=0;a!=n.length;++a){var o=parse_si$1(n[a].trim(),t);null!=o&&(r[r.length]=o)}i=parsexmltag$1(i[1]),r.Count=i.count,r.Unique=i.uniqueCount}return r}function parse_BrtBeginSst$1(e){return[e.read_shift(4),e.read_shift(4)]}function parse_sst_bin$1(e,t){var r=[],n=!1;return recordhopper$1(e,(function(e,i,a){switch(a){case 159:r.Count=e[0],r.Unique=e[1];break;case 19:r.push(e);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(i.T,!n||t.WTF)throw new Error("Unexpected record 0x"+a.toString(16))}})),r}function _JS2ANSI$1(e){for(var t=[],r=e.split(""),n=0;n<r.length;++n)t[n]=r[n].charCodeAt(0);return t}function parse_CRYPTOVersion$1(e,t){var r={};return r.Major=e.read_shift(2),r.Minor=e.read_shift(2),t>=4&&(e.l+=t-4),r}function parse_DataSpaceVersionInfo$1(e){var t={};return t.id=e.read_shift(0,"lpp4"),t.R=parse_CRYPTOVersion$1(e,4),t.U=parse_CRYPTOVersion$1(e,4),t.W=parse_CRYPTOVersion$1(e,4),t}function parse_DataSpaceMapEntry$1(e){for(var t=e.read_shift(4),r=e.l+t-4,n={},i=e.read_shift(4),a=[];i-- >0;)a.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(n.name=e.read_shift(0,"lpp4"),n.comps=a,e.l!=r)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+r);return n}function parse_DataSpaceMap$1(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(parse_DataSpaceMapEntry$1(e));return t}function parse_DataSpaceDefinition$1(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(e.read_shift(0,"lpp4"));return t}function parse_TransformInfoHeader$1(e){var t={};return e.read_shift(4),e.l+=4,t.id=e.read_shift(0,"lpp4"),t.name=e.read_shift(0,"lpp4"),t.R=parse_CRYPTOVersion$1(e,4),t.U=parse_CRYPTOVersion$1(e,4),t.W=parse_CRYPTOVersion$1(e,4),t}function parse_Primary$1(e){var t=parse_TransformInfoHeader$1(e);if(t.ename=e.read_shift(0,"8lpp4"),t.blksz=e.read_shift(4),t.cmode=e.read_shift(4),4!=e.read_shift(4))throw new Error("Bad !Primary record");return t}function parse_EncryptionHeader$1(e,t){var r=e.l+t,n={};n.Flags=63&e.read_shift(4),e.l+=4,n.AlgID=e.read_shift(4);var i=!1;switch(n.AlgID){case 26126:case 26127:case 26128:i=36==n.Flags;break;case 26625:i=4==n.Flags;break;case 0:i=16==n.Flags||4==n.Flags||36==n.Flags;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=e.read_shift(4),n.KeySize=e.read_shift(4),n.ProviderType=e.read_shift(4),e.l+=8,n.CSPName=e.read_shift(r-e.l>>1,"utf16le"),e.l=r,n}function parse_EncryptionVerifier$1(e,t){var r={},n=e.l+t;return e.l+=4,r.Salt=e.slice(e.l,e.l+16),e.l+=16,r.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),r.VerifierHash=e.slice(e.l,n),e.l=n,r}function parse_EncryptionInfo$1(e){var t=parse_CRYPTOVersion$1(e);switch(t.Minor){case 2:return[t.Minor,parse_EncInfoStd$1(e)];case 3:return[t.Minor,parse_EncInfoExt$1()];case 4:return[t.Minor,parse_EncInfoAgl$1(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}function parse_EncInfoStd$1(e){if(36!=(63&e.read_shift(4)))throw new Error("EncryptionInfo mismatch");var t=e.read_shift(4);return{t:"Std",h:parse_EncryptionHeader$1(e,t),v:parse_EncryptionVerifier$1(e,e.length-e.l)}}function parse_EncInfoExt$1(){throw new Error("File is password-protected: ECMA-376 Extensible")}function parse_EncInfoAgl$1(e){var t=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var r=e.read_shift(e.length-e.l,"utf8"),n={};return r.replace(tagregex$1,(function(e){var r=parsexmltag$1(e);switch(strip_ns$1(r[0])){case"<?xml":case"<encryption":case"</encryption>":case"</keyEncryptors>":case"</keyEncryptor>":break;case"<keyData":t.forEach((function(e){n[e]=r[e]}));break;case"<dataIntegrity":n.encryptedHmacKey=r.encryptedHmacKey,n.encryptedHmacValue=r.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"<keyEncryptor":n.uri=r.uri;break;case"<encryptedKey":n.encs.push(r);break;default:throw r[0]}})),n}function parse_RC4CryptoHeader$1(e,t){var r={},n=r.EncryptionVersionInfo=parse_CRYPTOVersion$1(e,4);if(t-=4,2!=n.Minor)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);r.Flags=e.read_shift(4),t-=4;var i=e.read_shift(4);return t-=4,r.EncryptionHeader=parse_EncryptionHeader$1(e,i),t-=i,r.EncryptionVerifier=parse_EncryptionVerifier$1(e,t),r}function parse_RC4Header$1(e){var t={},r=t.EncryptionVersionInfo=parse_CRYPTOVersion$1(e,4);if(1!=r.Major||1!=r.Minor)throw"unrecognized version code "+r.Major+" : "+r.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}function crypto_CreatePasswordVerifier_Method1$1(e){var t,r,n=0,i=_JS2ANSI$1(e),a=i.length+1;for((t=new_raw_buf$1(a))[0]=i.length,r=1;r!=a;++r)t[r]=i[r-1];for(r=a-1;r>=0;--r)n=((16384&n?1:0)|n<<1&32767)^t[r];return 52811^n}var crypto_CreateXorArray_Method1$1=function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],t=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],n=function(e,t){return 255&((r=e^t)/2|128*r);var r};return function(i){for(var a,o,s,l=_JS2ANSI$1(i),c=function(e){for(var n=t[e.length-1],i=104,a=e.length-1;a>=0;--a)for(var o=e[a],s=0;7!=s;++s)64&o&&(n^=r[i]),o*=2,--i;return n}(l),u=l.length,d=new_raw_buf$1(16),h=0;16!=h;++h)d[h]=0;for(1&~u||(a=c>>8,d[u]=n(e[0],a),--u,a=255&c,o=l[l.length-1],d[u]=n(o,a));u>0;)a=c>>8,d[--u]=n(l[u],a),a=255&c,d[--u]=n(l[u],a);for(u=15,s=15-l.length;s>0;)a=c>>8,d[u]=n(e[s],a),--s,a=255&c,d[--u]=n(l[u],a),--u,--s;return d}}(),crypto_DecryptData_Method1$1=function(e,t,r,n,i){var a,o;for(i||(i=t),n||(n=crypto_CreateXorArray_Method1$1(e)),a=0;a!=t.length;++a)o=t[a],o=255&((o^=n[r])>>5|o<<3),i[a]=o,++r;return[i,r,n]},crypto_MakeXorDecryptor$1=function(e){var t=0,r=crypto_CreateXorArray_Method1$1(e);return function(e){var n=crypto_DecryptData_Method1$1("",e,t,r);return t=n[1],n[0]}};function parse_XORObfuscation$1(e,t,r,n){var i={key:parseuint16$1(e),verificationBytes:parseuint16$1(e)};return r.password&&(i.verifier=crypto_CreatePasswordVerifier_Method1$1(r.password)),n.valid=i.verificationBytes===i.verifier,n.valid&&(n.insitu=crypto_MakeXorDecryptor$1(r.password)),i}function parse_FilePassHeader$1(e,t,r){var n=r||{};return n.Info=e.read_shift(2),e.l-=2,1===n.Info?n.Data=parse_RC4Header$1(e):n.Data=parse_RC4CryptoHeader$1(e,t),n}function parse_FilePass$1(e,t,r){var n={Type:r.biff>=8?e.read_shift(2):0};return n.Type?parse_FilePassHeader$1(e,t-2,n):parse_XORObfuscation$1(e,r.biff>=8?t:t-2,r,n),n}var RTF=function(){function e(e,r){switch(r.type){case"base64":return t(Base64_decode$1(e),r);case"binary":return t(e,r);case"buffer":return t(has_buf$1&&Buffer.isBuffer(e)?e.toString("binary"):a2s$1(e),r);case"array":return t(cc2str$1(e),r)}throw new Error("Unrecognized type "+r.type)}function t(e,t){var r=(t||{}).dense?[]:{},n=e.match(/\\trowd.*?\\row\b/g);if(!n.length)throw new Error("RTF missing table");var i={s:{c:0,r:0},e:{c:0,r:n.length-1}};return n.forEach((function(e,t){Array.isArray(r)&&(r[t]=[]);for(var n,a=/\\\w+\b/g,o=0,s=-1;n=a.exec(e);){if("\\cell"===n[0]){var l=e.slice(o,a.lastIndex-n[0].length);if(" "==l[0]&&(l=l.slice(1)),++s,l.length){var c={v:l,t:"s"};Array.isArray(r)?r[t][s]=c:r[encode_cell$1({r:t,c:s})]=c}}o=a.lastIndex}s>i.e.c&&(i.e.c=s)})),r["!ref"]=encode_range$1(i),r}return{to_workbook:function(t,r){return sheet_to_workbook$1(e(t,r),r)},to_sheet:e,from_sheet:function(e){for(var t,r=["{\\rtf1\\ansi"],n=safe_decode_range$1(e["!ref"]),i=Array.isArray(e),a=n.s.r;a<=n.e.r;++a){r.push("\\trowd\\trautofit1");for(var o=n.s.c;o<=n.e.c;++o)r.push("\\cellx"+(o+1));for(r.push("\\pard\\intbl"),o=n.s.c;o<=n.e.c;++o){var s=encode_cell$1({r:a,c:o});(t=i?(e[a]||[])[o]:e[s])&&(null!=t.v||t.f&&!t.F)&&(r.push(" "+(t.w||(format_cell$1(t),t.w))),r.push("\\cell"))}r.push("\\pard\\intbl\\row")}return r.join("")+"}"}}}();function hex2RGB$1(e){var t=e.slice("#"===e[0]?1:0).slice(0,6);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function rgb2Hex$1(e){for(var t=0,r=1;3!=t;++t)r=256*r+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}function rgb2HSL$1(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(t,r,n),a=Math.min(t,r,n),o=i-a;if(0===o)return[0,0,t];var s,l=0,c=i+a;switch(s=o/(c>1?2-c:c),i){case t:l=((r-n)/o+6)%6;break;case r:l=(n-t)/o+2;break;case n:l=(t-r)/o+4}return[l/6,s,c/2]}function hsl2RGB$1(e){var t,r=e[0],n=e[1],i=e[2],a=2*n*(i<.5?i:1-i),o=i-a/2,s=[o,o,o],l=6*r;if(0!==n)switch(0|l){case 0:case 6:t=a*l,s[0]+=a,s[1]+=t;break;case 1:t=a*(2-l),s[0]+=t,s[1]+=a;break;case 2:t=a*(l-2),s[1]+=a,s[2]+=t;break;case 3:t=a*(4-l),s[1]+=t,s[2]+=a;break;case 4:t=a*(l-4),s[2]+=a,s[0]+=t;break;case 5:t=a*(6-l),s[2]+=t,s[0]+=a}for(var c=0;3!=c;++c)s[c]=Math.round(255*s[c]);return s}function rgb_tint$1(e,t){if(0===t)return e;var r=rgb2HSL$1(hex2RGB$1(e));return r[2]=t<0?r[2]*(1+t):1-(1-r[2])*(1-t),rgb2Hex$1(hsl2RGB$1(r))}var DEF_MDW$1=6,MAX_MDW$1=15,MIN_MDW$1=1,MDW$1=DEF_MDW$1;function width2px$1(e){return Math.floor((e+Math.round(128/MDW$1)/256)*MDW$1)}function px2char$1(e){return Math.floor((e-5)/MDW$1*100+.5)/100}function char2width$1(e){return Math.round((e*MDW$1+5)/MDW$1*256)/256}function cycle_width$1(e){return char2width$1(px2char$1(width2px$1(e)))}function find_mdw_colw$1(e){var t=Math.abs(e-cycle_width$1(e)),r=MDW$1;if(t>.005)for(MDW$1=MIN_MDW$1;MDW$1<MAX_MDW$1;++MDW$1)Math.abs(e-cycle_width$1(e))<=t&&(t=Math.abs(e-cycle_width$1(e)),r=MDW$1);MDW$1=r}function process_col$1(e){e.width?(e.wpx=width2px$1(e.width),e.wch=px2char$1(e.wpx),e.MDW=MDW$1):e.wpx?(e.wch=px2char$1(e.wpx),e.width=char2width$1(e.wch),e.MDW=MDW$1):"number"==typeof e.wch&&(e.width=char2width$1(e.wch),e.wpx=width2px$1(e.width),e.MDW=MDW$1),e.customWidth&&delete e.customWidth}var DEF_PPI$1=96,PPI$1=DEF_PPI$1;function px2pt$1(e){return 96*e/PPI$1}function pt2px$1(e){return e*PPI$1/96}var XLMLPatternTypeMap$1={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function parse_borders$1(e,t,r,n){t.Borders=[];var i={},a=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var r=parsexmltag$1(e);switch(strip_ns$1(r[0])){case"<borders":case"<borders>":case"</borders>":case"</border>":case"<left/>":case"<left":case"<left>":case"</left>":case"<right/>":case"<right":case"<right>":case"</right>":case"<top/>":case"<top":case"<top>":case"</top>":case"<bottom/>":case"<bottom":case"<bottom>":case"</bottom>":case"<diagonal":case"<diagonal>":case"<diagonal/>":case"</diagonal>":case"<horizontal":case"<horizontal>":case"<horizontal/>":case"</horizontal>":case"<vertical":case"<vertical>":case"<vertical/>":case"</vertical>":case"<start":case"<start>":case"<start/>":case"</start>":case"<end":case"<end>":case"<end/>":case"</end>":case"<color":case"<color>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<border":case"<border>":case"<border/>":i={},r.diagonalUp&&(i.diagonalUp=parsexmlbool$1(r.diagonalUp)),r.diagonalDown&&(i.diagonalDown=parsexmlbool$1(r.diagonalDown)),t.Borders.push(i);break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(n&&n.WTF&&!a)throw new Error("unrecognized "+r[0]+" in borders")}}))}function parse_fills$1(e,t,r,n){t.Fills=[];var i={},a=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var r=parsexmltag$1(e);switch(strip_ns$1(r[0])){case"<fills":case"<fills>":case"</fills>":case"</fill>":case"<gradientFill>":case"<patternFill/>":case"</patternFill>":case"<bgColor/>":case"</bgColor>":case"<fgColor/>":case"</fgColor>":case"<stop":case"<stop/>":case"</stop>":case"<color":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<fill>":case"<fill":case"<fill/>":i={},t.Fills.push(i);break;case"<gradientFill":case"</gradientFill>":t.Fills.push(i),i={};break;case"<patternFill":case"<patternFill>":r.patternType&&(i.patternType=r.patternType);break;case"<bgColor":i.bgColor||(i.bgColor={}),r.indexed&&(i.bgColor.indexed=parseInt(r.indexed,10)),r.theme&&(i.bgColor.theme=parseInt(r.theme,10)),r.tint&&(i.bgColor.tint=parseFloat(r.tint)),r.rgb&&(i.bgColor.rgb=r.rgb.slice(-6));break;case"<fgColor":i.fgColor||(i.fgColor={}),r.theme&&(i.fgColor.theme=parseInt(r.theme,10)),r.tint&&(i.fgColor.tint=parseFloat(r.tint)),null!=r.rgb&&(i.fgColor.rgb=r.rgb.slice(-6));break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(n&&n.WTF&&!a)throw new Error("unrecognized "+r[0]+" in fills")}}))}function parse_fonts$1(e,t,r,n){t.Fonts=[];var i={},a=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var o=parsexmltag$1(e);switch(strip_ns$1(o[0])){case"<fonts":case"<fonts>":case"</fonts>":case"<font":case"<font>":case"<name/>":case"</name>":case"<sz/>":case"</sz>":case"<vertAlign/>":case"</vertAlign>":case"<family/>":case"</family>":case"<scheme/>":case"</scheme>":case"<color/>":case"</color>":case"<extLst":case"<extLst>":case"</extLst>":break;case"</font>":case"<font/>":t.Fonts.push(i),i={};break;case"<name":o.val&&(i.name=utf8read$1(o.val));break;case"<b":i.bold=o.val?parsexmlbool$1(o.val):1;break;case"<b/>":i.bold=1;break;case"<i":i.italic=o.val?parsexmlbool$1(o.val):1;break;case"<i/>":i.italic=1;break;case"<u":switch(o.val){case"none":i.underline=0;break;case"single":i.underline=1;break;case"double":i.underline=2;break;case"singleAccounting":i.underline=33;break;case"doubleAccounting":i.underline=34}break;case"<u/>":i.underline=1;break;case"<strike":i.strike=o.val?parsexmlbool$1(o.val):1;break;case"<strike/>":i.strike=1;break;case"<outline":i.outline=o.val?parsexmlbool$1(o.val):1;break;case"<outline/>":i.outline=1;break;case"<shadow":i.shadow=o.val?parsexmlbool$1(o.val):1;break;case"<shadow/>":i.shadow=1;break;case"<condense":i.condense=o.val?parsexmlbool$1(o.val):1;break;case"<condense/>":i.condense=1;break;case"<extend":i.extend=o.val?parsexmlbool$1(o.val):1;break;case"<extend/>":i.extend=1;break;case"<sz":o.val&&(i.sz=+o.val);break;case"<vertAlign":o.val&&(i.vertAlign=o.val);break;case"<family":o.val&&(i.family=parseInt(o.val,10));break;case"<scheme":o.val&&(i.scheme=o.val);break;case"<charset":if("1"==o.val)break;o.codepage=CS2CP$1[parseInt(o.val,10)];break;case"<color":if(i.color||(i.color={}),o.auto&&(i.color.auto=parsexmlbool$1(o.auto)),o.rgb)i.color.rgb=o.rgb.slice(-6);else if(o.indexed){i.color.index=parseInt(o.indexed,10);var s=XLSIcv$1[i.color.index];81==i.color.index&&(s=XLSIcv$1[1]),s||(s=XLSIcv$1[1]),i.color.rgb=s[0].toString(16)+s[1].toString(16)+s[2].toString(16)}else o.theme&&(i.color.theme=parseInt(o.theme,10),o.tint&&(i.color.tint=parseFloat(o.tint)),o.theme&&r.themeElements&&r.themeElements.clrScheme&&(i.color.rgb=rgb_tint$1(r.themeElements.clrScheme[i.color.theme].rgb,i.color.tint||0)));break;case"<AlternateContent":case"<ext":a=!0;break;case"</AlternateContent>":case"</ext>":a=!1;break;default:if(n&&n.WTF&&!a)throw new Error("unrecognized "+o[0]+" in fonts")}}))}function parse_numFmts$1(e,t,r){t.NumberFmt=[];for(var n=keys$4(table_fmt$1),i=0;i<n.length;++i)t.NumberFmt[n[i]]=table_fmt$1[n[i]];var a=e[0].match(tagregex$1);if(a)for(i=0;i<a.length;++i){var o=parsexmltag$1(a[i]);switch(strip_ns$1(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":case"</numFmt>":break;case"<numFmt":var s=unescapexml$1(utf8read$1(o.formatCode)),l=parseInt(o.numFmtId,10);if(t.NumberFmt[l]=s,l>0){if(l>392){for(l=392;l>60&&null!=t.NumberFmt[l];--l);t.NumberFmt[l]=s}SSF_load$1(s,l)}break;default:if(r.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}var cellXF_uint$1=["numFmtId","fillId","fontId","borderId","xfId"],cellXF_bool$1=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function parse_cellXfs$1(e,t,r){var n;t.CellXf=[];var i=!1;(e[0].match(tagregex$1)||[]).forEach((function(e){var a=parsexmltag$1(e),o=0;switch(strip_ns$1(a[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":case"</xf>":case"</alignment>":case"<protection":case"</protection>":case"<protection/>":case"<extLst":case"<extLst>":case"</extLst>":break;case"<xf":case"<xf/>":for(delete(n=a)[0],o=0;o<cellXF_uint$1.length;++o)n[cellXF_uint$1[o]]&&(n[cellXF_uint$1[o]]=parseInt(n[cellXF_uint$1[o]],10));for(o=0;o<cellXF_bool$1.length;++o)n[cellXF_bool$1[o]]&&(n[cellXF_bool$1[o]]=parsexmlbool$1(n[cellXF_bool$1[o]]));if(t.NumberFmt&&n.numFmtId>392)for(o=392;o>60;--o)if(t.NumberFmt[n.numFmtId]==t.NumberFmt[o]){n.numFmtId=o;break}t.CellXf.push(n);break;case"<alignment":case"<alignment/>":var s={};a.vertical&&(s.vertical=a.vertical),a.horizontal&&(s.horizontal=a.horizontal),null!=a.textRotation&&(s.textRotation=a.textRotation),a.indent&&(s.indent=a.indent),a.wrapText&&(s.wrapText=parsexmlbool$1(a.wrapText)),n.alignment=s;break;case"<AlternateContent":case"<ext":i=!0;break;case"</AlternateContent>":case"</ext>":i=!1;break;default:if(r&&r.WTF&&!i)throw new Error("unrecognized "+a[0]+" in cellXfs")}}))}var parse_sty_xml$1=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,r=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,n=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,i=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(a,o,s){var l,c={};return a?((l=(a=a.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"")).match(e))&&parse_numFmts$1(l,c,s),(l=a.match(n))&&parse_fonts$1(l,c,o,s),(l=a.match(r))&&parse_fills$1(l,c,o,s),(l=a.match(i))&&parse_borders$1(l,c,o,s),(l=a.match(t))&&parse_cellXfs$1(l,c,s),c):c}}();function parse_BrtFmt$1(e,t){return[e.read_shift(2),parse_XLWideString$1(e)]}function parse_BrtFont$1(e,t,r){var n={};n.sz=e.read_shift(2)/20;var i=parse_FontFlags$1(e);switch(i.fItalic&&(n.italic=1),i.fCondense&&(n.condense=1),i.fExtend&&(n.extend=1),i.fShadow&&(n.shadow=1),i.fOutline&&(n.outline=1),i.fStrikeout&&(n.strike=1),700===e.read_shift(2)&&(n.bold=1),e.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript"}var a=e.read_shift(1);0!=a&&(n.underline=a);var o=e.read_shift(1);o>0&&(n.family=o);var s=e.read_shift(1);switch(s>0&&(n.charset=s),e.l++,n.color=parse_BrtColor$1(e),e.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor"}return n.name=parse_XLWideString$1(e),n}var parse_BrtFill$1=parsenoop$1;function parse_BrtXF$1(e,t){var r=e.l+t,n=e.read_shift(2),i=e.read_shift(2);return e.l=r,{ixfe:n,numFmtId:i}}var parse_BrtBorder$1=parsenoop$1;function parse_sty_bin$1(e,t,r){var n={NumberFmt:[]};for(var i in table_fmt$1)n.NumberFmt[i]=table_fmt$1[i];n.CellXf=[],n.Fonts=[];var a=[],o=!1;return recordhopper$1(e,(function(e,i,s){switch(s){case 44:n.NumberFmt[e[0]]=e[1],SSF_load$1(e[1],e[0]);break;case 43:n.Fonts.push(e),null!=e.color.theme&&t&&t.themeElements&&t.themeElements.clrScheme&&(e.color.rgb=rgb_tint$1(t.themeElements.clrScheme[e.color.theme].rgb,e.color.tint||0));break;case 1025:case 45:case 46:case 48:case 507:case 572:case 475:case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 47:617==a[a.length-1]&&n.CellXf.push(e);break;case 35:o=!0;break;case 36:o=!1;break;case 37:a.push(s),o=!0;break;case 38:a.pop(),o=!1;break;default:if(i.T>0)a.push(s);else if(i.T<0)a.pop();else if(!o||r.WTF&&37!=a[a.length-1])throw new Error("Unexpected record 0x"+s.toString(16))}})),n}var XLSXThemeClrScheme$1=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function parse_clrScheme$1(e,t,r){t.themeElements.clrScheme=[];var n={};(e[0].match(tagregex$1)||[]).forEach((function(e){var i=parsexmltag$1(e);switch(i[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=i.val;break;case"<a:sysClr":n.rgb=i.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":"/"===i[0].charAt(1)?(t.themeElements.clrScheme[XLSXThemeClrScheme$1.indexOf(i[0])]=n,n={}):n.name=i[0].slice(3,i[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+i[0]+" in clrScheme")}}))}function parse_fontScheme(){}function parse_fmtScheme(){}var clrsregex=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,fntsregex=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,fmtsregex=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function parse_themeElements$1(e,t,r){var n;t.themeElements={},[["clrScheme",clrsregex,parse_clrScheme$1],["fontScheme",fntsregex,parse_fontScheme],["fmtScheme",fmtsregex,parse_fmtScheme]].forEach((function(i){if(!(n=e.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](n,t,r)}))}var themeltregex=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function parse_theme_xml$1(e,t){var r;e&&0!==e.length||(e=write_theme$1());var n={};if(!(r=e.match(themeltregex)))throw new Error("themeElements not found in theme");return parse_themeElements$1(r[0],n,t),n.raw=e,n}function write_theme$1(e,t){var r=[XML_HEADER$1];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function parse_Theme$1(e,t,r){var n=e.l+t;if(124226!==e.read_shift(4))if(r.cellStyles){var i,a=e.slice(e.l);e.l=n;try{i=zip_read$1(a,{type:"array"})}catch(s){return}var o=getzipstr$1(i,"theme/theme/theme1.xml",!0);if(o)return parse_theme_xml$1(o,r)}else e.l=n}function parse_ColorTheme$1(e){return e.read_shift(4)}function parse_FullColorExt$1(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:case 4:e.l+=4;break;case 1:t.xclrValue=parse_IcvXF$1(e,4);break;case 2:t.xclrValue=parse_LongRGBA$1(e);break;case 3:t.xclrValue=parse_ColorTheme$1(e)}return e.l+=8,t}function parse_IcvXF$1(e,t){return parsenoop$1(e,t)}function parse_XFExtGradient$1(e,t){return parsenoop$1(e,t)}function parse_ExtProp$1(e){var t=e.read_shift(2),r=e.read_shift(2)-4,n=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=parse_FullColorExt$1(e);break;case 6:n[1]=parse_XFExtGradient$1(e,r);break;case 14:case 15:n[1]=e.read_shift(1===r?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return n}function parse_XFExt$1(e,t){var r=e.l+t;e.l+=2;var n=e.read_shift(2);e.l+=2;for(var i=e.read_shift(2),a=[];i-- >0;)a.push(parse_ExtProp$1(e,r-e.l));return{ixfe:n,ext:a}}function update_xfext$1(e,t){t.forEach((function(e){e[0]}))}function parse_BrtMdtinfo$1(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:parse_XLWideString$1(e)}}function parse_BrtMdb$1(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function parse_BrtBeginEsmdb$1(e){return e.l+=4,0!=e.read_shift(4)}function parse_xlmeta_bin$1(e,t,r){var n={Types:[],Cell:[],Value:[]},i=r||{},a=[],o=!1,s=2;return recordhopper$1(e,(function(e,t,r){switch(r){case 335:n.Types.push({name:e.name});break;case 51:e.forEach((function(e){1==s?n.Cell.push({type:n.Types[e[0]-1].name,index:e[1]}):0==s&&n.Value.push({type:n.Types[e[0]-1].name,index:e[1]})}));break;case 337:s=e?1:0;break;case 338:s=2;break;case 35:a.push(r),o=!0;break;case 36:a.pop(),o=!1;break;default:if(t.T);else if(!o||i.WTF&&35!=a[a.length-1])throw new Error("Unexpected record 0x"+r.toString(16))}})),n}function parse_xlmeta_xml$1(e,t,r){var n={Types:[],Cell:[],Value:[]};if(!e)return n;var i,a=!1,o=2;return e.replace(tagregex$1,(function(e){var t=parsexmltag$1(e);switch(strip_ns$1(t[0])){case"<?xml":case"<metadata":case"</metadata>":case"<metadataTypes":case"</metadataTypes>":case"</metadataType>":case"</futureMetadata>":case"<bk>":case"</bk>":case"</rc>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<metadataType":n.Types.push({name:t.name});break;case"<futureMetadata":for(var s=0;s<n.Types.length;++s)n.Types[s].name==t.name&&(i=n.Types[s]);break;case"<rc":1==o?n.Cell.push({type:n.Types[t.t-1].name,index:+t.v}):0==o&&n.Value.push({type:n.Types[t.t-1].name,index:+t.v});break;case"<cellMetadata":o=1;break;case"</cellMetadata>":case"</valueMetadata>":o=2;break;case"<valueMetadata":o=0;break;case"<ext":a=!0;break;case"</ext>":a=!1;break;case"<rvb":if(!i)break;i.offsets||(i.offsets=[]),i.offsets.push(+t.i);break;default:if(!a&&r.WTF)throw new Error("unrecognized "+t[0]+" in metadata")}return e})),n}function parse_cc_xml$1(e){var t=[];if(!e)return t;var r=1;return(e.match(tagregex$1)||[]).forEach((function(e){var n=parsexmltag$1(e);switch(n[0]){case"<?xml":case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete n[0],n.i?r=n.i:n.i=r,t.push(n)}})),t}function parse_BrtCalcChainItem$$1(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=encode_cell$1(r);var n=e.read_shift(1);return 2&n&&(t.l="1"),8&n&&(t.a="1"),t}function parse_cc_bin$1(e,t,r){var n=[];return recordhopper$1(e,(function(e,t,r){if(63===r)n.push(e);else if(!t.T)throw new Error("Unexpected record 0x"+r.toString(16))})),n}function parse_xlink_xml$1(){}function parse_xlink_bin$1(e,t,r,n){if(!e)return e;var i=n||{},a=!1;recordhopper$1(e,(function(e,t,r){switch(r){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:a=!0;break;case 36:a=!1;break;default:if(t.T);else if(!a||i.WTF)throw new Error("Unexpected record 0x"+r.toString(16))}}),i)}function parse_drawing$1(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}function sheet_insert_comments$1(e,t,r,n){var i,a=Array.isArray(e);t.forEach((function(t){var o=decode_cell$1(t.ref);if(a?(e[o.r]||(e[o.r]=[]),i=e[o.r][o.c]):i=e[t.ref],!i){i={t:"z"},a?e[o.r][o.c]=i:e[t.ref]=i;var s=safe_decode_range$1(e["!ref"]||"BDWGO1000001:A1");s.s.r>o.r&&(s.s.r=o.r),s.e.r<o.r&&(s.e.r=o.r),s.s.c>o.c&&(s.s.c=o.c),s.e.c<o.c&&(s.e.c=o.c);var l=encode_range$1(s);l!==e["!ref"]&&(e["!ref"]=l)}i.c||(i.c=[]);var c={a:t.author,t:t.t,r:t.r,T:r};t.h&&(c.h=t.h);for(var u=i.c.length-1;u>=0;--u){if(!r&&i.c[u].T)return;r&&!i.c[u].T&&i.c.splice(u,1)}if(r&&n)for(u=0;u<n.length;++u)if(c.a==n[u].id){c.a=n[u].name||c.a;break}i.c.push(c)}))}function parse_comments_xml$1(e,t){if(e.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],n=[],i=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach((function(e){if(""!==e&&""!==e.trim()){var t=e.match(/<(?:\w+:)?author[^>]*>(.*)/);t&&r.push(t[1])}}));var a=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return a&&a[1]&&a[1].split(/<\/\w*:?comment>/).forEach((function(e){if(""!==e&&""!==e.trim()){var i=e.match(/<(?:\w+:)?comment[^>]*>/);if(i){var a=parsexmltag$1(i[0]),o={author:a.authorId&&r[a.authorId]||"sheetjsghost",ref:a.ref,guid:a.guid},s=decode_cell$1(a.ref);if(!(t.sheetRows&&t.sheetRows<=s.r)){var l=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),c=!!l&&!!l[1]&&parse_si$1(l[1])||{r:"",t:"",h:""};o.r=c.r,"<t></t>"==c.r&&(c.t=c.h=""),o.t=(c.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),t.cellHTML&&(o.h=c.h),n.push(o)}}}})),n}function parse_tcmnt_xml$1(e,t){var r=[],n=!1,i={},a=0;return e.replace(tagregex$1,(function(o,s){var l=parsexmltag$1(o);switch(strip_ns$1(l[0])){case"<?xml":case"<ThreadedComments":case"</ThreadedComments>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<threadedComment":i={author:l.personId,guid:l.id,ref:l.ref,T:1};break;case"</threadedComment>":null!=i.t&&r.push(i);break;case"<text>":case"<text":a=s+o.length;break;case"</text>":i.t=e.slice(a,s).replace(/\r\n/g,"\n").replace(/\r/g,"\n");break;case"<mentions":case"<mentions>":case"<ext":n=!0;break;case"</mentions>":case"</ext>":n=!1;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+l[0]+" in threaded comments")}return o})),r}function parse_people_xml$1(e,t){var r=[],n=!1;return e.replace(tagregex$1,(function(e){var i=parsexmltag$1(e);switch(strip_ns$1(i[0])){case"<?xml":case"<personList":case"</personList>":case"</person>":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<person":r.push({name:i.displayname,id:i.id});break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+i[0]+" in threaded comments")}return e})),r}function parse_BrtBeginComment$1(e){var t={};t.iauthor=e.read_shift(4);var r=parse_UncheckedRfX$1(e);return t.rfx=r.s,t.ref=encode_cell$1(r.s),e.l+=16,t}var parse_BrtCommentAuthor$1=parse_XLWideString$1;function parse_comments_bin$1(e,t){var r=[],n=[],i={},a=!1;return recordhopper$1(e,(function(e,o,s){switch(s){case 632:n.push(e);break;case 635:i=e;break;case 637:i.t=e.t,i.h=e.h,i.r=e.r;break;case 636:if(i.author=n[i.iauthor],delete i.iauthor,t.sheetRows&&i.rfx&&t.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,r.push(i);break;case 3072:case 37:case 38:break;case 35:a=!0;break;case 36:a=!1;break;default:if(o.T);else if(!a||t.WTF)throw new Error("Unexpected record 0x"+s.toString(16))}})),r}var CT_VBA$1="application/vnd.ms-office.vbaProject";function make_vba_xls$1(e){var t=CFB$1.utils.cfb_new({root:"R"});return e.FullPaths.forEach((function(r,n){if("/"!==r.slice(-1)&&r.match(/_VBA_PROJECT_CUR/)){var i=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");CFB$1.utils.cfb_add(t,i,e.FileIndex[n].content)}})),CFB$1.write(t)}function parse_ds_bin$1(){return{"!type":"dialog"}}function parse_ds_xml$1(){return{"!type":"dialog"}}function parse_ms_bin$1(){return{"!type":"macro"}}function parse_ms_xml$1(){return{"!type":"macro"}}var rc_to_a1$1=function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(e,r,n,i){var a=!1,o=!1;0==n.length?o=!0:"["==n.charAt(0)&&(o=!0,n=n.slice(1,-1)),0==i.length?a=!0:"["==i.charAt(0)&&(a=!0,i=i.slice(1,-1));var s=n.length>0?0|parseInt(n,10):0,l=i.length>0?0|parseInt(i,10):0;return a?l+=t.c:--l,o?s+=t.r:--s,r+(a?"":"$")+encode_col$1(l)+(o?"":"$")+encode_row$1(s)}return function(n,i){return t=i,n.replace(e,r)}}(),crefregex$1=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,a1_to_rc$1=function(){return function(e,t){return e.replace(crefregex$1,(function(e,r,n,i,a,o){var s=decode_col$1(i)-(n?0:t.c),l=decode_row$1(o)-(a?0:t.r);return r+"R"+(0==l?"":a?l+1:"["+l+"]")+"C"+(0==s?"":n?s+1:"["+s+"]")}))}}();function shift_formula_str$1(e,t){return e.replace(crefregex$1,(function(e,r,n,i,a,o){return r+("$"==n?n+i:encode_col$1(decode_col$1(i)+t.c))+("$"==a?a+o:encode_row$1(decode_row$1(o)+t.r))}))}function shift_formula_xlsx$1(e,t,r){var n=decode_range$1(t).s,i=decode_cell$1(r);return shift_formula_str$1(e,{r:i.r-n.r,c:i.c-n.c})}function fuzzyfmla$1(e){return 1!=e.length}function _xlfn$1(e){return e.replace(/_xlfn\./g,"")}function parseread1$1(e){e.l+=1}function parse_ColRelU$1(e,t){var r=e.read_shift(2);return[16383&r,r>>14&1,r>>15&1]}function parse_RgceArea$1(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return parse_RgceArea_BIFF2$1(e);12==r.biff&&(n=4)}var i=e.read_shift(n),a=e.read_shift(n),o=parse_ColRelU$1(e),s=parse_ColRelU$1(e);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:a,c:s[0],cRel:s[1],rRel:s[2]}}}function parse_RgceArea_BIFF2$1(e){var t=parse_ColRelU$1(e),r=parse_ColRelU$1(e),n=e.read_shift(1),i=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function parse_RgceAreaRel$1(e,t,r){if(r.biff<8)return parse_RgceArea_BIFF2$1(e);var n=e.read_shift(12==r.biff?4:2),i=e.read_shift(12==r.biff?4:2),a=parse_ColRelU$1(e),o=parse_ColRelU$1(e);return{s:{r:n,c:a[0],cRel:a[1],rRel:a[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function parse_RgceLoc$1(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return parse_RgceLoc_BIFF2$1(e);var n=e.read_shift(r&&12==r.biff?4:2),i=parse_ColRelU$1(e);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function parse_RgceLoc_BIFF2$1(e){var t=parse_ColRelU$1(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function parse_RgceElfLoc$1(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:255&r,fQuoted:!!(16384&r),cRel:r>>15,rRel:r>>15}}function parse_RgceLocRel$1(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return parse_RgceLocRel_BIFF2$1(e);var i=e.read_shift(n>=12?4:2),a=e.read_shift(2),o=(16384&a)>>14,s=(32768&a)>>15;if(a&=16383,1==s)for(;i>524287;)i-=1048576;if(1==o)for(;a>8191;)a-=16384;return{r:i,c:a,cRel:o,rRel:s}}function parse_RgceLocRel_BIFF2$1(e){var t=e.read_shift(2),r=e.read_shift(1),n=(32768&t)>>15,i=(16384&t)>>14;return t&=16383,1==n&&t>=8192&&(t-=16384),1==i&&r>=128&&(r-=256),{r:t,c:r,cRel:i,rRel:n}}function parse_PtgArea$1(e,t,r){return[(96&e[e.l++])>>5,parse_RgceArea$1(e,r.biff>=2&&r.biff<=5?6:8,r)]}function parse_PtgArea3d$1(e,t,r){var n=(96&e[e.l++])>>5,i=e.read_shift(2,"i"),a=8;if(r)switch(r.biff){case 5:e.l+=12,a=6;break;case 12:a=12}return[n,i,parse_RgceArea$1(e,a,r)]}function parse_PtgAreaErr$1(e,t,r){var n=(96&e[e.l++])>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function parse_PtgAreaErr3d$1(e,t,r){var n=(96&e[e.l++])>>5,i=e.read_shift(2),a=8;if(r)switch(r.biff){case 5:e.l+=12,a=6;break;case 12:a=12}return e.l+=a,[n,i]}function parse_PtgAreaN$1(e,t,r){return[(96&e[e.l++])>>5,parse_RgceAreaRel$1(e,t-1,r)]}function parse_PtgArray$1(e,t,r){var n=(96&e[e.l++])>>5;return e.l+=2==r.biff?6:12==r.biff?14:7,[n]}function parse_PtgAttrBaxcel$1(e){var t=1&e[e.l+1];return e.l+=4,[t,1]}function parse_PtgAttrChoose$1(e,t,r){e.l+=2;for(var n=e.read_shift(r&&2==r.biff?1:2),i=[],a=0;a<=n;++a)i.push(e.read_shift(r&&2==r.biff?1:2));return i}function parse_PtgAttrGoto$1(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=2,[n,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgAttrIf$1(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=2,[n,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgAttrIfError$1(e){var t=255&e[e.l+1]?1:0;return e.l+=2,[t,e.read_shift(2)]}function parse_PtgAttrSemi$1(e,t,r){var n=255&e[e.l+1]?1:0;return e.l+=r&&2==r.biff?3:4,[n]}function parse_PtgAttrSpaceType$1(e){return[e.read_shift(1),e.read_shift(1)]}function parse_PtgAttrSpace$1(e){return e.read_shift(2),parse_PtgAttrSpaceType$1(e)}function parse_PtgAttrSpaceSemi$1(e){return e.read_shift(2),parse_PtgAttrSpaceType$1(e)}function parse_PtgRef$1(e,t,r){var n=(96&e[e.l])>>5;return e.l+=1,[n,parse_RgceLoc$1(e,0,r)]}function parse_PtgRefN$1(e,t,r){var n=(96&e[e.l])>>5;return e.l+=1,[n,parse_RgceLocRel$1(e,0,r)]}function parse_PtgRef3d$1(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var i=e.read_shift(2);return r&&5==r.biff&&(e.l+=12),[n,i,parse_RgceLoc$1(e,0,r)]}function parse_PtgFunc$1(e,t,r){var n=(96&e[e.l])>>5;e.l+=1;var i=e.read_shift(r&&r.biff<=3?1:2);return[FtabArgc$1[i],Ftab$1[i],n]}function parse_PtgFuncVar$1(e,t,r){var n=e[e.l++],i=e.read_shift(1),a=r&&r.biff<=3?[88==n?-1:0,e.read_shift(1)]:parsetab$1(e);return[i,(0===a[0]?Ftab$1:Cetab$1)[a[1]]]}function parsetab$1(e){return[e[e.l+1]>>7,32767&e.read_shift(2)]}function parse_PtgAttrSum$1(e,t,r){e.l+=r&&2==r.biff?3:4}function parse_PtgExp$1(e,t,r){return e.l++,r&&12==r.biff?[e.read_shift(4,"i"),0]:[e.read_shift(2),e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgErr$1(e){return e.l++,BErr$1[e.read_shift(1)]}function parse_PtgInt$1(e){return e.l++,e.read_shift(2)}function parse_PtgBool$1(e){return e.l++,0!==e.read_shift(1)}function parse_PtgNum$1(e){return e.l++,parse_Xnum$1(e)}function parse_PtgStr$1(e,t,r){return e.l++,parse_ShortXLUnicodeString$1(e,t-1,r)}function parse_SerAr$1(e,t){var r=[e.read_shift(1)];if(12==t)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2}switch(r[0]){case 4:r[1]=parsebool$1(e,1)?"TRUE":"FALSE",12!=t&&(e.l+=7);break;case 37:case 16:r[1]=BErr$1[e[e.l]],e.l+=12==t?4:8;break;case 0:e.l+=8;break;case 1:r[1]=parse_Xnum$1(e);break;case 2:r[1]=parse_XLUnicodeString2$1(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function parse_PtgExtraMem$1(e,t,r){for(var n=e.read_shift(12==r.biff?4:2),i=[],a=0;a!=n;++a)i.push((12==r.biff?parse_UncheckedRfX$1:parse_Ref8U$1)(e));return i}function parse_PtgExtraArray$1(e,t,r){var n=0,i=0;12==r.biff?(n=e.read_shift(4),i=e.read_shift(4)):(i=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,0==--i&&(i=256));for(var a=0,o=[];a!=n&&(o[a]=[]);++a)for(var s=0;s!=i;++s)o[a][s]=parse_SerAr$1(e,r.biff);return o}function parse_PtgName$1(e,t,r){var n=e.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,a=e.read_shift(i);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12}return[n,0,a]}function parse_PtgNameX$1(e,t,r){return 5==r.biff?parse_PtgNameX_BIFF5$1(e):[e.read_shift(1)>>>5&3,e.read_shift(2),e.read_shift(4)]}function parse_PtgNameX_BIFF5$1(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}function parse_PtgMemArea$1(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=r&&2==r.biff?3:4,[n,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgMemFunc$1(e,t,r){return[e.read_shift(1)>>>5&3,e.read_shift(r&&2==r.biff?1:2)]}function parse_PtgRefErr$1(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,12==r.biff&&(e.l+=2),[n]}function parse_PtgRefErr3d$1(e,t,r){var n=(96&e[e.l++])>>5,i=e.read_shift(2),a=4;if(r)switch(r.biff){case 5:a=15;break;case 12:a=6}return e.l+=a,[n,i]}var parse_PtgMemErr$1=parsenoop$1,parse_PtgMemNoMem$1=parsenoop$1,parse_PtgTbl$1=parsenoop$1;function parse_PtgElfLoc$1(e,t,r){return e.l+=2,[parse_RgceElfLoc$1(e)]}function parse_PtgElfNoop$1(e){return e.l+=6,[]}var parse_PtgElfCol$1=parse_PtgElfLoc$1,parse_PtgElfColS$1=parse_PtgElfNoop$1,parse_PtgElfColSV$1=parse_PtgElfNoop$1,parse_PtgElfColV$1=parse_PtgElfLoc$1;function parse_PtgElfLel$1(e){return e.l+=2,[parseuint16$1(e),1&e.read_shift(2)]}var parse_PtgElfRadical$1=parse_PtgElfLoc$1,parse_PtgElfRadicalLel$1=parse_PtgElfLel$1,parse_PtgElfRadicalS$1=parse_PtgElfNoop$1,parse_PtgElfRw$1=parse_PtgElfLoc$1,parse_PtgElfRwV$1=parse_PtgElfLoc$1,PtgListRT$1=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function parse_PtgList$1(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i=e.read_shift(2),a=e.read_shift(2);return{ixti:t,coltype:3&r,rt:PtgListRT$1[r>>2&31],idx:n,c:i,C:a}}function parse_PtgSxName$1(e){return e.l+=2,[e.read_shift(4)]}function parse_PtgSheet$1(e,t,r){return e.l+=5,e.l+=2,e.l+=2==r.biff?1:4,["PTGSHEET"]}function parse_PtgEndSheet$1(e,t,r){return e.l+=2==r.biff?4:5,["PTGENDSHEET"]}function parse_PtgMemAreaN$1(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}function parse_PtgMemNoMemN$1(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}function parse_PtgAttrNoop$1(e){return e.l+=4,[0,0]}var PtgTypes$1={1:{n:"PtgExp",f:parse_PtgExp$1},2:{n:"PtgTbl",f:parse_PtgTbl$1},3:{n:"PtgAdd",f:parseread1$1},4:{n:"PtgSub",f:parseread1$1},5:{n:"PtgMul",f:parseread1$1},6:{n:"PtgDiv",f:parseread1$1},7:{n:"PtgPower",f:parseread1$1},8:{n:"PtgConcat",f:parseread1$1},9:{n:"PtgLt",f:parseread1$1},10:{n:"PtgLe",f:parseread1$1},11:{n:"PtgEq",f:parseread1$1},12:{n:"PtgGe",f:parseread1$1},13:{n:"PtgGt",f:parseread1$1},14:{n:"PtgNe",f:parseread1$1},15:{n:"PtgIsect",f:parseread1$1},16:{n:"PtgUnion",f:parseread1$1},17:{n:"PtgRange",f:parseread1$1},18:{n:"PtgUplus",f:parseread1$1},19:{n:"PtgUminus",f:parseread1$1},20:{n:"PtgPercent",f:parseread1$1},21:{n:"PtgParen",f:parseread1$1},22:{n:"PtgMissArg",f:parseread1$1},23:{n:"PtgStr",f:parse_PtgStr$1},26:{n:"PtgSheet",f:parse_PtgSheet$1},27:{n:"PtgEndSheet",f:parse_PtgEndSheet$1},28:{n:"PtgErr",f:parse_PtgErr$1},29:{n:"PtgBool",f:parse_PtgBool$1},30:{n:"PtgInt",f:parse_PtgInt$1},31:{n:"PtgNum",f:parse_PtgNum$1},32:{n:"PtgArray",f:parse_PtgArray$1},33:{n:"PtgFunc",f:parse_PtgFunc$1},34:{n:"PtgFuncVar",f:parse_PtgFuncVar$1},35:{n:"PtgName",f:parse_PtgName$1},36:{n:"PtgRef",f:parse_PtgRef$1},37:{n:"PtgArea",f:parse_PtgArea$1},38:{n:"PtgMemArea",f:parse_PtgMemArea$1},39:{n:"PtgMemErr",f:parse_PtgMemErr$1},40:{n:"PtgMemNoMem",f:parse_PtgMemNoMem$1},41:{n:"PtgMemFunc",f:parse_PtgMemFunc$1},42:{n:"PtgRefErr",f:parse_PtgRefErr$1},43:{n:"PtgAreaErr",f:parse_PtgAreaErr$1},44:{n:"PtgRefN",f:parse_PtgRefN$1},45:{n:"PtgAreaN",f:parse_PtgAreaN$1},46:{n:"PtgMemAreaN",f:parse_PtgMemAreaN$1},47:{n:"PtgMemNoMemN",f:parse_PtgMemNoMemN$1},57:{n:"PtgNameX",f:parse_PtgNameX$1},58:{n:"PtgRef3d",f:parse_PtgRef3d$1},59:{n:"PtgArea3d",f:parse_PtgArea3d$1},60:{n:"PtgRefErr3d",f:parse_PtgRefErr3d$1},61:{n:"PtgAreaErr3d",f:parse_PtgAreaErr3d$1},255:{}},PtgDupes$1={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},Ptg18$1={1:{n:"PtgElfLel",f:parse_PtgElfLel$1},2:{n:"PtgElfRw",f:parse_PtgElfRw$1},3:{n:"PtgElfCol",f:parse_PtgElfCol$1},6:{n:"PtgElfRwV",f:parse_PtgElfRwV$1},7:{n:"PtgElfColV",f:parse_PtgElfColV$1},10:{n:"PtgElfRadical",f:parse_PtgElfRadical$1},11:{n:"PtgElfRadicalS",f:parse_PtgElfRadicalS$1},13:{n:"PtgElfColS",f:parse_PtgElfColS$1},15:{n:"PtgElfColSV",f:parse_PtgElfColSV$1},16:{n:"PtgElfRadicalLel",f:parse_PtgElfRadicalLel$1},25:{n:"PtgList",f:parse_PtgList$1},29:{n:"PtgSxName",f:parse_PtgSxName$1},255:{}},Ptg19$1={0:{n:"PtgAttrNoop",f:parse_PtgAttrNoop$1},1:{n:"PtgAttrSemi",f:parse_PtgAttrSemi$1},2:{n:"PtgAttrIf",f:parse_PtgAttrIf$1},4:{n:"PtgAttrChoose",f:parse_PtgAttrChoose$1},8:{n:"PtgAttrGoto",f:parse_PtgAttrGoto$1},16:{n:"PtgAttrSum",f:parse_PtgAttrSum$1},32:{n:"PtgAttrBaxcel",f:parse_PtgAttrBaxcel$1},33:{n:"PtgAttrBaxcel",f:parse_PtgAttrBaxcel$1},64:{n:"PtgAttrSpace",f:parse_PtgAttrSpace$1},65:{n:"PtgAttrSpaceSemi",f:parse_PtgAttrSpaceSemi$1},128:{n:"PtgAttrIfError",f:parse_PtgAttrIfError$1},255:{}};function parse_RgbExtra$1(e,t,r,n){if(n.biff<8)return parsenoop$1(e,t);for(var i=e.l+t,a=[],o=0;o!==r.length;++o)switch(r[o][0]){case"PtgArray":r[o][1]=parse_PtgExtraArray$1(e,0,n),a.push(r[o][1]);break;case"PtgMemArea":r[o][2]=parse_PtgExtraMem$1(e,r[o][1],n),a.push(r[o][2]);break;case"PtgExp":n&&12==n.biff&&(r[o][1][1]=e.read_shift(4),a.push(r[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[o][0]}return 0!==(t=i-e.l)&&a.push(parsenoop$1(e,t)),a}function parse_Rgce$1(e,t,r){for(var n,i,a=e.l+t,o=[];a!=e.l;)t=a-e.l,i=e[e.l],n=PtgTypes$1[i]||PtgTypes$1[PtgDupes$1[i]],24!==i&&25!==i||(n=(24===i?Ptg18$1:Ptg19$1)[e[e.l+1]]),n&&n.f?o.push([n.n,n.f(e,t,r)]):parsenoop$1(e,t);return o}function stringify_array$1(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r],i=[],a=0;a<n.length;++a){var o=n[a];if(o)if(2===o[0])i.push('"'+o[1].replace(/"/g,'""')+'"');else i.push(o[1]);else i.push("")}t.push(i.join(","))}return t.join(";")}var PtgBinOp$1={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function formula_quote_sheet_name$1(e,t){if(!(e||t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function get_ixti_raw$1(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),0==t?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(e[n[0]][0]){case 357:return i=-1==n[1]?"#REF":e.SheetNames[n[1]],n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 358:return null!=r.SID?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return i=-1==n[1]?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map((function(e){return e.Name})).join(";;");default:return e[n[0]][0][3]?(i=-1==n[1]?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function get_ixti$1(e,t,r){var n=get_ixti_raw$1(e,t,r);return"#REF"==n?n:formula_quote_sheet_name$1(n,r)}function stringify_formula$1(e,t,r,n,i){var a,o,s,l,c=i&&i.biff||8,u={s:{c:0,r:0}},d=[],h=0,p=0,f="";if(!e[0]||!e[0][0])return"";for(var m=-1,g="",_=0,y=e[0].length;_<y;++_){var b=e[0][_];switch(b[0]){case"PtgUminus":d.push("-"+d.pop());break;case"PtgUplus":d.push("+"+d.pop());break;case"PtgPercent":d.push(d.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(a=d.pop(),o=d.pop(),m>=0){switch(e[0][m][1][0]){case 0:g=fill$3(" ",e[0][m][1][1]);break;case 1:g=fill$3("\r",e[0][m][1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}o+=g,m=-1}d.push(o+PtgBinOp$1[b[0]]+a);break;case"PtgIsect":a=d.pop(),o=d.pop(),d.push(o+" "+a);break;case"PtgUnion":a=d.pop(),o=d.pop(),d.push(o+","+a);break;case"PtgRange":a=d.pop(),o=d.pop(),d.push(o+":"+a);break;case"PtgAttrChoose":case"PtgAttrGoto":case"PtgAttrIf":case"PtgAttrIfError":case"PtgAttrBaxcel":case"PtgAttrSemi":case"PtgMemArea":case"PtgTbl":case"PtgMemErr":case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":case"PtgMemFunc":case"PtgMemNoMem":break;case"PtgRef":s=shift_cell_xls$1(b[1][1],u,i),d.push(encode_cell_xls$1(s,c));break;case"PtgRefN":s=r?shift_cell_xls$1(b[1][1],r,i):b[1][1],d.push(encode_cell_xls$1(s,c));break;case"PtgRef3d":h=b[1][1],s=shift_cell_xls$1(b[1][2],u,i),f=get_ixti$1(n,h,i),d.push(f+"!"+encode_cell_xls$1(s,c));break;case"PtgFunc":case"PtgFuncVar":var v=b[1][0],S=b[1][1];v||(v=0);var w=0==(v&=127)?[]:d.slice(-v);d.length-=v,"User"===S&&(S=w.shift()),d.push(S+"("+w.join(",")+")");break;case"PtgBool":d.push(b[1]?"TRUE":"FALSE");break;case"PtgInt":case"PtgErr":d.push(b[1]);break;case"PtgNum":d.push(String(b[1]));break;case"PtgStr":d.push('"'+b[1].replace(/"/g,'""')+'"');break;case"PtgAreaN":l=shift_range_xls$1(b[1][1],r?{s:r}:u,i),d.push(encode_range_xls$1(l,i));break;case"PtgArea":l=shift_range_xls$1(b[1][1],u,i),d.push(encode_range_xls$1(l,i));break;case"PtgArea3d":h=b[1][1],l=b[1][2],f=get_ixti$1(n,h,i),d.push(f+"!"+encode_range_xls$1(l,i));break;case"PtgAttrSum":d.push("SUM("+d.pop()+")");break;case"PtgName":p=b[1][2];var T=(n.names||[])[p-1]||(n[0]||[])[p],E=T?T.Name:"SH33TJSNAME"+String(p);E&&"_xlfn."==E.slice(0,6)&&!i.xlfn&&(E=E.slice(6)),d.push(E);break;case"PtgNameX":var x,A=b[1][1];if(p=b[1][2],!(i.biff<=5)){var C="";if(14849==((n[A]||[])[0]||[])[0]||(1025==((n[A]||[])[0]||[])[0]?n[A][p]&&n[A][p].itab>0&&(C=n.SheetNames[n[A][p].itab-1]+"!"):C=n.SheetNames[p-1]+"!"),n[A]&&n[A][p])C+=n[A][p].Name;else if(n[0]&&n[0][p])C+=n[0][p].Name;else{var R=(get_ixti_raw$1(n,A,i)||"").split(";;");R[p-1]?C=R[p-1]:C+="SH33TJSERRX"}d.push(C);break}A<0&&(A=-A),n[A]&&(x=n[A][p]),x||(x={Name:"SH33TJSERRY"}),d.push(x.Name);break;case"PtgParen":var D="(",P=")";if(m>=0){switch(g="",e[0][m][1][0]){case 2:D=fill$3(" ",e[0][m][1][1])+D;break;case 3:D=fill$3("\r",e[0][m][1][1])+D;break;case 4:P=fill$3(" ",e[0][m][1][1])+P;break;case 5:P=fill$3("\r",e[0][m][1][1])+P;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}m=-1}d.push(D+d.pop()+P);break;case"PtgRefErr":case"PtgRefErr3d":case"PtgAreaErr":case"PtgAreaErr3d":d.push("#REF!");break;case"PtgExp":s={c:b[1][1],r:b[1][0]};var I={c:r.c,r:r.r};if(n.sharedf[encode_cell$1(s)]){var k=n.sharedf[encode_cell$1(s)];d.push(stringify_formula$1(k,u,I,n,i))}else{var M=!1;for(a=0;a!=n.arrayf.length;++a)if(o=n.arrayf[a],!(s.c<o[0].s.c||s.c>o[0].e.c||s.r<o[0].s.r||s.r>o[0].e.r)){d.push(stringify_formula$1(o[1],u,I,n,i)),M=!0;break}M||d.push(b[1])}break;case"PtgArray":d.push("{"+stringify_array$1(b[1])+"}");break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=_;break;case"PtgMissArg":d.push("");break;case"PtgList":d.push("Table"+b[1].idx+"[#"+b[1].rt+"]");break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");default:throw new Error("Unrecognized Formula Token: "+String(b))}if(3!=i.biff&&m>=0&&-1==["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"].indexOf(e[0][_][0])){var $=!0;switch((b=e[0][m])[1][0]){case 4:$=!1;case 0:g=fill$3(" ",b[1][1]);break;case 5:$=!1;case 1:g=fill$3("\r",b[1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+b[1][0])}d.push(($?g:"")+d.pop()+($?"":g)),m=-1}}if(d.length>1&&i.WTF)throw new Error("bad formula stack");return d[0]}function parse_ArrayParsedFormula$1(e,t,r){var n,i=e.l+t,a=2==r.biff?1:2,o=e.read_shift(a);if(65535==o)return[[],parsenoop$1(e,t-2)];var s=parse_Rgce$1(e,o,r);return t!==o+a&&(n=parse_RgbExtra$1(e,t-o-a,s,r)),e.l=i,[s,n]}function parse_XLSCellParsedFormula$1(e,t,r){var n,i=e.l+t,a=2==r.biff?1:2,o=e.read_shift(a);if(65535==o)return[[],parsenoop$1(e,t-2)];var s=parse_Rgce$1(e,o,r);return t!==o+a&&(n=parse_RgbExtra$1(e,t-o-a,s,r)),e.l=i,[s,n]}function parse_NameParsedFormula$1(e,t,r,n){var i,a=e.l+t,o=parse_Rgce$1(e,n,r);return a!==e.l&&(i=parse_RgbExtra$1(e,a-e.l,o,r)),[o,i]}function parse_SharedParsedFormula$1(e,t,r){var n,i=e.l+t,a=e.read_shift(2),o=parse_Rgce$1(e,a,r);return 65535==a?[[],parsenoop$1(e,t-2)]:(t!==a+2&&(n=parse_RgbExtra$1(e,i-a-2,o,r)),[o,n])}function parse_FormulaValue$1(e){var t;if(65535!==__readUInt16LE$1(e,e.l+6))return[parse_Xnum$1(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=1===e[e.l+2],e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}function parse_Formula$1(e,t,r){var n=e.l+t,i=parse_XLSCell$1(e);2==r.biff&&++e.l;var a=parse_FormulaValue$1(e),o=e.read_shift(1);2!=r.biff&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var s=parse_XLSCellParsedFormula$1(e,n-e.l,r);return{cell:i,val:a[0],formula:s,shared:o>>3&1,tt:a[1]}}function parse_XLSBParsedFormula$1(e,t,r){var n=e.read_shift(4),i=parse_Rgce$1(e,n,r),a=e.read_shift(4);return[i,a>0?parse_RgbExtra$1(e,a,i,r):null]}var parse_XLSBArrayParsedFormula$1=parse_XLSBParsedFormula$1,parse_XLSBCellParsedFormula$1=parse_XLSBParsedFormula$1,parse_XLSBNameParsedFormula$1=parse_XLSBParsedFormula$1,parse_XLSBSharedParsedFormula$1=parse_XLSBParsedFormula$1,Cetab$1={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},Ftab$1={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},FtabArgc$1={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function ods_to_csf_formula$1(e){return"of:"==e.slice(0,3)&&(e=e.slice(3)),61==e.charCodeAt(0)&&61==(e=e.slice(1)).charCodeAt(0)&&(e=e.slice(1)),(e=(e=(e=e.replace(/COM\.MICROSOFT\./g,"")).replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,(function(e,t){return t.replace(/\./g,"")}))).replace(/\[.(#[A-Z]*[?!])\]/g,"$1")).replace(/[;~]/g,",").replace(/\|/g,";")}function ods_to_csf_3D$1(e){var t=e.split(":");return[t[0].split(".")[0],t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}var strs$1={},_ssfopts$1={};function default_margins$1(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];"xlml"==t&&(r=[1,1,1,1,.5,.5]),null==e.left&&(e.left=r[0]),null==e.right&&(e.right=r[1]),null==e.top&&(e.top=r[2]),null==e.bottom&&(e.bottom=r[3]),null==e.header&&(e.header=r[4]),null==e.footer&&(e.footer=r[5])}}function safe_format$1(e,t,r,n,i,a){try{n.cellNF&&(e.z=table_fmt$1[t])}catch(s){if(n.WTF)throw s}if("z"!==e.t||n.cellStyles){if("d"===e.t&&"string"==typeof e.v&&(e.v=parseDate$1(e.v)),(!n||!1!==n.cellText)&&"z"!==e.t)try{if(null==table_fmt$1[t]&&SSF_load$1(SSFImplicit$1[t]||"General",t),"e"===e.t)e.w=e.w||BErr$1[e.v];else if(0===t)if("n"===e.t)(0|e.v)===e.v?e.w=e.v.toString(10):e.w=SSF_general_num$1(e.v);else if("d"===e.t){var o=datenum$1(e.v);e.w=(0|o)===o?o.toString(10):SSF_general_num$1(o)}else{if(void 0===e.v)return"";e.w=SSF_general$1(e.v,_ssfopts$1)}else"d"===e.t?e.w=SSF_format$1(t,datenum$1(e.v),_ssfopts$1):e.w=SSF_format$1(t,e.v,_ssfopts$1)}catch(s){if(n.WTF)throw s}if(n.cellStyles&&null!=r)try{e.s=a.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=rgb_tint$1(i.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),n.WTF&&(e.s.fgColor.raw_rgb=i.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=rgb_tint$1(i.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),n.WTF&&(e.s.bgColor.raw_rgb=i.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(s){if(n.WTF&&a.Fills)throw s}}}function parse_ws_xml_dim$1(e,t){var r=safe_decode_range$1(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=encode_range$1(r))}var mergecregex$1=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,sheetdataregex=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,hlinkregex$1=/<(?:\w:)?hyperlink [^>]*>/gm,dimregex$1=/"(\w*:\w*)"/,colregex$1=/<(?:\w:)?col\b[^>]*[\/]?>/g,afregex$1=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,marginregex$1=/<(?:\w:)?pageMargins[^>]*\/>/g,sheetprregex$1=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,sheetprregex2=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,svsregex=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function parse_ws_xml$1(e,t,r,n,i,a,o){if(!e)return e;n||(n={"!id":{}});var s=t.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},c="",u="",d=e.match(sheetdataregex);d?(c=e.slice(0,d.index),u=e.slice(d.index+d[0].length)):c=u=e;var h=c.match(sheetprregex$1);h?parse_ws_xml_sheetpr$1(h[0],s,i,r):(h=c.match(sheetprregex2))&&parse_ws_xml_sheetpr2$1(h[0],h[1]||"",s,i,r);var p=(c.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(p>0){var f=c.slice(p,p+50).match(dimregex$1);f&&parse_ws_xml_dim$1(s,f[1])}var m=c.match(svsregex);m&&m[1]&&parse_ws_xml_sheetviews$1(m[1],i);var g=[];if(t.cellStyles){var _=c.match(colregex$1);_&&parse_ws_xml_cols$1(g,_)}d&&parse_ws_xml_data$1(d[1],s,t,l,a,o);var y=u.match(afregex$1);y&&(s["!autofilter"]=parse_ws_xml_autofilter$1(y[0]));var b=[],v=u.match(mergecregex$1);if(v)for(p=0;p!=v.length;++p)b[p]=safe_decode_range$1(v[p].slice(v[p].indexOf('"')+1));var S=u.match(hlinkregex$1);S&&parse_ws_xml_hlinks$1(s,S,n);var w=u.match(marginregex$1);if(w&&(s["!margins"]=parse_ws_xml_margins$1(parsexmltag$1(w[0]))),!s["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(s["!ref"]=encode_range$1(l)),t.sheetRows>0&&s["!ref"]){var T=safe_decode_range$1(s["!ref"]);t.sheetRows<=+T.e.r&&(T.e.r=t.sheetRows-1,T.e.r>l.e.r&&(T.e.r=l.e.r),T.e.r<T.s.r&&(T.s.r=T.e.r),T.e.c>l.e.c&&(T.e.c=l.e.c),T.e.c<T.s.c&&(T.s.c=T.e.c),s["!fullref"]=s["!ref"],s["!ref"]=encode_range$1(T))}return g.length>0&&(s["!cols"]=g),b.length>0&&(s["!merges"]=b),s}function parse_ws_xml_sheetpr$1(e,t,r,n){var i=parsexmltag$1(e);r.Sheets[n]||(r.Sheets[n]={}),i.codeName&&(r.Sheets[n].CodeName=unescapexml$1(utf8read$1(i.codeName)))}function parse_ws_xml_sheetpr2$1(e,t,r,n,i){parse_ws_xml_sheetpr$1(e.slice(0,e.indexOf(">")),r,n,i)}function parse_ws_xml_hlinks$1(e,t,r){for(var n=Array.isArray(e),i=0;i!=t.length;++i){var a=parsexmltag$1(utf8read$1(t[i]),!0);if(!a.ref)return;var o=((r||{})["!id"]||[])[a.id];o?(a.Target=o.Target,a.location&&(a.Target+="#"+unescapexml$1(a.location))):(a.Target="#"+unescapexml$1(a.location),o={Target:a.Target,TargetMode:"Internal"}),a.Rel=o,a.tooltip&&(a.Tooltip=a.tooltip,delete a.tooltip);for(var s=safe_decode_range$1(a.ref),l=s.s.r;l<=s.e.r;++l)for(var c=s.s.c;c<=s.e.c;++c){var u=encode_cell$1({c:c,r:l});n?(e[l]||(e[l]=[]),e[l][c]||(e[l][c]={t:"z",v:void 0}),e[l][c].l=a):(e[u]||(e[u]={t:"z",v:void 0}),e[u].l=a)}}}function parse_ws_xml_margins$1(e){var t={};return["left","right","top","bottom","header","footer"].forEach((function(r){e[r]&&(t[r]=parseFloat(e[r]))})),t}function parse_ws_xml_cols$1(e,t){for(var r=!1,n=0;n!=t.length;++n){var i=parsexmltag$1(t[n],!0);i.hidden&&(i.hidden=parsexmlbool$1(i.hidden));var a=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!r&&i.width&&(r=!0,find_mdw_colw$1(i.width)),process_col$1(i);a<=o;)e[a++]=dup$1(i)}}function parse_ws_xml_autofilter$1(e){return{ref:(e.match(/ref="([^"]*)"/)||[])[1]}}var sviewregex$1=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function parse_ws_xml_sheetviews$1(e,t){t.Views||(t.Views=[{}]),(e.match(sviewregex$1)||[]).forEach((function(e,r){var n=parsexmltag$1(e);t.Views[r]||(t.Views[r]={}),+n.zoomScale&&(t.Views[r].zoom=+n.zoomScale),parsexmlbool$1(n.rightToLeft)&&(t.Views[r].RTL=!0)}))}var parse_ws_xml_data$1=function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,n=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,a=matchtag("v"),o=matchtag("f");return function(s,l,c,u,d,h){for(var p,f,m,g,_,y=0,b="",v=[],S=[],w=0,T=0,E=0,x="",A=0,C=0,R=0,D=0,P=Array.isArray(h.CellXf),I=[],k=[],M=Array.isArray(l),$=[],O={},N=!1,F=!!c.sheetStubs,L=s.split(t),B=0,V=L.length;B!=V;++B){var U=(b=L[B].trim()).length;if(0!==U){var z=0;e:for(y=0;y<U;++y)switch(b[y]){case">":if("/"!=b[y-1]){++y;break e}if(c&&c.cellStyles){if(A=null!=(f=parsexmltag$1(b.slice(z,y),!0)).r?parseInt(f.r,10):A+1,C=-1,c.sheetRows&&c.sheetRows<A)continue;O={},N=!1,f.ht&&(N=!0,O.hpt=parseFloat(f.ht),O.hpx=pt2px$1(O.hpt)),"1"==f.hidden&&(N=!0,O.hidden=!0),null!=f.outlineLevel&&(N=!0,O.level=+f.outlineLevel),N&&($[A-1]=O)}break;case"<":z=y}if(z>=y)break;if(A=null!=(f=parsexmltag$1(b.slice(z,y),!0)).r?parseInt(f.r,10):A+1,C=-1,!(c.sheetRows&&c.sheetRows<A)){u.s.r>A-1&&(u.s.r=A-1),u.e.r<A-1&&(u.e.r=A-1),c&&c.cellStyles&&(O={},N=!1,f.ht&&(N=!0,O.hpt=parseFloat(f.ht),O.hpx=pt2px$1(O.hpt)),"1"==f.hidden&&(N=!0,O.hidden=!0),null!=f.outlineLevel&&(N=!0,O.level=+f.outlineLevel),N&&($[A-1]=O)),v=b.slice(y).split(e);for(var H=0;H!=v.length&&"<"==v[H].trim().charAt(0);++H);for(v=v.slice(H),y=0;y!=v.length;++y)if(0!==(b=v[y].trim()).length){if(S=b.match(r),w=y,T=0,E=0,b="<c "+("<"==b.slice(0,1)?">":"")+b,null!=S&&2===S.length){for(w=0,x=S[1],T=0;T!=x.length&&!((E=x.charCodeAt(T)-64)<1||E>26);++T)w=26*w+E;C=--w}else++C;for(T=0;T!=b.length&&62!==b.charCodeAt(T);++T);if(++T,(f=parsexmltag$1(b.slice(0,T),!0)).r||(f.r=encode_cell$1({r:A-1,c:C})),p={t:""},null!=(S=(x=b.slice(T)).match(a))&&""!==S[1]&&(p.v=unescapexml$1(S[1])),c.cellFormula){if(null!=(S=x.match(o))&&""!==S[1]){if(p.f=unescapexml$1(utf8read$1(S[1])).replace(/\r\n/g,"\n"),c.xlfn||(p.f=_xlfn$1(p.f)),S[0].indexOf('t="array"')>-1)p.F=(x.match(i)||[])[1],p.F.indexOf(":")>-1&&I.push([safe_decode_range$1(p.F),p.F]);else if(S[0].indexOf('t="shared"')>-1){g=parsexmltag$1(S[0]);var j=unescapexml$1(utf8read$1(S[1]));c.xlfn||(j=_xlfn$1(j)),k[parseInt(g.si,10)]=[g,j,f.r]}}else(S=x.match(/<f[^>]*\/>/))&&k[(g=parsexmltag$1(S[0])).si]&&(p.f=shift_formula_xlsx$1(k[g.si][1],k[g.si][2],f.r));var G=decode_cell$1(f.r);for(T=0;T<I.length;++T)G.r>=I[T][0].s.r&&G.r<=I[T][0].e.r&&G.c>=I[T][0].s.c&&G.c<=I[T][0].e.c&&(p.F=I[T][1])}if(null==f.t&&void 0===p.v)if(p.f||p.F)p.v=0,p.t="n";else{if(!F)continue;p.t="z"}else p.t=f.t||"n";switch(u.s.c>C&&(u.s.c=C),u.e.c<C&&(u.e.c=C),p.t){case"n":if(""==p.v||null==p.v){if(!F)continue;p.t="z"}else p.v=parseFloat(p.v);break;case"s":if(void 0===p.v){if(!F)continue;p.t="z"}else m=strs$1[parseInt(p.v,10)],p.v=m.t,p.r=m.r,c.cellHTML&&(p.h=m.h);break;case"str":p.t="s",p.v=null!=p.v?utf8read$1(p.v):"",c.cellHTML&&(p.h=escapehtml$1(p.v));break;case"inlineStr":S=x.match(n),p.t="s",null!=S&&(m=parse_si$1(S[1]))?(p.v=m.t,c.cellHTML&&(p.h=m.h)):p.v="";break;case"b":p.v=parsexmlbool$1(p.v);break;case"d":c.cellDates?p.v=parseDate$1(p.v,1):(p.v=datenum$1(parseDate$1(p.v,1)),p.t="n");break;case"e":c&&!1===c.cellText||(p.w=p.v),p.v=RBErr$1[p.v]}if(R=D=0,_=null,P&&void 0!==f.s&&null!=(_=h.CellXf[f.s])&&(null!=_.numFmtId&&(R=_.numFmtId),c.cellStyles&&null!=_.fillId&&(D=_.fillId)),safe_format$1(p,R,D,c,d,h),c.cellDates&&P&&"n"==p.t&&fmt_is_date$1(table_fmt$1[R])&&(p.t="d",p.v=numdate$1(p.v)),f.cm&&c.xlmeta){var W=(c.xlmeta.Cell||[])[+f.cm-1];W&&"XLDAPR"==W.type&&(p.D=!0)}if(M){var q=decode_cell$1(f.r);l[q.r]||(l[q.r]=[]),l[q.r][q.c]=p}else l[f.r]=p}}}}$.length>0&&(l["!rows"]=$)}}();function parse_BrtRowHdr$1(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var i=e.read_shift(2);e.l+=1;var a=e.read_shift(1);return e.l=n,7&a&&(r.level=7&a),16&a&&(r.hidden=!0),32&a&&(r.hpt=i/20),r}var parse_BrtWsDim$1=parse_UncheckedRfX$1;function parse_BrtWsFmtInfo$1(){}function parse_BrtWsProp$1(e,t){var r={},n=e[e.l];return++e.l,r.above=!(64&n),r.left=!(128&n),e.l+=18,r.name=parse_XLSBCodeName$1(e),r}function parse_BrtCellBlank$1(e){return[parse_XLSBCell$1(e)]}function parse_BrtShortBlank$1(e){return[parse_XLSBShortCell$1(e)]}function parse_BrtCellBool$1(e){return[parse_XLSBCell$1(e),e.read_shift(1),"b"]}function parse_BrtShortBool$1(e){return[parse_XLSBShortCell$1(e),e.read_shift(1),"b"]}function parse_BrtCellError$1(e){return[parse_XLSBCell$1(e),e.read_shift(1),"e"]}function parse_BrtShortError$1(e){return[parse_XLSBShortCell$1(e),e.read_shift(1),"e"]}function parse_BrtCellIsst$1(e){return[parse_XLSBCell$1(e),e.read_shift(4),"s"]}function parse_BrtShortIsst$1(e){return[parse_XLSBShortCell$1(e),e.read_shift(4),"s"]}function parse_BrtCellReal$1(e){return[parse_XLSBCell$1(e),parse_Xnum$1(e),"n"]}function parse_BrtShortReal$1(e){return[parse_XLSBShortCell$1(e),parse_Xnum$1(e),"n"]}function parse_BrtCellRk$1(e){return[parse_XLSBCell$1(e),parse_RkNumber$1(e),"n"]}function parse_BrtShortRk$1(e){return[parse_XLSBShortCell$1(e),parse_RkNumber$1(e),"n"]}function parse_BrtCellRString$1(e){return[parse_XLSBCell$1(e),parse_RichStr$1(e),"is"]}function parse_BrtCellSt$1(e){return[parse_XLSBCell$1(e),parse_XLWideString$1(e),"str"]}function parse_BrtShortSt$1(e){return[parse_XLSBShortCell$1(e),parse_XLWideString$1(e),"str"]}function parse_BrtFmlaBool$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,e.read_shift(1),"b"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}function parse_BrtFmlaError$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,e.read_shift(1),"e"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}function parse_BrtFmlaNum$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,parse_Xnum$1(e),"n"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}function parse_BrtFmlaString$1(e,t,r){var n=e.l+t,i=parse_XLSBCell$1(e);i.r=r["!row"];var a=[i,parse_XLWideString$1(e),"str"];if(r.cellFormula){e.l+=2;var o=parse_XLSBCellParsedFormula$1(e,n-e.l,r);a[3]=stringify_formula$1(o,null,i,r.supbooks,r)}else e.l=n;return a}var parse_BrtMergeCell$1=parse_UncheckedRfX$1;function parse_BrtHLink$1(e,t){var r=e.l+t,n=parse_UncheckedRfX$1(e),i=parse_XLNullableWideString$1(e),a=parse_XLWideString$1(e),o=parse_XLWideString$1(e),s=parse_XLWideString$1(e);e.l=r;var l={rfx:n,relId:i,loc:a,display:s};return o&&(l.Tooltip=o),l}function parse_BrtPane$1(){}function parse_BrtArrFmla$1(e,t,r){var n=e.l+t,i=parse_RfX$1(e),a=e.read_shift(1),o=[i];if(o[2]=a,r.cellFormula){var s=parse_XLSBArrayParsedFormula$1(e,n-e.l,r);o[1]=s}else e.l=n;return o}function parse_BrtShrFmla$1(e,t,r){var n=e.l+t,i=[parse_UncheckedRfX$1(e)];if(r.cellFormula){var a=parse_XLSBSharedParsedFormula$1(e,n-e.l,r);i[1]=a,e.l=n}else e.l=n;return i}var BrtMarginKeys$1=["left","right","top","bottom","header","footer"];function parse_BrtMargins$1(e){var t={};return BrtMarginKeys$1.forEach((function(r){t[r]=parse_Xnum$1(e)})),t}function parse_BrtBeginWsView$1(e){var t=e.read_shift(2);return e.l+=28,{RTL:32&t}}function parse_BrtDVal$1(){}function parse_BrtDVal14$1(){}function parse_ws_bin$1(e,t,r,n,i,a,o){if(!e)return e;var s=t||{};n||(n={"!id":{}});var l,c,u,d,h,p,f,m,g,_,y=s.dense?[]:{},b={s:{r:2e6,c:2e6},e:{r:0,c:0}},v=!1,S=!1,w=[];s.biff=12,s["!row"]=0;var T=0,E=!1,x=[],A={},C=s.supbooks||i.supbooks||[[]];if(C.sharedf=A,C.arrayf=x,C.SheetNames=i.SheetNames||i.Sheets.map((function(e){return e.name})),!s.supbooks&&(s.supbooks=C,i.Names))for(var R=0;R<i.Names.length;++R)C[0][R+1]=i.Names[R];var D,P=[],I=[],k=!1;if(XLSBRecordEnum$1[16]={n:"BrtShortReal",f:parse_BrtShortReal$1},recordhopper$1(e,(function(e,t,R){if(!S)switch(R){case 148:l=e;break;case 0:c=e,s.sheetRows&&s.sheetRows<=c.r&&(S=!0),g=encode_row$1(h=c.r),s["!row"]=c.r,(e.hidden||e.hpt||null!=e.level)&&(e.hpt&&(e.hpx=pt2px$1(e.hpt)),I[e.r]=e);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(u={t:e[2]},e[2]){case"n":u.v=e[1];break;case"s":m=strs$1[e[1]],u.v=m.t,u.r=m.r;break;case"b":u.v=!!e[1];break;case"e":u.v=e[1],!1!==s.cellText&&(u.w=BErr$1[u.v]);break;case"str":u.t="s",u.v=e[1];break;case"is":u.t="s",u.v=e[1].t}if((d=o.CellXf[e[0].iStyleRef])&&safe_format$1(u,d.numFmtId,null,s,a,o),p=-1==e[0].c?p+1:e[0].c,s.dense?(y[h]||(y[h]=[]),y[h][p]=u):y[encode_col$1(p)+g]=u,s.cellFormula){for(E=!1,T=0;T<x.length;++T){var M=x[T];c.r>=M[0].s.r&&c.r<=M[0].e.r&&p>=M[0].s.c&&p<=M[0].e.c&&(u.F=encode_range$1(M[0]),E=!0)}!E&&e.length>3&&(u.f=e[3])}if(b.s.r>c.r&&(b.s.r=c.r),b.s.c>p&&(b.s.c=p),b.e.r<c.r&&(b.e.r=c.r),b.e.c<p&&(b.e.c=p),s.cellDates&&d&&"n"==u.t&&fmt_is_date$1(table_fmt$1[d.numFmtId])){var $=SSF_parse_date_code$1(u.v);$&&(u.t="d",u.v=new Date($.y,$.m-1,$.d,$.H,$.M,$.S,$.u))}D&&("XLDAPR"==D.type&&(u.D=!0),D=void 0);break;case 1:case 12:if(!s.sheetStubs||v)break;u={t:"z",v:void 0},p=-1==e[0].c?p+1:e[0].c,s.dense?(y[h]||(y[h]=[]),y[h][p]=u):y[encode_col$1(p)+g]=u,b.s.r>c.r&&(b.s.r=c.r),b.s.c>p&&(b.s.c=p),b.e.r<c.r&&(b.e.r=c.r),b.e.c<p&&(b.e.c=p),D&&("XLDAPR"==D.type&&(u.D=!0),D=void 0);break;case 176:w.push(e);break;case 49:D=((s.xlmeta||{}).Cell||[])[e-1];break;case 494:var O=n["!id"][e.relId];for(O?(e.Target=O.Target,e.loc&&(e.Target+="#"+e.loc),e.Rel=O):""==e.relId&&(e.Target="#"+e.loc),h=e.rfx.s.r;h<=e.rfx.e.r;++h)for(p=e.rfx.s.c;p<=e.rfx.e.c;++p)s.dense?(y[h]||(y[h]=[]),y[h][p]||(y[h][p]={t:"z",v:void 0}),y[h][p].l=e):(f=encode_cell$1({c:p,r:h}),y[f]||(y[f]={t:"z",v:void 0}),y[f].l=e);break;case 426:if(!s.cellFormula)break;x.push(e),(_=s.dense?y[h][p]:y[encode_col$1(p)+g]).f=stringify_formula$1(e[1],b,{r:c.r,c:p},C,s),_.F=encode_range$1(e[0]);break;case 427:if(!s.cellFormula)break;A[encode_cell$1(e[0].s)]=e[1],(_=s.dense?y[h][p]:y[encode_col$1(p)+g]).f=stringify_formula$1(e[1],b,{r:c.r,c:p},C,s);break;case 60:if(!s.cellStyles)break;for(;e.e>=e.s;)P[e.e--]={width:e.w/256,hidden:!!(1&e.flags),level:e.level},k||(k=!0,find_mdw_colw$1(e.w/256)),process_col$1(P[e.e+1]);break;case 161:y["!autofilter"]={ref:encode_range$1(e)};break;case 476:y["!margins"]=e;break;case 147:i.Sheets[r]||(i.Sheets[r]={}),e.name&&(i.Sheets[r].CodeName=e.name),(e.above||e.left)&&(y["!outline"]={above:e.above,left:e.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),e.RTL&&(i.Views[0].RTL=!0);break;case 485:case 64:case 1053:case 151:case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:case 37:v=!0;break;case 36:case 38:v=!1;break;default:if(t.T);else if(!v||s.WTF)throw new Error("Unexpected record 0x"+R.toString(16))}}),s),delete s.supbooks,delete s["!row"],!y["!ref"]&&(b.s.r<2e6||l&&(l.e.r>0||l.e.c>0||l.s.r>0||l.s.c>0))&&(y["!ref"]=encode_range$1(l||b)),s.sheetRows&&y["!ref"]){var M=safe_decode_range$1(y["!ref"]);s.sheetRows<=+M.e.r&&(M.e.r=s.sheetRows-1,M.e.r>b.e.r&&(M.e.r=b.e.r),M.e.r<M.s.r&&(M.s.r=M.e.r),M.e.c>b.e.c&&(M.e.c=b.e.c),M.e.c<M.s.c&&(M.s.c=M.e.c),y["!fullref"]=y["!ref"],y["!ref"]=encode_range$1(M))}return w.length>0&&(y["!merges"]=w),P.length>0&&(y["!cols"]=P),I.length>0&&(y["!rows"]=I),y}function parse_Cache$1(e){var t,r=[],n=e.match(/^<c:numCache>/);(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm)||[]).forEach((function(e){var t=e.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);t&&(r[+t[1]]=n?+t[2]:t[2])}));var i=unescapexml$1((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(e.match(/<c:f>(.*?)<\/c:f>/gm)||[]).forEach((function(e){t=e.replace(/<.*?>/g,"")})),[r,i,t]}function parse_chart$1(e,t,r,n,i,a){var o=a||{"!type":"chart"};if(!e)return a;var s=0,l=0,c="A",u={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach((function(e){var t=parse_Cache$1(e);u.s.r=u.s.c=0,u.e.c=s,c=encode_col$1(s),t[0].forEach((function(e,r){o[c+encode_row$1(r)]={t:"n",v:e,z:t[1]},l=r})),u.e.r<l&&(u.e.r=l),++s})),s>0&&(o["!ref"]=encode_range$1(u)),o}function parse_cs_xml$1(e,t,r,n,i){if(!e)return e;n||(n={"!id":{}});var a,o={"!type":"chart","!drawel":null,"!rel":""},s=e.match(sheetprregex$1);return s&&parse_ws_xml_sheetpr$1(s[0],o,i,r),(a=e.match(/drawing r:id="(.*?)"/))&&(o["!rel"]=a[1]),n["!id"][o["!rel"]]&&(o["!drawel"]=n["!id"][o["!rel"]]),o}function parse_BrtCsProp$1(e,t){return e.l+=10,{name:parse_XLWideString$1(e)}}function parse_cs_bin$1(e,t,r,n,i){if(!e)return e;n||(n={"!id":{}});var a={"!type":"chart","!drawel":null,"!rel":""},o=!1;return recordhopper$1(e,(function(e,n,s){switch(s){case 550:a["!rel"]=e;break;case 651:i.Sheets[r]||(i.Sheets[r]={}),e.name&&(i.Sheets[r].CodeName=e.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:case 37:case 38:break;case 35:o=!0;break;case 36:o=!1;break;default:if(n.T>0);else if(n.T<0);else if(!o||t.WTF)throw new Error("Unexpected record 0x"+s.toString(16))}}),t),n["!id"][a["!rel"]]&&(a["!drawel"]=n["!id"][a["!rel"]]),a}var WBPropsDef$1=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],WBViewDef$1=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],SheetDef$1=[],CalcPrDef$1=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function push_defaults_array$1(e,t){for(var r=0;r!=e.length;++r)for(var n=e[r],i=0;i!=t.length;++i){var a=t[i];if(null==n[a[0]])n[a[0]]=a[1];else switch(a[2]){case"bool":"string"==typeof n[a[0]]&&(n[a[0]]=parsexmlbool$1(n[a[0]]));break;case"int":"string"==typeof n[a[0]]&&(n[a[0]]=parseInt(n[a[0]],10))}}}function push_defaults$1(e,t){for(var r=0;r!=t.length;++r){var n=t[r];if(null==e[n[0]])e[n[0]]=n[1];else switch(n[2]){case"bool":"string"==typeof e[n[0]]&&(e[n[0]]=parsexmlbool$1(e[n[0]]));break;case"int":"string"==typeof e[n[0]]&&(e[n[0]]=parseInt(e[n[0]],10))}}}function parse_wb_defaults$1(e){push_defaults$1(e.WBProps,WBPropsDef$1),push_defaults$1(e.CalcPr,CalcPrDef$1),push_defaults_array$1(e.WBView,WBViewDef$1),push_defaults_array$1(e.Sheets,SheetDef$1),_ssfopts$1.date1904=parsexmlbool$1(e.WBProps.date1904)}var badchars$1="][*?/\\".split("");function check_ws_name$1(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");return badchars$1.forEach((function(t){if(-1!=e.indexOf(t))throw new Error("Sheet name cannot contain : \\ / ? * [ ]")})),!0}var wbnsregex$1=/<\w+:workbook/;function parse_wb_xml$1(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,i="xmlns",a={},o=0;if(e.replace(tagregex$1,(function(s,l){var c=parsexmltag$1(s);switch(strip_ns$1(c[0])){case"<?xml":case"</workbook>":case"<fileVersion/>":case"</fileVersion>":case"<fileSharing":case"<fileSharing/>":case"</workbookPr>":case"<workbookProtection":case"<workbookProtection/>":case"<bookViews":case"<bookViews>":case"</bookViews>":case"</workbookView>":case"<sheets":case"<sheets>":case"</sheets>":case"</sheet>":case"<functionGroups":case"<functionGroups/>":case"<functionGroup":case"<externalReferences":case"</externalReferences>":case"<externalReferences>":case"<externalReference":case"<definedNames/>":case"<definedName/>":case"</calcPr>":case"<oleSize":case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":case"<customWorkbookView":case"</customWorkbookView>":case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":case"<pivotCache":case"<smartTagPr":case"<smartTagPr/>":case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":case"<smartTagType":case"<webPublishing":case"<webPublishing/>":case"<fileRecoveryPr":case"<fileRecoveryPr/>":case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":case"<webPublishObject":case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":case"<ArchID":case"<revisionPtr":break;case"<workbook":s.match(wbnsregex$1)&&(i="xmlns"+s.match(/<(\w+):/)[1]),r.xmlns=c[i];break;case"<fileVersion":delete c[0],r.AppVersion=c;break;case"<workbookPr":case"<workbookPr/>":WBPropsDef$1.forEach((function(e){if(null!=c[e[0]])switch(e[2]){case"bool":r.WBProps[e[0]]=parsexmlbool$1(c[e[0]]);break;case"int":r.WBProps[e[0]]=parseInt(c[e[0]],10);break;default:r.WBProps[e[0]]=c[e[0]]}})),c.codeName&&(r.WBProps.CodeName=utf8read$1(c.codeName));break;case"<workbookView":case"<workbookView/>":delete c[0],r.WBView.push(c);break;case"<sheet":switch(c.state){case"hidden":c.Hidden=1;break;case"veryHidden":c.Hidden=2;break;default:c.Hidden=0}delete c.state,c.name=unescapexml$1(utf8read$1(c.name)),delete c[0],r.Sheets.push(c);break;case"<definedNames>":case"<definedNames":case"<ext":case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</definedNames>":case"</ext>":case"</AlternateContent>":n=!1;break;case"<definedName":(a={}).Name=utf8read$1(c.name),c.comment&&(a.Comment=c.comment),c.localSheetId&&(a.Sheet=+c.localSheetId),parsexmlbool$1(c.hidden||"0")&&(a.Hidden=!0),o=l+s.length;break;case"</definedName>":a.Ref=unescapexml$1(utf8read$1(e.slice(o,l))),r.Names.push(a);break;case"<calcPr":case"<calcPr/>":delete c[0],r.CalcPr=c;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+c[0]+" in workbook")}return s})),-1===XMLNS_main$1.indexOf(r.xmlns))throw new Error("Unknown Namespace: "+r.xmlns);return parse_wb_defaults$1(r),r}function parse_BrtBundleSh$1(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=parse_RelID$1(e),r.name=parse_XLWideString$1(e),r}function parse_BrtWbProp$1(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var i=t>8?parse_XLWideString$1(e):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(65536&n),r.backupFile=!!(64&n),r.checkCompatibility=!!(4096&n),r.date1904=!!(1&n),r.filterPrivacy=!!(8&n),r.hidePivotFieldList=!!(1024&n),r.promptedSolutions=!!(16&n),r.publishItems=!!(2048&n),r.refreshAllConnections=!!(262144&n),r.saveExternalLinkValues=!!(128&n),r.showBorderUnselectedTables=!!(4&n),r.showInkAnnotation=!!(32&n),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(32768&n),r.updateLinks=["userSet","never","always"][n>>8&3],r}function parse_BrtFRTArchID$$1(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function parse_BrtName$1(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var i=e.read_shift(4),a=parse_XLNameWideString$1(e),o=parse_XLSBNameParsedFormula$1(e,0,r),s=parse_XLNullableWideString$1(e);e.l=n;var l={Name:a,Ptg:o};return i<0xfffffff&&(l.Sheet=i),s&&(l.Comment=s),l}function parse_wb_bin$1(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],i=!1;t||(t={}),t.biff=12;var a=[],o=[[]];return o.SheetNames=[],o.XTI=[],XLSBRecordEnum$1[16]={n:"BrtFRTArchID$",f:parse_BrtFRTArchID$$1},recordhopper$1(e,(function(e,s,l){switch(l){case 156:o.SheetNames.push(e.name),r.Sheets.push(e);break;case 153:r.WBProps=e;break;case 39:null!=e.Sheet&&(t.SID=e.Sheet),e.Ref=stringify_formula$1(e.Ptg,null,null,o,t),delete t.SID,delete e.Ptg,a.push(e);break;case 1036:case 361:case 2071:case 158:case 143:case 664:case 353:case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:case 16:break;case 357:case 358:case 355:case 667:o[0].length?o.push([l,e]):o[0]=[l,e],o[o.length-1].XTI=[];break;case 362:0===o.length&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(e),o.XTI=o.XTI.concat(e);break;case 35:case 37:n.push(l),i=!0;break;case 36:case 38:n.pop(),i=!1;break;default:if(s.T);else if(!i||t.WTF&&37!=n[n.length-1]&&35!=n[n.length-1])throw new Error("Unexpected record 0x"+l.toString(16))}}),t),parse_wb_defaults$1(r),r.Names=a,r.supbooks=o,r}function parse_wb$1(e,t,r){return".bin"===t.slice(-4)?parse_wb_bin$1(e,r):parse_wb_xml$1(e,r)}function parse_ws$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_ws_bin$1(e,n,r,i,a,o,s):parse_ws_xml$1(e,n,r,i,a,o,s)}function parse_cs$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_cs_bin$1(e,n,r,i,a):parse_cs_xml$1(e,n,r,i,a)}function parse_ms$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_ms_bin$1():parse_ms_xml$1()}function parse_ds$1(e,t,r,n,i,a,o,s){return".bin"===t.slice(-4)?parse_ds_bin$1():parse_ds_xml$1()}function parse_sty$1(e,t,r,n){return".bin"===t.slice(-4)?parse_sty_bin$1(e,r,n):parse_sty_xml$1(e,r,n)}function parse_theme(e,t,r){return parse_theme_xml$1(e,r)}function parse_sst$1(e,t,r){return".bin"===t.slice(-4)?parse_sst_bin$1(e,r):parse_sst_xml$1(e,r)}function parse_cmnt$1(e,t,r){return".bin"===t.slice(-4)?parse_comments_bin$1(e,r):parse_comments_xml$1(e,r)}function parse_cc$1(e,t,r){return".bin"===t.slice(-4)?parse_cc_bin$1(e):parse_cc_xml$1(e)}function parse_xlink$1(e,t,r,n){return".bin"===r.slice(-4)?parse_xlink_bin$1(e,t,r,n):parse_xlink_xml$1()}function parse_xlmeta$1(e,t,r){return".bin"===t.slice(-4)?parse_xlmeta_bin$1(e,t,r):parse_xlmeta_xml$1(e,t,r)}var attregexg2$1=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,attregex2$1=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/,XLMLFormatMap$1;function xlml_parsexmltag$1(e,t){var r=e.split(/\s+/),n=[];if(n[0]=r[0],1===r.length)return n;var i,a,o,s=e.match(attregexg2$1);if(s)for(o=0;o!=s.length;++o)-1===(a=(i=s[o].match(attregex2$1))[1].indexOf(":"))?n[i[1]]=i[2].slice(1,i[2].length-1):n["xmlns:"===i[1].slice(0,6)?"xmlns"+i[1].slice(6):i[1].slice(a+1)]=i[2].slice(1,i[2].length-1);return n}function xlml_parsexmltagobj$1(e){var t={};if(1===e.split(/\s+/).length)return t;var r,n,i,a=e.match(attregexg2$1);if(a)for(i=0;i!=a.length;++i)-1===(n=(r=a[i].match(attregex2$1))[1].indexOf(":"))?t[r[1]]=r[2].slice(1,r[2].length-1):t["xmlns:"===r[1].slice(0,6)?"xmlns"+r[1].slice(6):r[1].slice(n+1)]=r[2].slice(1,r[2].length-1);return t}function xlml_format$1(e,t){var r=XLMLFormatMap$1[e]||unescapexml$1(e);return"General"===r?SSF_general$1(t):SSF_format$1(r,t)}function xlml_set_custprop$1(e,t,r,n){var i=n;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=parsexmlbool$1(n);break;case"i2":case"int":i=parseInt(n,10);break;case"r4":case"float":i=parseFloat(n);break;case"date":case"dateTime.tz":i=parseDate$1(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[unescapexml$1(t)]=i}function safe_format_xlml$1(e,t,r){if("z"!==e.t){if(!r||!1!==r.cellText)try{"e"===e.t?e.w=e.w||BErr$1[e.v]:"General"===t?"n"===e.t?(0|e.v)===e.v?e.w=e.v.toString(10):e.w=SSF_general_num$1(e.v):e.w=SSF_general$1(e.v):e.w=xlml_format$1(t||"General",e.v)}catch(a){if(r.WTF)throw a}try{var n=XLMLFormatMap$1[t]||t||"General";if(r.cellNF&&(e.z=n),r.cellDates&&"n"==e.t&&fmt_is_date$1(n)){var i=SSF_parse_date_code$1(e.v);i&&(e.t="d",e.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(a){if(r.WTF)throw a}}}function process_style_xlml$1(e,t,r){if(r.cellStyles&&t.Interior){var n=t.Interior;n.Pattern&&(n.patternType=XLMLPatternTypeMap$1[n.Pattern]||n.Pattern)}e[t.ID]=t}function parse_xlml_data$1(e,t,r,n,i,a,o,s,l,c){var u="General",d=n.StyleID,h={};c=c||{};var p=[],f=0;for(void 0===d&&s&&(d=s.StyleID),void 0===d&&o&&(d=o.StyleID);void 0!==a[d]&&(a[d].nf&&(u=a[d].nf),a[d].Interior&&p.push(a[d].Interior),a[d].Parent);)d=a[d].Parent;switch(r.Type){case"Boolean":n.t="b",n.v=parsexmlbool$1(e);break;case"String":n.t="s",n.r=xlml_fixstr$1(unescapexml$1(e)),n.v=e.indexOf("<")>-1?unescapexml$1(t||e).replace(/<.*?>/g,""):n.r;break;case"DateTime":"Z"!=e.slice(-1)&&(e+="Z"),n.v=(parseDate$1(e)-new Date(Date.UTC(1899,11,30)))/864e5,n.v!=n.v?n.v=unescapexml$1(e):n.v<60&&(n.v=n.v-1),u&&"General"!=u||(u="yyyy-mm-dd");case"Number":void 0===n.v&&(n.v=+e),n.t||(n.t="n");break;case"Error":n.t="e",n.v=RBErr$1[e],!1!==c.cellText&&(n.w=e);break;default:""==e&&""==t?n.t="z":(n.t="s",n.v=xlml_fixstr$1(t||e))}if(safe_format_xlml$1(n,u,c),!1!==c.cellFormula)if(n.Formula){var m=unescapexml$1(n.Formula);61==m.charCodeAt(0)&&(m=m.slice(1)),n.f=rc_to_a1$1(m,i),delete n.Formula,"RC"==n.ArrayRange?n.F=rc_to_a1$1("RC:RC",i):n.ArrayRange&&(n.F=rc_to_a1$1(n.ArrayRange,i),l.push([safe_decode_range$1(n.F),n.F]))}else for(f=0;f<l.length;++f)i.r>=l[f][0].s.r&&i.r<=l[f][0].e.r&&i.c>=l[f][0].s.c&&i.c<=l[f][0].e.c&&(n.F=l[f][1]);c.cellStyles&&(p.forEach((function(e){!h.patternType&&e.patternType&&(h.patternType=e.patternType)})),n.s=h),void 0!==n.StyleID&&(n.ixfe=n.StyleID)}function xlml_clean_comment$1(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e.v=e.w=e.ixfe=void 0}function parse_xlml_xml$1(e,t){var r=t||{};make_ssf$1();var n=debom$1(xlml_normalize$1(e));"binary"!=r.type&&"array"!=r.type&&"base64"!=r.type||(n=utf8read$1(n));var i,a=n.slice(0,1024).toLowerCase(),o=!1;if((1023&(a=a.replace(/".*?"/g,"")).indexOf(">"))>Math.min(1023&a.indexOf(","),1023&a.indexOf(";"))){var s=dup$1(r);return s.type="string",PRN$1.to_workbook(n,s)}if(-1==a.indexOf("<?xml")&&["html","table","head","meta","script","style","div"].forEach((function(e){a.indexOf("<"+e)>=0&&(o=!0)})),o)return html_to_workbook$1(n,r);XLMLFormatMap$1={"General Number":"General","General Date":table_fmt$1[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":table_fmt$1[15],"Short Date":table_fmt$1[14],"Long Time":table_fmt$1[19],"Medium Time":table_fmt$1[18],"Short Time":table_fmt$1[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:table_fmt$1[2],Standard:table_fmt$1[4],Percent:table_fmt$1[10],Scientific:table_fmt$1[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var l,c,u=[],d={},h=[],p=r.dense?[]:{},f="",m={},g={},_=xlml_parsexmltag$1('<Data ss:Type="String">'),y=0,b=0,v=0,S={s:{r:2e6,c:2e6},e:{r:0,c:0}},w={},T={},E="",x=0,A=[],C={},R={},D=0,P=[],I=[],k={},M=[],$=!1,O=[],N=[],F={},L=0,B=0,V={Sheets:[],WBProps:{date1904:!1}},U={};xlmlregex$1.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/gm,"");for(var z="";i=xlmlregex$1.exec(n);)switch(i[3]=(z=i[3]).toLowerCase()){case"data":if("data"==z){if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==i[0].charAt(i[0].length-2)&&u.push([i[3],!0]);break}if(u[u.length-1][1])break;"/"===i[1]?parse_xlml_data$1(n.slice(y,i.index),E,_,"comment"==u[u.length-1][0]?k:m,{c:b,r:v},w,M[b],g,O,r):(E="",_=xlml_parsexmltag$1(i[0]),y=i.index+i[0].length);break;case"cell":if("/"===i[1])if(I.length>0&&(m.c=I),(!r.sheetRows||r.sheetRows>v)&&void 0!==m.v&&(r.dense?(p[v]||(p[v]=[]),p[v][b]=m):p[encode_col$1(b)+encode_row$1(v)]=m),m.HRef&&(m.l={Target:unescapexml$1(m.HRef)},m.HRefScreenTip&&(m.l.Tooltip=m.HRefScreenTip),delete m.HRef,delete m.HRefScreenTip),(m.MergeAcross||m.MergeDown)&&(L=b+(0|parseInt(m.MergeAcross,10)),B=v+(0|parseInt(m.MergeDown,10)),A.push({s:{c:b,r:v},e:{c:L,r:B}})),r.sheetStubs)if(m.MergeAcross||m.MergeDown){for(var H=b;H<=L;++H)for(var j=v;j<=B;++j)(H>b||j>v)&&(r.dense?(p[j]||(p[j]=[]),p[j][H]={t:"z"}):p[encode_col$1(H)+encode_row$1(j)]={t:"z"});b=L+1}else++b;else m.MergeAcross?b=L+1:++b;else(m=xlml_parsexmltagobj$1(i[0])).Index&&(b=+m.Index-1),b<S.s.c&&(S.s.c=b),b>S.e.c&&(S.e.c=b),"/>"===i[0].slice(-2)&&++b,I=[];break;case"row":"/"===i[1]||"/>"===i[0].slice(-2)?(v<S.s.r&&(S.s.r=v),v>S.e.r&&(S.e.r=v),"/>"===i[0].slice(-2)&&(g=xlml_parsexmltag$1(i[0])).Index&&(v=+g.Index-1),b=0,++v):((g=xlml_parsexmltag$1(i[0])).Index&&(v=+g.Index-1),F={},("0"==g.AutoFitHeight||g.Height)&&(F.hpx=parseInt(g.Height,10),F.hpt=px2pt$1(F.hpx),N[v]=F),"1"==g.Hidden&&(F.hidden=!0,N[v]=F));break;case"worksheet":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"));h.push(f),S.s.r<=S.e.r&&S.s.c<=S.e.c&&(p["!ref"]=encode_range$1(S),r.sheetRows&&r.sheetRows<=S.e.r&&(p["!fullref"]=p["!ref"],S.e.r=r.sheetRows-1,p["!ref"]=encode_range$1(S))),A.length&&(p["!merges"]=A),M.length>0&&(p["!cols"]=M),N.length>0&&(p["!rows"]=N),d[f]=p}else S={s:{r:2e6,c:2e6},e:{r:0,c:0}},v=b=0,u.push([i[3],!1]),l=xlml_parsexmltag$1(i[0]),f=unescapexml$1(l.Name),p=r.dense?[]:{},A=[],O=[],N=[],U={name:f,Hidden:0},V.Sheets.push(U);break;case"table":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else{if("/>"==i[0].slice(-2))break;u.push([i[3],!1]),M=[],$=!1}break;case"style":"/"===i[1]?process_style_xlml$1(w,T,r):T=xlml_parsexmltag$1(i[0]);break;case"numberformat":T.nf=unescapexml$1(xlml_parsexmltag$1(i[0]).Format||"General"),XLMLFormatMap$1[T.nf]&&(T.nf=XLMLFormatMap$1[T.nf]);for(var G=0;392!=G&&table_fmt$1[G]!=T.nf;++G);if(392==G)for(G=57;392!=G;++G)if(null==table_fmt$1[G]){SSF_load$1(T.nf,G);break}break;case"column":if("table"!==u[u.length-1][0])break;if((c=xlml_parsexmltag$1(i[0])).Hidden&&(c.hidden=!0,delete c.Hidden),c.Width&&(c.wpx=parseInt(c.Width,10)),!$&&c.wpx>10){$=!0,MDW$1=DEF_MDW$1;for(var W=0;W<M.length;++W)M[W]&&process_col$1(M[W])}$&&process_col$1(c),M[c.Index-1||M.length]=c;for(var q=0;q<+c.Span;++q)M[M.length]=dup$1(c);break;case"namedrange":if("/"===i[1])break;V.Names||(V.Names=[]);var X=parsexmltag$1(i[0]),K={Name:X.Name,Ref:rc_to_a1$1(X.RefersTo.slice(1),{r:0,c:0})};V.Sheets.length>0&&(K.Sheet=V.Sheets.length-1),V.Names.push(K);break;case"namedcell":case"b":case"i":case"u":case"s":case"em":case"h2":case"h3":case"sub":case"sup":case"span":case"alignment":case"borders":case"border":case"protection":case"paragraphs":case"name":case"pixelsperinch":case"null":break;case"font":if("/>"===i[0].slice(-2))break;"/"===i[1]?E+=n.slice(x,i.index):x=i.index+i[0].length;break;case"interior":if(!r.cellStyles)break;T.Interior=xlml_parsexmltag$1(i[0]);break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if("/>"===i[0].slice(-2))break;"/"===i[1]?xlml_set_prop$1(C,z,n.slice(D,i.index)):D=i.index+i[0].length;break;case"styles":case"workbook":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else u.push([i[3],!1]);break;case"comment":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"));xlml_clean_comment$1(k),I.push(k)}else u.push([i[3],!1]),k={a:(l=xlml_parsexmltag$1(i[0])).Author};break;case"autofilter":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else if("/"!==i[0].charAt(i[0].length-2)){var Y=xlml_parsexmltag$1(i[0]);p["!autofilter"]={ref:rc_to_a1$1(Y.Range).replace(/\$/g,"")},u.push([i[3],!0])}break;case"datavalidation":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==i[0].charAt(i[0].length-2)&&u.push([i[3],!0]);break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if("/"===i[1]){if((l=u.pop())[0]!==i[3])throw new Error("Bad state: "+l.join("|"))}else"/"!==i[0].charAt(i[0].length-2)&&u.push([i[3],!0]);break;default:if(0==u.length&&"document"==i[3])return parse_fods$1(n,r);if(0==u.length&&"uof"==i[3])return parse_fods$1(n,r);var J=!0;switch(u[u.length-1][0]){case"officedocumentsettings":switch(i[3]){case"allowpng":case"removepersonalinformation":case"downloadcomponents":case"locationofcomponents":case"colors":case"color":case"index":case"rgb":case"targetscreensize":case"readonlyrecommended":break;default:J=!1}break;case"componentoptions":switch(i[3]){case"toolbar":case"hideofficelogo":case"spreadsheetautofit":case"label":case"caption":case"maxheight":case"maxwidth":case"nextsheetnumber":break;default:J=!1}break;case"excelworkbook":switch(i[3]){case"date1904":V.WBProps.date1904=!0;break;case"windowheight":case"windowwidth":case"windowtopx":case"windowtopy":case"tabratio":case"protectstructure":case"protectwindow":case"protectwindows":case"activesheet":case"displayinknotes":case"firstvisiblesheet":case"supbook":case"sheetname":case"sheetindex":case"sheetindexfirst":case"sheetindexlast":case"dll":case"acceptlabelsinformulas":case"donotsavelinkvalues":case"iteration":case"maxiterations":case"maxchange":case"path":case"xct":case"count":case"selectedsheets":case"calculation":case"uncalced":case"startupprompt":case"crn":case"externname":case"formula":case"colfirst":case"collast":case"wantadvise":case"boolean":case"error":case"text":case"ole":case"noautorecover":case"publishobjects":case"donotcalculatebeforesave":case"number":case"refmoder1c1":case"embedsavesmarttags":break;default:J=!1}break;case"workbookoptions":switch(i[3]){case"owcversion":case"height":case"width":break;default:J=!1}break;case"worksheetoptions":switch(i[3]){case"visible":if("/>"===i[0].slice(-2));else if("/"===i[1])switch(n.slice(D,i.index)){case"SheetHidden":U.Hidden=1;break;case"SheetVeryHidden":U.Hidden=2}else D=i.index+i[0].length;break;case"header":p["!margins"]||default_margins$1(p["!margins"]={},"xlml"),isNaN(+parsexmltag$1(i[0]).Margin)||(p["!margins"].header=+parsexmltag$1(i[0]).Margin);break;case"footer":p["!margins"]||default_margins$1(p["!margins"]={},"xlml"),isNaN(+parsexmltag$1(i[0]).Margin)||(p["!margins"].footer=+parsexmltag$1(i[0]).Margin);break;case"pagemargins":var Z=parsexmltag$1(i[0]);p["!margins"]||default_margins$1(p["!margins"]={},"xlml"),isNaN(+Z.Top)||(p["!margins"].top=+Z.Top),isNaN(+Z.Left)||(p["!margins"].left=+Z.Left),isNaN(+Z.Right)||(p["!margins"].right=+Z.Right),isNaN(+Z.Bottom)||(p["!margins"].bottom=+Z.Bottom);break;case"displayrighttoleft":V.Views||(V.Views=[]),V.Views[0]||(V.Views[0]={}),V.Views[0].RTL=!0;break;case"freezepanes":case"frozennosplit":case"splithorizontal":case"splitvertical":case"donotdisplaygridlines":case"activerow":case"activecol":case"toprowbottompane":case"leftcolumnrightpane":case"unsynced":case"print":case"printerrors":case"panes":case"scale":case"pane":case"number":case"layout":case"pagesetup":case"selected":case"protectobjects":case"enableselection":case"protectscenarios":case"validprinterinfo":case"horizontalresolution":case"verticalresolution":case"numberofcopies":case"activepane":case"toprowvisible":case"leftcolumnvisible":case"fittopage":case"rangeselection":case"papersizeindex":case"pagelayoutzoom":case"pagebreakzoom":case"filteron":case"fitwidth":case"fitheight":case"commentslayout":case"zoom":case"lefttoright":case"gridlines":case"allowsort":case"allowfilter":case"allowinsertrows":case"allowdeleterows":case"allowinsertcols":case"allowdeletecols":case"allowinserthyperlinks":case"allowformatcells":case"allowsizecols":case"allowsizerows":case"tabcolorindex":case"donotdisplayheadings":case"showpagelayoutzoom":case"blackandwhite":case"donotdisplayzeros":case"displaypagebreak":case"rowcolheadings":case"donotdisplayoutline":case"noorientation":case"allowusepivottables":case"zeroheight":case"viewablerange":case"selection":case"protectcontents":break;case"nosummaryrowsbelowdetail":p["!outline"]||(p["!outline"]={}),p["!outline"].above=!0;break;case"nosummarycolumnsrightdetail":p["!outline"]||(p["!outline"]={}),p["!outline"].left=!0;break;default:J=!1}break;case"pivottable":case"pivotcache":switch(i[3]){case"immediateitemsondrop":case"showpagemultipleitemlabel":case"compactrowindent":case"location":case"pivotfield":case"orientation":case"layoutform":case"layoutsubtotallocation":case"layoutcompactrow":case"position":case"pivotitem":case"datatype":case"datafield":case"sourcename":case"parentfield":case"ptlineitems":case"ptlineitem":case"countofsameitems":case"item":case"itemtype":case"ptsource":case"cacheindex":case"consolidationreference":case"filename":case"reference":case"nocolumngrand":case"norowgrand":case"blanklineafteritems":case"hidden":case"subtotal":case"basefield":case"mapchilditems":case"function":case"refreshonfileopen":case"printsettitles":case"mergelabels":case"defaultversion":case"refreshname":case"refreshdate":case"refreshdatecopy":case"versionlastrefresh":case"versionlastupdate":case"versionupdateablemin":case"versionrefreshablemin":case"calculation":break;default:J=!1}break;case"pagebreaks":switch(i[3]){case"colbreaks":case"colbreak":case"rowbreaks":case"rowbreak":case"colstart":case"colend":case"rowend":break;default:J=!1}break;case"autofilter":switch(i[3]){case"autofiltercolumn":case"autofiltercondition":case"autofilterand":case"autofilteror":break;default:J=!1}break;case"querytable":switch(i[3]){case"id":case"autoformatfont":case"autoformatpattern":case"querysource":case"querytype":case"enableredirections":case"refreshedinxl9":case"urlstring":case"htmltables":case"connection":case"commandtext":case"refreshinfo":case"notitles":case"nextid":case"columninfo":case"overwritecells":case"donotpromptforfile":case"textwizardsettings":case"source":case"number":case"decimal":case"thousandseparator":case"trailingminusnumbers":case"formatsettings":case"fieldtype":case"delimiters":case"tab":case"comma":case"autoformatname":case"versionlastedit":case"versionlastrefresh":break;default:J=!1}break;case"datavalidation":switch(i[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":case"cellrangelist":break;default:J=!1}break;case"sorting":case"conditionalformatting":switch(i[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"cellrangelist":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":break;default:J=!1}break;case"mapinfo":case"schema":case"data":switch(i[3]){case"map":case"entry":case"range":case"xpath":case"field":case"xsdtype":case"filteron":case"aggregate":case"elementtype":case"attributetype":case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":case"row":break;default:J=!1}break;case"smarttags":break;default:J=!1}if(J)break;if(i[3].match(/!\[CDATA/))break;if(!u[u.length-1][1])throw"Unrecognized tag: "+i[3]+"|"+u.join("|");if("customdocumentproperties"===u[u.length-1][0]){if("/>"===i[0].slice(-2))break;"/"===i[1]?xlml_set_custprop$1(R,z,P,n.slice(D,i.index)):(P=i,D=i.index+i[0].length);break}if(r.WTF)throw"Unrecognized tag: "+i[3]+"|"+u.join("|")}var Q={};return r.bookSheets||r.bookProps||(Q.Sheets=d),Q.SheetNames=h,Q.Workbook=V,Q.SSF=dup$1(table_fmt$1),Q.Props=C,Q.Custprops=R,Q}function parse_xlml$1(e,t){switch(fix_read_opts$1(t=t||{}),t.type||"base64"){case"base64":return parse_xlml_xml$1(Base64_decode$1(e),t);case"binary":case"buffer":case"file":return parse_xlml_xml$1(e,t);case"array":return parse_xlml_xml$1(a2s$1(e),t)}}function parse_compobj$1(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=parse_ClipboardFormatOrAnsiString$1(r),r.length-r.l<=4)return t;var n=r.read_shift(4);return 0==n||n>40?t:(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4||0x71b239f4!==(n=r.read_shift(4))?t:(t.UnicodeClipboardFormat=parse_ClipboardFormatOrUnicodeString$1(r),0==(n=r.read_shift(4))||n>40?t:(r.l-=4,void(t.Reserved2=r.read_shift(0,"lpwstr")))))}var CONTINUE_RT$1=[60,1084,2066,2165,2175];function slurp$1(e,t,r,n,i){var a=n,o=[],s=r.slice(r.l,r.l+a);if(i&&i.enc&&i.enc.insitu&&s.length>0)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:case 133:break;default:i.enc.insitu(s)}o.push(s),r.l+=a;for(var l=__readUInt16LE$1(r,r.l),c=XLSRecordEnum$1[l],u=0;null!=c&&CONTINUE_RT$1.indexOf(l)>-1;)a=__readUInt16LE$1(r,r.l+2),u=r.l+4,2066==l?u+=4:2165!=l&&2175!=l||(u+=12),s=r.slice(u,r.l+4+a),o.push(s),r.l+=4+a,c=XLSRecordEnum$1[l=__readUInt16LE$1(r,r.l)];var d=bconcat$1(o);prep_blob$1(d,0);var h=0;d.lens=[];for(var p=0;p<o.length;++p)d.lens.push(h),h+=o[p].length;if(d.length<n)throw"XLS Record 0x"+e.toString(16)+" Truncated: "+d.length+" < "+n;return t.f(d,d.length,i)}function safe_format_xf$1(e,t,r){if("z"!==e.t&&e.XF){var n=0;try{n=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=table_fmt$1[n])}catch(a){if(t.WTF)throw a}if(!t||!1!==t.cellText)try{"e"===e.t?e.w=e.w||BErr$1[e.v]:0===n||"General"==n?"n"===e.t?(0|e.v)===e.v?e.w=e.v.toString(10):e.w=SSF_general_num$1(e.v):e.w=SSF_general$1(e.v):e.w=SSF_format$1(n,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(a){if(t.WTF)throw a}if(t.cellDates&&n&&"n"==e.t&&fmt_is_date$1(table_fmt$1[n]||String(n))){var i=SSF_parse_date_code$1(e.v);i&&(e.t="d",e.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}}function make_cell$1(e,t,r){return{v:e,ixfe:t,t:r}}function parse_workbook$1(e,t){var r,n,i,a,o,s,l,c,u={opts:{}},d={},h=t.dense?[]:{},p={},f={},m=null,g=[],_="",y={},b="",v={},S=[],w=[],T=[],E={Sheets:[],WBProps:{date1904:!1},Views:[{}]},x={},A=function(e){return e<8?XLSIcv$1[e]:e<64&&T[e-8]||XLSIcv$1[e]},C=function(e,t,n){if(!(F>1||n.sheetRows&&e.r>=n.sheetRows)){if(n.cellStyles&&t.XF&&t.XF.data&&function(e,t,r){var n,i=t.XF.data;i&&i.patternType&&r&&r.cellStyles&&(t.s={},t.s.patternType=i.patternType,(n=rgb2Hex$1(A(i.icvFore)))&&(t.s.fgColor={rgb:n}),(n=rgb2Hex$1(A(i.icvBack)))&&(t.s.bgColor={rgb:n}))}(0,t,n),delete t.ixfe,delete t.XF,r=e,b=encode_cell$1(e),f&&f.s&&f.e||(f={s:{r:0,c:0},e:{r:0,c:0}}),e.r<f.s.r&&(f.s.r=e.r),e.c<f.s.c&&(f.s.c=e.c),e.r+1>f.e.r&&(f.e.r=e.r+1),e.c+1>f.e.c&&(f.e.c=e.c+1),n.cellFormula&&t.f)for(var i=0;i<S.length;++i)if(!(S[i][0].s.c>e.c||S[i][0].s.r>e.r||S[i][0].e.c<e.c||S[i][0].e.r<e.r)){t.F=encode_range$1(S[i][0]),S[i][0].s.c==e.c&&S[i][0].s.r==e.r||delete t.f,t.f&&(t.f=""+stringify_formula$1(S[i][1],f,e,$,R));break}n.dense?(h[e.r]||(h[e.r]=[]),h[e.r][e.c]=t):h[b]=t}},R={enc:!1,sbcch:0,snames:[],sharedf:v,arrayf:S,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf};t.password&&(R.password=t.password);var D=[],P=[],I=[],k=[],M=!1,$=[];$.SheetNames=R.snames,$.sharedf=R.sharedf,$.arrayf=R.arrayf,$.names=[],$.XTI=[];var O,N=0,F=0,L=0,B=[],V=[];R.codepage=1200,set_cp$1(1200);for(var U=!1;e.l<e.length-1;){var z=e.l,H=e.read_shift(2);if(0===H&&10===N)break;var j=e.l===e.length?0:e.read_shift(2),G=XLSRecordEnum$1[H];if(G&&G.f){if(t.bookSheets&&133===N&&133!==H)break;if(N=H,2===G.r||12==G.r){var W=e.read_shift(2);if(j-=2,!R.enc&&W!==H&&((255&W)<<8|W>>8)!==H)throw new Error("rt mismatch: "+W+"!="+H);12==G.r&&(e.l+=10,j-=10)}var q={};if(q=10===H?G.f(e,j,R):slurp$1(H,G,e,j,R),0==F&&-1===[9,521,1033,2057].indexOf(N))continue;switch(H){case 34:u.opts.Date1904=E.WBProps.date1904=q;break;case 134:u.opts.WriteProtect=!0;break;case 47:if(R.enc||(e.l=0),R.enc=q,!t.password)throw new Error("File is password-protected");if(null==q.valid)throw new Error("Encryption scheme unsupported");if(!q.valid)throw new Error("Password is incorrect");break;case 92:R.lastuser=q;break;case 66:var X=Number(q);switch(X){case 21010:X=1200;break;case 32768:X=1e4;break;case 32769:X=1252}set_cp$1(R.codepage=X),U=!0;break;case 317:R.rrtabid=q;break;case 25:R.winlocked=q;break;case 439:u.opts.RefreshAll=q;break;case 12:u.opts.CalcCount=q;break;case 16:u.opts.CalcDelta=q;break;case 17:u.opts.CalcIter=q;break;case 13:u.opts.CalcMode=q;break;case 14:u.opts.CalcPrecision=q;break;case 95:u.opts.CalcSaveRecalc=q;break;case 15:R.CalcRefMode=q;break;case 2211:u.opts.FullCalc=q;break;case 129:q.fDialog&&(h["!type"]="dialog"),q.fBelow||((h["!outline"]||(h["!outline"]={})).above=!0),q.fRight||((h["!outline"]||(h["!outline"]={})).left=!0);break;case 224:w.push(q);break;case 430:$.push([q]),$[$.length-1].XTI=[];break;case 35:case 547:$[$.length-1].push(q);break;case 24:case 536:O={Name:q.Name,Ref:stringify_formula$1(q.rgce,f,null,$,R)},q.itab>0&&(O.Sheet=q.itab-1),$.names.push(O),$[0]||($[0]=[],$[0].XTI=[]),$[$.length-1].push(q),"_xlnm._FilterDatabase"==q.Name&&q.itab>0&&q.rgce&&q.rgce[0]&&q.rgce[0][0]&&"PtgArea3d"==q.rgce[0][0][0]&&(V[q.itab-1]={ref:encode_range$1(q.rgce[0][0][1][2])});break;case 22:R.ExternCount=q;break;case 23:0==$.length&&($[0]=[],$[0].XTI=[]),$[$.length-1].XTI=$[$.length-1].XTI.concat(q),$.XTI=$.XTI.concat(q);break;case 2196:if(R.biff<8)break;null!=O&&(O.Comment=q[1]);break;case 18:h["!protect"]=q;break;case 19:0!==q&&R.WTF&&console.error("Password verifier: "+q);break;case 133:p[q.pos]=q,R.snames.push(q.name);break;case 10:if(--F)break;if(f.e){if(f.e.r>0&&f.e.c>0){if(f.e.r--,f.e.c--,h["!ref"]=encode_range$1(f),t.sheetRows&&t.sheetRows<=f.e.r){var K=f.e.r;f.e.r=t.sheetRows-1,h["!fullref"]=h["!ref"],h["!ref"]=encode_range$1(f),f.e.r=K}f.e.r++,f.e.c++}D.length>0&&(h["!merges"]=D),P.length>0&&(h["!objects"]=P),I.length>0&&(h["!cols"]=I),k.length>0&&(h["!rows"]=k),E.Sheets.push(x)}""===_?y=h:d[_]=h,h=t.dense?[]:{};break;case 9:case 521:case 1033:case 2057:if(8===R.biff&&(R.biff={9:2,521:3,1033:4}[H]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[q.BIFFVer]||8),R.biffguess=0==q.BIFFVer,0==q.BIFFVer&&4096==q.dt&&(R.biff=5,U=!0,set_cp$1(R.codepage=28591)),8==R.biff&&0==q.BIFFVer&&16==q.dt&&(R.biff=2),F++)break;if(h=t.dense?[]:{},R.biff<8&&!U&&(U=!0,set_cp$1(R.codepage=t.codepage||1252)),R.biff<5||0==q.BIFFVer&&4096==q.dt){""===_&&(_="Sheet1"),f={s:{r:0,c:0},e:{r:0,c:0}};var Y={pos:e.l-j,name:_};p[Y.pos]=Y,R.snames.push(_)}else _=(p[z]||{name:""}).name;32==q.dt&&(h["!type"]="chart"),64==q.dt&&(h["!type"]="macro"),D=[],P=[],R.arrayf=S=[],I=[],k=[],M=!1,x={Hidden:(p[z]||{hs:0}).hs,name:_};break;case 515:case 3:case 2:"chart"==h["!type"]&&(t.dense?(h[q.r]||[])[q.c]:h[encode_cell$1({c:q.c,r:q.r})])&&++q.c,s={ixfe:q.ixfe,XF:w[q.ixfe]||{},v:q.val,t:"n"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 5:case 517:s={ixfe:q.ixfe,XF:w[q.ixfe],v:q.val,t:q.t},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 638:s={ixfe:q.ixfe,XF:w[q.ixfe],v:q.rknum,t:"n"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 189:for(var J=q.c;J<=q.C;++J){var Z=q.rkrec[J-q.c][0];s={ixfe:Z,XF:w[Z],v:q.rkrec[J-q.c][1],t:"n"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:J,r:q.r},s,t)}break;case 6:case 518:case 1030:if("String"==q.val){m=q;break}if((s=make_cell$1(q.val,q.cell.ixfe,q.tt)).XF=w[s.ixfe],t.cellFormula){var Q=q.formula;if(Q&&Q[0]&&Q[0][0]&&"PtgExp"==Q[0][0][0]){var ee=Q[0][0][1][0],te=Q[0][0][1][1],re=encode_cell$1({r:ee,c:te});v[re]?s.f=""+stringify_formula$1(q.formula,f,q.cell,$,R):s.F=((t.dense?(h[ee]||[])[te]:h[re])||{}).F}else s.f=""+stringify_formula$1(q.formula,f,q.cell,$,R)}L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C(q.cell,s,t),m=q;break;case 7:case 519:if(!m)throw new Error("String record expects Formula");m.val=q,(s=make_cell$1(q,m.cell.ixfe,"s")).XF=w[s.ixfe],t.cellFormula&&(s.f=""+stringify_formula$1(m.formula,f,m.cell,$,R)),L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C(m.cell,s,t),m=null;break;case 33:case 545:S.push(q);var ne=encode_cell$1(q[0].s);if(n=t.dense?(h[q[0].s.r]||[])[q[0].s.c]:h[ne],t.cellFormula&&n){if(!m)break;if(!ne||!n)break;n.f=""+stringify_formula$1(q[1],f,q[0],$,R),n.F=encode_range$1(q[0])}break;case 1212:if(!t.cellFormula)break;if(b){if(!m)break;v[encode_cell$1(m.cell)]=q[0],((n=t.dense?(h[m.cell.r]||[])[m.cell.c]:h[encode_cell$1(m.cell)])||{}).f=""+stringify_formula$1(q[0],f,r,$,R)}break;case 253:s=make_cell$1(g[q.isst].t,q.ixfe,"s"),g[q.isst].h&&(s.h=g[q.isst].h),s.XF=w[s.ixfe],L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 513:t.sheetStubs&&(s={ixfe:q.ixfe,XF:w[q.ixfe],t:"z"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t));break;case 190:if(t.sheetStubs)for(var ie=q.c;ie<=q.C;++ie){var ae=q.ixfe[ie-q.c];s={ixfe:ae,XF:w[ae],t:"z"},L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:ie,r:q.r},s,t)}break;case 214:case 516:case 4:(s=make_cell$1(q.val,q.ixfe,"s")).XF=w[s.ixfe],L>0&&(s.z=B[s.ixfe>>8&63]),safe_format_xf$1(s,t,u.opts.Date1904),C({c:q.c,r:q.r},s,t);break;case 0:case 512:1===F&&(f=q);break;case 252:g=q;break;case 1054:if(4==R.biff){B[L++]=q[1];for(var oe=0;oe<L+163&&table_fmt$1[oe]!=q[1];++oe);oe>=163&&SSF_load$1(q[1],L+163)}else SSF_load$1(q[1],q[0]);break;case 30:B[L++]=q;for(var se=0;se<L+163&&table_fmt$1[se]!=q;++se);se>=163&&SSF_load$1(q,L+163);break;case 229:D=D.concat(q);break;case 93:P[q.cmo[0]]=R.lastobj=q;break;case 438:R.lastobj.TxO=q;break;case 127:R.lastobj.ImData=q;break;case 440:for(o=q[0].s.r;o<=q[0].e.r;++o)for(a=q[0].s.c;a<=q[0].e.c;++a)(n=t.dense?(h[o]||[])[a]:h[encode_cell$1({c:a,r:o})])&&(n.l=q[1]);break;case 2048:for(o=q[0].s.r;o<=q[0].e.r;++o)for(a=q[0].s.c;a<=q[0].e.c;++a)(n=t.dense?(h[o]||[])[a]:h[encode_cell$1({c:a,r:o})])&&n.l&&(n.l.Tooltip=q[1]);break;case 28:if(R.biff<=5&&R.biff>=2)break;n=t.dense?(h[q[0].r]||[])[q[0].c]:h[encode_cell$1(q[0])];var le=P[q[2]];n||(t.dense?(h[q[0].r]||(h[q[0].r]=[]),n=h[q[0].r][q[0].c]={t:"z"}):n=h[encode_cell$1(q[0])]={t:"z"},f.e.r=Math.max(f.e.r,q[0].r),f.s.r=Math.min(f.s.r,q[0].r),f.e.c=Math.max(f.e.c,q[0].c),f.s.c=Math.min(f.s.c,q[0].c)),n.c||(n.c=[]),i={a:q[1],t:le.TxO.t},n.c.push(i);break;case 2173:update_xfext$1(w[q.ixfe],q.ext);break;case 125:if(!R.cellStyles)break;for(;q.e>=q.s;)I[q.e--]={width:q.w/256,level:q.level||0,hidden:!!(1&q.flags)},M||(M=!0,find_mdw_colw$1(q.w/256)),process_col$1(I[q.e+1]);break;case 520:var ce={};null!=q.level&&(k[q.r]=ce,ce.level=q.level),q.hidden&&(k[q.r]=ce,ce.hidden=!0),q.hpt&&(k[q.r]=ce,ce.hpt=q.hpt,ce.hpx=pt2px$1(q.hpt));break;case 38:case 39:case 40:case 41:h["!margins"]||default_margins$1(h["!margins"]={}),h["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[H]]=q;break;case 161:h["!margins"]||default_margins$1(h["!margins"]={}),h["!margins"].header=q.header,h["!margins"].footer=q.footer;break;case 574:q.RTL&&(E.Views[0].RTL=!0);break;case 146:T=q;break;case 2198:c=q;break;case 140:l=q;break;case 442:_?x.CodeName=q||x.name:E.WBProps.CodeName=q||"ThisWorkbook"}}else G||console.error("Missing Info for XLS Record 0x"+H.toString(16)),e.l+=j}return u.SheetNames=keys$4(p).sort((function(e,t){return Number(e)-Number(t)})).map((function(e){return p[e].name})),t.bookSheets||(u.Sheets=d),!u.SheetNames.length&&y["!ref"]?(u.SheetNames.push("Sheet1"),u.Sheets&&(u.Sheets.Sheet1=y)):u.Preamble=y,u.Sheets&&V.forEach((function(e,t){u.Sheets[u.SheetNames[t]]["!autofilter"]=e})),u.Strings=g,u.SSF=dup$1(table_fmt$1),R.enc&&(u.Encryption=R.enc),c&&(u.Themes=c),u.Metadata={},void 0!==l&&(u.Metadata.Country=l),$.names.length>0&&(E.Names=$.names),u.Workbook=E,u}var PSCLSID$1={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function parse_xls_props$1(e,t,r){var n=CFB$1.find(e,"/!DocumentSummaryInformation");if(n&&n.size>0)try{var i=parse_PropertySetStream$1(n,DocSummaryPIDDSI$1,PSCLSID$1.DSI);for(var a in i)t[a]=i[a]}catch(c){if(r.WTF)throw c}var o=CFB$1.find(e,"/!SummaryInformation");if(o&&o.size>0)try{var s=parse_PropertySetStream$1(o,SummaryPIDSI$1,PSCLSID$1.SI);for(var l in s)null==t[l]&&(t[l]=s[l])}catch(c){if(r.WTF)throw c}t.HeadingPairs&&t.TitlesOfParts&&(load_props_pairs$1(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function parse_xlscfb$1(e,t){var r,n,i,a;if(t||(t={}),fix_read_opts$1(t),reset_cp$1(),t.codepage&&set_ansi$1(t.codepage),e.FullPaths){if(CFB$1.find(e,"/encryption"))throw new Error("File is password-protected");r=CFB$1.find(e,"!CompObj"),n=CFB$1.find(e,"/Workbook")||CFB$1.find(e,"/Book")}else{switch(t.type){case"base64":e=s2a$1(Base64_decode$1(e));break;case"binary":e=s2a$1(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e))}prep_blob$1(e,0),n={content:e}}if(r&&parse_compobj$1(r),t.bookProps&&!t.bookSheets)i={};else{var o=has_buf$1?"buffer":"array";if(n&&n.content)i=parse_workbook$1(n.content,t);else if((a=CFB$1.find(e,"PerfectOffice_MAIN"))&&a.content)i=WK_$1.to_workbook(a.content,(t.type=o,t));else{if(!(a=CFB$1.find(e,"NativeContent_MAIN"))||!a.content)throw(a=CFB$1.find(e,"MN0"))&&a.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");i=WK_$1.to_workbook(a.content,(t.type=o,t))}t.bookVBA&&e.FullPaths&&CFB$1.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=make_vba_xls$1(e))}var s={};return e.FullPaths&&parse_xls_props$1(e,s,t),i.Props=i.Custprops=s,t.bookFiles&&(i.cfb=e),i}var XLSBRecordEnum$1={0:{f:parse_BrtRowHdr$1},1:{f:parse_BrtCellBlank$1},2:{f:parse_BrtCellRk$1},3:{f:parse_BrtCellError$1},4:{f:parse_BrtCellBool$1},5:{f:parse_BrtCellReal$1},6:{f:parse_BrtCellSt$1},7:{f:parse_BrtCellIsst$1},8:{f:parse_BrtFmlaString$1},9:{f:parse_BrtFmlaNum$1},10:{f:parse_BrtFmlaBool$1},11:{f:parse_BrtFmlaError$1},12:{f:parse_BrtShortBlank$1},13:{f:parse_BrtShortRk$1},14:{f:parse_BrtShortError$1},15:{f:parse_BrtShortBool$1},16:{f:parse_BrtShortReal$1},17:{f:parse_BrtShortSt$1},18:{f:parse_BrtShortIsst$1},19:{f:parse_RichStr$1},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:parse_BrtName$1},40:{},42:{},43:{f:parse_BrtFont$1},44:{f:parse_BrtFmt$1},45:{f:parse_BrtFill$1},46:{f:parse_BrtBorder$1},47:{f:parse_BrtXF$1},48:{},49:{f:parse_Int32LE$1},50:{},51:{f:parse_BrtMdb$1},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:parse_ColInfo$1},62:{f:parse_BrtCellRString$1},63:{f:parse_BrtCalcChainItem$$1},64:{f:parse_BrtDVal$1},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:parsenoop$1,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:parse_BrtBeginWsView$1},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:parse_BrtWsProp$1},148:{f:parse_BrtWsDim$1,p:16},151:{f:parse_BrtPane$1},152:{},153:{f:parse_BrtWbProp$1},154:{},155:{},156:{f:parse_BrtBundleSh$1},157:{},158:{},159:{T:1,f:parse_BrtBeginSst$1},160:{T:-1},161:{T:1,f:parse_UncheckedRfX$1},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:parse_BrtMergeCell$1},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:parse_BrtMdtinfo$1},336:{T:-1},337:{f:parse_BrtBeginEsmdb$1,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:parse_RelID$1},357:{},358:{},359:{},360:{T:1},361:{},362:{f:parse_ExternSheet$1},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:parse_BrtArrFmla$1},427:{f:parse_BrtShrFmla$1},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:parse_BrtMargins$1},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:parse_BrtWsFmtInfo$1},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:parse_BrtHLink$1},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:parse_RelID$1},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:parse_BrtCommentAuthor$1},633:{T:1},634:{T:-1},635:{T:1,f:parse_BrtBeginComment$1},636:{T:-1},637:{f:parse_BrtCommentText$1},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:parse_BrtCsProp$1},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:parse_BrtDVal14$1},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},XLSRecordEnum$1={6:{f:parse_Formula$1},10:{f:parsenoop2$1},12:{f:parseuint16$1},13:{f:parseuint16$1},14:{f:parsebool$1},15:{f:parsebool$1},16:{f:parse_Xnum$1},17:{f:parsebool$1},18:{f:parsebool$1},19:{f:parseuint16$1},20:{f:parse_XLHeaderFooter$1},21:{f:parse_XLHeaderFooter$1},23:{f:parse_ExternSheet$1},24:{f:parse_Lbl$1},25:{f:parsebool$1},26:{},27:{},28:{f:parse_Note$1},29:{},34:{f:parsebool$1},35:{f:parse_ExternName$1},38:{f:parse_Xnum$1},39:{f:parse_Xnum$1},40:{f:parse_Xnum$1},41:{f:parse_Xnum$1},42:{f:parsebool$1},43:{f:parsebool$1},47:{f:parse_FilePass$1},49:{f:parse_Font$1},51:{f:parseuint16$1},60:{},61:{f:parse_Window1$1},64:{f:parsebool$1},65:{f:parse_Pane$1},66:{f:parseuint16$1},77:{},80:{},81:{},82:{},85:{f:parseuint16$1},89:{},90:{},91:{},92:{f:parse_WriteAccess$1},93:{f:parse_Obj$1},94:{},95:{f:parsebool$1},96:{},97:{},99:{f:parsebool$1},125:{f:parse_ColInfo$1},128:{f:parse_Guts$1},129:{f:parse_WsBool$1},130:{f:parseuint16$1},131:{f:parsebool$1},132:{f:parsebool$1},133:{f:parse_BoundSheet8$1},134:{},140:{f:parse_Country$1},141:{f:parseuint16$1},144:{},146:{f:parse_Palette$1},151:{},152:{},153:{},154:{},155:{},156:{f:parseuint16$1},157:{},158:{},160:{f:parse_Scl$1},161:{f:parse_Setup$1},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:parse_MulRk$1},190:{f:parse_MulBlank$1},193:{f:parsenoop2$1},197:{},198:{},199:{},200:{},201:{},202:{f:parsebool$1},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:parseuint16$1},220:{},221:{f:parsebool$1},222:{},224:{f:parse_XF$1},225:{f:parse_InterfaceHdr$1},226:{f:parsenoop2$1},227:{},229:{f:parse_MergeCells$1},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:parse_SST$1},253:{f:parse_LabelSst$1},255:{f:parse_ExtSST$1},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:parseuint16a$1},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:parsebool$1},353:{f:parsenoop2$1},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:parse_SupBook$1},431:{f:parsebool$1},432:{},433:{},434:{},437:{},438:{f:parse_TxO$1},439:{f:parsebool$1},440:{f:parse_HLink$1},441:{},442:{f:parse_XLUnicodeString$1},443:{},444:{f:parseuint16$1},445:{},446:{},448:{f:parsenoop2$1},449:{f:parse_RecalcId$1,r:2},450:{f:parsenoop2$1},512:{f:parse_Dimensions$1},513:{f:parse_Blank$1},515:{f:parse_Number$1},516:{f:parse_Label$1},517:{f:parse_BoolErr$1},519:{f:parse_String$1},520:{f:parse_Row$1},523:{},545:{f:parse_Array$1},549:{f:parse_DefaultRowHeight$1},566:{},574:{f:parse_Window2$1},638:{f:parse_RK$1},659:{},1048:{},1054:{f:parse_Format$1},1084:{},1212:{f:parse_ShrFmla$1},2048:{f:parse_HLinkTooltip$1},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:parse_BOF$1},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:parsenoop2$1},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:parse_XFCRC$1,r:12},2173:{f:parse_XFExt$1,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:parsebool$1,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:parse_NameCmt$1,r:12},2197:{},2198:{f:parse_Theme$1,r:12},2199:{},2200:{},2201:{},2202:{f:parse_MTRSettings$1,r:12},2203:{f:parsenoop2$1},2204:{},2205:{},2206:{},2207:{},2211:{f:parse_ForceFullCalculation$1},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:parseuint16$1},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:parse_ShtProps$1},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:parse_ClrtClient$1},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:parse_Dimensions$1},1:{},2:{f:parse_BIFF2INT$1},3:{f:parse_BIFF2NUM$1},4:{f:parse_BIFF2STR$1},5:{f:parse_BoolErr$1},7:{f:parse_BIFF2STRING$1},8:{},9:{f:parse_BOF$1},11:{},22:{f:parseuint16$1},30:{f:parse_BIFF2Format$1},31:{},32:{},33:{f:parse_Array$1},36:{},37:{f:parse_DefaultRowHeight$1},50:{f:parse_BIFF2FONTXTRA$1},62:{},52:{},67:{},68:{f:parseuint16$1},69:{},86:{},126:{},127:{f:parse_ImData$1},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:parse_RString$1},223:{},234:{},354:{},421:{},518:{f:parse_Formula$1},521:{f:parse_BOF$1},536:{f:parse_Lbl$1},547:{f:parse_ExternName$1},561:{},579:{},1030:{f:parse_Formula$1},1033:{f:parse_BOF$1},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function write_biff_rec$1(e,t,r,n){var i=t;if(!isNaN(i)){var a=(r||[]).length||0,o=e.next(4);o.write_shift(2,i),o.write_shift(2,a),a>0&&is_buf$1(r)&&e.push(r)}}function html_to_sheet$1(e,t){var r=t||{},n=r.dense?[]:{},i=(e=e.replace(/<!--.*?-->/g,"")).match(/<table/i);if(!i)throw new Error("Invalid HTML: could not find <table>");var a=e.match(/<\/table/i),o=i.index,s=a&&a.index||e.length,l=split_regex$1(e.slice(o,s),/(:?<tr[^>]*>)/i,"<tr>"),c=-1,u=0,d=0,h=0,p={s:{r:1e7,c:1e7},e:{r:0,c:0}},f=[];for(o=0;o<l.length;++o){var m=l[o].trim(),g=m.slice(0,3).toLowerCase();if("<tr"!=g){if("<td"==g||"<th"==g){var _=m.split(/<\/t[dh]>/i);for(s=0;s<_.length;++s){var y=_[s].trim();if(y.match(/<t[dh]/i)){for(var b=y,v=0;"<"==b.charAt(0)&&(v=b.indexOf(">"))>-1;)b=b.slice(v+1);for(var S=0;S<f.length;++S){var w=f[S];w.s.c==u&&w.s.r<c&&c<=w.e.r&&(u=w.e.c+1,S=-1)}var T=parsexmltag$1(y.slice(0,y.indexOf(">")));h=T.colspan?+T.colspan:1,((d=+T.rowspan)>1||h>1)&&f.push({s:{r:c,c:u},e:{r:c+(d||1)-1,c:u+h-1}});var E=T.t||T["data-t"]||"";if(b.length)if(b=htmldecode$1(b),p.s.r>c&&(p.s.r=c),p.e.r<c&&(p.e.r=c),p.s.c>u&&(p.s.c=u),p.e.c<u&&(p.e.c=u),b.length){var x={t:"s",v:b};r.raw||!b.trim().length||"s"==E||("TRUE"===b?x={t:"b",v:!0}:"FALSE"===b?x={t:"b",v:!1}:isNaN(fuzzynum$1(b))?isNaN(fuzzydate$1(b).getDate())||(x={t:"d",v:parseDate$1(b)},r.cellDates||(x={t:"n",v:datenum$1(x.v)}),x.z=r.dateNF||table_fmt$1[14]):x={t:"n",v:fuzzynum$1(b)}),r.dense?(n[c]||(n[c]=[]),n[c][u]=x):n[encode_cell$1({r:c,c:u})]=x,u+=h}else u+=h;else u+=h}}}}else{if(++c,r.sheetRows&&r.sheetRows<=c){--c;break}u=0}}return n["!ref"]=encode_range$1(p),f.length&&(n["!merges"]=f),n}function make_html_row$1(e,t,r,n){for(var i=e["!merges"]||[],a=[],o=t.s.c;o<=t.e.c;++o){for(var s=0,l=0,c=0;c<i.length;++c)if(!(i[c].s.r>r||i[c].s.c>o||i[c].e.r<r||i[c].e.c<o)){if(i[c].s.r<r||i[c].s.c<o){s=-1;break}s=i[c].e.r-i[c].s.r+1,l=i[c].e.c-i[c].s.c+1;break}if(!(s<0)){var u=encode_cell$1({r:r,c:o}),d=n.dense?(e[r]||[])[o]:e[u],h=d&&null!=d.v&&(d.h||escapehtml$1(d.w||(format_cell$1(d),d.w)||""))||"",p={};s>1&&(p.rowspan=s),l>1&&(p.colspan=l),n.editable?h='<span contenteditable="true">'+h+"</span>":d&&(p["data-t"]=d&&d.t||"z",null!=d.v&&(p["data-v"]=d.v),null!=d.z&&(p["data-z"]=d.z),d.l&&"#"!=(d.l.Target||"#").charAt(0)&&(h='<a href="'+d.l.Target+'">'+h+"</a>")),p.id=(n.id||"sjs")+"-"+u,a.push(writextag$1("td",h,p))}}return"<tr>"+a.join("")+"</tr>"}var HTML_BEGIN$1='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',HTML_END$1="</body></html>";function html_to_workbook$1(e,t){var r=e.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||0==r.length)throw new Error("Invalid HTML: could not find <table>");if(1==r.length)return sheet_to_workbook$1(html_to_sheet$1(r[0],t),t);var n=book_new$1();return r.forEach((function(e,r){book_append_sheet$1(n,html_to_sheet$1(e,t),"Sheet"+(r+1))})),n}function make_html_preamble$1(e,t,r){return[].join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function sheet_to_html$1(e,t){var r=t||{},n=null!=r.header?r.header:HTML_BEGIN$1,i=null!=r.footer?r.footer:HTML_END$1,a=[n],o=decode_range$1(e["!ref"]);r.dense=Array.isArray(e),a.push(make_html_preamble$1(e,o,r));for(var s=o.s.r;s<=o.e.r;++s)a.push(make_html_row$1(e,o,s,r));return a.push("</table>"+i),a.join("")}function sheet_add_dom$1(e,t,r){var n=r||{},i=0,a=0;if(null!=n.origin)if("number"==typeof n.origin)i=n.origin;else{var o="string"==typeof n.origin?decode_cell$1(n.origin):n.origin;i=o.r,a=o.c}var s=t.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,s.length),c={s:{r:0,c:0},e:{r:i,c:a}};if(e["!ref"]){var u=decode_range$1(e["!ref"]);c.s.r=Math.min(c.s.r,u.s.r),c.s.c=Math.min(c.s.c,u.s.c),c.e.r=Math.max(c.e.r,u.e.r),c.e.c=Math.max(c.e.c,u.e.c),-1==i&&(c.e.r=i=u.e.r+1)}var d=[],h=0,p=e["!rows"]||(e["!rows"]=[]),f=0,m=0,g=0,_=0,y=0,b=0;for(e["!cols"]||(e["!cols"]=[]);f<s.length&&m<l;++f){var v=s[f];if(is_dom_element_hidden$1(v)){if(n.display)continue;p[m]={hidden:!0}}var S=v.children;for(g=_=0;g<S.length;++g){var w=S[g];if(!n.display||!is_dom_element_hidden$1(w)){var T=w.hasAttribute("data-v")?w.getAttribute("data-v"):w.hasAttribute("v")?w.getAttribute("v"):htmldecode$1(w.innerHTML),E=w.getAttribute("data-z")||w.getAttribute("z");for(h=0;h<d.length;++h){var x=d[h];x.s.c==_+a&&x.s.r<m+i&&m+i<=x.e.r&&(_=x.e.c+1-a,h=-1)}b=+w.getAttribute("colspan")||1,((y=+w.getAttribute("rowspan")||1)>1||b>1)&&d.push({s:{r:m+i,c:_+a},e:{r:m+i+(y||1)-1,c:_+a+(b||1)-1}});var A={t:"s",v:T},C=w.getAttribute("data-t")||w.getAttribute("t")||"";null!=T&&(0==T.length?A.t=C||"z":n.raw||0==T.trim().length||"s"==C||("TRUE"===T?A={t:"b",v:!0}:"FALSE"===T?A={t:"b",v:!1}:isNaN(fuzzynum$1(T))?isNaN(fuzzydate$1(T).getDate())||(A={t:"d",v:parseDate$1(T)},n.cellDates||(A={t:"n",v:datenum$1(A.v)}),A.z=n.dateNF||table_fmt$1[14]):A={t:"n",v:fuzzynum$1(T)})),void 0===A.z&&null!=E&&(A.z=E);var R="",D=w.getElementsByTagName("A");if(D&&D.length)for(var P=0;P<D.length&&(!D[P].hasAttribute("href")||"#"==(R=D[P].getAttribute("href")).charAt(0));++P);R&&"#"!=R.charAt(0)&&(A.l={Target:R}),n.dense?(e[m+i]||(e[m+i]=[]),e[m+i][_+a]=A):e[encode_cell$1({c:_+a,r:m+i})]=A,c.e.c<_+a&&(c.e.c=_+a),_+=b}}++m}return d.length&&(e["!merges"]=(e["!merges"]||[]).concat(d)),c.e.r=Math.max(c.e.r,m-1+i),e["!ref"]=encode_range$1(c),m>=l&&(e["!fullref"]=encode_range$1((c.e.r=s.length-f+m-1+i,c))),e}function parse_dom_table$1(e,t){return sheet_add_dom$1((t||{}).dense?[]:{},e,t)}function table_to_book$1(e,t){return sheet_to_workbook$1(parse_dom_table$1(e,t),t)}function is_dom_element_hidden$1(e){var t="",r=get_get_computed_style_function$1(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),"none"===t}function get_get_computed_style_function$1(e){return e.ownerDocument.defaultView&&"function"==typeof e.ownerDocument.defaultView.getComputedStyle?e.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null}function parse_text_p$1(e){var t=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,(function(e,t){return Array(parseInt(t,10)+1).join(" ")})).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,"\n");return[unescapexml$1(t.replace(/<[^>]*>/g,""))]}var number_formats_ods={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function parse_content_xml$1(e,t){var r,n,i,a,o,s,l=t||{},c=xlml_normalize$1(e),u=[],d={name:""},h="",p=0,f={},m=[],g=l.dense?[]:{},_={value:""},y="",b=0,v=[],S=-1,w=-1,T={s:{r:1e6,c:1e7},e:{r:0,c:0}},E=0,x={},A=[],C={},R=[],D=1,P=1,I=[],k={Names:[]},M={},$=["",""],O=[],N={},F="",L=0,B=!1,V=!1,U=0;for(xlmlregex$1.lastIndex=0,c=c.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");o=xlmlregex$1.exec(c);)switch(o[3]=o[3].replace(/_.*$/,"")){case"table":case"工作表":"/"===o[1]?(T.e.c>=T.s.c&&T.e.r>=T.s.r?g["!ref"]=encode_range$1(T):g["!ref"]="A1:A1",l.sheetRows>0&&l.sheetRows<=T.e.r&&(g["!fullref"]=g["!ref"],T.e.r=l.sheetRows-1,g["!ref"]=encode_range$1(T)),A.length&&(g["!merges"]=A),R.length&&(g["!rows"]=R),i.name=i["名称"]||i.name,"undefined"!=typeof JSON&&JSON.stringify(i),m.push(i.name),f[i.name]=g,V=!1):"/"!==o[0].charAt(o[0].length-2)&&(i=parsexmltag$1(o[0],!1),S=w=-1,T.s.r=T.s.c=1e7,T.e.r=T.e.c=0,g=l.dense?[]:{},A=[],R=[],V=!0);break;case"table-row-group":"/"===o[1]?--E:++E;break;case"table-row":case"行":if("/"===o[1]){S+=D,D=1;break}if((a=parsexmltag$1(o[0],!1))["行号"]?S=a["行号"]-1:-1==S&&(S=0),(D=+a["number-rows-repeated"]||1)<10)for(U=0;U<D;++U)E>0&&(R[S+U]={level:E});w=-1;break;case"covered-table-cell":"/"!==o[1]&&++w,l.sheetStubs&&(l.dense?(g[S]||(g[S]=[]),g[S][w]={t:"z"}):g[encode_cell$1({r:S,c:w})]={t:"z"}),y="",v=[];break;case"table-cell":case"数据":if("/"===o[0].charAt(o[0].length-2))++w,_=parsexmltag$1(o[0],!1),P=parseInt(_["number-columns-repeated"]||"1",10),s={t:"z",v:null},_.formula&&0!=l.cellFormula&&(s.f=ods_to_csf_formula$1(unescapexml$1(_.formula))),"string"==(_["数据类型"]||_["value-type"])&&(s.t="s",s.v=unescapexml$1(_["string-value"]||""),l.dense?(g[S]||(g[S]=[]),g[S][w]=s):g[encode_cell$1({r:S,c:w})]=s),w+=P-1;else if("/"!==o[1]){y="",b=0,v=[],P=1;var z=D?S+D-1:S;if(++w>T.e.c&&(T.e.c=w),w<T.s.c&&(T.s.c=w),S<T.s.r&&(T.s.r=S),z>T.e.r&&(T.e.r=z),O=[],N={},s={t:(_=parsexmltag$1(o[0],!1))["数据类型"]||_["value-type"],v:null},l.cellFormula)if(_.formula&&(_.formula=unescapexml$1(_.formula)),_["number-matrix-columns-spanned"]&&_["number-matrix-rows-spanned"]&&(C={s:{r:S,c:w},e:{r:S+(parseInt(_["number-matrix-rows-spanned"],10)||0)-1,c:w+(parseInt(_["number-matrix-columns-spanned"],10)||0)-1}},s.F=encode_range$1(C),I.push([C,s.F])),_.formula)s.f=ods_to_csf_formula$1(_.formula);else for(U=0;U<I.length;++U)S>=I[U][0].s.r&&S<=I[U][0].e.r&&w>=I[U][0].s.c&&w<=I[U][0].e.c&&(s.F=I[U][1]);switch((_["number-columns-spanned"]||_["number-rows-spanned"])&&(C={s:{r:S,c:w},e:{r:S+(parseInt(_["number-rows-spanned"],10)||0)-1,c:w+(parseInt(_["number-columns-spanned"],10)||0)-1}},A.push(C)),_["number-columns-repeated"]&&(P=parseInt(_["number-columns-repeated"],10)),s.t){case"boolean":s.t="b",s.v=parsexmlbool$1(_["boolean-value"]);break;case"float":case"percentage":case"currency":s.t="n",s.v=parseFloat(_.value);break;case"date":s.t="d",s.v=parseDate$1(_["date-value"]),l.cellDates||(s.t="n",s.v=datenum$1(s.v)),s.z="m/d/yy";break;case"time":s.t="n",s.v=parse_isodur$1(_["time-value"])/86400,l.cellDates&&(s.t="d",s.v=numdate$1(s.v)),s.z="HH:MM:SS";break;case"number":s.t="n",s.v=parseFloat(_["数据数值"]);break;default:if("string"!==s.t&&"text"!==s.t&&s.t)throw new Error("Unsupported value type "+s.t);s.t="s",null!=_["string-value"]&&(y=unescapexml$1(_["string-value"]),v=[])}}else{if(B=!1,"s"===s.t&&(s.v=y||"",v.length&&(s.R=v),B=0==b),M.Target&&(s.l=M),O.length>0&&(s.c=O,O=[]),y&&!1!==l.cellText&&(s.w=y),B&&(s.t="z",delete s.v),(!B||l.sheetStubs)&&!(l.sheetRows&&l.sheetRows<=S))for(var H=0;H<D;++H){if(P=parseInt(_["number-columns-repeated"]||"1",10),l.dense)for(g[S+H]||(g[S+H]=[]),g[S+H][w]=0==H?s:dup$1(s);--P>0;)g[S+H][w+P]=dup$1(s);else for(g[encode_cell$1({r:S+H,c:w})]=s;--P>0;)g[encode_cell$1({r:S+H,c:w+P})]=dup$1(s);T.e.c<=w&&(T.e.c=w)}w+=(P=parseInt(_["number-columns-repeated"]||"1",10))-1,P=0,s={},y="",v=[]}M={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if("/"===o[1]){if((r=u.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&u.push([o[3],!0]);break;case"annotation":if("/"===o[1]){if((r=u.pop())[0]!==o[3])throw"Bad state: "+r;N.t=y,v.length&&(N.R=v),N.a=F,O.push(N)}else"/"!==o[0].charAt(o[0].length-2)&&u.push([o[3],!1]);F="",L=0,y="",b=0,v=[];break;case"creator":"/"===o[1]?F=c.slice(L,o.index):L=o.index+o[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if("/"===o[1]){if((r=u.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&u.push([o[3],!1]);y="",b=0,v=[];break;case"scientific-number":case"currency-symbol":case"currency-style":case"script":case"libraries":case"automatic-styles":case"default-style":case"page-layout":case"style":case"map":case"font-face":case"paragraph-properties":case"table-properties":case"table-column-properties":case"table-row-properties":case"table-cell-properties":case"fraction":case"boolean-style":case"boolean":case"text-style":case"text-content":case"text-properties":case"embedded-text":case"body":case"电子表格":case"forms":case"table-column":case"table-header-rows":case"table-rows":case"table-column-group":case"table-header-columns":case"table-columns":case"null-date":case"graphic-properties":case"calculation-settings":case"named-expressions":case"label-range":case"label-ranges":case"named-expression":case"sort":case"sort-by":case"sort-groups":case"tab":case"line-break":case"span":case"s":case"date":case"object":case"title":case"标题":case"desc":case"binary-data":case"table-source":case"scenario":case"iteration":case"content-validations":case"content-validation":case"help-message":case"error-message":case"database-ranges":case"filter":case"filter-and":case"filter-or":case"filter-condition":case"list-level-style-bullet":case"list-level-style-number":case"list-level-properties":case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":case"event-listener":case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":case"config-item":case"page-number":case"page-count":case"time":case"cell-range-source":case"detective":case"operation":case"highlighted-range":case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":case"rect":case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":case"properties":case"property":case"table-protection":case"data-pilot-grand-total":case"office-document-common-attrs":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if("/"===o[1]){if(x[d.name]=h,(r=u.pop())[0]!==o[3])throw"Bad state: "+r}else"/"!==o[0].charAt(o[0].length-2)&&(h="",d=parsexmltag$1(o[0],!1),u.push([o[3],!0]));break;case"number":case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(u[u.length-1][0]){case"time-style":case"date-style":n=parsexmltag$1(o[0],!1),h+=number_formats_ods[o[3]]["long"===n.style?1:0]}break;case"text":if("/>"===o[0].slice(-2))break;if("/"===o[1])switch(u[u.length-1][0]){case"number-style":case"date-style":case"time-style":h+=c.slice(p,o.index)}else p=o.index+o[0].length;break;case"named-range":$=ods_to_csf_3D$1((n=parsexmltag$1(o[0],!1))["cell-range-address"]);var j={Name:n.name,Ref:$[0]+"!"+$[1]};V&&(j.Sheet=m.length),k.Names.push(j);break;case"p":case"文本串":if(["master-styles"].indexOf(u[u.length-1][0])>-1)break;if("/"!==o[1]||_&&_["string-value"])parsexmltag$1(o[0],!1),b=o.index+o[0].length;else{var G=parse_text_p$1(c.slice(b,o.index));y=(y.length>0?y+"\n":"")+G[0]}break;case"database-range":if("/"===o[1])break;try{f[($=ods_to_csf_3D$1(parsexmltag$1(o[0])["target-range-address"]))[0]]["!autofilter"]={ref:$[1]}}catch(q){}break;case"a":if("/"!==o[1]){if(!(M=parsexmltag$1(o[0],!1)).href)break;M.Target=unescapexml$1(M.href),delete M.href,"#"==M.Target.charAt(0)&&M.Target.indexOf(".")>-1?($=ods_to_csf_3D$1(M.Target.slice(1)),M.Target="#"+$[0]+"!"+$[1]):M.Target.match(/^\.\.[\\\/]/)&&(M.Target=M.Target.slice(3))}break;default:switch(o[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(l.WTF)throw new Error(o)}}var W={Sheets:f,SheetNames:m,Workbook:k};return l.bookSheets&&delete W.Sheets,W}function parse_ods$1(e,t){t=t||{},safegetzipfile$1(e,"META-INF/manifest.xml")&&parse_manifest$1(getzipdata$1(e,"META-INF/manifest.xml"),t);var r=getzipstr$1(e,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var n=parse_content_xml$1(utf8read$1(r),t);return safegetzipfile$1(e,"meta.xml")&&(n.Props=parse_core_props$1(getzipdata$1(e,"meta.xml"))),n}function parse_fods$1(e,t){return parse_content_xml$1(e,t)}function u8_to_dataview$1(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u8str$1(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):utf8read$1(a2s$1(e))}function u8concat$1(e){var t=e.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(t),n=0;return e.forEach((function(e){r.set(e,n),n+=e.length})),r}function popcnt$1(e){return 0x1010101*((e=(0x33333333&(e-=e>>1&0x55555555))+(e>>2&0x33333333))+(e>>4)&0xf0f0f0f)>>>24}function readDecimal128LE$1(e,t){for(var r=(127&e[t+15])<<7|e[t+14]>>1,n=1&e[t+14],i=t+13;i>=t;--i)n=256*n+e[i];return(128&e[t+15]?-n:n)*Math.pow(10,r-6176)}function parse_varint49$1(e,t){var r=t?t[0]:0,n=127&e[r];e:if(e[r++]>=128){if(n|=(127&e[r])<<7,e[r++]<128)break e;if(n|=(127&e[r])<<14,e[r++]<128)break e;if(n|=(127&e[r])<<21,e[r++]<128)break e;if(n+=(127&e[r])*Math.pow(2,28),++r,e[r++]<128)break e;if(n+=(127&e[r])*Math.pow(2,35),++r,e[r++]<128)break e;if(n+=(127&e[r])*Math.pow(2,42),++r,e[r++]<128)break e}return t&&(t[0]=r),n}function varint_to_i32$1(e){var t=0,r=127&e[t];e:if(e[t++]>=128){if(r|=(127&e[t])<<7,e[t++]<128)break e;if(r|=(127&e[t])<<14,e[t++]<128)break e;if(r|=(127&e[t])<<21,e[t++]<128)break e;r|=(127&e[t])<<28}return r}function parse_shallow$1(e){for(var t=[],r=[0];r[0]<e.length;){var n,i=r[0],a=parse_varint49$1(e,r),o=7&a,s=0;if(0==(a=Math.floor(a/8)))break;switch(o){case 0:for(var l=r[0];e[r[0]++]>=128;);n=e.slice(l,r[0]);break;case 5:s=4,n=e.slice(r[0],r[0]+s),r[0]+=s;break;case 1:s=8,n=e.slice(r[0],r[0]+s),r[0]+=s;break;case 2:s=parse_varint49$1(e,r),n=e.slice(r[0],r[0]+s),r[0]+=s;break;default:throw new Error("PB Type ".concat(o," for Field ").concat(a," at offset ").concat(i))}var c={data:n,type:o};null==t[a]?t[a]=[c]:t[a].push(c)}return t}function mappa$1(e,t){return(null==e?void 0:e.map((function(e){return t(e.data)})))||[]}function parse_iwa_file$1(e){for(var t,r=[],n=[0];n[0]<e.length;){var i=parse_varint49$1(e,n),a=parse_shallow$1(e.slice(n[0],n[0]+i));n[0]+=i;var o={id:varint_to_i32$1(a[1][0].data),messages:[]};a[2].forEach((function(t){var r=parse_shallow$1(t.data),i=varint_to_i32$1(r[3][0].data);o.messages.push({meta:r,data:e.slice(n[0],n[0]+i)}),n[0]+=i})),(null==(t=a[3])?void 0:t[0])&&(o.merge=varint_to_i32$1(a[3][0].data)>>>0>0),r.push(o)}return r}function parse_snappy_chunk$1(e,t){if(0!=e)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=parse_varint49$1(t,r),i=[];r[0]<t.length;){var a=3&t[r[0]];if(0!=a){var o=0,s=0;if(1==a?(s=4+(t[r[0]]>>2&7),o=(224&t[r[0]++])<<3,o|=t[r[0]++]):(s=1+(t[r[0]++]>>2),2==a?(o=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(o=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[u8concat$1(i)],0==o)throw new Error("Invalid offset 0");if(o>i[0].length)throw new Error("Invalid offset beyond length");if(s>=o)for(i.push(i[0].slice(-o)),s-=o;s>=i[i.length-1].length;)i.push(i[i.length-1]),s-=i[i.length-1].length;i.push(i[0].slice(-o,-o+s))}else{var l=t[r[0]++]>>2;if(l<60)++l;else{var c=l-59;l=t[r[0]],c>1&&(l|=t[r[0]+1]<<8),c>2&&(l|=t[r[0]+2]<<16),c>3&&(l|=t[r[0]+3]<<24),l>>>=0,l++,r[0]+=c}i.push(t.slice(r[0],r[0]+l)),r[0]+=l}}var u=u8concat$1(i);if(u.length!=n)throw new Error("Unexpected length: ".concat(u.length," != ").concat(n));return u}function decompress_iwa_file$1(e){for(var t=[],r=0;r<e.length;){var n=e[r++],i=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(parse_snappy_chunk$1(n,e.slice(r,r+i))),r+=i}if(r!==e.length)throw new Error("data is not a valid framed stream!");return u8concat$1(t)}function parse_old_storage$1(e,t,r,n){var i,a=u8_to_dataview$1(e),o=a.getUint32(4,!0),s=(n>1?12:8)+4*popcnt$1(o&(n>1?3470:398)),l=-1,c=-1,u=NaN,d=new Date(2001,0,1);switch(512&o&&(l=a.getUint32(s,!0),s+=4),s+=4*popcnt$1(o&(n>1?12288:4096)),16&o&&(c=a.getUint32(s,!0),s+=4),32&o&&(u=a.getFloat64(s,!0),s+=8),64&o&&(d.setTime(d.getTime()+1e3*a.getFloat64(s,!0)),s+=8),e[2]){case 0:break;case 2:i={t:"n",v:u};break;case 3:i={t:"s",v:t[c]};break;case 5:i={t:"d",v:d};break;case 6:i={t:"b",v:u>0};break;case 7:i={t:"n",v:u/86400};break;case 8:i={t:"e",v:0};break;case 9:if(l>-1)i={t:"s",v:r[l]};else if(c>-1)i={t:"s",v:t[c]};else{if(isNaN(u))throw new Error("Unsupported cell type ".concat(e.slice(0,4)));i={t:"n",v:u}}break;default:throw new Error("Unsupported cell type ".concat(e.slice(0,4)))}return i}function parse_new_storage$1(e,t,r){var n,i=u8_to_dataview$1(e),a=i.getUint32(8,!0),o=12,s=-1,l=-1,c=NaN,u=NaN,d=new Date(2001,0,1);switch(1&a&&(c=readDecimal128LE$1(e,o),o+=16),2&a&&(u=i.getFloat64(o,!0),o+=8),4&a&&(d.setTime(d.getTime()+1e3*i.getFloat64(o,!0)),o+=8),8&a&&(l=i.getUint32(o,!0),o+=4),16&a&&(s=i.getUint32(o,!0),o+=4),e[1]){case 0:break;case 2:case 10:n={t:"n",v:c};break;case 3:n={t:"s",v:t[l]};break;case 5:n={t:"d",v:d};break;case 6:n={t:"b",v:u>0};break;case 7:n={t:"n",v:u/86400};break;case 8:n={t:"e",v:0};break;case 9:if(!(s>-1))throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(31&a," : ").concat(e.slice(0,4)));n={t:"s",v:r[s]};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(31&a," : ").concat(e.slice(0,4)))}return n}function parse_cell_storage$1(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:return parse_old_storage$1(e,t,r,e[0]);case 5:return parse_new_storage$1(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function parse_TSP_Reference$1(e){return parse_varint49$1(parse_shallow$1(e)[1][0].data)}function parse_TST_TableDataList$1(e,t){var r=parse_shallow$1(t.data),n=varint_to_i32$1(r[1][0].data),i=r[3],a=[];return(i||[]).forEach((function(t){var r=parse_shallow$1(t.data),i=varint_to_i32$1(r[1][0].data)>>>0;switch(n){case 1:a[i]=u8str$1(r[3][0].data);break;case 8:var o=parse_shallow$1(e[parse_TSP_Reference$1(r[9][0].data)][0].data),s=e[parse_TSP_Reference$1(o[1][0].data)][0],l=varint_to_i32$1(s.meta[1][0].data);if(2001!=l)throw new Error("2000 unexpected reference to ".concat(l));var c=parse_shallow$1(s.data);a[i]=c[3].map((function(e){return u8str$1(e.data)})).join("")}})),a}function parse_TST_TileRowInfo$1(e,t){var r,n,i,a,o,s,l,c,u,d,h,p,f,m,g,_,y=parse_shallow$1(e),b=varint_to_i32$1(y[1][0].data)>>>0,v=varint_to_i32$1(y[2][0].data)>>>0,S=(null==(n=null==(r=y[8])?void 0:r[0])?void 0:n.data)&&varint_to_i32$1(y[8][0].data)>0||!1;if((null==(a=null==(i=y[7])?void 0:i[0])?void 0:a.data)&&0!=t)g=null==(s=null==(o=y[7])?void 0:o[0])?void 0:s.data,_=null==(c=null==(l=y[6])?void 0:l[0])?void 0:c.data;else{if(!(null==(d=null==(u=y[4])?void 0:u[0])?void 0:d.data)||1==t)throw"NUMBERS Tile missing ".concat(t," cell storage");g=null==(p=null==(h=y[4])?void 0:h[0])?void 0:p.data,_=null==(m=null==(f=y[3])?void 0:f[0])?void 0:m.data}for(var w=S?4:1,T=u8_to_dataview$1(g),E=[],x=0;x<g.length/2;++x){var A=T.getUint16(2*x,!0);A<65535&&E.push([x,A])}if(E.length!=v)throw"Expected ".concat(v," cells, found ").concat(E.length);var C=[];for(x=0;x<E.length-1;++x)C[E[x][0]]=_.subarray(E[x][1]*w,E[x+1][1]*w);return E.length>=1&&(C[E[E.length-1][0]]=_.subarray(E[E.length-1][1]*w)),{R:b,cells:C}}function parse_TST_Tile$1(e,t){var r,n=parse_shallow$1(t.data),i=(null==(r=null==n?void 0:n[7])?void 0:r[0])?varint_to_i32$1(n[7][0].data)>>>0>0?1:0:-1,a=mappa$1(n[5],(function(e){return parse_TST_TileRowInfo$1(e,i)}));return{nrows:varint_to_i32$1(n[4][0].data)>>>0,data:a.reduce((function(e,t){return e[t.R]||(e[t.R]=[]),t.cells.forEach((function(r,n){if(e[t.R][n])throw new Error("Duplicate cell r=".concat(t.R," c=").concat(n));e[t.R][n]=r})),e}),[])}}function parse_TST_TableModelArchive$1(e,t,r){var n,i=parse_shallow$1(t.data),a={s:{r:0,c:0},e:{r:0,c:0}};if(a.e.r=(varint_to_i32$1(i[6][0].data)>>>0)-1,a.e.r<0)throw new Error("Invalid row varint ".concat(i[6][0].data));if(a.e.c=(varint_to_i32$1(i[7][0].data)>>>0)-1,a.e.c<0)throw new Error("Invalid col varint ".concat(i[7][0].data));r["!ref"]=encode_range$1(a);var o=parse_shallow$1(i[4][0].data),s=parse_TST_TableDataList$1(e,e[parse_TSP_Reference$1(o[4][0].data)][0]),l=(null==(n=o[17])?void 0:n[0])?parse_TST_TableDataList$1(e,e[parse_TSP_Reference$1(o[17][0].data)][0]):[],c=parse_shallow$1(o[3][0].data),u=0;c[1].forEach((function(t){var n=parse_shallow$1(t.data),i=e[parse_TSP_Reference$1(n[2][0].data)][0],a=varint_to_i32$1(i.meta[1][0].data);if(6002!=a)throw new Error("6001 unexpected reference to ".concat(a));var o=parse_TST_Tile$1(e,i);o.data.forEach((function(e,t){e.forEach((function(e,n){var i=encode_cell$1({r:u+t,c:n}),a=parse_cell_storage$1(e,s,l);a&&(r[i]=a)}))})),u+=o.nrows}))}function parse_TST_TableInfoArchive$1(e,t){var r={"!ref":"A1"},n=e[parse_TSP_Reference$1(parse_shallow$1(t.data)[2][0].data)],i=varint_to_i32$1(n[0].meta[1][0].data);if(6001!=i)throw new Error("6000 unexpected reference to ".concat(i));return parse_TST_TableModelArchive$1(e,n[0],r),r}function parse_TN_SheetArchive$1(e,t){var r,n=parse_shallow$1(t.data),i={name:(null==(r=n[1])?void 0:r[0])?u8str$1(n[1][0].data):"",sheets:[]};return mappa$1(n[2],parse_TSP_Reference$1).forEach((function(t){e[t].forEach((function(t){6e3==varint_to_i32$1(t.meta[1][0].data)&&i.sheets.push(parse_TST_TableInfoArchive$1(e,t))}))})),i}function parse_TN_DocumentArchive$1(e,t){var r=book_new$1();if(mappa$1(parse_shallow$1(t.data)[1],parse_TSP_Reference$1).forEach((function(t){e[t].forEach((function(t){if(2==varint_to_i32$1(t.meta[1][0].data)){var n=parse_TN_SheetArchive$1(e,t);n.sheets.forEach((function(e,t){book_append_sheet$1(r,e,0==t?n.name:n.name+"_"+t,!0)}))}}))})),0==r.SheetNames.length)throw new Error("Empty NUMBERS file");return r}function parse_numbers_iwa$1(e){var t,r,n,i,a={},o=[];if(e.FullPaths.forEach((function(e){if(e.match(/\.iwpv2/))throw new Error("Unsupported password protection")})),e.FileIndex.forEach((function(e){if(e.name.match(/\.iwa$/)){var t,r;try{t=decompress_iwa_file$1(e.content)}catch(n){return console.log("?? "+e.content.length+" "+(n.message||n))}try{r=parse_iwa_file$1(t)}catch(n){return console.log("## "+(n.message||n))}r.forEach((function(e){a[e.id]=e.messages,o.push(e.id)}))}})),!o.length)throw new Error("File has no messages");var s=(null==(i=null==(n=null==(r=null==(t=null==a?void 0:a[1])?void 0:t[0])?void 0:r.meta)?void 0:n[1])?void 0:i[0].data)&&1==varint_to_i32$1(a[1][0].meta[1][0].data)&&a[1][0];if(s||o.forEach((function(e){a[e].forEach((function(e){if(1==varint_to_i32$1(e.meta[1][0].data)>>>0){if(s)throw new Error("Document has multiple roots");s=e}}))})),!s)throw new Error("Cannot find Document root");return parse_TN_DocumentArchive$1(a,s)}function fix_opts_func$1(e){return function(t){for(var r=0;r!=e.length;++r){var n=e[r];void 0===t[n[0]]&&(t[n[0]]=n[1]),"n"===n[2]&&(t[n[0]]=Number(t[n[0]]))}}}function fix_read_opts$1(e){fix_opts_func$1([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function get_sheet_type$1(e){return RELS$1.WS.indexOf(e)>-1?"sheet":e==RELS$1.CS?"chart":e==RELS$1.DS?"dialog":e==RELS$1.MS?"macro":e&&e.length?e:"sheet"}function safe_parse_wbrels$1(e,t){if(!e)return 0;try{e=t.map((function(t){return t.id||(t.id=t.strRelID),[t.name,e["!id"][t.id].Target,get_sheet_type$1(e["!id"][t.id].Type)]}))}catch(r){return null}return e&&0!==e.length?e:null}function safe_parse_sheet$1(e,t,r,n,i,a,o,s,l,c,u,d){try{a[n]=parse_rels$1(getzipstr$1(e,r,!0),t);var h,p=getzipdata$1(e,t);switch(s){case"sheet":h=parse_ws$1(p,t,i,l,a[n],c,u,d);break;case"chart":if(!(h=parse_cs$1(p,t,i,l,a[n],c,u,d))||!h["!drawel"])break;var f=resolve_path$1(h["!drawel"].Target,t),m=get_rels_path$1(f),g=resolve_path$1(parse_drawing$1(getzipstr$1(e,f,!0),parse_rels$1(getzipstr$1(e,m,!0),f)),f),_=get_rels_path$1(g);h=parse_chart$1(getzipstr$1(e,g,!0),g,l,parse_rels$1(getzipstr$1(e,_,!0),g),c,h);break;case"macro":h=parse_ms$1(p,t,i,l,a[n],c,u,d);break;case"dialog":h=parse_ds$1(p,t,i,l,a[n],c,u,d);break;default:throw new Error("Unrecognized sheet type "+s)}o[n]=h;var y=[];a&&a[n]&&keys$4(a[n]).forEach((function(r){var i="";if(a[n][r].Type==RELS$1.CMNT){i=resolve_path$1(a[n][r].Target,t);var o=parse_cmnt$1(getzipdata$1(e,i,!0),i,l);if(!o||!o.length)return;sheet_insert_comments$1(h,o,!1)}a[n][r].Type==RELS$1.TCMNT&&(i=resolve_path$1(a[n][r].Target,t),y=y.concat(parse_tcmnt_xml$1(getzipdata$1(e,i,!0),l)))})),y&&y.length&&sheet_insert_comments$1(h,y,!0,l.people||[])}catch(b){if(l.WTF)throw b}}function strip_front_slash$1(e){return"/"==e.charAt(0)?e.slice(1):e}function parse_zip$1(e,t){if(make_ssf$1(),fix_read_opts$1(t=t||{}),safegetzipfile$1(e,"META-INF/manifest.xml"))return parse_ods$1(e,t);if(safegetzipfile$1(e,"objectdata.xml"))return parse_ods$1(e,t);if(safegetzipfile$1(e,"Index/Document.iwa")){if("undefined"==typeof Uint8Array)throw new Error("NUMBERS file parsing requires Uint8Array support");if(void 0!==parse_numbers_iwa$1){if(e.FileIndex)return parse_numbers_iwa$1(e);var r=CFB$1.utils.cfb_new();return zipentries$1(e).forEach((function(t){zip_add_file$1(r,t,getzipbin$1(e,t))})),parse_numbers_iwa$1(r)}throw new Error("Unsupported NUMBERS file")}if(!safegetzipfile$1(e,"[Content_Types].xml")){if(safegetzipfile$1(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(safegetzipfile$1(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");throw new Error("Unsupported ZIP file")}var n,i,a=zipentries$1(e),o=parse_ct$1(getzipstr$1(e,"[Content_Types].xml")),s=!1;if(0===o.workbooks.length&&getzipdata$1(e,i="xl/workbook.xml",!0)&&o.workbooks.push(i),0===o.workbooks.length){if(!getzipdata$1(e,i="xl/workbook.bin",!0))throw new Error("Could not find workbook");o.workbooks.push(i),s=!0}"bin"==o.workbooks[0].slice(-3)&&(s=!0);var l={},c={};if(!t.bookSheets&&!t.bookProps){if(strs$1=[],o.sst)try{strs$1=parse_sst$1(getzipdata$1(e,strip_front_slash$1(o.sst)),o.sst,t)}catch(P){if(t.WTF)throw P}t.cellStyles&&o.themes.length&&(l=parse_theme(getzipstr$1(e,o.themes[0].replace(/^\//,""),!0)||"",o.themes[0],t)),o.style&&(c=parse_sty$1(getzipdata$1(e,strip_front_slash$1(o.style)),o.style,l,t))}o.links.map((function(r){try{var n=parse_rels$1(getzipstr$1(e,get_rels_path$1(strip_front_slash$1(r))),r);return parse_xlink$1(getzipdata$1(e,strip_front_slash$1(r)),n,r,t)}catch(P){}}));var u=parse_wb$1(getzipdata$1(e,strip_front_slash$1(o.workbooks[0])),o.workbooks[0],t),d={},h="";o.coreprops.length&&((h=getzipdata$1(e,strip_front_slash$1(o.coreprops[0]),!0))&&(d=parse_core_props$1(h)),0!==o.extprops.length&&(h=getzipdata$1(e,strip_front_slash$1(o.extprops[0]),!0))&&parse_ext_props$1(h,d,t));var p={};t.bookSheets&&!t.bookProps||0!==o.custprops.length&&(h=getzipstr$1(e,strip_front_slash$1(o.custprops[0]),!0))&&(p=parse_cust_props$1(h,t));var f={};if((t.bookSheets||t.bookProps)&&(u.Sheets?n=u.Sheets.map((function(e){return e.name})):d.Worksheets&&d.SheetNames.length>0&&(n=d.SheetNames),t.bookProps&&(f.Props=d,f.Custprops=p),t.bookSheets&&void 0!==n&&(f.SheetNames=n),t.bookSheets?f.SheetNames:t.bookProps))return f;n={};var m={};t.bookDeps&&o.calcchain&&(m=parse_cc$1(getzipdata$1(e,strip_front_slash$1(o.calcchain)),o.calcchain));var g,_,y=0,b={},v=u.Sheets;d.Worksheets=v.length,d.SheetNames=[];for(var S=0;S!=v.length;++S)d.SheetNames[S]=v[S].name;var w=s?"bin":"xml",T=o.workbooks[0].lastIndexOf("/"),E=(o.workbooks[0].slice(0,T+1)+"_rels/"+o.workbooks[0].slice(T+1)+".rels").replace(/^\//,"");safegetzipfile$1(e,E)||(E="xl/_rels/workbook."+w+".rels");var x=parse_rels$1(getzipstr$1(e,E,!0),E.replace(/_rels.*/,"s5s"));(o.metadata||[]).length>=1&&(t.xlmeta=parse_xlmeta$1(getzipdata$1(e,strip_front_slash$1(o.metadata[0])),o.metadata[0],t)),(o.people||[]).length>=1&&(t.people=parse_people_xml$1(getzipdata$1(e,strip_front_slash$1(o.people[0])),t)),x&&(x=safe_parse_wbrels$1(x,u.Sheets));var A=getzipdata$1(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(y=0;y!=d.Worksheets;++y){var C="sheet";if(x&&x[y]?(g="xl/"+x[y][1].replace(/[\/]?xl\//,""),safegetzipfile$1(e,g)||(g=x[y][1]),safegetzipfile$1(e,g)||(g=E.replace(/_rels\/.*$/,"")+x[y][1]),C=x[y][2]):g=(g="xl/worksheets/sheet"+(y+1-A)+"."+w).replace(/sheet0\./,"sheet."),_=g.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&null!=t.sheets)switch(typeof t.sheets){case"number":if(y!=t.sheets)continue e;break;case"string":if(d.SheetNames[y].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var R=!1,D=0;D!=t.sheets.length;++D)"number"==typeof t.sheets[D]&&t.sheets[D]==y&&(R=1),"string"==typeof t.sheets[D]&&t.sheets[D].toLowerCase()==d.SheetNames[y].toLowerCase()&&(R=1);if(!R)continue e}}safe_parse_sheet$1(e,g,_,d.SheetNames[y],y,b,n,C,t,u,l,c)}return f={Directory:o,Workbook:u,Props:d,Custprops:p,Deps:m,Sheets:n,SheetNames:d.SheetNames,Strings:strs$1,Styles:c,Themes:l,SSF:dup$1(table_fmt$1)},t&&t.bookFiles&&(e.files?(f.keys=a,f.files=e.files):(f.keys=[],f.files={},e.FullPaths.forEach((function(t,r){t=t.replace(/^Root Entry[\/]/,""),f.keys.push(t),f.files[t]=e.FileIndex[r]})))),t&&t.bookVBA&&(o.vba.length>0?f.vbaraw=getzipdata$1(e,strip_front_slash$1(o.vba[0]),!0):o.defaults&&o.defaults.bin===CT_VBA$1&&(f.vbaraw=getzipdata$1(e,"xl/vbaProject.bin",!0))),f}function parse_xlsxcfb$1(e,t){var r=t||{},n="Workbook",i=CFB$1.find(e,n);try{if(n="/!DataSpaces/Version",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(parse_DataSpaceVersionInfo$1(i.content),n="/!DataSpaces/DataSpaceMap",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var a=parse_DataSpaceMap$1(i.content);if(1!==a.length||1!==a[0].comps.length||0!==a[0].comps[0].t||"StrongEncryptionDataSpace"!==a[0].name||"EncryptedPackage"!==a[0].comps[0].v)throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=parse_DataSpaceDefinition$1(i.content);if(1!=o.length||"StrongEncryptionTransform"!=o[0])throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);parse_Primary$1(i.content)}catch(l){}if(n="/EncryptionInfo",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var s=parse_EncryptionInfo$1(i.content);if(n="/EncryptedPackage",!(i=CFB$1.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(4==s[0]&&"undefined"!=typeof decrypt_agile)return decrypt_agile(s[1],i.content,r.password||"",r);if(2==s[0]&&"undefined"!=typeof decrypt_std76)return decrypt_std76(s[1],i.content,r.password||"",r);throw new Error("File is password-protected")}function firstbyte$1(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Base64_decode$1(e.slice(0,12));break;case"binary":r=e;break;default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function read_cfb$1(e,t){return CFB$1.find(e,"EncryptedPackage")?parse_xlsxcfb$1(e,t):parse_xlscfb$1(e,t)}function read_zip$1(e,t){var r=e,n=t||{};return n.type||(n.type=has_buf$1&&Buffer.isBuffer(e)?"buffer":"base64"),parse_zip$1(zip_read$1(r,n),n)}function read_plaintext$1(e,t){var r=0;e:for(;r<e.length;)switch(e.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return parse_xlml$1(e.slice(r),t);default:break e}return PRN$1.to_workbook(e,t)}function read_plaintext_raw$1(e,t){var r="",n=firstbyte$1(e,t);switch(t.type){case"base64":r=Base64_decode$1(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=cc2str$1(e);break;default:throw new Error("Unrecognized type "+t.type)}return 239==n[0]&&187==n[1]&&191==n[2]&&(r=utf8read$1(r)),t.type="binary",read_plaintext$1(r,t)}function read_utf16$1(e,t){var r=e;return"base64"==t.type&&(r=Base64_decode$1(r)),r=$cptable.utils.decode(1200,r.slice(2),"str"),t.type="binary",read_plaintext$1(r,t)}function bstrify$1(e){return e.match(/[^\x00-\x7F]/)?utf8write$1(e):e}function read_prn$1(e,t,r,n){return n?(r.type="string",PRN$1.to_workbook(e,r)):PRN$1.to_workbook(t,r)}function readSync$1(e,t){reset_cp$1();var r=t||{};if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return readSync$1(new Uint8Array(e),((r=dup$1(r)).type="array",r));"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&!r.type&&(r.type="undefined"!=typeof Deno?"buffer":"array");var n,i=e,a=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),_ssfopts$1={},r.dateNF&&(_ssfopts$1.dateNF=r.dateNF),r.type||(r.type=has_buf$1&&Buffer.isBuffer(e)?"buffer":"base64"),"file"==r.type&&(r.type=has_buf$1?"buffer":"binary",i=read_binary$1(e),"undefined"==typeof Uint8Array||has_buf$1||(r.type="array")),"string"==r.type&&(a=!0,r.type="binary",r.codepage=65001,i=bstrify$1(e)),"array"==r.type&&"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&"undefined"!=typeof ArrayBuffer){var o=new ArrayBuffer(3),s=new Uint8Array(o);if(s.foo="bar",!s.foo)return(r=dup$1(r)).type="array",readSync$1(ab2a$1(i),r)}switch((n=firstbyte$1(i,r))[0]){case 208:if(207===n[1]&&17===n[2]&&224===n[3]&&161===n[4]&&177===n[5]&&26===n[6]&&225===n[7])return read_cfb$1(CFB$1.read(i,r),r);break;case 9:if(n[1]<=8)return parse_xlscfb$1(i,r);break;case 60:return parse_xlml$1(i,r);case 73:if(73===n[1]&&42===n[2]&&0===n[3])throw new Error("TIFF Image File is not a spreadsheet");if(68===n[1])return read_wb_ID$1(i,r);break;case 84:if(65===n[1]&&66===n[2]&&76===n[3])return DIF$1.to_workbook(i,r);break;case 80:return 75===n[1]&&n[2]<9&&n[3]<9?read_zip$1(i,r):read_prn$1(e,i,r,a);case 239:return 60===n[3]?parse_xlml$1(i,r):read_prn$1(e,i,r,a);case 255:if(254===n[1])return read_utf16$1(i,r);if(0===n[1]&&2===n[2]&&0===n[3])return WK_$1.to_workbook(i,r);break;case 0:if(0===n[1]){if(n[2]>=2&&0===n[3])return WK_$1.to_workbook(i,r);if(0===n[2]&&(8===n[3]||9===n[3]))return WK_$1.to_workbook(i,r)}break;case 3:case 131:case 139:case 140:return DBF$1.to_workbook(i,r);case 123:if(92===n[1]&&114===n[2]&&116===n[3])return RTF.to_workbook(i,r);break;case 10:case 13:case 32:return read_plaintext_raw$1(i,r);case 137:if(80===n[1]&&78===n[2]&&71===n[3])throw new Error("PNG Image File is not a spreadsheet")}return DBF_SUPPORTED_VERSIONS$1.indexOf(n[0])>-1&&n[2]<=12&&n[3]<=31?DBF$1.to_workbook(i,r):read_prn$1(e,i,r,a)}function make_json_row$1(e,t,r,n,i,a,o,s){var l=encode_row$1(r),c=s.defval,u=s.raw||!Object.prototype.hasOwnProperty.call(s,"raw"),d=!0,h=1===i?[]:{};if(1!==i)if(Object.defineProperty)try{Object.defineProperty(h,"__rowNum__",{value:r,enumerable:!1})}catch(g){h.__rowNum__=r}else h.__rowNum__=r;if(!o||e[r])for(var p=t.s.c;p<=t.e.c;++p){var f=o?e[r][p]:e[n[p]+l];if(void 0!==f&&void 0!==f.t){var m=f.v;switch(f.t){case"z":if(null==m)break;continue;case"e":m=0==m?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+f.t)}if(null!=a[p]){if(null==m)if("e"==f.t&&null===m)h[a[p]]=null;else if(void 0!==c)h[a[p]]=c;else{if(!u||null!==m)continue;h[a[p]]=null}else h[a[p]]=u&&("n"!==f.t||"n"===f.t&&!1!==s.rawNumbers)?m:format_cell$1(f,m,s);null!=m&&(d=!1)}}else{if(void 0===c)continue;null!=a[p]&&(h[a[p]]=c)}}return{row:h,isempty:d}}function sheet_to_json$1(e,t){if(null==e||null==e["!ref"])return[];var r={t:"n",v:0},n=0,i=1,a=[],o=0,s="",l={s:{r:0,c:0},e:{r:0,c:0}},c=t||{},u=null!=c.range?c.range:e["!ref"];switch(1===c.header?n=1:"A"===c.header?n=2:Array.isArray(c.header)?n=3:null==c.header&&(n=0),typeof u){case"string":l=safe_decode_range$1(u);break;case"number":(l=safe_decode_range$1(e["!ref"])).s.r=u;break;default:l=u}n>0&&(i=0);var d=encode_row$1(l.s.r),h=[],p=[],f=0,m=0,g=Array.isArray(e),_=l.s.r,y=0,b={};g&&!e[_]&&(e[_]=[]);var v=c.skipHidden&&e["!cols"]||[],S=c.skipHidden&&e["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(v[y]||{}).hidden)switch(h[y]=encode_col$1(y),r=g?e[_][y]:e[h[y]+d],n){case 1:a[y]=y-l.s.c;break;case 2:a[y]=h[y];break;case 3:a[y]=c.header[y-l.s.c];break;default:if(null==r&&(r={w:"__EMPTY",t:"s"}),s=o=format_cell$1(r,null,c),m=b[o]||0){do{s=o+"_"+m++}while(b[s]);b[o]=m,b[s]=1}else b[o]=1;a[y]=s}for(_=l.s.r+i;_<=l.e.r;++_)if(!(S[_]||{}).hidden){var w=make_json_row$1(e,l,_,h,n,a,g,c);(!1===w.isempty||(1===n?!1!==c.blankrows:c.blankrows))&&(p[f++]=w.row)}return p.length=f,p}var qreg$1=/"/g;function make_csv_row$1(e,t,r,n,i,a,o,s){for(var l=!0,c=[],u="",d=encode_row$1(r),h=t.s.c;h<=t.e.c;++h)if(n[h]){var p=s.dense?(e[r]||[])[h]:e[n[h]+d];if(null==p)u="";else if(null!=p.v){l=!1,u=""+(s.rawNumbers&&"n"==p.t?p.v:format_cell$1(p,null,s));for(var f=0,m=0;f!==u.length;++f)if((m=u.charCodeAt(f))===i||m===a||34===m||s.forceQuotes){u='"'+u.replace(qreg$1,'""')+'"';break}"ID"==u&&(u='"ID"')}else null==p.f||p.F?u="":(l=!1,(u="="+p.f).indexOf(",")>=0&&(u='"'+u.replace(qreg$1,'""')+'"'));c.push(u)}return!1===s.blankrows&&l?null:c.join(o)}function sheet_to_csv$1(e,t){var r=[],n=null==t?{}:t;if(null==e||null==e["!ref"])return"";var i=safe_decode_range$1(e["!ref"]),a=void 0!==n.FS?n.FS:",",o=a.charCodeAt(0),s=void 0!==n.RS?n.RS:"\n",l=s.charCodeAt(0),c=new RegExp(("|"==a?"\\|":a)+"+$"),u="",d=[];n.dense=Array.isArray(e);for(var h=n.skipHidden&&e["!cols"]||[],p=n.skipHidden&&e["!rows"]||[],f=i.s.c;f<=i.e.c;++f)(h[f]||{}).hidden||(d[f]=encode_col$1(f));for(var m=0,g=i.s.r;g<=i.e.r;++g)(p[g]||{}).hidden||null!=(u=make_csv_row$1(e,i,g,d,o,l,a,n))&&(n.strip&&(u=u.replace(c,"")),(u||!1!==n.blankrows)&&r.push((m++?s:"")+u));return delete n.dense,r.join("")}function sheet_to_txt$1(e,t){return t||(t={}),t.FS=" ",t.RS="\n",sheet_to_csv$1(e,t)}function sheet_to_formulae$1(e){var t,r="",n="";if(null==e||null==e["!ref"])return[];var i,a=safe_decode_range$1(e["!ref"]),o="",s=[],l=[],c=Array.isArray(e);for(i=a.s.c;i<=a.e.c;++i)s[i]=encode_col$1(i);for(var u=a.s.r;u<=a.e.r;++u)for(o=encode_row$1(u),i=a.s.c;i<=a.e.c;++i)if(r=s[i]+o,n="",void 0!==(t=c?(e[u]||[])[i]:e[r])){if(null!=t.F){if(r=t.F,!t.f)continue;n=t.f,-1==r.indexOf(":")&&(r=r+":"+r)}if(null!=t.f)n=t.f;else{if("z"==t.t)continue;if("n"==t.t&&null!=t.v)n=""+t.v;else if("b"==t.t)n=t.v?"TRUE":"FALSE";else if(void 0!==t.w)n="'"+t.w;else{if(void 0===t.v)continue;n="s"==t.t?"'"+t.v:""+t.v}}l[l.length]=r+"="+n}return l}function sheet_add_json$1(e,t,r){var n,i=r||{},a=+!i.skipHeader,o=e||{},s=0,l=0;if(o&&null!=i.origin)if("number"==typeof i.origin)s=i.origin;else{var c="string"==typeof i.origin?decode_cell$1(i.origin):i.origin;s=c.r,l=c.c}var u={s:{c:0,r:0},e:{c:l,r:s+t.length-1+a}};if(o["!ref"]){var d=safe_decode_range$1(o["!ref"]);u.e.c=Math.max(u.e.c,d.e.c),u.e.r=Math.max(u.e.r,d.e.r),-1==s&&(s=d.e.r+1,u.e.r=s+t.length-1+a)}else-1==s&&(s=0,u.e.r=t.length-1+a);var h=i.header||[],p=0;t.forEach((function(e,t){keys$4(e).forEach((function(r){-1==(p=h.indexOf(r))&&(h[p=h.length]=r);var c=e[r],u="z",d="",f=encode_cell$1({c:l+p,r:s+t+a});n=ws_get_cell_stub$1(o,f),!c||"object"!=typeof c||c instanceof Date?("number"==typeof c?u="n":"boolean"==typeof c?u="b":"string"==typeof c?u="s":c instanceof Date?(u="d",i.cellDates||(u="n",c=datenum$1(c)),d=i.dateNF||table_fmt$1[14]):null===c&&i.nullError&&(u="e",c=0),n?(n.t=u,n.v=c,delete n.w,delete n.R,d&&(n.z=d)):o[f]=n={t:u,v:c},d&&(n.z=d)):o[f]=c}))})),u.e.c=Math.max(u.e.c,l+h.length-1);var f=encode_row$1(s);if(a)for(p=0;p<h.length;++p)o[encode_col$1(p+l)+f]={t:"s",v:h[p]};return o["!ref"]=encode_range$1(u),o}function json_to_sheet$1(e,t){return sheet_add_json$1(null,e,t)}function ws_get_cell_stub$1(e,t,r){if("string"==typeof t){if(Array.isArray(e)){var n=decode_cell$1(t);return e[n.r]||(e[n.r]=[]),e[n.r][n.c]||(e[n.r][n.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return ws_get_cell_stub$1(e,encode_cell$1("number"!=typeof t?t:{r:t,c:r||0}))}function wb_sheet_idx$1(e,t){if("number"==typeof t){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}if("string"==typeof t){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}throw new Error("Cannot find sheet |"+t+"|")}function book_new$1(){return{SheetNames:[],Sheets:{}}}function book_append_sheet$1(e,t,r,n){var i=1;if(!r)for(;i<=65535&&-1!=e.SheetNames.indexOf(r="Sheet"+i);++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var a=r.match(/(^.*?)(\d+)$/);i=a&&+a[2]||0;var o=a&&a[1]||r;for(++i;i<=65535&&-1!=e.SheetNames.indexOf(r=o+i);++i);}if(check_ws_name$1(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function book_set_sheet_visibility$1(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=wb_sheet_idx$1(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function cell_set_number_format$1(e,t){return e.z=t,e}function cell_set_hyperlink$1(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function cell_set_internal_link$1(e,t,r){return cell_set_hyperlink$1(e,"#"+t,r)}function cell_add_comment$1(e,t,r){e.c||(e.c=[]),e.c.push({t:t,a:r||"SheetJS"})}function sheet_set_array_formula$1(e,t,r,n){for(var i="string"!=typeof t?t:safe_decode_range$1(t),a="string"==typeof t?t:encode_range$1(t),o=i.s.r;o<=i.e.r;++o)for(var s=i.s.c;s<=i.e.c;++s){var l=ws_get_cell_stub$1(e,o,s);l.t="n",l.F=a,delete l.v,o==i.s.r&&s==i.s.c&&(l.f=r,n&&(l.D=!0))}return e}var utils$a={encode_col:encode_col$1,encode_row:encode_row$1,encode_cell:encode_cell$1,encode_range:encode_range$1,decode_col:decode_col$1,decode_row:decode_row$1,split_cell:split_cell$1,decode_cell:decode_cell$1,decode_range:decode_range$1,format_cell:format_cell$1,sheet_add_aoa:sheet_add_aoa$1,sheet_add_json:sheet_add_json$1,sheet_add_dom:sheet_add_dom$1,aoa_to_sheet:aoa_to_sheet$1,json_to_sheet:json_to_sheet$1,table_to_sheet:parse_dom_table$1,table_to_book:table_to_book$1,sheet_to_csv:sheet_to_csv$1,sheet_to_txt:sheet_to_txt$1,sheet_to_json:sheet_to_json$1,sheet_to_html:sheet_to_html$1,sheet_to_formulae:sheet_to_formulae$1,sheet_to_row_object_array:sheet_to_json$1,sheet_get_cell:ws_get_cell_stub$1,book_new:book_new$1,book_append_sheet:book_append_sheet$1,book_set_sheet_visibility:book_set_sheet_visibility$1,cell_set_number_format:cell_set_number_format$1,cell_set_hyperlink:cell_set_hyperlink$1,cell_set_internal_link:cell_set_internal_link$1,cell_add_comment:cell_add_comment$1,sheet_set_array_formula:sheet_set_array_formula$1,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};let mix=e=>new MixinBuilder(e);class MixinBuilder{constructor(e){this.superclass=e}with(...e){return e.reduce(((e,t)=>t(e)),this.superclass)}}function promiseToTupple(e){return e.then((e=>[null,e])).catch((e=>[e,null]))}function makeUuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function getErrorStack(){try{throw Error("")}catch(error){let t=error.stack.split("\n");return t.splice(1,1),JSON.stringify(t.join("\n"))}}function isEmpty$1(e){return void 0===e||!!Array.isArray(e)&&(0===e.length||1===e.length&&void 0===e[0])}function detectBrowser$1(){const e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0;if(e)return"Opera";if("undefined"!=typeof InstallTrigger)return"Firefox";if(/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString())return"Safari";const t=!!document.documentMode;if(t)return"IE";if(!t&&!!window.StyleMedia)return"Edge";const r=window.chrome;if(r)return"Chrome";if(r&&-1!==navigator.userAgent.indexOf("Edg"))return"EdgeChromium";return(r||e)&&!!window.CSS?"Blink":"unknown"}function toNumerical(e){const t={origin:"util.toNumerical",context:"when converting an object to its numerical form"};try{if(null===e)throw"unable to convert null to a number";if(void 0===e)throw"unable to convert undefined to a number";if("number"==typeof e)return e;const t=e=>{const t=Number.parseFloat(e);if(Number.isNaN(t))throw`unable to convert ${e} to a number`;return t};if(Array.isArray(e))return e.map(t);const r=turnSquareBracketsIntoArrays(e);if(Array.isArray(r))return r.map(t);if("string"==typeof e)return t(e);throw"unable to convert the object to a number"}catch(error){throw Object.assign(t,{error:error})}}function isNumeric(e){return!1===Number.isNaN(Number(e))}function IsPointInsidePolygon(e,t){const r=e[0],n=e[1];let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const e=t[a][0],s=t[a][1],l=t[o][0],c=t[o][1];s>n!=c>n&&r<(l-e)*(n-s)/(c-s)+e&&(i=!i)}return i}function shuffle$2(e,t=void 0){void 0===t&&(t=Math.random);for(let r=e.length-1;r>0;r--){const n=Math.floor(t()*(r+1));[e[r],e[n]]=[e[n],e[r]]}return e}function randchoice(e,t=void 0){void 0===t&&(t=Math.random);return e[Math.floor(t()*e.length)]}function getPositionFromObject(e,t){const r={origin:"util.getPositionFromObject",context:"when getting the position of an object"};try{if(void 0===e)throw"cannot get the position of an undefined object";let r;return"function"==typeof e.getPos&&(t=e.units,r=e.win,e=e.getPos()),to_px$1(e,t,r)}catch(error){throw Object.assign(r,{error:error})}}function to_px$1(e,t,r,n=!1){const i={origin:"util.to_px",context:"when converting a position to pixel units"};let a;if("pix"===t)a=e;else if("norm"===t)a=[e[0]*r.size[0]/2,e[1]*r.size[1]/2];else{if("height"!==t)throw Object.assign(i,{error:`unknown position units: ${t}`});{const t=Math.min(r.size[0],r.size[1]);a=[e[0]*t,e[1]*t]}}return n?[Math.round(a[0]),Math.round(a[1])]:a}function to_norm(e,t,r){if("norm"===t)return e;if("pix"===t)return[e[0]/(r.size[0]/2),e[1]/(r.size[1]/2)];if("height"===t){const t=Math.min(r.size[0],r.size[1]);return[e[0]*t/(r.size[0]/2),e[1]*t/(r.size[1]/2)]}throw Object.assign({origin:"util.to_norm",context:"when converting a position to norm units"},{error:`unknown position units: ${t}`})}function to_height(e,t,r){if("height"===t)return e;if("pix"===t){const t=Math.min(r.size[0],r.size[1]);return[e[0]/t,e[1]/t]}if("norm"===t){const t=Math.min(r.size[0],r.size[1]);return[e[0]*r.size[0]/2/t,e[1]*r.size[1]/2/t]}throw Object.assign({origin:"util.to_height",context:"when converting a position to height units"},{error:`unknown position units: ${t}`})}function to_win(e,t,r){const n={origin:"util.to_win",context:"when converting a position to window units"};try{if("pix"===r._units)return to_px$1(e,t,r);if("norm"===r._units)return to_norm(e,t,r);if("height"===r._units)return to_height(e,t,r);throw`unknown window units: ${r._units}`}catch(error){throw Object.assign(n,{response:n,error:error})}}function to_unit(e,t,r,n){const i={origin:"util.to_unit",context:"when converting a position to different units"};try{if("pix"===n)return to_px$1(e,t,r);if("norm"===n)return to_norm(e,t,r);if("height"===n)return to_height(e,t,r);throw`unknown target units: ${n}`}catch(error){throw Object.assign(i,{error:error})}}function toString$p(e){if(void 0===e)return"undefined";if(!e)return"null";if("string"==typeof e)return e;if("class"===e.constructor.toString().substring(0,5)&&"function"==typeof e.toString)return e.toString();try{const t=(e,t)=>("symbol"==typeof t&&(t=Symbol.keyFor(t)),t);return JSON.stringify(e,t)}catch(t){return"Object (circular)"}}function getRequestError(e,t,r){let n="unknown error";return void 0!==e.responseJSON?"object"==typeof e.responseJSON?e.responseJSON.error?(n=e.responseJSON.error,e.responseJSON.details&&(n+=" - "+e.responseJSON.details),e.responseJSON.code&&(n+=" (Code: "+e.responseJSON.code+")")):n=JSON.stringify(e.responseJSON):n=e.responseJSON:void 0!==e.responseText?n=e.responseText:void 0!==r&&(n=r),n}function isInt(e){if(isNaN(e))return!1;const t=parseFloat(e);return(0|t)===t}function getUrlParameters(){const e=window.location.search.slice(1);return new URLSearchParams(e)}function addInfoFromUrl(e){return getUrlParameters().forEach(((t,r)=>{0!==r.indexOf("__")&&(e[r]=t)})),e}function selectFromArray(e,t){if(isInt(t))return[e[parseInt(t)]];if(Array.isArray(t))return t.map((t=>e[t]));if("string"!=typeof t)throw{origin:"selectFromArray",context:"when selecting entries from an array",error:"unknown selection type: "+typeof t};if(t.indexOf(",")>-1){const r=t.split(",").map((e=>parseInt(e)));return selectFromArray(e,r)}if(t.indexOf(":")>-1){let r=t.split(":").map((e=>parseInt(e)));return 3===r.length?sliceArray(e,r[0],r[2],r[1]):sliceArray(e,...r)}}function flattenArray(e){return e.reduce(((e,t)=>(e.push(Array.isArray(t)&&Array.isArray(t[0])?flattenArray(t):t),e)),[])}function sliceArray(e,t=NaN,r=NaN,n=NaN){isNaN(t)&&(t=0),isNaN(r)&&(r=e.length);let i=e.slice(t,r);return isNaN(n)?i:(n<0&&i.reverse(),1===(n=Math.abs(n))?i:i.filter(((e,t)=>t%n==0)))}function offerDataForDownload(e,t,r){const n=new Blob([t],{type:r});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,e);else{const t=document.createElement("a");t.href=window.URL.createObjectURL(n),t.download=e,document.body.appendChild(t),t.click(),document.body.removeChild(t)}}function turnSquareBracketsIntoArrays(e,t=1){if(String(e)!==e)return;const r=e.match(/\[(.*?)\]/g);if(null===r)return;const n=r.map((e=>e.replace(/[\[\]]+/g,"").split(/[, ]+/)));return t<2?n[0]:n}function randint(e=0,t){let r=e,n=t;if(void 0===t&&(n=r,r=0),n<r)throw{origin:"util.randint",context:"when generating a random integer",error:"min should be <= max"};return Math.floor(Math.random()*(n-r))+r}function round$4(e,t=0){return+(Math.round(`${e}e+${t}`)+`e-${t}`)}function sum$2(e=[],t=0){if(!Array.isArray(e))return t;return e.map((e=>Number(e))).filter((e=>!1===Number.isNaN(e))).reduce(((e,t)=>e+t),t)}function average$1(e=[]){return Array.isArray(e)?0===e.length?0:sum$2(e,0)/e.length:0}function sort(e){const t={origin:"util.sort",context:"when sorting the elements of an array"};try{if(!Array.isArray(e))throw"the input argument should be an array";if(e.every((e=>"number"==typeof e)))return e.sort(((e,t)=>e-t));if(e.every((e=>"string"==typeof e)))return e.sort();throw"the input array should either consist entirely of strings or of numbers"}catch(error){throw{...t,error:error}}}function range$1(...e){const t={origin:"util.range",context:"when building a range of numbers"};try{let t,r,n;switch(e.length){case 0:throw"at least one argument is required";case 1:t=0,r=e[0],n=1;break;case 2:t=e[0],r=e[1],n=1;break;case 3:t=e[0],r=e[1],n=e[2];break;default:throw"range requires at least one and at most 3 arguments"}if(!Number.isInteger(t))throw"start should be an integer";if(!Number.isInteger(r))throw"stop should be an integer";if(!Number.isInteger(n))throw"step should be an integer";if(t>=r)return[];let i=[];for(let e=t;e<r;e+=n)i.push(e);return i}catch(error){throw{...t,error:error}}}function _match(e){const t={origin:"util._match",context:"when creating a function that compares an input element to the given value"};try{if("function"==typeof e)throw"the value cannot be a function";if(Number.isNaN(e))return e=>Number.isNaN(e);if(null===e)return e=>null===e;if("object"==typeof e){const t=JSON.stringify(e);if(void 0===t)throw"value could not be converted to a JSON string";return e=>JSON.stringify(e)===t}return t=>t===e}catch(error){throw{...t,error:error}}}function count(e,t){const r={origin:"util.count",context:"when counting how many elements in the input array match the given value"};try{if(!Array.isArray(e))throw"the input argument should be an array";const r=_match(t);let n=0;return e.forEach((e=>{r(e)&&++n})),n}catch(error){throw{...r,error:error}}}function index$2(e,t){const r={origin:"util.index",context:"when getting the index in the input array of the first element that matches the given value"};try{if(!Array.isArray(e))throw"the input argument should be an array";const r=_match(t),n=e.findIndex(r);if(-1===n)throw"no element in the input array matches the value";return n}catch(error){throw{...r,error:error}}}function extensionFromMimeType(e){return"string"!=typeof e?".dat":0===e.indexOf("audio/webm")?".webm":0===e.indexOf("audio/ogg")?".ogg":0===e.indexOf("audio/wav")?".wav":0===e.indexOf("video/webm")?".webm":".dat"}async function getDownloadSpeed(e,t=1){const r="https://upload.wikimedia.org/wikipedia/commons/a/a6/Brandenburger_Tor_abends.jpg";return new Promise(((n,i)=>{let a=0,o=0;const s=new Image;s.onload=()=>{const e=performance.now();if(a+=e-l,++o,o===t){n(0x14a8018*t/(a/1e3)/1024/1024)}else l=performance.now(),s.src=`${r}?salt=${l}`},s.onerror=t=>{const r=`unable to estimate the download speed: ${JSON.stringify(t)}`;e.logger.error(r),i(r)};let l=performance.now();s.src=`${r}?salt=${l}`}))}String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,(function(t,r){return void 0!==e[r]?e[r]:t})).replace(/{([$_a-zA-Z][$_a-zA-Z0-9]*)}/g,(function(t,r){return e.length>0&&void 0!==e[0][r]?e[0][r]:t}))});const repeatEveryElement=(e,t)=>e.map((e=>[...[...new Array(t).keys()].map((t=>e))])).flat(),getTimezoneName=()=>{const e=new Date,t=e.toLocaleDateString(void 0),r=e.toLocaleDateString(void 0,{timeZoneName:"short"}),n=r.indexOf(t);if(n>=0){return(r.substring(0,n)+r.substring(n+t.length)).replace(/^[\s,.\-:;]+|[\s,.\-:;]+$/g,"")}return r};let EventEmitter$2=class{constructor(){this._listeners=new Map,this._onceUuids=new Map}on(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");let r=makeUuid();return this._listeners.has(e)||this._listeners.set(e,[]),this._listeners.get(e).push({uuid:r,listener:t}),r}once(e,t){let r=this.on(e,t);return this._onceUuids.has(e)||this._onceUuids.set(e,[]),this._onceUuids.get(e).push(r),r}off(e,t){let r=this._listeners.get(e);return!(!r||!r.length)&&(this._listeners.set(e,r.filter((e=>e.uuid!=t))),!0)}emit(e,t){let r=this._listeners.get(e);if(r&&r.length){let n=this._onceUuids.get(e),i=this;return r.forEach((({uuid:r,listener:a})=>{a(t),void 0!==n&&n.includes(r)&&i.off(e,r)})),!0}return!1}};class PsychObject extends EventEmitter$2{constructor(e,t){super(),this._psychoJS=e,this._userAttributes=new Set,void 0===t&&(t=this.constructor.name),this._addAttribute("name",t)}get psychoJS(){return this._psychoJS}set psychoJS(e){this._psychoJS=e}toString(){let e=this.constructor.name+"( ",t=!1;for(const r of this._userAttributes){t&&(e+=", "),t=!0;let n=toString$p(this["_"+r]);const i=n.length;i>50&&(n=")"===n[i-1]?n.substring(0,50)+"~)":n.substring(0,50)+"~"),e+=r+"="+n}return e+=" )",e}_setAttribute(e,t,r=!1,n=void 0,i=!1){const a={origin:"PsychObject.setAttribute",context:"when setting the attribute of an object"};if(void 0===e)throw Object.assign(a,{error:"the attribute name cannot be undefined"});if(void 0!==n&&this.hasOwnProperty("_"+e)){let r=this["_"+e];if("number"!=typeof t&&(!Array.isArray(t)||0!==t.length&&"number"!=typeof t[0]))throw Object.assign(a,{error:"operation: "+n+" is invalid for old value: "+JSON.stringify(r)+" and new value: "+JSON.stringify(t)});if(Array.isArray(t))if(Array.isArray(r)){if(t.length!==r.length)throw Object.assign(a,{error:"old and new value should have the same size when they are both arrays"});switch(n){case"":break;case"+":t=t.map(((e,t)=>r[t]+e));break;case"*":t=t.map(((e,t)=>r[t]*e));break;case"-":t=t.map(((e,t)=>r[t]-e));break;case"/":t=t.map(((e,t)=>r[t]/e));break;case"**":t=t.map(((e,t)=>r[t]**e));break;case"%":t=t.map(((e,t)=>r[t]%e));break;default:throw Object.assign(a,{error:"unsupported operation: "+n+" when setting: "+e+" in: "+this.name})}}else switch(n){case"":break;case"+":t=t.map((e=>r+e));break;case"*":t=t.map((e=>r*e));break;case"-":t=t.map((e=>r-e));break;case"/":t=t.map((e=>r/e));break;case"**":t=t.map((e=>r**e));break;case"%":t=t.map((e=>r%e));break;default:throw Object.assign(a,{error:"unsupported value: "+JSON.stringify(t)+" for operation: "+n+" when setting: "+e+" in: "+this.name})}else if(Array.isArray(r))switch(n){case"":t=r.map((e=>t));break;case"+":t=r.map((e=>e+t));break;case"*":t=r.map((e=>e*t));break;case"-":t=r.map((e=>e-t));break;case"/":t=r.map((e=>e/t));break;case"**":t=r.map((e=>e**t));break;case"%":t=r.map((e=>e%t));break;default:throw Object.assign(a,{error:"unsupported operation: "+n+" when setting: "+e+" in: "+this.name})}else switch(n){case"":break;case"+":t=r+t;break;case"*":t*=r;break;case"-":t=r-t;break;case"/":t=r/t;break;case"**":t=r**t;break;case"%":t=r%t;break;default:throw Object.assign(a,{error:"unsupported value: "+JSON.stringify(t)+" for operation: "+n+" when setting: "+e+" in: "+this.name})}}if(!i&&(r||this._autoLog)&&void 0!==this.win){const r=this.name+": "+e+" = "+toString$p(t);this.win.logOnFlip({msg:r})}const o=this["_"+e];if(this["_"+e]=t,void 0===o)return!1;const s=toString$p(o),l=toString$p(t);return"Object (circular)"===s||"Object (circular)"===l||s!==l}_addAttribute(e,t,r=void 0,n=()=>{}){const i="get"+e[0].toUpperCase()+e.substr(1);void 0===this[i]&&(this[i]=()=>this["_"+e]);const a="set"+e[0].toUpperCase()+e.substr(1);void 0===this[a]?this[a]=(t,i=!1)=>{null==t&&(t=r);this._setAttribute(e,t,i)&&n()}:null==t&&(t=r),Object.defineProperty(this,e,{configurable:!0,get(){return this[i]()},set(e){this[a](e)}}),this[e]=t,this._userAttributes.add(e)}}const SPACED=", $1",excelSafeCellValue=e=>{try{return Array.isArray(e)?JSON.stringify(e).replace(/,(\S)/g,SPACED):"string"==typeof e?e.replace(/,(\S)/g,SPACED):e}catch(t){return e}},excelSafeRows=e=>Array.isArray(e)?e.map((e=>{try{return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,excelSafeCellValue(t)])))}catch(t){return e}})):e;class ExperimentHandler extends PsychObject{get experimentEnded(){return this._experimentEnded}set experimentEnded(e){this._experimentEnded=e}get _thisEntry(){return this._currentTrialData}get _entries(){return this._trialsData}constructor({psychoJS:e,name:t,extraInfo:r,dataFileName:n}={}){super(e,t),this._addAttribute("extraInfo",r),this._experimentName=this.psychoJS.config.experiment.name,this._participant="string"==typeof r.participant&&r.participant.length>0?r.participant:"PARTICIPANT";const i=r.ProlificParticipantID?r.ProlificParticipantID:void 0;this._session="string"==typeof r.session&&r.session.length>0?r.session:"SESSION",this._datetime=void 0!==r.date?r.date:MonotonicClock.getDateStr(),this._addAttribute("dataFileName",n,`${this._participant}_${i?`${i}_`:""}${this._experimentName}_${this._datetime}`),this._loops=[],this._unfinishedLoops=[],this._trialsKeys=[],this._trialsData=[],this._currentTrialData={},this.experimentClock=new MonotonicClock,this._experimentEnded=!1}isEntryEmpty(){return Object.keys(this._currentTrialData).length>0}addLoop(e){this._loops.push(e),this._unfinishedLoops.push(e),e.experimentHandler=this}removeLoop(e){const t=this._unfinishedLoops.indexOf(e);-1!==t&&this._unfinishedLoops.splice(t,1)}addData(e,t){-1===this._trialsKeys.indexOf(e)&&this._trialsKeys.push(e),Array.isArray(t)&&(t=JSON.stringify(t)),this._currentTrialData[e]=t}nextEntry(e){if(void 0!==e){Array.isArray(e)||(e=[e]);for(const t of e){const e=ExperimentHandler._getLoopAttributes(t);for(let t in e)e.hasOwnProperty(t)&&(this._currentTrialData[t]=e[t])}}else for(const t of this._unfinishedLoops){const e=ExperimentHandler._getLoopAttributes(t);for(const t in e)e.hasOwnProperty(t)&&(this._currentTrialData[t]=e[t])}for(let t in this.extraInfo)if(this.extraInfo.hasOwnProperty(t)){const e="date"===t?this.getDateTimeString():this.extraInfo[t];this._currentTrialData[t]=e}this._trialsData.push(this._currentTrialData),this._currentTrialData={},this._currentTrialData.secs=this.experimentClock.getTime()}getDateTimeString(){return MonotonicClock.getDateStr()+" "+MonotonicClock.getTimeZone()}async save({attributes:e=[],sync:t=!1,tag:r="",clear:n=!1}={}){if(this._psychoJS.logger.info("[PsychoJS] Save experiment results."),this.extraInfo.dataSaved=!0,0===e.length){e=this._trialsKeys.slice();for(let t=0;t<this._loops.length;t++){const r=this._loops[t],n=ExperimentHandler._getLoopAttributes(r);for(let t in n)n.hasOwnProperty(t)&&e.push(t)}for(let t in this.extraInfo)this.extraInfo.hasOwnProperty(t)&&e.push(t)}let i;if(({data:i,attributes:e}=this._orderOutput(this._trialsData,e)),n&&(this._trialsData=[]),i=excelSafeRows(i),this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.CSV){const e=utils$a.json_to_sheet(i),n="\uFEFF"+utils$a.sheet_to_csv(e),a=this._psychoJS.experiment.getExtraInfo(),o=a.participant||"PARTICIPANT",s=a.ProlificParticipantID||void 0,l=`${`${o}_${s?`${s}_`:""}${this._psychoJS.config.experiment.name}_${a.session||"SESSION"}_${a.date||MonotonicClock.getDateStr()}`}${r}.csv`;if(this._psychoJS.getEnvironment()===ExperimentHandler.Environment.SERVER&&"RUNNING"===this._psychoJS.config.experiment.status&&!this._psychoJS._serverMsg.has("__pilotToken"))return this._psychoJS.serverManager.uploadData(l,n,t);offerDataForDownload(l,n,"text/csv")}else if(this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.DATABASE){const r=this._psychoJS.config.gitlab,n=void 0!==r&&void 0!==r.projectId?r.projectId:void 0;let a=[];for(let t=0;t<i.length;t++){let r={__projectId:n,__experimentName:this._experimentName,__participant:this._participant,__session:this._session,__datetime:this._datetime};for(let n=0;n<e.length;n++)r[e[n]]=i[t][e[n]];a.push(r)}if(this._psychoJS.getEnvironment()===ExperimentHandler.Environment.SERVER&&"RUNNING"===this._psychoJS.config.experiment.status&&!this._psychoJS._serverMsg.has("__pilotToken")){console.log("documents",a);const e="results";return this._psychoJS.serverManager.uploadData(e,JSON.stringify(a),t)}offerDataForDownload("results.json",JSON.stringify(a),"application/json")}}saveCSV(e,t="stimulus",r=!1,n=!1){console.log(e);const i=utils$a.json_to_sheet(excelSafeRows(e)),a="\uFEFF"+utils$a.sheet_to_csv(i),o=this._psychoJS.experiment.getExtraInfo(),s=o.participant||"PARTICIPANT",l=o.ProlificParticipantID||void 0,c=this._psychoJS.config.experiment.name,u=o.session||"SESSION",d=o.date||MonotonicClock.getDateStr(),h=`${n?t:`${s}_${l?`${l}_`:""}${c}_${u}_${d}_${t}`}.csv`,p=this._psychoJS.config.gitlab,f=void 0!==p&&void 0!==p.projectId?p.projectId:void 0;for(let g=0;g<e.length;g++)e[g].__projectId=f,e[g].__experimentName=this.psychoJS.config.experiment.name,e[g].__participant=this._participant,e[g].__session=this._session,e[g].__datetime=this._datetime;if(this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.CSV)if(r)try{this._psychoJS.serverManager.uploadData(h,a,!1)}catch(m){console.error("Error saving csv data to online.",m)}else offerDataForDownload(h,a,"text/csv");else if(this._psychoJS.config.experiment.saveFormat===ExperimentHandler.SaveFormat.DATABASE)if(r)try{this._psychoJS.serverManager.uploadData("results",JSON.stringify(excelSafeRows(e)),!1)}catch(m){console.error("Error saving to results.",m)}else offerDataForDownload(h,a,"text/csv")}downloadJSON(e,t){const r=this._psychoJS.experiment.getExtraInfo(),n=r.participant||"PARTICIPANT",i=r.session||"SESSION",a=calibrationTime.current,o=`${this._psychoJS.config.experiment.name}_${n}_${i}_${a}_${0==t?"sound":`M${t}`}.json`,s=document.createElement("a");return s.href="data:application/json;charset=utf-8;,"+encodeURIComponent(JSON.stringify(e)),s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s),this._psychoJS.getEnvironment()!==ExperimentHandler.Environment.SERVER||"RUNNING"!==this._psychoJS.config.experiment.status||this._psychoJS._serverMsg.has("__pilotToken")||this._psychoJS.serverManager.uploadData(o,JSON.stringify(e),!1),o}static _getLoopAttributes(e){const t=["thisRepN","thisTrialN","thisN","thisIndex","stepSizeCurrent","ran","order"];let r={};const n=e.name;for(const i in e)if(t.includes(i)){r["stepSizeCurrent"===i?n+".stepSize":n+"."+i]=e[i]}if("function"==typeof e.getCurrentTrial){const t=e.getCurrentTrial();for(const e in t)r[e]=t[e]}return r}_orderOutput(e,t){if(0===e.length||0===t.length||!this._psychoJS)return{data:e,attributes:t};const r=[...this._psychoJS.inputParameters],n=["expName","name","blockNumber","_s","setSession","targetMeasuredDurationFrames","label","!experimentFilename"];t=t.filter((e=>!n.includes(e)));const i=["URL","experiment","date"],a=r.filter((e=>t.includes(e))),o=t.filter((e=>!r.includes(e)&&!i.includes(e))),s=[...i,...a,...o],l={};for(const c of s)l[c]=null;for(let c=0;c<e.length;c++){for(const t of n)e[c].hasOwnProperty(t)&&delete e[c][t];e[c]=Object.assign({},l,e[c])}return{data:e,attributes:s}}}ExperimentHandler.SaveFormat={CSV:Symbol.for("CSV"),DATABASE:Symbol.for("DATABASE")},ExperimentHandler.Environment={SERVER:Symbol.for("SERVER"),LOCAL:Symbol.for("LOCAL")};let Scheduler$1=class e{constructor(t){this._psychoJS=t,this._taskList=[],this._currentTask=void 0,this._argsList=[],this._currentArgs=void 0,this._stopAtNextUpdate=!1,this._stopAtNextTask=!1,this._status=e.Status.STOPPED}get status(){return this._status}add(e,...t){this._taskList.push(e),this._argsList.push(t)}unshift(e,...t){this._taskList.unshift(e),this._argsList.unshift(t)}addConditional(t,r,n){const i=this;this.add((function(){return t()?i.add(r):i.add(n),e.Event.NEXT}))}async start(){const t=this,r=async n=>{if(t._stopAtNextUpdate)return void(t._status=e.Status.STOPPED);if(await t._runNextTasks()===e.Event.QUIT)return void(t._status=e.Status.STOPPED);const i=void 0===t._lastTimestamp?n:t._lastTimestamp;t._lastDelta=n-i,t._lastTimestamp=n,t._psychoJS.window.render(),requestAnimationFrame(r)};requestAnimationFrame(r)}stop(){this._status=e.Status.STOPPED,this._stopAtNextTask=!0,this._stopAtNextUpdate=!0}async _runNextTasks(){this._status=e.Status.RUNNING;let t=e.Event.NEXT;for(;t===e.Event.NEXT;){if(this._stopAtNextTask)return e.Event.QUIT;if(void 0===this._currentTask){if(!(this._taskList.length>0))return this._currentTask=void 0,this._currentArgs=void 0,e.Event.QUIT;this._currentTask=this._taskList.shift(),this._currentArgs=this._argsList.shift()}this._currentTask instanceof Function?t=await this._currentTask(...this._currentArgs):(t=await this._currentTask._runNextTasks(),t===e.Event.QUIT&&(this._psychoJS.experiment.experimentEnded||(t=e.Event.NEXT))),t!==e.Event.FLIP_REPEAT&&(this._currentTask=void 0,this._currentArgs=void 0)}return t}};Scheduler$1.Event={NEXT:Symbol.for("NEXT"),FLIP_REPEAT:Symbol.for("FLIP_REPEAT"),FLIP_NEXT:Symbol.for("FLIP_NEXT"),QUIT:Symbol.for("QUIT")},Scheduler$1.Status={RUNNING:Symbol.for("RUNNING"),STOPPED:Symbol.for("STOPPED")};const version$6="14.7.77",createExtendedExponentialRampToValueAutomationEvent=(e,t,r)=>({endTime:t,insertTime:r,type:"exponentialRampToValue",value:e}),createExtendedLinearRampToValueAutomationEvent=(e,t,r)=>({endTime:t,insertTime:r,type:"linearRampToValue",value:e}),createSetValueAutomationEvent=(e,t)=>({startTime:t,type:"setValue",value:e}),createSetValueCurveAutomationEvent=(e,t,r)=>({duration:r,startTime:t,type:"setValueCurve",values:e}),getTargetValueAtTime=(e,t,{startTime:r,target:n,timeConstant:i})=>n+(t-n)*Math.exp((r-e)/i),isExponentialRampToValueAutomationEvent=e=>"exponentialRampToValue"===e.type,isLinearRampToValueAutomationEvent=e=>"linearRampToValue"===e.type,isAnyRampToValueAutomationEvent=e=>isExponentialRampToValueAutomationEvent(e)||isLinearRampToValueAutomationEvent(e),isSetValueAutomationEvent=e=>"setValue"===e.type,isSetValueCurveAutomationEvent=e=>"setValueCurve"===e.type,getValueOfAutomationEventAtIndexAtTime=(e,t,r,n)=>{const i=e[t];return void 0===i?n:isAnyRampToValueAutomationEvent(i)||isSetValueAutomationEvent(i)?i.value:isSetValueCurveAutomationEvent(i)?i.values[i.values.length-1]:getTargetValueAtTime(r,getValueOfAutomationEventAtIndexAtTime(e,t-1,i.startTime,n),i)},getEndTimeAndValueOfPreviousAutomationEvent=(e,t,r,n,i)=>void 0===r?[n.insertTime,i]:isAnyRampToValueAutomationEvent(r)?[r.endTime,r.value]:isSetValueAutomationEvent(r)?[r.startTime,r.value]:isSetValueCurveAutomationEvent(r)?[r.startTime+r.duration,r.values[r.values.length-1]]:[r.startTime,getValueOfAutomationEventAtIndexAtTime(e,t-1,r.startTime,i)],isCancelAndHoldAutomationEvent=e=>"cancelAndHold"===e.type,isCancelScheduledValuesAutomationEvent=e=>"cancelScheduledValues"===e.type,getEventTime=e=>isCancelAndHoldAutomationEvent(e)||isCancelScheduledValuesAutomationEvent(e)?e.cancelTime:isExponentialRampToValueAutomationEvent(e)||isLinearRampToValueAutomationEvent(e)?e.endTime:e.startTime,getExponentialRampValueAtTime=(e,t,r,{endTime:n,value:i})=>r===i?i:0<r&&0<i||r<0&&i<0?r*(i/r)**((e-t)/(n-t)):0,getLinearRampValueAtTime=(e,t,r,{endTime:n,value:i})=>r+(e-t)/(n-t)*(i-r),interpolateValue=(e,t)=>{const r=Math.floor(t),n=Math.ceil(t);return r===n?e[r]:(1-(t-r))*e[r]+(1-(n-t))*e[n]},getValueCurveValueAtTime=(e,{duration:t,startTime:r,values:n})=>{const i=(e-r)/t*(n.length-1);return interpolateValue(n,i)},isSetTargetAutomationEvent=e=>"setTarget"===e.type;class AutomationEventList{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=getEventTime(e);if(isCancelAndHoldAutomationEvent(e)||isCancelScheduledValuesAutomationEvent(e)){const r=this._automationEvents.findIndex((r=>isCancelScheduledValuesAutomationEvent(e)&&isSetValueCurveAutomationEvent(r)?r.startTime+r.duration>=t:getEventTime(r)>=t)),n=this._automationEvents[r];if(-1!==r&&(this._automationEvents=this._automationEvents.slice(0,r)),isCancelAndHoldAutomationEvent(e)){const e=this._automationEvents[this._automationEvents.length-1];if(void 0!==n&&isAnyRampToValueAutomationEvent(n)){if(isSetTargetAutomationEvent(e))throw new Error("The internal list is malformed.");const r=isSetValueCurveAutomationEvent(e)?e.startTime+e.duration:getEventTime(e),i=isSetValueCurveAutomationEvent(e)?e.values[e.values.length-1]:e.value,a=isExponentialRampToValueAutomationEvent(n)?getExponentialRampValueAtTime(t,r,i,n):getLinearRampValueAtTime(t,r,i,n),o=isExponentialRampToValueAutomationEvent(n)?createExtendedExponentialRampToValueAutomationEvent(a,t,this._currenTime):createExtendedLinearRampToValueAutomationEvent(a,t,this._currenTime);this._automationEvents.push(o)}void 0!==e&&isSetTargetAutomationEvent(e)&&this._automationEvents.push(createSetValueAutomationEvent(this.getValue(t),t)),void 0!==e&&isSetValueCurveAutomationEvent(e)&&e.startTime+e.duration>t&&(this._automationEvents[this._automationEvents.length-1]=createSetValueCurveAutomationEvent(new Float32Array([6,7]),e.startTime,t-e.startTime))}}else{const r=this._automationEvents.findIndex((e=>getEventTime(e)>t)),n=-1===r?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[r-1];if(void 0!==n&&isSetValueCurveAutomationEvent(n)&&getEventTime(n)+n.duration>t)return!1;const i=isExponentialRampToValueAutomationEvent(e)?createExtendedExponentialRampToValueAutomationEvent(e.value,e.endTime,this._currenTime):isLinearRampToValueAutomationEvent(e)?createExtendedLinearRampToValueAutomationEvent(e.value,t,this._currenTime):e;if(-1===r)this._automationEvents.push(i);else{if(isSetValueCurveAutomationEvent(e)&&t+e.duration>getEventTime(this._automationEvents[r]))return!1;this._automationEvents.splice(r,0,i)}}return!0}flush(e){const t=this._automationEvents.findIndex((t=>getEventTime(t)>e));if(t>1){const e=this._automationEvents.slice(t-1),r=e[0];isSetTargetAutomationEvent(r)&&e.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=e}}getValue(e){if(0===this._automationEvents.length)return this._defaultValue;const t=this._automationEvents.findIndex((t=>getEventTime(t)>e)),r=this._automationEvents[t],n=(-1===t?this._automationEvents.length:t)-1,i=this._automationEvents[n];if(void 0!==i&&isSetTargetAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)||r.insertTime>e))return getTargetValueAtTime(e,getValueOfAutomationEventAtIndexAtTime(this._automationEvents,n-1,i.startTime,this._defaultValue),i);if(void 0!==i&&isSetValueAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)))return i.value;if(void 0!==i&&isSetValueCurveAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)||i.startTime+i.duration>e))return e<i.startTime+i.duration?getValueCurveValueAtTime(e,i):i.values[i.values.length-1];if(void 0!==i&&isAnyRampToValueAutomationEvent(i)&&(void 0===r||!isAnyRampToValueAutomationEvent(r)))return i.value;if(void 0!==r&&isExponentialRampToValueAutomationEvent(r)){const[t,a]=getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents,n,i,r,this._defaultValue);return getExponentialRampValueAtTime(e,t,a,r)}if(void 0!==r&&isLinearRampToValueAutomationEvent(r)){const[t,a]=getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents,n,i,r,this._defaultValue);return getLinearRampValueAtTime(e,t,a,r)}return this._defaultValue}}const createCancelAndHoldAutomationEvent=e=>({cancelTime:e,type:"cancelAndHold"}),createCancelScheduledValuesAutomationEvent=e=>({cancelTime:e,type:"cancelScheduledValues"}),createExponentialRampToValueAutomationEvent=(e,t)=>({endTime:t,type:"exponentialRampToValue",value:e}),createLinearRampToValueAutomationEvent=(e,t)=>({endTime:t,type:"linearRampToValue",value:e}),createSetTargetAutomationEvent=(e,t,r)=>({startTime:t,target:e,timeConstant:r,type:"setTarget"}),createAbortError=()=>new DOMException("","AbortError"),createAddActiveInputConnectionToAudioNode=e=>(t,r,[n,i,a],o)=>{e(t[i],[r,n,a],(e=>e[0]===r&&e[1]===n),o)},createAddAudioNodeConnections=e=>(t,r,n)=>{const i=[];for(let e=0;e<n.numberOfInputs;e+=1)i.push(new Set);e.set(t,{activeInputs:i,outputs:new Set,passiveInputs:new WeakMap,renderer:r})},createAddAudioParamConnections=e=>(t,r)=>{e.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:r})},ACTIVE_AUDIO_NODE_STORE=new WeakSet,AUDIO_NODE_CONNECTIONS_STORE=new WeakMap,AUDIO_NODE_STORE=new WeakMap,AUDIO_PARAM_CONNECTIONS_STORE=new WeakMap,AUDIO_PARAM_STORE=new WeakMap,CONTEXT_STORE=new WeakMap,EVENT_LISTENERS=new WeakMap,CYCLE_COUNTERS=new WeakMap,NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS=new WeakMap,NODE_TO_PROCESSOR_MAPS=new WeakMap,handler={construct:()=>handler},isConstructible=e=>{try{new new Proxy(e,handler)}catch{return!1}return!0},IMPORT_STATEMENT_REGEX=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,splitImportStatements=(e,t)=>{const r=[];let n=e.replace(/^[\s]+/,""),i=n.match(IMPORT_STATEMENT_REGEX);for(;null!==i;){const e=i[1].slice(1,-1),a=i[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());r.push(a),n=n.slice(i[0].length).replace(/^[\s]+/,""),i=n.match(IMPORT_STATEMENT_REGEX)}return[r.join(";"),n]},verifyParameterDescriptors=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},verifyProcessorCtor=e=>{if(!isConstructible(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},createAddAudioWorkletModule=(e,t,r,n,i,a,o,s,l,c,u,d,h)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const _=u.get(f);if(void 0!==_&&_.has(m))return Promise.resolve();const y=c.get(f);if(void 0!==y){const e=y.get(m);if(void 0!==e)return e}const b=a(f),v=void 0===b.audioWorklet?i(m).then((([e,t])=>{const[n,i]=splitImportStatements(e,t);return r(`${n};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${i}
|
|
2
2
|
})})(window,'_AWGS')`)})).then((()=>{const e=h._AWGS.pop();if(void 0===e)throw new SyntaxError;n(b.currentTime,b.sampleRate,(()=>e(class{},void 0,((e,r)=>{if(""===e.trim())throw t();const n=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(b);if(void 0!==n){if(n.has(e))throw t();verifyProcessorCtor(r),verifyParameterDescriptors(r.parameterDescriptors),n.set(e,r)}else verifyProcessorCtor(r),verifyParameterDescriptors(r.parameterDescriptors),NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.set(b,new Map([[e,r]]))}),b.sampleRate,void 0,void 0)))})):Promise.all([i(m),Promise.resolve(e(d,d))]).then((([[e,t],r])=>{const n=p+1;p=n;const[i,a]=splitImportStatements(e,t),c=new Blob([`${i};((AudioWorkletProcessor,registerProcessor)=>{${a}
|
|
3
3
|
})(${r?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${r?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${r?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${n}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),u=URL.createObjectURL(c);return b.audioWorklet.addModule(u,g).then((()=>{if(s(b))return b;const e=o(b);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${n}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===y?c.set(f,new Map([[m,v]])):y.set(m,v),v.then((()=>{const e=u.get(f);void 0===e?u.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=c.get(f);void 0!==e&&e.delete(m)})),v}},getValueForKey=(e,t)=>{const r=e.get(t);if(void 0===r)throw new Error("A value with the given key could not be found.");return r},pickElementFromSet=(e,t)=>{const r=Array.from(e).filter(t);if(r.length>1)throw Error("More than one element was found.");if(0===r.length)throw Error("No element was found.");const[n]=r;return e.delete(n),n},deletePassiveInputConnectionToAudioNode=(e,t,r,n)=>{const i=getValueForKey(e,t),a=pickElementFromSet(i,(e=>e[0]===r&&e[1]===n));return 0===i.size&&e.delete(t),a},getEventListenersOfAudioNode=e=>getValueForKey(EVENT_LISTENERS,e),setInternalStateToActive=e=>{if(ACTIVE_AUDIO_NODE_STORE.has(e))throw new Error("The AudioNode is already stored.");ACTIVE_AUDIO_NODE_STORE.add(e),getEventListenersOfAudioNode(e).forEach((e=>e(!0)))},isAudioWorkletNode=e=>"port"in e,setInternalStateToPassive=e=>{if(!ACTIVE_AUDIO_NODE_STORE.has(e))throw new Error("The AudioNode is not stored.");ACTIVE_AUDIO_NODE_STORE.delete(e),getEventListenersOfAudioNode(e).forEach((e=>e(!1)))},setInternalStateToPassiveWhenNecessary=(e,t)=>{!isAudioWorkletNode(e)&&t.every((e=>0===e.size))&&setInternalStateToPassive(e)},createAddConnectionToAudioNode=(e,t,r,n,i,a,o,s,l,c,u,d,h)=>{const p=new WeakMap;return(f,m,g,_,y)=>{const{activeInputs:b,passiveInputs:v}=a(m),{outputs:S}=a(f),w=s(f),T=a=>{const s=l(m),c=l(f);if(a){const t=deletePassiveInputConnectionToAudioNode(v,f,g,_);e(b,f,t,!1),y||d(f)||r(c,s,g,_),h(m)&&setInternalStateToActive(m)}else{const e=n(b,f,g,_);t(v,_,e,!1),y||d(f)||i(c,s,g,_);const r=o(m);if(0===r)u(m)&&setInternalStateToPassiveWhenNecessary(m,b);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{u(m)&&setInternalStateToPassiveWhenNecessary(m,b)}),1e3*r))}}};return!!c(S,[m,g,_],(e=>e[0]===m&&e[1]===g&&e[2]===_),!0)&&(w.add(T),u(f)?e(b,f,[g,_,T],!0):t(v,_,[f,g,T],!0),!0)}},createAddPassiveInputConnectionToAudioNode=e=>(t,r,[n,i,a],o)=>{const s=t.get(n);void 0===s?t.set(n,new Set([[i,r,a]])):e(s,[i,r,a],(e=>e[0]===i&&e[1]===r),o)},createAddSilentConnection=e=>(t,r)=>{const n=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});r.connect(n).connect(t.destination);const i=()=>{r.removeEventListener("ended",i),r.disconnect(n),n.disconnect()};r.addEventListener("ended",i)},createAddUnrenderedAudioWorkletNode=e=>(t,r)=>{e(t).add(r)},DEFAULT_OPTIONS$j={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},createAnalyserNodeConstructor=(e,t,r,n,i,a)=>class extends e{constructor(e,r){const o=i(e),s={...DEFAULT_OPTIONS$j,...r},l=n(o,s);super(e,!1,l,a(o)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,r()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,r()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}},isOwnedByContext=(e,t)=>e.context===t,createAnalyserNodeRendererFactory=(e,t,r)=>()=>{const n=new WeakMap;return{render(i,a){const o=n.get(a);return void 0!==o?Promise.resolve(o):(async(i,a)=>{let o=t(i);if(!isOwnedByContext(o,a)){const t={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,fftSize:o.fftSize,maxDecibels:o.maxDecibels,minDecibels:o.minDecibels,smoothingTimeConstant:o.smoothingTimeConstant};o=e(a,t)}return n.set(a,o),await r(i,a,o),o})(i,a)}}},testAudioBufferCopyChannelMethodsOutOfBoundsSupport=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},createIndexSizeError=()=>new DOMException("","IndexSizeError"),wrapAudioBufferGetChannelDataMethod=e=>{var t;e.getChannelData=(t=e.getChannelData,r=>{try{return t.call(e,r)}catch(err){if(12===err.code)throw createIndexSizeError();throw err}})},DEFAULT_OPTIONS$i={numberOfChannels:1},createAudioBufferConstructor=(e,t,r,n,i,a,o,s)=>{let l=null;return class c{constructor(c){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:d,sampleRate:h}={...DEFAULT_OPTIONS$i,...c};null===l&&(l=new i(1,1,44100));const p=null!==n&&t(a,a)?new n({length:u,numberOfChannels:d,sampleRate:h}):l.createBuffer(d,u,h);if(0===p.numberOfChannels)throw r();return"function"!=typeof p.copyFromChannel?(o(p),wrapAudioBufferGetChannelDataMethod(p)):t(testAudioBufferCopyChannelMethodsOutOfBoundsSupport,(()=>testAudioBufferCopyChannelMethodsOutOfBoundsSupport(p)))||s(p),e.add(p),p}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===c.prototype||e.has(t)}}},MOST_NEGATIVE_SINGLE_FLOAT=-3402823466385289e23,MOST_POSITIVE_SINGLE_FLOAT=-MOST_NEGATIVE_SINGLE_FLOAT,isActiveAudioNode=e=>ACTIVE_AUDIO_NODE_STORE.has(e),DEFAULT_OPTIONS$h={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},createAudioBufferSourceNodeConstructor=(e,t,r,n,i,a,o,s)=>class extends e{constructor(e,n){const s=a(e),l={...DEFAULT_OPTIONS$h,...n},c=i(s,l),u=o(s),d=u?t():null;super(e,!1,c,d),this._audioBufferSourceNodeRenderer=d,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=r(this,u,c.playbackRate,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw n();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?s(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const r=this._nativeAudioBufferSourceNode.onended;this._onended=null!==r&&r===t?e:r}get playbackRate(){return this._playbackRate}start(e=0,t=0,r){if(this._nativeAudioBufferSourceNode.start(e,t,r),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===r?[e,t]:[e,t,r]),"closed"!==this.context.state){setInternalStateToActive(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}},createAudioBufferSourceNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;let o=null,s=null;return{set start(e){o=e},set stop(e){s=e},render(l,c){const u=a.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=r(l);const d=isOwnedByContext(u,c);if(!d){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==o&&u.start(...o),null!==s&&u.stop(s)}return a.set(c,u),d?await e(c,l.playbackRate,u.playbackRate):await n(c,l.playbackRate,u.playbackRate),await i(l,c,u),u})(l,c)}}},isAudioBufferSourceNode=e=>"playbackRate"in e,isBiquadFilterNode=e=>"frequency"in e&&"gain"in e,isConstantSourceNode=e=>"offset"in e,isGainNode=e=>!("frequency"in e)&&"gain"in e,isOscillatorNode=e=>"detune"in e&&"frequency"in e,isStereoPannerNode=e=>"pan"in e,getAudioNodeConnections=e=>getValueForKey(AUDIO_NODE_CONNECTIONS_STORE,e),getAudioParamConnections=e=>getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE,e),deactivateActiveAudioNodeInputConnections=(e,t)=>{const{activeInputs:r}=getAudioNodeConnections(e);r.forEach((r=>r.forEach((([r])=>{t.includes(e)||deactivateActiveAudioNodeInputConnections(r,[...t,e])}))));const n=isAudioBufferSourceNode(e)?[e.playbackRate]:isAudioWorkletNode(e)?Array.from(e.parameters.values()):isBiquadFilterNode(e)?[e.Q,e.detune,e.frequency,e.gain]:isConstantSourceNode(e)?[e.offset]:isGainNode(e)?[e.gain]:isOscillatorNode(e)?[e.detune,e.frequency]:isStereoPannerNode(e)?[e.pan]:[];for(const i of n){const e=getAudioParamConnections(i);void 0!==e&&e.activeInputs.forEach((([e])=>deactivateActiveAudioNodeInputConnections(e,t)))}isActiveAudioNode(e)&&setInternalStateToPassive(e)},deactivateAudioGraph=e=>{deactivateActiveAudioNodeInputConnections(e.destination,[])},isValidLatencyHint=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),createAudioContextConstructor=(e,t,r,n,i,a,o,s,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(err){if(12===err.code&&"sampleRate is not in range"===err.message)throw r();throw err}if(null===t)throw n();if(!isValidLatencyHint(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw r();super(t,2);const{latencyHint:i}=e,{sampleRate:a}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===i?512/a:"interactive"===i||void 0===i?256/a:"playback"===i?1024/a:128*Math.max(2,Math.min(128,Math.round(i*a/128)))/a,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),deactivateAudioGraph(this)})))}createMediaElementSource(e){return new i(this,{mediaElement:e})}createMediaStreamDestination(){return new a(this)}createMediaStreamSource(e){return new o(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new s(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const r=()=>{this._nativeAudioContext.removeEventListener("statechange",r),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",r)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}},createAudioDestinationNodeConstructor=(e,t,r,n,i,a,o,s)=>class extends e{constructor(e,r){const n=a(e),l=o(n),c=i(n,r,l);super(e,!1,c,l?t(s):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw n();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw r();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw n();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},createAudioDestinationNodeRenderer=e=>{const t=new WeakMap;return{render(r,n){const i=t.get(n);return void 0!==i?Promise.resolve(i):(async(r,n)=>{const i=n.destination;return t.set(n,i),await e(r,n,i),i})(r,n)}}},createAudioListenerFactory=(e,t,r,n,i,a,o,s)=>(l,c)=>{const u=c.listener,{forwardX:d,forwardY:h,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:_,upY:y,upZ:b}=void 0===u.forwardX?(()=>{const d=new Float32Array(1),h=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=o(c);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const _=()=>{if(f)return;f=!0;const e=n(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[a(e,d,0),a(e,d,1),a(e,d,2),a(e,d,3),a(e,d,4),a(e,d,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const r=[a(e,d,6),a(e,d,7),a(e,d,8)];r.some(((e,t)=>e!==g[t]))&&(u.setPosition(...r),g=r)},h.connect(e)},y=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},b=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},v=(t,n,a)=>{const o=r(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:n});o.connect(h,0,t),o.start(),Object.defineProperty(o.offset,"defaultValue",{get:()=>n});const u=e({context:l},p,o.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT);var d,f,m,g,y,b,v;return s(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(err){if(9!==err.code)throw err}_(),p&&a(t)})),u.cancelAndHoldAtTime=(d=u.cancelAndHoldAtTime,p?()=>{throw i()}:(...e)=>{const t=d.apply(u,e);return _(),t}),u.cancelScheduledValues=(f=u.cancelScheduledValues,p?()=>{throw i()}:(...e)=>{const t=f.apply(u,e);return _(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,p?()=>{throw i()}:(...e)=>{const t=m.apply(u,e);return _(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,p?()=>{throw i()}:(...e)=>{const t=g.apply(u,e);return _(),t}),u.setTargetAtTime=(y=u.setTargetAtTime,p?()=>{throw i()}:(...e)=>{const t=y.apply(u,e);return _(),t}),u.setValueAtTime=(b=u.setValueAtTime,p?()=>{throw i()}:(...e)=>{const t=b.apply(u,e);return _(),t}),u.setValueCurveAtTime=(v=u.setValueCurveAtTime,p?()=>{throw i()}:(...e)=>{const t=v.apply(u,e);return _(),t}),u};return{forwardX:v(0,0,y(0)),forwardY:v(1,0,y(1)),forwardZ:v(2,-1,y(2)),positionX:v(6,0,b(0)),positionY:v(7,0,b(1)),positionZ:v(8,0,b(2)),upX:v(3,0,y(3)),upY:v(4,1,y(4)),upZ:v(5,0,y(5))}})():u;return{get forwardX(){return d},get forwardY(){return h},get forwardZ(){return p},get positionX(){return f},get positionY(){return m},get positionZ(){return g},get upX(){return _},get upY(){return y},get upZ(){return b}}},isAudioNode$1=e=>"context"in e,isAudioNodeOutputConnection=e=>isAudioNode$1(e[0]),insertElementInSet=(e,t,r,n)=>{for(const i of e)if(r(i)){if(n)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},addActiveInputConnectionToAudioParam=(e,t,[r,n],i)=>{insertElementInSet(e,[t,r,n],(e=>e[0]===t&&e[1]===r),i)},addPassiveInputConnectionToAudioParam=(e,[t,r,n],i)=>{const a=e.get(t);void 0===a?e.set(t,new Set([[r,n]])):insertElementInSet(a,[r,n],(e=>e[0]===r),i)},isNativeAudioNodeFaker=e=>"inputs"in e,connectNativeAudioNodeToNativeAudioNode=(e,t,r,n)=>{if(isNativeAudioNodeFaker(t)){const i=t.inputs[n];return e.connect(i,r,0),[i,r,0]}return e.connect(t,r,n),[t,r,n]},deleteActiveInputConnection=(e,t,r)=>{for(const n of e)if(n[0]===t&&n[1]===r)return e.delete(n),n;return null},deleteActiveInputConnectionToAudioParam=(e,t,r)=>pickElementFromSet(e,(e=>e[0]===t&&e[1]===r)),deleteEventListenerOfAudioNode=(e,t)=>{if(!getEventListenersOfAudioNode(e).delete(t))throw new Error("Missing the expected event listener.")},deletePassiveInputConnectionToAudioParam=(e,t,r)=>{const n=getValueForKey(e,t),i=pickElementFromSet(n,(e=>e[0]===r));return 0===n.size&&e.delete(t),i},disconnectNativeAudioNodeFromNativeAudioNode=(e,t,r,n)=>{isNativeAudioNodeFaker(t)?e.disconnect(t.inputs[n],r,0):e.disconnect(t,r,n)},getNativeAudioNode=e=>getValueForKey(AUDIO_NODE_STORE,e),getNativeAudioParam=e=>getValueForKey(AUDIO_PARAM_STORE,e),isPartOfACycle=e=>CYCLE_COUNTERS.has(e),isPassiveAudioNode=e=>!ACTIVE_AUDIO_NODE_STORE.has(e),testAudioNodeDisconnectMethodSupport=(e,t)=>new Promise((r=>{if(null!==t)r(!0);else{const t=e.createScriptProcessor(256,1,1),n=e.createGain(),i=e.createBuffer(1,2,44100),a=i.getChannelData(0);a[0]=1,a[1]=1;const o=e.createBufferSource();o.buffer=i,o.loop=!0,o.connect(t).connect(e.destination),o.connect(n),o.disconnect(n),t.onaudioprocess=n=>{const i=n.inputBuffer.getChannelData(0);Array.prototype.some.call(i,(e=>1===e))?r(!0):r(!1),o.stop(),t.onaudioprocess=null,o.disconnect(t),t.disconnect(e.destination)},o.start()}})),visitEachAudioNodeOnce=(e,t)=>{const r=new Map;for(const n of e)for(const e of n){const t=r.get(e);r.set(e,void 0===t?1:t+1)}r.forEach(((e,r)=>t(r,e)))},isNativeAudioNode$1=e=>"context"in e,wrapAudioNodeDisconnectMethod=e=>{const t=new Map;e.connect=(e=>(r,n=0,i=0)=>{const a=isNativeAudioNode$1(r)?e(r,n,i):e(r,n),o=t.get(r);return void 0===o?t.set(r,[{input:i,output:n}]):o.every((e=>e.input!==i||e.output!==n))&&o.push({input:i,output:n}),a})(e.connect.bind(e)),e.disconnect=(r=>(n,i,a)=>{if(r.apply(e),void 0===n)t.clear();else if("number"==typeof n)for(const[e,r]of t){const i=r.filter((e=>e.output!==n));0===i.length?t.delete(e):t.set(e,i)}else if(t.has(n))if(void 0===i)t.delete(n);else{const e=t.get(n);if(void 0!==e){const r=e.filter((e=>e.output!==i&&(e.input!==a||void 0===a)));0===r.length?t.delete(n):t.set(n,r)}}for(const[r,o]of t)o.forEach((t=>{isNativeAudioNode$1(r)?e.connect(r,t.output,t.input):e.connect(r,t.output)}))})(e.disconnect)},addConnectionToAudioParamOfAudioContext=(e,t,r,n)=>{const{activeInputs:i,passiveInputs:a}=getAudioParamConnections(t),{outputs:o}=getAudioNodeConnections(e),s=getEventListenersOfAudioNode(e),l=o=>{const s=getNativeAudioNode(e),l=getNativeAudioParam(t);if(o){const t=deletePassiveInputConnectionToAudioParam(a,e,r);addActiveInputConnectionToAudioParam(i,e,t,!1),n||isPartOfACycle(e)||s.connect(l,r)}else{const t=deleteActiveInputConnectionToAudioParam(i,e,r);addPassiveInputConnectionToAudioParam(a,t,!1),n||isPartOfACycle(e)||s.disconnect(l,r)}};return!!insertElementInSet(o,[t,r],(e=>e[0]===t&&e[1]===r),!0)&&(s.add(l),isActiveAudioNode(e)?addActiveInputConnectionToAudioParam(i,e,[r,l],!0):addPassiveInputConnectionToAudioParam(a,[e,r,l],!0),!0)},deleteInputConnectionOfAudioNode=(e,t,r,n)=>{const{activeInputs:i,passiveInputs:a}=getAudioNodeConnections(t),o=deleteActiveInputConnection(i[n],e,r);if(null===o){return[deletePassiveInputConnectionToAudioNode(a,e,r,n)[2],!1]}return[o[2],!0]},deleteInputConnectionOfAudioParam=(e,t,r)=>{const{activeInputs:n,passiveInputs:i}=getAudioParamConnections(t),a=deleteActiveInputConnection(n,e,r);if(null===a){return[deletePassiveInputConnectionToAudioParam(i,e,r)[1],!1]}return[a[2],!0]},deleteInputsOfAudioNode=(e,t,r,n,i)=>{const[a,o]=deleteInputConnectionOfAudioNode(e,r,n,i);if(null!==a&&(deleteEventListenerOfAudioNode(e,a),!o||t||isPartOfACycle(e)||disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(e),getNativeAudioNode(r),n,i)),isActiveAudioNode(r)){const{activeInputs:e}=getAudioNodeConnections(r);setInternalStateToPassiveWhenNecessary(r,e)}},deleteInputsOfAudioParam=(e,t,r,n)=>{const[i,a]=deleteInputConnectionOfAudioParam(e,r,n);null!==i&&(deleteEventListenerOfAudioNode(e,i),!a||t||isPartOfACycle(e)||getNativeAudioNode(e).disconnect(getNativeAudioParam(r),n))},deleteAnyConnection=(e,t)=>{const r=getAudioNodeConnections(e),n=[];for(const i of r.outputs)isAudioNodeOutputConnection(i)?deleteInputsOfAudioNode(e,t,...i):deleteInputsOfAudioParam(e,t,...i),n.push(i[0]);return r.outputs.clear(),n},deleteConnectionAtOutput=(e,t,r)=>{const n=getAudioNodeConnections(e),i=[];for(const a of n.outputs)a[1]===r&&(isAudioNodeOutputConnection(a)?deleteInputsOfAudioNode(e,t,...a):deleteInputsOfAudioParam(e,t,...a),i.push(a[0]),n.outputs.delete(a));return i},deleteConnectionToDestination=(e,t,r,n,i)=>{const a=getAudioNodeConnections(e);return Array.from(a.outputs).filter((e=>!(e[0]!==r||void 0!==n&&e[1]!==n||void 0!==i&&e[2]!==i))).map((r=>(isAudioNodeOutputConnection(r)?deleteInputsOfAudioNode(e,t,...r):deleteInputsOfAudioParam(e,t,...r),a.outputs.delete(r),r[0])))},createAudioNodeConstructor=(e,t,r,n,i,a,o,s,l,c,u,d,h,p,f,m)=>class extends c{constructor(t,n,i,a){super(i),this._context=t,this._nativeAudioNode=i;const o=u(t);d(o)&&!0!==r(testAudioNodeDisconnectMethodSupport,(()=>testAudioNodeDisconnectMethodSupport(o,m)))&&wrapAudioNodeDisconnectMethod(i),AUDIO_NODE_STORE.set(this,i),EVENT_LISTENERS.set(this,new Set),"closed"!==t.state&&n&&setInternalStateToActive(this),e(this,a,i)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,r=0,s=0){if(r<0||r>=this._nativeAudioNode.numberOfOutputs)throw i();const c=u(this._context),d=f(c);if(h(e)||p(e))throw a();if(isAudioNode$1(e)){const i=getNativeAudioNode(e);try{const t=connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode,i,r,s),n=isPassiveAudioNode(this);(d||n)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!n&&isPassiveAudioNode(e)&&setInternalStateToActive(e)}catch(err){if(12===err.code)throw a();throw err}if(t(this,e,r,s,d)){const t=l([this],e);visitEachAudioNodeOnce(t,n(d))}return e}const m=getNativeAudioParam(e);if("playbackRate"===m.name&&1024===m.maxValue)throw o();try{this._nativeAudioNode.connect(m,r),(d||isPassiveAudioNode(this))&&this._nativeAudioNode.disconnect(m,r)}catch(err){if(12===err.code)throw a();throw err}if(addConnectionToAudioParamOfAudioContext(this,e,r,d)){const t=l([this],e);visitEachAudioNodeOnce(t,n(d))}}disconnect(e,t,r){let n;const o=u(this._context),c=f(o);if(void 0===e)n=deleteAnyConnection(this,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw i();n=deleteConnectionAtOutput(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw i();if(isAudioNode$1(e)&&void 0!==r&&(r<0||r>=e.numberOfInputs))throw i();if(n=deleteConnectionToDestination(this,c,e,t,r),0===n.length)throw a()}for(const i of n){const e=l([this],i);visitEachAudioNodeOnce(e,s)}}},createAudioParamFactory=(e,t,r,n,i,a,o,s,l,c,u,d,h)=>(p,f,m,g=null,_=null)=>{const y=new AutomationEventList(m.defaultValue),b=f?n(y):null,v={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===_?m.minValue:_},get value(){return m.value},set value(e){m.value=e,v.setValueAtTime(e,p.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===b&&y.flush(p.context.currentTime),y.add(i(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(y).pop();null===b&&y.flush(p.context.currentTime),y.add(i(e));const r=Array.from(y).pop();m.cancelScheduledValues(e),t!==r&&void 0!==r&&("exponentialRampToValue"===r.type?m.exponentialRampToValueAtTime(r.value,r.endTime):"linearRampToValue"===r.type?m.linearRampToValueAtTime(r.value,r.endTime):"setValue"===r.type?m.setValueAtTime(r.value,r.startTime):"setValueCurve"===r.type&&m.setValueCurveAtTime(r.values,r.startTime,r.duration))}return v},cancelScheduledValues:e=>(null===b&&y.flush(p.context.currentTime),y.add(a(e)),m.cancelScheduledValues(e),v),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;return null===b&&y.flush(p.context.currentTime),y.add(o(e,t)),m.exponentialRampToValueAtTime(e,t),v},linearRampToValueAtTime:(e,t)=>(null===b&&y.flush(p.context.currentTime),y.add(s(e,t)),m.linearRampToValueAtTime(e,t),v),setTargetAtTime:(e,t,r)=>(null===b&&y.flush(p.context.currentTime),y.add(l(e,t,r)),m.setTargetAtTime(e,t,r),v),setValueAtTime:(e,t)=>(null===b&&y.flush(p.context.currentTime),y.add(c(e,t)),m.setValueAtTime(e,t),v),setValueCurveAtTime(e,t,r){const n=e instanceof Float32Array?e:new Float32Array(e);if(null!==d&&"webkitAudioContext"===d.name){const e=t+r,i=p.context.sampleRate,a=Math.ceil(t*i),o=Math.floor(e*i),s=o-a,l=new Float32Array(s);for(let u=0;u<s;u+=1){const e=(n.length-1)/r*((a+u)/i-t),o=Math.floor(e),s=Math.ceil(e);l[u]=o===s?n[o]:(1-(e-o))*n[o]+(1-(s-e))*n[s]}null===b&&y.flush(p.context.currentTime),y.add(u(l,t,r)),m.setValueCurveAtTime(l,t,r);const c=o/i;c<e&&h(v,l[l.length-1],c),h(v,n[n.length-1],e)}else null===b&&y.flush(p.context.currentTime),y.add(u(n,t,r)),m.setValueCurveAtTime(n,t,r);return v}};return r.set(v,m),t.set(v,p),e(v,b),v},createAudioParamRenderer=e=>({replay(t){for(const r of e)if("exponentialRampToValue"===r.type){const{endTime:e,value:n}=r;t.exponentialRampToValueAtTime(n,e)}else if("linearRampToValue"===r.type){const{endTime:e,value:n}=r;t.linearRampToValueAtTime(n,e)}else if("setTarget"===r.type){const{startTime:e,target:n,timeConstant:i}=r;t.setTargetAtTime(n,e,i)}else if("setValue"===r.type){const{startTime:e,value:n}=r;t.setValueAtTime(n,e)}else{if("setValueCurve"!==r.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:n,values:i}=r;t.setValueCurveAtTime(i,n,e)}}}});class ReadOnlyMap{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((r,n)=>e.call(t,r,n,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const DEFAULT_OPTIONS$g={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},createAudioWorkletNodeConstructor=(e,t,r,n,i,a,o,s,l,c,u,d,h,p)=>class extends t{constructor(t,p,f){var m;const g=s(t),_=l(g),y=u({...DEFAULT_OPTIONS$g,...f});h(y);const b=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(g),v=null==b?void 0:b.get(p),S=_||"closed"!==g.state?g:null!==(m=o(g))&&void 0!==m?m:g,w=i(S,_?null:t.baseLatency,c,p,v,y);super(t,!0,w,_?n(p,y,v):null);const T=[];w.parameters.forEach(((e,t)=>{const n=r(this,_,e);T.push([t,n])})),this._nativeAudioWorkletNode=w,this._onprocessorerror=null,this._parameters=new ReadOnlyMap(T),_&&e(g,this);const{activeInputs:E}=a(this);d(w,E)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(e){const t="function"==typeof e?p(this,e):null;this._nativeAudioWorkletNode.onprocessorerror=t;const r=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==r&&r===t?e:r}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function copyFromChannel(e,t,r,n,i){if("function"==typeof e.copyFromChannel)0===t[r].byteLength&&(t[r]=new Float32Array(128)),e.copyFromChannel(t[r],n,i);else{const a=e.getChannelData(n);if(0===t[r].byteLength)t[r]=a.slice(i,i+128);else{const e=new Float32Array(a.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);t[r].set(e)}}}const copyToChannel=(e,t,r,n,i)=>{"function"==typeof e.copyToChannel?0!==t[r].byteLength&&e.copyToChannel(t[r],n,i):0!==t[r].byteLength&&e.getChannelData(n).set(t[r],i)},createNestedArrays=(e,t)=>{const r=[];for(let n=0;n<e;n+=1){const e=[],i="number"==typeof t?t:t[n];for(let t=0;t<i;t+=1)e.push(new Float32Array(128));r.push(e)}return r},getAudioWorkletProcessor=(e,t)=>{const r=getValueForKey(NODE_TO_PROCESSOR_MAPS,e),n=getNativeAudioNode(t);return getValueForKey(r,n)},processBuffer=async(e,t,r,n,i,a,o)=>{const s=null===t?128*Math.ceil(e.context.length/128):t.length,l=n.channelCount*n.numberOfInputs,c=i.reduce(((e,t)=>e+t),0),u=0===c?null:r.createBuffer(c,s,r.sampleRate);if(void 0===a)throw new Error("Missing the processor constructor.");const d=getAudioNodeConnections(e),h=await getAudioWorkletProcessor(r,e),p=createNestedArrays(n.numberOfInputs,n.channelCount),f=createNestedArrays(n.numberOfOutputs,i),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let g=0;g<s;g+=128){if(n.numberOfInputs>0&&null!==t)for(let e=0;e<n.numberOfInputs;e+=1)for(let r=0;r<n.channelCount;r+=1)copyFromChannel(t,p[e],r,r,g);void 0!==a.parameterDescriptors&&null!==t&&a.parameterDescriptors.forEach((({name:e},r)=>{copyFromChannel(t,m,e,l+r,g)}));for(let e=0;e<n.numberOfInputs;e+=1)for(let t=0;t<i[e];t+=1)0===f[e][t].byteLength&&(f[e][t]=new Float32Array(128));try{const e=p.map(((e,t)=>0===d.activeInputs[t].size?[]:e)),t=o(g/r.sampleRate,r.sampleRate,(()=>h.process(e,f,m)));if(null!==u)for(let r=0,a=0;r<n.numberOfOutputs;r+=1){for(let e=0;e<i[r];e+=1)copyToChannel(u,f[r],e,a+e,g);a+=i[r]}if(!t)break}catch(error){e.dispatchEvent(new ErrorEvent("processorerror",{colno:error.colno,filename:error.filename,lineno:error.lineno,message:error.message}));break}}return u},createAudioWorkletNodeRendererFactory=(e,t,r,n,i,a,o,s,l,c,u,d,h,p,f,m)=>(g,_,y)=>{const b=new WeakMap;let v=null;return{render(S,w){s(w,S);const T=b.get(w);return void 0!==T?Promise.resolve(T):(async(s,S)=>{let w=u(s),T=null;const E=isOwnedByContext(w,S),x=Array.isArray(_.outputChannelCount)?_.outputChannelCount:Array.from(_.outputChannelCount);if(null===d){const e=x.reduce(((e,t)=>e+t),0),r=i(S,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),a=[];for(let t=0;t<s.numberOfOutputs;t+=1)a.push(n(S,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:x[t]}));const c=o(S,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1});c.connect=t.bind(null,a),c.disconnect=l.bind(null,a),T=[r,a,c]}else E||(w=new d(S,g));if(b.set(S,null===T?w:T[2]),null!==T){if(null===v){if(void 0===y)throw new Error("Missing the processor constructor.");if(null===h)throw new Error("Missing the native OfflineAudioContext constructor.");const e=s.channelCount*s.numberOfInputs,t=void 0===y.parameterDescriptors?0:y.parameterDescriptors.length,r=e+t,l=async()=>{const l=new h(r,128*Math.ceil(s.context.length/128),S.sampleRate),c=[],u=[];for(let e=0;e<_.numberOfInputs;e+=1)c.push(o(l,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1})),u.push(i(l,{channelCount:_.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:_.channelCount}));const d=await Promise.all(Array.from(s.parameters.values()).map((async e=>{const t=a(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await p(l,e,t.offset),t}))),g=n(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;e<_.numberOfInputs;e+=1){c[e].connect(u[e]);for(let t=0;t<_.channelCount;t+=1)u[e].connect(g,t,e*_.channelCount+t)}for(const[t,r]of d.entries())r.connect(g,0,e+t),r.start(0);return g.connect(l.destination),await Promise.all(c.map((e=>f(s,l,e)))),m(l)};v=processBuffer(s,0===r?null:await l(),S,_,x,y,c)}const e=await v,t=r(S,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,d]=T;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let r=0,n=0;r<s.numberOfOutputs;r+=1){const e=u[r];for(let t=0;t<x[r];t+=1)l.connect(e,n+t,t);n+=x[r]}return d}if(E)for(const[t,r]of s.parameters.entries())await e(S,r,w.parameters.get(t));else for(const[e,t]of s.parameters.entries())await p(S,t,w.parameters.get(e));return await f(s,S,w),w})(S,w)}}},createBaseAudioContextConstructor=(e,t,r,n,i,a,o,s,l,c,u,d,h,p,f,m,g,_,y,b)=>class extends f{constructor(t,r){super(t,r),this._nativeContext=t,this._audioWorklet=void 0===e?void 0:{addModule:(t,r)=>e(this,t,r)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new i(this)}createBuffer(e,t,n){return new r({length:t,numberOfChannels:e,sampleRate:n})}createBufferSource(){return new n(this)}createChannelMerger(e=6){return new a(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new o(this,{numberOfOutputs:e})}createConstantSource(){return new s(this)}createConvolver(){return new l(this)}createDelay(e=1){return new u(this,{maxDelayTime:e})}createDynamicsCompressor(){return new d(this)}createGain(){return new h(this)}createIIRFilter(e,t){return new p(this,{feedback:t,feedforward:e})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(e,t,r={disableNormalization:!1}){return new _(this,{...r,imag:t,real:e})}createStereoPanner(){return new y(this)}createWaveShaper(){return new b(this)}decodeAudioData(e,t,r){return c(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof r&&r(e),e}))}},DEFAULT_OPTIONS$f={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},createBiquadFilterNodeConstructor=(e,t,r,n,i,a,o,s)=>class extends e{constructor(e,n){const l=a(e),c={...DEFAULT_OPTIONS$f,...n},u=i(l,c),d=o(l);super(e,!1,u,d?r():null),this._Q=t(this,d,u.Q,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._detune=t(this,d,u.detune,1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT),-1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT)),this._frequency=t(this,d,u.frequency,e.sampleRate/2,0),this._gain=t(this,d,u.gain,40*Math.log10(MOST_POSITIVE_SINGLE_FLOAT),MOST_NEGATIVE_SINGLE_FLOAT),this._nativeBiquadFilterNode=u,s(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,r){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,r)}catch(err){if(11===err.code)throw n();throw err}if(e.length!==t.length||t.length!==r.length)throw n()}},createBiquadFilterNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;return{render(o,s){const l=a.get(s);return void 0!==l?Promise.resolve(l):(async(o,s)=>{let l=r(o);const c=isOwnedByContext(l,s);if(!c){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(s,e)}return a.set(s,l),c?(await e(s,o.Q,l.Q),await e(s,o.detune,l.detune),await e(s,o.frequency,l.frequency),await e(s,o.gain,l.gain)):(await n(s,o.Q,l.Q),await n(s,o.detune,l.detune),await n(s,o.frequency,l.frequency),await n(s,o.gain,l.gain)),await i(o,s,l),l})(o,s)}}},createCacheTestResult=(e,t)=>(r,n)=>{const i=t.get(r);if(void 0!==i)return i;const a=e.get(r);if(void 0!==a)return a;try{const i=n();return i instanceof Promise?(e.set(r,i),i.catch((()=>!1)).then((n=>(e.delete(r),t.set(r,n),n)))):(t.set(r,i),i)}catch{return t.set(r,!1),!1}},DEFAULT_OPTIONS$e={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},createChannelMergerNodeConstructor=(e,t,r,n,i)=>class extends e{constructor(e,a){const o=n(e),s={...DEFAULT_OPTIONS$e,...a};super(e,!1,r(o,s),i(o)?t():null)}},createChannelMergerNodeRendererFactory=(e,t,r)=>()=>{const n=new WeakMap;return{render(i,a){const o=n.get(a);return void 0!==o?Promise.resolve(o):(async(i,a)=>{let o=t(i);if(!isOwnedByContext(o,a)){const t={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,numberOfInputs:o.numberOfInputs};o=e(a,t)}return n.set(a,o),await r(i,a,o),o})(i,a)}}},DEFAULT_OPTIONS$d={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},createChannelSplitterNodeConstructor=(e,t,r,n,i,a)=>class extends e{constructor(e,o){const s=n(e),l=a({...DEFAULT_OPTIONS$d,...o});super(e,!1,r(s,l),i(s)?t():null)}},createChannelSplitterNodeRendererFactory=(e,t,r)=>()=>{const n=new WeakMap;return{render(i,a){const o=n.get(a);return void 0!==o?Promise.resolve(o):(async(i,a)=>{let o=t(i);if(!isOwnedByContext(o,a)){const t={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,numberOfOutputs:o.numberOfOutputs};o=e(a,t)}return n.set(a,o),await r(i,a,o),o})(i,a)}}},createConnectAudioParam=e=>(t,r,n)=>e(r,t,n),createConnectMultipleOutputs=e=>(t,r,n=0,i=0)=>{const a=t[n];if(void 0===a)throw e();return isNativeAudioNode$1(r)?a.connect(r,0,i):a.connect(r,0)},createConnectedNativeAudioBufferSourceNodeFactory=e=>(t,r)=>{const n=e(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),i=t.createBuffer(1,2,44100);return n.buffer=i,n.loop=!0,n.connect(r),n.start(),()=>{n.stop(),n.disconnect(r)}},DEFAULT_OPTIONS$c={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},createConstantSourceNodeConstructor=(e,t,r,n,i,a,o)=>class extends e{constructor(e,o){const s=i(e),l={...DEFAULT_OPTIONS$c,...o},c=n(s,l),u=a(s),d=u?r():null;super(e,!1,c,d),this._constantSourceNodeRenderer=d,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?o(this,e):null;this._nativeConstantSourceNode.onended=t;const r=this._nativeConstantSourceNode.onended;this._onended=null!==r&&r===t?e:r}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){setInternalStateToActive(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}},createConstantSourceNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;let o=null,s=null;return{set start(e){o=e},set stop(e){s=e},render(l,c){const u=a.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=r(l);const d=isOwnedByContext(u,c);if(!d){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==o&&u.start(o),null!==s&&u.stop(s)}return a.set(c,u),d?await e(c,l.offset,u.offset):await n(c,l.offset,u.offset),await i(l,c,u),u})(l,c)}}},createConvertNumberToUnsignedLong=e=>t=>(e[0]=t,e[0]),DEFAULT_OPTIONS$b={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},createConvolverNodeConstructor=(e,t,r,n,i,a)=>class extends e{constructor(e,o){const s=n(e),l={...DEFAULT_OPTIONS$b,...o},c=r(s,l);super(e,!1,c,i(s)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&a(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,a(this,0)}else this._isBufferNullified=!1,a(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}},createConvolverNodeRendererFactory=(e,t,r)=>()=>{const n=new WeakMap;return{render(i,a){const o=n.get(a);return void 0!==o?Promise.resolve(o):(async(i,a)=>{let o=t(i);if(!isOwnedByContext(o,a)){const t={buffer:o.buffer,channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,disableNormalization:!o.normalize};o=e(a,t)}return n.set(a,o),isNativeAudioNodeFaker(o)?await r(i,a,o.inputs[0]):await r(i,a,o),o})(i,a)}}},createCreateNativeOfflineAudioContext=(e,t)=>(r,n,i)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(r,n,i)}catch(err){if("SyntaxError"===err.name)throw e();throw err}},createDataCloneError=()=>new DOMException("","DataCloneError"),detachArrayBuffer=e=>{const{port1:t,port2:r}=new MessageChannel;return new Promise((n=>{const i=()=>{r.onmessage=null,t.close(),r.close(),n()};r.onmessage=()=>i();try{t.postMessage(e,[e])}finally{i()}}))},createDecodeAudioData=(e,t,r,n,i,a,o,s,l,c,u)=>(d,h)=>{const p=o(d)?d:a(d);if(i.has(h)){const e=r();return Promise.reject(e)}try{i.add(h)}catch{}return t(l,(()=>l(p)))?p.decodeAudioData(h).then((r=>(detachArrayBuffer(h).catch((()=>{})),t(s,(()=>s(r)))||u(r),e.add(r),r))):new Promise(((t,r)=>{const i=async()=>{try{await detachArrayBuffer(h)}catch{}},a=e=>{r(e),i()};try{p.decodeAudioData(h,(r=>{"function"!=typeof r.copyFromChannel&&(c(r),wrapAudioBufferGetChannelDataMethod(r)),e.add(r),i().then((()=>t(r)))}),(e=>{a(null===e?n():e)}))}catch(err){a(err)}}))},createDecrementCycleCounter=(e,t,r,n,i,a,o,s)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const d=a(l.context),h=s(d);if(u===c){if(t.delete(l),!h&&o(l)){const t=n(l),{outputs:a}=r(l);for(const r of a)if(isAudioNodeOutputConnection(r)){const i=n(r[0]);e(t,i,r[1],r[2])}else{const e=i(r[0]);t.connect(e,r[1])}}}else t.set(l,u-c)},DEFAULT_OPTIONS$a={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},createDelayNodeConstructor=(e,t,r,n,i,a,o)=>class extends e{constructor(e,s){const l=i(e),c={...DEFAULT_OPTIONS$a,...s},u=n(l,c),d=a(l);super(e,!1,u,d?r(c.maxDelayTime):null),this._delayTime=t(this,d,u.delayTime),o(this,c.maxDelayTime)}get delayTime(){return this._delayTime}},createDelayNodeRendererFactory=(e,t,r,n,i)=>a=>{const o=new WeakMap;return{render(s,l){const c=o.get(l);return void 0!==c?Promise.resolve(c):(async(s,l)=>{let c=r(s);const u=isOwnedByContext(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:a};c=t(l,e)}return o.set(l,c),u?await e(l,s.delayTime,c.delayTime):await n(l,s.delayTime,c.delayTime),await i(s,l,c),c})(s,l)}}},createDeleteActiveInputConnectionToAudioNode=e=>(t,r,n,i)=>e(t[i],(e=>e[0]===r&&e[1]===n)),createDeleteUnrenderedAudioWorkletNode=e=>(t,r)=>{e(t).delete(r)},isDelayNode=e=>"delayTime"in e,createDetectCycles=(e,t,r)=>function n(i,a){const o=isAudioNode$1(a)?a:r(e,a);if(isDelayNode(o))return[];if(i[0]===o)return[i];if(i.includes(o))return[];const{outputs:s}=t(o);return Array.from(s).map((e=>n([...i,o],e[0]))).reduce(((e,t)=>e.concat(t)),[])},getOutputAudioNodeAtIndex=(e,t,r)=>{const n=t[r];if(void 0===n)throw e();return n},createDisconnectMultipleOutputs=e=>(t,r=void 0,n=void 0,i=0)=>void 0===r?t.forEach((e=>e.disconnect())):"number"==typeof r?getOutputAudioNodeAtIndex(e,t,r).disconnect():isNativeAudioNode$1(r)?void 0===n?t.forEach((e=>e.disconnect(r))):void 0===i?getOutputAudioNodeAtIndex(e,t,n).disconnect(r,0):getOutputAudioNodeAtIndex(e,t,n).disconnect(r,0,i):void 0===n?t.forEach((e=>e.disconnect(r))):getOutputAudioNodeAtIndex(e,t,n).disconnect(r,0),DEFAULT_OPTIONS$9={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},createDynamicsCompressorNodeConstructor=(e,t,r,n,i,a,o,s)=>class extends e{constructor(e,i){const l=a(e),c={...DEFAULT_OPTIONS$9,...i},u=n(l,c),d=o(l);super(e,!1,u,d?r():null),this._attack=t(this,d,u.attack),this._knee=t(this,d,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,d,u.ratio),this._release=t(this,d,u.release),this._threshold=t(this,d,u.threshold),s(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},createDynamicsCompressorNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;return{render(o,s){const l=a.get(s);return void 0!==l?Promise.resolve(l):(async(o,s)=>{let l=r(o);const c=isOwnedByContext(l,s);if(!c){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(s,e)}return a.set(s,l),c?(await e(s,o.attack,l.attack),await e(s,o.knee,l.knee),await e(s,o.ratio,l.ratio),await e(s,o.release,l.release),await e(s,o.threshold,l.threshold)):(await n(s,o.attack,l.attack),await n(s,o.knee,l.knee),await n(s,o.ratio,l.ratio),await n(s,o.release,l.release),await n(s,o.threshold,l.threshold)),await i(o,s,l),l})(o,s)}}},createEncodingError=()=>new DOMException("","EncodingError"),createEvaluateSource=e=>t=>new Promise(((r,n)=>{if(null===e)return void n(new SyntaxError);const i=e.document.head;if(null===i)n(new SyntaxError);else{const a=e.document.createElement("script"),o=new Blob([t],{type:"application/javascript"}),s=URL.createObjectURL(o),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(s)};e.onerror=(t,r,i,a,o)=>r===s||r===e.location.href&&1===i&&1===a?(c(),n(o),!1):null!==l?l(t,r,i,a,o):void 0,a.onerror=()=>{c(),n(new SyntaxError)},a.onload=()=>{c(),r()},a.src=s,a.type="module",i.appendChild(a)}})),createEventTargetConstructor=e=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(t,r,n){if(null!==r){let i=this._listeners.get(r);void 0===i&&(i=e(this,r),"function"==typeof r&&this._listeners.set(r,i)),this._nativeEventTarget.addEventListener(t,i,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,r){const n=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===n?null:n,r)}},createExposeCurrentFrameAndCurrentTime=e=>(t,r,n)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*r)},currentTime:{configurable:!0,get:()=>t}});try{return n()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}},createFetchSource=e=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw e()},DEFAULT_OPTIONS$8={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},createGainNodeConstructor=(e,t,r,n,i,a)=>class extends e{constructor(e,o){const s=i(e),l={...DEFAULT_OPTIONS$8,...o},c=n(s,l),u=a(s);super(e,!1,c,u?r():null),this._gain=t(this,u,c.gain,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get gain(){return this._gain}},createGainNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;return{render(o,s){const l=a.get(s);return void 0!==l?Promise.resolve(l):(async(o,s)=>{let l=r(o);const c=isOwnedByContext(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(s,e)}return a.set(s,l),c?await e(s,o.gain,l.gain):await n(s,o.gain,l.gain),await i(o,s,l),l})(o,s)}}},createGetActiveAudioWorkletNodeInputs=(e,t)=>r=>t(e,r),createGetAudioNodeRenderer=e=>t=>{const r=e(t);if(null===r.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return r.renderer},createGetAudioNodeTailTime=e=>t=>{var r;return null!==(r=e.get(t))&&void 0!==r?r:0},createGetAudioParamRenderer=e=>t=>{const r=e(t);if(null===r.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return r.renderer},createGetBackupOfflineAudioContext=e=>t=>e.get(t),createInvalidStateError=()=>new DOMException("","InvalidStateError"),createGetNativeContext=e=>t=>{const r=e.get(t);if(void 0===r)throw createInvalidStateError();return r},createGetOrCreateBackupOfflineAudioContext=(e,t)=>r=>{let n=e.get(r);if(void 0!==n)return n;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return n=new t(1,1,44100),e.set(r,n),n},createGetUnrenderedAudioWorkletNodes=e=>t=>{const r=e.get(t);if(void 0===r)throw new Error("The context has no set of AudioWorkletNodes.");return r},createInvalidAccessError=()=>new DOMException("","InvalidAccessError"),wrapIIRFilterNodeGetFrequencyResponseMethod=e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(r,n,i)=>{if(r.length!==n.length||n.length!==i.length)throw createInvalidAccessError();return t.call(e,r,n,i)})},DEFAULT_OPTIONS$7={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},createIIRFilterNodeConstructor=(e,t,r,n,i,a)=>class extends e{constructor(e,o){const s=n(e),l=i(s),c={...DEFAULT_OPTIONS$7,...o},u=t(s,l?null:e.baseLatency,c);super(e,!1,u,l?r(c.feedback,c.feedforward):null),wrapIIRFilterNodeGetFrequencyResponseMethod(u),this._nativeIIRFilterNode=u,a(this,1)}getFrequencyResponse(e,t,r){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,r)}},filterBuffer=(e,t,r,n,i,a,o,s,l,c,u)=>{const d=c.length;let h=s;for(let p=0;p<d;p+=1){let s=r[0]*c[p];for(let t=1;t<i;t+=1){const n=h-t&l-1;s+=r[t]*a[n],s-=e[t]*o[n]}for(let e=i;e<n;e+=1)s+=r[e]*a[h-e&l-1];for(let r=i;r<t;r+=1)s-=e[r]*o[h-r&l-1];a[h]=c[p],o[h]=s,h=h+1&l-1,u[p]=s}return h},filterFullBuffer=(e,t,r,n)=>{const i=r instanceof Float64Array?r:new Float64Array(r),a=n instanceof Float64Array?n:new Float64Array(n),o=i.length,s=a.length,l=Math.min(o,s);if(1!==i[0]){for(let e=0;e<o;e+=1)a[e]/=i[0];for(let e=1;e<s;e+=1)i[e]/=i[0]}const c=new Float32Array(32),u=new Float32Array(32),d=t.createBuffer(e.numberOfChannels,e.length,e.sampleRate),h=e.numberOfChannels;for(let p=0;p<h;p+=1){const t=e.getChannelData(p),r=d.getChannelData(p);c.fill(0),u.fill(0),filterBuffer(i,o,a,s,l,c,u,0,32,t,r)}return d},createIIRFilterNodeRendererFactory=(e,t,r,n,i)=>(a,o)=>{const s=new WeakMap;let l=null;return{render(c,u){const d=s.get(u);return void 0!==d?Promise.resolve(d):(async(c,u)=>{let d=null,h=t(c);const p=isOwnedByContext(h,u);if(void 0===u.createIIRFilter?d=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(h=u.createIIRFilter(o,a)),s.set(u,null===d?h:d),null!==d){if(null===l){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new r(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await n(c,e,e.destination);const t=await i(e);return filterFullBuffer(t,u,a,o)})()}const e=await l;return d.buffer=e,d.start(0),d}return await n(c,u,h),h})(c,u)}}},createIncrementCycleCounterFactory=(e,t,r,n,i,a)=>o=>(s,l)=>{const c=e.get(s);if(void 0===c){if(!o&&a(s)){const e=n(s),{outputs:a}=r(s);for(const r of a)if(isAudioNodeOutputConnection(r)){const i=n(r[0]);t(e,i,r[1],r[2])}else{const t=i(r[0]);e.disconnect(t,r[1])}}e.set(s,l)}else e.set(s,c+l)},createIsAnyAudioContext=(e,t)=>r=>{const n=e.get(r);return t(n)||t(r)},createIsAnyAudioNode=(e,t)=>r=>e.has(r)||t(r),createIsAnyAudioParam=(e,t)=>r=>e.has(r)||t(r),createIsAnyOfflineAudioContext=(e,t)=>r=>{const n=e.get(r);return t(n)||t(r)},createIsNativeAudioContext=e=>t=>null!==e&&t instanceof e,createIsNativeAudioNode=e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode,createIsNativeAudioParam=e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam,createIsNativeContext=(e,t)=>r=>e(r)||t(r),createIsNativeOfflineAudioContext=e=>t=>null!==e&&t instanceof e,createIsSecureContext=e=>null!==e&&e.isSecureContext,createIsSupportedPromise=async(e,t,r,n,i,a,o,s,l,c,u,d,h,p,f,m)=>{if(e(t,t)&&e(r,r)&&e(i,i)&&e(a,a)&&e(s,s)&&e(l,l)&&e(c,c)&&e(u,u)&&e(d,d)&&e(h,h)&&e(p,p)){return(await Promise.all([e(n,n),e(o,o),e(f,f),e(m,m)])).every((e=>e))}return!1},createMediaElementAudioSourceNodeConstructor=(e,t,r,n)=>class extends e{constructor(e,i){const a=r(e),o=t(a,i);if(n(a))throw TypeError();super(e,!0,o,null),this._nativeMediaElementAudioSourceNode=o}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},DEFAULT_OPTIONS$6={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},createMediaStreamAudioDestinationNodeConstructor=(e,t,r,n)=>class extends e{constructor(e,i){const a=r(e);if(n(a))throw new TypeError;const o={...DEFAULT_OPTIONS$6,...i},s=t(a,o);super(e,!1,s,null),this._nativeMediaStreamAudioDestinationNode=s}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},createMediaStreamAudioSourceNodeConstructor=(e,t,r,n)=>class extends e{constructor(e,i){const a=r(e),o=t(a,i);if(n(a))throw new TypeError;super(e,!0,o,null),this._nativeMediaStreamAudioSourceNode=o}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},createMediaStreamTrackAudioSourceNodeConstructor=(e,t,r)=>class extends e{constructor(e,n){const i=r(e);super(e,!0,t(i,n),null)}},createMinimalBaseAudioContextConstructor=(e,t,r,n,i,a)=>class extends r{constructor(r,a){super(r),this._nativeContext=r,CONTEXT_STORE.set(this,r),n(r)&&i.set(r,new Set),this._destination=new e(this,a),this._listener=t(this,r),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?a(this,e):null;this._nativeContext.onstatechange=t;const r=this._nativeContext.onstatechange;this._onstatechange=null!==r&&r===t?e:r}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},testPromiseSupport=e=>{const t=new Uint32Array([0x46464952,40,0x45564157,0x20746d66,16,131073,44100,176400,1048580,0x61746164,4,0]);try{const r=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==r&&(r.catch((()=>{})),!0)}catch{}return!1},createMonitorConnections=(e,t)=>(r,n,i)=>{const a=new Set;return r.connect=(i=>(o,s=0,l=0)=>{const c=0===a.size;if(t(o))return i.call(r,o,s,l),e(a,[o,s,l],(e=>e[0]===o&&e[1]===s&&e[2]===l),!0),c&&n(),o;i.call(r,o,s),e(a,[o,s],(e=>e[0]===o&&e[1]===s),!0),c&&n()})(r.connect),r.disconnect=(e=>(n,o,s)=>{const l=a.size>0;if(void 0===n)e.apply(r),a.clear();else if("number"==typeof n){e.call(r,n);for(const e of a)e[1]===n&&a.delete(e)}else{t(n)?e.call(r,n,o,s):e.call(r,n,o);for(const e of a)e[0]!==n||void 0!==o&&e[1]!==o||void 0!==s&&e[2]!==s||a.delete(e)}const c=0===a.size;l&&c&&i()})(r.disconnect),r},assignNativeAudioNodeOption=(e,t,r)=>{const n=t[r];void 0!==n&&n!==e[r]&&(e[r]=n)},assignNativeAudioNodeOptions=(e,t)=>{assignNativeAudioNodeOption(e,t,"channelCount"),assignNativeAudioNodeOption(e,t,"channelCountMode"),assignNativeAudioNodeOption(e,t,"channelInterpretation")},testAnalyserNodeGetFloatTimeDomainDataMethodSupport=e=>"function"==typeof e.getFloatTimeDomainData,wrapAnalyserNodeGetFloatTimeDomainDataMethod=e=>{e.getFloatTimeDomainData=t=>{const r=new Uint8Array(t.length);e.getByteTimeDomainData(r);const n=Math.max(r.length,e.fftSize);for(let e=0;e<n;e+=1)t[e]=.0078125*(r[e]-128);return t}},createNativeAnalyserNodeFactory=(e,t)=>(r,n)=>{const i=r.createAnalyser();if(assignNativeAudioNodeOptions(i,n),!(n.maxDecibels>n.minDecibels))throw t();return assignNativeAudioNodeOption(i,n,"fftSize"),assignNativeAudioNodeOption(i,n,"maxDecibels"),assignNativeAudioNodeOption(i,n,"minDecibels"),assignNativeAudioNodeOption(i,n,"smoothingTimeConstant"),e(testAnalyserNodeGetFloatTimeDomainDataMethodSupport,(()=>testAnalyserNodeGetFloatTimeDomainDataMethodSupport(i)))||wrapAnalyserNodeGetFloatTimeDomainDataMethod(i),i},createNativeAudioBufferConstructor=e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null,assignNativeAudioNodeAudioParamValue=(e,t,r)=>{const n=t[r];void 0!==n&&n!==e[r].value&&(e[r].value=n)},wrapAudioBufferSourceNodeStartMethodConsecutiveCalls=e=>{e.start=(t=>{let r=!1;return(n=0,i=0,a)=>{if(r)throw createInvalidStateError();t.call(e,n,i,a),r=!0}})(e.start)},wrapAudioScheduledSourceNodeStartMethodNegativeParameters=e=>{e.start=(t=>(r=0,n=0,i)=>{if("number"==typeof i&&i<0||n<0||r<0)throw new RangeError("The parameters can't be negative.");t.call(e,r,n,i)})(e.start)},wrapAudioScheduledSourceNodeStopMethodNegativeParameters=e=>{var t;e.stop=(t=e.stop,(r=0)=>{if(r<0)throw new RangeError("The parameter can't be negative.");t.call(e,r)})},createNativeAudioBufferSourceNodeFactory=(e,t,r,n,i,a,o,s,l,c,u)=>(d,h)=>{const p=d.createBufferSource();return assignNativeAudioNodeOptions(p,h),assignNativeAudioNodeAudioParamValue(p,h,"playbackRate"),assignNativeAudioNodeOption(p,h,"buffer"),assignNativeAudioNodeOption(p,h,"loop"),assignNativeAudioNodeOption(p,h,"loopEnd"),assignNativeAudioNodeOption(p,h,"loopStart"),t(r,(()=>r(d)))||wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(p),t(n,(()=>n(d)))||l(p),t(i,(()=>i(d)))||c(p,d),t(a,(()=>a(d)))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(p),t(o,(()=>o(d)))||u(p,d),t(s,(()=>s(d)))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(p),e(d,p),p},createNativeAudioContextConstructor=e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null,createNativeAudioDestinationNodeFactory=(e,t)=>(r,n,i)=>{const a=r.destination;if(a.channelCount!==n)try{a.channelCount=n}catch{}i&&"explicit"!==a.channelCountMode&&(a.channelCountMode="explicit"),0===a.maxChannelCount&&Object.defineProperty(a,"maxChannelCount",{value:n});const o=e(r,{channelCount:n,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,gain:1});return t(o,"channelCount",(e=>()=>e.call(o)),(e=>t=>{e.call(o,t);try{a.channelCount=t}catch(err){if(t>a.maxChannelCount)throw err}})),t(o,"channelCountMode",(e=>()=>e.call(o)),(e=>t=>{e.call(o,t),a.channelCountMode=t})),t(o,"channelInterpretation",(e=>()=>e.call(o)),(e=>t=>{e.call(o,t),a.channelInterpretation=t})),Object.defineProperty(o,"maxChannelCount",{get:()=>a.maxChannelCount}),o.connect(a),o},createNativeAudioWorkletNodeConstructor=e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null,testClonabilityOfAudioWorkletNodeOptions=e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},createNativeAudioWorkletNodeFactory=(e,t,r,n,i)=>(a,o,s,l,c,u)=>{if(null!==s)try{const t=new s(a,l,u),n=new Map;let o=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>o,set:e=>{"function"==typeof o&&t.removeEventListener("processorerror",o),o="function"==typeof e?e:null,"function"==typeof o&&t.addEventListener("processorerror",o)}}}),t.addEventListener=(h=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const r=n.get(e[1]);void 0!==r?e[1]=r:(e[1]=r=>{"error"===r.type?(Object.defineProperties(r,{type:{value:"processorerror"}}),t(r)):t(new ErrorEvent(e[0],{...r}))},n.set(t,e[1]))}}return h.call(t,"error",e[1],e[2]),h.call(t,...e)}),t.removeEventListener=(d=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=n.get(e[1]);void 0!==t&&(n.delete(e[1]),e[1]=t)}return d.call(t,"error",e[1],e[2]),d.call(t,e[0],e[1],e[2])}),0!==u.numberOfOutputs){const e=r(a,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(a.destination);return i(t,(()=>e.disconnect()),(()=>e.connect(a.destination)))}return t}catch(err){if(11===err.code)throw n();throw err}var d,h;if(void 0===c)throw n();return testClonabilityOfAudioWorkletNodeOptions(u),t(a,o,c,u)},computeBufferSize=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),cloneAudioWorkletNodeOptions=e=>new Promise(((t,r)=>{const{port1:n,port2:i}=new MessageChannel;n.onmessage=({data:e})=>{n.close(),i.close(),t(e)},n.onmessageerror=({data:e})=>{n.close(),i.close(),r(e)},i.postMessage(e)})),createAudioWorkletProcessorPromise=async(e,t)=>new e(await cloneAudioWorkletNodeOptions(t)),createAudioWorkletProcessor=(e,t,r,n)=>{let i=NODE_TO_PROCESSOR_MAPS.get(e);void 0===i&&(i=new WeakMap,NODE_TO_PROCESSOR_MAPS.set(e,i));const a=createAudioWorkletProcessorPromise(r,n);return i.set(t,a),a},createNativeAudioWorkletNodeFakerFactory=(e,t,r,n,i,a,o,s,l,c,u,d,h)=>(p,f,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const _=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(_.some((e=>e<1)))throw l();if(_.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const y=g.channelCount*g.numberOfInputs,b=_.reduce(((e,t)=>e+t),0),v=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(y+v>6||b>6)throw l();const S=new MessageChannel,w=[],T=[];for(let e=0;e<g.numberOfInputs;e+=1)w.push(o(p,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),T.push(i(p,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const E=[];if(void 0!==m.parameterDescriptors)for(const{defaultValue:e,maxValue:t,minValue:r,name:n}of m.parameterDescriptors){const i=a(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==g.parameterData[n]?g.parameterData[n]:void 0===e?0:e});Object.defineProperties(i.offset,{defaultValue:{get:()=>void 0===e?0:e},maxValue:{get:()=>void 0===t?MOST_POSITIVE_SINGLE_FLOAT:t},minValue:{get:()=>void 0===r?MOST_NEGATIVE_SINGLE_FLOAT:r}}),E.push(i)}const x=n(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,y+v)}),A=computeBufferSize(f,p.sampleRate),C=s(p,A,y+v,Math.max(1,b)),R=i(p,{channelCount:Math.max(1,b),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,b)}),D=[];for(let e=0;e<g.numberOfOutputs;e+=1)D.push(n(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:_[e]}));for(let e=0;e<g.numberOfInputs;e+=1){w[e].connect(T[e]);for(let t=0;t<g.channelCount;t+=1)T[e].connect(x,t,e*g.channelCount+t)}const P=new ReadOnlyMap(void 0===m.parameterDescriptors?[]:m.parameterDescriptors.map((({name:e},t)=>{const r=E[t];return r.connect(x,0,y+t),r.start(0),[e,r.offset]})));x.connect(C);let I=g.channelInterpretation,k=null;const M=0===g.numberOfOutputs?[C]:D,$={get bufferSize(){return A},get channelCount(){return g.channelCount},set channelCount(e){throw r()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw r()},get channelInterpretation(){return I},set channelInterpretation(e){for(const t of w)t.channelInterpretation=e;I=e},get context(){return C.context},get inputs(){return w},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return k},set onprocessorerror(e){"function"==typeof k&&$.removeEventListener("processorerror",k),k="function"==typeof e?e:null,"function"==typeof k&&$.addEventListener("processorerror",k)},get parameters(){return P},get port(){return S.port2},addEventListener:(...e)=>C.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,M),disconnect:c.bind(null,M),dispatchEvent:(...e)=>C.dispatchEvent(e[0]),removeEventListener:(...e)=>C.removeEventListener(e[0],e[1],e[2])},O=new Map;var N,F;S.port1.addEventListener=(N=S.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const r=O.get(e[1]);void 0!==r?e[1]=r:(e[1]=e=>{u(p.currentTime,p.sampleRate,(()=>t(e)))},O.set(t,e[1]))}}return N.call(S.port1,e[0],e[1],e[2])}),S.port1.removeEventListener=(F=S.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=O.get(e[1]);void 0!==t&&(O.delete(e[1]),e[1]=t)}return F.call(S.port1,e[0],e[1],e[2])});let L=null;Object.defineProperty(S.port1,"onmessage",{get:()=>L,set:e=>{"function"==typeof L&&S.port1.removeEventListener("message",L),L="function"==typeof e?e:null,"function"==typeof L&&(S.port1.addEventListener("message",L),S.port1.start())}}),m.prototype.port=S.port1;let B=null;createAudioWorkletProcessor(p,$,m,g).then((e=>B=e));const V=createNestedArrays(g.numberOfInputs,g.channelCount),U=createNestedArrays(g.numberOfOutputs,_),z=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let H=!0;const j=()=>{g.numberOfOutputs>0&&C.disconnect(R);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const r=D[e];for(let n=0;n<_[e];n+=1)R.disconnect(r,t+n,n);t+=_[e]}},G=new Map;C.onaudioprocess=({inputBuffer:e,outputBuffer:t})=>{if(null!==B){const r=d($);for(let n=0;n<A;n+=128){for(let t=0;t<g.numberOfInputs;t+=1)for(let r=0;r<g.channelCount;r+=1)copyFromChannel(e,V[t],r,r,n);void 0!==m.parameterDescriptors&&m.parameterDescriptors.forEach((({name:t},r)=>{copyFromChannel(e,z,t,y+r,n)}));for(let e=0;e<g.numberOfInputs;e+=1)for(let t=0;t<_[e];t+=1)0===U[e][t].byteLength&&(U[e][t]=new Float32Array(128));try{const e=V.map(((e,t)=>{if(r[t].size>0)return G.set(t,A/128),e;const n=G.get(t);return void 0===n?[]:(e.every((e=>e.every((e=>0===e))))&&(1===n?G.delete(t):G.set(t,n-1)),e)})),i=u(p.currentTime+n/p.sampleRate,p.sampleRate,(()=>B.process(e,U,z)));H=i;for(let r=0,a=0;r<g.numberOfOutputs;r+=1){for(let e=0;e<_[r];e+=1)copyToChannel(t,U[r],e,a+e,n);a+=_[r]}}catch(error){H=!1,$.dispatchEvent(new ErrorEvent("processorerror",{colno:error.colno,filename:error.filename,lineno:error.lineno,message:error.message}))}if(!H){for(let e=0;e<g.numberOfInputs;e+=1){w[e].disconnect(T[e]);for(let t=0;t<g.channelCount;t+=1)T[n].disconnect(x,t,e*g.channelCount+t)}if(void 0!==m.parameterDescriptors){const e=m.parameterDescriptors.length;for(let t=0;t<e;t+=1){const e=E[t];e.disconnect(x,0,y+t),e.stop()}}x.disconnect(C),C.onaudioprocess=null,W?j():K();break}}}};let W=!1;const q=o(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),X=()=>C.connect(q).connect(p.destination),K=()=>{C.disconnect(q),q.disconnect()};return X(),h($,(()=>{if(H){K(),g.numberOfOutputs>0&&C.connect(R);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const r=D[e];for(let n=0;n<_[e];n+=1)R.connect(r,t+n,n);t+=_[e]}}W=!0}),(()=>{H&&(X(),j()),W=!1}))},createNativeBiquadFilterNode=(e,t)=>{const r=e.createBiquadFilter();return assignNativeAudioNodeOptions(r,t),assignNativeAudioNodeAudioParamValue(r,t,"Q"),assignNativeAudioNodeAudioParamValue(r,t,"detune"),assignNativeAudioNodeAudioParamValue(r,t,"frequency"),assignNativeAudioNodeAudioParamValue(r,t,"gain"),assignNativeAudioNodeOption(r,t,"type"),r},createNativeChannelMergerNodeFactory=(e,t)=>(r,n)=>{const i=r.createChannelMerger(n.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(r,i),assignNativeAudioNodeOptions(i,n),i},wrapChannelSplitterNode=e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw createInvalidStateError()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw createInvalidStateError()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw createInvalidStateError()}})},createNativeChannelSplitterNode=(e,t)=>{const r=e.createChannelSplitter(t.numberOfOutputs);return assignNativeAudioNodeOptions(r,t),wrapChannelSplitterNode(r),r},createNativeConstantSourceNodeFactory=(e,t,r,n,i)=>(a,o)=>{if(void 0===a.createConstantSource)return r(a,o);const s=a.createConstantSource();return assignNativeAudioNodeOptions(s,o),assignNativeAudioNodeAudioParamValue(s,o,"offset"),t(n,(()=>n(a)))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(s),t(i,(()=>i(a)))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(s),e(a,s),s},interceptConnections=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),createNativeConstantSourceNodeFakerFactory=(e,t,r,n)=>(i,{offset:a,...o})=>{const s=i.createBuffer(1,2,44100),l=t(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),c=r(i,{...o,gain:a}),u=s.getChannelData(0);u[0]=1,u[1]=1,l.buffer=s,l.loop=!0;const d={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(i,l),n(interceptConnections(d,c),(()=>l.connect(c)),(()=>l.disconnect(c)))},createNativeConvolverNodeFactory=(e,t)=>(r,n)=>{const i=r.createConvolver();if(assignNativeAudioNodeOptions(i,n),n.disableNormalization===i.normalize&&(i.normalize=!n.disableNormalization),assignNativeAudioNodeOption(i,n,"buffer"),n.channelCount>2)throw e();if(t(i,"channelCount",(e=>()=>e.call(i)),(t=>r=>{if(r>2)throw e();return t.call(i,r)})),"max"===n.channelCountMode)throw e();return t(i,"channelCountMode",(e=>()=>e.call(i)),(t=>r=>{if("max"===r)throw e();return t.call(i,r)})),i},createNativeDelayNode=(e,t)=>{const r=e.createDelay(t.maxDelayTime);return assignNativeAudioNodeOptions(r,t),assignNativeAudioNodeAudioParamValue(r,t,"delayTime"),r},createNativeDynamicsCompressorNodeFactory=e=>(t,r)=>{const n=t.createDynamicsCompressor();if(assignNativeAudioNodeOptions(n,r),r.channelCount>2)throw e();if("max"===r.channelCountMode)throw e();return assignNativeAudioNodeAudioParamValue(n,r,"attack"),assignNativeAudioNodeAudioParamValue(n,r,"knee"),assignNativeAudioNodeAudioParamValue(n,r,"ratio"),assignNativeAudioNodeAudioParamValue(n,r,"release"),assignNativeAudioNodeAudioParamValue(n,r,"threshold"),n},createNativeGainNode=(e,t)=>{const r=e.createGain();return assignNativeAudioNodeOptions(r,t),assignNativeAudioNodeAudioParamValue(r,t,"gain"),r},createNativeIIRFilterNodeFactory=e=>(t,r,n)=>{if(void 0===t.createIIRFilter)return e(t,r,n);const i=t.createIIRFilter(n.feedforward,n.feedback);return assignNativeAudioNodeOptions(i,n),i};function divide$2(e,t){const r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}function multiply$2(e,t){return[e[0]*t[0]-e[1]*t[1],e[0]*t[1]+e[1]*t[0]]}function evaluatePolynomial(e,t){let r=[0,0];for(let n=e.length-1;n>=0;n-=1)r=multiply$2(r,t),r[0]+=e[n];return r}const createNativeIIRFilterNodeFakerFactory=(e,t,r,n)=>(i,a,{channelCount:o,channelCountMode:s,channelInterpretation:l,feedback:c,feedforward:u})=>{const d=computeBufferSize(a,i.sampleRate),h=c instanceof Float64Array?c:new Float64Array(c),p=u instanceof Float64Array?u:new Float64Array(u),f=h.length,m=p.length,g=Math.min(f,m);if(0===f||f>20)throw n();if(0===h[0])throw t();if(0===m||m>20)throw n();if(0===p[0])throw t();if(1!==h[0]){for(let e=0;e<m;e+=1)p[e]/=h[0];for(let e=1;e<f;e+=1)h[e]/=h[0]}const _=r(i,d,o,o);_.channelCount=o,_.channelCountMode=s,_.channelInterpretation=l;const y=[],b=[],v=[];for(let e=0;e<o;e+=1){y.push(0);const e=new Float32Array(32),t=new Float32Array(32);e.fill(0),t.fill(0),b.push(e),v.push(t)}_.onaudioprocess=e=>{const t=e.inputBuffer,r=e.outputBuffer,n=t.numberOfChannels;for(let i=0;i<n;i+=1){const e=t.getChannelData(i),n=r.getChannelData(i);y[i]=filterBuffer(h,f,p,m,g,b[i],v[i],y[i],32,e,n)}};const S=i.sampleRate/2,w={get bufferSize(){return d},get channelCount(){return _.channelCount},set channelCount(e){_.channelCount=e},get channelCountMode(){return _.channelCountMode},set channelCountMode(e){_.channelCountMode=e},get channelInterpretation(){return _.channelInterpretation},set channelInterpretation(e){_.channelInterpretation=e},get context(){return _.context},get inputs(){return[_]},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},addEventListener:(...e)=>_.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>_.dispatchEvent(e[0]),getFrequencyResponse(t,r,n){if(t.length!==r.length||r.length!==n.length)throw e();const i=t.length;for(let e=0;e<i;e+=1){const i=-Math.PI*(t[e]/S),a=[Math.cos(i),Math.sin(i)],o=divide$2(evaluatePolynomial(p,a),evaluatePolynomial(h,a));r[e]=Math.sqrt(o[0]*o[0]+o[1]*o[1]),n[e]=Math.atan2(o[1],o[0])}},removeEventListener:(...e)=>_.removeEventListener(e[0],e[1],e[2])};return interceptConnections(w,_)},createNativeMediaElementAudioSourceNode=(e,t)=>e.createMediaElementSource(t.mediaElement),createNativeMediaStreamAudioDestinationNode=(e,t)=>{const r=e.createMediaStreamDestination();return assignNativeAudioNodeOptions(r,t),1===r.numberOfOutputs&&Object.defineProperty(r,"numberOfOutputs",{get:()=>0}),r},createNativeMediaStreamAudioSourceNode=(e,{mediaStream:t})=>{const r=t.getAudioTracks();r.sort(((e,t)=>e.id<t.id?-1:e.id>t.id?1:0));const n=r.slice(0,1),i=e.createMediaStreamSource(new MediaStream(n));return Object.defineProperty(i,"mediaStream",{value:t}),i},createNativeMediaStreamTrackAudioSourceNodeFactory=(e,t)=>(r,{mediaStreamTrack:n})=>{if("function"==typeof r.createMediaStreamTrackSource)return r.createMediaStreamTrackSource(n);const i=new MediaStream([n]),a=r.createMediaStreamSource(i);if("audio"!==n.kind)throw e();if(t(r))throw new TypeError;return a},createNativeOfflineAudioContextConstructor=e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null,createNativeOscillatorNodeFactory=(e,t,r,n,i,a)=>(o,s)=>{const l=o.createOscillator();return assignNativeAudioNodeOptions(l,s),assignNativeAudioNodeAudioParamValue(l,s,"detune"),assignNativeAudioNodeAudioParamValue(l,s,"frequency"),void 0!==s.periodicWave?l.setPeriodicWave(s.periodicWave):assignNativeAudioNodeOption(l,s,"type"),t(r,(()=>r(o)))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(l),t(n,(()=>n(o)))||a(l,o),t(i,(()=>i(o)))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(l),e(o,l),l},createNativePannerNodeFactory=e=>(t,r)=>{const n=t.createPanner();return void 0===n.orientationX?e(t,r):(assignNativeAudioNodeOptions(n,r),assignNativeAudioNodeAudioParamValue(n,r,"orientationX"),assignNativeAudioNodeAudioParamValue(n,r,"orientationY"),assignNativeAudioNodeAudioParamValue(n,r,"orientationZ"),assignNativeAudioNodeAudioParamValue(n,r,"positionX"),assignNativeAudioNodeAudioParamValue(n,r,"positionY"),assignNativeAudioNodeAudioParamValue(n,r,"positionZ"),assignNativeAudioNodeOption(n,r,"coneInnerAngle"),assignNativeAudioNodeOption(n,r,"coneOuterAngle"),assignNativeAudioNodeOption(n,r,"coneOuterGain"),assignNativeAudioNodeOption(n,r,"distanceModel"),assignNativeAudioNodeOption(n,r,"maxDistance"),assignNativeAudioNodeOption(n,r,"panningModel"),assignNativeAudioNodeOption(n,r,"refDistance"),assignNativeAudioNodeOption(n,r,"rolloffFactor"),n)},createNativePannerNodeFakerFactory=(e,t,r,n,i,a,o,s,l,c)=>(u,{coneInnerAngle:d,coneOuterAngle:h,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:_,orientationZ:y,panningModel:b,positionX:v,positionY:S,positionZ:w,refDistance:T,rolloffFactor:E,...x})=>{const A=u.createPanner();if(x.channelCount>2)throw o();if("max"===x.channelCountMode)throw o();assignNativeAudioNodeOptions(A,x);const C={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},R=r(u,{...C,channelInterpretation:"speakers",numberOfInputs:6}),D=n(u,{...x,gain:1}),P=n(u,{...C,gain:1}),I=n(u,{...C,gain:0}),k=n(u,{...C,gain:0}),M=n(u,{...C,gain:0}),$=n(u,{...C,gain:0}),O=n(u,{...C,gain:0}),N=i(u,256,6,1),F=a(u,{...C,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,_,y],B=[v,S,w];const V=new Float32Array(1);N.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,V,0),l(e,V,1),l(e,V,2)];t.some(((e,t)=>e!==L[t]))&&(A.setOrientation(...t),L=t);const r=[l(e,V,3),l(e,V,4),l(e,V,5)];r.some(((e,t)=>e!==B[t]))&&(A.setPosition(...r),B=r)},Object.defineProperty(I.gain,"defaultValue",{get:()=>0}),Object.defineProperty(k.gain,"defaultValue",{get:()=>0}),Object.defineProperty(M.gain,"defaultValue",{get:()=>0}),Object.defineProperty($.gain,"defaultValue",{get:()=>0}),Object.defineProperty(O.gain,"defaultValue",{get:()=>0});const U={get bufferSize(){},get channelCount(){return A.channelCount},set channelCount(e){if(e>2)throw o();D.channelCount=e,A.channelCount=e},get channelCountMode(){return A.channelCountMode},set channelCountMode(e){if("max"===e)throw o();D.channelCountMode=e,A.channelCountMode=e},get channelInterpretation(){return A.channelInterpretation},set channelInterpretation(e){D.channelInterpretation=e,A.channelInterpretation=e},get coneInnerAngle(){return A.coneInnerAngle},set coneInnerAngle(e){A.coneInnerAngle=e},get coneOuterAngle(){return A.coneOuterAngle},set coneOuterAngle(e){A.coneOuterAngle=e},get coneOuterGain(){return A.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();A.coneOuterGain=e},get context(){return A.context},get distanceModel(){return A.distanceModel},set distanceModel(e){A.distanceModel=e},get inputs(){return[D]},get maxDistance(){return A.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;A.maxDistance=e},get numberOfInputs(){return A.numberOfInputs},get numberOfOutputs(){return A.numberOfOutputs},get orientationX(){return P.gain},get orientationY(){return I.gain},get orientationZ(){return k.gain},get panningModel(){return A.panningModel},set panningModel(e){A.panningModel=e},get positionX(){return M.gain},get positionY(){return $.gain},get positionZ(){return O.gain},get refDistance(){return A.refDistance},set refDistance(e){if(e<0)throw new RangeError;A.refDistance=e},get rolloffFactor(){return A.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;A.rolloffFactor=e},addEventListener:(...e)=>D.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>D.dispatchEvent(e[0]),removeEventListener:(...e)=>D.removeEventListener(e[0],e[1],e[2])};d!==U.coneInnerAngle&&(U.coneInnerAngle=d),h!==U.coneOuterAngle&&(U.coneOuterAngle=h),p!==U.coneOuterGain&&(U.coneOuterGain=p),f!==U.distanceModel&&(U.distanceModel=f),m!==U.maxDistance&&(U.maxDistance=m),g!==U.orientationX.value&&(U.orientationX.value=g),_!==U.orientationY.value&&(U.orientationY.value=_),y!==U.orientationZ.value&&(U.orientationZ.value=y),b!==U.panningModel&&(U.panningModel=b),v!==U.positionX.value&&(U.positionX.value=v),S!==U.positionY.value&&(U.positionY.value=S),w!==U.positionZ.value&&(U.positionZ.value=w),T!==U.refDistance&&(U.refDistance=T),E!==U.rolloffFactor&&(U.rolloffFactor=E),1===L[0]&&0===L[1]&&0===L[2]||A.setOrientation(...L),0===B[0]&&0===B[1]&&0===B[2]||A.setPosition(...B);return c(interceptConnections(U,A),(()=>{D.connect(A),e(D,F,0,0),F.connect(P).connect(R,0,0),F.connect(I).connect(R,0,1),F.connect(k).connect(R,0,2),F.connect(M).connect(R,0,3),F.connect($).connect(R,0,4),F.connect(O).connect(R,0,5),R.connect(N).connect(u.destination)}),(()=>{D.disconnect(A),s(D,F,0,0),F.disconnect(P),P.disconnect(R),F.disconnect(I),I.disconnect(R),F.disconnect(k),k.disconnect(R),F.disconnect(M),M.disconnect(R),F.disconnect($),$.disconnect(R),F.disconnect(O),O.disconnect(R),R.disconnect(N),N.disconnect(u.destination)}))},createNativePeriodicWaveFactory=e=>(t,{disableNormalization:r,imag:n,real:i})=>{const a=n instanceof Float32Array?n:new Float32Array(n),o=i instanceof Float32Array?i:new Float32Array(i),s=t.createPeriodicWave(o,a,{disableNormalization:r});if(Array.from(n).length<2)throw e();return s},createNativeScriptProcessorNode=(e,t,r,n)=>e.createScriptProcessor(t,r,n),createNativeStereoPannerNodeFactory=(e,t)=>(r,n)=>{const i=n.channelCountMode;if("clamped-max"===i)throw t();if(void 0===r.createStereoPanner)return e(r,n);const a=r.createStereoPanner();return assignNativeAudioNodeOptions(a,n),assignNativeAudioNodeAudioParamValue(a,n,"pan"),Object.defineProperty(a,"channelCountMode",{get:()=>i,set:e=>{if(e!==i)throw t()}}),a},createNativeStereoPannerNodeFakerFactory=(e,t,r,n,i,a)=>{const o=16385,s=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},d=(e,a,d,h,p)=>{if(1===a)return((e,t,i,a)=>{const d=new Float32Array(o),h=new Float32Array(o);for(let r=0;r<o;r+=1){const e=r/16384*l;d[r]=Math.cos(e),h[r]=Math.sin(e)}const p=r(e,{...c,gain:0}),f=n(e,{...u,curve:d}),m=n(e,{...u,curve:s}),g=r(e,{...c,gain:0}),_=n(e,{...u,curve:h});return{connectGraph(){t.connect(p),t.connect(void 0===m.inputs?m:m.inputs[0]),t.connect(g),m.connect(i),i.connect(void 0===f.inputs?f:f.inputs[0]),i.connect(void 0===_.inputs?_:_.inputs[0]),f.connect(p.gain),_.connect(g.gain),p.connect(a,0,0),g.connect(a,0,1)},disconnectGraph(){t.disconnect(p),t.disconnect(void 0===m.inputs?m:m.inputs[0]),t.disconnect(g),m.disconnect(i),i.disconnect(void 0===f.inputs?f:f.inputs[0]),i.disconnect(void 0===_.inputs?_:_.inputs[0]),f.disconnect(p.gain),_.disconnect(g.gain),p.disconnect(a,0,0),g.disconnect(a,0,1)}}})(e,d,h,p);if(2===a)return((e,i,a,d)=>{const h=new Float32Array(o),p=new Float32Array(o),f=new Float32Array(o),m=new Float32Array(o),g=Math.floor(8192.5);for(let t=0;t<o;t+=1)if(t>g){const e=(t-g)/(16384-g)*l;h[t]=Math.cos(e),p[t]=Math.sin(e),f[t]=0,m[t]=1}else{const e=t/(16384-g)*l;h[t]=1,p[t]=0,f[t]=Math.cos(e),m[t]=Math.sin(e)}const _=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),y=r(e,{...c,gain:0}),b=n(e,{...u,curve:h}),v=r(e,{...c,gain:0}),S=n(e,{...u,curve:p}),w=n(e,{...u,curve:s}),T=r(e,{...c,gain:0}),E=n(e,{...u,curve:f}),x=r(e,{...c,gain:0}),A=n(e,{...u,curve:m});return{connectGraph(){i.connect(_),i.connect(void 0===w.inputs?w:w.inputs[0]),_.connect(y,0),_.connect(v,0),_.connect(T,1),_.connect(x,1),w.connect(a),a.connect(void 0===b.inputs?b:b.inputs[0]),a.connect(void 0===S.inputs?S:S.inputs[0]),a.connect(void 0===E.inputs?E:E.inputs[0]),a.connect(void 0===A.inputs?A:A.inputs[0]),b.connect(y.gain),S.connect(v.gain),E.connect(T.gain),A.connect(x.gain),y.connect(d,0,0),T.connect(d,0,0),v.connect(d,0,1),x.connect(d,0,1)},disconnectGraph(){i.disconnect(_),i.disconnect(void 0===w.inputs?w:w.inputs[0]),_.disconnect(y,0),_.disconnect(v,0),_.disconnect(T,1),_.disconnect(x,1),w.disconnect(a),a.disconnect(void 0===b.inputs?b:b.inputs[0]),a.disconnect(void 0===S.inputs?S:S.inputs[0]),a.disconnect(void 0===E.inputs?E:E.inputs[0]),a.disconnect(void 0===A.inputs?A:A.inputs[0]),b.disconnect(y.gain),S.disconnect(v.gain),E.disconnect(T.gain),A.disconnect(x.gain),y.disconnect(d,0,0),T.disconnect(d,0,0),v.disconnect(d,0,1),x.disconnect(d,0,1)}}})(e,d,h,p);throw i()};return(t,{channelCount:n,channelCountMode:o,pan:s,...l})=>{if("max"===o)throw i();const c=e(t,{...l,channelCount:1,channelCountMode:o,numberOfInputs:2}),u=r(t,{...l,channelCount:n,channelCountMode:o,gain:1}),h=r(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:s});let{connectGraph:p,disconnectGraph:f}=d(t,n,u,h,c);Object.defineProperty(h.gain,"defaultValue",{get:()=>0}),Object.defineProperty(h.gain,"maxValue",{get:()=>1}),Object.defineProperty(h.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=d(t,e,u,h,c)),g&&p()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw i();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return h.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return a(interceptConnections(m,c),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}},createNativeWaveShaperNodeFactory=(e,t,r,n,i,a,o)=>(s,l)=>{const c=s.createWaveShaper();if(null!==a&&"webkitAudioContext"===a.name&&void 0===s.createGain().gain.automationRate)return r(s,l);assignNativeAudioNodeOptions(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();assignNativeAudioNodeOption(c,{curve:u},"curve"),assignNativeAudioNodeOption(c,l,"oversample");let d=null,h=!1;o(c,"curve",(e=>()=>e.call(c)),(t=>r=>(t.call(c,r),h&&(n(r)&&null===d?d=e(s,c):n(r)||null===d||(d(),d=null)),r)));return i(c,(()=>{h=!0,n(c.curve)&&(d=e(s,c))}),(()=>{h=!1,null!==d&&(d(),d=null)}))},createNativeWaveShaperNodeFakerFactory=(e,t,r,n,i)=>(a,{curve:o,oversample:s,...l})=>{const c=a.createWaveShaper(),u=a.createWaveShaper();assignNativeAudioNodeOptions(c,l),assignNativeAudioNodeOptions(u,l);const d=r(a,{...l,gain:1}),h=r(a,{...l,gain:-1}),p=r(a,{...l,gain:1}),f=r(a,{...l,gain:-1});let m=null,g=!1,_=null;const y={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){d.channelCount=e,h.channelCount=e,c.channelCount=e,p.channelCount=e,u.channelCount=e,f.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){d.channelCountMode=e,h.channelCountMode=e,c.channelCountMode=e,p.channelCountMode=e,u.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){d.channelInterpretation=e,h.channelInterpretation=e,c.channelInterpretation=e,p.channelInterpretation=e,u.channelInterpretation=e,f.channelInterpretation=e},get context(){return c.context},get curve(){return _},set curve(r){if(null!==r&&r.length<2)throw t();if(null===r)c.curve=r,u.curve=r;else{const e=r.length,t=new Float32Array(e+2-e%2),n=new Float32Array(e+2-e%2);t[0]=r[0],n[0]=-r[e-1];const i=Math.ceil((e+1)/2),a=(e+1)/2-1;for(let o=1;o<i;o+=1){const s=o/i*a,l=Math.floor(s),c=Math.ceil(s);t[o]=l===c?r[l]:(1-(s-l))*r[l]+(1-(c-s))*r[c],n[o]=l===c?-r[e-1-l]:-(1-(s-l))*r[e-1-l]-(1-(c-s))*r[e-1-c]}t[i]=e%2==1?r[i-1]:(r[i-2]+r[i-1])/2,c.curve=t,u.curve=n}_=r,g&&(n(_)&&null===m?m=e(a,d):null!==m&&(m(),m=null))},get inputs(){return[d]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get oversample(){return c.oversample},set oversample(e){c.oversample=e,u.oversample=e},addEventListener:(...e)=>d.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>d.dispatchEvent(e[0]),removeEventListener:(...e)=>d.removeEventListener(e[0],e[1],e[2])};null!==o&&(y.curve=o instanceof Float32Array?o:new Float32Array(o)),s!==y.oversample&&(y.oversample=s);return i(interceptConnections(y,p),(()=>{d.connect(c).connect(p),d.connect(h).connect(u).connect(f).connect(p),g=!0,n(_)&&(m=e(a,d))}),(()=>{d.disconnect(c),c.disconnect(p),d.disconnect(h),h.disconnect(u),u.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))},createNotSupportedError=()=>new DOMException("","NotSupportedError"),DEFAULT_OPTIONS$5={numberOfChannels:1},createOfflineAudioContextConstructor=(e,t,r,n,i)=>class extends e{constructor(e,r,i){let a;if("number"==typeof e&&void 0!==r&&void 0!==i)a={length:r,numberOfChannels:e,sampleRate:i};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");a=e}const{length:o,numberOfChannels:s,sampleRate:l}={...DEFAULT_OPTIONS$5,...a},c=n(s,o,l);t(testPromiseSupport,(()=>testPromiseSupport(c)))||c.addEventListener("statechange",(()=>{let e=0;const t=r=>{"running"===this._state&&(e>0?(c.removeEventListener("statechange",t),r.stopImmediatePropagation(),this._waitForThePromiseToSettle(r)):e+=1)};return t})()),super(c,s),this._length=o,this._nativeOfflineAudioContext=c,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(r()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,deactivateAudioGraph(this)})))}_waitForThePromiseToSettle(e){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(e):setTimeout((()=>this._waitForThePromiseToSettle(e)))}},DEFAULT_OPTIONS$4={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},createOscillatorNodeConstructor=(e,t,r,n,i,a,o)=>class extends e{constructor(e,o){const s=i(e),l={...DEFAULT_OPTIONS$4,...o},c=r(s,l),u=a(s),d=u?n():null,h=e.sampleRate/2;super(e,!1,c,d),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,h,-h),this._nativeOscillatorNode=c,this._onended=null,this._oscillatorNodeRenderer=d,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?o(this,e):null;this._nativeOscillatorNode.onended=t;const r=this._nativeOscillatorNode.onended;this._onended=null!==r&&r===t?e:r}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){setInternalStateToActive(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}},createOscillatorNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;let o=null,s=null,l=null;return{set periodicWave(e){o=e},set start(e){s=e},set stop(e){l=e},render(c,u){const d=a.get(u);return void 0!==d?Promise.resolve(d):(async(c,u)=>{let d=r(c);const h=isOwnedByContext(d,u);if(!h){const e={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:null===o?void 0:o,type:d.type};d=t(u,e),null!==s&&d.start(s),null!==l&&d.stop(l)}return a.set(u,d),h?(await e(u,c.detune,d.detune),await e(u,c.frequency,d.frequency)):(await n(u,c.detune,d.detune),await n(u,c.frequency,d.frequency)),await i(c,u,d),d})(c,u)}}},DEFAULT_OPTIONS$3={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},createPannerNodeConstructor=(e,t,r,n,i,a,o)=>class extends e{constructor(e,s){const l=i(e),c={...DEFAULT_OPTIONS$3,...s},u=r(l,c),d=a(l);super(e,!1,u,d?n():null),this._nativePannerNode=u,this._orientationX=t(this,d,u.orientationX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationY=t(this,d,u.orientationY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationZ=t(this,d,u.orientationZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionX=t(this,d,u.positionX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionY=t(this,d,u.positionY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionZ=t(this,d,u.positionZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}},createPannerNodeRendererFactory=(e,t,r,n,i,a,o,s,l,c)=>()=>{const u=new WeakMap;let d=null;return{render(h,p){const f=u.get(p);return void 0!==f?Promise.resolve(f):(async(h,p)=>{let f=null,m=a(h);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},_={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},y=isOwnedByContext(m,p);if("bufferSize"in m)f=n(p,{...g,gain:1});else if(!y){const e={..._,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=i(p,e)}if(u.set(p,null===f?m:f),null!==f){if(null===d){if(null===o)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new o(6,h.context.length,p.sampleRate),n=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});n.connect(e.destination),d=(async()=>{const t=await Promise.all([h.orientationX,h.orientationY,h.orientationZ,h.positionX,h.positionY,h.positionZ].map((async(t,n)=>{const i=r(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===n?1:0});return await s(e,t,i.offset),i})));for(let e=0;e<6;e+=1)t[e].connect(n,0,e),t[e].start(0);return c(e)})()}const e=await d,a=n(p,{...g,gain:1});await l(h,p,a);const u=[];for(let t=0;t<e.numberOfChannels;t+=1)u.push(e.getChannelData(t));let m=[u[0][0],u[1][0],u[2][0]],y=[u[3][0],u[4][0],u[5][0]],b=n(p,{...g,gain:1}),v=i(p,{..._,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:y[0],positionY:y[1],positionZ:y[2]});a.connect(b).connect(v.inputs[0]),v.connect(f);for(let t=128;t<e.length;t+=128){const e=[u[0][t],u[1][t],u[2][t]],r=[u[3][t],u[4][t],u[5][t]];if(e.some(((e,t)=>e!==m[t]))||r.some(((e,t)=>e!==y[t]))){m=e,y=r;const o=t/p.sampleRate;b.gain.setValueAtTime(0,o),b=n(p,{...g,gain:0}),v=i(p,{..._,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:y[0],positionY:y[1],positionZ:y[2]}),b.gain.setValueAtTime(1,o),a.connect(b).connect(v.inputs[0]),v.connect(f)}}return f}return y?(await e(p,h.orientationX,m.orientationX),await e(p,h.orientationY,m.orientationY),await e(p,h.orientationZ,m.orientationZ),await e(p,h.positionX,m.positionX),await e(p,h.positionY,m.positionY),await e(p,h.positionZ,m.positionZ)):(await s(p,h.orientationX,m.orientationX),await s(p,h.orientationY,m.orientationY),await s(p,h.orientationZ,m.orientationZ),await s(p,h.positionX,m.positionX),await s(p,h.positionY,m.positionY),await s(p,h.positionZ,m.positionZ)),isNativeAudioNodeFaker(m)?await l(h,p,m.inputs[0]):await l(h,p,m),m})(h,p)}}},DEFAULT_OPTIONS$2={disableNormalization:!1},createPeriodicWaveConstructor=(e,t,r,n)=>class i{constructor(i,a){const o=t(i),s=n({...DEFAULT_OPTIONS$2,...a}),l=e(o,s);return r.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===i.prototype||r.has(e)}},createRenderAutomation=(e,t)=>(r,n,i)=>(e(n).replay(i),t(n,r,i)),createRenderInputsOfAudioNode=(e,t,r)=>async(n,i,a)=>{const o=e(n);await Promise.all(o.activeInputs.map(((e,o)=>Array.from(e).map((async([e,s])=>{const l=t(e),c=await l.render(e,i),u=n.context.destination;r(e)||n===u&&r(n)||c.connect(a,s,o)})))).reduce(((e,t)=>[...e,...t]),[]))},createRenderInputsOfAudioParam=(e,t,r)=>async(n,i,a)=>{const o=t(n);await Promise.all(Array.from(o.activeInputs).map((async([t,n])=>{const o=e(t),s=await o.render(t,i);r(t)||s.connect(a,n)})))},createRenderNativeOfflineAudioContext=(e,t,r,n)=>i=>e(testPromiseSupport,(()=>testPromiseSupport(i)))?Promise.resolve(e(n,n)).then((e=>{if(!e){const e=r(i,512,0,1);i.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>i.currentTime,e.connect(i.destination)}return i.startRendering()})):new Promise((e=>{const r=t(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=t=>{r.disconnect(),e(t.renderedBuffer)},r.connect(i.destination),i.startRendering()})),createSetActiveAudioWorkletNodeInputs=e=>(t,r)=>{e.set(t,r)},createSetAudioNodeTailTime=e=>(t,r)=>e.set(t,r),createStartRendering=(e,t,r,n,i,a,o,s)=>(l,c)=>r(l).render(l,c).then((()=>Promise.all(Array.from(n(c)).map((e=>r(e).render(e,c)))))).then((()=>i(c))).then((r=>("function"!=typeof r.copyFromChannel?(o(r),wrapAudioBufferGetChannelDataMethod(r)):t(a,(()=>a(r)))||s(r),e.add(r),r))),DEFAULT_OPTIONS$1={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},createStereoPannerNodeConstructor=(e,t,r,n,i,a)=>class extends e{constructor(e,o){const s=i(e),l={...DEFAULT_OPTIONS$1,...o},c=r(s,l),u=a(s);super(e,!1,c,u?n():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}},createStereoPannerNodeRendererFactory=(e,t,r,n,i)=>()=>{const a=new WeakMap;return{render(o,s){const l=a.get(s);return void 0!==l?Promise.resolve(l):(async(o,s)=>{let l=r(o);const c=isOwnedByContext(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(s,e)}return a.set(s,l),c?await e(s,o.pan,l.pan):await n(s,o.pan,l.pan),isNativeAudioNodeFaker(l)?await i(o,s,l.inputs[0]):await i(o,s,l),l})(o,s)}}},createTestAudioBufferConstructorSupport=e=>()=>{if(null===e)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0},createTestAudioBufferCopyChannelMethodsSubarraySupport=e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createBuffer(1,1,44100);if(void 0===t.copyToChannel)return!0;const r=new Float32Array(2);try{t.copyFromChannel(r,0,0)}catch{return!1}return!0},createTestAudioContextCloseMethodSupport=e=>()=>{if(null===e)return!1;if(void 0!==e.prototype&&void 0!==e.prototype.close)return!0;const t=new e,r=void 0!==t.close;try{t.close()}catch{}return r},createTestAudioContextDecodeAudioDataMethodTypeErrorSupport=e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);return new Promise((e=>{let r=!0;const n=n=>{r&&(r=!1,t.startRendering(),e(n instanceof TypeError))};let i;try{i=t.decodeAudioData(null,(()=>{}),n)}catch(err){n(err)}void 0!==i&&i.catch(n)}))},createTestAudioContextOptionsSupport=e=>()=>{if(null===e)return!1;let t;try{t=new e({latencyHint:"balanced"})}catch{return!1}return t.close(),!0},createTestAudioNodeConnectMethodSupport=e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createGain(),r=t.connect(t)===t;return t.disconnect(t),r},createTestAudioWorkletProcessorNoOutputsSupport=(e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const r=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),n=new MessageChannel,i=new t(1,128,44100),a=URL.createObjectURL(r);let o=!1;try{await i.audioWorklet.addModule(a);const t=new e(i,"a",{numberOfOutputs:0}),r=i.createOscillator();await new Promise((e=>{t.port.onmessage=()=>e(),t.port.postMessage(n.port2,[n.port2])})),t.port.onmessage=()=>o=!0,r.connect(t),r.start(0),await i.startRendering(),o=await new Promise((e=>{n.port1.onmessage=({data:t})=>e(1===t),n.port1.postMessage(0)}))}catch{}finally{n.port1.close(),URL.revokeObjectURL(a)}return o},createTestAudioWorkletProcessorPostMessageSupport=(e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const r=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),n=new t(1,128,44100),i=URL.createObjectURL(r);let a=!1,o=!1;try{await n.audioWorklet.addModule(i);const t=new e(n,"a",{numberOfOutputs:0}),r=n.createOscillator();t.port.onmessage=()=>a=!0,t.onprocessorerror=()=>o=!0,r.connect(t),r.start(0),await n.startRendering()}catch{}finally{URL.revokeObjectURL(i)}return a&&!o},createTestChannelMergerNodeChannelCountSupport=e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createChannelMerger();if("max"===t.channelCountMode)return!0;try{t.channelCount=2}catch{return!0}return!1},createTestConstantSourceNodeAccurateSchedulingSupport=e=>()=>{if(null===e)return!1;const t=new e(1,1,44100);if(void 0===t.createConstantSource)return!0;return t.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY},createTestConvolverNodeBufferReassignabilitySupport=e=>()=>{if(null===e)return!1;const t=new e(1,1,44100),r=t.createConvolver();r.buffer=t.createBuffer(1,1,t.sampleRate);try{r.buffer=t.createBuffer(1,1,t.sampleRate)}catch{return!1}return!0},createTestConvolverNodeChannelCountSupport=e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createConvolver();try{t.channelCount=1}catch{return!1}return!0},createTestIsSecureContextSupport=e=>()=>null!==e&&e.hasOwnProperty("isSecureContext"),createTestMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport=e=>()=>{if(null===e)return!1;const t=new e;try{return t.createMediaStreamSource(new MediaStream),!1}catch(err){return!0}finally{t.close()}},createTestOfflineAudioContextCurrentTimeSupport=(e,t)=>()=>{if(null===t)return Promise.resolve(!1);const r=new t(1,1,44100),n=e(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{r.oncomplete=()=>{n.disconnect(),e(0!==r.currentTime)},r.startRendering()}))},createTestStereoPannerNodeDefaultValueSupport=e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);if(void 0===t.createStereoPanner)return Promise.resolve(!0);if(void 0===t.createConstantSource)return Promise.resolve(!0);const r=t.createConstantSource(),n=t.createStereoPanner();return r.channelCount=1,r.offset.value=1,n.channelCount=1,r.start(),r.connect(n).connect(t.destination),t.startRendering().then((e=>1!==e.getChannelData(0)[0]))},createUnknownError=()=>new DOMException("","UnknownError"),DEFAULT_OPTIONS={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},createWaveShaperNodeConstructor=(e,t,r,n,i,a,o)=>class extends e{constructor(e,t){const s=i(e),l={...DEFAULT_OPTIONS,...t},c=r(s,l);super(e,!0,c,a(s)?n():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}},createWaveShaperNodeRendererFactory=(e,t,r)=>()=>{const n=new WeakMap;return{render(i,a){const o=n.get(a);return void 0!==o?Promise.resolve(o):(async(i,a)=>{let o=t(i);if(!isOwnedByContext(o,a)){const t={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,curve:o.curve,oversample:o.oversample};o=e(a,t)}return n.set(a,o),isNativeAudioNodeFaker(o)?await r(i,a,o.inputs[0]):await r(i,a,o),o})(i,a)}}},createWindow=()=>"undefined"==typeof window?null:window,createWrapAudioBufferCopyChannelMethods=(e,t)=>r=>{r.copyFromChannel=(n,i,a=0)=>{const o=e(a),s=e(i);if(s>=r.numberOfChannels)throw t();const l=r.length,c=r.getChannelData(s),u=n.length;for(let e=o<0?-o:0;e+o<l&&e<u;e+=1)n[e]=c[e+o]},r.copyToChannel=(n,i,a=0)=>{const o=e(a),s=e(i);if(s>=r.numberOfChannels)throw t();const l=r.length,c=r.getChannelData(s),u=n.length;for(let e=o<0?-o:0;e+o<l&&e<u;e+=1)c[e+o]=n[e]}},createWrapAudioBufferCopyChannelMethodsOutOfBounds=e=>t=>{t.copyFromChannel=(r=>(n,i,a=0)=>{const o=e(a),s=e(i);if(o<t.length)return r.call(t,n,s,o)})(t.copyFromChannel),t.copyToChannel=(r=>(n,i,a=0)=>{const o=e(a),s=e(i);if(o<t.length)return r.call(t,n,s,o)})(t.copyToChannel)},createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer=e=>(t,r)=>{const n=r.createBuffer(1,1,44100);null===t.buffer&&(t.buffer=n),e(t,"buffer",(e=>()=>{const r=e.call(t);return r===n?null:r}),(e=>r=>e.call(t,null===r?n:r)))},createWrapChannelMergerNode=(e,t)=>(r,n)=>{n.channelCount=1,n.channelCountMode="explicit",Object.defineProperty(n,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(n,"channelCountMode",{get:()=>"explicit",set:()=>{throw e()}});const i=r.createBufferSource();t(n,(()=>{const e=n.numberOfInputs;for(let t=0;t<e;t+=1)i.connect(n,0,t)}),(()=>i.disconnect(n)))},getFirstSample=(e,t,r)=>void 0===e.copyFromChannel?e.getChannelData(r)[0]:(e.copyFromChannel(t,r),t[0]),isDCCurve=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},overwriteAccessors=(e,t,r,n)=>{let i=e;for(;!i.hasOwnProperty(t);)i=Object.getPrototypeOf(i);const{get:a,set:o}=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,{get:r(a),set:n(o)})},sanitizeAudioWorkletNodeOptions=e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))}),sanitizeChannelSplitterOptions=e=>({...e,channelCount:e.numberOfOutputs}),sanitizePeriodicWaveOptions=e=>{const{imag:t,real:r}=e;return void 0===t?void 0===r?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(r,(()=>0)),real:r}:void 0===r?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:r}},setValueAtTimeUntilPossible=(e,t,r)=>{try{e.setValueAtTime(t,r)}catch(err){if(9!==err.code)throw err;setValueAtTimeUntilPossible(e,t,r+1e-7)}},testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport=e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},testAudioBufferSourceNodeStartMethodOffsetClampingSupport=e=>{const t=e.createBufferSource(),r=e.createBuffer(1,1,44100);t.buffer=r;try{t.start(0,1)}catch{return!1}return!0},testAudioBufferSourceNodeStopMethodNullifiedBufferSupport=e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},testAudioScheduledSourceNodeStartMethodNegativeParametersSupport=e=>{const t=e.createOscillator();try{t.start(-1)}catch(err){return err instanceof RangeError}return!1},testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport=e=>{const t=e.createBuffer(1,1,44100),r=e.createBufferSource();r.buffer=t,r.start(),r.stop();try{return r.stop(),!0}catch{return!1}},testAudioScheduledSourceNodeStopMethodNegativeParametersSupport=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(err){return err instanceof RangeError}return!1},testAudioWorkletNodeOptionsClonability=e=>{const{port1:t,port2:r}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),r.close()}},testDomExceptionConstructorSupport=()=>{try{new DOMException}catch{return!1}return!0},testTransferablesSupport=()=>new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})),wrapAudioBufferSourceNodeStartMethodOffsetClamping=e=>{e.start=(t=>(r=0,n=0,i)=>{const a=e.buffer,o=null===a?n:Math.min(a.duration,n);null!==a&&o>a.duration-.5/e.context.sampleRate?t.call(e,r,0,0):t.call(e,r,o,i)})(e.start)},wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls=(e,t)=>{const r=t.createGain();e.connect(r);const n=(t=>()=>{t.call(e,r),e.removeEventListener("ended",n)})(e.disconnect);e.addEventListener("ended",n),interceptConnections(e,r),e.stop=(t=>{let n=!1;return (i=0)=>{if(n)try{t.call(e,i)}catch{r.gain.setValueAtTime(0,i)}else t.call(e,i),n=!0}})(e.stop)},wrapEventListener=(e,t)=>r=>{const n={value:e};return Object.defineProperties(r,{currentTarget:n,target:n}),"function"==typeof t?t.call(e,r):t.handleEvent.call(e,r)},addActiveInputConnectionToAudioNode=createAddActiveInputConnectionToAudioNode(insertElementInSet),addPassiveInputConnectionToAudioNode=createAddPassiveInputConnectionToAudioNode(insertElementInSet),deleteActiveInputConnectionToAudioNode=createDeleteActiveInputConnectionToAudioNode(pickElementFromSet),audioNodeTailTimeStore=new WeakMap,getAudioNodeTailTime=createGetAudioNodeTailTime(audioNodeTailTimeStore),cacheTestResult=createCacheTestResult(new Map,new WeakMap),window$1=createWindow(),createNativeAnalyserNode=createNativeAnalyserNodeFactory(cacheTestResult,createIndexSizeError),getAudioNodeRenderer=createGetAudioNodeRenderer(getAudioNodeConnections),renderInputsOfAudioNode=createRenderInputsOfAudioNode(getAudioNodeConnections,getAudioNodeRenderer,isPartOfACycle),createAnalyserNodeRenderer=createAnalyserNodeRendererFactory(createNativeAnalyserNode,getNativeAudioNode,renderInputsOfAudioNode),getNativeContext=createGetNativeContext(CONTEXT_STORE),nativeOfflineAudioContextConstructor=createNativeOfflineAudioContextConstructor(window$1),isNativeOfflineAudioContext=createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor),audioParamAudioNodeStore=new WeakMap,eventTargetConstructor=createEventTargetConstructor(wrapEventListener),nativeAudioContextConstructor=createNativeAudioContextConstructor(window$1),isNativeAudioContext=createIsNativeAudioContext(nativeAudioContextConstructor),isNativeAudioNode=createIsNativeAudioNode(window$1),isNativeAudioParam=createIsNativeAudioParam(window$1),nativeAudioWorkletNodeConstructor=createNativeAudioWorkletNodeConstructor(window$1),audioNodeConstructor=createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE),createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode,addPassiveInputConnectionToAudioNode,connectNativeAudioNodeToNativeAudioNode,deleteActiveInputConnectionToAudioNode,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getAudioNodeTailTime,getEventListenersOfAudioNode,getNativeAudioNode,insertElementInSet,isActiveAudioNode,isPartOfACycle,isPassiveAudioNode),cacheTestResult,createIncrementCycleCounterFactory(CYCLE_COUNTERS,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,isActiveAudioNode),createIndexSizeError,createInvalidAccessError,createNotSupportedError,createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode,CYCLE_COUNTERS,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,getNativeContext,isActiveAudioNode,isNativeOfflineAudioContext),createDetectCycles(audioParamAudioNodeStore,getAudioNodeConnections,getValueForKey),eventTargetConstructor,getNativeContext,isNativeAudioContext,isNativeAudioNode,isNativeAudioParam,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor),analyserNodeConstructor=createAnalyserNodeConstructor(audioNodeConstructor,createAnalyserNodeRenderer,createIndexSizeError,createNativeAnalyserNode,getNativeContext,isNativeOfflineAudioContext),audioBufferStore=new WeakSet,nativeAudioBufferConstructor=createNativeAudioBufferConstructor(window$1),convertNumberToUnsignedLong=createConvertNumberToUnsignedLong(new Uint32Array(1)),wrapAudioBufferCopyChannelMethods=createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong,createIndexSizeError),wrapAudioBufferCopyChannelMethodsOutOfBounds=createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong),audioBufferConstructor=createAudioBufferConstructor(audioBufferStore,cacheTestResult,createNotSupportedError,nativeAudioBufferConstructor,nativeOfflineAudioContextConstructor,createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor),wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),addSilentConnection=createAddSilentConnection(createNativeGainNode),renderInputsOfAudioParam=createRenderInputsOfAudioParam(getAudioNodeRenderer,getAudioParamConnections,isPartOfACycle),connectAudioParam=createConnectAudioParam(renderInputsOfAudioParam),createNativeAudioBufferSourceNode=createNativeAudioBufferSourceNodeFactory(addSilentConnection,cacheTestResult,testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport,testAudioBufferSourceNodeStartMethodOffsetClampingSupport,testAudioBufferSourceNodeStopMethodNullifiedBufferSupport,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioBufferSourceNodeStartMethodOffsetClamping,createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors),wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),renderAutomation=createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections),renderInputsOfAudioParam),createAudioBufferSourceNodeRenderer=createAudioBufferSourceNodeRendererFactory(connectAudioParam,createNativeAudioBufferSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),createAudioParam=createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE),audioParamAudioNodeStore,AUDIO_PARAM_STORE,createAudioParamRenderer,createCancelAndHoldAutomationEvent,createCancelScheduledValuesAutomationEvent,createExponentialRampToValueAutomationEvent,createLinearRampToValueAutomationEvent,createSetTargetAutomationEvent,createSetValueAutomationEvent,createSetValueCurveAutomationEvent,nativeAudioContextConstructor,setValueAtTimeUntilPossible),audioBufferSourceNodeConstructor=createAudioBufferSourceNodeConstructor(audioNodeConstructor,createAudioBufferSourceNodeRenderer,createAudioParam,createInvalidStateError,createNativeAudioBufferSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),audioDestinationNodeConstructor=createAudioDestinationNodeConstructor(audioNodeConstructor,createAudioDestinationNodeRenderer,createIndexSizeError,createInvalidStateError,createNativeAudioDestinationNodeFactory(createNativeGainNode,overwriteAccessors),getNativeContext,isNativeOfflineAudioContext,renderInputsOfAudioNode),createBiquadFilterNodeRenderer=createBiquadFilterNodeRendererFactory(connectAudioParam,createNativeBiquadFilterNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),setAudioNodeTailTime=createSetAudioNodeTailTime(audioNodeTailTimeStore),biquadFilterNodeConstructor=createBiquadFilterNodeConstructor(audioNodeConstructor,createAudioParam,createBiquadFilterNodeRenderer,createInvalidAccessError,createNativeBiquadFilterNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),monitorConnections=createMonitorConnections(insertElementInSet,isNativeAudioNode),wrapChannelMergerNode=createWrapChannelMergerNode(createInvalidStateError,monitorConnections),createNativeChannelMergerNode=createNativeChannelMergerNodeFactory(nativeAudioContextConstructor,wrapChannelMergerNode),createChannelMergerNodeRenderer=createChannelMergerNodeRendererFactory(createNativeChannelMergerNode,getNativeAudioNode,renderInputsOfAudioNode),channelMergerNodeConstructor=createChannelMergerNodeConstructor(audioNodeConstructor,createChannelMergerNodeRenderer,createNativeChannelMergerNode,getNativeContext,isNativeOfflineAudioContext),createChannelSplitterNodeRenderer=createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode,getNativeAudioNode,renderInputsOfAudioNode),channelSplitterNodeConstructor=createChannelSplitterNodeConstructor(audioNodeConstructor,createChannelSplitterNodeRenderer,createNativeChannelSplitterNode,getNativeContext,isNativeOfflineAudioContext,sanitizeChannelSplitterOptions),createNativeConstantSourceNodeFaker=createNativeConstantSourceNodeFakerFactory(addSilentConnection,createNativeAudioBufferSourceNode,createNativeGainNode,monitorConnections),createNativeConstantSourceNode=createNativeConstantSourceNodeFactory(addSilentConnection,cacheTestResult,createNativeConstantSourceNodeFaker,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport),createConstantSourceNodeRenderer=createConstantSourceNodeRendererFactory(connectAudioParam,createNativeConstantSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),constantSourceNodeConstructor=createConstantSourceNodeConstructor(audioNodeConstructor,createAudioParam,createConstantSourceNodeRenderer,createNativeConstantSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createNativeConvolverNode=createNativeConvolverNodeFactory(createNotSupportedError,overwriteAccessors),createConvolverNodeRenderer=createConvolverNodeRendererFactory(createNativeConvolverNode,getNativeAudioNode,renderInputsOfAudioNode),convolverNodeConstructor=createConvolverNodeConstructor(audioNodeConstructor,createConvolverNodeRenderer,createNativeConvolverNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createDelayNodeRenderer=createDelayNodeRendererFactory(connectAudioParam,createNativeDelayNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),delayNodeConstructor=createDelayNodeConstructor(audioNodeConstructor,createAudioParam,createDelayNodeRenderer,createNativeDelayNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativeDynamicsCompressorNode=createNativeDynamicsCompressorNodeFactory(createNotSupportedError),createDynamicsCompressorNodeRenderer=createDynamicsCompressorNodeRendererFactory(connectAudioParam,createNativeDynamicsCompressorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),dynamicsCompressorNodeConstructor=createDynamicsCompressorNodeConstructor(audioNodeConstructor,createAudioParam,createDynamicsCompressorNodeRenderer,createNativeDynamicsCompressorNode,createNotSupportedError,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createGainNodeRenderer=createGainNodeRendererFactory(connectAudioParam,createNativeGainNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),gainNodeConstructor=createGainNodeConstructor(audioNodeConstructor,createAudioParam,createGainNodeRenderer,createNativeGainNode,getNativeContext,isNativeOfflineAudioContext),createNativeIIRFilterNodeFaker=createNativeIIRFilterNodeFakerFactory(createInvalidAccessError,createInvalidStateError,createNativeScriptProcessorNode,createNotSupportedError),renderNativeOfflineAudioContext=createRenderNativeOfflineAudioContext(cacheTestResult,createNativeGainNode,createNativeScriptProcessorNode,createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode,nativeOfflineAudioContextConstructor)),createIIRFilterNodeRenderer=createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderInputsOfAudioNode,renderNativeOfflineAudioContext),createNativeIIRFilterNode=createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker),iIRFilterNodeConstructor=createIIRFilterNodeConstructor(audioNodeConstructor,createNativeIIRFilterNode,createIIRFilterNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createAudioListener=createAudioListenerFactory(createAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeScriptProcessorNode,createNotSupportedError,getFirstSample,isNativeOfflineAudioContext,overwriteAccessors),unrenderedAudioWorkletNodeStore=new WeakMap,minimalBaseAudioContextConstructor=createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor,createAudioListener,eventTargetConstructor,isNativeOfflineAudioContext,unrenderedAudioWorkletNodeStore,wrapEventListener),createNativeOscillatorNode=createNativeOscillatorNodeFactory(addSilentConnection,cacheTestResult,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),createOscillatorNodeRenderer=createOscillatorNodeRendererFactory(connectAudioParam,createNativeOscillatorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),oscillatorNodeConstructor=createOscillatorNodeConstructor(audioNodeConstructor,createAudioParam,createNativeOscillatorNode,createOscillatorNodeRenderer,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createConnectedNativeAudioBufferSourceNode=createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode),createNativeWaveShaperNodeFaker=createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeGainNode,isDCCurve,monitorConnections),createNativeWaveShaperNode=createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeWaveShaperNodeFaker,isDCCurve,monitorConnections,nativeAudioContextConstructor,overwriteAccessors),createNativePannerNodeFaker=createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode,createInvalidStateError,createNativeChannelMergerNode,createNativeGainNode,createNativeScriptProcessorNode,createNativeWaveShaperNode,createNotSupportedError,disconnectNativeAudioNodeFromNativeAudioNode,getFirstSample,monitorConnections),createNativePannerNode=createNativePannerNodeFactory(createNativePannerNodeFaker),createPannerNodeRenderer=createPannerNodeRendererFactory(connectAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeGainNode,createNativePannerNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),pannerNodeConstructor=createPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativePannerNode,createPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativePeriodicWave=createNativePeriodicWaveFactory(createIndexSizeError),periodicWaveConstructor=createPeriodicWaveConstructor(createNativePeriodicWave,getNativeContext,new WeakSet,sanitizePeriodicWaveOptions),nativeStereoPannerNodeFakerFactory=createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeGainNode,createNativeWaveShaperNode,createNotSupportedError,monitorConnections),createNativeStereoPannerNode=createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory,createNotSupportedError),createStereoPannerNodeRenderer=createStereoPannerNodeRendererFactory(connectAudioParam,createNativeStereoPannerNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),stereoPannerNodeConstructor=createStereoPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativeStereoPannerNode,createStereoPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext),createWaveShaperNodeRenderer=createWaveShaperNodeRendererFactory(createNativeWaveShaperNode,getNativeAudioNode,renderInputsOfAudioNode),waveShaperNodeConstructor=createWaveShaperNodeConstructor(audioNodeConstructor,createInvalidStateError,createNativeWaveShaperNode,createWaveShaperNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),isSecureContext=createIsSecureContext(window$1),exposeCurrentFrameAndCurrentTime=createExposeCurrentFrameAndCurrentTime(window$1),backupOfflineAudioContextStore=new WeakMap,getOrCreateBackupOfflineAudioContext=createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore,nativeOfflineAudioContextConstructor),addAudioWorkletModule=isSecureContext?createAddAudioWorkletModule(cacheTestResult,createNotSupportedError,createEvaluateSource(window$1),exposeCurrentFrameAndCurrentTime,createFetchSource(createAbortError),getNativeContext,getOrCreateBackupOfflineAudioContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,new WeakMap,new WeakMap,createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor),window$1):void 0,isNativeContext=createIsNativeContext(isNativeAudioContext,isNativeOfflineAudioContext),decodeAudioData=createDecodeAudioData(audioBufferStore,cacheTestResult,createDataCloneError,createEncodingError,new WeakSet,getNativeContext,isNativeContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,testPromiseSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),baseAudioContextConstructor=createBaseAudioContextConstructor(addAudioWorkletModule,analyserNodeConstructor,audioBufferConstructor,audioBufferSourceNodeConstructor,biquadFilterNodeConstructor,channelMergerNodeConstructor,channelSplitterNodeConstructor,constantSourceNodeConstructor,convolverNodeConstructor,decodeAudioData,delayNodeConstructor,dynamicsCompressorNodeConstructor,gainNodeConstructor,iIRFilterNodeConstructor,minimalBaseAudioContextConstructor,oscillatorNodeConstructor,pannerNodeConstructor,periodicWaveConstructor,stereoPannerNodeConstructor,waveShaperNodeConstructor),mediaElementAudioSourceNodeConstructor=createMediaElementAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaElementAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioDestinationNodeConstructor=createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioDestinationNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioSourceNodeConstructor=createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),createNativeMediaStreamTrackAudioSourceNode=createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError,isNativeOfflineAudioContext),mediaStreamTrackAudioSourceNodeConstructor=createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamTrackAudioSourceNode,getNativeContext),audioContextConstructor=createAudioContextConstructor(baseAudioContextConstructor,createInvalidStateError,createNotSupportedError,createUnknownError,mediaElementAudioSourceNodeConstructor,mediaStreamAudioDestinationNodeConstructor,mediaStreamAudioSourceNodeConstructor,mediaStreamTrackAudioSourceNodeConstructor,nativeAudioContextConstructor),getUnrenderedAudioWorkletNodes=createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore),addUnrenderedAudioWorkletNode=createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),connectMultipleOutputs=createConnectMultipleOutputs(createIndexSizeError),deleteUnrenderedAudioWorkletNode=createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),disconnectMultipleOutputs=createDisconnectMultipleOutputs(createIndexSizeError),activeAudioWorkletNodeInputsStore=new WeakMap,getActiveAudioWorkletNodeInputs=createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore,getValueForKey),createNativeAudioWorkletNodeFaker=createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs,createIndexSizeError,createInvalidStateError,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,createNativeScriptProcessorNode,createNotSupportedError,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getActiveAudioWorkletNodeInputs,monitorConnections),createNativeAudioWorkletNode=createNativeAudioWorkletNodeFactory(createInvalidStateError,createNativeAudioWorkletNodeFaker,createNativeGainNode,createNotSupportedError,monitorConnections),createAudioWorkletNodeRenderer=createAudioWorkletNodeRendererFactory(connectAudioParam,connectMultipleOutputs,createNativeAudioBufferSourceNode,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,deleteUnrenderedAudioWorkletNode,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getNativeAudioNode,nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),getBackupOfflineAudioContext=createGetBackupOfflineAudioContext(backupOfflineAudioContextStore),setActiveAudioWorkletNodeInputs=createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore),audioWorkletNodeConstructor=isSecureContext?createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode,audioNodeConstructor,createAudioParam,createAudioWorkletNodeRenderer,createNativeAudioWorkletNode,getAudioNodeConnections,getBackupOfflineAudioContext,getNativeContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,sanitizeAudioWorkletNodeOptions,setActiveAudioWorkletNodeInputs,testAudioWorkletNodeOptionsClonability,wrapEventListener):void 0,createNativeOfflineAudioContext=createCreateNativeOfflineAudioContext(createNotSupportedError,nativeOfflineAudioContextConstructor),startRendering=createStartRendering(audioBufferStore,cacheTestResult,getAudioNodeRenderer,getUnrenderedAudioWorkletNodes,renderNativeOfflineAudioContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),offlineAudioContextConstructor=createOfflineAudioContextConstructor(baseAudioContextConstructor,cacheTestResult,createInvalidStateError,createNativeOfflineAudioContext,startRendering),isAnyAudioContext=createIsAnyAudioContext(CONTEXT_STORE,isNativeAudioContext),isAnyAudioNode=createIsAnyAudioNode(AUDIO_NODE_STORE,isNativeAudioNode),isAnyAudioParam=createIsAnyAudioParam(AUDIO_PARAM_STORE,isNativeAudioParam),isAnyOfflineAudioContext=createIsAnyOfflineAudioContext(CONTEXT_STORE,isNativeOfflineAudioContext),isSupported=()=>createIsSupportedPromise(cacheTestResult,createTestAudioBufferCopyChannelMethodsSubarraySupport(nativeOfflineAudioContextConstructor),createTestAudioContextCloseMethodSupport(nativeAudioContextConstructor),createTestAudioContextDecodeAudioDataMethodTypeErrorSupport(nativeOfflineAudioContextConstructor),createTestAudioContextOptionsSupport(nativeAudioContextConstructor),createTestAudioNodeConnectMethodSupport(nativeOfflineAudioContextConstructor),createTestAudioWorkletProcessorNoOutputsSupport(nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor),createTestChannelMergerNodeChannelCountSupport(nativeOfflineAudioContextConstructor),createTestConstantSourceNodeAccurateSchedulingSupport(nativeOfflineAudioContextConstructor),createTestConvolverNodeBufferReassignabilitySupport(nativeOfflineAudioContextConstructor),createTestConvolverNodeChannelCountSupport(nativeOfflineAudioContextConstructor),testDomExceptionConstructorSupport,createTestIsSecureContextSupport(window$1),createTestMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport(nativeAudioContextConstructor),createTestStereoPannerNodeDefaultValueSupport(nativeOfflineAudioContextConstructor),testTransferablesSupport);function assert$1(e,t){if(!e)throw new Error(t)}function assertRange(e,t,r=1/0){if(!(t<=e&&e<=r))throw new RangeError(`Value must be within [${t}, ${r}], got: ${e}`)}function assertContextRunning(e){e.isOffline||"running"===e.state||warn$2('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let defaultLogger=console;function setLogger(e){defaultLogger=e}function log$3(...e){defaultLogger.log(...e)}function warn$2(...e){defaultLogger.warn(...e)}const Debug=Object.freeze(Object.defineProperty({__proto__:null,assert:assert$1,assertContextRunning:assertContextRunning,assertRange:assertRange,log:log$3,setLogger:setLogger,warn:warn$2},Symbol.toStringTag,{value:"Module"}));function isUndef(e){return void 0===e}function isDefined(e){return!isUndef(e)}function isFunction$3(e){return"function"==typeof e}function isNumber$4(e){return"number"==typeof e}function isObject$p(e){return"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object}function isBoolean$2(e){return"boolean"==typeof e}function isArray$b(e){return Array.isArray(e)}function isString$2(e){return"string"==typeof e}function isNote(e){return isString$2(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)}function createAudioContext(e){return new audioContextConstructor(e)}function createOfflineAudioContext(e,t,r){return new offlineAudioContextConstructor(e,t,r)}const theWindow="object"==typeof self?self:null,hasAudioContext=theWindow&&(theWindow.hasOwnProperty("AudioContext")||theWindow.hasOwnProperty("webkitAudioContext"));function createAudioWorkletNode(e,t,r){return assert$1(isDefined(audioWorkletNodeConstructor),"This node only works in a secure context (https or localhost)"),new audioWorkletNodeConstructor(e,t,r)}function __decorate(e,t,r,n){var i,a=arguments.length,o=a<3?t:n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function __awaiter$1(e,t,r,n){return new(r||(r=Promise))((function(t,i){function a(e){try{s(n.next(e))}catch(t){i(t)}}function o(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,o)}s((n=n.apply(e,[])).next())}))}let Ticker$1=class{constructor(e,t,r){this._callback=e,this._type=t,this._updateInterval=r,this._createClock()}_createWorker(){const e=new Blob([`
|
|
4
4
|
// the initial timeout time
|
|
@@ -268,7 +268,7 @@ ${getCompatibilityString(s,neededAPIs,t)}</String>
|
|
|
268
268
|
</ObjectInfo>
|
|
269
269
|
</DieCutLabel>`;await dymo.label.framework.printLabelAsync(l.name,u,d).then((()=>{T.innerHTML=e,T.disabled=!1}))}catch(error){console.error("Error printing label:",error),alert("Error printing label: "+error.message)}}))}))},startCalibration=async(e,t,r,n,i=null,a=!1)=>{const o=calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled;n&&(await new Promise((i=>{const s=microphoneInfo$1.current?.micFullName?microphoneInfo$1.current.micFullName:"",l=loudspeakerInfo$1.current.fullLoudspeakerModelName+" "+("“"+webAudioDeviceNames.loudspeaker+"”");webAudioDeviceNames.loudspeakerText=o?"":readi18nPhrases("RC_nameLoudspeaker",r).replace("“[[xxx]]”",l).replace("“[[XXX]]”",l);const c=s+" "+("“"+(n?webAudioDeviceNames.microphone:select?select.options[select.selectedIndex].textContent:"")+"”");webAudioDeviceNames.microphoneText=o?"":readi18nPhrases("RC_nameMicrophone",r).replace("“[[xxx]]”",c).replace("“[[XXX]]”",c),e.subtitle.innerHTML=webAudioDeviceNames.loudspeakerText+"<br/>"+webAudioDeviceNames.microphoneText;const u=document.createElement("h2");u.style.fontSize="1.1rem",u.style.lineHeight="1.5",u.innerHTML=`${readi18nPhrases("RC_removeHeadphones",r).replace(/\n/g,"<br><br>")}
|
|
270
270
|
${readi18nPhrases("RC_chargePhoneNoCase",r).replace(/\n/g,"<br><br>")}`,u.style.marginLeft="0px",u.style.fontSize="1.1rem",e.displayContainer.appendChild(u),console.log("Loudspeaker + Smartphone: ",u.innerHTML);const d=document.createElement("button");d.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",r)),d.classList.add("btn","btn-success"),d.style.marginLeft="0px",d.style.marginTop="2.2rem",e.displayContainer.appendChild(d),d.addEventListener("click",(async()=>{adjustPageNumber(e.title,[{replace:t&&!a?5:t?2:4,with:t&&!a?6:t?3:5}]),removeElements$1([u,d]),i()})),document.addEventListener("keydown",(e=>{"Enter"===e.key&&d.click()}))})),await new Promise((n=>{const i=document.createElement("h2");i.innerHTML=renderMarkdown(readi18nPhrases("RC_platformForPhone",r)).replace(/\n/g,"<br>"),i.style.marginLeft="0px",i.style.fontSize="1.1rem",i.style.lineHeight="1.5",e.displayContainer.appendChild(i),removeAutocompletionMessage();const o=document.createElement("button");o.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",r)),o.classList.add("btn","btn-success"),o.style.marginLeft="0px",o.style.marginTop="2.2rem",e.displayContainer.appendChild(o),o.addEventListener("click",(async()=>{adjustPageNumber(e.title,[{replace:t&&!a?6:t?3:5,with:t&&!a?7:t?4:6}]),removeElements$1([i,o]),n()})),document.addEventListener("keydown",(e=>{"Enter"===e.key&&o.click()}))})));const s=microphoneInfo$1.current?.micFullName?microphoneInfo$1.current.micFullName:"",l=microphoneInfo$1.current?.micFullSerialNumber?microphoneInfo$1.current.micFullSerialNumber:"",c=microphoneInfo$1.current?.micrFullManufacturerName?microphoneInfo$1.current.micrFullManufacturerName:"",{CombinationCalibration:u}=speakerCalibrator,d=loudspeakerInfo$1.current.fullLoudspeakerModelName+" "+("“"+webAudioDeviceNames.loudspeaker+"”");webAudioDeviceNames.loudspeakerText=o?"":readi18nPhrases("RC_nameLoudspeaker",r).replace("“[[xxx]]”",d).replace("“[[XXX]]”",d);const h=s+" "+("“"+(n?webAudioDeviceNames.microphone:select?select.options[select.selectedIndex].textContent:"")+"”");webAudioDeviceNames.microphoneText=o?"":readi18nPhrases("RC_nameMicrophone",r).replace("“[[xxx]]”",h).replace("“[[XXX]]”",h),IDsToSaveInSoundProfileLibrary.ProlificParticipantID=isProlificExperiment()?new URLSearchParams(window.location.search).get("participant"):"",IDsToSaveInSoundProfileLibrary.PavloviaSessionID=thisExperimentInfo.PavloviaSessionID;const p=document.createElement("div");let f=readi18nPhrases(n?"RC_reminderVolumeCase":"RC_reminderVolume",r);p.innerHTML=o?"":f.replace(/\n/g,"<br>"),p.style.marginTop="10px",p.style.marginLeft="0px",p.style.fontSize="1rem",p.style.fontWeight="normal",p.style.display="none",p.style.userSelect="text",e.subtitle.innerHTML=o?"":webAudioDeviceNames.loudspeakerText+"<br/>"+webAudioDeviceNames.microphoneText,e.displayContainer.appendChild(p);const m=document.createElement("button");m.innerHTML=renderMarkdown(readi18nPhrases("RC_ReRecord",r)),m.classList.add("btn","btn-primary"),m.style.marginLeft="0px",m.style.marginTop="10px",m.style.display="none",e.displayContainer.appendChild(m);const g=getButtonsContainer(r);console.log(select);const _={calibrateSoundLimit:calibrateSoundLimit.current,restartButton:m,buttonsContainer:g,reminder:p,language:r,siteUrl:"https://easy-eyes-listener-page.herokuapp.com",targetElementId:"displayQR",debug:debugBool.current,gainValues:globalGains.values,knownIR:i,displayUpdate:e.displayUpdate,instructionDisplayId:"recordingInProgress",soundMessageId:"soundMessage",titleDisplayId:"soundTitle",timeToCalibrateId:"timeToCalibrate",soundSubtitleId:"soundSubtitle",webAudioDeviceNames:webAudioDeviceNames,IDsToSaveInSoundProfileLibrary:IDsToSaveInSoundProfileLibrary,calibrateSoundBurstRepeats:calibrateSoundBurstRepeats.current,calibrateSoundBurstSec:calibrateSoundBurstSec.current,_calibrateSoundBurstPreSec:_calibrateSoundBurstPreSec.current,_calibrateSoundBurstPostSec:_calibrateSoundBurstPostSec.current,calibrateSoundSamplingDesiredBits:calibrateSoundSamplingDesiredBits.current,calibrateSoundHz:calibrateSoundHz.current,timeToCalibrate:timeToCalibrate.current,microphoneName:s,micManufacturer:c,micSerialNumber:l,micModelNumber:l,micModelName:s,isSmartPhone:n,isLoudspeakerCalibration:t,isParticipant:a,calibrateSoundBurstDb:calibrateSoundBurstDb.current,calibrateSoundBurstScalarDB:calibrateSoundBurstScalarDB.current,calibrateSoundBurstNormalizeBy1000HzGainBool:calibrateSoundBurstNormalizeBy1000HzGainBool.current,calibrateSoundBurstFilteredExtraDb:calibrateSoundBurstFilteredExtraDb.current,calibrateSoundBurstLevelReTBool:calibrateSoundBurstLevelReTBool.current,calibrateSoundBurstUses1000HzGainBool:!1,_calibrateSoundBurstMaxSD_dB:_calibrateSoundBurstMaxSD_dB.current,calibrateSoundCheck:calibrateSoundCheck.current,calibrateSoundIRSec:calibrateSoundIRSec.current,calibrateSoundIIRSec:calibrateSoundIIRSec.current,calibrateSoundIIRPhase:calibrateSoundIIRPhase.current,calibrateSound1000HzPreSec:_calibrateSound1000HzPreSec.current,calibrateSound1000HzSec:_calibrateSound1000HzSec.current,calibrateSound1000HzPostSec:_calibrateSound1000HzPostSec.current,calibrateSoundBackgroundSecs:calibrateSoundBackgroundSecs.current,calibrateSoundSmoothOctaves:calibrateSoundSmoothOctaves.current,calibrateSound1000HzMaxSD_dB:_calibrateSound1000HzMaxSD_dB.current,calibrateSoundBurstDownsample:calibrateSoundBurstDownsample.current,calibrateSound1000HzMaxTries:_calibrateSound1000HzMaxTries.current,calibrateSoundSmoothMinBandwidthHz:calibrateSoundSmoothMinBandwidthHz.current,calibrateSoundPowerBinDesiredSec:calibrateSoundPowerBinDesiredSec.current,calibrateSoundPowerDbSDToleratedDb:calibrateSoundPowerDbSDToleratedDb.current,calibrateSoundTaperSec:calibrateSoundTaperSec.current,calibrateMicrophonesBool:calibrateMicrophonesBool.current,authorEmails:authorEmail.current,micrpohoneIdFromWebAudioApi:n?"":select?select.options[select.selectedIndex].textContent:"",phrases:getPhrases(),calibrateSoundSimulateMicrophone:o?"impulseResponse"===calibrateSoundSimulateMicrophone.type?calibrateSoundSimulateMicrophone.amplitudes:calibrateSoundSimulateMicrophone.gains:null,calibrateSoundSimulateLoudspeaker:o?"impulseResponse"===calibrateSoundSimulateLoudspeaker.type?calibrateSoundSimulateLoudspeaker.amplitudes:calibrateSoundSimulateLoudspeaker.gains:null,calibrateSoundSimulateMicrophoneTime:o?calibrateSoundSimulateMicrophone.time:null,calibrateSoundSimulateLoudspeakerTime:o?calibrateSoundSimulateLoudspeaker.time:null,calibrateSoundSimulateMicrophoneType:o?calibrateSoundSimulateMicrophone.type:null,calibrateSoundSimulateLoudspeakerType:o?calibrateSoundSimulateLoudspeaker.type:null,calibrateSoundSimulateMicrophoneFrequencies:o?calibrateSoundSimulateMicrophone.frequencies:null,calibrateSoundSimulateLoudspeakerFrequencies:o?calibrateSoundSimulateLoudspeaker.frequencies:null,calibrateSoundSimulateMicrophoneFileName:o?calibrateSoundSimulateMicrophone.fileName:null,calibrateSoundSimulateLoudspeakerFileName:o?calibrateSoundSimulateLoudspeaker.fileName:null,isLoudspeakerCalibration:t},y=new u({numCaptures:calibrateSoundBurstMLSVersions.current,numMLSPerCapture:2,download:!1,lowHz:_calibrateSoundMinHz.current,highHz:_calibrateSoundMaxHz.current});y.on("update",(({message:t,...r})=>{e.displayUpdate.innerHTML=t})),await adjustDisplayBeforeCalibration(e,n,r,t),calibrationTime.current=getCurrentTimeString(),timeToCalibrate.timeAtTheStartOfCalibration=new Date,ConnectionManager.handler.sendPageTitle("EasyEyes Microphone");const b=o?await SoundCalibrationPeer.handler.simulateCalibration(_,y,ConnectionManager.handler,timeoutSoundCalibrationSec.current):await SoundCalibrationPeer.handler.startCalibration(_,y,ConnectionManager.handler,timeoutSoundCalibrationSec.current);m.style.display="none",p.style.display="none",timeToCalibrate.timeAtTheEndOfCalibration=new Date,timeToCalibrate.calibrationDuration=Math.round((timeToCalibrate.timeAtTheEndOfCalibration-timeToCalibrate.timeAtTheStartOfCalibration)/1e3/60);return document.getElementById("timeToCalibrate").innerHTML=renderMarkdown(readi18nPhrases("RC_calibrationEstimatedAndActualMinutes",r)).replace("[[N11]]",timeToCalibrate.current).replace("[[N22]]",timeToCalibrate.calibrationDuration),console.log("Result of calibration peer: ",b),!1!==b&&("restart"===b?(console.log("Restarting speaker calibration - redirecting to microphone specification page..."),e.displayUpdate.innerHTML="",e.displayUpdate.style.display="none",e.recordingInProgress.innerHTML="",e.timeToCalibrate.innerHTML="",e.title.innerHTML=t&&!n?renderMarkdown(readi18nPhrases("RC_loudspeakerCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","5"):t&&n?renderMarkdown(readi18nPhrases("RC_loudspeakerCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","7"):t||n?renderMarkdown(readi18nPhrases("RC_microphoneCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","6"):renderMarkdown(readi18nPhrases("RC_usbMicrophoneCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","4"),void(await getUSBMicrophoneDetailsFromUser(e,r,t))):"permission denied"===b?(quitPsychoJS("",!1,paramReader,!isProlificExperiment(),!1,"microphonePermissionDenied"),void showExperimentEnding$1(!0,isProlificExperiment())):(adjustDisplayAfterCalibration(e,t),void(t?await parseLoudspeakerCalibrationResults(b,n):await parseMicrophoneCalibrationResults(b,n))))},calibrateAgain=async(e,t,r,n,i=null,a=!1)=>{const o=calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled;e.subtitle.innerHTML=o?"":t?readi18nPhrases(n?"RC_usingSmartphoneMicrophone":"RC_usingUSBMicrophone",r):e.subtitle.innerHTML;const s=microphoneInfo$1.current?.micFullName?microphoneInfo$1.current.micFullName:"",l=microphoneInfo$1.current?.micFullSerialNumber?microphoneInfo$1.current.micFullSerialNumber:"",c=microphoneInfo$1.current?.micrFullManufacturerName?microphoneInfo$1.current.micrFullManufacturerName:"",{Speaker:u,CombinationCalibration:d}=speakerCalibrator,h=document.createElement("button");h.innerHTML=renderMarkdown(readi18nPhrases("RC_ReRecord",r)),h.classList.add("btn","btn-primary"),h.style.marginLeft="0px",h.style.marginTop="10px",h.style.display="none",e.displayContainer.appendChild(h);const p=document.createElement("div");let f=o?"":readi18nPhrases(n?"RC_reminderVolumeCase":"RC_reminderVolume",r);p.innerHTML=o?"":f.replace(/\n/g,"<br>"),p.style.marginTop="10px",p.style.marginLeft="0px",p.style.fontSize="1rem",p.style.fontWeight="normal",p.style.display="none",e.displayContainer.appendChild(p);const m=getButtonsContainer(r);console.log(select);const g={calibrateSoundLimit:calibrateSoundLimit.current,restartButton:h,buttonsContainer:m,reminder:p,language:r,siteUrl:"https://easy-eyes-listener-page.herokuapp.com",targetElementId:"displayQR",debug:debugBool.current,gainValues:globalGains.values,knownIR:i,displayUpdate:e.displayUpdate,instructionDisplayId:"recordingInProgress",soundMessageId:"soundMessage",titleDisplayId:"soundTitle",timeToCalibrateId:"timeToCalibrate",soundSubtitleId:"soundSubtitle",webAudioDeviceNames:webAudioDeviceNames,IDsToSaveInSoundProfileLibrary:IDsToSaveInSoundProfileLibrary,calibrateSoundBurstRepeats:calibrateSoundBurstRepeats.current,calibrateSoundBurstSec:calibrateSoundBurstSec.current,_calibrateSoundBurstPreSec:_calibrateSoundBurstPreSec.current,_calibrateSoundBurstPostSec:_calibrateSoundBurstPostSec.current,calibrateSoundSamplingDesiredBits:calibrateSoundSamplingDesiredBits.current,calibrateSoundHz:calibrateSoundHz.current,timeToCalibrate:timeToCalibrate.current,microphoneName:s,micManufacturer:c,micSerialNumber:l,micModelNumber:l,loudspeakerModelName:loudspeakerInfo$1.current.fullLoudspeakerModelName,micModelName:s,isSmartPhone:n,isParticipant:a,isLoudspeakerCalibration:t,calibrateSoundBurstDb:calibrateSoundBurstDb.current,calibrateSoundBurstFilteredExtraDb:calibrateSoundBurstFilteredExtraDb.current,calibrateSoundBurstLevelReTBool:calibrateSoundBurstLevelReTBool.current,calibrateSoundBurstUses1000HzGainBool:!1,calibrateSoundBurstScalarDB:calibrateSoundBurstScalarDB.current,calibrateSoundBurstNormalizeBy1000HzGainBool:calibrateSoundBurstNormalizeBy1000HzGainBool.current,_calibrateSoundBurstMaxSD_dB:_calibrateSoundBurstMaxSD_dB.current,calibrateSoundCheck:calibrateSoundCheck.current,calibrateSoundIRSec:calibrateSoundIRSec.current,calibrateSoundIIRSec:calibrateSoundIIRSec.current,calibrateSoundIIRPhase:calibrateSoundIIRPhase.current,calibrateSound1000HzPreSec:_calibrateSound1000HzPreSec.current,calibrateSound1000HzSec:_calibrateSound1000HzSec.current,calibrateSound1000HzPostSec:_calibrateSound1000HzPostSec.current,calibrateSoundBackgroundSecs:calibrateSoundBackgroundSecs.current,calibrateSound1000HzMaxSD_dB:_calibrateSound1000HzMaxSD_dB.current,calibrateSoundBurstDownsample:calibrateSoundBurstDownsample.current,calibrateSound1000HzMaxTries:_calibrateSound1000HzMaxTries.current,calibrateSoundSmoothOctaves:calibrateSoundSmoothOctaves.current,calibrateSoundSmoothMinBandwidthHz:calibrateSoundSmoothMinBandwidthHz.current,calibrateSoundPowerBinDesiredSec:calibrateSoundPowerBinDesiredSec.current,calibrateSoundPowerDbSDToleratedDb:calibrateSoundPowerDbSDToleratedDb.current,calibrateSoundTaperSec:calibrateSoundTaperSec.current,calibrateMicrophonesBool:calibrateMicrophonesBool.current,authorEmails:authorEmail.current,micrpohoneIdFromWebAudioApi:n?"":select?select.options[select.selectedIndex].textContent:"",phrases:getPhrases(),calibrateSoundSimulateMicrophone:o?"impulseResponse"===calibrateSoundSimulateMicrophone.type?calibrateSoundSimulateMicrophone.amplitudes:calibrateSoundSimulateMicrophone.gains:null,calibrateSoundSimulateLoudspeaker:o?"impulseResponse"===calibrateSoundSimulateLoudspeaker.type?calibrateSoundSimulateLoudspeaker.amplitudes:calibrateSoundSimulateLoudspeaker.gains:null,calibrateSoundSimulateMicrophoneTime:o?calibrateSoundSimulateMicrophone.time:null,calibrateSoundSimulateLoudspeakerTime:o?calibrateSoundSimulateLoudspeaker.time:null,calibrateSoundSimulateMicrophoneType:o?calibrateSoundSimulateMicrophone.type:null,calibrateSoundSimulateLoudspeakerType:o?calibrateSoundSimulateLoudspeaker.type:null,calibrateSoundSimulateMicrophoneFrequencies:o?calibrateSoundSimulateMicrophone.frequencies:null,calibrateSoundSimulateLoudspeakerFrequencies:o?calibrateSoundSimulateLoudspeaker.frequencies:null,calibrateSoundSimulateMicrophoneFileName:o?calibrateSoundSimulateMicrophone.fileName:null,calibrateSoundSimulateLoudspeakerFileName:o?calibrateSoundSimulateLoudspeaker.fileName:null,isLoudspeakerCalibration:t},_=new d({numCaptures:calibrateSoundBurstMLSVersions.current,numMLSPerCapture:2,download:!1,lowHz:_calibrateSoundMinHz.current,highHz:_calibrateSoundMaxHz.current});_.on("update",(({message:t,...r})=>{e.displayUpdate.innerHTML=t})),await adjustDisplayBeforeCalibration(e,n,r,t),calibrationTime.current=getCurrentTimeString(),timeToCalibrate.timeAtTheStartOfCalibration=new Date,_.setSamplingRates(microphoneActualSamplingRate.current),_.setSampleSize(actualBitsPerSample.current);const y=t?soundCalibrationResults.current.micInfo:microphoneCalibrationResult.current.micInfo,b={OEM:y.OEM,hardwarename:y.HardwareName,hardwarefamily:y.hardwareFamily,hardwaremodel:y.HardwareModel,platformname:y.PlatformName,platformversion:y.PlatformVersion,devicetype:y.DeviceType,DeviceId:y.ID_from_51Degrees,calibrateMicrophonesBool:y.calibrateMicrophonesBool,screenHeight:y.screenHeight,screenWidth:y.screenWidth,microphoneFromAPI:y.webAudioDeviceNames.microphone};_.setDeviceInfo(b),_.setFlags(flags.current),calibrationRound.current--,e.title.innerHTML=t&&!n?renderMarkdown(readi18nPhrases("RC_loudspeakerCalibration",r)).replace("[[N11]]","5").replace("[[N22]]","5"):t&&n?renderMarkdown(readi18nPhrases("RC_loudspeakerCalibration",r)).replace("[[N11]]","7").replace("[[N22]]","7"):t||n?renderMarkdown(readi18nPhrases("RC_microphoneCalibration",r)).replace("[[N11]]","6").replace("[[N22]]","6"):renderMarkdown(readi18nPhrases("RC_usbMicrophoneCalibration",r)).replace("[[N11]]","4").replace("[[N22]]","4"),removeAutocompletionMessage(),ConnectionManager.handler.sendPageTitle("EasyEyes Microphone");const v=o?await SoundCalibrationPeer.handler.simulateCalibration(g,_,ConnectionManager.handler,timeoutSoundCalibrationSec.current):await SoundCalibrationPeer.handler.repeatCalibration(g,window.localStream,_);h.style.display="none",p.style.display="none",timeToCalibrate.timeAtTheEndOfCalibration=new Date,timeToCalibrate.calibrationDuration=Math.round((timeToCalibrate.timeAtTheEndOfCalibration-timeToCalibrate.timeAtTheStartOfCalibration)/1e3/60);return document.getElementById("timeToCalibrate").innerHTML=renderMarkdown(readi18nPhrases("RC_calibrationEstimatedAndActualMinutes",r)).replace("[[N11]]",timeToCalibrate.current).replace("[[N22]]",timeToCalibrate.calibrationDuration),!1!==v&&("restart"===v?(console.log("Restarting speaker calibration - redirecting to microphone specification page..."),e.displayUpdate.innerHTML="",e.displayUpdate.style.display="none",e.recordingInProgress.innerHTML="",e.timeToCalibrate.innerHTML="",e.title.innerHTML=t&&!n?renderMarkdown(readi18nPhrases("RC_loudspeakerCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","5"):t&&n?renderMarkdown(readi18nPhrases("RC_loudspeakerCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","7"):t||n?renderMarkdown(readi18nPhrases("RC_microphoneCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","6"):renderMarkdown(readi18nPhrases("RC_usbMicrophoneCalibration",r)).replace("[[N11]]","2").replace("[[N22]]","4"),void(await getUSBMicrophoneDetailsFromUser(e,r,t))):"permission denied"===v?(quitPsychoJS("",!1,paramReader,!isProlificExperiment(),!1,"microphonePermissionDenied"),void showExperimentEnding$1(!0,isProlificExperiment())):(adjustDisplayAfterCalibration(e,t),void(t?await parseLoudspeakerCalibrationResults(v,n):await parseMicrophoneCalibrationResults(v,n))))},buildLoudspeakerCalibrationPayload=async(e,t)=>{if(soundCalibrationResults.current=e,qualityMetrics.current=e.qualityMetrics,invertedImpulseResponse.current="speakerAndMic"===calibrateSoundCheck.current?soundCalibrationResults.current.system.iir:soundCalibrationResults.current.component.iir,microphoneInfo$1.current={...microphoneInfo$1.current,...soundCalibrationResults.current.micInfo},microphoneInfo$1.current.micFullName=t?microphoneInfo$1.current.micModelName:microphoneInfo$1.current.micFullName,"umik-1"===microphoneInfo$1.current.micFullName&&(microphoneInfo$1.current.micFullName="UMIK-1"),"umik-2"===microphoneInfo$1.current.micFullName&&(microphoneInfo$1.current.micFullName="UMIK-2"),microphoneInfo$1.current.micFullSerialNumber=t?microphoneInfo$1.current.ID:microphoneInfo$1.current.micFullSerialNumber,microphoneInfo$1.current.micrFullManufacturerName=t?microphoneInfo$1.current.OEM:microphoneInfo$1.current.micrFullManufacturerName,"minidsp"===microphoneInfo$1.current.micrFullManufacturerName&&(microphoneInfo$1.current.micrFullManufacturerName="miniDSP"),actualSamplingRate.current=soundCalibrationResults.current.audioInfo?.sourceSampleRate,microphoneActualSamplingRate.current=soundCalibrationResults.current.audioInfo?.sinkSampleRate,actualBitsPerSample.current=soundCalibrationResults.current.audioInfo?.bitsPerSample,microphoneInfo$1.current.CalibrationDate=calibrationTime.current,"none"!==calibrateSoundCheck.current){"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?allHzCalibrationResults.system=soundCalibrationResults.current.system:"speakerOrMic"===calibrateSoundCheck.current||"goal"===calibrateSoundCheck.current?allHzCalibrationResults.component=soundCalibrationResults.current.component:"both"===calibrateSoundCheck.current&&(allHzCalibrationResults.system=soundCalibrationResults.current.system,allHzCalibrationResults.component=soundCalibrationResults.current.component),allHzCalibrationResults.mls_psd=soundCalibrationResults.current.mls_psd;const e=microphoneInfo$1.current.OEM.toLowerCase().split(" ").join(""),t=microphoneInfo$1.current.ID,r=calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled;if(console.log("simulationEnabled in parseLoudspeakerCalibrationResults",r),r){const e=soundCalibrationResults.current.simulatedMicrophoneIR;console.log("simulatedMicrophoneIR in parseLoudspeakerCalibrationResults",e),allHzCalibrationResults.microphoneGain=e||{Freq:[],Gain:[]}}else{const r=await readFrqGainFromFirestore(t,e);allHzCalibrationResults.microphoneGain=r||{Freq:[],Gain:[]}}allHzCalibrationResults.filteredMLSRange=soundCalibrationResults.current.filteredMLSRange,calibrateSoundBackgroundSecs.current>0&&(allHzCalibrationResults.background={x_background:soundCalibrationResults.current.background_noise?.x_background,y_background:soundCalibrationResults.current.background_noise?.y_background})}filteredMLSAttenuation.component=soundCalibrationResults.current.filteredMLSAttenuation.component,filteredMLSAttenuation.system=soundCalibrationResults.current.filteredMLSAttenuation.system,filteredMLSAttenuation.maxAbsComponent=soundCalibrationResults.current.filteredMLSAttenuation.maxAbsComponent,filteredMLSAttenuation.maxAbsSystem=soundCalibrationResults.current.filteredMLSAttenuation.maxAbsSystem,filteredMLSAttenuation.attenuationDbSystem=10*Math.log10(filteredMLSAttenuation.system),filteredMLSAttenuation.attenuationDbComponent=10*Math.log10(filteredMLSAttenuation.component),fMaxHz.system=soundCalibrationResults.current.system.fMaxHz,fMaxHz.component=soundCalibrationResults.current.component.fMaxHz,attenuatorGainDB.system=soundCalibrationResults.current.system.attenuatorGainDB,attenuatorGainDB.component=soundCalibrationResults.current.component.attenuatorGainDB,soundGainDBSPL.current=soundCalibrationResults.current.parameters.gainDBSPL,soundGainDBSPL.current=Math.round(10*soundGainDBSPL.current)/10,allHzCalibrationResults.timestamps=soundCalibrationResults.current.timeStamps,flags.current=soundCalibrationResults.current.flags;const r=loudspeakerInfo$1.current.fullLoudspeakerModelNumber,n=loudspeakerInfo$1.current.fullLoudspeakerModelName;loudspeakerInfo$1.current={...loudspeakerInfo$1.current,webAudioDeviceNames:{loudspeaker:webAudioDeviceNames.loudspeaker,microphone:webAudioDeviceNames.microphone},PavloviaSessionID:thisExperimentInfo.PavloviaSessionID,userIDs:IDsToSaveInSoundProfileLibrary,ModelName:n,ID:r,isSmartPhone:t,HardwareName:thisDevice.current.HardwareName,HardwareModel:thisDevice.current.HardwareModel,HardwareModelVariants:thisDevice.current.HardwareModelVariants,HardwareFamily:thisDevice.current.HardwareFamily,OEM:thisDevice.current.OEM,DeviceType:thisDevice.current.DeviceType,DeviceId:thisDevice.current.DeviceId,PlatformName:thisDevice.current.PlatformName,PlatformVersion:thisDevice.current.PlatformVersion,browser:thisExperimentInfo?.deviceBrowser,browserVersion:thisExperimentInfo?.deviceBrowserVersion,gainDBSPL:Math.round(10*(soundGainDBSPL.current-microphoneInfo$1.current.gainDBSPL))/10,CalibrationDate:calibrationTime.current,createDate:new Date(Date.parse(calibrationTime.current)),micInfo:microphoneInfo$1.current,calibrateMicrophonesBool:calibrateMicrophonesBool.current,mlsSD:Number(qualityMetrics.current?.mls),systemCorrectionSD:Number(qualityMetrics.current?.system),componentCorrectionSD:Number(qualityMetrics.current?.component)},calibrateMicrophonesBool.current&&(loudspeakerInfo$1.current.authorEmails=authorEmail.current);const i=soundCalibrationResults.current.component.ir.Freq,a=soundCalibrationResults.current.component.ir.Gain;if(calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled){const e=soundCalibrationResults.current.simulatedLoudspeakerIR;e?(loudspeakerIR.Freq=e.Freq,loudspeakerIR.Gain=e.Gain):(loudspeakerIR.Freq=[],loudspeakerIR.Gain=[])}else loudspeakerIR.Freq=i,loudspeakerIR.Gain=a;let o;if(allHzCalibrationResults.knownIr=JSON.parse(JSON.stringify(soundCalibrationResults.current.component.ir)),soundCalibrationResults.current&&(o={experiment:thisExperimentInfo.experiment,pavloviaSessionID:thisExperimentInfo.PavloviaSessionID,_calibrateMicrophonesBool:calibrateMicrophonesBool.current,_calibrateSoundBackgroundSecs:calibrateSoundBackgroundSecs.current,_calibrateSoundBurstDownsample:calibrateSoundBurstDownsample.current,_calibrateSOundBurstMaxSD_dB:_calibrateSoundBurstMaxSD_dB.current,_calibrateSoundBurstMLSVersions:calibrateSoundBurstMLSVersions.current,_calibrateSoundBurstScalar_dB:calibrateSoundBurstScalarDB.current,_calibrateSoundCheck:calibrateSoundCheck.current,_calibrateSoundPowerBinDesiredSec:calibrateSoundPowerBinDesiredSec.current,_calibrateSoundPowerDbSDToleratedDb:calibrateSoundPowerDbSDToleratedDb.current,_calibrateSoundSamplingDesiredBits:calibrateSoundSamplingDesiredBits.current,_calibrateSoundSamplingDesiredHz:calibrateSoundHz.current,_calibrateSoundSaveJSON:_calibrateSoundSaveJSON.current,_calibrateSoundTaperSec:calibrateSoundTaperSec.current,_calibrateSoundTolerance_dB:"Not implemented yet",_needSmartPhoneCheckBool:"Not implemented",_showSoundCalibrationResultsBool:_calibrateSoundShowResultsBool.current,_showSoundTestPageBool:_calibrateSoundShowTestPageBool.current,calibrateSound1000HzBool:_calibrateSound1000HzBool.currentHardwareModelVariants,calibrateSound1000HzDB:_calibrateSound1000HzDB.current,calibrateSoundAllHzBool:_calibrateSoundAllHzBool.current,SoundGainParameters:soundCalibrationResults.current?.parameters,Cal1000HzInDb:soundCalibrationResults.current?.inDBValues,Cal1000HzOutDb:soundCalibrationResults.current?.outDBSPL1000Values,outDBSPLValues:soundCalibrationResults.current?.outDBSPLValues,THD:soundCalibrationResults.current?.thdValues,MlsSpectrumHz_system:soundCalibrationResults.current?.system?.psd?.conv?.x,MlsSpectrumFilteredDb_system:soundCalibrationResults.current?.system?.psd?.conv?.y,MlsSpectrumUnfilteredHz_system:soundCalibrationResults.current?.system?.psd?.unconv?.x,MlsSpectrumUnfilteredDb_system:soundCalibrationResults.current?.system?.psd?.unconv?.y,MlsSpectrumHz_component:soundCalibrationResults.current?.component?.psd?.conv?.x,MlsSpectrumFilteredDb_component:soundCalibrationResults.current?.component?.psd?.conv?.y,MlsSpectrumUnfilteredHz_component:soundCalibrationResults.current?.component?.psd?.unconv?.x,MlsSpectrumUnfilteredDb_component:soundCalibrationResults.current?.component?.psd?.unconv?.y,"Loudspeaker Component IR":loudspeakerIR,"Loudspeaker Component IIR":soundCalibrationResults.current?.component?.iir,"Loudspeaker Component IR Time Domain":soundCalibrationResults.current?.component?.ir_in_time_domain,"Loudspeaker system IR":soundCalibrationResults.current?.system?.ir,"Loudspeaker system IIR":soundCalibrationResults.current?.system?.iir,dB_component_iir:soundCalibrationResults.current?.component?.iir_psd?.y,Hz_component_iir:soundCalibrationResults.current?.component?.iir_psd?.x,dB_component_iir_no_bandpass:soundCalibrationResults.current?.component?.iir_psd?.y_no_bandpass,Hz_component_iir_no_bandpass:soundCalibrationResults.current?.component?.iir_psd?.x_no_bandpass,dB_system_iir:soundCalibrationResults.current?.system?.iir_psd?.y,Hz_system_iir:soundCalibrationResults.current?.system?.iir_psd?.x,dB_system_iir_no_bandpass:soundCalibrationResults.current?.system?.iir_psd?.y_no_bandpass,Hz_system_iir_no_bandpass:soundCalibrationResults.current?.system?.iir_psd?.x_no_bandpass,filtered_mls_nbp_system:soundCalibrationResults.current?.system.filtered_no_bandpass_mls_psd,filtered_mls_nbp_component:soundCalibrationResults.current?.component.filtered_no_bandpass_mls_psd,"Loudspeaker model":loudspeakerInfo$1.current,micInfo:soundCalibrationResults.current?.micInfo,autocorrelations:{},backgroundNoiseSystem:{x_background:soundCalibrationResults.current.system.background_noise.x_background,y_background:soundCalibrationResults.current.system.background_noise.y_background},backgroundNoiseComponent:{x_background:soundCalibrationResults.current.component.background_noise.x_background,y_background:soundCalibrationResults.current.component.background_noise.y_background},db_BackgroundNoise:soundCalibrationResults.current?.background_noise?.x_background,Hz_BackgroundNoise:soundCalibrationResults.current?.background_noise?.y_background,db_system_convolution:soundCalibrationResults.current?.system?.filtered_mls_psd?.y,Hz_system_convolution:soundCalibrationResults.current?.system?.filtered_mls_psd?.x,db_component_convolution:soundCalibrationResults.current?.component?.filtered_mls_psd?.y,Hz_component_convolution:soundCalibrationResults.current?.component?.filtered_mls_psd?.x,microphoneGain:allHzCalibrationResults.microphoneGain,db_mls:soundCalibrationResults.current?.mls_psd?.y,Hz_mls:soundCalibrationResults.current?.mls_psd?.x,recordingChecks:soundCalibrationResults.current?.recordingChecks,_calibrateSoundBurstDb:calibrateSoundBurstLevelReTBool.current?calibrateSoundBurstDb.current+soundCalibrationResults.current.parameters.T-soundCalibrationResults.current.parameters.gainDBSPL:calibrateSoundBurstDb.current,_calibrateSoundBurstFilteredExtraDb:calibrateSoundBurstFilteredExtraDb.current,_calibrateSoundBurstLevelReTBool:calibrateSoundBurstLevelReTBool.current,_calibrateSoundBurstSec:calibrateSoundBurstSec.current,_calibrateSoundBurstPreSec:_calibrateSoundBurstPreSec.current,_calibrateSoundBurstPostSec:_calibrateSoundBurstPostSec.current,_calibrateSoundBurstRepeats:calibrateSoundBurstRepeats.current,_calibrateSoundIRSec:calibrateSoundIRSec.current,_calibrateSoundIIRSec:calibrateSoundIIRSec.current,calibrateSoundMinHz:_calibrateSoundMinHz.current,calibrateSoundMaxHz:_calibrateSoundMaxHz.current,calibrateSound1000HzSec:_calibrateSound1000HzSec.current,calibrateSound1000HzPreSec:_calibrateSound1000HzPreSec.current,calibrateSound1000HzPostSec:_calibrateSound1000HzPostSec.current,calibrateSoundHz:calibrateSoundHz.current,_calibrateSoundSmoothOctaves:calibrateSoundSmoothOctaves.current,_calibrateSoundSmoothMinBandwidthHz:calibrateSoundSmoothMinBandwidthHz.current,filteredMLSRange:allHzCalibrationResults.filteredMLSRange,sampleRate:{loudspeaker:actualSamplingRate.current,microphone:microphoneActualSamplingRate.current},sampleSize:actualBitsPerSample.current,filteredMLSRange:allHzCalibrationResults.filteredMLSRange,webAudioDeviceNames:{loudspeaker:webAudioDeviceNames.loudspeaker,microphone:webAudioDeviceNames.microphone},mlsSD:qualityMetrics.current.mls,systemCorrectionSD:Number(qualityMetrics.current?.system),componentCorrectionSD:Number(qualityMetrics.current?.component),calibrateSoundAttenuationSpeakerAndMicDb:filteredMLSAttenuation.attenuationDbSystem,calibrateSoundAttenuationLoudspeakerDb:filteredMLSAttenuation.attenuationDbComponent,calibrateSoundAttenuationSpeakerAndMicGain:filteredMLSAttenuation.system,calibrateSoundAttenuationLoudspeakerGain:filteredMLSAttenuation.component,filteredMLSMaxAbsSystem:filteredMLSAttenuation.maxAbsSystem,filteredMLSMaxAbsComponent:filteredMLSAttenuation.maxAbsComponent,attenuatorGainDB:attenuatorGainDB,fMaxHz:fMaxHz,fs2:soundCalibrationResults.current?.fs2,waveforms:soundCalibrationResults.current.waveforms}),soundCalibrationResults.current?.autocorrelations?.length>0)for(let s=0;s<soundCalibrationResults.current.autocorrelations.length;s++)o.autocorrelations[`autocorrelation_${s}`]=soundCalibrationResults.current.autocorrelations[s];return o},parseLoudspeakerCalibrationResults=async(e,t)=>{const{wantsLocal:r,wantsOnline:n}=parseJsonSaveTargets(_calibrateSoundSaveJSON.current),i=await buildLoudspeakerCalibrationPayload(e,t);if(console.log("Soundcalibration PayLoad: ",i),i)if(n&&r){const e=psychoJS.experiment.downloadJSON(i,calibrationRound.current++);loudspeakerInfo$1.current.jsonFileName=e,psychoJS.experiment.addData("LoudspeakerCalibrationJSON",JSON.stringify(i)),console.log("↓ saved LoudspeakerCalibrationJSON data to local and online")}else if(r){const e=psychoJS.experiment.downloadJSON(i,calibrationRound.current++);loudspeakerInfo$1.current.jsonFileName=e,console.log("↓ saved LoudspeakerCalibrationJSON data to local")}else n?(psychoJS.experiment.addData("LoudspeakerCalibrationJSON",JSON.stringify(i)),console.log("↓ saved LoudspeakerCalibrationJSON data to online")):(loudspeakerInfo$1.current.jsonFileName="",console.log("↓ Not saving LoudspeakerCalibrationJSON data to local and online"));loudspeakerInfo$1.current.screenWidth=microphoneInfo$1.current.screenWidth,loudspeakerInfo$1.current.screenHeight=microphoneInfo$1.current.screenHeight,loudspeakerInfo$1.current.filteredMLSComponentMin=Math.round(10*allHzCalibrationResults.filteredMLSRange.component.Min)/10,loudspeakerInfo$1.current.filteredMLSComponentMax=Math.round(10*allHzCalibrationResults.filteredMLSRange.component.Max)/10,loudspeakerInfo$1.current.filteredMLSSystemMin=Math.round(10*allHzCalibrationResults.filteredMLSRange.system.Min)/10,loudspeakerInfo$1.current.filteredMLSSystemMax=Math.round(10*allHzCalibrationResults.filteredMLSRange.system.Max)/10,loudspeakerInfo$1.current.calibrateSoundBurstDb=calibrateSoundBurstLevelReTBool.current?calibrateSoundBurstDb.current+parameters.T-parameters.gainDBSPL:calibrateSoundBurstDb.current,loudspeakerInfo$1.current.calibrateSoundBurstFilteredExtraDb=calibrateSoundBurstFilteredExtraDb.current,loudspeakerInfo$1.current.calibrateSoundBurstSec=calibrateSoundBurstSec.current,loudspeakerInfo$1.current._calibrateSoundBurstPreSec=_calibrateSoundBurstPreSec.current,loudspeakerInfo$1.current._calibrateSoundBurstPostSec=_calibrateSoundBurstPostSec.current,loudspeakerInfo$1.current.calibrateSoundBurstRepeats=calibrateSoundBurstRepeats.current,loudspeakerInfo$1.current.calibrateSoundHz=calibrateSoundHz.current,loudspeakerInfo$1.current.calibrateSoundIRSec=calibrateSoundIRSec.current,loudspeakerInfo$1.current.calibrateSoundIIRSec=calibrateSoundIIRSec.current,loudspeakerInfo$1.current.calibrateSoundMinHz=_calibrateSoundMinHz.current,loudspeakerInfo$1.current.calibrateSoundMaxHz=_calibrateSoundMaxHz.current,loudspeakerInfo$1.current.fs2=soundCalibrationResults.current.fs2,loudspeakerInfo$1.current.fs=microphoneActualSamplingRate.current,loudspeakerInfo$1.current.T=soundCalibrationResults.current.parameters.T,loudspeakerInfo$1.current.W=soundCalibrationResults.current.parameters.W,loudspeakerInfo$1.current.Q=1/Number(soundCalibrationResults.current.parameters.R.toFixed(1)),loudspeakerInfo$1.current.backgroundDBSPL=soundCalibrationResults.current.parameters.backgroundDBSPL,loudspeakerInfo$1.current.RMSError=soundCalibrationResults.current.parameters.RMSError,loudspeakerInfo$1.current.actualSamplingRate=actualSamplingRate.current,loudspeakerInfo$1.current.actualBitsPerSample=actualBitsPerSample.current;try{calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled||await saveLoudSpeakerInfoToFirestore(loudspeakerInfo$1.current,soundCalibrationResults.current.component.ir_in_time_domain,soundCalibrationResults.current.component.ir,soundCalibrationResults.current.component.iir,allHzCalibrationResults.component.iir_no_bandpass)}catch(err){console.log(err)}console.log("stored data using parseLoundspeakerCalibrationResults")},parseMicrophoneCalibrationResults=async(e,t)=>{soundCalibrationResults.current=e,flags.current=soundCalibrationResults.current.flags,"speakerAndMic"!==calibrateSoundCheck.current&&"both"!==calibrateSoundCheck.current&&"system"!==calibrateSoundCheck.current||(allHzCalibrationResults.system=soundCalibrationResults.current.system),microphoneCalibrationResult.current=e,qualityMetrics.current=e?.qualityMetrics,microphoneInfo$1.current.gainDBSPL=Math.round(10*(microphoneCalibrationResult.current.parameters.gainDBSPL-loudspeakerInfo$1.current.gainDBSPL))/10,microphoneInfo$1.current.CalibrationDate=calibrationTime.current,microphoneInfo$1.current.micrFullManufacturerName=t?microphoneCalibrationResult.current.micInfo.OEM:microphoneInfo$1.current.micrFullManufacturerName;const r=soundCalibrationResults.current.component.ir.Freq,n=soundCalibrationResults.current.component.ir.Gain;microphoneCalibrationResult.current.component.ir={Freq:r,Gain:n},fMaxHz.system=microphoneCalibrationResult.current.system.fMaxHz,fMaxHz.component=microphoneCalibrationResult.current.component.fMaxHz,attenuatorGainDB.system=microphoneCalibrationResult.current.system.attenuatorGainDB,attenuatorGainDB.component=microphoneCalibrationResult.current.component.attenuatorGainDB,filteredMLSAttenuation.component=microphoneCalibrationResult.current.filteredMLSAttenuation.component,filteredMLSAttenuation.system=microphoneCalibrationResult.current.filteredMLSAttenuation.system,filteredMLSAttenuation.maxAbsSystem=microphoneCalibrationResult.current.filteredMLSAttenuation.maxAbsSystem,filteredMLSAttenuation.maxAbsComponent=microphoneCalibrationResult.current.filteredMLSAttenuation.maxAbsComponent,filteredMLSAttenuation.attenuationDbSystem=10*Math.log10(filteredMLSAttenuation.system),filteredMLSAttenuation.attenuationDbComponent=10*Math.log10(filteredMLSAttenuation.component);let i={experiment:thisExperimentInfo.experiment,pavloviaSessionID:thisExperimentInfo.PavloviaSessionID,_calibrateMicrophonesBool:calibrateMicrophonesBool.current,_calibrateSoundBackgroundSecs:calibrateSoundBackgroundSecs.current,_calibrateSoundBurstDownsample:calibrateSoundBurstDownsample.current,_calibrateSOundBurstMaxSD_dB:_calibrateSoundBurstMaxSD_dB.current,_calibrateSoundBurstMLSVersions:calibrateSoundBurstMLSVersions.current,_calibrateSoundBurstScalar_dB:calibrateSoundBurstScalarDB.current,_calibrateSoundCheck:calibrateSoundCheck.current,_calibrateSoundPowerBinDesiredSec:calibrateSoundPowerBinDesiredSec.current,_calibrateSoundPowerDbSDToleratedDb:calibrateSoundPowerDbSDToleratedDb.current,_calibrateSoundSamplingDesiredBits:calibrateSoundSamplingDesiredBits.current,_calibrateSoundSamplingDesiredHz:calibrateSoundHz.current,_calibrateSoundSaveJSON:_calibrateSoundSaveJSON.current,_calibrateSoundTaperSec:calibrateSoundTaperSec.current,_calibrateSoundTolerance_dB:"Not implemented yet",_needSmartPhoneCheckBool:"Not implemented",_showSoundCalibrationResultsBool:_calibrateSoundShowResultsBool.current,_showSoundTestPageBool:_calibrateSoundShowTestPageBool.current,calibrateSound1000HzBool:_calibrateSound1000HzBool.current,calibrateSound1000HzDB:_calibrateSound1000HzDB.current,calibrateSoundAllHzBool:_calibrateSoundAllHzBool.current,SoundGainParameters:e.parameters,Cal1000HzInDb:e.inDBValues?e.inDBValues:[],Cal1000HzOutDb:e.outDBSPL1000Values?e.outDBSPL1000Values:[],outDBSPLValues:e.outDBSPLValues,THD:e.thdValues,isSmartPhone:t,HardwareName:microphoneInfo$1.current.HardwareName,HardwareFamily:microphoneInfo$1.current.HardwareFamily,HardwareModel:microphoneInfo$1.current.HardwareModel,HardwareModelVariants:microphoneInfo$1.currentHardwareModelVariants,PlatformVersion:microphoneInfo$1.current.PlatformVersion,DeviceType:microphoneInfo$1.current.DeviceType,CalibrationDate:microphoneInfo$1.current.CalibrationDate,MlsSpectrumHz_system:e?.system?.psd?.conv?.x,MlsSpectrumFilteredDb_system:e?.system?.psd?.conv?.y,MlsSpectrumUnfilteredHz_system:e?.system?.psd?.unconv?.x,MlsSpectrumUnfilteredDb_system:e?.system?.psd?.unconv?.y,MlsSpectrumHz_component:e?.component?.psd?.conv?.x,MlsSpectrumFilteredDb_component:e?.component?.psd?.conv?.y,MlsSpectrumUnfilteredHz_component:e?.component?.psd?.unconv?.x,MlsSpectrumUnfilteredDb_component:e?.component?.psd?.unconv?.y,"Microphone Component IR":{Freq:r,Gain:n},"Microphone Component IIR":e?.component?.iir,"Loudspeaker Component IR Time Domain":e?.component?.ir_in_time_domain,"Microphone system IR":e?.system?.ir,"Microphone system IIR":e?.system?.iir,dB_component_iir:e?.component?.iir_psd?.y,Hz_component_iir:e?.component?.iir_psd?.x,dB_component_iir_no_bandpass:e?.component?.iir_psd?.y_no_bandpass,Hz_component_iir_no_bandpass:e?.component?.iir_psd?.x_no_bandpass,dB_system_iir:e?.system?.iir_psd?.y,Hz_system_iir:e?.system?.iir_psd?.x,dB_system_iir_no_bandpass:e?.system?.iir_psd?.y_no_bandpass,Hz_system_iir_no_bandpass:e?.system?.iir_psd?.x_no_bandpass,filtered_mls_nbp_system:e.system.filtered_no_bandpass_mls_psd,filtered_mls_nbp_component:e.component.filtered_no_bandpass_mls_psd,"Loudspeaker model":loudspeakerInfo$1.current,micInfo:{micModelName:microphoneInfo$1.current.micFullName,OEM:microphoneInfo$1.current.micrFullManufacturerName,ID:microphoneInfo$1.current.micFullSerialNumber,gainDBSPL:microphoneInfo$1.current.gainDBSPL},autocorrelations:e?.autocorrelations,db_BackgroundNoise:e?.background_noise?.x_background,Hz_BackgroundNoise:e?.background_noise?.y_background,backgroundNoiseSystem:{x_background:e.system.background_noise.x_background,y_background:e.system.background_noise.y_background},backgroundNoiseComponent:{x_background:e.component.background_noise.x_background,y_background:e.component.background_noise.y_background},db_system_convolution:e.system?.filtered_mls_psd?.y,Hz_system_convolution:e.system?.filtered_mls_psd?.x,db_component_convolution:e.component?.filtered_mls_psd?.y,Hz_component_convolution:e.component?.filtered_mls_psd?.x,loudspeakerGain:loudspeakerIR,db_mls:e.mls_psd?.y,Hz_mls:e.mls_psd?.x,recordingChecks:e.recordingChecks,_calibrateSoundBurstDb:calibrateSoundBurstLevelReTBool.current?calibrateSoundBurstDb.current+e.parameters.T-e.parameters.gainDBSPL:calibrateSoundBurstDb.current,_calibrateSoundBurstFilteredExtraDb:calibrateSoundBurstFilteredExtraDb.current,calibrateSoundBurstLevelReTBool:calibrateSoundBurstLevelReTBool.current,calibrateSoundBurstSec:calibrateSoundBurstSec.current,_calibrateSoundBurstPreSec:_calibrateSoundBurstPreSec.current,_calibrateSoundBurstPostSec:_calibrateSoundBurstPostSec.current,_calibrateSoundBurstRepeats:calibrateSoundBurstRepeats.current,_calibrateSoundIRSec:calibrateSoundIRSec.current,_calibrateSoundIIRSec:calibrateSoundIIRSec.current,calibrateSoundMinHz:_calibrateSoundMinHz.current,calibrateSoundMaxHz:_calibrateSoundMaxHz.current,calibrateSound1000HzSec:_calibrateSound1000HzSec.current,calibrateSound1000HzPreSec:_calibrateSound1000HzPreSec.current,calibrateSound1000HzPostSec:_calibrateSound1000HzPostSec.current,calibrateSoundHz:calibrateSoundHz.current,_calibrateSoundSmoothOctaves:calibrateSoundSmoothOctaves.current,_calibrateSoundSmoothMinBandwidthHz:calibrateSoundSmoothMinBandwidthHz.current,sampleRate:{loudspeaker:actualSamplingRate.current,microphone:microphoneActualSamplingRate.current},sampleSize:actualBitsPerSample.current,filteredMLSRange:e.filteredMLSRange,webAudioDeviceNames:{loudspeaker:webAudioDeviceNames.loudspeaker,microphone:webAudioDeviceNames.microphone},mlsSD:Number(e?.qualityMetrics.mls),systemCorrectionSD:Number(e?.qualityMetrics.system),componentCorrectionSD:Number(e?.qualityMetrics.component),calibrateSoundAttenuationSpeakerAndMicDb:filteredMLSAttenuation.attenuationDbSystem,calibrateSoundAttenuationMicrophoneDb:filteredMLSAttenuation.attenuationDbComponent,calibrateSoundAttenuationMicrophoneGain:filteredMLSAttenuation.component,calibrateSoundAttenuationSpeakerAndMicGain:filteredMLSAttenuation.system,filteredMLSMaxAbsComponent:filteredMLSAttenuation.maxAbsComponent,filteredMLSMaxAbsSystem:filteredMLSAttenuation.maxAbsSystem,attenuatorGainDB:attenuatorGainDB,fMaxHz:fMaxHz,fs2:e.fs2,waveforms:soundCalibrationResults.current.waveforms};microphoneCalibrationResult.current.timeStamps=e.timeStamps,microphoneCalibrationResults.push(i),actualSamplingRate.current=soundCalibrationResults.current.audioInfo?.sourceSampleRate,microphoneActualSamplingRate.current=soundCalibrationResults.current.audioInfo?.sinkSampleRate,actualBitsPerSample.current=soundCalibrationResults.current.audioInfo?.bitsPerSample;const{wantsLocal:a,wantsOnline:o}=parseJsonSaveTargets(_calibrateSoundSaveJSON.current);if(o&&a){let t=psychoJS.experiment.downloadJSON(i,calibrationRound.current);e.micInfo.jsonFileName=t,calibrationRound.current=calibrationRound.current+1,psychoJS.experiment.addData("MicrophoneCalibrationJSON",JSON.stringify(i)),console.log("↓ saved MicrophoneCalibrationJSON data to local and online")}else if(a){let t=psychoJS.experiment.downloadJSON(i,calibrationRound.current);e.micInfo.jsonFileName=t,calibrationRound.current=calibrationRound.current+1,console.log("↓ saved MicrophoneCalibrationJSON data to local")}else o?(psychoJS.experiment.addData("MicrophoneCalibrationJSON",JSON.stringify(i)),console.log("↓ saved MicrophoneCalibrationJSON data to online")):(e.micInfo.jsonFileName="",console.log("↓ Not saving MicrophoneCalibrationJSON data to local and online"));e.micInfo.parentTimestamp=loudspeakerInfo$1.current.createDate,e.micInfo.parentFilenameJSON=loudspeakerInfo$1.current.jsonFileName;const s=calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled,l=s?"simulation":await writeIsSmartPhoneToFirestore(e.micInfo.ID,t,e.micInfo.OEM);e.micInfo.filteredMLSSystemMin=Math.round(10*e.filteredMLSRange.system.Min)/10,e.micInfo.filteredMLSSystemMax=Math.round(10*e.filteredMLSRange.system.Max)/10,e.micInfo.filteredMLSComponentMin=Math.round(10*e.filteredMLSRange.component.Min)/10,e.micInfo.filteredMLSComponentMax=Math.round(10*e.filteredMLSRange.component.Max)/10,e.micInfo.calibrateSoundBurstDb=calibrateSoundBurstDb.current,e.micInfo.calibrateSoundBurstFilteredExtraDb=calibrateSoundBurstFilteredExtraDb.current,e.micInfo.calibrateSoundBurstLevelReTBool=calibrateSoundBurstLevelReTBool.current,e.micInfo.calibrateSoundBurstSec=calibrateSoundBurstSec.current,e.micInfo._calibrateSoundburstPreSec=_calibrateSoundBurstPreSec.current,e.micInfo._calibrateSoundBurstPostSec=_calibrateSoundBurstPostSec.current,e.micInfo.calibrateSoundBurstRepeats=calibrateSoundBurstRepeats.current,e.micInfo.calibrateSoundHz=calibrateSoundHz.current,e.micInfo.calibrateSoundIRSec=calibrateSoundIRSec.current,e.micInfo.calibrateSoundIIRSec=calibrateSoundIIRSec.current,e.micInfo.calibrateSoundMinHz=_calibrateSoundMinHz.current,e.micInfo.calibrateSoundMaxHz=_calibrateSoundMaxHz.current,e.micInfo.fs2=e.fs2,e.micInfo.fs=microphoneActualSamplingRate.current,e.micInfo.T=e.parameters.T,e.micInfo.W=e.parameters.W,e.micInfo.Q=1/Number(e.parameters.R.toFixed(1)),e.micInfo.gainDBSPL=microphoneInfo$1.current.gainDBSPL,e.micInfo.backgroundDBSPL=e.parameters.backgroundDBSPL,e.micInfo.RMSError=e.parameters.RMSError,e.micInfo.loudspeakerInfo=loudspeakerInfo$1.current,e.micInfo.browser=thisExperimentInfo?.deviceBrowser,e.micInfo.browserVersion=thisExperimentInfo?.deviceBrowserVersion,e.micInfo.authorEmails=authorEmail.current,s||(await writeMicrophoneInfoToFirestore(e.micInfo,l),await writeFrqGainToFirestore(r,n,l),await writeGainat1000HzToFirestore(microphoneInfo$1.current.gainDBSPL,l))},adjustDisplayBeforeCalibration=async(e,t,r,n)=>{e.displayContainer.style.display="flex",e.displayContainer.style.marginLeft="0px",e.displayContainer.style.flexDirection="column",e.displayUpdate.style.display="flex",e.displayUpdate.style.marginLeft="0px",e.displayUpdate.style.flexDirection="column",e.displayQR.style.display="flex",e.displayQR.style.marginLeft="0px",e.displayQR.style.flexDirection="column";const i=calibrateSoundSimulateLoudspeaker.enabled&&calibrateSoundSimulateMicrophone.enabled;if(!t&&!i){await getConnectionManagerDisplay(!0);const t=document.createElement("button");t.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",r)),t.classList.add("btn","btn-success"),t.addEventListener("click",(()=>{window.open(qrLink.value,"_blank"),t.remove()})),e.displayQR.appendChild(t)}removeAutocompletionMessage();const a=i?"":t?readi18nPhrases("RC_soundCalibrationSeePhone",r):`${readi18nPhrases("RC_removeHeadphones",r)}<br>${readi18nPhrases("RC_getUSBMicrophoneReady",r)}`.replace(/\n/g,"<br>");e.message.style.display="block",e.message.innerHTML=a,e.message.style.lineHeight="1.5",e.message.style.fontSize="1.1rem",console.log("Adjusting display before calibration"),document.body.style.overflow="auto"},adjustDisplayAfterCalibration=(e,t)=>{e.recordingInProgress.innerHTML="",e.message.style.display="block",e.message.style.whiteSpace="normal",e.message.style.fontSize="1.1rem",e.message.style.fontWeight="normal"},getButtonsContainer=e=>{const t=document.createElement("button");t.id="cantReadButton";const r=document.createElement("button");r.id="noSmartphoneButton",r.style.marginTop="13px",t.textContent=readi18nPhrases("RC_cantConnectPhone_Button",e),r.textContent=readi18nPhrases("RC_noSmartphone_Button",e);const n=document.createElement("div");n.style.display="flex",n.style.flexDirection="column",t.addEventListener("click",(async()=>{psychoJS.experiment.addData("QRConnect","✖Cannot"),psychoJS.experiment.nextEntry(),quitPsychoJS("",!1,paramReader,!isProlificExperiment(),!1,"peerConnectCancelled"),showExperimentEnding$1(!0,isProlificExperiment())})),r.addEventListener("click",(async()=>{QRSkipResponse.QRNoSmartphoneBool=!0,psychoJS.experiment.addData("QRConnect","✖NoPhone"),psychoJS.experiment.nextEntry(),quitPsychoJS("",!1,paramReader,!isProlificExperiment(),!1,"peerConnectNoSmartphone"),showExperimentEnding$1(!0,isProlificExperiment())})),t.classList.add("needs-page-button"),r.classList.add("needs-page-button"),n.appendChild(t),n.appendChild(r);const i=new ResizeObserver((e=>{e[0].contentRect.width>0&&(i.disconnect(),requestAnimationFrame((()=>{const e=[t,r].filter((e=>e.clientWidth>0));if(0===e.length)return;const n=Math.min(...e.map((e=>getMaxPossibleFontSize(e.textContent,e.clientWidth,e.clientHeight,getComputedStyle(e).fontFamily,1.15))));e.forEach((e=>{e.style.fontSize=`${n}px`}))})))}));return i.observe(n),n},getAutocompletionMessage=t=>{const r=document.createElement("p");r.style.marginTop="0.5rem",r.style.fontWeight="normal",r.style.fontStyle="italic",r.id="autocompletionMsg";try{r.innerText=readi18nPhrases("RC_autocompletion",t)}catch(e){r.innerText="",r.style.display="none",console.error("Failed to add autocompletion message, RC_autocompletion not found.",e)}return r},removeAutocompletionMessage=()=>{const e=document.getElementById("autocompletionMsg");e&&e.remove()},getCompatibilityString=(e,t,r)=>null!==e?readi18nPhrases("RC_phoneBrowserCantBeIdentified",r):t&&t.getUserMedia?t.getUserMediaError?readi18nPhrases("RC_phoneBrowserIdentifiedButIncompatible",r):readi18nPhrases("RC_phoneBrowserIdentifiedAndCompatible",r):readi18nPhrases("RC_phoneBrowserIdentifiedButIncompatible",r);let active=!1,deps=null;const initRecalibration=e=>{deps=e},isRecalibrationActive=()=>active,onRecalibrateStart=()=>{!active&&deps&&(active=!0,deps.clearKeys())},onRecalibrateEnd=async()=>{active&&deps&&(deps.updateDistanceState(),deps.clearKeys(),deps.requestRestartBlock(),active=!1,deps.hideVideo?.())},getRecalibrationHooks=()=>({onRecalibrateStart:onRecalibrateStart,onRecalibrateEnd:onRecalibrateEnd}),useCalibration=e=>ifTrue$2([...e.read("calibrateFrameRateUnderStressBool","__ALL_BLOCKS__"),...e.read("calibrateBlindSpotBool","__ALL_BLOCKS__"),...e.read("calibrateScreenSizeBool","__ALL_BLOCKS__"),...e.read("calibrateDistanceBool","__ALL_BLOCKS__"),...e.read("calibrateTrackGazeBool","__ALL_BLOCKS__")]),ifAnyCheck=e=>ifTrue$2([...e.read("calibrateScreenSizeCheckBool","__ALL_BLOCKS__"),...e.read("_calibrateDistanceCheckBool","__ALL_BLOCKS__"),...e.read("calibrateGazeCheckBool","__ALL_BLOCKS__")]),parseTwoNumberStringOrDefault=(t,r)=>{try{if("string"==typeof t){const e=t.trim().split(",").map((e=>parseFloat(e.trim())));return 2!==e.length||e.some((e=>Number.isNaN(e)))?r:e}return Array.isArray(t)&&(2===t.length&&t.every((e=>"number"==typeof e&&!Number.isNaN(e))))?t:r}catch(e){return r}},formCalibrationList=e=>{const t=[];ifTrue$2(e.read("calibrateFrameRateUnderStressBool","__ALL_BLOCKS__"))&&t.push({name:"performance",callback:e=>{loggerText(`[rc] idealFps: ${e.value.idealFps}, stressFps: ${e.value.stressFps}`)}}),ifTrue$2(e.read("calibrateScreenSizeBool","__ALL_BLOCKS__"))&&t.push({name:"screenSize",options:{fullscreen:!debug$1,check:e.read("calibrateScreenSizeCheckBool")[0],screenSizeMeasurementCount:e.read("calibrateScreenSizeTimes")[0],calibrateDistanceAllowedRatioPxPerCm:e.read("_calibrateDistanceAllowedRatioPxPerCm")[0],_calibrateScreenSizeCacheBool:e.read("_calibrateScreenSizeCacheBool")[0]}}),ifTrue$2(e.read("calibrateBlindSpotBool","__ALL_BLOCKS__"))&&t.push({name:"measureDistance",options:{fullscreen:!debug$1,sparkle:!0,check:e.read("_calibrateDistanceCheckBool")[0],showCancelButton:!1}});let r=[],n=[],i=!1;if(e.read("_calibrateDistanceCheckBool")[0]){i=!0;const t=e.read("_calibrateDistanceCheckCm")[0];if("string"==typeof t&&t.includes(",")?r.push(...t.split(",")):r.push(t),e.read("_calibrateDistanceCheckLengthCm")[0]){n=e.read("_calibrateDistanceCheckLengthCm")[0].split(",").map(Number)}}r=r.map((e=>parseFloat(e)));const a=e.read("_calibrateDistance")[0];let o="both";if(a){const e=a.split(",").map((e=>e.trim().toLowerCase())),t=e.includes("typical"),r=e.includes("paper")||e.includes("paperorruler"),n=e.includes("object"),i=e.includes("blindspot"),s=e.includes("autocreditcard"),l=e.includes("justcreditcard"),c=e.includes("creditcard");t?(o=!1,o="typical"):n&&i?o="both":s?(o=!1,o="autoCreditCard"):r?(o=!1,o="paper"):l?(o=!1,o="justCreditCard"):c?(o=!1,o="creditCard"):n?o=!0:i&&(o=!1)}let s=e.read("_calibrateDistanceSpotXYDeg")[0],l=e.read("_calibrateDistanceSpotMinMaxDeg")[0];s=parseTwoNumberStringOrDefault(s,[15.5,1.5]),l=parseTwoNumberStringOrDefault(l,[3,16]);const c=parseTwoNumberStringOrDefault(e.read("_calibrateDistanceObjectMinMaxCm")[0],[30,60]);return ifTrue$2(e.read("calibrateDistanceBool","__ALL_BLOCKS__"))&&t.push({name:"trackDistance",options:{nearPoint:!1,showVideo:!0,viewingDistanceAllowedPreciseBool:e.read("viewingDistanceAllowedPreciseBool")[0],calibrateDistanceCheckSecs:e.read("_calibrateDistanceCheckSecs")[0],desiredDistanceCm:e.has("viewingDistanceDesiredCm")?e.read("viewingDistanceDesiredCm")[0]:void 0,desiredDistanceTolerance:e.read("viewingDistanceAllowedRatio")[0]>0?e.read("viewingDistanceAllowedRatio")[0]:1/0,desiredDistanceMonitor:ifTrue$2(e.read("viewingDistanceAllowedRatio","__ALL_BLOCKS__").map((e=>e>0))),desiredDistanceMonitorAllowRecalibrate:!debugBool.current,...getRecalibrationHooks(),fullscreen:!debug$1,calibrateDistanceAllowedRatioPxPerCm:e.read("_calibrateDistanceAllowedRatioPxPerCm")[0],calibrateScreenSizeTimes:e.read("calibrateScreenSizeTimes")[0],sparkle:!0,check:e.read("_calibrateDistanceCheckBool")[0],showCancelButton:!1,calibrateDistanceCheckBool:i,calibrateDistanceCheckCm:r,useObjectTestData:o,calibrateDistance:a,calibrateDistanceCorrectForHeadRotation:e.read("_calibrateDistanceCorrectForHeadRotation")[0],viewingDistanceAllowedHeadRotationDeg:e.read("_viewingDistanceAllowedHeadRotationDeg")[0],calibrateDistanceAllowedRatio:e.read("_calibrateDistanceAllowedRatioFOverWidth")[0],calibrateDistanceAllowedRatioFOverWidth:e.read("_calibrateDistanceAllowedRatioFOverWidth")[0],calibrateDistanceAllowedRatioCm:e.read("_calibrateDistanceAllowedRatioCm")[0],calibrateDistanceAllowedRatioHalfCm:e.read("_calibrateDistanceAllowedRatioHalfCm")[0],calibrateDistanceAllowedRangeCm:e.read("_calibrateDistanceAllowedRangeCm")[0],objecttestdebug:e.read("showDistanceCalibrationBool")[0],calibrateDistanceMinCm:e.read("_calibrateDistanceObjectMinMaxCm")[0],calibrateDistanceCheckLengthCm:n,showNearestPointsBool:e.read("_calibrateDistanceShowEyeFeetBool")[0]||!1,showIrisesBool:e.read("_showIrisesBool")[0]||!1,calibrateDistanceIsCameraTopCenterBool:e.read("_calibrateDistanceIsCameraTopCenterBool")[0]||!1,calibrateDistanceCenterYourEyesBool:e.read("_calibrateDistanceCenterYourEyesBool")[0]||!1,calibrateDistanceAcceptBottomCameraBool:!1!==e.read("_calibrateDistanceAcceptBottomCameraBool")[0],calibrateDistanceExcludeExternalCamerasBool:!1!==e.read("_calibrateDistanceExcludeExternalCamerasBool")[0],calibrateDistanceAllowExternalCameraBool:!0===e.read("_calibrateDistanceAllowExternalCameraBool")[0],calibrateDistanceCameraKindOverride:e.read("_calibrateDistanceCameraKindOverride")[0]||"assess",_calibrateDistanceExcludeTubeDebugBool:e.read("_calibrateDistanceExcludeTubeDebugBool")[0],_calibrateDistanceExcludeTube:e.read("_calibrateDistanceExcludeTube")[0],_calibrateDistanceExcludeTubeTweak:e.read("_calibrateDistanceExcludeTubeTweak")[0],calibrateDistancePupil:e.read("_calibrateDistancePupil")[0]||"iris",resolutionWarningThreshold:e.read("_calibrateDistanceIsCameraMinRes")[0],calibrateDistanceBlindspotDiameterDeg:e.read("_calibrateDistanceBlindspotDiameterDeg")[0],calibrateDistanceOffsetCm:e.read("_calibrateDistanceOffsetCm")[0],calibrateDistanceTubeDiameterCm:e.read("_calibrateDistanceTubeDiameterCm")[0],calibrateDistanceCheckMinRulerCm:e.read("_calibrateDistanceCheckMinRulerCm")[0],calibrateDistanceDrawPaperTubeBool:e.read("_calibrateDistanceDrawPaperTubeBool")[0],viewingDistanceWhichEye:e.read("viewingDistanceWhichEye")[0],viewingDistanceWhichPoint:e.read("viewingDistanceWhichPoint")[0],calibrateDistanceSpotXYDeg:s,calibrateDistanceSpotMinMaxDeg:l,calibrateDistanceBlindspotDebugging:e.read("_calibrateDistanceSpotDebugBool")[0],calibrateDistanceChecking:e.read("_calibrateDistanceCheckLocations")[0],calibrateDistanceObjectMinMaxCm:c,_calibrateDistanceShowRulerUnitsBool:e.read("_calibrateDistanceShowRulerUnitsBool")[0],calibrateDistanceCameraToBlueLineCm:e.read("_calibrateDistanceCameraToBlueLineCm")[0],calibrateDistanceGreenLineVideoFraction:e.read("_calibrateDistanceGreenLineVideoFraction")[0],stepperHistory:e.read("_stepperHistory")[0],calibrateDistanceQuadBaseRatio:e.read("_calibrateDistanceQuadBaseRatio")[0],calibrateDistanceIpdUsesZBool:e.read("_calibrateDistanceIpdUsesZBool")[0],calibrateDistanceLocations:e.read("_calibrateDistanceLocations")[0],calibrateDistanceCameraResolution:e.read("_calibrateDistanceCameraResolution")[0].match(/\d+/g).map(Number),calibrateDistanceCameraHz:e.read("_calibrateDistanceCameraHz")[0],saveSnapshots:e.read("_saveSnapshotsBool")[0],calibrateDistanceFocalLengthRange:e.read("_calibrateDistanceFocalLengthRange")[0],_showCameraResolutionBool:e.read("_showCameraResolutionBool")[0]}}),ifTrue$2(e.read("calibrateTrackGazeBool","__ALL_BLOCKS__"))&&t.push({name:"trackGaze",options:{showGazer:ifTrue$2(e.read("showGazeBool","__ALL_BLOCKS__")),showVideo:!1,calibrationCount:1,fullscreen:!debug$1,saveSnapshots:e.read("_saveSnapshotsBool")[0]}}),t},saveCalibratorData=(e,t,r)=>{if(ifTrue$2(e.read("calibrateScreenSizeBool","__ALL_BLOCKS__"))&&(r.experiment.addData("screenWidthCm",t.screenWidthCm?t.screenWidthCm.value:0),r.experiment.addData("screenHeightCm",t.screenHeightCm?t.screenHeightCm.value:0)),t.viewingDistanceCm)for(let n of t.viewingDistanceData)"BlindSpot"===n.method&&r.experiment.addData("viewingDistanceByBlindSpotCm",n.value);t.fontRenderSec&&r.experiment.addData("fontRenderSec",t.fontRenderSec),t.heap100MBAllocSec&&r.experiment.addData("heap100MBAllocSec",t.heap100MBAllocSec)},saveCheckData=(e,t)=>{for(let r of e.checkData)"screenSize"===r.measure?(r.value.horizontal&&t.experiment.addData("screenWidthByRulerCm",getCmValue(r.value.horizontal.numerical,r.value.horizontal.unit)*screen.width/r.value.horizontal.arrowWidthPx),r.value.vertical&&t.experiment.addData("screenHeightByRulerCm",getCmValue(r.value.vertical.numerical,r.value.vertical.unit)*screen.height/r.value.vertical.arrowHeightPx)):"measureDistance"!==r.measure&&"trackDistance"!==r.measure||t.experiment.addData("viewingDistanceByRulerCm",getCmValue(r.value.numerical,r.value.unit))},calibrateAudio=async t=>{const[r,n]=[ifTrue$2(t.read(getGlossary()._calibrateSound1000HzBool.name,"__ALL_BLOCKS__")),ifTrue$2(t.read(getGlossary()._calibrateSoundAllHzBool.name,"__ALL_BLOCKS__"))];if(!r&&!n)return!0;if(calibrateMicrophonesBool.current=ifTrue$2(t.read(getGlossary()._calibrateMicrophonesBool.name,"__ALL_BLOCKS__")),calibrateSoundBurstLevelReTBool.current=ifTrue$2(t.read(getGlossary()._calibrateSoundBurstLevelReTBool.name,"__ALL_BLOCKS__")),ifTrue$2(t.read(getGlossary()._calibrateSoundBurstDbIsRelativeBool.name,"__ALL_BLOCKS__")),calibrateSoundBurstNormalizeBy1000HzGainBool.current=ifTrue$2(t.read(getGlossary()._calibrateSoundBurstNormalizeBy1000HzGainBool.name,"__ALL_BLOCKS__")),calibrateSoundCheck.current=t.read("_calibrateSoundCheck")[0],_calibrateSoundShowResultsBool.current=ifTrue$2(t.read(getGlossary()._calibrateSoundShowResultsBool.name,"__ALL_BLOCKS__")),_calibrateSoundShowTestPageBool.current=ifTrue$2(t.read(getGlossary()._calibrateSoundShowTestPageBool.name,"__ALL_BLOCKS__")),_calibrateSoundShowParametersBool.current=ifTrue$2(t.read(getGlossary()._calibrateSoundShowParametersBool.name,"__ALL_BLOCKS__")),_calibrateSoundMinHz.current=t.read(getGlossary()._calibrateSoundMinHz.name)[0],timeoutSoundCalibrationSec.current=t.read(getGlossary()._timeoutSoundCalibrationSec.name)[0],timeoutNewPhoneSec.current=t.read(getGlossary()._timeoutNewPhoneSec.name)[0],_calibrateSoundMaxHz.current=t.read(getGlossary()._calibrateSoundMaxHz.name)[0],_calibrateSoundAllHzBool.current=t.read(getGlossary()._calibrateSoundAllHzBool.name)[0],calibrateSoundBurstRepeats.current=t.read(getGlossary()._calibrateSoundBurstRepeats.name)[0],calibrateSoundBurstSec.current=t.read(getGlossary()._calibrateSoundBurstSec.name)[0],_calibrateSoundBurstPreSec.current=t.read(getGlossary()._calibrateSoundBurstPreSec.name)[0],_calibrateSoundBurstPostSec.current=t.read(getGlossary()._calibrateSoundBurstPostSec.name)[0],t.read(getGlossary()._calibrateSoundBurstsWarmup.name)[0],calibrateSoundHz.current=t.read(getGlossary()._calibrateSoundSamplingDesiredHz.name)[0],t.read(getGlossary()._calibrateSoundBurstRecordings.name)[0],calibrateSoundBurstMLSVersions.current=t.read(getGlossary()._calibrateSoundBurstMLSVersions.name)[0],calibrateSoundIIRSec.current=t.read(getGlossary()._calibrateSoundIIRSec.name)[0],calibrateSoundIRSec.current=t.read(getGlossary()._calibrateSoundIRSec.name)[0],calibrateSoundIIRPhase.current=t.read(getGlossary()._calibrateSoundIIRPhase.name)[0],calibrateSoundBurstDb.current=t.read(getGlossary()._calibrateSoundBurstDb.name)[0],calibrateSoundBurstFilteredExtraDb.current=t.read(getGlossary()._calibrateSoundBurstFilteredExtraDb.name)[0],calibrateSoundBurstScalarDB.current=t.read(getGlossary()._calibrateSoundBurstScalar_dB.name)[0],_calibrateSound1000HzSec.current=t.read(getGlossary()._calibrateSound1000HzSec.name)[0],_calibrateSound1000HzBool.current=t.read(getGlossary()._calibrateSound1000HzBool.name)[0],_calibrateSound1000HzDB.current=t.read(getGlossary()._calibrateSound1000HzDB.name)[0],_calibrateSound1000HzPreSec.current=t.read(getGlossary()._calibrateSound1000HzPreSec.name)[0],_calibrateSound1000HzPostSec.current=t.read(getGlossary()._calibrateSound1000HzPostSec.name)[0],calibrateSoundBackgroundSecs.current=t.read(getGlossary()._calibrateSoundBackgroundSecs.name)[0],_calibrateSoundSaveJSON.current=t.read(getGlossary()._calibrateSoundSaveJSON.name)[0],calibrateSoundSmoothOctaves.current=t.read(getGlossary()._calibrateSoundSmoothOctaves.name)[0],_calibrateSoundBurstMaxSD_dB.current=t.read(getGlossary()._calibrateSoundBurstMaxSD_dB.name)[0],_calibrateSound1000HzMaxSD_dB.current=t.read(getGlossary()._calibrateSound1000HzMaxSD_dB.name)[0],calibrateSoundBurstDownsample.current=t.read(getGlossary()._calibrateSoundBurstDownsample.name)[0],_calibrateSound1000HzMaxTries.current=t.read(getGlossary()._calibrateSound1000HzMaxTries.name)[0],calibrateSoundSmoothMinBandwidthHz.current=t.read(getGlossary()._calibrateSoundSmoothMinBandwidthHz.name)[0],calibrateSoundPowerBinDesiredSec.current=t.read(getGlossary()._calibrateSoundPowerBinDesiredSec.name)[0],calibrateSoundPowerDbSDToleratedDb.current=t.read(getGlossary()._calibrateSoundPowerDbSDToleratedDb.name)[0],calibrateSoundTaperSec.current=t.read(getGlossary()._calibrateSoundTaperSec.name)[0],calibrateSoundSamplingDesiredBits.current=t.read(getGlossary()._calibrateSoundSamplingDesiredBits.name)[0],calibrateSoundLimit.current=t.read(getGlossary()._calibrateSoundLimit.name)[0],calibrateSoundUMIKBase_dB.umik1=t.read(getGlossary()._calibrateSoundUMIK1Base_dB.name)[0],calibrateSoundUMIKBase_dB.umik2=t.read(getGlossary()._calibrateSoundUMIK2Base_dB.name)[0],calibrateSoundSimulateLoudspeaker.fileName=t.read(getGlossary()._calibrateSoundSimulateLoudspeaker.name)[0],calibrateSoundSimulateMicrophone.fileName=t.read(getGlossary()._calibrateSoundSimulateMicrophone.name)[0],calibrateSoundSimulateLoudspeaker.fileName&&calibrateSoundSimulateMicrophone.fileName){const e=await parseImpulseResponseOrFrequencyResponseFile(calibrateSoundSimulateLoudspeaker.fileName);calibrateSoundSimulateLoudspeaker.type=e.type,"impulseResponse"===e.type?(calibrateSoundSimulateLoudspeaker.amplitudes=e.amplitudes,calibrateSoundSimulateLoudspeaker.time=e.time):(calibrateSoundSimulateLoudspeaker.frequencies=e.frequencies,calibrateSoundSimulateLoudspeaker.gains=e.gains);const t=await parseImpulseResponseOrFrequencyResponseFile(calibrateSoundSimulateMicrophone.fileName);calibrateSoundSimulateMicrophone.type=t.type,"impulseResponse"===t.type?(calibrateSoundSimulateMicrophone.time=t.time,calibrateSoundSimulateMicrophone.amplitudes=t.amplitudes):(calibrateSoundSimulateMicrophone.frequencies=t.frequencies,calibrateSoundSimulateMicrophone.gains=t.gains)}const i=_calibrateSound1000HzDB.current.split(",");for(let e=0;e<i.length;e++)i[e]=parseFloat(i[e]);const a=i.map((e=>Math.pow(10,e/20)));return timeToCalibrate.current=calculateTimeToCalibrate(a),authorEmail.current=t.read(getGlossary()._authorEmails.name)[0],!!gotLoudspeakerMatch.current||(rc.isFullscreen.value&&(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()),new Promise((async o=>{const s=rc.language.value,l={title:readi18nPhrases(r?"RC_soundCalibrationTitle1000Hz":"RC_soundCalibrationTitleAllHz",s),soundCalibration:readi18nPhrases("RC_loudspeakerCalibration",s),neediPhone:readi18nPhrases("RC_soundCalibrationNeedsMicrophone",s),yes:readi18nPhrases("RC_soundCalibrationYes",s),no:readi18nPhrases("RC_soundCalibrationNo",s),qr:readi18nPhrases("RC_soundCalibrationQR",s),holdiPhoneOK:readi18nPhrases("RC_soundCalibrationContinue",s),clickToStart:readi18nPhrases("RC_soundCalibrationClickToStart",s),done:readi18nPhrases("RC_soundCalibrationLoudspeakerReadyParticipant",s),test:readi18nPhrases("RC_testSounds",s),citation:'Measured sound power is modeled as sum of background sound power and power gain times digital sound power. Microphone compression modeled by Eq. 4 of Giannoulis, Massberg, & Reiss (2012). "Digital Dynamic Range Compressor Design — A Tutorial and Analysis." Journal of Audio Engineering Society. 60 (6): 399–408.',calibrateMicrophone:readi18nPhrases("RC_calibrateAMicrophone",s),proceedToExperiment:readi18nPhrases("RC_proceedToStudy",s)},c=_addSoundCalibrationElems(l),u=document.querySelector("#soundNavContainer");u&&(u.style.display="none");try{if(r&&n&&!gotLoudspeakerMatch.current){const e=await runCombinationCalibration(c,a,!0,rc.language.value);console.log("done combination calibration"),!1===e&&o(!1)}else o(!1)}catch(e){e instanceof speakerCalibrator.UnsupportedDeviceError&&(alert(`${e}: Your Mobile Device is incompatiable with this test`),o(!1)),e instanceof speakerCalibrator.CalibrationTimedOutError&&(alert(`${e}: Something went wrong during this step`),o(!1)),console.error(e)}if(c.displayQR.style.display="none",c.message.innerHTML=l.done,c.yesButton.style.display="none",c.displayUpdate.style.display="none",c.title.innerHTML=renderMarkdown(readi18nPhrases(deviceType.isLoudspeaker?"RC_loudspeakerCalibrationResults":"RC_microphoneCalibrationResults",rc.language.value)),c.title.style.visibility="visible",r&&soundCalibrationResults.current&&invertedImpulseResponse.current&&(allHzCalibrationResults||microphoneCalibrationResult.current)&&_calibrateSoundShowResultsBool.current&&"none"!==calibrateSoundCheck.current&&!gotLoudspeakerMatch.current){displayCompleteTransducerTable(loudspeakerInfo$1.current,microphoneInfo$1.current,c,deviceType.isLoudspeaker,"both"===calibrateSoundCheck.current?"speakerAndMic":calibrateSoundCheck.current);const e="Sound Level at 1000 Hz",t=["Correction"];displayParameters1000Hz(c,i,deviceType.isLoudspeaker?soundCalibrationResults.current:microphoneCalibrationResult.current,e,"both"===calibrateSoundCheck.current?"speakerAndMic":calibrateSoundCheck.current,deviceType.isLoudspeaker),displayVolumeRecordings(c,soundCalibrationResults.current.recordingChecks,deviceType.isLoudspeaker,allHzCalibrationResults.filteredMLSRange.component),displayRecordings(c,deviceType.isLoudspeaker?soundCalibrationResults.current.recordingChecks:microphoneCalibrationResult.current.recordingChecks,deviceType.isLoudspeaker,deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component,calibrateSoundCheck.current),"speakerAndMic"===calibrateSoundCheck.current||"speakerOrMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current||"goal"===calibrateSoundCheck.current?deviceType.isLoudspeaker?displayParametersAllHz(c,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?allHzCalibrationResults.system:allHzCalibrationResults.component,t,calibrateSoundCheck.current,deviceType.isLoudspeaker,allHzCalibrationResults.background,allHzCalibrationResults.mls_psd,allHzCalibrationResults.microphoneGain,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?allHzCalibrationResults.filteredMLSRange.system:allHzCalibrationResults.filteredMLSRange.component,soundCalibrationResults.current.parameters):displayParametersAllHz(c,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?microphoneCalibrationResult.current.system:microphoneCalibrationResult.current.component,t,calibrateSoundCheck.current,deviceType.isLoudspeaker,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,microphoneCalibrationResult.current.microphoneGain,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?microphoneCalibrationResult.current.filteredMLSRange.system:microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters):deviceType.isLoudspeaker?(displayParametersAllHz(c,allHzCalibrationResults.system,t,"speakerAndMic",deviceType.isLoudspeaker,allHzCalibrationResults.background,allHzCalibrationResults.mls_psd,{Freq:[],Gain:[]},allHzCalibrationResults.filteredMLSRange.system,soundCalibrationResults.current.parameters),displayParametersAllHz(c,allHzCalibrationResults.component,t,"speakerOrMic",deviceType.isLoudspeaker,allHzCalibrationResults.background,allHzCalibrationResults.mls_psd,allHzCalibrationResults.microphoneGain,allHzCalibrationResults.filteredMLSRange.component,soundCalibrationResults.current.parameters)):(displayParametersAllHz(c,microphoneCalibrationResult.current.system,t,"speakerAndMic",deviceType.isLoudspeaker,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,microphoneCalibrationResult.current.microphoneGain,microphoneCalibrationResult.current.filteredMLSRange.system,soundCalibrationResults.current.parameters),displayParametersAllHz(c,microphoneCalibrationResult.current.component,t,"speakerOrMic",deviceType.isLoudspeaker,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,loudspeakerIR,microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters)),await displayWhatIsSavedInDatabase(c,deviceType.isLoudspeaker?allHzCalibrationResults.knownIr:microphoneCalibrationResult.current.component.ir,deviceType.isLoudspeaker,"",deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters.RMSError),displayTimestamps(c)}let d=!0;for(;calibrateMicrophonesBool.current;){_calibrateSoundShowTestPageBool.current&&(c.testButton.style.display="block",c.testButton.style.visibility="visible",c.testButton.addEventListener("click",(async e=>{micsForSoundTestPage.list=await getListOfConnectedMicrophones();document.querySelector("#soundTestModal")||addSoundTestElements(t,rc.language.value),$("#soundTestModal").modal("show")}))),c.displayUpdate.style.display="none",c.calibrateMicrophoneButton.style.display="block",againButton.innerHTML=renderMarkdown(readi18nPhrases("RC_Again",rc.language.value)),c.againButton.style.display=deviceType.profileFetchedFromLibrary?"none":"block",deviceType.profileFetchedFromLibrary=!1,c.continueButton.style.display="block",c.navContainer.style.display="flex",c.message.innerHTML=readi18nPhrases(d?"RC_soundCalibrationLoudspeakerReadyScientist":"RC_soundCalibrationMicrophoneDone",rc.language.value),d=!1;const e=await new Promise((async e=>{const t=async()=>{console.log("repeatCalibration"),c.subtitle2.innerText="",c.completeTransducerTable.innerHTML="",c.testButton.style.display="none",c.citation.style.visibility="hidden",c.soundLevelsTable.innerHTML="",c.soundLevelsTableContainer.style.visibility="hidden",c.soundTestPlots.innerHTML="",c.soundParametersFromCalibration.innerHTML="",c.downloadButton.style.visibility="hidden",c.displayUpdate.innerHTML="",c.message.innerHTML="",c.message.style.lineHeight="2rem",c.message.style.fontWeight="normal",c.message.style.fontSize="1.1rem",c.calibrateMicrophoneButton.style.display="none",againButton.style.display="none",c.continueButton.style.display="none",c.timeToCalibrate.innerHTML="",deviceType.isLoudspeaker&&(d=!0),c.timeStamps.innerHTML="";let r=JSON.parse(JSON.stringify(loudspeakerIR));if(await calibrateAgain(c,deviceType.isLoudspeaker,rc.language.value,deviceType.isSmartphone,deviceType.isLoudspeaker?null:r,deviceType.isParticipant),c.title.innerHTML=renderMarkdown(readi18nPhrases(deviceType.isLoudspeaker?"RC_loudspeakerCalibrationResults":"RC_microphoneCalibrationResults",rc.language.value)),c.title.style.visibility="visible",_calibrateSoundShowResultsBool.current){displayCompleteTransducerTable(loudspeakerInfo$1.current,microphoneInfo$1.current,c,deviceType.isLoudspeaker,"both"===calibrateSoundCheck.current?"speakerAndMic":calibrateSoundCheck.current);const e="Sound Level at 1000 Hz",t=["Correction"];displayParameters1000Hz(c,i,deviceType.isLoudspeaker?soundCalibrationResults.current:microphoneCalibrationResult.current,e,"both"===calibrateSoundCheck.current?"speakerAndMic":calibrateSoundCheck.current,deviceType.isLoudspeaker),displayVolumeRecordings(c,deviceType.isLoudspeaker?soundCalibrationResults.current.recordingChecks:microphoneCalibrationResult.current.recordingChecks,deviceType.isLoudspeaker,deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component),displayRecordings(c,deviceType.isLoudspeaker?soundCalibrationResults.current.recordingChecks:microphoneCalibrationResult.current.recordingChecks,deviceType.isLoudspeaker,deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component,calibrateSoundCheck.current),"speakerAndMic"===calibrateSoundCheck.current||"speakerOrMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current||"goal"===calibrateSoundCheck.current?deviceType.isLoudspeaker?displayParametersAllHz(c,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?allHzCalibrationResults.system:allHzCalibrationResults.component,t,calibrateSoundCheck.current,deviceType.isLoudspeaker,allHzCalibrationResults.background,allHzCalibrationResults.mls_psd,allHzCalibrationResults.microphoneGain,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?allHzCalibrationResults.filteredMLSRange.system:allHzCalibrationResults.filteredMLSRange.component,soundCalibrationResults.current.parameters):displayParametersAllHz(c,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?microphoneCalibrationResult.current.system:microphoneCalibrationResult.current.component,t,calibrateSoundCheck.current,deviceType.isLoudspeaker,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,loudspeakerIR,"speakerAndMic"===calibrateSoundCheck.current||"system"===calibrateSoundCheck.current?microphoneCalibrationResult.current.filteredMLSRange.system:microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters):deviceType.isLoudspeaker?(displayParametersAllHz(c,allHzCalibrationResults.system,t,"speakerAndMic",deviceType.isLoudspeaker,allHzCalibrationResults.background,allHzCalibrationResults.mls_psd,{Freq:[],Gain:[]},allHzCalibrationResults.filteredMLSRange.system,soundCalibrationResults.current.parameters),displayParametersAllHz(c,allHzCalibrationResults.component,t,"speakerOrMic",deviceType.isLoudspeaker,allHzCalibrationResults.background,allHzCalibrationResults.mls_psd,allHzCalibrationResults.microphoneGain,allHzCalibrationResults.filteredMLSRange.component,soundCalibrationResults.current.parameters)):(displayParametersAllHz(c,microphoneCalibrationResult.current.system,t,"speakerAndMic",deviceType.isLoudspeaker,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,microphoneCalibrationResult.current.microphoneGain,microphoneCalibrationResult.current.filteredMLSRange.system,soundCalibrationResults.current.parameters),displayParametersAllHz(c,microphoneCalibrationResult.current.component,t,"speakerOrMic",deviceType.isLoudspeaker,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,loudspeakerIR,microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters)),await displayWhatIsSavedInDatabase(c,deviceType.isLoudspeaker?allHzCalibrationResults.knownIr:microphoneCalibrationResult.current.component.ir,deviceType.isLoudspeaker,"",deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters.RMSError),displayTimestamps(c)}c.againButton.removeEventListener("click",t),e()};c.againButton.addEventListener("click",t),c.calibrateMicrophoneButton.addEventListener("click",(async r=>{if(deviceType.isLoudspeaker=!1,c.completeTransducerTable.innerHTML="",c.subtitle2.innerText="",c.testButton.style.display="none",c.citation.style.visibility="hidden",c.soundLevelsTable.innerHTML="",c.soundLevelsTableContainer.style.visibility="hidden",c.soundTestPlots.innerHTML="",c.soundParametersFromCalibration.innerHTML="",c.downloadButton.style.visibility="hidden",c.displayUpdate.innerHTML="",c.message.innerHTML="",c.message.style.lineHeight="2rem",c.message.style.fontWeight="normal",c.message.style.fontSize="1.1rem",c.message.style.overflowX="hidden",c.calibrateMicrophoneButton.style.display="none",againButton.style.display="none",c.continueButton.style.display="none",c.timeToCalibrate.innerHTML="",deviceType.isLoudspeaker=!1,c.timeStamps.innerHTML="",await runCombinationCalibration(c,a,!1,rc.language.value),c.title.innerHTML=renderMarkdown(readi18nPhrases("RC_microphoneCalibrationResults",rc.language.value)),c.title.style.visibility="visible",_calibrateSoundShowResultsBool.current){displayCompleteTransducerTable(loudspeakerInfo$1.current,microphoneInfo$1.current,c,deviceType.isLoudspeaker,"both"===calibrateSoundCheck.current?"speakerAndMic":calibrateSoundCheck.current);const e="Sound Level at 1000 Hz",t=["Correction"];displayParameters1000Hz(c,i,microphoneCalibrationResult.current,e,"both"===calibrateSoundCheck.current?"speakerAndMic":calibrateSoundCheck.current,!1),displayVolumeRecordings(c,deviceType.isLoudspeaker?soundCalibrationResults.current.recordingChecks:microphoneCalibrationResult.current.recordingChecks,deviceType.isLoudspeaker,deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component),displayRecordings(c,deviceType.isLoudspeaker?soundCalibrationResults.current.recordingChecks:microphoneCalibrationResult.current.recordingChecks,deviceType.isLoudspeaker,deviceType.isLoudspeaker?allHzCalibrationResults.filteredMLSRange.component:microphoneCalibrationResult.current.filteredMLSRange.component,calibrateSoundCheck.current),"speakerAndMic"===calibrateSoundCheck.current||"speakerOrMic"===calibrateSoundCheck.current?displayParametersAllHz(c,"speakerAndMic"===calibrateSoundCheck.current?microphoneCalibrationResult.current.system:microphoneCalibrationResult.current.component,t,calibrateSoundCheck.current,!1,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,loudspeakerIR,"speakerAndMic"===calibrateSoundCheck.current?microphoneCalibrationResult.current.filteredMLSRange.system:microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters):(displayParametersAllHz(c,microphoneCalibrationResult.current.system,t,"speakerAndMic",!1,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,loudspeakerIR,microphoneCalibrationResult.current.filteredMLSRange.system,soundCalibrationResults.current.parameters),displayParametersAllHz(c,microphoneCalibrationResult.current.component,t,"speakerOrMic",!1,microphoneCalibrationResult.current.background_noise,microphoneCalibrationResult.current.mls_psd,loudspeakerIR,microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters)),await displayWhatIsSavedInDatabase(c,microphoneCalibrationResult.current.component.ir,!1,"",microphoneCalibrationResult.current.filteredMLSRange.component,soundCalibrationResults.current.parameters.RMSError),displayTimestamps(c)}c.againButton.removeEventListener("click",t),e()})),c.continueButton.addEventListener("click",(async t=>{c.calibrateMicrophoneButton.style.display="none",c.againButton.style.display="none",c.continueButton.style.display="none",calibrateMicrophonesBool.current=!1,e("proceed")}))}));"proceed"===await e&&(_removeSoundCalibrationElems(Object.values(c)),o(!0))}_calibrateSoundShowTestPageBool.current||(_removeSoundCalibrationElems(Object.values(c)),o(!0)),c.navContainer.style.display="flex",c.yesButton.style.display="block",c.testButton.style.display="block",c.testButton.style.visibility="visible",c.testButton.addEventListener("click",(async e=>{micsForSoundTestPage.list=await getListOfConnectedMicrophones();document.querySelector("#soundTestModal")||addSoundTestElements(t,rc.language.value),$("#soundTestModal").modal("show")})),c.yesButton.innerHTML=renderMarkdown(readi18nPhrases("RC_proceedToStudy",s)),c.yesButton.addEventListener("click",(async e=>{_removeSoundCalibrationElems(Object.values(c)),o(!0)}))})))},_addSoundCalibrationElems=e=>{const t=document.querySelector("#root");t&&(t.style.visibility="hidden");const r=document.createElement("h1"),n=document.createElement("h2"),i=document.createElement("p"),a=document.createElement("div"),o=document.createElement("div"),s=document.createElement("h2"),l=document.createElement("div"),c=document.createElement("span"),u=document.createElement("span"),d=document.createElement("div"),h=document.createElement("div"),p=document.createElement("button"),f=document.createElement("button"),m=document.createElement("button"),g=document.createElement("table"),_=document.createElement("div"),y=document.createElement("div"),b=document.createElement("div"),v=document.createElement("div"),S=document.createElement("div"),w=document.createElement("div"),T=document.createElement("button"),E=document.createElement("div"),x=document.createElement("button"),A=document.createElement("button"),C=document.createElement("h1"),R=document.createElement("div"),D=document.createElement("button"),P={timeToCalibrate:R,recordingInProgress:C,background:a,title:r,subtitle:n,subtitle2:i,displayContainer:l,displayQR:c,displayUpdate:u,navContainer:h,yesButton:p,noButton:f,container:o,message:s,testButton:m,soundLevelsTable:g,completeTransducerTable:y,soundParametersFromCalibration:S,soundTestPlots:w,soundTestContainer:v,downloadButton:T,buttonAndParametersContainer:E,citation:d,calibrateMicrophoneButton:x,continueButton:A,againButton:D,soundLevelsTableContainer:_,timeStamps:b};return Object.values(P).forEach((e=>{e.style.userSelect="text"})),R.setAttribute("id","timeToCalibrate"),C.setAttribute("id","recordingInProgress"),r.setAttribute("id","soundTitle"),n.setAttribute("id","soundSubtitle"),i.setAttribute("id","soundSubtitle2"),s.setAttribute("id","soundMessage"),o.setAttribute("id","soundContainer"),a.setAttribute("id","background"),l.setAttribute("id","displayContainer"),c.setAttribute("id","displayQR"),u.setAttribute("id","displayUpdate"),h.setAttribute("id","soundNavContainer"),p.setAttribute("id","soundYes"),f.setAttribute("id","soundNo"),m.setAttribute("id","soundTest"),x.setAttribute("id","calibrateMicrophone"),A.setAttribute("id","continueButton"),D.setAttribute("id","againButton"),S.setAttribute("id","soundParametersFromCalibration"),w.setAttribute("id","soundTestPlots"),v.setAttribute("id","soundTestContainer"),b.setAttribute("id","timeStamps"),d.setAttribute("id","citation"),r.style.fontSize="1.5rem",r.style.marginBottom="0px",s.style.display="none",p.innerHTML=e.yes,f.innerHTML=e.no,p.style.display="none",f.style.display="none",m.innerHTML=e.test,m.style.display="none",d.innerHTML=e.citation,d.style.fontSize="0.8em",d.style.visibility="hidden",x.innerHTML=e.calibrateMicrophone,x.style.display="none",A.innerHTML=e.proceedToExperiment,A.style.display="none",D.style.display="none",u.style.width="100%",c.style.marginLeft="-12px",R.style.marginLeft="0px",n.style.paddingBottom="0px",i.style.paddingTop="0px",i.style.paddingBottom="12px",i.style.margin="0px",n.style.marginBottom="0px",R.style.paddingTop="8px",R.style.paddingBottom="0px",R.style.marginBottom="0px",u.style.paddingTop="0px",l.style.paddingTop="0px",a.classList.add("sound-calibration-background"),o.classList.add("container"),p.classList.add("btn","btn-primary"),f.classList.add("btn","btn-secondary"),m.classList.add("btn","btn-secondary"),x.classList.add("btn","btn-primary"),A.classList.add("btn","btn-success"),D.classList.add("btn","btn-primary"),T.style.visibility="hidden",a.appendChild(o),o.appendChild(C),o.appendChild(r),o.appendChild(n),o.appendChild(i),o.appendChild(s),o.appendChild(h),h.appendChild(m),h.appendChild(x),h.appendChild(D),h.appendChild(p),h.appendChild(f),h.appendChild(A),o.appendChild(l),l.appendChild(R),l.appendChild(u),l.appendChild(c),E.appendChild(S),E.appendChild(T),o.appendChild(y),_.appendChild(g),o.appendChild(_),v.appendChild(E),v.appendChild(w),o.appendChild(v),o.appendChild(b),o.appendChild(d),document.body.appendChild(a),_addSoundCss(),P},_removeSoundCalibrationElems=e=>{console.log("removing sound calibration elements"),Object.values(e).forEach((e=>e.remove())),console.log("removed sound calibration elements");const t=document.querySelector("#root");t&&(t.style.visibility="visible"),console.log("removed sound calibration elements")},_addSoundCss=()=>{const e=document.createElement("style");e.innerText='\n #background {\n width: fit-content;\n height: fit-content;\n margin: auto;\n }\n #soundContainer {\n padding-left: 10px;\n padding-right: 10px;\n }\n #soundContainer > * {\n padding-top: 5px;\n padding-bottom: 5px;\n }\n #soundNavContainer > * {\n margin-right: 10px;\n }\n #displayContainer > * {\n margin: auto;\n display: flex;\n justify-content: center;\n }\n #displayContainer > div {\n padding-top: 5px;\n padding-bottom: 5px;\n }\n #displayContainer > div > div {\n height: 90px;\n width: 90px;\n }\n #soundTest {\n visibility: hidden;\n data-toggle="modal"\n data-target="#soundTestModal"\n }\n ',document.head.appendChild(e)},getCmValue=(e,t)=>"cm"===t?e:2.54*e,ReadingPageFlip="data:audio/mpeg;base64,SUQzAwAAAAAAFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/+7BEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/7sEQABfO3b72oZh+mfE8XoDADIE8l2QQtsGBJ7zxgQaEMAQQQAMLAKbu+ifu7gYhN393RERK+YRM4ETdPREJ3J4iIR/XiIhbu5ohcu7vf7v97toyzCGe9aM9tHMQz+9gghEfL2M/5gXvfWgzE3Dgb4QRXOmm7oiF9dyv6IEEQAT//oGLiIWXEJ3dy58SuTvogiO54B/SxhYRIMBHtt7oHFwIAAAgtBCIggoIhO4GLiVKc3whIiK7nCRKBuaAAALeJ+mX9FmWiIACCREPd4hUw7mhUOL0QRTQnN4iAAAAFS//eOfxOIBgYGLPMIAC3/3d0CIgRNBD7vXOae7n9ACeAAAnolf3dyP0T/4hcLRELRER3OmEABDToFYKAYBhxVJ5ulUO9QHibSP0JN0t68MRwxNKqZoSqwdD81j24oyMbGNQLBIImhf6TJfarwOsEQoIphlxS2kgKMTkHtDHp4tDfMzgN9FjI1vuCyuR2ljOd4RmjKK7oXY5CDbRd80WxUJEKXqL7TqoI6L9FNAlI4eSOYeTMHaJABKCAxXaQMJXbCCWDigF9GFE5KcGQzresfHJKDONNwSBhjrISkWoTA/N2XlMz4yFWKmauQKmZBTNa6NIe4gax5ZXYIMefm6eCmYqHmrEixo54eGTGormxdIPOEDCvhkILueNnokcnc1sVXHSpq/4Of5vOCiH7BgBVxQAO2DUMHA7HhGFQHQRDgAmC4Gg4B232+jkrnafYC6Oic4ApEoiQIROSEBICEE0ZduYBQLOhpkRIlRJIhi+hJ4QhESzlJ0TB+fqvZw2mKQC6CEKMLrHTIE2xNRZPXPMIIdIn//uyZDMABZR4wMupM1KbjtghdyYMWD0dDY9wx8neFyQ1zJi4Bmp7UIyTm6bonys5PTE3YjVfcfEO0afVlw1a/TLTpkETc8U+1dNeeH7aRiGIp3Sc7t7HZlx8NfNQY9PN2HzW6DuxWTJ62d5g2z0VRH0A/McYw+F05zgQWUDrBr6bWnguRSzeUYpIYliaaXL1yoAAzSggrppoQDhZNneC9f/tHsWcLCzCwGOT2NdKMZztT18t5T096v48PmS7kE+TPtly9q109if0z4p2TmMid1Vocm4vZSzMcoD09neLOZ3vTFrTMi1l14k9eQ73zaVy5t88dsriVRPbuXReX7+19vErpC2iYU0ZUOrDfAkWqgXEyAGikJwYBgM48HWYHYL5gDgoGEcEQYPwNQiBLNNqM20lDHQ6MwHA4MkTvePOmxUyaMxoLGBgMCQCYHBIkAwsBDCwaMQCoxYICgGIbyZBIrBQuHA7/wHd5Mp6QxjHY5IowaYD2/o/oJkC7ThOObSTlqJzYCPzcIpp3dHS0IIleEikFsgrdnIMaFITkF03P1s3vJ7mYh5qVkJUZXCQDoFhxApgwQa5a4AfhKzfRr0PpOmWjcrV7lqVGeJqke4SLpZdtLdHG0T0AKMTisMj46HzDIZMwns/3WDNbLePwODHpQbRhAGcboQ+4Cu37sInqDtbgdYB1Kevb6soEAEFiQcBrr0khVKt51Lc++2V/++//++3fIi3aPG/rgoYJgw4QOQ8PH4OOAlDDYAcAwOKza21JU5kpp0KBGhoiYlt7pEVDuhBCCmSABAgYCJxkQVGlSiZAIokTTMhpZ4ZDUJjARGJSEY3//uyRBaABM9ByvuYG8qZBkj9c2Y+EYDVLU1hC+JNm6TdpI8QKhkcPGrxkvEWYrO3VCtu5lsIvlemFLlWLArLYOs5ap6e9GatLnd1mQUYPbUvlIhiBnAzU1KOm+eZmYIdxaqaODZEexKi8entCJIv04eSfSUO5C/gf7pXmfUV27lG729QAWtD1WXMUta6KjR3rhEvWzO2tpEo52hDNgvFhoAAKYRAg6MAKjwSJTRBk3YfMeZDBcMYmzWaI5e+GuI7s9M7DwEwiweIxAOUhYzMHTCFJCEFJ5cLAXyYDDL21q79vsYOAiIYpBhRKDB5IgpFNPbmNmXvXzzdzjoHRpCnztkZE9oQhsvqErxR5YuLkg8LrTcx2YaWQ5L3COZNVUmLlijVxG1CbKGU0AIBHt7GSEC5AWTOyX8YyDi7iF/V8JKAoA/JdBdjkRQKnWfKG5GADm7uTsxApedUS6GZm0KSboBUqFaAwCncZlfs8SIcls5eODG6NZXst1hycD5xKrsfQ0tzAfLcZRBsvBli6rJFRC1Du5iMqPd6aRckNNpLMVBw4YMDBWHdSlC5KT9DmL2KSifWjzPaAF6WJpM2Vc4qcRoiJoYYgIgJoSDcyUcgYtBAEHAE9jDBnYMOpNOPEgiehghiLD3wI9bW0A60WtN41sCgUc37jTEF4JIyNc7vMQZm/bWzwJhMoBhnANqNk6YrI4CMfTQEBh3I5stv60ZQxOBxvmWnGLMlTInMyxxY0qAEAYEC0+P2JuSwaedjdjnRUT6TOInup33lagIwAcejSUOJBgcqhQGCgC0gwEOFgZIRWouy4KE5cbkpFOe7D/SVkMVq//uyRBSERKZXy9NsHGqSSxmKYSPFEmzzJk48cUo+JmVppI5pkhpHzLRVYfLpJUi4moTwDzNsinpg+enrb1roa56Aln762BRGte6y60C9pjMdq8xBCvghbsFARzlKto0lMKZUOwIjrM9lEIDU+5V1RjN7JDCcthGLcgR2kZlGjboTZShuYrFmYWWw/vPvil9oCAAFJLG1DcsRaTAB8jWADEa0SgYcmD6F6i7NEklhRGgBig1vWlWWdR5l0Stz7+2KZsbEZ11n3ep3mTVoaoYdvViqhOj5UZ3E0bbMZx29TZiUZRdEvFppfatNGoWMhuYxwKcq4dlDKlMC+QMKULp86D2QoxkxGEOKH4Uu8PpXO82yPnStI6ahnnQG8MyD1WrllCIHqvOSj02mFTBwUBQVQgGRSBhOzRUJQCiz6+gcD0H3eWk5aYbZBoGKwMwoTgOi7e4xHeXyQRauVTGzN0Z42HRqqEXqzt8IYE19rhiynGxZcnjA1tMCwKOMAeHHKB2BDEVgG4rEDkEHKvYpsp145E8czkQerB8oIwWoNYv3xz9WkImDavLAwwFv1uleY+JgkU5b2X5kAANuRyG4QAfqYYI18hFF2gw21lCl1XHTXL1oS1zJuNHXvDjoMQlL3xB9K5WjBhgYERkjRCsNw9SzbkhGAEIDp582ZChcDwbamfaJCMojqM2CTJLo2+u8MQvdwYtgISkJBnBqwHT59Fm+L3QMEliYTlyIpdaaafIW5EQ8hwy3XpW19t7bbAP0+5+F/30xuTsAYTkkcB0IKHF77K7TBayJC0fLrMCVtTRAw2qQteOEL4AYhK4v4WhJnpMlHzIR//uyZBcABXlITbt4Y3J95cmVbwNuFKEXMa3hK4n1lGd1lhpREgveTBRTgwtgtFV6mjoPqtkvUiSjm8Zd9EsuQ+stjLPmWNhb4vY11nafocYIYrexiBIsnRCmdNZeiNiwf1FjNsfB3iY9sFAwDwn6mKpRAgE4hDIknRZQVJ0TR3M6LzBO0zTvWL6TlNvdZtorzTb5uQ5tN21bzSNy+UYGNiyLLP/9kAPwF2Ro4GBQMMNQweRWVPIm3YQyyAlNU0oJVgNeR57di2c8joBoRBHhszCE4matPgNnyYD8vMyxgDKFIQtdjosHdh416vPAl9YBn7SlYIfijO2kOiyeUQTFoDjsAV9j2IIgG1YADsogG+DYQHHHI+DgmEkIsl0WWEO8/a+XEBIAAAACKkp/JuZeCFUZAImjkBhMwELEQIGA6K6wRZEVAocn2abH9hQdfDjBcBjMTOBiQPWql6lc/TQWaKmet1W4P9AjiOU2ey7KmLuy5RQUzRiEuPNqgSy2ZPIVCh8aKOeiFCiOCI0oolbKJSvvZUlGccz3rRdKEIfJz3yl6/r36jOc4x3dzzneyglIdMOa/3voos/Q/vpZMnypGRS2mbfd7r2xGbACIAAcd35s1lqA7VOh4S2rNGUtZmqjpstf1/S4KYrYGcuytEs6vWIS6VFaI4WcOsQdE5ZyLl7RlrOFQpzjutbIDSYGhAmSxabI+9O0tH9m4Ne+kIv+m8dbXvi35T5h4UEm9+uzvfqrIjq62B8Qsj+HE1bXXv7V+oH8/69qAAZbcPdJjZhcUBAMbBUFCwyjg+jVEFGfM3chiLQ3ITob6M12vMgTAyDKJgBR//uyRBaMxG1QyptpHGKX69lDcYOmUuEFJE3kx8JcLiTJzQ05CRACAFE8YAYMvbACGSgqJnspBYEgsKgSNbSzT0LumhncYI0KHUsihZ2t8stVzjKt4Zx4YEBMBEdPPWrSVmhHNzRM4ewrBHGZ5z0yXuSHGBY5lLYTgEetKAv8kJK+t7+34AAEk4fZAhlUXEIDDgwFQCYVCJWCSqBTBwGBAUEAODAQEBxHldaVCYqz0i37RjUQkC+VCbLNWdNahqTjYKDp0rOwFtuy+FbDM3Sk09Wnq1p6y5pcTlxKPYoI1AVYCqhRPD8EZ9oRgy9JpJCoszvr/p+na55woj5Z5E6bwi6KN6tK0lmR9YyYjSHZSXf8+FVQIK94cjbSyKxQppY6cOE1UOFkOIcXmACZhJaI1M8w0pg6AMaBqxXsIgjHONSUwCihVPq4j2gKQDlASaEtVpfqBKTkmtUkntjyzEctoIziaeEkthNOgkVovUcfXxXwq+hmM9Uac1wdzYbUO+Y2aorNQJukabmZsdCJ1qbXmOi9hQafLlxG1ZtizUFgcOjWBWDZ08oLLNAZLXIUbcTF3/9WsaZrDX8YjLhgsEmKAEYnBZUABjIKhYWmPRareahAaMaKgjxCiEcEBjYLwIQEloVDITBIOFiAXBqZl5FhU6H7axDLtN7DUbZVHo3O3b92pXpA6sGtFhFNSdQJRJitEdqcsuRpFUG+2dSvQDFK4LtpSmRsZkX12fTpNbG2/Y5vhUvG+m1mZnl7evodbz+ElTFY9fx5qREpWUoJ1ptM4cZGBILAJgYWFRMwAJNUmHDCaA7xUJN9kVTApTyFzCJGAVxr//uyRBQARGFGSZt5MXKSKzkycwNqE6UbM02keGpgHOZdtg5lYQ0a0pcgtGnegbsN54CAQ20npATXZRSolEuk9uJMOoJotA+pEvWyz6jJiN2ZrzFbtR6jvP5+mVCuz5S20rEmZ/GT9x8jWo9sSbchTKS4mh3xEJv0CjzBM1wmpBsVg3PTrZ+YjhPVWdCSQJEpjUDhwITjCgKEBMMPigwIEwcVjJg0MNAAwYM4CCASiALxHThIiEwKQFQGUB1AxOIOtBEEw86UESjs3WxnJRQa7Q0ux6ggM3TQcWMomiQXEFAyPILtmWhWHqkSlo0bYy6ZoET3eWm0hTM+RGOvkTtbS5DdzpetcHC7zPcnfdXD5moaYeIvWMN1kLEjTAAFmtcSUIzgHJogCAoFI9jIIEAQYBhcLEIgYeVmmi4QKAYEMTAwgbBQQW0b8QACQ6lTDQcBxRypA47X4lgo0tOcg5eCk1bF7oOMxfOMXZEbPAW2TmoOVkSK6hF07XW7fwx5MfhoC5VAmgzKtjQlYcgZuLrGVws4C0zY7Snocc6Sgs2MLzbPA68zu9QzoMYHRGim5FGxrnqW/bvFfkwJbEiofEJhg01swIKMFCS5SXYwLmADIFFAhRNdNxIsFABIcycZLSAAIULEA0j2Dgphpiou0hyBWB9cPYuBQ8TkBEdL1YiiWVycSD0Qx6LtKju+0a20uxrT/rxZtbwgYMQRxwoqUeqZ3Xzspu8IgwiqSBkN66Ag/Zk3HWkZzt2i5+8vkRbb8rBJ9X/ny0KuLnfVDeV57FsB9UAlXOJqH+hoWEwhMdOVCWvASSDoEVAmNABY6Y84JQTDhSya//uyRBGARI1bzTtMHTqTq5nDaYO1Ut0XKG3kyco2Kmbdkw7ZD6AwmFGEAL5T3VWWqv8uG0ZlLvwzATI9kAKbk4xBovOoYb+VUbShvtrbaQQOwyvq3BHZubqupyG4hWxRIHiFZhy6gv7Ba3li5nvA4LpaFGW73I59KTLXz8zJKRvSil/2PRSJVtDKt1/pKP7UZ7kib9jbw/RHja6Bo6VABEDDjZUHLtYacNYUJgEqFpC6BUiWfBAASJmYHDgEZGlzi+KvwaLLtRhx6jOmd3lpJ0Oq8QQBIDeOrm0Liico1mXlG2wf4vYx6jbyECB/CMxAqw0X3hdU1GWMU1VyUovxaVZ7n1ujVsuQ/jF/zVy1LYbamjn/SWxYbGmJNU6gLS0ZBa3qUGrlQFJG3Dhis6Q2eQx8QEYaYSMhEGW5MXTnHC+RKmMCF1iPIZBHA3cTJBrhshDRzahcpOYKDl4Yk8bNX0iDT8pC1Nv6TuUak978xDJSxhJO05ThI52cXJxyZckZcwvYiqnmzdugpAkZ1FU93dw3jcfPvKRc/u3nLjMXbZ+0O+F+oHgk+PLV5+r1h9zxraJf8+cz8It7BfN88yAM32256DhFaQAyMFDGNiM0GAoIDLQMkgOJMA00kwgJlzQ1KgUKg0ATBpNlycyVzWVH5NLnNj9C77qS6B35BssiXpOFQQcqU82EBds8FmHITKqUlWNWWzlaIJyteb5HoWhxyhQYtXq9RXYy+6SMWvnN7ca659dTKX3K6B3ywRSzg4Ld85W4yBfZ1P5S1SIJuSOU48ECrVGE1gqIMAkC4AmJipULhxCKFRS4hEFokPSgY3drUPxF//uyRBQExINcSptGHdKPJglDawk+UPFvK04YdwomJ+VNkw7pR93GRMmkV13rbsy2GnpxrV75g7ooBEInIn4zPJHLN2pLaO7Qc+UXDEcOtPtVt9u8QeDFe9NghRmH2Dm/7M5Jc82e+8KQvL83pmzmgd7Xkah0pPSXS/1R3NE2cW+gSB+dAEIKi09mM0HBOSJJnB9ggMkSMBBIOYkMaOEnScYiTgfYeePdQTxwK5METZs1sWu+RdeNN87zWn5dZlrou8sZnb0uyyCBSwWI0AqDZFaJGUZxEXVpNBs2Ua7Sd2tizWKoslmJpzane1007tS5QpiZ4hyui/5KrQW7vbUNc02Hn2pfb6OyMh/Tot/8oLkU0ToXG057jSM7xnIgDcjbcOAs4xSEEzlQo3EAKWykOjQX3QpSBSzYC15CamrC4hE139npDB9qMV61vU/SRHDC1oXOzum0SSL0yri0EGSOhIeo2b1ZPmGm4VCOkHuM5ubt2KlFHMoXqJUptn9rphq+SC48Zez9qlY5jnw6UMVTjH2wjPssf7HyyzUQ6ky237941SsGJuOQ+pgQKkyhzMc0IRLakII0wWbSvYFEwUFPiAMvTLX9Wy80/NtoozXfl+qk/ZzkLZbGFTQiPm4+ljRknnelfJs83dc83nJF0xp+95tqbLyYbdZmw2/A+jjZrpsUbjZKswydaAnqkZ/FSkxH8cmr4V9r0WrIOWEPhWqfWiBLORqW2x2tTg0WXooEAcjTSZwSAIbmJDGGMN3AAgxQRDMWYhDUdAgoeW2CgdNgu4nKsMojabhWlauWTQXH56NtdmmVgaJi0AWADIPvRORN2Qhk//uyZCMEBT1aSTtJHWJ/y/k5bYNuVBWRIS480MIsLKRlww6gFhWBnZLIgJJkliYWAo+0RI2CIoiJU4qN1OSzkFxut1yyFSaFCo9CFB06S08pOVQgkyVisVgzJneGsCcPWgqFSzQGS0M1cV7W75O4IjY7ZGb6w+ASMfuyJUM5APEii8H//+mDIAXzNnXm5qZiMgoGKQ4EKgIhLtpwoAysASpSIdZ1iECTwwJpRK58mJOR5A7DxThtrNtae9+7DkemJkVXWNXNxMxY3ZmsuPk7CWZSLzA25EuRN53Ioxqzhwn2tF5kR9Y+m3C7kvzuRHKd/kM/i1M/LhXKwnvOMCpSeYn/J76kwATTVOcR4pqMJA4qggXmKgwYXEgkDQEAgcBigTMLZggBaEBAihZKUq1SuAXMfpnKBMPVMoawNmqVzkjGeq2x2dX1PvujGHaeluVu7fPhtZ4TrP0KyKaf8XEYfZwZIpsLUB2bghj3qUcyUzWKy+tHsUfbZvo7Kesjae5rs06/v6xvzq9ZPym28WRrUHxM6zPnntn1m9m2aqgG14Dbr+fc7asgEQSuVY5DeTKZSKAEIxwCA+kEVgYOBskCoIe9RVOdmai9GyteDZGlMvoZdDPX6xi+rs0DcZlTzlplwsiViS5JfJJmIVhpqazkdrnlEpesY9jU60MsGxnKeeCIOuZxDzOMzlDjRSqevHZ1Z0pZmeV1mZSqWSA2LOy3U6ZIVIRHjy6wdNb+upjNbU/pMAAG7lCPxmjnRgyU0MxGhYrEIMPC5e4w0FCBIiAUhgwOJg5iS2HbaW1Np023stYg/tZkSiRovQErqvDZu7YWPMk8//uyZCEABJ9dyEtpHNCOqFj2cYZ2VlHPFA5kx8njl+W1kJoFV9jHt57aWWxyb7movetSix2M9nvCwld6PlclIEQJHyrxsrQAbyMkGyhPMn9DyLZSnYVtNzUi8sUZT4iZki0p+YoJqcJxVakVeJx8mAxYtVV1UgqalQTTsSM8Fcx8ITEA5HBIXIEiGEBUIDq0WKJHhYAoD0NHJdplGjwJRagHcDRJQyx6JCLEqG9eREd4CFUgOwEh8Zkp1Iiknln6UbzUP/LmOzV/fwrI5kXDbKTCSZlqy92Y9xeXaTN3L/z3mP9N+A7EbakFfLW0PeqmBuXzprz3Jryf1dNxZW8KMd/z+b+zlLHN7kwRBswElAoGjFgkMgkow6EjrmB6wUrNtxnBiJFl1dEBy9HVp59b7ktpK5BRRJ+57Vy5AUuprLi7BUX5cHKwyzjTzxy63YKQx3bNWeTUnKLQtAVDP6JySMEMs6Cx+kEFkyuiRCBp7ZjEg6BxHVSRvj0+x554hK+QEwMl1jwcQYXfgtHD0qY/Xwzw9bde9nmdnnN8do9Hs+1X9vuTy2+PzG3MT2sbx2fO7vkqNffLehIwjcrJI0AEaJ50CGksaNZlBmai5xe2apHKf2ZcG8w5pMCuNQt2k7dgMPZYWmFGFi9wgUNyScJ1bbeMS6etDMSp8PylFFeKfUWKpDKx5zYy2ws1qeVdeNbtB61rHOVezu//0ZalnTqXP4/6Naz+2nT5zf9/Bdu+TdMQEgJluSNppmA58AAyYeEhgQBJhJloToiW9lanDaozLddJn0ALLQ1Q3e5t0p5Ay6LT4PVx92mkTWrmQCjMZNMIiMSR//uyRCGABHxGyWuMNBKIJ2ktawkOUJTdHy0wzsIWLeQlow5wLYjsuIok2w77p14uPpfjM6e/JtFPbb/fuubuNT6gz4bN5rZiEL1FdXfjHLd8Pty0n0Kf8d4nWM7DyJNJQ9HHMOTsgq23eNGD9////8ABEIQLTbiSYejKEZrg/YKKsR8UyRg7IU1WDKuHASVMRQRVMWahvEHvC6BrDAMQEeA8nySGQjc017enuz1KEeyswyvebr8u9zXXF2K3bDk4PX1dpdVa5TetUkFvlStzq9u77/JJOs3flUHqKp1qhgErgQT2XOjkH4QKJx7M/d1AVGlgW245TLHRApFXywJ5H5sg4JGkgIdACgwdCpEwSspObRc1MGkgpeTtcBIDR0VmzY+XHzShiZLJ8+fngQUvbh0vewAEdRrUm2E105uZPQ8xL025L56ZnZsLn5mUgqMOpZyEc88ShgNkbEg69hxhNDlFDVa0i4KCFoQxhVYLPKwHNPuD0oEVRRq+zCa6wAhIqqVjttDDnkEYOMLjEYQKgyqFVNBzUi7JghrAXRcVwJQ/rlNtQyPkDw0kccc40DCZKhGnJhc7CSTYa9ppYe7arM2Lv68tTLWtnE7idu+cyYghOleS37eqeTHtZyw3L4Yx+RF0smno6zlrDm2MZPnnl/l8InbWEVEiQmXqEI2XPIWPt60FWXWpQEV+DIl4GAQCBlrpkFrXjWYEA7O3UXFBUMvs61IOicuSKIYgbohOu6Ul5uUOaxTXfI65A3iY4CB4aAvKIDEDxkhktCZhhjsMGpG3beBB0Ukc6m9Umt20M52rDViORA0uaimLF57/e9rIPtWO//uyRDgABBVER0tpG8KBaglNaYNrUFFbJa0YcyoHHSS1phmhrNh9HyYn799Nyh8lrWv///KP4Cs5I433EgAjngjJiW3QCF6VK0uE5UjUj0z3sS6WMzc6SA9CTiT/mZ8ldWs4y01nQOn69aigK5VyVNnzQKFEIqAt6R8xNGIoZmYMB0BIxMGUyMMjv8BGd10seKXDSKrTJTiAkU1PQwrOuf1DntedBkmFlYz2ERNp7brMd1Qt8jXsxw41ZFbJGkCEQ7zRGxggnRPpJIA2Dr9WERJbWbVVeOAXTaW4FJeqUkJk1OYWsTSCAdTGlEmfDzU7nMvXjFEXVvLo5F0ke1WyZyIKKg9uoMjpVjGQnz83Ij2tVIJSHMGIA8yM6kKURZWtJU+Qzy4kLMs92hvJkPIDvYM884Sc4NvR96sx6VtXJdI5E2eU4KDjNkTJCEcUpS8b0vIhMWUymVKKJ8UDkPRQYGDpghkWJZTFrvuQFu7cyYmJUBgbEJL5U4pzIvSopd/Z3/G+u9t1sEFH6ScooJfZvpzknHXBZyknyNsuMLUqkP+35ElF+NaYdX67pZh8MuO9Ztkz8KXnf7jtd+vfVQcrEm65I2k2cdwByQYCZiGIU+ggE/6Xqqq/XxiqpWuuCzWZkU7I8UDh1BgCYQStA1UQs0iaUOyfq5JHQRVtS7BRtTqheiyMUFkmx2Ghw8NSPxWtY7qvov7kxBTTpJaRGq6+RcOHDIhUdD+5ZmkMuuSfs0WyLR7hWQt6zLtXe90EIYev6FE8azsRZwKhoGtil5bWBmQs1gF3YZU1dtoDKVYmSvPLBxxxBA5ah1oAOUbPZajQNrlE//uyRFsAA/5aSGtGHEJ/yIjZZMOIECkVFY2Yc4H9KSKllgz4qjzY0w5ICIduxkXSsFgECFBJWi/xzl/+Oh3VslLOGWbUEprXXf6RCiDG4dAVLLW4Gh5gCljA50uG6yU6PNRYfnaFkbA17akc9qAJSTMS1QAc+HmDjDT1aYhBJEAvMpq6Lov7Acon12zj/7pLe5qcm4mcwSq+couIJeTJbDy4eZCEnh1/sJMaSkl2SYq5fvssjphRyJWwYY82GzMbECnVzOySWeZGV8snmFJH2XGDlCbIMqPHCxcYRFWig3nQNYKGV9q9zaupDGZkp7RWdqrVFAOoTrhAMif5vEqi6QhiOdrhLB0SSSUFR2JR8+OmO8oiXQ82cHjV48TQYRscqFYcXRIRTlhpDrdpobsFIqJVWO3jGD3WkTRHFmW5mSErZHkbwS4onFcqGUOtvwgSFFjVf6vaXw0BLFRzQq4BJ7VTRlZGtK+0jLVWnkLpEDeoAHhpwkuruZ806q4bawZO3o0Kowg5E5LWLTZHC3nUrwFeiyZ1yacMWshQSIJGoXMKuYaxlSHW6EEyECUCqluRk4NSqViZDY2wpdQ6thxfJMsrhhzgRo7nhYH9otJwDFdegby19adfVYKj/Yyj1NQibL38fqb6zAqztfqcABVvtUA6qKHKZQBSymlmtUlS2NFhU0iQpvUIUS149ddpcPpG4STMIiZl12mTVDZrlXRczgbCAEvFYMtmWMe2VCwuzdDVfPmIwGRskhH+SMTgNstIPBZ9oqxRz9VlhvjW3HEe7jO2pvm1z5eesxP/6wG2wt7/3yg073fhbjSAjc6CZDAkPY41//uyRIKBk+5BQzNmGvJ8Z3h5YSNeTwm9CEyYa8m9muFZhKAZectcZcSaRJPL71M14l55pSKRJPUiRUApZFE5CjE+nBDqdXQpTzSkS+XKLw31psbq7M6s1VJc1mKhxzOg/eVGKz40b5DUsmIqU+OV1vlDtY4y0lef4pqnynrE5+e2FLdTYknCKHQ2F/zIRhnGV4NvSs69RK5E26KyRTLp6v3F4zvkm4OlPJQbrS35QtA40iSZFB4mMFA3BhpTck6981OdjzO9OkLVYfSG+LqRtx+Amr+K+r/CsaR/Xf3pQ3tgrwHccmIFoesDffv/D1WgD0bwr9eItT0Cm3b2mr7JAPECAACADkdQ6pcUoartQxqSiS/gqiSNUXY+lGVaFEygJBS1I6pKvqsZwzMGAm9TUuqXs3+qwmMKsZv4dKGtI1Jjvw12b4BClzUmVYBGTBQEV//GhquzbKudUmoqkxxqSwCqM6qwEfDsiQ39HXGxRQLKbibwKbBQDAEEAYJSgJIVVWExxjVVDCj1KHFjfV9m6pQ1b+lxiDARoBCsMQEZQ6pbHxj//CiY2pBm4zMTHsBCmp1f2b+NGNZAzcZmbIMBGqwMvr1QQoMKvqq6l//QzcNVjfsd2aBgIy1AS4ef61VASOlWMKgEOvQrxWIvJLuoAAWsyMmslQyZZbHI/+X/lksv//5qwMFLHIy//+y2f9l////zVrJUMjWWxyP7JY/yyWWLAYKOhkatbHIyayVDI/thkatY1wtEkCigMDEE0FokjRQoDMTi2eGepo04soo+DRoVFjT1igt+ujVgYKOhkasDBx0NWUECqORq1ss+/5kyyggw//uyRLkEE6xkv8GBGAJ4Tff4PMMATTmkrkGM20HUORUAAIwBOWWAwUsssslIyOy2OR/m1nq1kqGRq1ss/mZZMoYKCBB0cYUFDAwYR0NWUFHQ1YKGChQgcQOJZQQKoZH6rLLLLY5GX8v/LJZZZZKR/5K19goYGDBOJVBitNNIhUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",{TonePlayer:TonePlayer}=sound,default_env={attack:.001,decay:.001,sustain:1,release:.001},getCorrectSynth=e=>new TonePlayer({psychoJS:e,note:2e3,duration_s:.05,volume:.6,loops:0,wave:"sine",envelope:default_env}),getPurrSynth=e=>new TonePlayer({psychoJS:e,note:200,duration_s:.6,volume:.7,loops:0,wave:"sine",envelope:default_env}),getReadingSound=()=>new Audio(ReadingPageFlip),showConditionNameConfig=showConditionNameConfig$1,targetSpecsConfig={letter:()=>({spacingRelationToSize:letterConfig.spacingRelationToSize,spacingOverSizeRatio:letterConfig.spacingOverSizeRatio,spacingSymmetry:letterConfig.spacingSymmetry,targetDurationSec:letterConfig.targetDurationSec,targetSizeIsHeightBool:letterConfig.targetSizeIsHeightBool}),repeatedLetters:()=>({spacingRelationToSize:letterConfig.spacingRelationToSize,spacingOverSizeRatio:letterConfig.spacingOverSizeRatio,targetSizeIsHeightBool:letterConfig.targetSizeIsHeightBool}),movie:(e,t)=>e&&t?{targetEccentricityXDeg:e.read("targetEccentricityXDeg",t),targetEccentricityYDeg:e.read("targetEccentricityYDeg",t),targetContrast:e.read("targetContrast",t),targetCyclePerDeg:e.read("targetCyclePerDeg",t),targetHz:e.read("targetHz",t),thresholdParameter:e.read("thresholdParameter",t)}:{},reading:(e,t)=>e&&t?{readingCorpus:e.read("readingCorpus",t),readingFirstFewWords:readingPageStats.readingPageSkipCorpusWords.get(t)?.length?readingPageStats.readingPageSkipCorpusWords.get(t)[readingPageStats.readingPageSkipCorpusWords.get(t).length-1]:0,readingLineSpacingDefineSingleAs:e.read("readingLineSpacingDefineSingleAs",t),font:e.read("font",t),readingLinesPerPage:e.read("readingLinesPerPage",t),readingLineLengthUnit:e.read("readingLineLengthUnit",t),readingLineLength:e.read("readingLineLength",t),readingLineSpacingMultipleOfSingle:e.read("readingLineSpacingMultipleOfSingle",t),readingNominalSizeDeg:e.read("readingNominalSizeDeg",t),readingNumberOfPossibleAnswers:e.read("readingNumberOfPossibleAnswers",t),readingNumberOfQuestions:e.read("readingNumberOfQuestions",t),readingSetSizeBy:e.read("readingSetSizeBy",t),readingLineSpacingSingleDeg:e.read("readingLineSpacingSingleDeg",t),readingSpacingDeg:e.read("readingSpacingDeg",t),readingXHeightDeg:e.read("readingXHeightDeg",t),readingXHeightPt:e.read("readingXHeightPt",t),readingNominalSizePt:e.read("readingNominalSizePt",t)}:{},rsvpReading:(e,t)=>{if(!e||!t)return{};return{...{readingCorpus:e.read("readingCorpus",t),readingFirstFewWords:readingPageStats.readingPageSkipCorpusWords.get(t)?.length?readingPageStats.readingPageSkipCorpusWords.get(t)[readingPageStats.readingPageSkipCorpusWords.get(t).length-1]:0,readingDefineSingeLineSpacingAs:e.read("readingLineSpacingDefineSingleAs",t),font:e.read("font",t),readingLineSpacingMultipleOfSingle:e.read("readingLineSpacingMultipleOfSingle",t),readingNominalSizeDeg:e.read("readingNominalSizeDeg",t),readingSetSizeBy:e.read("readingSetSizeBy",t),readingLineSpacingSingleDeg:e.read("readingLineSpacingSingleDeg",t),readingSpacingDeg:e.read("readingSpacingDeg",t),readingXHeightDeg:e.read("readingXHeightDeg",t),readingXHeightPt:e.read("readingXHeightPt",t),readingNominalSizePt:e.read("readingNominalSizePt",t)},...{rsvpReadingFlankTargetWithLettersBool:e.read("rsvpReadingFlankTargetWithLettersBool",t),rsvpReadingFlankerCharacterSet:e.read("rsvpReadingFlankerCharacterSet",t),rsvpReadingNumberOfResponseOptions:e.read("rsvpReadingNumberOfResponseOptions",t),rsvpReadingNumberOfWords:e.read("rsvpReadingNumberOfWords",t),rsvpReadingRequireUniqueWordsBool:e.read("rsvpReadingRequireUniqueWordsBool",t)}}}},getCommonSpecs=()=>({filename:thisExperimentInfo.experimentFilename,font:font.name,targetEccentricityXYDegs:[targetEccentricityDeg.x,targetEccentricityDeg.y],viewingDistanceCm:viewingDistanceCm.current}),isTimingOK=(e,t)=>e<t?"OK":"BAD",desiredDigits={Deg:1,Degs:1,Cm:1,Px:0,Sec:3,DBSPL:1,Pt:0},toRound=e=>e.match(/.*(Cm$)|(Degs?$)|(Px$)|(Sec$)|(DBSPL$)|(Pt$)/),formatSpecValue=(e,t)=>{const r=toRound(e);if(!r)return String(t);const n=desiredDigits[r[0]]??0;if(Array.isArray(t)){return[].concat(...t).map((e=>String(toFixedNumber(e,n)))).join(",")}return String("number"==typeof t?toFixedNumber(t,n):t)},enumerateProvidedTargetSpecs=e=>Object.keys(e).filter((t=>""!==e[t]&&!(Array.isArray(e[t])&&0===e[t].length))).sort().map((t=>`${t}: ${formatSpecValue(t,e[t])}`)).join("\n"),updateConditionNameConfig=(e,t,r=null)=>{t&&r?(conditionNameConfig.pos[0]=-window.innerWidth/2,conditionNameConfig.pos[1]=-window.innerHeight/2+r.getBoundingBox().height):(conditionNameConfig.pos[0]=-window.innerWidth/2,conditionNameConfig.pos[1]=-window.innerHeight/2)},showConditionName=(e,t)=>{showConditionNameConfig.show?(e.setText(String(showConditionNameConfig.name??"")),updateConditionNameConfig(conditionNameConfig,showConditionNameConfig.showTargetSpecs,t),e.setPos(conditionNameConfig.pos),e.setColor(getInstructionColor(String(status.block_condition??status.block??""))),e.setAutoDraw(!0)):e.setAutoDraw(!1)},updateTargetSpecs=(e={},t,r,n)=>{const i=getCommonSpecs();let a;if(t){const o=targetSpecsConfig[t];if(o){const t=o(r,n);a=enumerateProvidedTargetSpecs({...i,...t,...e})}else console.warn(`[showTrialInformation] Unknown targetKind "${t}". Add it to targetSpecsConfig in showTrialInformation.ts for full support. Falling back to general specs only.`),a=enumerateProvidedTargetSpecs({...i,...e})}else a=enumerateProvidedTargetSpecs({...i,...e});showConditionNameConfig.targetSpecs=a},drawTargetSpecs=(e,t,r,n={})=>{const{skipConditionName:i=!1,position:a}=n;showConditionNameConfig.showTargetSpecs&&(e.setText(showConditionNameConfig.targetSpecs??""),a?e.setPos(a):e.setPos([-window.innerWidth/2,-window.innerHeight/2]),e.setAutoDraw(!0)),i||showConditionName(t,e)},appendTargetSpecs=(e,t,r)=>{const n=formatSpecValue(e,t),i=r?` ${r}`:"",a=`
|
|
271
|
-
${e}: ${n}${i}`;showConditionNameConfig.targetSpecs?showConditionNameConfig.targetSpecs+=a:showConditionNameConfig.targetSpecs=`${e}: ${n}${i}`};function getTrialInfoStr(e,t,r,n,i,a,o,s,l){let c="";if(t)if(n&&i){c=replacePlaceholders(readi18nPhrases("reading"===l?"T_counterReadingPageBlock":"T_counterTrialBlock",e),n,i,a,o)}else c=replacePlaceholders(readi18nPhrases("T_counterBlock",e),a,o);return r&&(viewingDistanceCm.current=rc.viewingDistanceCm?rc.viewingDistanceCm.value:viewingDistanceCm.desired,Screens[0].viewingDistanceCm=viewingDistanceCm.current,updateNearestPointFromRc(0,rc),c+=" "+replacePlaceholders(readi18nPhrases("T_counterCm",e),viewingDistanceCm.current?.toFixed(1)||viewingDistanceCm.current)),c}let lastUpdateMs=-1/0;const periodMs=500,resetTrialCounterThrottle=()=>{lastUpdateMs=-1/0},liveUpdateTrialCounter=(e,t,r,n,i,a,o,s,l,c)=>{const u=performance.now();u-lastUpdateMs>=periodMs&&(lastUpdateMs=u,c.setText(getTrialInfoStr(e,t,r,n,i,a,o,s,l)))},incrementTrialCompletedThisBlock=e=>{status.trialCompleted_thisBlock++,status.nthTrialCompletedThisBlockByCondition.set(e,status.nthTrialCompletedThisBlockByCondition.get(e)+1)},incrementTrialCorrectThisBlock=e=>{status.trialCorrect_thisBlock++,status.nthTrialCorrectThisBlockByCondition.set(e,status.nthTrialCorrectThisBlockByCondition.get(e)+1)},incrementTrialsAttempted=e=>{const t=status.nthTrialAttemptedByCondition.get(e);status.nthTrialAttemptedByCondition.set(e,t+1)},incrementTrialsCompleted=(e,t)=>{const r=status.nthTrialByCondition.get(e);status.nthTrialByCondition.set(e,r+1),["rsvpReading","repeatedLetters","image"].includes(t.read("targetKind",e))||incrementTrialCompletedThisBlock(e)},ptMultiplier=24,inMultiplier=.2,fat=5,thin=1;class Grid{constructor(e,t,r){this.units=e||"none",this.displayOptions=t,this.psychoJS=r,this.visible=!1,this.allGrids={},this.lines=[],this.labels=[],this.opacity=.9,this.dimensions=this.psychoJS.window._size,this.gridkey={key:["`","~"],code:"Backquote",keyCode:192},this.spawnGridStims(),window.onkeydown=e=>{(e.code===this.gridkey.code||this.gridkey.key.includes(e.key))&&(this.cycle(),r&&r.experiment&&r.experiment.addData("cycledGridTo",this.units)),e.stopPropagation()},this._reflectVisibility()}update(e=void 0,t=void 0){e&&(this.units=e,grid.units=e),t&&(this.displayOptions=t),"disabled"!==this.units&&(this.visible=!0,this._undraw(),this.spawnGridStims(),[this.lines,this.labels]=this.allGrids[this.units],this._reflectVisibility())}show(){this.visible=!0,this._draw()}hide(){this.visible=!1,this._undraw()}cycle(){this._undraw(),this.units=this._cycleUnits(this.units),grid.units=this.units,this.spawnGridStims(this.units),[this.lines,this.labels]=this.allGrids[this.units],this._reflectVisibility()}spawnGridStims(e=void 0){if(e)this.allGrids[e]=this._getGridStims(e);else for(const t of["px","pt","cm","in","deg","degDynamic","mmV4","none","disabled"])this.allGrids[t]=this._getGridStims(t)}_undraw(){[...this.lines,...this.labels].forEach((e=>{e&&e.setAutoDraw(!1)}))}_draw(){[...this.lines,...this.labels].forEach((e=>{e&&e.setAutoDraw(!0)}))}_reflectVisibility(){this.visible?this._draw():this._undraw()}_getGridStims(e){switch(e){case"px":return this._getPixelGridStims();case"pt":return this._getPointGridStims();case"cm":return this._getCmGridStims();case"in":return this._getInchGridStims();case"deg":return this._getDegGridStims(!1);case"degDynamic":return this._getDegGridStims(!0);case"mmV4":return this._getMmGridStims();case"none":case"disabled":return[[],[]]}}_getNumberOfGridLines=(e,t=!1)=>{this.dimensionsCm=this.dimensions.map((e=>e/this.displayOptions.pxPerCm)),this.dimensionsIn=this.dimensionsCm.map((e=>e/2.54)),this.dimensionsPt=this.dimensionsIn.map((e=>72*e));const[r,n]=this.dimensions;switch(t?Screens[0].fixationConfig.pos:Screens[0].fixationConfig.nominalPos,this.dimensionsDeg=[[XYDegOfPx(0,[r,0],t)[0],XYDegOfPx(0,[-r,0],t)[0]],[XYDegOfPx(0,[0,-n],t)[1],XYDegOfPx(0,[0,n],t)[1]]],e){case"px":return this.dimensions.map((e=>Math.floor(e/100)+1));case"pt":return this.dimensionsPt.map((e=>(Math.floor(e)+1)/ptMultiplier));case"in":return this.dimensionsIn.map((e=>(Math.floor(e)+1)/inMultiplier));case"cm":return this.dimensionsCm.map((e=>Math.floor(e)+1));case"deg":return this.dimensionsDeg.map((e=>e.map((e=>Math.ceil(Math.abs(e))+1))))}};_cycleUnits(e){switch(e){case"none":return"px";case"px":return"pt";case"pt":return"cm";case"cm":return"in";case"in":return"degDynamic";case"degDynamic":return"deg";case"deg":return"mmV4";case"mmV4":return"none";case"disabled":return"disabled"}return"none"}_getPixelGridStims=()=>{const e=100,t=[-Math.round(this.dimensions[0]/2),-Math.round(this.dimensions[1]/2)],r=this._getNumberOfGridLines("px"),[n,i]=[[],[]];for(const a of["vertical","horizontal"]){const o="vertical"===a?r[0]:r[1];for(let r=0;r<o;r++){const o="vertical"===a?[[+(t[0]+r*e),+Math.round(this.dimensions[1]/2)],[+(t[0]+r*e),-Math.round(this.dimensions[1]/2)]]:[[+Math.round(this.dimensions[0]/2),+(t[1]+r*e)],[-Math.round(this.dimensions[0]/2),+(t[1]+r*e)]],s="vertical"===a?[t[0]+r*e+3,t[1]]:[t[0]+3,t[1]+r*e],l=`${a}-grid-line-${r}`;n.push(new ShapeStim({name:l,win:this.psychoJS.window,units:"pix",lineWidth:r%5==0?fat:thin,lineColor:new Color$1(getColor("px")),fillColor:null,opacity:this.opacity,vertices:o,depth:-999999,ori:0,interpolate:!1,size:1,autoLog:!1})),r%5==0&&i.push(new TextStim({name:`${a}-grid-line-label-${r}`,win:this.psychoJS.window,text:e*r+" px",font:"Arial",units:"pix",pos:s,alignHoriz:"left",alignVert:"bottom",height:8,ori:0,color:new Color$1(getColor("px")),opacity:1,depth:0,autoLog:!1}))}}return[n,i]};_getFixedSpacingGrid=(e,t)=>{const r=[-Math.round(this.dimensions[0]/2),-Math.round(this.dimensions[1]/2)],n=this._getNumberOfGridLines(t),i=getColor(t),[a,o]=[[],[]];for(const s of["vertical","horizontal"]){const l="vertical"===s?n[0]:n[1];for(let n=0;n<l;n++){const l="vertical"===s?[[+(r[0]+n*e),+Math.round(this.dimensions[1]/2)],[+(r[0]+n*e),-Math.round(this.dimensions[1]/2)]]:[[+Math.round(this.dimensions[0]/2),+(r[1]+n*e)],[-Math.round(this.dimensions[0]/2),+(r[1]+n*e)]],c="vertical"===s?[r[0]+n*e+3,r[1]]:[r[0]+3,r[1]+n*e],u="pt"===t?3:5;a.push(new ShapeStim({name:`${s}-grid-line-${t}-${n}`,win:this.psychoJS.window,units:"pix",lineWidth:n%u==0?fat:thin,lineColor:new Color$1(i),fillColor:null,opacity:this.opacity,vertices:l,depth:-999999,ori:0,interpolate:!1,size:1,autoLog:!1}));const d=["in","pt"].includes(t)?"in"===t?inMultiplier:ptMultiplier:1;n%u==0&&o.push(new TextStim({name:`${s}-${t}-grid-line-label-${n}`,win:this.psychoJS.window,text:`${n*d} ${t}`,font:"Arial",units:"pix",alignHoriz:"left",alignVert:"bottom",pos:c,height:8,ori:0,color:new Color$1(i),opacity:1,depth:0,autoLog:!1}))}}return[a,o]};_getCmGridStims=()=>this._getFixedSpacingGrid(this.displayOptions.pxPerCm,"cm");_getInchGridStims=()=>this._getFixedSpacingGrid(2.54*this.displayOptions.pxPerCm/5,"in");_getPointGridStims=()=>this._getFixedSpacingGrid(2.54*this.displayOptions.pxPerCm/72*ptMultiplier,"pt");_getDegGridStims=(e=!1)=>{const t=this._getNumberOfGridLines("deg",e),[r,n]=[[],[]],i=getColor(e?"degDynamic":"deg");for(const a of["right","left","upper","lower"]){let o;switch(a){case"left":o=t[0][1];break;case"right":o=t[0][0];break;case"upper":o=t[1][1];break;case"lower":o=t[1][0]}for(let t=0;t<o;t++){if(["left","lower"].includes(a)&&0===t)continue;let[o,s]=this._getDegGridPathVertices(t,a,e);if(r.push(new ShapeStim({name:`${a}-grid-line${e?"-dynamic":""}-${t}`,win:this.psychoJS.window,units:"pix",lineWidth:t%5==0?fat:thin,lineColor:new Color$1(i),fillColor:null,closeShape:!1,opacity:this.opacity,vertices:o,depth:-999999,ori:0,interpolate:!1,size:1,autoLog:!1})),t%5==0){const r=e?"deg\ndynamic":"deg";n.push(new TextStim({name:`${a}-grid-line-label${e?"-dynamic":""}-${t}`,win:this.psychoJS.window,text:`${t} ${r}`,font:"Arial",units:"pix",pos:s,height:Math.min(Math.round(degreesToPixels(.25,[0,0],"horizontal")),12),alignHoriz:"left",alignVert:"bottom",ori:0,color:new Color$1(i),opacity:1,depth:0,autoLog:!1}))}}}return[r,n]};_getDegGridPathVertices=(e,t,r=!1)=>{const n=[];let i=[];const a={left:-this.dimensions[0]/2,right:this.dimensions[0]/2,top:this.dimensions[1]/2,bottom:-this.dimensions[1]/2};let o=!0,s=0;for(;o;){let r,i;switch(t){case"left":r=XYPxOfDeg(0,[-e,s]),i=XYPxOfDeg(0,[-e,-s]);break;case"right":r=XYPxOfDeg(0,[e,s]),i=XYPxOfDeg(0,[e,-s]);break;case"upper":r=XYPxOfDeg(0,[s,e]),i=XYPxOfDeg(0,[-s,e]);break;case"lower":r=XYPxOfDeg(0,[s,-e]),i=XYPxOfDeg(0,[-s,-e])}o=isInRect(...r,a)||isInRect(...i,a),o&&(s+=.1),n.unshift(i),n.push(r)}return i=["left","right"].includes(t)?[n[Math.floor(n.length/2)][0],a.bottom+5]:[a.left+5,n[Math.floor(n.length/2)][1]],[n,i]};_getMmGridStims=()=>{const e=Screens[0].fixationConfig.pos,t=this.dimensions[1]/2,r=-this.dimensions[1]/2,n=-this.dimensions[0]/2,i=this.dimensions[0]/2,a={top:e[1],bottom:e[1],left:e[0],right:e[0]};let o=a.top<t||a.bottom>r||a.right<i||a.left>n;const[s,l]=[[],[]];let c=0;for(;o;){const e=c%5==0,u=.15*Math.pow(10,c/38)-.15,d=XYPxOfDeg(0,[u,0])[0]-Screens[0].fixationConfig.pos[0];if(d<50)c+=1;else{if(s.push(new Polygon({win:this.psychoJS.window,name:`mmV4-grid-circle-${c}`,units:"pix",edges:360,radius:d,ori:0,size:1,pos:Screens[0].fixationConfig.pos,lineWidth:e?fat:thin,lineColor:new Color$1(getColor("mmV4")),fillColor:null,opacity:this.opacity,depth:-999999,interpolate:!0,autoLog:!1})),e){const e=Screens[0].fixationConfig.pos[0]<0?1:-1,t=XYPxOfDeg(0,[e*u,0]);l.push(new TextStim({name:`mmV4-grid-label-${c}`,win:this.psychoJS.window,text:`${c} mmV4`,font:"Arial",units:"pix",alignHoriz:"center",pos:t,height:8,ori:0,color:new Color$1(getColor("mm")),opacity:1,depth:0,autoLog:!1}))}c+=1,a.top=XYPxOfDeg(0,[0,u])[1],a.bottom=XYPxOfDeg(0,[[0,-u]])[1],a.left=XYPxOfDeg(0,[-u,0])[0],a.right=XYPxOfDeg(0,[u,0])[0],o=a.top<t||a.bottom>r||a.right<i||a.left>n}}return[s,l]}}const getColor=e=>{switch(e){case"px":return"#91014e";case"cm":return"#910187";case"in":return"#310191";case"pt":return"#01910b";case"deg":return"#007056";case"degDynamic":return"#873100";case"mmV4":return"#3b0066"}},ALLOWLIST=new Set(["text","autoDraw","pos","size","font","color","contrast","opacity","alignHoriz","alignVert","height","letterHeight","wrapWidth","flipHoriz"]);function serializeStimValue(e){if(null==e)return"";if("string"==typeof e)return e;if("number"==typeof e)return Number.isNaN(e)?"NaN":Number.isFinite(e)?String(e):e>0?"Infinity":"-Infinity";if("boolean"==typeof e)return e?"true":"false";if(Array.isArray(e))try{return e.map((e=>serializeStimValue(e))).join(",")}catch{return"[unserializable]"}try{return JSON.stringify(e)}catch{return"[unserializable]"}}function cap(e){return e.charAt(0).toUpperCase()+e.slice(1)}function stimChangeToStateUpdate(e,t,r){if(!ALLOWLIST.has(t))return null;const n=String(e??"").replace(/[^a-zA-Z0-9]/g,"");if(!n)return null;const i="stim"+cap(n)+cap(t);return{[i]:serializeStimValue(r)}}function stimChangeReporter(e,t){const r=stimChangeToStateUpdate(this._name,e,t);if(!r)return;setEEState(r);const n=serializeStimValue(t);console.debug(`[sim:stim] ${this._name}.${e} = ${JSON.stringify(n)}`)}function enableInstrumentation(e){const t=e.prototype;if(t._setAttribute?.__eeSimWrapped)return;const r=t._setAttribute,n=function(e,t,n,i,a){const o=r.call(this,e,t,n,i,a);return o&&this._reportChange?.(e,t),o};Object.defineProperty(n,"__eeSimWrapped",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t._setAttribute=n,t._reportChange=stimChangeReporter}function formatParamRead(e,t,r,n){return`[sim:read] ${e}[${"string"==typeof t?`"${t}"`:String(t)}] = ${serializeReadValue(r)}${n?` (${n})`:""}`}function serializeReadValue(e){return void 0===e?"undefined":Array.isArray(e)?`[${e.join(",")}]`:"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?String(e):JSON.stringify(e)}const INSTALLED$1=new WeakSet;function installParamReaderReporter(e){if(INSTALLED$1.has(e.prototype))return;INSTALLED$1.add(e.prototype);let t="";const r=e.prototype.read;e.prototype.read=function(...e){const n=String(e[0]??""),i=e[1];let a;if("function"==typeof this.has)try{a=this.has(n)?"csv":"glossary"}catch{a="unknown"}else a="unknown";try{const o=r.apply(this,e),s=`${n}|${i}|${a}`;return s!==t&&(t=s,console.debug(formatParamRead(n,i,o,a))),o}catch(err){const t=err instanceof Error?err.message:String(err);throw console.debug(`[sim:read] ${n}[${"string"==typeof i?`"${i}"`:String(i)}] = ERROR: ${t} (${a})`),err}}}function formatError(e){return`[sim:error] ${e.replace(/\s+/g," ").trim()}`}let INSTALLED=!1;function installErrorReporter(){INSTALLED||(INSTALLED=!0,window.addEventListener("error",(e=>{const t=e.message||String(e.error||e);console.debug(formatError(t)),publishErrorReported(t)})),window.addEventListener("unhandledrejection",(e=>{const t=e.reason,r=t instanceof Error?t.message:String(t);console.debug(formatError(`Unhandled rejection: ${r}`)),publishErrorReported(`Unhandled rejection: ${r}`)})))}let installed=!1;function patchSwalInstance(e){if(!e||e.__simPatched)return;Object.defineProperty(e,"__simPatched",{value:!0,enumerable:!1});const t=e.fire;e.fire=function(...r){const n="string"==typeof r[0]?r[0]:r[0]?.title??"",i=++dialogSeq;publishDialogOpened("swal",n,`Swal: ${n}`);const a=t.apply(e,r);return Promise.resolve(a).then((()=>{i===dialogSeq&&publishDialogClosed()}),(()=>{})),a};const r=e.close;e.close=function(){return dialogSeq++,publishDialogClosed(),r.apply(e)}}let dialogSeq=0;function installDialogReporter(){if(installed)return;installed=!0,patchSwalInstance(Swal);const e=()=>{const r=window.Swal;r?patchSwalInstance(r):Date.now()-t<1e4&&setTimeout(e,100)},t=Date.now();e()}function formatDispatch(e,t){return`[sim:dispatch] ${e}="${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function logDispatch(e,t){console.debug(formatDispatch(e,t))}let eeLastSeq=0,eeProjection={};function readEEState(){const e=window.__eeEvents;if(e)for(;eeLastSeq<e.length;eeLastSeq++){const t=e[eeLastSeq];"telemetry"!==t.ch&&(eeProjection=applyEvent(eeProjection,t.e))}const t=eeProjection,r=e=>void 0===e?null:String(e);return{phase:t.phase??null,trial:r(t.trial),trialTotal:r(t.trialTotal),block:r(t.block),responseTyped:!0===t.responseTyped,validCharsTyped:t.validCharsTyped??"",responseClicked:!0===t.responseClicked,validCharsClicked:t.validCharsClicked??"",keypadUrl:null,dialogOpen:void 0===t.dialogOpen?null:t.dialogOpen,dialogs:r(t.dialogs),correctResponse:r(t.correctResponse),simulationModel:r(t.simulationModel),trialLevel:r(t.trialLevel),simulationThreshold:r(t.simulationThreshold),simulationBeta:r(t.simulationBeta),simulationDelta:r(t.simulationDelta),thresholdProportionCorrect:r(t.thresholdProportionCorrect),error:r(t.error),recalibrations:r(t.recalibrations),targetTask:r(t.targetTask)}}const KEY_NAME_MAP={space:{key:" ",code:"Space",keyCode:32},Space:{key:" ",code:"Space",keyCode:32},ArrowLeft:{key:"ArrowLeft",code:"ArrowLeft",keyCode:37},ArrowRight:{key:"ArrowRight",code:"ArrowRight",keyCode:39},ArrowUp:{key:"ArrowUp",code:"ArrowUp",keyCode:38},ArrowDown:{key:"ArrowDown",code:"ArrowDown",keyCode:40},up:{key:"ArrowUp",code:"ArrowUp",keyCode:38},down:{key:"ArrowDown",code:"ArrowDown",keyCode:40},left:{key:"ArrowLeft",code:"ArrowLeft",keyCode:37},right:{key:"ArrowRight",code:"ArrowRight",keyCode:39},Enter:{key:"Enter",code:"Enter",keyCode:13},return:{key:"Enter",code:"Enter",keyCode:13},Escape:{key:"Escape",code:"Escape",keyCode:27},esc:{key:"Escape",code:"Escape",keyCode:27}};function dispatchKey(e){const t=KEY_NAME_MAP[e],r=t?.key??(" "===e?" ":e),n=t?.code??(" "===e?"Space":1===e.length?`Key${e.toUpperCase()}`:e),i=t?.keyCode??e.charCodeAt(0);logDispatch("key"," "===e?"Space":e),window.dispatchEvent(new KeyboardEvent("keydown",{code:n,key:r,keyCode:i,bubbles:!0,cancelable:!0}))}function dispatchClick(e,t){if(!e)return!1;const r=e.getBoundingClientRect();r.width>0&&r.height>0&&(r.top<0||r.bottom>window.innerHeight)&&e.scrollIntoView({block:"center"});const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return logDispatch("click",t),e.click(),!0;const i=n.left+n.width/2,a=n.top+n.height/2;if(i<0||a<0||i>window.innerWidth||a>window.innerHeight)return logDispatch("click-blocked",`${t} off-viewport at ${0|i},${0|a}`),!1;const o=document.elementFromPoint(i,a);if(null==o)return logDispatch("click",t),e.click(),!0;if(o!==e&&!e.contains(o)){return logDispatch("click-blocked",`${t} covered by ${o&&o!==e?`<${o.tagName?.toLowerCase()} id=${o.id||"-"} class=${(o.className?.toString?.()||"").slice(0,30)} z=${o.style?.zIndex||"-"} text="${(o.textContent||"").trim().slice(0,30)}">`:"nothing (no hit)"} at ${0|i},${0|a}`),!1}logDispatch("click",t),e.click();const s={bubbles:!0,cancelable:!0,clientX:i,clientY:a,button:0};return window.dispatchEvent(new MouseEvent("mousemove",s)),window.dispatchEvent(new MouseEvent("mousedown",s)),setTimeout((()=>{window.dispatchEvent(new MouseEvent("mouseup",s))}),50),!0}function buildKey(e,t,r,n=null){return`${e}:${t}:${r??""}:${n??""}`}function recordVisiblePopupAndInstructionTexts(){const e=document.querySelector(".swal2-popup");if(e&&null!==e.offsetParent){const t=window.__simSwalPopupTexts??=[],r=e.textContent?.trim()??"";r&&!t.includes(r)&&t.push(r)}for(const t of Array.from(document.querySelectorAll(".ee-html-text-stim"))){if(null===t.offsetParent)continue;const e=window.__simInstructionTexts??=[],r=t.textContent?.trim()??"";r&&!e.includes(r)&&e.push(r);const n=window.__simInstructionFonts??={};r&&!(r in n)&&(n[r]=t.style.fontFamily??"")}for(const t of document.querySelectorAll("#compatibility-chrome-title")){if(0===t.getClientRects().length)continue;const e=window.__simEePopupTitles??=[],r=t.textContent?.trim()??"";r&&!e.includes(r)&&e.push(r)}for(const t of document.querySelectorAll("#compatibility-known-list")){if(0===t.getClientRects().length)continue;const e=window.__simCompatFactTexts??=[],r=t.textContent?.trim()??"";r&&!e.includes(r)&&e.push(r)}}function handleQADialog(e){const t=document.querySelectorAll(".swal2-radio input");if(t.length>0){const r=Math.floor(e()*t.length);return t[r].click(),logDispatch("qa-radio",`idx=${r}/${t.length}`),setTimeout((()=>{const e=document.querySelector(".swal2-confirm");e&&null!==e.offsetParent&&dispatchClick(e,".swal2-confirm (qa-radio)")}),120),!0}const r=document.querySelector(".swal2-textarea");if(r){r.value="sim",r.dispatchEvent(new Event("input",{bubbles:!0}));return dispatchClick(document.querySelector(".swal2-confirm"),".swal2-confirm (qa-textarea)"),!0}return!1}function handleLoadingDialog(e){if(handleQADialog(e))return!0;const t=document.querySelector(".swal2-confirm");return!(!t||null===t.offsetParent)&&(dispatchClick(t,".swal2-confirm (loading dialog)"),!0)}function handleSoundOutputGlobalModals(e){const t=document.querySelector("[data-ee-sound-output-reconnect]");if(t&&t.getClientRects().length>0){const r=window;if(r.__simReconnectShown||(r.__simReconnectShown=!0,r.__simSoundOutputActions.push({action:"reconnect-shown"})),"restored"!==t.dataset.state){const t=[...r.__simSoundOutputActions??[]].reverse().find((e=>"select"===e.action));if(t?.label&&!r.__simReconnectDidConnect)return r.__simReconnectDidConnect=!0,r.__simConnectAudioOutput(t.label),r.__simSoundOutputActions.push({action:"connect",label:t.label}),e(),!0}else{const r=t.querySelector("[data-ee-sound-output-reconnect-proceed]");if(r&&r.getClientRects().length>0)return dispatchClick(r,"sound-output reconnect Proceed"),e(),!0}}const r=document.querySelector("[data-ee-sound-output-reminder]");if(r&&r.getClientRects().length>0){r.dataset.simRecorded||(r.dataset.simRecorded="1",window.__simSoundOutputActions.push({action:"reminder",kind:r.dataset.kind??"",text:r.querySelector("p")?.textContent?.trim()??""}));const t=r.querySelector("[data-ee-sound-output-reminder-proceed]");if(t&&t.getClientRects().length>0)return dispatchClick(t,"sound-output reminder Proceed"),e(),!0}return!1}function act(e,t,r){const n=e.phase,i=document.getElementById("msgDialog");if(i){const e=i;if(!0!==e.__simOkClicked){e.__simOkClicked=!0;const t=i.closest(".ui-dialog"),r=t&&t.querySelector("#buttonOk")||document.getElementById("buttonOk");r&&dispatchClick(r,"#msgDialog OK (audited quit)")}return}if(e.error)return;if(recordVisiblePopupAndInstructionTexts(),e.dialogOpen&&handleQADialog(t))return;if(handleSoundOutputGlobalModals(r))return;if(document.querySelector("[data-ee-display-precision-page]"))return;const a=document.getElementById("threshold-container");if(a&&null!==a.offsetParent){const e=window.__simEePopupTitles??=[],t=document.getElementById("threshold-title")?.textContent?.trim()??"";t&&!e.includes(t)&&e.push(t);const r=document.getElementById("threshold-continue-button");r&&null!==r.offsetParent&&r.onclick?dispatchClick(r,"#threshold-continue-button (popup)"):dispatchKey("Enter")}else switch(n){case"compatibility":{const e=document.querySelector("video[id^='camera-preview']:not([id*='bottom'])");if(e&&null!==e.offsetParent){dispatchClick(e,"video#camera-preview (select camera)"),r();break}const n=document.querySelector("[data-ee-sound-output-step]");if(n&&null!==n.offsetParent){const e=window,t=e.__SIM_OPTIONS__?.soundOutputPolicy??{},n=Array.from(document.querySelectorAll("[data-ee-sound-output-row]")).filter((e=>null!==e.offsetParent));for(const r of n){const n=r.dataset.eeSoundOutputRow??"",i=r.querySelector("select");if(!i)continue;const a=t[n]??"first";let o;o="none"===a?Array.from(i.options).find((e=>"none"===e.value)):"first"!==a&&a?Array.from(i.options).find((e=>e.value&&"none"!==e.value&&e.textContent?.includes(a))):Array.from(i.options).find((e=>e.value&&"none"!==e.value)),o&&i.value!==o.value&&(i.value=o.value,i.dispatchEvent(new Event("change",{bubbles:!0}))),o&&!i.dataset.simSelected&&(i.dataset.simSelected="1",e.__simSoundOutputActions.push({action:"select",kind:n,value:i.value,label:i.selectedOptions[0]?.textContent?.trim()??""}));const s=r.querySelector("button[data-ee-sound-output-test]");s&&!s.dataset.simClicked&&(s.dataset.simClicked="1",dispatchClick(s,"sound-output test button"),e.__simSoundOutputActions.push({action:"test-button",kind:n}))}const i=document.querySelector("button[data-ee-sound-output-quit]");if(i&&null!==i.offsetParent){e.__simSoundOutputActions.push({action:"quit"}),dispatchClick(i,"sound-output Quit"),r();break}}const i=document.querySelector("[data-ee-sound-output-block0]");if(i&&null!==i.offsetParent){const e=window;if(e.__SIM_OPTIONS__?.soundOutputPolicy?.reconnect&&!e.__simReconnectDidDisconnect){const t=[...e.__simSoundOutputActions??[]].reverse().find((e=>"select"===e.action));if(t?.value){e.__simReconnectDidDisconnect=!0,e.__simDisconnectAudioOutput(t.value),e.__simSoundOutputActions.push({action:"disconnect",id:t.value,label:t.label}),r();break}}}const a=Array.from(document.querySelectorAll("button.btn-outline-secondary")).filter((e=>null!==e.offsetParent&&!e.disabled&&/^[123]$/.test(e.textContent?.trim()??"")));if(a.length>0){const e=window.__SIM_OPTIONS__?.headphoneCheck??"ideal",n="ideal"===e?window.__simHeadphoneCheckTarget:void 0;let i=a[Math.floor(t()*a.length)];"number"==typeof n&&a[n-1]&&(i=a[n-1],delete window.__simHeadphoneCheckTarget),dispatchClick(i,`huggins choice (${e}${"number"==typeof n?", oracle":""})`),r();break}const o=Array.from(document.querySelectorAll("button.btn-success")).find((e=>null!==e.offsetParent&&!e.disabled));if(o){dispatchClick(o,"button.btn-success (compat)"),r();break}const s=document.getElementById("procced-btn")??document.querySelector('button[id*="proceed" i], button[id*="continue" i]');s?(dispatchClick(s,"#procced-btn|proceed|continue"),r()):(dispatchKey("Enter"),r());break}case"consent":dispatchClick(document.getElementById("form-yes"),"#form-yes");break;case"calibration":{const e=document.querySelector(".rc-panel-debug-control-next");if(e){dispatchClick(e,".rc-panel-debug-control-next");break}const t=document.querySelector('button[id*="continue" i], button[id*="proceed" i], button[id*="done" i]')??document.querySelector("button");t?dispatchClick(t,'button[id*="continue|proceed|done" i]'):dispatchKey("Enter");break}case"instructions":{const e=(document.getElementById("easyeyes-title-page")?document.getElementById("easyeyes-title-page-proceed-button"):null)??document.getElementById("threshold-proceed-button");e?dispatchClick(e,`#${e.id}`):dispatchKey(" "),r();break}case"showimage":dispatchKey("return");break;case"fixation":dispatchKey(" ");break;case"reading":{let n=document.querySelectorAll("#characterSet-holder .characterSet");if(0===n.length&&(n=document.querySelectorAll(".phrase-identification-category-item:not(.phrase-identification-item-selected)")),n.length>0){const r=Array.from(n).map((e=>e.textContent??"")),i=selectClickedIndex(r,e,t);dispatchClick(n[i],`[idx=${i}]="${r[i]??""}"`)}else dispatchKey(" ");r();break}case"response":if("adjust"===e.targetTask){dispatchKey("ArrowRight"),dispatchKey("ArrowRight"),dispatchKey(" ");break}if(e.responseClicked){const r=document.querySelectorAll("#characterSet-holder .characterSet"),n=Array.from(r).map((e=>e.textContent??"")),i=selectClickedIndex(n,e,t);dispatchClick(r[i],`.characterSet[idx=${i}]="${n[i]??""}"`)}else e.responseTyped&&e.validCharsTyped.length>0&&dispatchKey(selectTypedResponse(e,t));break;case"debrief":dispatchClick(document.querySelector('button[aria-label*="Yes" i], .swal2-confirm'),'button[aria-label*="Yes" i], .swal2-confirm')}}const ACTION_DELAY_MS=500;function setupInstrumentation(){activateSimulation(),enableInstrumentation(MinimalStim),installParamReaderReporter(ParamReader),installErrorReporter(),installDialogReporter()}const _savedOriginals={getUserMedia:null,enumerateDevices:null,requestFullscreen:null,exitFullscreen:null,fullscreenElementDescriptor:null};let _intervalId=null;function stopSimulatedParticipant(){null!==_intervalId&&(clearInterval(_intervalId),_intervalId=null);const e=navigator.mediaDevices;for(e&&_savedOriginals.getUserMedia&&(e.getUserMedia=_savedOriginals.getUserMedia),e&&_savedOriginals.enumerateDevices&&(e.enumerateDevices=_savedOriginals.enumerateDevices),_savedOriginals.requestFullscreen&&(document.documentElement.requestFullscreen=_savedOriginals.requestFullscreen),_savedOriginals.exitFullscreen&&(document.exitFullscreen=_savedOriginals.exitFullscreen),_savedOriginals.fullscreenElementDescriptor&&Object.defineProperty(document,"fullscreenElement",_savedOriginals.fullscreenElementDescriptor);_simRestores.length;)_simRestores.pop()?.()}let cameraStubInstalled=!1;function installCameraStub(){if(cameraStubInstalled)return;cameraStubInstalled=!0;const e=(()=>{try{const e=document.createElement("canvas");e.width=320,e.height=240;const t=e.getContext("2d");t?.fillRect(0,0,320,240);return e.captureStream?.(30)??e.mozCaptureStream?.(30)??null}catch{return null}})(),t=navigator.mediaDevices??(navigator.mediaDevices={});t.getUserMedia?.bind(t);let r=null;const n=()=>{if(r)return r;try{const e=window.AudioContext;if(!e)return null;const t=new e,n=t.createMediaStreamDestination(),i=t.createOscillator(),a=t.createGain();a.gain.value=0,i.connect(a).connect(n),i.start(),r=n.stream.getAudioTracks()[0]??null}catch{r=null}return r};t.getUserMedia=async t=>{if(e){if(t&&t.audio){const t=n();if(t&&!e.getAudioTracks().length)try{e.addTrack(t)}catch{}}return e}const r=new MediaStream;if(t&&t.audio){const e=n();e&&r.addTrack(e)}return r};const i=t.enumerateDevices?.bind(t);i&&(t.enumerateDevices=async()=>{try{const e=await i();if(e.some((e=>"videoinput"===e.kind)))return e}catch{}return[{deviceId:"sim-camera",groupId:"sim-group",kind:"videoinput",label:"Simulated Camera",toJSON(){}}]})}let audioOutputStubInstalled=!1;const _simRestores=[];function installAudioOutputStub(){if(audioOutputStubInstalled)return;audioOutputStubInstalled=!0;const e=window;e.__simSinkCalls??=[],e.__simMediaPlays??=[],e.__simSoundOutputActions??=[],e.__simAudioOutputs??=[{id:"sim-output-speakers",label:"MacBook Pro Speakers"},{id:"sim-output-airpods",label:"Denis's AirPods Pro #2"}];const t=()=>{navigator.mediaDevices?.dispatchEvent?.(new Event("devicechange"))},r=navigator.mediaDevices;if(r?.enumerateDevices){const t=r.enumerateDevices.bind(r);r.enumerateDevices=async()=>{const r=await t(),n=r.filter((e=>"audiooutput"!==e.kind)),i=r.filter((e=>"audiooutput"===e.kind&&e.label&&e.deviceId));return[...n,...e.__simAudioOutputs.map((e=>({deviceId:e.id,groupId:"sim-output-group",kind:"audiooutput",label:e.label,toJSON(){}}))),...i]}}e.__simAudioOutputTombstones??=[],e.__simConnectAudioOutput=r=>{const n=e.__simAudioOutputTombstones.find((e=>e.label===r)),i=n?.id??"sim-output-"+r.toLowerCase().replace(/[^a-z0-9]+/g,"-");return n&&(e.__simAudioOutputTombstones=e.__simAudioOutputTombstones.filter((e=>e.id!==i))),e.__simAudioOutputs.some((e=>e.id===i))||(e.__simAudioOutputs.push({id:i,label:r}),t()),i},e.__simDisconnectAudioOutput=r=>{const n=e.__simAudioOutputs.find((e=>e.id===r));n&&e.__simAudioOutputTombstones.push(n);const i=e.__simAudioOutputs.length;e.__simAudioOutputs=e.__simAudioOutputs.filter((e=>e.id!==r)),e.__simAudioOutputs.length!==i&&t()};const n=e.__SIM_OPTIONS__??{};for(const i of n.deviceScript??[])setTimeout((()=>{"disconnect"===i.action?e.__simDisconnectAudioOutput(i.id):i.label&&e.__simConnectAudioOutput(i.label)}),Math.max(0,0|i.atMs));if(n.simNoSinkSupport){const e=[];for(const t of["undefined"!=typeof AudioContext?AudioContext.prototype:null,HTMLMediaElement.prototype]){const r=t;r&&"setSinkId"in r&&(e.push([r,r.setSinkId]),delete r.setSinkId)}_simRestores.push((()=>{for(const[t,r]of e)t.setSinkId=r}))}else{const t="undefined"!=typeof AudioContext?[AudioContext.prototype,HTMLMediaElement.prototype]:[HTMLMediaElement.prototype];for(const r of t){const n=r;if(n.__simPatched)continue;n.__simPatched=!0;const i=2===t.length&&r===t[0]?"AudioContext":"HTMLMediaElement",a=n.setSinkId;n.setSinkId=function(...t){const r=t[0],n=e.__simAudioOutputs.some((e=>e.id===r)),o=e.__simAudioOutputs.find((e=>e.id===r))?.label??"";return e.__simSinkCalls.push({target:i,deviceId:r,label:o,t:Date.now()-(e.__simBootTime??Date.now())}),n||"function"!=typeof a?Promise.resolve():a.apply(this,t)},_simRestores.push((()=>{"function"==typeof a?n.setSinkId=a:delete n.setSinkId,n.__simPatched=!1}))}}e.__simBootTime=Date.now(),e.__simGroundTruth=()=>({sinkCalls:e.__simSinkCalls,mediaPlays:e.__simMediaPlays,soundOutputActions:e.__simSoundOutputActions,audioOutputs:e.__simAudioOutputs})}let rcDefaultsInstalled=!1;function installRcDebugDefaults(){if(rcDefaultsInstalled)return;rcDefaultsInstalled=!0;const e=Date.now(),t=()=>{const r=window.RemoteCalibrator;if(r)try{r._cameraSelectionDone=!0,r.calibrationSimulatedBool=!0}catch{}else Date.now()-e<1e4&&setTimeout(t,100)};t()}function startSimulatedParticipant(){if(null!==_intervalId)return;setupInstrumentation(),_savedOriginals.requestFullscreen=document.documentElement.requestFullscreen,_savedOriginals.exitFullscreen=document.exitFullscreen,_savedOriginals.fullscreenElementDescriptor=Object.getOwnPropertyDescriptor(document,"fullscreenElement")??{configurable:!0,get:()=>null},document.documentElement.requestFullscreen=()=>Promise.resolve(),Object.defineProperty(document,"fullscreenElement",{configurable:!0,get:()=>document.documentElement}),document.exitFullscreen=()=>Promise.resolve(),HTMLMediaElement.prototype.play=function(){return(window.__simMediaPlays??=[]).push({src:(this.currentSrc||this.src||"").slice(0,80),id:this.id??"",t:Date.now()-(window.__simBootTime??Date.now())}),Promise.resolve(this)};const t=navigator.mediaDevices??(navigator.mediaDevices={});_savedOriginals.getUserMedia=t.getUserMedia?.bind(t)??null,_savedOriginals.enumerateDevices=t.enumerateDevices?.bind(t)??null,installCameraStub(),installAudioOutputStub(),installRcDebugDefaults();const r=window.__SIM_SEED__,n="number"==typeof r?mulberry32(r):Math.random;if("1"===new URLSearchParams(window.location.search).get("simFastMode")){const e=document.createElement("style");e.textContent="canvas { visibility: hidden !important; }",document.head.appendChild(e)}{let t="",r=null,i=null;_intervalId=setInterval((()=>{try{const e=readEEState(),a=e.phase;if(e.recalibrations!==i&&(i=e.recalibrations,t=""),e.dialogOpen&&("loading"===a||!a)){const i=`__dialog__:${e.dialogOpen}`;return void(i!==t&&(t=i,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null,readEEState().dialogOpen===e.dialogOpen&&(handleLoadingDialog(n)||(t=""))}),ACTION_DELAY_MS)))}if(!("loading"!==a&&a||e.dialogOpen)){if(document.querySelector(".swal2-popup")&&null!==document.querySelector(".swal2-popup")?.parentElement?.offsetParent){const e=`__swal_fallback__:${a??""}`;return void(e!==t&&(t=e,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null,handleLoadingDialog(n)||(t="")}),ACTION_DELAY_MS)))}}if(handleSoundOutputGlobalModals((()=>{})))return;if(!a||"loading"===a)return void logDispatch("tick-return",`loading-early phase=${a}`);{const e=document.querySelector(".swal2-popup"),i=document.querySelectorAll(".swal2-popup .swal2-radio input"),a=!!e&&null!==e.offsetParent&&i.length>0&&!Array.from(i).every((e=>e.disabled));if(!a&&t.startsWith("__midrun_dialog__:")&&(t=""),a){recordVisiblePopupAndInstructionTexts();const i=`__midrun_dialog__:${(e?.textContent||"").trim().slice(0,60)}`;return void(i!==t&&(t=i,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null,handleQADialog(n)||(t="")}),ACTION_DELAY_MS)))}}const o=buildKey(a,e.trial,e.dialogOpen,e.dialogs);if(o===t)return void logDispatch("dedupe-skip",o);t=o,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null;const e=readEEState(),i=buildKey(e.phase,e.trial,e.dialogOpen,e.dialogs);i===o?(act(e,n,(()=>{t=""})),"complete"===e.phase&&stopSimulatedParticipant()):logDispatch("tick-return",`stale-key ${o} -> ${i}`)}),ACTION_DELAY_MS)}catch(e){console.error("[sim] tick threw:",e)}}),200)}}const populateQuestDefaults=(e,t,r="letter")=>{for(let n=0;n<e.length;n++){const i=e[n].block_condition,a=t.read("thresholdGamma",i),o=""!==a?a:"letter"==r?getGamma(t.read("fontCharacterSet",i)):.5,s={startVal:Math.log10(t.read("thresholdGuess",i)),startValSd:t.read("thresholdGuessLogSd",i),beta:t.read("thresholdBeta",i),delta:t.read("thresholdDelta",i),gamma:o,pThreshold:t.read("thresholdProportionCorrect",i),nTrials:t.read("conditionTrials",i)};for(const t in s)s[t]||console.error(`property: ${t}, value: ${s[t]}`),e[n][t]=s[t]}return e},getGamma=e=>{isNaN(e)||(e=e.toString());const t={};for(let n=0;n<e.length;n++)t.hasOwnProperty(e[n])?t[e[n]]++:t[e[n]]=1;const r=Array.from(new Set(e)).sort(((e,r)=>t[e]<t[r]?1:-1));return t[r.pop()]/e.length},generateBoundingBoxPolies=(e,t)=>{const r={win:t.window,units:"pix",width:1,height:1,ori:0,pos:[0,0],lineWidth:1,opacity:void 0,depth:-10,interpolate:!0,size:0},n={target:new Rect({...r,lineColor:new Color$1("blue"),name:"targetBoundingPoly"}),flanker1:new Rect({...r,lineColor:new Color$1("blue"),name:"flanker1BoundingPoly"}),flanker2:new Rect({...r,lineColor:new Color$1("blue"),name:"flanker2BoundingPoly"})},i={target:new Rect({...r,lineColor:new Color$1("red"),name:"fontCharacterSetBoundingPoly"}),flanker1:new Rect({...r,lineColor:new Color$1("red"),name:"flanker1CharacterSetBoundingPoly"}),flanker2:new Rect({...r,lineColor:new Color$1("red"),name:"flanker2CharacterSetBoundingPoly"})},a={};for(const o of e.block_conditions){const n=String(e.read("fontCharacterSet",o)).split("");e.read("showCharacterSetBoundingBoxBool",o)&&(a[o]=getDisplayCharacterSetBoundingPolies(n,r,t))}return[n,i,a]},getDisplayCharacterSetBoundingPolies=(e,t,r)=>{const[n,i]=[[],[]];for(const a of e){const e=a;i.push(new TextStim({win:r.window,name:`displayCharacterSet_${a}`,text:e,font:"Arial",units:"pix",pos:[0,0],height:1,wrapWidth:void 0,ori:0,color:new Color$1("black"),opacity:1,depth:-10})),n.push(new Rect({...t,lineColor:new Color$1("red"),name:`displayCharacterSetBoundingBox-${a}`}))}return{characters:i,polies:n}},prettyPrintPsychojsBoundingBox=e=>`height : ${toFixedNumber(e.height,0)}, width : ${toFixedNumber(e.width,0)}, x: ${toFixedNumber(e.x)}, y: ${toFixedNumber(e.y)}`,getBoundingBoxVisualRect=e=>{const t=e.getBoundingBox(!0),r={win:e._psychoJS.window,units:"pix",width:1,height:1,ori:0,pos:[0,0],lineWidth:5,opacity:1,depth:-1e3,interpolate:!0,size:[t.width,t.height],pos:[t.left,t.top],autoDraw:!0};return new Rect({...r,lineColor:new Color$1("blue"),name:`boundingBoxVisualRect-${e.name}`})},getBlockPercentCorrect=(e,t,r,n)=>{let i=0,a=0;for(const s of t)e(s)&&(i+=r(s),a+=n(s));if(0===a)return null;const o=Math.round(100*(i/a+Number.EPSILON));return Number.isFinite(o)?o:null},preparePopup=(e,t)=>{const r=document.createElement("div");r.id=`${t}-container`,r.className="popup-container";const n=document.createElement("div");n.id=`${t}-background`,n.className="popup-background",r.appendChild(n);const i=document.createElement("div");i.id=`${t}-popup`,i.className="popup";const a=document.createElement("h1");a.id=`${t}-title`,a.className="popup-title",i.appendChild(a);const o=document.createElement("p");o.id=`${t}-sub-text`,o.className="popup-sub-text",i.appendChild(o);const s=document.createElement("button");return s.id=`${t}-continue-button`,s.className="popup-continue-button",s.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",e)),i.appendChild(s),r.appendChild(i),document.body.appendChild(r),[r,a,o,s]},showPopup=(e,t,r,n=!1,i=!1)=>{document.getElementById(`${e}-container`).style.display="block",document.getElementById(`${e}-title`).innerHTML=renderMarkdown(t),document.getElementById(`${e}-sub-text`).innerHTML=renderMarkdown(r),toggleSubTextVisibility(i,e),toggleProceedButtonVisibility(n,e)},toggleSubTextVisibility=(e,t)=>{document.getElementById(`${t}-sub-text`).style.display=e?"none":"block"},toggleProceedButtonVisibility=(e,t)=>{document.getElementById(`${t}-continue-button`).style.display=e?"none":"block"},hidePopup=e=>{document.getElementById(`${e}-container`).style.display="none"},showPopupProceed=(e,t,r)=>{const n=document.getElementById(`${e}-sub-text`);n.innerHTML=renderMarkdown(t),n.style.display="block",document.getElementById(`${e}-continue-button`).style.display=r?"block":"none"},hidePopupProceed=(e,t)=>{document.getElementById(`${e}-sub-text`).innerHTML=t,document.getElementById(`${e}-continue-button`).style.display="none"},addPopupLogic=async(e,t,r=null,n=void 0,i)=>{const a=status.currentFunction;return status.currentFunction=`popup:${e}`,new Promise((o=>{const s=()=>{document.getElementById(`${e}-continue-button`).onclick=()=>{},hidePopupProceed(e),hidePopup(e),status.currentFunction=a,n&&n.receiver&&(n.receiver.onData=n.onDataCallback),safeExecuteFunc(r),document.removeEventListener("keydown",l),o()},l=e=>{e.preventDefault(),"Enter"===e.key&&(e.stopPropagation(),s(),document.removeEventListener("keydown",l))};(()=>{const e=e=>{e&&["return",readi18nPhrases("T_RETURN",i).toLowerCase()].includes(e.response.toLowerCase())&&s()};n&&n.inUse(status.block)&&(n.receiver.onData=e)})(),canClick(t)&&(showCursor(),document.getElementById(`${e}-continue-button`).onclick=s),canType(t)&&document.addEventListener("keydown",l)}))},prepareTrialBreakProgressBar=()=>{const e=document.createElement("div");e.id="trial-break-progress-bar-wrapper";const t=document.createElement("div");t.id="trial-break-progress",t.style.width="0%",e.appendChild(t),document.body.appendChild(e)},showTrialBreakProgressBar=(e=0)=>{e=Math.max(Math.min(e,1),0),document.getElementById("trial-break-progress-bar-wrapper").style.display="block",document.getElementById("trial-break-progress").style.width=100*e+"%"},hideTrialBreakProgressBar=()=>{document.getElementById("trial-break-progress-bar-wrapper").style.display="none"},initializeEscHandlingDiv=()=>{0==document.getElementById("esc-key-handling-div").children.length&&(document.getElementById("esc-key-handling-div").innerHTML='<div\n class="modal fade"\n id="exampleModal"\n tabindex="-1"\n aria-labelledby="exampleModalLabel"\n aria-hidden="true"\n>\n <div class="modal-dialog">\n <div class="modal-content">\n <div class="modal-header">\n <h3 class="modal-title" id="modalTitle">Escape Key was Pressed</h3>\n </div>\n <div\n class="modal-body"\n id="modalBody"\n style="display: flex; justify-content: space-around"\n >\n <div style="display: grid">\n <button\n type="button"\n id="skip-trial-btn"\n class="btn btn-outline-secondary"\n style="white-space: normal; word-break: break-word;"\n data-bs-dismiss="modal"\n >\n Skip Trial\n </button>\n <span style="text-align: center">(Space)</span>\n </div>\n <div id="skip-block-div" style="display: grid">\n <button\n type="button"\n id="skip-block-btn"\n class="btn btn-outline-secondary"\n style="white-space: normal; word-break: break-word;"\n data-bs-dismiss="modal"\n >\n Skip Block\n </button>\n <span style="text-align: center">(Enter)</span>\n </div>\n <div style="display: grid">\n <button\n type="button"\n id="quit-btn"\n class="btn btn-outline-danger"\n style="white-space: normal; word-break: break-word;"\n data-bs-dismiss="modal"\n >\n Quit\n </button>\n <span style="text-align: center">(Escape)</span>\n </div>\n </div>\n </div>\n </div>\n</div>',document.getElementById("exampleModal").addEventListener("shown.bs.modal",(()=>{const e=["skip-trial-btn","skip-block-btn","quit-btn"].map((e=>document.getElementById(e))).filter((e=>e&&e.clientWidth>0));if(0===e.length)return;const t=Math.min(...e.map((e=>getMaxPossibleFontSize(e.textContent.trim(),e.clientWidth,e.clientHeight,getComputedStyle(e).fontFamily,1.15))));e.forEach((e=>{e.style.fontSize=`${t}px`}))})))},logQuest=(e,t="",r=void 0)=>{r??=status.block_condition;const n=["background-color: lightyellow","border: 2px dashed blue","padding: 2px 2px","border-radius: 1px"].join(";");paramReader.read("logQuestBool",r)&&console.log("%cQUEST. "+e,n,t)},logNotice=(e,t="",r=void 0)=>{if(/EachFrame/.test(e))return;const n=toFixedNumber(performance.now()/1e3,3);r??=status.block_condition;const i=["background-color: lightblue","color: black"].join(";");console.log("%c "+e+" "+n+"(sec)",i,t)},okayToRetryThisTrial=(e,t,r)=>{const n=e.nthTrialAttemptedByCondition.get(e.block_condition)??1,i=e.nthTrialByCondition.get(e.block_condition)??0,a=t.read("conditionTrials",e.block_condition),o=Math.max(0,n-i)<Math.ceil(a*t.read("thresholdAllowedTrialRatio",e.block_condition))-a,s=r.skipBlock&&r.blockId===e.block;return o&&!s},isConditionFinished=(e,t,r,n)=>{const i=t.read("conditionTrials",e);if(i<=0)return!0;if(!n)return!1;return(r.nthTrialByCondition.get(e)??0)>=i},readAllowedTolerances=(e,t,r)=>{e.allowed.thresholdAllowedDurationRatio=t.read("thresholdAllowedDurationRatio",r),e.allowed.thresholdAllowedGazeRErrorDeg=t.read("thresholdAllowedGazeRErrorDeg",r),e.allowed.thresholdAllowedGazeXErrorDeg=t.read("thresholdAllowedGazeXErrorDeg",r),e.allowed.thresholdAllowedGazeYErrorDeg=t.read("thresholdAllowedGazeYErrorDeg",r),e.allowed.thresholdAllowedLatenessSec=t.read("thresholdAllowedLatenessSec",r)},measureGazeError=(e,t,r,n)=>{rc.getGazeNow({wait:1e3*n,frames:9},(t=>{e.measured.gazeMeasurementLatencySec=(t.timestamp-t.value.latencyMs-r)/1e3;const[n,i]=psychojsUnitsFromWindowUnits([t.value.x,t.value.y],[rc.windowWidthPx.value,rc.windowHeightPx.value],Screens[0].fixationConfig.pos);[e.measured.gazeMeasuredXDeg,e.measured.gazeMeasuredYDeg]=XYDegOfPx(0,[n,i]),e.measured.gazeMeasuredRDeg=norm([e.measured.gazeMeasuredXDeg,e.measured.gazeMeasuredYDeg]),simulateActive&&setEEState({gazeMeasuredDeg:`(${e.measured.gazeMeasuredXDeg.toFixed(1)}, ${e.measured.gazeMeasuredYDeg.toFixed(1)}, ${e.measured.gazeMeasuredRDeg.toFixed(1)})`}),e.measured.gazeMeasuredRawDeg=[];for(let r of t.raw){const[t,n]=psychojsUnitsFromWindowUnits([r.x,r.y],[rc.windowWidthPx.value,rc.windowHeightPx.value],Screens[0].fixationConfig.pos),[i,a]=XYDegOfPx(0,[t,n]);e.measured.gazeMeasuredRawDeg.push([toFixedNumber(i,5),toFixedNumber(a,5)])}}))},calculateError=async(e,t,r,n,i)=>{const a=_reportTargetTimingFrames(n);if(void 0===e.targetFinishSec||void 0===e.targetStartSec||null===e.targetStartSec||null===e.targetFinishSec)console.error("targetStartSec or targetFinishSec is missing, in calculateError");else{psychoJS.window.monitorFramePeriod;const n=e.targetFinishSec-e.targetStartSec,i=e.preRenderEndSec-e.preRenderStartSec;t.measured.targetMeasuredDurationSec=n,t.measured.targetMeasuredDurationFrames=a.recordedEnd-a.recordedStart,t.measured.thresholdDurationRatio=n<r?r/n:n/r,t.measured.targetMeasuredLatenessSec=(e.targetDrawnConfirmedTimestamp-e.targetRequestedTimestamp)/1e3,t.measured.targetMeasuredPreRenderSec=i}},addResponseIfTolerableError=(e,t,r,n,i,a,o,s,l=!1,c=!1)=>{addMeasuredErrorToOutput(a,n);const u=_targetDurationAcceptable(n.measured.thresholdDurationRatio,n.allowed.thresholdAllowedDurationRatio)||o,d=_targetLatencyAcceptable(n.measured.targetMeasuredLatenessSec,n.allowed.thresholdAllowedLatenessSec);paramReader.read("_logFontBool")[0]&&logLetterParamsToFormspree({},n.measured.targetMeasuredLatenessSec);const h=[u,d,!letterTiming.blackoutDetectedBool];letterTiming.blackoutDetectedBool?letterConfig.useFontMaxPxShrinkageBool=!0:letterConfig.useFontMaxPxShrinkageBool=!1,letterTiming.blackoutDetectedBool=!1;const p=h,f=["durationAcceptable","latenessAcceptable","noBlackout"];if(i){const e=_gazeErrorAcceptable(n.measured,n.allowed);p.push(e),f.push("gazeAcceptable")}const m=p.every((e=>e));logQuest("Was trial given to QUEST?",m),logQuest("Was answer correct?",!!t),a.experiment.addData("trialGivenToQuestErrorCheckLabels",f.toString()),a.experiment.addData("trialGivenToQuestChecks",p.toString());const g=(m?"good":"bad")+(c?"practice":"test");a.experiment.addData("trialKind",g);const _=okayToRetryThisTrial(status,paramReader,skipTrialOrBlock);status.retryThisTrialBool=status.retryThisTrialBool||(!m||c)&&_;const y=isConditionFinished(status.block_condition,paramReader,status,m);return e.addResponse(t,r,m,l,status.retryThisTrialBool,y),m},addMeasuredErrorToOutput=(e,t)=>{["gazeMeasuredXDeg","gazeMeasuredYDeg","gazeMeasuredRDeg","gazeMeasuredRawDeg","gazeMeasurementLatencySec","targetMeasuredLatenessSec","targetMeasuredDurationSec","targetMeasuredDurationFrames","targetMeasuredPreRenderSec"].forEach((r=>e.experiment.addData(r,t.measured[r])))},_targetDurationAcceptable=(e,t)=>e&&t?e<=t:(warning("Unable to check if target duration is acceptable."),!1),_gazeErrorAcceptable=(e,t)=>{const{gazeMeasuredXDeg:r,gazeMeasuredYDeg:n,gazeMeasuredRDeg:i}=e,{thresholdAllowedGazeXErrorDeg:a,thresholdAllowedGazeYErrorDeg:o,thresholdAllowedGazeRErrorDeg:s}=t;return i&&r&&n&&s&&a&&o?Math.abs(r)<=Math.abs(a)&&Math.abs(n)<=Math.abs(o)&&i<=s:(warning("Unable to check if gaze position is acceptable."),!1)},_targetLatencyAcceptable=(e,t)=>e&&t?e<=t:(warning("Unable to check if target latency is acceptable."),!1),_reportTargetTimingFrames=e=>({nominalStart:e.frameNStart,recordedStart:e.frameNDrawnConfirmed,nominalEnd:e.frameNEnd,recordedEnd:e.frameNFinishConfirmed}),targetsOverlap=e=>{const t=e.map((e=>e.getBoundingBox(!0))).map(rectFromPixiRect);return getPairs(t).some((([e,t])=>isRectTouchingRect(e,t)))},doubleCheckSizeToSpacing=(e,t)=>{if("ratio"===letterConfig.spacingRelationToSize&&!status.currentFunction.includes("instructionSetup")){const r=letterConfig.targetSizeIsHeightBool?Math.abs(e.getBoundingBox(!0).height):Math.abs(e.getBoundingBox(!0).width),n=e.getBoundingBox(!0),i=t.getBoundingBox(!0),a=[n.x,n.y],o=[i.x,i.y],s=distance(a,o);checkSpacingOverSizeRatio(s,r,`${status.currentFunction}MeasuredPx`)}},checkSpacingOverSizeRatio=(e,t,r="")=>{const n=closeEnough(e/t,letterConfig.spacingOverSizeRatio);return n||warning(`!. Size (${toFixedNumber(t,3)}) and spacing (${toFixedNumber(e,3)}) are out of proportion (${toFixedNumber(e/t,3)}, not ${letterConfig.spacingOverSizeRatio}), at ${r}`),n};var interval;const trackCursor=e=>{const t=e.read("_saveCursorPositionBool")[0],r=e.read("saveCursorTrackingHz")[0],n=intervalMsFromHz(r);t&&void 0===interval&&(interval=setInterval(recordCursorPosition,n))},updateTrackCursorHz=e=>{if(void 0!==interval){const t=e.read("saveCursorTrackingHz",status.block_condition),r=intervalMsFromHz(t);clearInterval(interval),interval=setInterval(recordCursorPosition,r)}},defineTargetForCursorTracking=e=>{cursorTracking.target=e},intervalMsFromHz=e=>1/e*1e3,recordCursorPosition=()=>{let e,t,r,n,i,a,o,s,l,c,u,d,h,p,f,m,g=cursorTracking.target;Array.isArray(g)&&(g=g[0]);const _=/_instructionRoutineEachFrame/.test(status.currentFunction),y=void 0!==g&&!0===g._autoDraw;if(y){const[e,t]=g._pos;n=getAppleCoordinatePosition(e,t).toString()}else n="";const b=getCursorLocation();t=getAppleCoordinatePosition(b[0],b[1]).toString(),r=getAppleCoordinatePosition(Screens[0].fixationConfig.pos[0],Screens[0].fixationConfig.pos[1]).toString();const v=void 0!==Screens[0].fixationConfig.stim&&Screens[0].fixationConfig.stim?.stims[0]?._autoDraw;if(void 0!==status.block_condition){i=thisExperimentInfo.experiment,c=thisExperimentInfo.participant,a=status.block,o=status.block_condition,s=showConditionNameConfig$1.name,l=Number(o.split("_")[1]),u=status.trial,e=Date.now()/1e3,d=Screens[0].pxPerCm,h=viewingDistanceCm.current,p=getScreenDimensions(),f=Screens[0].nearestPointXYZPx[0],m=Screens[0].nearestPointXYZPx[1];const g={experiment:i,pavloviaSessionId:c,posixTimeSec:e.toString(),cursorPositionXYPx:t,crosshairPositionXYPx:r,targetPositionXYPx:n,blockNumber:a,block_condition:o,conditionNumber:l,conditionName:s,trialNumber:u,pxPerCm:d.toString(),viewingDistanceCm:h.toString(),screenWidthPx:p[0],screenHeightPx:p[1],nearpointXYPx:getAppleCoordinatePosition(f,m).toString(),trialStep:status.currentFunction,targetBool:y&&!_,crosshairBool:v&&!_};cursorTracking.records.push(g)}};class RsvpReadingResponseModeConfigurationError extends Error{constructor(e){super(e),this.name="RsvpReadingResponseModeConfigurationError"}}const requireBoolean=(e,t)=>{if("boolean"!=typeof e)throw new RsvpReadingResponseModeConfigurationError(`${t} must be a Boolean value for RSVP reading.`);return e},resolveRsvpReadingResponseMode=({responseSpokenBool:e,responseSpokenToExperimenterBool:t})=>{const r=requireBoolean(e,"responseSpokenBool"),n=requireBoolean(t,"responseSpokenToExperimenterBool");if(r&&n)throw new RsvpReadingResponseModeConfigurationError("RSVP reading cannot use automatic speech recognition and human experimenter scoring at the same time.");return r?"automaticSpeech":n?"spoken":"silent"},resolveRsvpReadingBlockResponseModes=({responseSpokenBool:e,responseSpokenToExperimenterBool:t})=>{if(!Array.isArray(e)||!Array.isArray(t))throw new RsvpReadingResponseModeConfigurationError("RSVP reading block response parameters must be arrays.");if(e.length!==t.length)throw new RsvpReadingResponseModeConfigurationError("RSVP reading block response parameters must contain one value per condition.");return e.map(((e,r)=>resolveRsvpReadingResponseMode({responseSpokenBool:e,responseSpokenToExperimenterBool:t[r]})))},isRsvpReadingMatrixResponseMode=e=>"silent"===e,isRsvpReadingExperimenterResponseMode=e=>"spoken"===e,isRsvpReadingAutomaticSpeechResponseMode=e=>"automaticSpeech"===e,getRsvpReadingQuestionResponseType=e=>isRsvpReadingMatrixResponseMode(e)?"silent":"spoken",ZWNJ="",NON_STANDARD_JOIN_CONTROLS=/[\u200B\u200D\u2060\uFEFF]/g,ALL_JOIN_CONTROLS=/[\u200B-\u200D\u2060\uFEFF]/g,JOIN_CONTROL_CHARACTER=/[\u200B-\u200D\u2060\uFEFF]/u,APOSTROPHE_VARIANTS=/[\u2018\u2019\u02BC\u0060\u00B4]/g,DASH_VARIANTS=/[\u2010-\u2015\u2212]/g,EDGE_NON_WORD=/^[^\p{L}\p{N}\p{M}\u200C\u200D]+|[^\p{L}\p{N}\p{M}\u200C\u200D]+$/gu,CONTAINS_LETTER_OR_NUMBER=/[\p{L}\p{N}]/u,NUMBER$1=/\p{N}/u,PUNCTUATION_RUN_BETWEEN_WORD_CHARACTERS=/([\p{L}\p{N}\p{M}])(\p{P}+)(?=([\p{L}\p{N}\p{M}]))/gu,LEXICAL_INTERNAL_PUNCTUATION=new Set(["'","‘","’","ʼ","`","\xb4","-","‐","‑"]),NUMERIC_INTERNAL_PUNCTUATION=new Set([".",",",":","/","٫","٬",".",",",":","/"]),ARABIC_YEH=/\u064A/g,PERSIAN_YEH="ی",PERSIAN_YEH_PATTERN=/\u06CC/g,ARABIC_KAF=/\u0643/g,PERSIAN_KAF="ک",PERSIAN_KAF_PATTERN=/\u06A9/g,TATWEEL=/\u0640/g,ARABIC_DIACRITICS=/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g,PERSIAN_PHONETIC_EQUIVALENTS=Object.freeze({"س":"S","ص":"S","ث":"S","ز":"Z","ذ":"Z","ض":"Z","ظ":"Z","ت":"T","ط":"T","ق":"Q","غ":"Q","ه":"H","ح":"H","ا":"A","آ":"A","أ":"A","إ":"A","ک":"K","ك":"K","ی":"Y","ي":"Y","و":"V","ع":"E"}),PERSIAN_SEPARABLE_PREFIXES=new Set(["می","نمی"]),PERSIAN_SEPARABLE_SUFFIXES=new Set(["ها","های","هایی","تر","ترین"]),normalizeLanguageCode=e=>{const t=String(e??"").trim().replace(/_/g,"-");if(!t)throw new Error("A speech language code is required.");return t},baseLanguage=e=>normalizeLanguageCode(e).split("-")[0].toLowerCase(),localeLowerCase=(e,t)=>{try{return e.toLocaleLowerCase(t)}catch{return e.toLowerCase()}},prepareJoinControls=e=>e.normalize("NFC").replace(NON_STANDARD_JOIN_CONTROLS,ZWNJ).replace(/[\t ]*\u200C+[\t ]*/g,ZWNJ),preparePunctuationBoundaries=e=>e.replace(PUNCTUATION_RUN_BETWEEN_WORD_CHARACTERS,((e,t,r,n)=>{const i=[...r];if(1===i.length&&LEXICAL_INTERNAL_PUNCTUATION.has(i[0]))return e;return NUMBER$1.test(t)&&NUMBER$1.test(n)&&i.every((e=>NUMERIC_INTERNAL_PUNCTUATION.has(e)))?e:`${t} `})),tokenResult=(e,t,r,n,i,a=[])=>({original:e,normalized:t,comparisonKey:r,languageCode:n,profileId:i.id,profileVersion:i.version,phoneticKeys:a}),persianPhoneticKey=e=>[...e].filter((e=>!JOIN_CONTROL_CHARACTER.test(e))).map((e=>PERSIAN_PHONETIC_EQUIVALENTS[e]??e)).join(""),defaultProfile={id:"default",version:"unicode-nfc-v1",prepareText:e=>e.normalize("NFC"),normalizeToken:(e,t)=>{const r=localeLowerCase(e.normalize("NFC").replace(EDGE_NON_WORD,""),t);return tokenResult(e,r,r.replace(ALL_JOIN_CONTROLS,""),t,defaultProfile)}},englishProfile={id:"en",version:"english-nfkc-v1",prepareText:e=>e.normalize("NFKC"),normalizeToken:(e,t)=>{const r=e.normalize("NFKC").replace(APOSTROPHE_VARIANTS,"'").replace(DASH_VARIANTS,"-").toLocaleLowerCase("en-US").replace(EDGE_NON_WORD,"");return tokenResult(e,r,r,t,englishProfile)}},persianProfile={id:"fa",version:"persian-orthographic-v1",prepareText:prepareJoinControls,normalizeToken:(e,t)=>{const r=prepareJoinControls(e).replace(ARABIC_YEH,PERSIAN_YEH).replace(ARABIC_KAF,PERSIAN_KAF).replace(TATWEEL,"").replace(ARABIC_DIACRITICS,"").replace(EDGE_NON_WORD,"");return tokenResult(e,r,r.replace(ALL_JOIN_CONTROLS,""),t,persianProfile,r?[persianPhoneticKey(r)]:[])}},arabicProfile={id:"ar",version:"arabic-orthographic-v1",prepareText:prepareJoinControls,normalizeToken:(e,t)=>{const r=prepareJoinControls(e).replace(PERSIAN_YEH_PATTERN,"ي").replace(PERSIAN_KAF_PATTERN,"ك").replace(TATWEEL,"").replace(ARABIC_DIACRITICS,"").replace(EDGE_NON_WORD,"");return tokenResult(e,r,r.replace(ALL_JOIN_CONTROLS,""),t,arabicProfile)}},resolveProfile=e=>{switch(baseLanguage(e)){case"en":return englishProfile;case"fa":case"fas":return persianProfile;case"ar":case"ara":return arabicProfile;default:return defaultProfile}},normalizeSpeechToken=(e,t)=>{const r=normalizeLanguageCode(t);return resolveProfile(r).normalizeToken(String(e??""),r)},tokenizeSpeechTranscript=(e,t)=>{const r=normalizeLanguageCode(t),n=resolveProfile(r),i=String(e??""),a=preparePunctuationBoundaries(n.prepareText(i)).split(/\s+/u).filter(Boolean).map((e=>n.normalizeToken(e,r))).filter((e=>e.comparisonKey.length>0&&CONTAINS_LETTER_OR_NUMBER.test(e.comparisonKey)));return{rawText:i,languageCode:r,profileId:n.id,profileVersion:n.version,tokens:a}},speechTokenSplitMatchKind=(e,t)=>{if(t.length<2||t.some((t=>t.profileId!==e.profileId))||t.map((e=>e.comparisonKey)).join("")!==e.comparisonKey)return null;if(("fa"===e.profileId||"ar"===e.profileId)&&e.normalized.includes(ZWNJ))return"explicitJoinControl";if("fa"!==e.profileId)return null;const r=t[0].comparisonKey,n=t[t.length-1].comparisonKey;return PERSIAN_SEPARABLE_PREFIXES.has(r)||PERSIAN_SEPARABLE_SUFFIXES.has(n)?"persianAffixBoundary":null},OMISSION_COST=1,INSERTION_COST=1,OUT_OF_ORDER_TARGET_COST=.4,PHONETIC_CANDIDATE_COST=.8,UNRELATED_SUBSTITUTION_COST=2.1,JOINED_TRANSCRIPT_COST=.05,MERGED_TARGETS_COST=.05,MAX_JOINED_TRANSCRIPT_TOKENS=3,MAX_MERGED_TARGET_TOKENS=3,targetIndexLookup=e=>{const t=new Map;return e.forEach(((e,r)=>{const n=t.get(e.comparisonKey)??[];n.push(r),t.set(e.comparisonKey,n)})),t},substitution=(e,t,r,n)=>{if(e.comparisonKey===t.comparisonKey)return{matchKind:"exact",stepCost:0};if((n.get(t.comparisonKey)??[]).some((e=>e!==r)))return{matchKind:"outOfOrderTarget",stepCost:OUT_OF_ORDER_TARGET_COST};const i=new Set(t.phoneticKeys);return e.phoneticKeys.some((e=>i.has(e)))?{matchKind:"phoneticCandidate",stepCost:PHONETIC_CANDIDATE_COST}:{matchKind:"unrelated",stepCost:UNRELATED_SUBSTITUTION_COST}},joinedTranscriptMatchesTarget=(e,t)=>speechTokenSplitMatchKind(e,t),mergedTargetsMatchTranscript=(e,t,r,n)=>e.length>=2&&"fa"===t.profileId&&e.every((e=>"fa"===e.profileId))&&e.map((e=>e.comparisonKey)).join("")===t.comparisonKey&&!r.has(t.comparisonKey)&&1===n.get(t.comparisonKey),mergedTargetKeyCountLookup=e=>{const t=new Map;for(let r=0;r<e.length;r+=1)for(let n=2;n<=MAX_MERGED_TARGET_TOKENS&&r+n<=e.length;n+=1){const i=e.slice(r,r+n);if(i.some((e=>"fa"!==e.profileId)))continue;const a=i.map((e=>e.comparisonKey)).join("");t.set(a,(t.get(a)??0)+1)}return t},alignSpeechTokensToTargets=(e,t)=>{const r=e.length,n=t.length,i=targetIndexLookup(e),a=mergedTargetKeyCountLookup(e),o=Array.from({length:r+1},(()=>Array(n+1).fill(Number.POSITIVE_INFINITY))),s=Array.from({length:r+1},(()=>Array(n+1).fill(void 0)));o[0][0]=0;for(let d=1;d<=r;d+=1)o[d][0]=d*OMISSION_COST,s[d][0]={operation:"omission",matchKind:null,transcriptTokenCount:0,stepCost:OMISSION_COST};for(let d=1;d<=n;d+=1)o[0][d]=d*INSERTION_COST,s[0][d]={operation:"insertion",matchKind:null,transcriptTokenCount:1,stepCost:INSERTION_COST};for(let d=1;d<=r;d+=1)for(let r=1;r<=n;r+=1){const n=substitution(e[d-1],t[r-1],d-1,i),l=o[d-1][r-1]+n.stepCost,c=o[d-1][r]+OMISSION_COST,u=o[d][r-1]+INSERTION_COST;let h=l,p={operation:"diagonal",matchKind:n.matchKind,transcriptTokenCount:1,stepCost:n.stepCost};c<h&&(h=c,p={operation:"omission",matchKind:null,transcriptTokenCount:0,stepCost:OMISSION_COST});const f="exact"===n.matchKind&&u===l&&c>l;(u<h||f)&&(h=u,p={operation:"insertion",matchKind:null,transcriptTokenCount:1,stepCost:INSERTION_COST});for(let i=2;i<=MAX_JOINED_TRANSCRIPT_TOKENS&&i<=r;i+=1){const n=t.slice(r-i,r),a=joinedTranscriptMatchesTarget(e[d-1],n);if(!a)continue;const s=o[d-1][r-i]+JOINED_TRANSCRIPT_COST;s<h&&(h=s,p={operation:"joinedTranscript",matchKind:"joinedTranscript",transcriptTokenCount:i,boundaryMatchKind:a,stepCost:JOINED_TRANSCRIPT_COST})}for(let s=2;s<=MAX_MERGED_TARGET_TOKENS&&s<=d;s+=1){const n=e.slice(d-s,d);if(!mergedTargetsMatchTranscript(n,t[r-1],i,a))continue;const l=o[d-s][r-1]+MERGED_TARGETS_COST;l<h&&(h=l,p={operation:"mergedTargets",matchKind:"mergedTargets",transcriptTokenCount:1,targetTokenCount:s,stepCost:MERGED_TARGETS_COST})}o[d][r]=h,s[d][r]=p}const l=[];let c=r,u=n;for(;c>0||u>0;){const e=s[c][u];if(!e)throw new Error("Speech token alignment is incomplete.");switch(e.operation){case"diagonal":{const t=c-1,r=u-1;l.unshift({operation:"exact"===e.matchKind?"match":"substitution",matchKind:e.matchKind,targetIndex:t,targetIndices:[t],transcriptIndices:[r],beforeTargetIndex:null,cost:e.stepCost}),c-=1,u-=1;break}case"joinedTranscript":{const t=c-1,r=u-e.transcriptTokenCount;l.unshift({operation:"match",matchKind:"joinedTranscript",targetIndex:t,targetIndices:[t],transcriptIndices:Array.from({length:e.transcriptTokenCount},((e,t)=>r+t)),beforeTargetIndex:null,boundaryMatchKind:e.boundaryMatchKind,cost:e.stepCost}),c-=1,u-=e.transcriptTokenCount;break}case"mergedTargets":{const t=e.targetTokenCount??0;if(t<2)throw new Error("Merged speech targets are incomplete.");const r=c-t,n=Array.from({length:t},((e,t)=>r+t));l.unshift({operation:"match",matchKind:"mergedTargets",targetIndex:r,targetIndices:n,transcriptIndices:[u-1],beforeTargetIndex:null,cost:e.stepCost}),c-=t,u-=1;break}case"omission":l.unshift({operation:"omission",matchKind:null,targetIndex:c-1,targetIndices:[c-1],transcriptIndices:[],beforeTargetIndex:null,cost:e.stepCost}),c-=1;break;case"insertion":l.unshift({operation:"insertion",matchKind:null,targetIndex:null,targetIndices:[],transcriptIndices:[u-1],beforeTargetIndex:c,cost:e.stepCost}),u-=1}}return{events:l,totalCost:o[r][n]}},characterSimilarity=(e,t)=>{const r=[...e],n=[...t];if(r.join("")===n.join(""))return 1;if(0===r.length||0===n.length)return 0;let i=Array.from({length:n.length+1},((e,t)=>t)),a=Array(n.length+1).fill(0);for(let o=1;o<=r.length;o+=1){a[0]=o;for(let e=1;e<=n.length;e+=1)a[e]=r[o-1]===n[e-1]?i[e-1]:1+Math.min(i[e-1],i[e],a[e-1]);[i,a]=[a,i]}return 1-i[n.length]/Math.max(r.length,n.length)},RSVP_SPEECH_SCORING_VERSION="rsvp-position-aware-v1";class RsvpSpeechScoringError extends Error{constructor(e,t){super(t),this.name="RsvpSpeechScoringError",this.code=e}}const validatePolicy=e=>{if(!e||!["strict","anyOrder"].includes(e.wordOrder))throw new RsvpSpeechScoringError("invalidPolicy","RSVP speech scoring requires a valid word-order policy.");if(!["ignore","markIncorrect"].includes(e.repetition))throw new RsvpSpeechScoringError("invalidPolicy","RSVP speech scoring requires a valid repetition policy.");if(!["accept","markIncorrect"].includes(e.selfCorrection))throw new RsvpSpeechScoringError("invalidPolicy","RSVP speech scoring requires a valid self-correction policy.")},ensureValidTargets=e=>{e.forEach((e=>{if(!e.comparisonKey)throw new RsvpSpeechScoringError("invalidTargets","RSVP speech target words cannot normalize to empty text.")}))},transcriptText=(e,t)=>0===e.transcriptIndices.length?null:e.transcriptIndices.map((e=>t[e]?.original??"")).filter(Boolean).join(" "),targetEventMap=e=>{const t=new Map;return e.forEach((e=>{e.targetIndices.forEach((r=>t.set(r,e)))})),t},APPROVED_EXACT_MATCH_KINDS=new Set(["exact","joinedTranscript","mergedTargets"]),isApprovedExactMatch=e=>"match"===e.operation&&null!==e.matchKind&&APPROVED_EXACT_MATCH_KINDS.has(e.matchKind),similarityThreshold=(e,t)=>Math.min([...e].length,[...t].length)<=3?2/3:.6,classifyInsertions=(e,t,r)=>{const n=new Map;t.forEach(((e,t)=>{const r=n.get(e.comparisonKey)??[];r.push(t),n.set(e.comparisonKey,r)}));const i=new Map;return e.forEach(((e,t)=>{"match"===e.operation&&e.targetIndices.forEach((e=>i.set(e,t)))})),e.map(((a,o)=>{if("insertion"!==a.operation)return a;const s=a.transcriptIndices[0],l=r[s],c=n.get(l.comparisonKey)??[];if(c.length>0){const e=c.map((e=>({targetIndex:e,eventIndex:i.get(e)}))).filter((e=>void 0!==e.eventIndex&&e.eventIndex<o)).sort(((e,t)=>t.eventIndex-e.eventIndex))[0],r=c.map((e=>({targetIndex:e,eventIndex:i.get(e)}))).filter((e=>void 0!==e.eventIndex&&e.eventIndex>o)).sort(((e,t)=>e.eventIndex-t.eventIndex))[0],n=e?.targetIndex??r?.targetIndex??c.reduce(((e,r)=>{const n=a.beforeTargetIndex??t.length;return Math.abs(r-n)<Math.abs(e-n)?r:e}));return{...a,insertionKind:e?"repetition":"outOfOrderTarget",relatedTargetIndex:n,relatedTargetIndices:[n]}}const u=e.findIndex((e=>"mergedTargets"===e.matchKind&&e.transcriptIndices.some((e=>r[e]?.comparisonKey===l.comparisonKey))));if(u>=0){const t=e[u];return{...a,insertionKind:u<o?"repetition":"outOfOrderTarget",relatedTargetIndex:t.targetIndices[0],relatedTargetIndices:t.targetIndices}}const d=e[o+1];if("match"===d?.operation&&1===d.targetIndices.length&&d.transcriptIndices[0]===s+1){const e=d.targetIndices[0],r=t[e],n=characterSimilarity(l.comparisonKey,r.comparisonKey);if(n>=similarityThreshold(l.comparisonKey,r.comparisonKey))return{...a,insertionKind:"selfCorrectionAttempt",relatedTargetIndex:e,relatedTargetIndices:[e],similarityToTarget:n}}return{...a,insertionKind:"filler"}}))},scoreWithoutOrder=(e,t,r)=>{const n=Array(e.length).fill(0),i=new Map,a=new Set;return e.forEach(((e,r)=>{const o=t.findIndex(((t,r)=>!a.has(r)&&t.comparisonKey===e.comparisonKey));o<0||(n[r]=1,a.add(o),i.set(r,t[o].original))})),r.forEach((e=>{if(!isApprovedExactMatch(e)||"exact"===e.matchKind)return;if(e.targetIndices.some((e=>1===n[e]))||e.transcriptIndices.some((e=>a.has(e))))return;const r=transcriptText(e,t);null!==r&&(e.transcriptIndices.forEach((e=>a.add(e))),e.targetIndices.forEach((e=>{n[e]=1,i.set(e,r)})))})),{vector:n,responseTextByTarget:i}},scoreRsvpSpeechResponse=e=>{if(!Array.isArray(e.targetWords)||0===e.targetWords.length)throw new RsvpSpeechScoringError("invalidTargets","RSVP speech scoring requires at least one target word.");validatePolicy(e.policy);const t=e.targetWords.map((t=>normalizeSpeechToken(t,e.languageCode)));ensureValidTargets(t);const r=tokenizeSpeechTranscript(e.transcript,e.languageCode),n=r.tokens;if(0===n.length)throw new RsvpSpeechScoringError("emptyTranscript","RSVP speech scoring cannot score an empty transcript.");const i=alignSpeechTokensToTargets(t,n),a=classifyInsertions(i.events,t,n),o=targetEventMap(a);let s,l=new Map;if("anyOrder"===e.policy.wordOrder){const e=scoreWithoutOrder(t,n,a);s=e.vector,l=e.responseTextByTarget}else s=t.map(((e,t)=>{const r=o.get(t);if(!r||!isApprovedExactMatch(r))return 0;const i=transcriptText(r,n);return null!==i&&l.set(t,i),1})),a.forEach((e=>{"outOfOrderTarget"===e.insertionKind&&null!==e.beforeTargetIndex&&e.beforeTargetIndex<s.length&&(s[e.beforeTargetIndex]=0)}));"markIncorrect"===e.policy.repetition&&a.forEach((e=>{"repetition"===e.insertionKind&&e.relatedTargetIndices?.forEach((e=>{s[e]=0}))})),"markIncorrect"===e.policy.selfCorrection&&a.forEach((e=>{"selfCorrectionAttempt"===e.insertionKind&&void 0!==e.relatedTargetIndex&&(s[e.relatedTargetIndex]=0)}));const c=new Set;a.forEach((e=>{"outOfOrderTarget"===e.matchKind&&e.targetIndices.forEach((e=>c.add(e))),"outOfOrderTarget"===e.insertionKind&&null!==e.beforeTargetIndex&&e.beforeTargetIndex<t.length&&c.add(e.beforeTargetIndex)}));const u=new Set;a.forEach((t=>{("repetition"===t.insertionKind&&"markIncorrect"===e.policy.repetition||"selfCorrectionAttempt"===t.insertionKind&&"markIncorrect"===e.policy.selfCorrection)&&t.relatedTargetIndices?.forEach((e=>u.add(e)))}));const d=t.map(((t,r)=>{const i=o.get(r),a=s[r];let d;return d=u.has(r)?"rejectedByPolicy":a?"correct":c.has(r)?"outOfOrder":"substitution"===i?.operation?"substitution":"omission",{targetIndex:r,targetWord:e.targetWords[r],responseText:l.get(r)??(i?transcriptText(i,n):null),correct:a,outcome:d}})),h=a.filter((e=>"insertion"===e.operation));return{responseVector:s,targetResults:d,policy:{...e.policy},diagnostics:{scoringVersion:RSVP_SPEECH_SCORING_VERSION,languageCode:r.languageCode,languageProfile:r.profileId,languageProfileVersion:r.profileVersion,normalizedTargetWords:t.map((e=>e.normalized)),normalizedTranscript:n.map((e=>e.normalized)).join(" "),transcriptTokenCount:n.length,insertionCount:h.length,fillerCount:h.filter((e=>"filler"===e.insertionKind)).length,repetitionCount:h.filter((e=>"repetition"===e.insertionKind)).length,selfCorrectionCount:h.filter((e=>"selfCorrectionAttempt"===e.insertionKind)).length,outOfOrderCount:a.filter((e=>"outOfOrderTarget"===e.matchKind||"outOfOrderTarget"===e.insertionKind)).length,omissionCount:a.filter((e=>"omission"===e.operation)).length,substitutionCount:a.filter((e=>"substitution"===e.operation)).length,splitTranscriptCount:a.filter((e=>"joinedTranscript"===e.matchKind)).length,mergedTargetGroupCount:a.filter((e=>"mergedTargets"===e.matchKind)).length,phoneticCandidateCount:a.filter((e=>"phoneticCandidate"===e.matchKind)).length,alignmentCost:i.totalCost,events:a}}},DEFAULT_RSVP_SPEECH_SCORING_POLICY={wordOrder:"anyOrder",repetition:"ignore",selfCorrection:"accept"},runtime$1=rsvpSpeechRuntime$1,response$1=phraseIdentificationResponse,resolveScoringPolicy=e=>{if(e.policy)return e.policy;if("boolean"!=typeof e.ignoreWordOrder)throw new Error("rsvpReadingSTTIgnoreOrderBool must be a Boolean value.");return{...DEFAULT_RSVP_SPEECH_SCORING_POLICY,wordOrder:e.ignoreWordOrder?"anyOrder":"strict"}},resetRsvpSpeechResponseRegistration=()=>{runtime$1.responseRegistrationStatus="pending",runtime$1.responseRegistrationError=void 0,runtime$1.responseDiagnostics=void 0},markInvalid=e=>(runtime$1.responseRegistrationStatus="invalid",runtime$1.responseRegistrationError=e,runtime$1.responseDiagnostics=void 0,{status:"invalid",errorCode:e}),registerRsvpSpeechResult=e=>{if("registered"===runtime$1.responseRegistrationStatus)return{status:"registered",diagnostics:runtime$1.responseDiagnostics};if("invalid"===runtime$1.responseRegistrationStatus)return{status:"invalid",errorCode:runtime$1.responseRegistrationError};const t=e.speechResult??runtime$1.result;if("completed"!==runtime$1.status||!t)return"failed"===runtime$1.status||"closed"===runtime$1.status?markInvalid("postExposureTechnicalFailure"):{status:"waiting"};try{const r=resolveScoringPolicy(e),n=scoreRsvpSpeechResponse({targetWords:e.targetWords,transcript:t.text,languageCode:e.languageCode,policy:r});return response$1.current=n.targetResults.map((e=>e.responseText??"")),response$1.targetWord=n.targetResults.map((e=>e.targetWord)),response$1.correct=[...n.responseVector],response$1.clickTime=[],runtime$1.responseRegistrationStatus="registered",runtime$1.responseRegistrationError=void 0,runtime$1.responseDiagnostics=n.diagnostics,{status:"registered",diagnostics:n.diagnostics}}catch(error){const t="object"==typeof error&&null!==error&&"code"in error&&"string"==typeof error.code?error.code:"scoringError";return markInvalid(t)}};class RSVPReadingTargetSet{constructor(e,t,r,n,i,a,o,s){this.word=e,this.displayText=s||e,this.foilWords=i,this.position=t,this.startTime=void 0,this.durationSec=r,this.orderNumber=n,this.flankerCharacterSet=a.read("rsvpReadingFlankerCharacterSet",o).split(""),this.paramReader=a,this.BC=o,this._heightPx=getRSVPReadingHeightPx(this.paramReader,this.BC),this._spacingPx=this._heightPx*letterConfig.spacingOverSizeRatio,this.flankerLettersUsed=[],this.stims=this.generateStims(),this.stimsNominalPositions=[...this.stims.map((e=>e.getPos()))],this.measuredDuration=void 0}generateStims(){const e=this._generateStimStrings();switch(letterConfig.spacingRelationToSize){case"ratio":return this._generateRatioStims(e);case"typographic":return this._generateTypographicStims(e);default:return console.error(`Unsupported spacingRelationToSize: ${letterConfig.spacingRelationToSize}`),this._generateRatioStims(e)}}_generateStimStrings(){let e=[];if(this.flankerCharacterSet.length>0){const t=this.displayText.length+2;e.push(sampleWithReplacement(this.flankerCharacterSet,t).join("")),e.push(sampleWithReplacement(this.flankerCharacterSet,1).join("")+this.displayText+sampleWithReplacement(this.flankerCharacterSet,1).join("")),e.push(sampleWithReplacement(this.flankerCharacterSet,t).join(""))}else e.push(this.displayText);return e}_generateRatioStims(e){if(e.length>1){const t=[this.position[0],this.position[1]+this._spacingPx],r=[this.position[0],this.position[1]-this._spacingPx];return[..._generateLetterStimsForWord(e[0],t,this._heightPx,this._spacingPx,`topFlanker-${this.orderNumber}`,this.BC,this.paramReader),..._generateLetterStimsForWord(e[1],this.position,this._heightPx,this._spacingPx,`middleRow-${this.orderNumber}`,this.BC,this.paramReader),..._generateLetterStimsForWord(e[2],r,this._heightPx,this._spacingPx,`bottomFlanker-${this.orderNumber}`,this.BC,this.paramReader)]}return _generateLetterStimsForWord(this.displayText,this.position,this._heightPx,this._spacingPx,`middleRow-${this.orderNumber}`,this.BC,this.paramReader)}_generateTypographicStims(e){const t=e.join("\n"),r=new TextStim({name:`typographicReadingTarget-${this.orderNumber}}`,win:psychoJS.window,text:t,font:font.name,pos:this.position,units:"pix",height:this._heightPx,wrapWidth:2*window.innerWidth,ori:0,color:colorRGBASnippetToRGBA(font.colorRGBA),opacity:1,depth:999999,padding:this.paramReader.read("fontPadding",this.BC),characterSet:readFontMetricsCharacterSet(this.paramReader,this.BC),language:font.language,direction:font.direction,kerning:font.kerning,textRendering:font.textRendering});return r.setPadding(this.paramReader.read("fontPadding",this.BC)),readingConfig.height=findReadingSize(this.paramReader.read("readingSetSizeBy",this.BC),this.paramReader,r,"condition"),r.setHeight(readingConfig.height),r.setText(t),font.letterSpacing&&r.setLetterSpacingByProportion(font.letterSpacing),[r]}}class Category{constructor(e,t){this.target=e,this.foils=t,this.elements=shuffle([this.target,...this.foils])}}class rsvpReadingTrialWords{constructor(e,t,r=1,n=1){this.sequence=e;const i=tokenizeWordsIndividually(e),a=e.split(/\s/),o=t.slice(),s=i.map(((e,t)=>{const r=o.map((e=>e[0])).indexOf(e.toLowerCase());let n=o.splice(r,1).pop();return n=[a[t],...n.slice(1)],n})),l=Math.ceil(i.length/r);this.targetWords=[],this.foils=[],this.responseOptions=[],this.displayTexts=[],this.screens=[];for(let c=0;c<l;c++){const e=c*r,t=Math.min(e+r,i.length),o=t-e,l=a.slice(e,t).join(" "),u=Array.from({length:o},((e,t)=>t)),d=shuffle([...u]).slice(0,Math.min(n,o)).sort(((e,t)=>e-t)),h=u.filter((e=>!d.includes(e))).map((t=>a[e+t].toLowerCase())),p=[],f=[];for(const r of d){const t=s[e+r],n=t.slice(1).filter((e=>!h.includes(e.toLowerCase())));this.targetWords.push(t[0]),this.foils.push(n),this.responseOptions.push(shuffle([t[0],...n])),this.displayTexts.push(l),p.push(t[0]),f.push(n)}this.screens.push({displayText:l,allWords:a.slice(e,t),testedWords:p,testedFoils:f})}}}const getThisBlockRSVPReadingWords=(e,t)=>{const r=e.conditions.filter((e=>e.block===t)),n=e.read("conditionTrials",t),i={};return r.forEach(((t,r)=>{const a=t.block_condition,o=e.read("rsvpReadingNumberOfWords",a),s=e.read("rsvpReadingWordsPerScreen",a),l=e.read("rsvpReadingWordsTestedPerScreen",a),c=o,u=n[r],d=getThisBlockPagesForAGivenCondition(e,a,dummyStim,1,u,c).flatMap((e=>e.split("\n"))).map((e=>e.replace(/\t/g,""))),h=d.map((t=>{const n=tokenizeWordsIndividually(t),i=n.length,o=e.read("rsvpReadingNumberOfResponseOptions",a),s=e.read("readingCorpusFoils",a),l=prepareReadingQuestions(i,o,n,readingFrequencyToWordArchive[e.read("readingCorpus",a)],getRsvpReadingQuestionResponseType(rsvpReadingResponse.responseTypeForCurrentBlock[r]),"rsvpReading",e.read("rsvpReadingRequireUniqueWordsBool",a),s,e.read("readingCorpusFoilsExclude",a),e.read("readingCorpus",a),e.read("readingCorpusTargetsExclude",a)).map((e=>[e.correctAnswer,...e.foils])),c=n.map((e=>canonical(e,"individuallyTokenizedWords")));return l.sort(((e,t)=>c.indexOf(canonical(e[0],"responseOptions a[0]"))-c.indexOf(canonical(t[0],"responseOptions b[0]")))),l}));i[a]=d.map(((e,t)=>new rsvpReadingTrialWords(e,h[t],s,l)))})),i},generateRSVPReadingTargetSets=(e,t,r,n)=>{const i=XYPxOfDeg(0,[targetEccentricityDeg.x,targetEccentricityDeg.y]),a=e.screens.map(((e,a)=>new RSVPReadingTargetSet(e.testedWords[0]||e.allWords[0],i,t,a,e.testedFoils[0]||[],r,n,e.displayText))),o=e.targetWords.map(((a,o)=>new RSVPReadingTargetSet(a,i,t,o,e.foils[o],r,n,e.displayTexts[o])));return{displaySets:a,identificationSets:o}},_generateLetterStimsForWord=(e,t,r,n,i,a,o)=>{const s=getEvenlySpacedValues(e.length,n).map((e=>[t[0]+e,t[1]])),l=i?`${i}-letterWordStim-${e}`:`letterWordStim-${e}`,c=readFontMetricsCharacterSet(o,a),u=s.map(((t,n)=>{const i=new TextStim({name:l+`-${e[n]}`,win:psychoJS.window,text:e[n],font:font.name,pos:t,units:"pix",height:r,wrapWidth:void 0,ori:0,color:colorRGBASnippetToRGBA(font.colorRGBA),opacity:1,depth:999999,padding:o.read("fontPadding",a),characterSet:c,language:font.language,direction:font.direction,kerning:font.kerning,textRendering:font.textRendering});return i.setPadding(o.read("fontPadding",a)),i}));return u};let rsvpEndRoutineAtT,restInstructionsBool=!0,start,rsvpDelayBeforeResponseStartT;const _rsvpReading_trialRoutineEachFrame=(e,t,r)=>{const n=void 0===rsvpReadingTargetSets.current&&0===rsvpReadingTargetSets.upcoming.length;if(defineTargetForCursorTracking(n?void 0:rsvpReadingTargetSets.current[0]),void 0===phraseIdentificationResponse.onsetTime&¬eStimulusOnsetForPhraseIdentification(e),rsvpReadingTargetSets.skippedDueToBadTracking)return 1===rsvpReadingTargetSets.skippedDueToBadTracking?(isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType)&&closeActiveRsvpSpeechTrial(),void 0!==start&&rsvpReadingTargetSets.past.length>0&&(rsvpReadingTargetSets.past[rsvpReadingTargetSets.past.length-1].measuredDuration=e-start,start=void 0),!0):(rsvpReadingTargetSets.skippedDueToBadTracking=0,rsvpDelayBeforeResponseStartT=void 0,!1);if(n){const n=rsvpReadingResponse.responseType;void 0===rsvpDelayBeforeResponseStartT&&(rsvpDelayBeforeResponseStartT=e);const i=paramReader.read("rsvpReadingDelayBeforeResponseScreenSec",status.block_condition)??1;if(e<rsvpDelayBeforeResponseStartT+i)return!0;if(restInstructionsBool&&(r.tSTart=e,r.frameNStart=t,isRsvpReadingMatrixResponseMode(n)||r.setText(""),r.setAutoDraw(!0),restInstructionsBool=!1,!isRsvpReadingAutomaticSpeechResponseMode(n)&&(addRevealableTargetWordsToAidSpokenScoring(),keypad.handler&&keypad.handler.inUse(status.block_condition))))if(keypad.handler.start(),isRsvpReadingMatrixResponseMode(n)){const e=isFontLTR(readFontDirection(paramReader,status.block_condition))?0:rsvpReadingTargetSets.identificationTargetSets.length-1,t=rsvpReadingTargetSets.identificationTargetSets[e],r=shuffle([t.word,...t.foilWords]);keypad.handler.update(r)}else keypad.handler.update(["up","down"]);const a=isRsvpReadingAutomaticSpeechResponseMode(n);if(a&&simulateActive&&("capturing"===rsvpSpeechRuntime.status||"finalizing"===rsvpSpeechRuntime.status)){const t=rsvpReadingTargetSets.identificationTargetSets.map((e=>e.word)).join(" "),r="undefined"!=typeof window?window:void 0,n="string"==typeof r?.__EASY_EYES_RSVP_SPEECH_TRANSCRIPT__?r.__EASY_EYES_RSVP_SPEECH_TRANSCRIPT__:t;injectRsvpSpeechTranscriptForSimulation(n,(()=>1e3*e))}const o=a?registerRsvpSpeechResult({targetWords:rsvpReadingTargetSets.identificationTargetSets.map((e=>e.word)),languageCode:paramReader.read("fontLanguage",status.block_condition)||"en",ignoreWordOrder:paramReader.read(RSVP_SPEECH_PARAMETER_NAMES.ignoreOrder,status.block_condition)}):void 0;return(a?"registered"===o?.status||"invalid"===o?.status:phraseIdentificationResponse.current.length>=rsvpReadingTargetSets.numberOfIdentifications)&&(rsvpEndRoutineAtT??=e+.5,e>=rsvpEndRoutineAtT)?(isRsvpReadingExperimenterResponseMode(n)&&removeScientistKeypressFeedback(),a&&"registered"!==o?.status||updateTrialCounterNumbersForRSVPReading(),rsvpEndRoutineAtT=void 0,restInstructionsBool=!0,rsvpDelayBeforeResponseStartT=void 0,!1):(showCursor(),isRsvpReadingMatrixResponseMode(n)&&!rsvpReadingResponse.displayStatus?(showPhraseIdentification(rsvpReadingResponse.screen),rsvpReadingResponse.displayStatus=!0):isRsvpReadingExperimenterResponseMode(n)&&!rsvpReadingResponse.displayStatus&&(addScientistKeypressFeedback(rsvpReadingTargetSets.numberOfIdentifications),rsvpReadingResponse.displayStatus=!0),!0)}if(void 0!==rsvpReadingTargetSets.current&&rsvpReadingTargetSets.current.stims.every((e=>e.status===PsychoJS$1.Status.NOT_STARTED))){const r=0===rsvpReadingTargetSets.past.length;rsvpReadingTargetSets.current.startTime=e,rsvpReadingTargetSets.current.stims.forEach((r=>{r.tStart=e,r.frameNStart=t,r.setAutoDraw(!0)})),start=e,drawTimingBars(showTimingBarsBool.current,"target",!0),r&&isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType)&&startRsvpSpeechCapture()}return e>=rsvpReadingTargetSets.current.startTime+rsvpReadingTargetSets.current.durationSec&&rsvpReadingTargetSets.current.stims.every((e=>e.status===PsychoJS$1.Status.STARTED))&&(rsvpReadingTargetSets.current.stims.forEach((e=>{e.setAutoDraw(!1)})),drawTimingBars(showTimingBarsBool.current,"target",!1),rsvpReadingTargetSets.past.push(rsvpReadingTargetSets.current),rsvpReadingTargetSets.current=rsvpReadingTargetSets.upcoming.shift(),rsvpReadingTargetSets.past[rsvpReadingTargetSets.past.length-1].measuredDuration=e-start,start=void 0,rsvpReadingTargetSets.past[rsvpReadingTargetSets.past.length-1].stims.forEach((e=>e.frameNFinishedConfirmed=t)),void 0===rsvpReadingTargetSets.current&&0===rsvpReadingTargetSets.upcoming.length&&isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType)&&allowRsvpSpeechProviderFinalization()),!0},undrawAllRSVPReadingStims=()=>{[rsvpReadingTargetSets.current?[rsvpReadingTargetSets.current]:[],rsvpReadingTargetSets.upcoming||[],rsvpReadingTargetSets.past||[],rsvpReadingTargetSets.identificationTargetSets||[]].forEach((e=>{e.forEach((e=>{e?.stims?.forEach((e=>{e&&"function"==typeof e.setAutoDraw&&e.setAutoDraw(!1)}))}))}))},getRSVPReadingHeightPx=(e,t)=>{const r=e.read("targetSizeDeg",t),n=[e.read("targetEccentricityXDeg",t),e.read("targetEccentricityYDeg",t)];return Math.round(Math.abs(XYPxOfDeg(0,[n[0],n[1]-r/2])[1]-XYPxOfDeg(0,[n[0],n[1]+r/2])[1]))},registerKeypressForRSVPReading=e=>{if(!e.length)return;const t=getFeedbackCircles(),r=getUnscoredFeedbackCircles(),n=e[t.length-r.length??0];if(!n||!n.name)return;const i="up"===n.name?1:0;phraseIdentificationResponse.clickTime.push(performance.now()),phraseIdentificationResponse.current.push(n),phraseIdentificationResponse.correct.push(i),updateScientistKeypressFeedback(i),_highlightNextWordInRevealedKey()},addScientistKeypressFeedback=e=>{const t=document.createElement("div");t.className="scientist-feedback-circle-container";for(let r=0;r<e;r++){const e=document.createElement("div");e.className="scientist-feedback-circle",t.appendChild(e)}document.body.appendChild(t),phraseIdentificationResponse.onsetTime=performance.now()},updateScientistKeypressFeedback=e=>{const t=getUnscoredFeedbackCircles().shift();t?.classList.add(e?"scientist-feedback-circle-correct":"scientist-feedback-circle-incorrect")},removeScientistKeypressFeedback=()=>{const e=document.querySelector(".scientist-feedback-circle-container");null!=e&&e.parentNode.removeChild(e)},updateTrialCounterNumbersForRSVPReading=()=>{incrementTrialCompletedThisBlock(status.block_condition),phraseIdentificationResponse.correct.every((e=>e))&&incrementTrialCorrectThisBlock(status.block_condition)},constrainRSVPReadingSpeed=e=>{const t=Math.pow(10,e),r=t>10?10/t*t:t,n=r<.03?.03/t*r:r;return Math.log10(n)},addRevealableTargetWordsToAidSpokenScoring=()=>{const e=document.createElement("div");e.className="rsvpReadingTargetWordsKey",e.id="rsvpReadingTargetWordsKey",rsvpReadingTargetSets.identificationTargetSets.forEach(((t,r)=>{const n=document.createElement("div");n.innerText=t.word,n.classList.add("rsvpReadingTargetWord"),n.classList.add(0===r?"rsvpReadingTargetWordCurrent":"rsvpReadingTargetWordNotYetResponded"),e.appendChild(n)})),e.classList.add("hidden"),document.body.appendChild(e),document.addEventListener("keydown",(t=>{t.shiftKey&&"spoken"===rsvpReadingResponse.responseType&&e.classList.toggle("hidden")}))},removeRevealableTargetWordsToAidSpokenScoring=()=>{const e=document.querySelector("#rsvpReadingTargetWordsKey");e&&e.parentNode.removeChild(e)},_highlightNextWordInRevealedKey=()=>{const e=document.querySelector(".rsvpReadingTargetWordCurrent");e&&e.classList.replace("rsvpReadingTargetWordCurrent","rsvpReadingTargetWordAlreadyResponded");const t=[...document.querySelectorAll(".rsvpReadingTargetWordNotYetResponded")].shift();t&&t.classList.replace("rsvpReadingTargetWordNotYetResponded","rsvpReadingTargetWordCurrent")},addRsvpReadingTrialResponsesToData=()=>{reportRsvpReadingTargetDurations(rsvpReadingTargetSets),resetRsvpReadingTiming();const e="silent"===rsvpReadingResponse.responseType||isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType);psychoJS.experiment.addData("rsvpReadingParticipantResponses",e?phraseIdentificationResponse.current.toString():""),psychoJS.experiment.addData("rsvpReadingTargetWords",rsvpReadingTargetSets.past.map((e=>e.word)).toString()),psychoJS.experiment.addData("rsvpReadingDisplayTexts",rsvpReadingTargetSets.past.map((e=>e.displayText)).toString()),psychoJS.experiment.addData("rsvpReadingTargetWordsForIdentification",rsvpReadingTargetSets.identificationTargetSets.map((e=>e.word)).toString()),psychoJS.experiment.addData("rsvpReadingResponseCorrectBool",phraseIdentificationResponse.correct.map((e=>e?"TRUE":"FALSE")).toString()),psychoJS.experiment.addData("rsvpReadingResponseTimesSec",getPhraseIdentificationReactionTimes().map((e=>toFixedNumber(e,2))).toString())},getFeedbackCircles=()=>[...document.querySelectorAll(".scientist-feedback-circle")],getUnscoredFeedbackCircles=()=>[...getFeedbackCircles().filter((e=>!([...e.classList].includes("scientist-feedback-circle-correct")||[...e.classList].includes("scientist-feedback-circle-incorrect"))))],reportRsvpReadingTargetDurations=e=>{const t=e.past.map((e=>toFixedNumber(e.measuredDuration,3))).join(",");psychoJS.experiment.addData("targetMeasuredDurationSec",t)},resetRsvpReadingTiming=()=>{rsvpReadingTiming.current={},rsvpReadingTiming.past=[]},generateSupplementalRsvpReadingWords=(e,t)=>{const r=e.read("rsvpReadingNumberOfWords",t),n=e.read("rsvpReadingWordsPerScreen",t),i=e.read("rsvpReadingWordsTestedPerScreen",t),a=e.read("rsvpReadingNumberOfResponseOptions",t),o=e.read("readingCorpus",t),s=readingFrequencyToWordArchive[o],l=rsvpReadingResponse.responseTypeForCurrentBlock,c=e.read("conditionTrials",t);if(!s)return console.warn(`No frequency-to-words mapping found for corpus: ${o}`),null;const u=getThisBlockPagesForAGivenCondition(e,t,dummyStim,c,1,r,readingUsedText[o]?.get(t)?.length||0).map((e=>e.split("\n").map((e=>e.replace(/\t/g,"")))))[0].map((o=>{const c=tokenizeWordsIndividually(o),u=prepareReadingQuestions(r,a,c,s,l,"rsvpReading",e.read("rsvpReadingRequireUniqueWordsBool",t),e.read("readingCorpusFoils",t),e.read("readingCorpusFoilsExclude",t),e.read("readingCorpus",t),e.read("readingCorpusTargetsExclude",t)),d=u.map((e=>[e.correctAnswer,...e.foils])),h=u.map((e=>e.correctAnswer)).join(" ");return new rsvpReadingTrialWords(h,d,n,i)})).shift();return u},resolveRsvpSpeechTrialValidity=e=>{if("automaticSpeech"!==e.responseMode)return{validForQuest:!0,consumeTargetWords:!0};return"completed"===e.runtimeStatus&&"registered"===e.responseRegistrationStatus&&e.registeredResponseCount===e.expectedResponseCount?{validForQuest:!0,consumeTargetWords:!0}:"invalid"===e.responseRegistrationStatus?{validForQuest:!1,consumeTargetWords:!0,invalidReason:"postExposureTechnicalFailure"}:e.captureStarted?{validForQuest:!1,consumeTargetWords:!0,invalidReason:"completed"===e.runtimeStatus?"responseNotRegistered":"postExposureTechnicalFailure"}:{validForQuest:!1,consumeTargetWords:!1,invalidReason:"preExposureTechnicalFailure"}},_identify_trialInstructionRoutineEnd=(e,t)=>{removeHandlerForClickingFixation(),e.setAutoDraw(!1),t.setAutoDraw(!1),drawTimingBars(showTimingBarsBool.current,"fixation",!1),letterTiming.crosshairClickedTimestamp=performance.now()},_letter_trialRoutineEnd=(e,t,r,n,i,a,o,s)=>{if(calculateError(letterTiming,tolerances,letterConfig.targetDurationSec,e,letterConfig.delayBeforeStimOnsetSec),letterTiming.trialFirstFrameSec=void 0,letterTiming.targetStartSec=void 0,letterTiming.targetFinishSec=void 0,addTrialStaircaseSummariesToData(t,psychoJS),t instanceof MultiStairHandler$1){const e=t._currentStaircase;logQuest("Level given quest",toFixedNumber(i,3)),!addResponseIfTolerableError(t,n,i,tolerances,usingGaze.current,psychoJS,a,r,o,status.retryThisTrialBool)&&usingGaze.current&&rc.nudgeGaze({showOffset:!0});const s=e._jsQuest.trialCount;psychoJS.experiment.addData("questTrialCountAtEndOfTrial",s)}},_repeatedLetters_trialRoutineFirstFrame=e=>{e.read("calibrateTrackGazeBool",status.block_condition)&&void 0===tolerances.measured.gazeMeasurementLatencySec&&measureGazeError(tolerances,Screens[0],clickedContinue.timestamps[clickedContinue.timestamps.length-1],letterConfig.targetDurationSec)},_repeatedLetters_trialRoutineEachFrame=(e,t,r,n,i,a,o,s)=>{if(e>=r&&repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.NOT_STARTED))&&repeatedLettersConfig.stims.forEach((r=>{r.tStart=e,r.frameNStart=t,r.setAutoDraw(!0)})),repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.STARTED))&&!letterTiming.targetStartSec&&(letterTiming.targetStartSec=e,repeatedLettersConfig.stims.forEach((e=>e.frameNDrawnConfirmed=t)),letterTiming.targetDrawnConfirmedTimestamp=performance.now(),letterTiming.crosshairClickedTimestamp=clickedContinue.timestamps[clickedContinue.timestamps.length-1]),repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.STARTED))&&e>=n&&(repeatedLettersConfig.stims.forEach((e=>{e.setAutoDraw(!1),e.frameNEnd=t})),setTimeout((()=>{showCursor()}),500)),repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.FINISHED))&&!letterTiming.targetFinishSec&&(letterTiming.targetFinishSec=e,repeatedLettersConfig.stims.forEach((e=>e.frameNFinishConfirmed=t)),showConditionNameConfig$1.showTargetSpecs)){const e=letterTiming.targetFinishSec-letterTiming.targetStartSec;appendTargetSpecs("targetOnsetSec",Math.round(100*e)/100,`[${isTimingOK(Math.abs(e-letterConfig.targetDurationSec),.02)}]`),drawTargetSpecs(i,a)}e>=r+letterConfig.markingOnsetAfterTargetOffsetSecs+letterConfig.targetDurationSec&&o.status===PsychoJS$1.Status.NOT_STARTED&&(o.tStart=e,o.frameNStart=t,o.setAutoDraw(!0),setupClickableCharacterSet(fontCharacterSet.current,font.name,fontCharacterSet.where,void 0,showCharacterSetResponse,null,"",targetKind.current,status.block_condition,responseType.current),s.tSTart=e,s.frameNStart=t,s.setAutoDraw(!0))},_letter_trialRoutineFirstFrame=(e,t,r,n,i,a)=>{e.read("calibrateTrackGazeBool",status.block_condition)&&measureGazeError(tolerances,Screens[0],clickedContinue.timestamps[clickedContinue.timestamps.length-1],letterConfig.targetDurationSec)},_rsvpReading_trialRoutineEnd=(e,t,r,n)=>{if(addRsvpReadingTrialResponsesToData(),addTrialStaircaseSummariesToData(e,psychoJS),removeRevealableTargetWordsToAidSpokenScoring(),psychoJS.experiment.addData("rsvpReadingResponsesBool",phraseIdentificationResponse.correct.join(",")),e instanceof MultiStairHandler$1){const i=e._currentStaircase,a=phraseIdentificationResponse.correct.map((e=>e?1:0)),o=resolveRsvpSpeechTrialValidity({responseMode:rsvpReadingResponse.responseType,runtimeStatus:rsvpSpeechRuntime$1.status,captureStarted:void 0!==rsvpSpeechRuntime$1.captureStartedAtMs,registeredResponseCount:phraseIdentificationResponse.correct.length,expectedResponseCount:rsvpReadingTargetSets.numberOfIdentifications??a.length,responseRegistrationStatus:rsvpSpeechRuntime$1.responseRegistrationStatus}),s=o.validForQuest,l=okayToRetryThisTrial(status,n,skipTrialOrBlock);if(status.retryThisTrialBool=status.retryThisTrialBool||!s&&l,o.consumeTargetWords&&rsvpReadingWordsForThisBlock.current[status.block_condition].shift(),status.retryThisTrialBool&&o.consumeTargetWords){const e=generateSupplementalRsvpReadingWords(n,status.block_condition);rsvpReadingWordsForThisBlock.current[status.block_condition].push(e)}const c=isConditionFinished(status.block_condition,n,status,s);e.addResponse(a,t,s,r,status.retryThisTrialBool,c);const u=i._jsQuest.trialCount;psychoJS.experiment.addData("questTrialCountAtEndOfTrial",u)}clearPhraseIdentificationRegisters()},snapshotLoopState=(e,t,r)=>({bc:r,stair:e._name??e.name,thisRepN:e.thisRepN,thisTrialN:e.thisTrialN,nStim:e.nStim,nReps:e.nReps,nRemaining:e.nRemaining,stairFinished:!!e.finished,multiFinished:!!t._finished,trialKeyLen:Array.isArray(t.trialKey)?t.trialKey.length:-1,nth:0});function recordLoopTrailRow(e,t,r){if("undefined"==typeof window)return;const n=window,i=n.__simLoopTrail??=[];i.push({...snapshotLoopState(e,t,r),nth:i.length+1})}const skipTrial=()=>{skipTrialOrBlock.skipTrial=!0,skipTrialOrBlock.trialId=status.trial,skipTrialOrBlock.blockId=status.block};var timeWhenTimeout;const handleResponseTimeoutSec=(e,t)=>{if(0===e||void 0===timeWhenTimeout){const e=paramReader.read("responseTimeoutSec",status.block_condition);timeWhenTimeout=t+e}timeWhenTimeout&&t>timeWhenTimeout&&(skipTrial(),timeWhenTimeout=void 0)},addSkipTrialButton=()=>{if(paramReader.read("responseSkipTrialButtonBool",status.block_condition)&&!document.getElementById("skipTrialButton")){const e=document.createElement("button");e.id="skipTrialButton",e.className="btn btn-outline-secondary threshold-button threshold-beep-button";const t=readi18nPhrases("T_skipTrial",rc.language.value);e.innerText=t,e.addEventListener("click",skipTrial),document.body.appendChild(e)}},removeSkipTrialButton=()=>{document.getElementById("skipTrialButton")?.remove()},createSkipBlockKeyHandler=()=>e=>{const t=e.metaKey||e.ctrlKey;if("ArrowRight"===e.code&&e.shiftKey&&t){let e;if(e=status.block_condition?paramReader.read("responseSkipBlockForWhom",status.block_condition):status.block?paramReader.read("responseSkipBlockForWhom",status.block)[0]:"noone","noone"===e||thisExperimentInfo.ProlificSessionID)return;skipBlock()}};function handleResponseSkipBlockForWhom(){const e=createSkipBlockKeyHandler();return document.addEventListener("skip-block",skipBlock),document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}const skipBlock=()=>{skipTrialOrBlock.skipBlock=!0,skipTrialOrBlock.blockId=status.block},RC_CAMERA_RECONNECT_POPUP_QUIT="rc:cameraReconnectPopup:quit",detailSafe=e=>String(e??"").replace(/[(),\n\r]/g," ").replace(/\s+/g," ").trim().slice(0,40),sanitizeTrigger=e=>String(e??"").replace(/[^\w.-]/g,"").slice(0,40),rcMinutesSinceStart=(e,t)=>{const r=e?.getTime();return"number"==typeof r&&isFinite(r)?r/60:t/6e4},rcUnmetNeedsFromReason=(e,t)=>{const r=e&&"object"==typeof e?sanitizeTrigger(e.trigger):"",n=r&&"cameraReconnectPopup"!==r?`rc:${r}:quit`:RC_CAMERA_RECONNECT_POPUP_QUIT;if(!e||"object"!=typeof e)return n;const i=[];return e.snapshot?.status&&i.push(`status=${detailSafe(e.snapshot.status)}`),e.cameraLabel&&i.push(`camera=${detailSafe(e.cameraLabel)}`),e.resumeAttempts&&i.push(`attempts=${detailSafe(e.resumeAttempts)}`),"number"==typeof t&&isFinite(t)&&i.push("min="+Math.round(10*t)/10),i.length?`${n}(${i.join(",")})`:n};var mergeAudioBuffers=mergeBuffers;function mergeBuffers(e,t){for(var r=0,n=0,i=0;i<e.length;i++)e[i].numberOfChannels>r&&(r=e[i].numberOfChannels),e[i].duration>n&&(n=e[i].duration);for(var a=t.createBuffer(r,t.sampleRate*n,t.sampleRate),o=0;o<e.length;o++)for(var s=0;s<e[o].numberOfChannels;s++){var l=a.getChannelData(s),c=e[o].getChannelData(s);for(i=0;i<c.length;i++)l[i]+=c[i];a.getChannelData(s).set(l,0)}return a}const mergeBuffers$1=getDefaultExportFromCjs(mergeAudioBuffers),vocoderPhrase="Ready Baron, go to {Color} {Number} now";var targetList$2={},maskerList$1={};const initVocoderPhraseSoundFiles=async e=>{const t=await loadVocoderPhraseSoundFiles(e);return targetList$2=t.target,maskerList$1=t.maskerList,{targetList:t.target,maskerList:t.maskerList}},getVocoderPhraseTrialData=async(e,t,r,n=10,i=40,a=0,o=10,s=9)=>{var l=populateTargetIndices(s),c=populateMaskerIndices(l),u=Object.keys(targetList$2[r]);const{targetSentenceAudio:d,talker:h,categoriesChosen:p,allCategories:f}=getTargetSentenceAudio(u,e,l,targetList$2[r]);var m=Object.keys(maskerList$1[r]);const g=m.length>0,_=g?getMaskerSentenceAudio(m,t,c,maskerList$1[r],h,p):null,{targetAudioBuffersAligned:y,maskerAudioBuffersAligned:b}=alignTargetAndMaskerAudioBuffers(d,_),v=combineAudioBuffers(y,audioCtx),S=g?combineAudioBuffers(b,audioCtx):null,w=v.getChannelData(0),T=g?S.getChannelData(0):null,E=audioCtx.createBuffer(1,v.length,audioCtx.sampleRate);for(var x=E.getChannelData(0),A=0;A<x.length;A++)x[A]=2*random$1("audio")-1;setWaveFormToZeroDbSPL(w),g&&setWaveFormToZeroDbSPL(T),setWaveFormToZeroDbSPL(x);const C=i-a,R=getMaxValueOfAbsoluteValueOfBuffer(x)/1,D=getGainValue(C),P=g?getMaxValueOfAbsoluteValueOfBuffer(T)/1:0,I=o-a,k=getGainValue(I);adjustSoundDbSPL(x,C),g&&adjustSoundDbSPL(T,I);const M=getCorrectedInDbAndSoundDBSPLForVocoderPhrase(n,a,w,1-P*k-R*D);return adjustSoundDbSPL(w,M.inDB),{trialSound:c.length&&g?mergeBuffers$1([v,S,E],audioCtx):mergeBuffers$1([v,E],audioCtx),categoriesChosen:p,allCategories:f,targetVolumeDbSPL:M.correctedSoundDBSPL}},getCorrectedInDbAndSoundDBSPLForVocoderPhrase=(e,t,r,n)=>{const i=getMaxValueOfAbsoluteValueOfBuffer(r)/1,a=e-t,o=i*getGainValue(a)>n?calculateDBFromRMS(n/i):a;return{inDB:o,correctedSoundDBSPL:t+o}},alignTargetAndMaskerAudioBuffers=(e,t)=>({targetAudioBuffersAligned:e,maskerAudioBuffersAligned:t}),combineAudioBuffers=(e,t)=>{var r=0;e.map((e=>r+=e.length));for(var n=e[0].numberOfChannels,i=t.createBuffer(n,r,e[0].sampleRate),a=0;a<n;a++){var o=i.getChannelData(a),s=0;e.map((e=>{o.set(e.getChannelData(a),s),s+=e.length}))}return i},populateTargetIndices=(e=9)=>{var t=[...Array(e)];return t.forEach(((e,r,n)=>{for(var i=Math.floor(16*random$1("stimuli"));t.includes(i);)i=Math.floor(16*random$1("stimuli"));n[r]=i})),t.sort()},populateMaskerIndices=e=>{for(var t=[],r=0;r<16;r++)e.includes(r)||t.push(r);return t.sort()},getTrialAudioBufferNewImplementation=(e,t,r)=>{const n=r.createBuffer(1,t.hi.length,t.hi.sampleRate),i=n.getChannelData(0);return e.forEach((e=>{const r=new Float32Array(t.hi.length);e<8?t.lo.copyFromChannel(r,e):t.hi.copyFromChannel(r,e-8);for(var n=0;n<r.length;n++)i[n]+=r[n]})),n},getTargetSentenceAudio=(e,t,r,n)=>{var i=[];const a=e[Math.floor(random$1("stimuli")*e.length)],o={},s={};return t.map((async e=>{if("#"===e[0]){const t=e.substring(1),l=Object.keys(n[a][t]),c=l[Math.floor(random$1("stimuli")*l.length)],u=getTrialAudioBufferNewImplementation(r,n[a][t][c],audioCtx);s[t]=Object.keys(n[a][t]),o[t]=c,i.push(u)}else{const t=n[a][e],o=getTrialAudioBufferNewImplementation(r,t,audioCtx);i.push(o)}})),{targetSentenceAudio:i,talker:a,categoriesChosen:o,allCategories:s}},getMaskerSentenceAudio=(e,t,r,n,i,a)=>{var o=[];const s={t:void 0},l={t:i};for(;l.t===i;)s.t=Math.floor(random$1("stimuli")*e.length),l.t=e[s.t];return t.map((e=>{if("#"===e[0]){const t=e.substring(1),i=Object.keys(n[l.t][t]),s={t:void 0},c={t:a[t]};for(;c.t===a[t];)s.t=Math.floor(random$1("stimuli")*i.length),c.t=i[s.t];const u=getTrialAudioBufferNewImplementation(r,n[l.t][t][c.t],audioCtx);o.push(u)}else{const t=n[l.t][e],i=getTrialAudioBufferNewImplementation(r,t,audioCtx);o.push(i)}})),o},vocoderPhraseSetupClickableCategory=(e,t)=>{const r=document.createElement("div");r.id="responseScreen",r.classList.add("responseScreen");const n=document.createElement("div");n.classList.add("vocoder-phrase-header"),n.id="vocoder-phrase-header",n.innerHTML=vocoderPhrase,r.appendChild(n);const i=document.createElement("div");i.classList.add("vocoder-phrase-clickable-category"),i.id="vocoder-phrase-clickable-category",r.appendChild(i);const a=e.all,o=Object.keys(a),s=o.length,l={};o.forEach(((e,r,n)=>{const o=document.createElement("div");o.classList.add("vocoder-phrase-category-container"),o.id="vocoder-phrase-category-container",o.style.marginLeft="10vw";const c=document.createElement("div");c.classList.add("vocoder-phrase-category-title"),c.id="vocoder-phrase-category-title",c.innerHTML=e;const u=document.createElement("div");u.classList.add("vocoder-phrase-category-list"),u.id="vocoder-phrase-category-list",u.style.display="flex",u.style.flexDirection="column",a[e].forEach(((r,n,i)=>{const a=document.createElement("div");a.className="vocoder-phrase-category-item",a.innerHTML=r,a.onclick=()=>{l[e]=r;const n=document.getElementById("vocoder-phrase-header");n.innerHTML=vocoderPhrase,n.innerHTML=n.innerHTML.replace("{"+e+"}",r);const i=u.children;for(let e=0;e<i.length;e++)i[e].innerHTML===r?i[e].classList.add("vocoder-phrase-item-selected"):i[e].classList.remove("vocoder-phrase-item-selected");const a=Object.keys(l),o=[];a.length===s&&(t.clickTime.push(performance.now()),a.map((e=>{o.push(e+"_"+l[e])})),t.current=o)},u.appendChild(a)})),o.appendChild(c),o.appendChild(u),i.appendChild(o)})),document.body.appendChild(r)},vocoderPhraseRemoveClickableCategory=e=>{e.current=[],e.onsetTime=0,e.clickTime=[];const t=document.querySelectorAll(".responseScreen");t.length>0&&t.forEach((e=>{document.body.removeChild(e)}))};var maskerList={},targetList$1={},whiteNoise$1,whiteNoiseData$1;const initToneInMelodySoundFiles=async e=>{const t=await initSoundFilesWithPromiseAll(e);maskerList=t.maskers,targetList$1=t.target},getToneInMelodyTrialData=async(e,t,r,n,i,a,o)=>{var s=Math.floor(random$1("stimuli")*maskerList[e].length),l=await maskerList[e][s].file,c=l.getChannelData(0);setWaveFormToZeroDbSPL(c);var u=0,d=0;const h=i-a;if(o){whiteNoise$1=audioCtx.createBuffer(1,c.length,audioCtx.sampleRate),whiteNoiseData$1=whiteNoise$1.getChannelData(0);for(var p=0;p<whiteNoiseData$1.length;p++)whiteNoiseData$1[p]=2*random$1("audio")-1;setWaveFormToZeroDbSPL(whiteNoiseData$1),u=getMaxValueOfAbsoluteValueOfBuffer(whiteNoiseData$1)/1,d=getGainValue(h)}const f=getMaxValueOfAbsoluteValueOfBuffer(c)/1,m=n-a,g=getGainValue(m);var _,y;if(adjustSoundDbSPL(c,m),o&&adjustSoundDbSPL(whiteNoiseData$1,h),t){s=Math.floor(random$1("stimuli")*targetList$1[e].length);var b=(_=await targetList$1[e][s].file).getChannelData(0);setWaveFormToZeroDbSPL(b);const t=getCorrectedInDbAndSoundDBSPLForToneInMelody(r,a,b,1-f*g-u*d);adjustSoundDbSPL(b,t.inDB),y=t.correctedSoundDBSPL}return t?{trialSoundMelody:mergeBuffers$1(o?[l,_,whiteNoise$1]:[l,_],audioCtx),targetVolume:y}:{trialSoundMelody:o?mergeBuffers$1([l,whiteNoise$1],audioCtx):l}},getCorrectedInDbAndSoundDBSPLForToneInMelody=(e,t,r,n)=>{const i=getMaxValueOfAbsoluteValueOfBuffer(r)/1,a=e-t,o=i*getGainValue(a)>n?calculateDBFromRMS(Math.abs(n/i)):a;return{inDB:o,correctedSoundDBSPL:t+o}};var targetList={},whiteNoise,whiteNoiseData;const initSpeechInNoiseSoundFiles=async e=>{const t=await initSoundFilesWithPromiseAll(e);return targetList=t.target,new Promise(((e,t)=>{const r=setInterval((()=>{0!==Object.keys(targetList).length&&(clearInterval(r),e(!0))}),100)}))},getSpeechInNoiseTrialData=async(e,t,r,n,i)=>{var a,o=Math.floor(random$1("stimuli")*targetList[e].length),s=(a=await targetList[e][o].file).getChannelData(0);setWaveFormToZeroDbSPL(s);var l=0,c=0;if(i){whiteNoise=audioCtx.createBuffer(1,s.length,audioCtx.sampleRate),whiteNoiseData=whiteNoise.getChannelData(0);for(var u=0;u<whiteNoiseData.length;u++)whiteNoiseData[u]=2*random$1("audio")-1;setWaveFormToZeroDbSPL(whiteNoiseData);const e=r-n;l=getMaxValueOfAbsoluteValueOfBuffer(whiteNoiseData)/1,c=getGainValue(e),adjustSoundDbSPL(whiteNoiseData,e)}const d=getCorrectedInDbAndSoundDBSPLForSpeechInNoise(t,n,s,1-l*c);return adjustSoundDbSPL(s,d.inDB),{targetList:targetList[e],trialSound:i?mergeBuffers$1([a,whiteNoise],audioCtx):a,correctAnsIndex:o,targetVolume:d.correctedSoundDBSPL}},getTargetSoundListTrialData=async(e,t,r,n,i)=>{const a=targetSoundListMap[e].currentIndex,o=targetSoundListMap[e].list[a].left,s=targetSoundListMap[e].list[a].right;let l=targetSoundListFiles[e][o],c=targetSoundListFiles[e][s];const u=cloneAudioBuffer(l).getChannelData(0),d=cloneAudioBuffer(c).getChannelData(0);setWaveFormToZeroDbSPL(u),setWaveFormToZeroDbSPL(d);const h=getCorrectedInDbAndSoundDBSPLForSpeechInNoise(t,n,u,1),p=getCorrectedInDbAndSoundDBSPLForSpeechInNoise(t,n,d,1);adjustSoundDbSPL(u,h.inDB),adjustSoundDbSPL(d,p.inDB),targetSoundListTrialData.left={name:o,file:l},targetSoundListTrialData.right={name:s,file:c},targetSoundListTrialData.targetVolume=h.correctedSoundDBSPL,targetSoundListTrialData.whiteNoiseLevel=r,targetSoundListTrialData.trialSound={names:[o,s],file:combineToStereo(audioCtx,l,c)},targetSoundListMap[e].currentIndex++},combineToStereo=(e,t,r)=>{if(t.sampleRate!==r.sampleRate)throw new Error("Left and right buffers must have the same sample rate");const n=Math.max(t.length,r.length),i=t.sampleRate,a=e.createBuffer(2,n,i);a.getChannelData(0).set(t.getChannelData(0));return a.getChannelData(1).set(r.getChannelData(0)),a},getCorrectedInDbAndSoundDBSPLForSpeechInNoise=(e,t,r,n)=>{const i=getMaxValueOfAbsoluteValueOfBuffer(r)/1,a=e-t,o=i*getGainValue(a)>n?calculateDBFromRMS(n/i):a;return{inDB:o,correctedSoundDBSPL:t+o}},t=(e,t,r="")=>{try{const n=readi18nPhrases(e,t);return"string"==typeof n?n:r}catch{return r}},_needSoundOutput={current:"headphone"},HEADPHONE_CHECK_CONFIG={centerFrequencyHz:600,bandwidthFraction:.06,intervalDurationSec:1,interStimulusIntervalSec:.5,fadeSec:.025,fftLength:65536,noisePeak:.5,numTrials:6,passThreshold:4},headphoneCheckIsNeeded=(e=_needSoundOutput.current)=>{const t=(e||"").trim().toLowerCase();return"headphone"===t||"loudspeaker"===t},runHeadphoneCheck=async(t={})=>{const r=(t.requirement??_needSoundOutput.current??"").trim().toLowerCase();if(!headphoneCheckIsNeeded(r))return{ran:!1,requirement:r,numTrials:0,numCorrect:0,passThreshold:HEADPHONE_CHECK_CONFIG.passThreshold,detectedHeadphones:!1,meetsRequirement:!0,responses:[],summary:"",audioDeviceLabel:null};const n=t.mountNode??document.body,i=new(window.AudioContext||window.webkitAudioContext);t.paramReader&&await applySinkToNewContext(i,desiredSinkForBlock0(t.paramReader));const a=await getAudioOutputDeviceLabel(i);let o=[];try{o=await presentHeadphoneCheckUI(i,n,{paramReader:t.paramReader,rc:t.rc})}finally{try{await i.close()}catch(e){}}const s=o.reduce(((e,t)=>e+(t.correct?1:0)),0),l=s>=HEADPHONE_CHECK_CONFIG.passThreshold,c="headphone"===r?l:!l;return{ran:!0,requirement:r,numTrials:HEADPHONE_CHECK_CONFIG.numTrials,numCorrect:s,passThreshold:HEADPHONE_CHECK_CONFIG.passThreshold,detectedHeadphones:l,meetsRequirement:c,responses:o,audioDeviceLabel:a,summary:buildHeadphoneCheckSummary(r,s,HEADPHONE_CHECK_CONFIG.numTrials,l,c,t.rc?.language?.value||"en")}},getAudioOutputDeviceLabel=async e=>{try{if("undefined"==typeof navigator||!navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.enumerateDevices)return null;const t=await navigator.mediaDevices.getUserMedia({audio:!0});if(t){const r=(await navigator.mediaDevices.enumerateDevices()).filter((e=>"audiooutput"===e.kind));if(console.log("outputs",r),0===r.length)return null;let n="default";if(e&&void 0!==e.sinkId){const t="string"==typeof e.sinkId?e.sinkId:e.sinkId?.id??"";t&&(n=t)}const i=r.find((e=>e.deviceId===n))||r.find((e=>"default"===e.deviceId))||r[0];return t.getTracks().forEach((e=>e.stop())),i?.label??""}return null}catch{return null}},buildThreeIntervalBuffer=(e,t)=>{const r=HEADPHONE_CHECK_CONFIG,n=e.sampleRate,i=Math.round(n*r.intervalDurationSec),a=Math.round(n*r.interStimulusIntervalSec),o=3*i+2*a,s=e.createBuffer(2,o,n),l=s.getChannelData(0),c=s.getChannelData(1);for(let u=1;u<=3;u++){const e=u===t,{leftData:r,rightData:o}=generateInterval(n,i,e),s=(u-1)*(i+a);l.set(r,s),c.set(o,s)}return s},generateInterval=(e,t,r)=>{const n=HEADPHONE_CHECK_CONFIG,i=n.fftLength,a=new Float32Array(i);for(let p=0;p<i;p+=2){let e=random$1("audio");const t=random$1("audio");e<1e-12&&(e=1e-12);const r=Math.sqrt(-2*Math.log(e));a[p]=r*Math.cos(2*Math.PI*t),p+1<i&&(a[p+1]=r*Math.sin(2*Math.PI*t))}const o=a;let s;if(r){const t=new Float32Array(i),r=new Float32Array(i);t.set(a),fft(t,r,!1);const o=e/i,l=n.centerFrequencyHz*(1-n.bandwidthFraction),c=n.centerFrequencyHz*(1+n.bandwidthFraction),u=Math.max(1,Math.floor(l/o)),d=Math.min(i/2-1,Math.ceil(c/o));for(let e=u;e<=d;e++)t[e]=-t[e],r[e]=-r[e],t[i-e]=-t[i-e],r[i-e]=-r[i-e];fft(t,r,!0),s=t}else s=a;const l=new Float32Array(t),c=new Float32Array(t);let u=1e-12;for(let p=0;p<t;p++){const e=o[p],t=s[p];l[p]=e,c[p]=t,Math.abs(e)>u&&(u=Math.abs(e)),Math.abs(t)>u&&(u=Math.abs(t))}const d=n.noisePeak/u,h=Math.max(1,Math.round(e*n.fadeSec));for(let p=0;p<t;p++){let e=1;if(p<h)e=.5*(1-Math.cos(Math.PI*p/h));else if(p>t-h){const r=t-1-p;e=.5*(1-Math.cos(Math.PI*r/h))}l[p]*=d*e,c[p]*=d*e}return{leftData:l,rightData:c}},fft=(e,t,r)=>{const n=e.length;for(let a=1,o=0;a<n;a++){let r=n>>1;for(;o&r;r>>=1)o^=r;if(o^=r,a<o){let r=e[a];e[a]=e[o],e[o]=r,r=t[a],t[a]=t[o],t[o]=r}}const i=r?1:-1;for(let a=2;a<=n;a<<=1){const r=a>>1,o=2*i*Math.PI/a,s=Math.cos(o),l=Math.sin(o);for(let i=0;i<n;i+=a){let n=1,a=0;for(let o=0;o<r;o++){const c=e[i+o],u=t[i+o],d=e[i+o+r]*n-t[i+o+r]*a,h=e[i+o+r]*a+t[i+o+r]*n;e[i+o]=c+d,t[i+o]=u+h,e[i+o+r]=c-d,t[i+o+r]=u-h;const p=n*l+a*s;n=n*s-a*l,a=p}}}if(r)for(let a=0;a<n;a++)e[a]/=n,t[a]/=n},drawTargetSequence=()=>{const e=[1,1,2,2,3,3];for(let t=e.length-1;t>0;t--){const r=Math.floor(random$1("audio")*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e},presentHeadphoneCheckUI=async(e,r,{paramReader:n,rc:i}={})=>{const a={retranslate:()=>{}},o=e=>{let t=!1;try{t="rtl"===(readi18nPhrases("EE_LanguageDirection",e)||"LTR").toString().toLowerCase()}catch{t=!1}l.style.direction=t?"rtl":"ltr",l.style.textAlign=t?"right":"left"},s=mountCompatibilityChrome({paramReader:n,rc:i,stepTitle:t("EE_headphoneCheckTitle",i?.language?.value||"en","Headphone check"),onLanguageChange:e=>{s.setStepTitle(t("EE_headphoneCheckTitle",e,"Headphone check")),o(e);try{a.retranslate()}catch(_e){}}}),l=document.createElement("div");l.id="headphone-check-wrapper",l.style.position="absolute",l.style.top=getCompatibilityBodyTopOffset(),l.style.left="20vw",l.style.right="20vw",l.style.minWidth="60vw",l.style.zIndex="10001",l.style.backgroundColor="#eee",l.style.padding="0",l.style.lineHeight="1.5",o(i?.language?.value||"en"),r.appendChild(l);const c=drawTargetSequence();try{await showIntroPage(l,e,{rc:i,pageState:a});const t=[];for(let r=0;r<c.length;r++){const n=c[r],o=buildThreeIntervalBuffer(e,n);publishPhaseEntered(SIM_PHASE.COMPATIBILITY),setEEState({currentFunction:`headphoneCheck ${r+1}/${c.length}`}),simulateActive&&(window.__simHeadphoneCheckTarget=n);const s=await runOneTrial(l,e,{trialIndex:r,numTrials:c.length,target:n,buffer:o,rc:i,pageState:a});t.push({trial:r+1,target:n,response:s,correct:s===n})}return t}finally{a.retranslate=()=>{},l.remove(),s.unmount()}},showIntroPage=(r,n,{rc:i,pageState:a}={})=>new Promise((o=>{r.innerHTML="";const s=document.createElement("div");r.appendChild(s);const l=document.createElement("div");l.style.display="flex",l.style.alignItems="center",l.style.gap="1rem",l.style.marginTop="1.5rem";const c=document.createElement("button");c.classList.add("btn","btn-success"),c.style.width="fit-content",c.style.padding="10px",c.style.minWidth="9rem",l.appendChild(c),r.appendChild(l);const u=()=>{const e=i?.language?.value||"en",r=t("EE_headphoneCheckIntro",e,"Detect a pure tone hidden in noise.\nThere are [[N11]] trials. In each trial, you will hear three one-second bursts of static noise. One burst contains a faint tone.\nChoose which sound—1, 2, or 3—contains the tone.\nYou may replay each trial as often as you like before answering.\nSet the volume to a comfortable level."),n=fillPhrase(r,{N11:HEADPHONE_CHECK_CONFIG.numTrials});s.innerHTML="",n.split("\n").map((e=>e.trim())).filter((e=>e.length>0)).forEach((e=>{const t=document.createElement("p");t.textContent=e,s.appendChild(t)})),c.textContent=t("EE_compatibilityPreviewRunButton",e,"Run tests")};u(),a&&(a.retranslate=u),c.addEventListener("click",(async()=>{try{await n.resume()}catch(e){}a&&(a.retranslate=()=>{}),o()}))})),runOneTrial=(r,n,{trialIndex:i,numTrials:a,buffer:o,rc:s,pageState:l})=>new Promise((c=>{r.innerHTML="";const u=document.createElement("p");r.appendChild(u);const d=document.createElement("button");d.classList.add("btn","btn-secondary"),d.style.width="fit-content",d.style.padding="10px",d.style.minWidth="9rem",d.style.marginTop="0.5rem",d.style.marginRight="0.75rem",d.style.transition="background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease",r.appendChild(d);const h=document.createElement("div");h.style.marginTop="1.5rem",h.style.display="flex",h.style.gap="0.75rem",r.appendChild(h);const p=[1,2,3].map((e=>{const t=document.createElement("button");return t.classList.add("btn","btn-outline-secondary"),t.style.width="5rem",t.style.padding="10px",t.style.fontSize="1rem",t.style.transition="background-color 0.15s ease, color 0.15s ease, outline 0.05s ease, opacity 0.15s ease",t.textContent=String(e),h.appendChild(t),t})),f=document.createElement("div");f.style.position="fixed",f.style.bottom="0",f.style.right="0.25rem",f.style.fontSize="26px",f.style.lineHeight="1",f.style.color="#000",f.style.zIndex="10002",r.appendChild(f);const m=e=>{d.disabled=e,p.forEach((t=>{t.disabled=e}))},g=()=>{const e=s?.language?.value||"en";u.textContent=t("EE_headphoneCheckTrialPrompt",e,"Listen carefully. Which of the three sounds contains the hidden tone?"),d.textContent=t("EE_headphoneCheckPlayAgain",e,"Play again"),f.textContent=fillPhrase(t("EE_headphoneCheckTrialNumber",e,"Trial [[N11]] of [[N22]]"),{N11:i+1,N22:a})};g(),l&&(l.retranslate=g);let _=!1,y=null,b=!1;const v=HEADPHONE_CHECK_CONFIG,S=1e3*v.intervalDurationSec,w=1e3*v.interStimulusIntervalSec,T=[],E=()=>{T.forEach(clearTimeout),T.length=0,p.forEach((e=>{e.style.outline="",e.style.backgroundColor="",e.style.color=""}))},x=async()=>{if(_||b)return;_=!0,m(!0),simulateActive&&setTimeout((()=>{if(_&&!b){_=!1;try{y?.stop()}catch{}y=null,E(),m(!1)}}),1e3*o.duration+1250);try{await n.resume()}catch(e){}const t=n.createBufferSource();t.buffer=o,t.connect(n.destination),y=t,(()=>{for(let e=0;e<3;e++){const t=e*(S+w);T.push(setTimeout((()=>{p.forEach(((t,r)=>{r===e?(t.style.outline="3px solid #4CAF50",t.style.backgroundColor="#e8f5e9"):(t.style.outline="",t.style.backgroundColor="")}))}),t)),T.push(setTimeout((()=>{p[e].style.outline="",p[e].style.backgroundColor=""}),t+S))}})(),t.onended=()=>{_=!1,y=null,E(),b||m(!1)},t.start()},A=t=>{if(b)return;if(t<1||t>3)return;b=!0,m(!0),E();const r=p[t-1];if(r.style.backgroundColor="#333",r.style.color="#fff",y)try{y.stop()}catch(e){}document.removeEventListener("keydown",C),l&&(l.retranslate=()=>{}),setTimeout((()=>{c(t)}),350)};d.addEventListener("click",(()=>{d.disabled||x()})),p.forEach(((e,t)=>{e.addEventListener("click",(()=>{e.disabled||A(t+1)}))}));const C=e=>{if(!b)if(" "===e.key||"Space"===e.code)e.preventDefault(),d.disabled||x();else if("1"===e.key||"2"===e.key||"3"===e.key){const t=Number(e.key);p[t-1].disabled||A(t)}};document.addEventListener("keydown",C),m(!0),setTimeout((()=>{b||x()}),500)})),renderHeadphoneCheckSummary=(e,t="en")=>e&&e.ran?buildHeadphoneCheckSummary(e.requirement,e.numCorrect,e.numTrials,e.detectedHeadphones,e.meetsRequirement,t):"",buildHeadphoneCheckSummary=(e,r,n,i,a,o="en")=>{const s=i?t("EE_headphoneCheckHeadphones",o,"headphones"):t("EE_headphoneCheckLoudspeakersOrUnclear",o,"loudspeakers or unclear"),l="headphone"===e?t("EE_headphoneCheckHeadphones",o,"headphones"):t("EE_headphoneCheckLoudspeakers",o,"loudspeakers"),c=a?t("EE_headphoneCheckSummaryPass",o,"✅ Headphone check passed: [[N11]]/[[N22]] correct. Detected [[DDD]] (required: [[RRR]]).\n"):t("EE_headphoneCheckSummaryFail",o,"❌ Headphone check failed: [[N11]]/[[N22]] correct. Detected [[DDD]] (required: [[RRR]]).");return fillPhrase(c,{N11:r,N22:n,DDD:s,RRR:l})},PREVIEW_PAGE_ID="compatibility-preview-page",buildTestPlan=e=>{const t=[];return willCalibrateDistance(e)&&t.push({id:"chooseCamera",labelKey:"EE_compatibilityTestChooseCamera"}),_needSoundOutput.current=e.read("_needSoundOutput")?.[0]||"headphone",neededSoundOutputKinds(e).length>0&&t.push({id:"soundOutput",labelKey:"RC_SoundOutput"}),headphoneCheckIsNeeded(_needSoundOutput.current)&&t.push({id:"headphoneCheck",labelKey:"headphone"===_needSoundOutput.current?"EE_compatibilityTestHeadphoneCheckHeadphone":"EE_compatibilityTestHeadphoneCheckLoudspeaker"}),t},showCompatibilityPreviewPage=({paramReader:e,rc:t,testPlan:r,knownFacts:n})=>new Promise((i=>{const a=mountCompatibilityChrome({paramReader:e,rc:t,showEyebrow:!1,stepTitle:tryReadPhrase$1("EE_compatibilityTitle1of2",t?.language?.value||"en")||tryReadPhrase$1("EE_compatibilityTitle",t?.language?.value||"en")||"",onLanguageChange:e=>{a.setStepTitle(tryReadPhrase$1("EE_compatibilityTitle1of2",e)||tryReadPhrase$1("EE_compatibilityTitle",e)||""),_()}}),o=document.createElement("div");o.id=PREVIEW_PAGE_ID,o.style.display="flex",o.style.flexDirection="column",o.style.position="absolute",o.style.top=getCompatibilityBodyTopOffset(),o.style.right="20vw",o.style.left="20vw",o.style.minWidth="60vw",o.style.zIndex="10001",o.style.backgroundColor="#eee",o.style.lineHeight="1.5";const s=document.createElement("h2");s.style.margin="0 0 0.5rem 0",s.style.fontSize="1.5rem",s.style.fontWeight="500",s.style.lineHeight="1.4";const l=document.createElement("ul");l.style.listStyle="none",l.style.padding="0",l.style.margin="0 0 1.5rem 0",l.style.fontSize=COMPAT_LIST_FONT_SIZE,l.style.lineHeight=COMPAT_LIST_LINE_HEIGHT;const c=document.createElement("ol");c.style.listStyle="none",c.style.padding="0",c.style.margin="0px 0px 0.8rem",c.style.fontSize=COMPAT_LIST_FONT_SIZE,c.style.lineHeight=COMPAT_LIST_LINE_HEIGHT;const u=resolvePaperRulerAlert(e),d=document.createElement("p");d.style.fontStyle="italic",d.style.opacity="0.85",d.style.margin="0 0 0 0";const h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.gap="1rem",h.style.margin="0 0 0.75rem 0";const p=document.createElement("button");p.classList.add("btn","btn-success"),p.style.width="fit-content",p.style.padding="10px",p.style.minWidth="9rem",p.style.fontWeight="bold",p.style.fontSize="1.3rem",h.appendChild(p);const f=document.createElement("div");f.id="prolific-policy-preview",f.style.fontSize="0.9rem",f.style.position="fixed",f.style.bottom="3rem",f.style.maxWidth="57ch",f.style.zIndex="10001";const m=document.createElement("p");m.id="prolific-rule-preview",m.style.marginBottom="2px",f.appendChild(m);const g=document.createElement("p");g.innerHTML="https://researcher-help.prolific.com/en/article/4ae222",g.style.pointerEvents="none",g.style.marginBottom="0",f.appendChild(g),o.appendChild(s),o.appendChild(l),o.appendChild(h),o.appendChild(c),o.appendChild(d),o.appendChild(f);const _=()=>{const i=t.language.value,a=isLanguageRTL(i);o.style.direction=a?"rtl":"ltr",o.style.textAlign=a?"right":"left";const h=r.length>0;c.innerHTML="";const g=e=>{if(!e)return;const t=document.createElement("li");styleCompatListItemGrid(t);const r=document.createElement("span");r.textContent=`${c.childElementCount+1}.`,r.style.textAlign="start";const n=document.createElement("span");n.innerHTML=e,neutralizeEnlargedInlineIcons(n),t.appendChild(r),t.appendChild(n),c.appendChild(t)},_=()=>{if(willCalibrateScreenSize(e)&&g(renderMarkdown(tryReadPhrase$1("EE_compatibilityNeedCreditCard",i)||"")),u){const e=tryReadPhrase$1(u.phraseKey,i)||"";g(renderPhraseHTML(fillPhrase(e,u.params)))}};r.some((e=>"chooseCamera"===e.id))||_(),r.forEach((e=>{g(renderMarkdown(tryReadPhrase$1(e.labelKey,i)||e.labelKey)),"chooseCamera"===e.id&&_()})),c.style.display=c.childElementCount>0?"":"none";const y=n.some((e=>!e.ok));s.innerHTML=renderMarkdown(tryReadPhrase$1("EE_compatibilityPreviewKnownTitle",i)||""),l.innerHTML=buildKnownFactsList(n,i).innerHTML,y?(d.style.display="",d.innerHTML=renderMarkdown(tryReadPhrase$1("EE_compatibilityPreviewNoteHasIssues",i)||"")):(d.style.display="none",d.innerHTML=""),f.style.textAlign=a?"right":"left",f.style.direction=a?"rtl":"ltr",a?(f.style.right="3rem",f.style.left=""):(f.style.left="3rem",f.style.right=""),m.innerHTML=renderMarkdown(tryReadPhrase$1("EE_ProlificCompatibilityRule",i)||""),p.textContent=h?tryReadPhrase$1("EE_compatibilityPreviewRunButton",i)||"":tryReadPhrase$1("T_proceed",i)||""};_(),document.body.prepend(o),p.focus({preventScroll:!0});let y=!1;const b=()=>{y||(y=!0,p.removeEventListener("click",b),document.removeEventListener("keydown",v,!0),o.remove(),a.unmount(),i())},v=e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),b())};p.addEventListener("click",b),document.addEventListener("keydown",v,!0)})),runCameraSelectionStep=async({paramReader:e,rc:t,keypad:r})=>{const n=formCalibrationList(e).find((e=>"trackDistance"===("string"==typeof e?e:e.name)));if(!n||"function"!=typeof t.selectCamera)return;const i="object"==typeof n&&n.options||{};t.keypadHandler.keypad=r.handler;const a=createCameraPageLanguageMenu(e,t);try{await t.selectCamera(i)}finally{a?.remove()}},runHeadphoneCheckStep=async({paramReader:t,rc:r,psychoJS:n})=>{if(!headphoneCheckIsNeeded(_needSoundOutput.current))return null;try{const e=await runHeadphoneCheck({requirement:_needSoundOutput.current,paramReader:t,rc:r});return n&&(n.experiment.addData("HeadphoneCheck",JSON.stringify(e)),n.experiment.nextEntry()),e}catch(e){return console.error("Headphone check failed to run:",e),null}},runFinalCompatibilityReportStep=async({paramReader:e,rc:t,psychoJS:r,measureMeters:n,headphoneCheckResult:i,keypad:a,KeypadHandler:o,_key_resp_event_handlers:s,_key_resp_allKeys:l,ConnectionManager:c,ConnectionManagerDisplay:u,getConnectionManagerDisplay:d,handleLanguageChangeForConnectionManagerDisplay:h,keypadRequiredInExperiment:p,needPhoneSurveyRef:f,needComputerSurveyBoolRef:m,EasyEyesPeer:g,quitPsychoJS:_})=>{const y=!(!i||!i.ran),b=!y||i.meetsRequirement,v=await checkSystemCompatibility(e,t.language.value,t,!0,r,n,e.read("_needBrowserActualName")[0],b),S=y?e=>{const t=renderHeadphoneCheckSummary(i,e);return t?"\n\n"+t:""}:null,w=!1,T=(e.read("_needCalibratedSound")?.[0]||"").split(",");let E=null;if(f.current){const n={text:readi18nPhrases("RC_smartphoneOkThanks",t.language.value),onError:()=>{Swal.fire({allowOutsideClick:!1,html:renderPhraseHTML(readi18nPhrases("RC_cantDrawQR",t.language.value)),icon:"error",confirmButtonText:readi18nPhrases("RC_cantConnectPhone_Button",t.language.value)}).then((async n=>{if(!n.isConfirmed)return;const{mic:i,loudspeaker:a}=await handleCantReadQROnError(t,r,f.current,T,m.current);f.current&&(r.experiment.addData("Microphone survey",JSON.stringify(i.phoneSurvey)),r.experiment.nextEntry()),m.current&&(r.experiment.addData("Loudspeaker survey",JSON.stringify(a)),r.experiment.nextEntry()),showExperimentEnding(),_("",!0,e)}))}};E=new g.ExperimentPeer(n),await E.init()}return await displayCompatibilityMessage(v.notes,e,t,v.promptRefresh,v.proceed,E,w,!1,m.current,T,r,_,a,o,s,l,c.handler,u,d,h,p,S,b)},runDeviceCompatibilityFlow=async({paramReader:e,rc:t,psychoJS:r,measureMeters:n,keypad:i,KeypadHandler:a,_key_resp_event_handlers:o,_key_resp_allKeys:s,ConnectionManager:l,ConnectionManagerDisplay:c,getConnectionManagerDisplay:u,handleLanguageChangeForConnectionManagerDisplay:d,keypadRequiredInExperiment:h,needPhoneSurveyRef:p,needComputerSurveyBoolRef:f,EasyEyesPeer:m,quitPsychoJS:g})=>{const _=buildTestPlan(e),y=summarizeKnownDeviceFacts(e,t);if(await showCompatibilityPreviewPage({paramReader:e,rc:t,testPlan:_,knownFacts:y}),_.some((e=>"chooseCamera"===e.id))&&(status.currentFunction="compatChooseCamera",await runCameraSelectionStep({paramReader:e,rc:t,keypad:i})),_.some((e=>"soundOutput"===e.id))){status.currentFunction="compatSoundOutput";if(!(await runSoundOutputSelectionStep({paramReader:e,rc:t})))return{proceedButtonClicked:!0,proceedBool:!1,mic:{},loudspeaker:{},gotLoudspeakerMatchBool:!1}}const b=_.some((e=>"headphoneCheck"===e.id))?(status.currentFunction="compatHeadphoneCheck",await runHeadphoneCheckStep({paramReader:e,rc:t,psychoJS:r})):null,v=await runFinalCompatibilityReportStep({paramReader:e,rc:t,psychoJS:r,measureMeters:n,headphoneCheckResult:b,keypad:i,KeypadHandler:a,_key_resp_event_handlers:o,_key_resp_allKeys:s,ConnectionManager:l,ConnectionManagerDisplay:c,getConnectionManagerDisplay:u,handleLanguageChangeForConnectionManagerDisplay:d,keypadRequiredInExperiment:h,needPhoneSurveyRef:p,needComputerSurveyBoolRef:f,EasyEyesPeer:m,quitPsychoJS:g});return v.proceedBool&&(await runSoundOutputBlock0Page({paramReader:e,rc:t}),startSoundOutputReconnectWatch({paramReader:e,rc:t,quitPsychoJS:g})),v};class VernierStim{constructor(){this.color,this.lineWidth=2,this.targetDurationSec,this.targetGapDeg,this.targetLengthDeg,this.targetOffsetDeg,this.targetThicknessDeg,this.directionBool,this.nominalPosPx,this._pos,this.markingFixationMotionRadiusDeg,this.markingFixationMotionSpeedDegPerSec,this._ctx=createDisposableCanvas(1/0),this.stims=[new ShapeStim({name:"upper line",win:psychoJS.window,lineWidth:this.lineWidth,closeShape:!1,lineColor:new Color$1("black"),opacity:void 0,depth:1/0,vertices:[[190,10],[190,50]],units:"pix"}),new ShapeStim({name:"lower line",win:psychoJS.window,lineWidth:2,closeShape:!1,lineColor:new Color$1("black"),opacity:void 0,depth:1/0,vertices:[[210,-10],[210,-50]],units:"pix"})]}setAutoDraw(e){this.stims.forEach((t=>t.setAutoDraw(e)))}setLineWidth(e){this.stims.forEach((t=>t.setLineWidth(e)))}update(e,t,r){this.directionBool=random$1("stimuli")>.5,this.setColor(colorRGBASnippetToRGBA(e.read("targetColorRGBA",t))),this.targetDurationSec=e.read("targetDurationSec",t),this.targetGapDeg=e.read("targetGapDeg",t),this.targetLengthDeg=e.read("targetLengthDeg",t),this.targetThicknessDeg=e.read("targetThicknessDeg",t),this.markingFixationMotionRadiusDeg=e.read("markingFixationMotionRadiusDeg",t),this.markingFixationMotionSpeedDegPerSec=e.read("markingFixationMotionSpeedDegPerSec",t),this.nominalPosPx=XYPxOfDeg(0,[e.read("targetEccentricityXDeg",t),e.read("targetEccentricityYDeg",t)]),this._pos=this.nominalPosPx,this.targetOffsetDeg=this.restrictOffsetDeg(r),this.setVertices(this.getVerticesPx(this.targetOffsetDeg)),this.setLineWidth(Math.abs(XYPxOfDeg(0,[this.targetThicknessDeg,0])[0]))}restrictOffsetDeg(e){const t=[-Screens[0].window._size[0]/2,-Screens[0].window._size[1]/2],r=[Screens[0].window._size[0]/2,Screens[0].window._size[1]/2];let n=new Rectangle(t,r),i=e;for(;!isRectInRect(this.getStimulusRect(i),n)&&i>1e-6;)console.count("Decreasing targetOffsetDeg"),i*=.9;return i}getStimulusRect(e){const[t,r]=this.getVerticesPx(e),n=[t[0][0],t[1][0],r[0][0],r[1][0]],i=[t[0][1],t[1][1],r[0][1],r[1][1]],a=[Math.min(...n),Math.min(...i)];let o=new Rectangle(a,[Math.max(...n),Math.max(...i)]);const s=[targetEccentricityDeg.x,targetEccentricityDeg.y],l=this.markingFixationMotionRadiusDeg>0&&this.markingFixationMotionSpeedDegPerSec>0?[degreesToPixels(this.markingFixationMotionRadiusDeg,s,"horizontal"),degreesToPixels(this.markingFixationMotionRadiusDeg,s,"vertical")]:[0,0];return o=o.inset(-l[0],-l[1]),o}setPos(e){const t=this.stims.map((e=>e.getVertices())).map((e=>e.map((e=>[e[0]-this.nominalPosPx[0],e[1]-this.nominalPosPx[1]])))),r=t.map((t=>t.map((t=>[t[0]+e[0],t[1]+e[1]]))));this.nominalPosPx=e,this._pos=this.nominalPosPx,this.setVertices(r)}setVertices(e){this.stims[0].setVertices(e[0]),this.stims[1].setVertices(e[1])}setColor(e){this.color=new Color$1(e),this.stims.forEach((e=>e.setLineColor(this.color)))}getVerticesDeg(e){const t=e/2,r=this.targetGapDeg/2,n=targetEccentricityDeg.x,i=targetEccentricityDeg.y;return this.directionBool?[[[n-t,i+r+this.targetLengthDeg],[n-t,i+r]],[[n+t,i-r],[n+t,i-r-this.targetLengthDeg]]]:[[[n-t,i-r],[n-t,i-r-this.targetLengthDeg]],[[n+t,i+r+this.targetLengthDeg],[n+t,i+r]]]}getVerticesPx(e){const t=[],r=this.getVerticesDeg(e);for(const[n,i]of r.entries()){t[n]=[];for(const[e,r]of i.entries())t[n][e]=XYPxOfDeg(0,r)}return t}getLowerLineVertices(e){const t=this.directionBool?e:-e,r=targetEccentricityDeg.x+t,n=targetEccentricityDeg.y-this.targetGapDeg/2;return[XYPxOfDeg(0,[r,n]),XYPxOfDeg(0,[r,n+this.targetLengthDeg])]}getUpperLineVertices(e){const t=this.directionBool?-e:e,r=targetEccentricityDeg.x+t,n=targetEccentricityDeg.y+this.targetGapDeg/2;return[XYPxOfDeg(0,[r,n]),XYPxOfDeg(0,[r,n+this.targetLengthDeg])]}_updateIfNeeded(){this.stims.forEach((e=>e._updateIfNeeded()))}get status(){return this.stims[0].status}get tStart(){return this.stims[0].tStart}get frameNStart(){return this.stims[0].frameNStart}set status(e){this.stims.forEach((t=>t.status=e))}set tStart(e){this.stims.forEach((t=>t.tStart=e))}set frameNStart(e){this.stims.forEach((t=>t.frameNStart=e))}}const downloadTextFile=(e,t)=>{const r=document.createElement("a");r.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),r.setAttribute("download",e),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)},saveParticipantIdFile=async(e,t)=>{if(!e)return;const r=`EasyEyes_${t}_${e}.txt`,n=`Please keep this file to facilitate participation in future sessions. When an experiment has several sessions, you can use this file to connect them, while retaining your anonymity.
|
|
271
|
+
${e}: ${n}${i}`;showConditionNameConfig.targetSpecs?showConditionNameConfig.targetSpecs+=a:showConditionNameConfig.targetSpecs=`${e}: ${n}${i}`};function getTrialInfoStr(e,t,r,n,i,a,o,s,l){let c="";if(t)if(n&&i){c=replacePlaceholders(readi18nPhrases("reading"===l?"T_counterReadingPageBlock":"T_counterTrialBlock",e),n,i,a,o)}else c=replacePlaceholders(readi18nPhrases("T_counterBlock",e),a,o);return r&&(viewingDistanceCm.current=rc.viewingDistanceCm?rc.viewingDistanceCm.value:viewingDistanceCm.desired,Screens[0].viewingDistanceCm=viewingDistanceCm.current,updateNearestPointFromRc(0,rc),c+=" "+replacePlaceholders(readi18nPhrases("T_counterCm",e),viewingDistanceCm.current?.toFixed(1)||viewingDistanceCm.current)),c}let lastUpdateMs=-1/0;const periodMs=500,resetTrialCounterThrottle=()=>{lastUpdateMs=-1/0},liveUpdateTrialCounter=(e,t,r,n,i,a,o,s,l,c)=>{const u=performance.now();u-lastUpdateMs>=periodMs&&(lastUpdateMs=u,c.setText(getTrialInfoStr(e,t,r,n,i,a,o,s,l)))},incrementTrialCompletedThisBlock=e=>{status.trialCompleted_thisBlock++,status.nthTrialCompletedThisBlockByCondition.set(e,status.nthTrialCompletedThisBlockByCondition.get(e)+1)},incrementTrialCorrectThisBlock=e=>{status.trialCorrect_thisBlock++,status.nthTrialCorrectThisBlockByCondition.set(e,status.nthTrialCorrectThisBlockByCondition.get(e)+1)},incrementTrialsAttempted=e=>{const t=status.nthTrialAttemptedByCondition.get(e);status.nthTrialAttemptedByCondition.set(e,t+1)},incrementTrialsCompleted=(e,t)=>{const r=status.nthTrialByCondition.get(e);status.nthTrialByCondition.set(e,r+1),["rsvpReading","repeatedLetters","image"].includes(t.read("targetKind",e))||incrementTrialCompletedThisBlock(e)},ptMultiplier=24,inMultiplier=.2,fat=5,thin=1;class Grid{constructor(e,t,r){this.units=e||"none",this.displayOptions=t,this.psychoJS=r,this.visible=!1,this.allGrids={},this.lines=[],this.labels=[],this.opacity=.9,this.dimensions=this.psychoJS.window._size,this.gridkey={key:["`","~"],code:"Backquote",keyCode:192},this.spawnGridStims(),window.onkeydown=e=>{(e.code===this.gridkey.code||this.gridkey.key.includes(e.key))&&(this.cycle(),r&&r.experiment&&r.experiment.addData("cycledGridTo",this.units),e.stopPropagation())},this._reflectVisibility()}update(e=void 0,t=void 0){if(e&&(this.units=e),t&&(this.displayOptions=t),"disabled"===this.units)return this.visible=!1,void this._undraw();this.visible=!0,this._undraw(),this.spawnGridStims(),[this.lines,this.labels]=this.allGrids[this.units],this._reflectVisibility()}show(){this.visible=!0,this._draw()}hide(){this.visible=!1,this._undraw()}cycle(){this._undraw(),this.units=this._cycleUnits(this.units),grid.units=this.units,this.spawnGridStims(this.units),[this.lines,this.labels]=this.allGrids[this.units],this._reflectVisibility()}spawnGridStims(e=void 0){if(e)this.allGrids[e]=this._getGridStims(e);else for(const t of["px","pt","cm","in","deg","degDynamic","mmV4","none","disabled"])this.allGrids[t]=this._getGridStims(t)}_undraw(){[...this.lines,...this.labels].forEach((e=>{e&&e.setAutoDraw(!1)}))}_draw(){[...this.lines,...this.labels].forEach((e=>{e&&e.setAutoDraw(!0)}))}_reflectVisibility(){this.visible?this._draw():this._undraw()}_getGridStims(e){switch(e){case"px":return this._getPixelGridStims();case"pt":return this._getPointGridStims();case"cm":return this._getCmGridStims();case"in":return this._getInchGridStims();case"deg":return this._getDegGridStims(!1);case"degDynamic":return this._getDegGridStims(!0);case"mmV4":return this._getMmGridStims();case"none":case"disabled":return[[],[]]}}_getNumberOfGridLines=(e,t=!1)=>{this.dimensionsCm=this.dimensions.map((e=>e/this.displayOptions.pxPerCm)),this.dimensionsIn=this.dimensionsCm.map((e=>e/2.54)),this.dimensionsPt=this.dimensionsIn.map((e=>72*e));const[r,n]=this.dimensions;switch(t?Screens[0].fixationConfig.pos:Screens[0].fixationConfig.nominalPos,this.dimensionsDeg=[[XYDegOfPx(0,[r,0],t)[0],XYDegOfPx(0,[-r,0],t)[0]],[XYDegOfPx(0,[0,-n],t)[1],XYDegOfPx(0,[0,n],t)[1]]],e){case"px":return this.dimensions.map((e=>Math.floor(e/100)+1));case"pt":return this.dimensionsPt.map((e=>(Math.floor(e)+1)/ptMultiplier));case"in":return this.dimensionsIn.map((e=>(Math.floor(e)+1)/inMultiplier));case"cm":return this.dimensionsCm.map((e=>Math.floor(e)+1));case"deg":return this.dimensionsDeg.map((e=>e.map((e=>Math.ceil(Math.abs(e))+1))))}};_cycleUnits(e){switch(e){case"none":return"px";case"px":return"cm";case"cm":return"pt";case"pt":return"in";case"in":return"deg";case"deg":return"degDynamic";case"degDynamic":return"mmV4";case"mmV4":return"none";case"disabled":return"disabled"}return"none"}_getPixelGridStims=()=>{const e=100,t=[-Math.round(this.dimensions[0]/2),-Math.round(this.dimensions[1]/2)],r=this._getNumberOfGridLines("px"),[n,i]=[[],[]];for(const a of["vertical","horizontal"]){const o="vertical"===a?r[0]:r[1];for(let r=0;r<o;r++){const o="vertical"===a?[[+(t[0]+r*e),+Math.round(this.dimensions[1]/2)],[+(t[0]+r*e),-Math.round(this.dimensions[1]/2)]]:[[+Math.round(this.dimensions[0]/2),+(t[1]+r*e)],[-Math.round(this.dimensions[0]/2),+(t[1]+r*e)]],s="vertical"===a?[t[0]+r*e+3,t[1]]:[t[0]+3,t[1]+r*e],l=`${a}-grid-line-${r}`;n.push(new ShapeStim({name:l,win:this.psychoJS.window,units:"pix",lineWidth:r%5==0?fat:thin,lineColor:new Color$1(getColor("px")),fillColor:null,opacity:this.opacity,vertices:o,depth:-999999,ori:0,interpolate:!1,size:1,autoLog:!1})),r%5==0&&i.push(new TextStim({name:`${a}-grid-line-label-${r}`,win:this.psychoJS.window,text:e*r+" px",font:"Arial",units:"pix",pos:s,alignHoriz:"left",alignVert:"bottom",height:8,ori:0,color:new Color$1(getColor("px")),opacity:1,depth:0,autoLog:!1}))}}return[n,i]};_getFixedSpacingGrid=(e,t)=>{const r=[-Math.round(this.dimensions[0]/2),-Math.round(this.dimensions[1]/2)],n=this._getNumberOfGridLines(t),i=getColor(t),[a,o]=[[],[]];for(const s of["vertical","horizontal"]){const l="vertical"===s?n[0]:n[1];for(let n=0;n<l;n++){const l="vertical"===s?[[+(r[0]+n*e),+Math.round(this.dimensions[1]/2)],[+(r[0]+n*e),-Math.round(this.dimensions[1]/2)]]:[[+Math.round(this.dimensions[0]/2),+(r[1]+n*e)],[-Math.round(this.dimensions[0]/2),+(r[1]+n*e)]],c="vertical"===s?[r[0]+n*e+3,r[1]]:[r[0]+3,r[1]+n*e],u="pt"===t?3:5;a.push(new ShapeStim({name:`${s}-grid-line-${t}-${n}`,win:this.psychoJS.window,units:"pix",lineWidth:n%u==0?fat:thin,lineColor:new Color$1(i),fillColor:null,opacity:this.opacity,vertices:l,depth:-999999,ori:0,interpolate:!1,size:1,autoLog:!1}));const d=["in","pt"].includes(t)?"in"===t?inMultiplier:ptMultiplier:1;n%u==0&&o.push(new TextStim({name:`${s}-${t}-grid-line-label-${n}`,win:this.psychoJS.window,text:`${n*d} ${t}`,font:"Arial",units:"pix",alignHoriz:"left",alignVert:"bottom",pos:c,height:8,ori:0,color:new Color$1(i),opacity:1,depth:0,autoLog:!1}))}}return[a,o]};_getCmGridStims=()=>this._getFixedSpacingGrid(this.displayOptions.pxPerCm,"cm");_getInchGridStims=()=>this._getFixedSpacingGrid(2.54*this.displayOptions.pxPerCm/5,"in");_getPointGridStims=()=>this._getFixedSpacingGrid(2.54*this.displayOptions.pxPerCm/72*ptMultiplier,"pt");_getDegGridStims=(e=!1)=>{const t=this._getNumberOfGridLines("deg",e),[r,n]=[[],[]],i=getColor(e?"degDynamic":"deg");for(const a of["right","left","upper","lower"]){let o;switch(a){case"left":o=t[0][1];break;case"right":o=t[0][0];break;case"upper":o=t[1][1];break;case"lower":o=t[1][0]}for(let t=0;t<o;t++){if(["left","lower"].includes(a)&&0===t)continue;let[o,s]=this._getDegGridPathVertices(t,a,e);if(r.push(new ShapeStim({name:`${a}-grid-line${e?"-dynamic":""}-${t}`,win:this.psychoJS.window,units:"pix",lineWidth:t%5==0?fat:thin,lineColor:new Color$1(i),fillColor:null,closeShape:!1,opacity:this.opacity,vertices:o,depth:-999999,ori:0,interpolate:!1,size:1,autoLog:!1})),t%5==0){const r=e?"deg\ndynamic":"deg";n.push(new TextStim({name:`${a}-grid-line-label${e?"-dynamic":""}-${t}`,win:this.psychoJS.window,text:`${t} ${r}`,font:"Arial",units:"pix",pos:s,height:Math.min(Math.round(degreesToPixels(.25,[0,0],"horizontal")),12),alignHoriz:"left",alignVert:"bottom",ori:0,color:new Color$1(i),opacity:1,depth:0,autoLog:!1}))}}}return[r,n]};_getDegGridPathVertices=(e,t,r=!1)=>{const n=[];let i=[];const a={left:-this.dimensions[0]/2,right:this.dimensions[0]/2,top:this.dimensions[1]/2,bottom:-this.dimensions[1]/2};let o=!0,s=0;for(;o;){let i,l;switch(t){case"left":i=XYPxOfDeg(0,[-e,s],r),l=XYPxOfDeg(0,[-e,-s],r);break;case"right":i=XYPxOfDeg(0,[e,s],r),l=XYPxOfDeg(0,[e,-s],r);break;case"upper":i=XYPxOfDeg(0,[s,e],r),l=XYPxOfDeg(0,[-s,e],r);break;case"lower":i=XYPxOfDeg(0,[s,-e],r),l=XYPxOfDeg(0,[-s,-e],r)}o=isInRect(...i,a)||isInRect(...l,a),o&&(s+=.1),n.unshift(l),n.push(i)}return i=["left","right"].includes(t)?[n[Math.floor(n.length/2)][0],a.bottom+5]:[a.left+5,n[Math.floor(n.length/2)][1]],[n,i]};_getMmGridStims=()=>{const e=Screens[0].fixationConfig.pos,t=this.dimensions[1]/2,r=-this.dimensions[1]/2,n=-this.dimensions[0]/2,i=this.dimensions[0]/2,a={top:e[1],bottom:e[1],left:e[0],right:e[0]};let o=a.top<t||a.bottom>r||a.right<i||a.left>n;const[s,l]=[[],[]];let c=0;for(;o;){const e=c%5==0,u=.15*Math.pow(10,c/38)-.15,d=XYPxOfDeg(0,[u,0])[0]-Screens[0].fixationConfig.pos[0];if(d<50)c+=1;else{if(s.push(new Polygon({win:this.psychoJS.window,name:`mmV4-grid-circle-${c}`,units:"pix",edges:360,radius:d,ori:0,size:1,pos:Screens[0].fixationConfig.pos,lineWidth:e?fat:thin,lineColor:new Color$1(getColor("mmV4")),fillColor:null,opacity:this.opacity,depth:-999999,interpolate:!0,autoLog:!1})),e){const e=Screens[0].fixationConfig.pos[0]<0?1:-1,t=XYPxOfDeg(0,[e*u,0]);l.push(new TextStim({name:`mmV4-grid-label-${c}`,win:this.psychoJS.window,text:`${c} mmV4`,font:"Arial",units:"pix",alignHoriz:"center",pos:t,height:8,ori:0,color:new Color$1(getColor("mm")),opacity:1,depth:0,autoLog:!1}))}c+=1,a.top=XYPxOfDeg(0,[0,u])[1],a.bottom=XYPxOfDeg(0,[[0,-u]])[1],a.left=XYPxOfDeg(0,[-u,0])[0],a.right=XYPxOfDeg(0,[u,0])[0],o=a.top<t||a.bottom>r||a.right<i||a.left>n}}return[s,l]}}const getColor=e=>{switch(e){case"px":return"#91014e";case"cm":return"#910187";case"in":return"#310191";case"pt":return"#01910b";case"deg":return"#007056";case"degDynamic":return"#873100";case"mmV4":return"#3b0066"}},ALLOWLIST=new Set(["text","autoDraw","pos","size","font","color","contrast","opacity","alignHoriz","alignVert","height","letterHeight","wrapWidth","flipHoriz"]);function serializeStimValue(e){if(null==e)return"";if("string"==typeof e)return e;if("number"==typeof e)return Number.isNaN(e)?"NaN":Number.isFinite(e)?String(e):e>0?"Infinity":"-Infinity";if("boolean"==typeof e)return e?"true":"false";if(Array.isArray(e))try{return e.map((e=>serializeStimValue(e))).join(",")}catch{return"[unserializable]"}try{return JSON.stringify(e)}catch{return"[unserializable]"}}function cap(e){return e.charAt(0).toUpperCase()+e.slice(1)}function stimChangeToStateUpdate(e,t,r){if(!ALLOWLIST.has(t))return null;const n=String(e??"").replace(/[^a-zA-Z0-9]/g,"");if(!n)return null;const i="stim"+cap(n)+cap(t);return{[i]:serializeStimValue(r)}}function stimChangeReporter(e,t){const r=stimChangeToStateUpdate(this._name,e,t);if(!r)return;setEEState(r);const n=serializeStimValue(t);console.debug(`[sim:stim] ${this._name}.${e} = ${JSON.stringify(n)}`)}function enableInstrumentation(e){const t=e.prototype;if(t._setAttribute?.__eeSimWrapped)return;const r=t._setAttribute,n=function(e,t,n,i,a){const o=r.call(this,e,t,n,i,a);return o&&this._reportChange?.(e,t),o};Object.defineProperty(n,"__eeSimWrapped",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t._setAttribute=n,t._reportChange=stimChangeReporter}function formatParamRead(e,t,r,n){return`[sim:read] ${e}[${"string"==typeof t?`"${t}"`:String(t)}] = ${serializeReadValue(r)}${n?` (${n})`:""}`}function serializeReadValue(e){return void 0===e?"undefined":Array.isArray(e)?`[${e.join(",")}]`:"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?String(e):JSON.stringify(e)}const INSTALLED$1=new WeakSet;function installParamReaderReporter(e){if(INSTALLED$1.has(e.prototype))return;INSTALLED$1.add(e.prototype);let t="";const r=e.prototype.read;e.prototype.read=function(...e){const n=String(e[0]??""),i=e[1];let a;if("function"==typeof this.has)try{a=this.has(n)?"csv":"glossary"}catch{a="unknown"}else a="unknown";try{const o=r.apply(this,e),s=`${n}|${i}|${a}`;return s!==t&&(t=s,console.debug(formatParamRead(n,i,o,a))),o}catch(err){const t=err instanceof Error?err.message:String(err);throw console.debug(`[sim:read] ${n}[${"string"==typeof i?`"${i}"`:String(i)}] = ERROR: ${t} (${a})`),err}}}function formatError(e){return`[sim:error] ${e.replace(/\s+/g," ").trim()}`}let INSTALLED=!1;function installErrorReporter(){INSTALLED||(INSTALLED=!0,window.addEventListener("error",(e=>{const t=e.message||String(e.error||e);console.debug(formatError(t)),publishErrorReported(t)})),window.addEventListener("unhandledrejection",(e=>{const t=e.reason,r=t instanceof Error?t.message:String(t);console.debug(formatError(`Unhandled rejection: ${r}`)),publishErrorReported(`Unhandled rejection: ${r}`)})))}let installed=!1;function patchSwalInstance(e){if(!e||e.__simPatched)return;Object.defineProperty(e,"__simPatched",{value:!0,enumerable:!1});const t=e.fire;e.fire=function(...r){const n="string"==typeof r[0]?r[0]:r[0]?.title??"",i=++dialogSeq;publishDialogOpened("swal",n,`Swal: ${n}`);const a=t.apply(e,r);return Promise.resolve(a).then((()=>{i===dialogSeq&&publishDialogClosed()}),(()=>{})),a};const r=e.close;e.close=function(){return dialogSeq++,publishDialogClosed(),r.apply(e)}}let dialogSeq=0;function installDialogReporter(){if(installed)return;installed=!0,patchSwalInstance(Swal);const e=()=>{const r=window.Swal;r?patchSwalInstance(r):Date.now()-t<1e4&&setTimeout(e,100)},t=Date.now();e()}function formatDispatch(e,t){return`[sim:dispatch] ${e}="${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function logDispatch(e,t){console.debug(formatDispatch(e,t))}let eeLastSeq=0,eeProjection={};function readEEState(){const e=window.__eeEvents;if(e)for(;eeLastSeq<e.length;eeLastSeq++){const t=e[eeLastSeq];"telemetry"!==t.ch&&(eeProjection=applyEvent(eeProjection,t.e))}const t=eeProjection,r=e=>void 0===e?null:String(e);return{phase:t.phase??null,trial:r(t.trial),trialTotal:r(t.trialTotal),block:r(t.block),responseTyped:!0===t.responseTyped,validCharsTyped:t.validCharsTyped??"",responseClicked:!0===t.responseClicked,validCharsClicked:t.validCharsClicked??"",keypadUrl:null,dialogOpen:void 0===t.dialogOpen?null:t.dialogOpen,dialogs:r(t.dialogs),correctResponse:r(t.correctResponse),simulationModel:r(t.simulationModel),trialLevel:r(t.trialLevel),simulationThreshold:r(t.simulationThreshold),simulationBeta:r(t.simulationBeta),simulationDelta:r(t.simulationDelta),thresholdProportionCorrect:r(t.thresholdProportionCorrect),error:r(t.error),recalibrations:r(t.recalibrations),targetTask:r(t.targetTask)}}const KEY_NAME_MAP={space:{key:" ",code:"Space",keyCode:32},Space:{key:" ",code:"Space",keyCode:32},ArrowLeft:{key:"ArrowLeft",code:"ArrowLeft",keyCode:37},ArrowRight:{key:"ArrowRight",code:"ArrowRight",keyCode:39},ArrowUp:{key:"ArrowUp",code:"ArrowUp",keyCode:38},ArrowDown:{key:"ArrowDown",code:"ArrowDown",keyCode:40},up:{key:"ArrowUp",code:"ArrowUp",keyCode:38},down:{key:"ArrowDown",code:"ArrowDown",keyCode:40},left:{key:"ArrowLeft",code:"ArrowLeft",keyCode:37},right:{key:"ArrowRight",code:"ArrowRight",keyCode:39},Enter:{key:"Enter",code:"Enter",keyCode:13},return:{key:"Enter",code:"Enter",keyCode:13},Escape:{key:"Escape",code:"Escape",keyCode:27},esc:{key:"Escape",code:"Escape",keyCode:27}};function dispatchKey(e){const t=KEY_NAME_MAP[e],r=t?.key??(" "===e?" ":e),n=t?.code??(" "===e?"Space":1===e.length?`Key${e.toUpperCase()}`:e),i=t?.keyCode??e.charCodeAt(0);logDispatch("key"," "===e?"Space":e),window.dispatchEvent(new KeyboardEvent("keydown",{code:n,key:r,keyCode:i,bubbles:!0,cancelable:!0}))}function dispatchClick(e,t){if(!e)return!1;const r=e.getBoundingClientRect();r.width>0&&r.height>0&&(r.top<0||r.bottom>window.innerHeight)&&e.scrollIntoView({block:"center"});const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return logDispatch("click",t),e.click(),!0;const i=n.left+n.width/2,a=n.top+n.height/2;if(i<0||a<0||i>window.innerWidth||a>window.innerHeight)return logDispatch("click-blocked",`${t} off-viewport at ${0|i},${0|a}`),!1;const o=document.elementFromPoint(i,a);if(null==o)return logDispatch("click",t),e.click(),!0;if(o!==e&&!e.contains(o)){return logDispatch("click-blocked",`${t} covered by ${o&&o!==e?`<${o.tagName?.toLowerCase()} id=${o.id||"-"} class=${(o.className?.toString?.()||"").slice(0,30)} z=${o.style?.zIndex||"-"} text="${(o.textContent||"").trim().slice(0,30)}">`:"nothing (no hit)"} at ${0|i},${0|a}`),!1}logDispatch("click",t),e.click();const s={bubbles:!0,cancelable:!0,clientX:i,clientY:a,button:0};return window.dispatchEvent(new MouseEvent("mousemove",s)),window.dispatchEvent(new MouseEvent("mousedown",s)),setTimeout((()=>{window.dispatchEvent(new MouseEvent("mouseup",s))}),50),!0}function buildKey(e,t,r,n=null){return`${e}:${t}:${r??""}:${n??""}`}function recordVisiblePopupAndInstructionTexts(){const e=document.querySelector(".swal2-popup");if(e&&null!==e.offsetParent){const t=window.__simSwalPopupTexts??=[],r=e.textContent?.trim()??"";r&&!t.includes(r)&&t.push(r)}for(const t of Array.from(document.querySelectorAll(".ee-html-text-stim"))){if(null===t.offsetParent)continue;const e=window.__simInstructionTexts??=[],r=t.textContent?.trim()??"";r&&!e.includes(r)&&e.push(r);const n=window.__simInstructionFonts??={};r&&!(r in n)&&(n[r]=t.style.fontFamily??"")}for(const t of document.querySelectorAll("#compatibility-chrome-title")){if(0===t.getClientRects().length)continue;const e=window.__simEePopupTitles??=[],r=t.textContent?.trim()??"";r&&!e.includes(r)&&e.push(r)}for(const t of document.querySelectorAll("#compatibility-known-list")){if(0===t.getClientRects().length)continue;const e=window.__simCompatFactTexts??=[],r=t.textContent?.trim()??"";r&&!e.includes(r)&&e.push(r)}}function handleQADialog(e){const t=document.querySelectorAll(".swal2-radio input");if(t.length>0){const r=Math.floor(e()*t.length);return t[r].click(),logDispatch("qa-radio",`idx=${r}/${t.length}`),setTimeout((()=>{const e=document.querySelector(".swal2-confirm");e&&null!==e.offsetParent&&dispatchClick(e,".swal2-confirm (qa-radio)")}),120),!0}const r=document.querySelector(".swal2-textarea");if(r){r.value="sim",r.dispatchEvent(new Event("input",{bubbles:!0}));return dispatchClick(document.querySelector(".swal2-confirm"),".swal2-confirm (qa-textarea)"),!0}return!1}function handleLoadingDialog(e){if(handleQADialog(e))return!0;const t=document.querySelector(".swal2-confirm");return!(!t||null===t.offsetParent)&&(dispatchClick(t,".swal2-confirm (loading dialog)"),!0)}function handleSoundOutputGlobalModals(e){const t=document.querySelector("[data-ee-sound-output-reconnect]");if(t&&t.getClientRects().length>0){const r=window;if(r.__simReconnectShown||(r.__simReconnectShown=!0,r.__simSoundOutputActions.push({action:"reconnect-shown"})),"restored"!==t.dataset.state){const t=[...r.__simSoundOutputActions??[]].reverse().find((e=>"select"===e.action));if(t?.label&&!r.__simReconnectDidConnect)return r.__simReconnectDidConnect=!0,r.__simConnectAudioOutput(t.label),r.__simSoundOutputActions.push({action:"connect",label:t.label}),e(),!0}else{const r=t.querySelector("[data-ee-sound-output-reconnect-proceed]");if(r&&r.getClientRects().length>0)return dispatchClick(r,"sound-output reconnect Proceed"),e(),!0}}const r=document.querySelector("[data-ee-sound-output-reminder]");if(r&&r.getClientRects().length>0){r.dataset.simRecorded||(r.dataset.simRecorded="1",window.__simSoundOutputActions.push({action:"reminder",kind:r.dataset.kind??"",text:r.querySelector("p")?.textContent?.trim()??""}));const t=r.querySelector("[data-ee-sound-output-reminder-proceed]");if(t&&t.getClientRects().length>0)return dispatchClick(t,"sound-output reminder Proceed"),e(),!0}return!1}function act(e,t,r){const n=e.phase,i=document.getElementById("msgDialog");if(i){const e=i;if(!0!==e.__simOkClicked){e.__simOkClicked=!0;const t=i.closest(".ui-dialog"),r=t&&t.querySelector("#buttonOk")||document.getElementById("buttonOk");r&&dispatchClick(r,"#msgDialog OK (audited quit)")}return}if(e.error)return;if(recordVisiblePopupAndInstructionTexts(),e.dialogOpen&&handleQADialog(t))return;if(handleSoundOutputGlobalModals(r))return;if(document.querySelector("[data-ee-display-precision-page]"))return;const a=document.getElementById("threshold-container");if(a&&null!==a.offsetParent){const e=window.__simEePopupTitles??=[],t=document.getElementById("threshold-title")?.textContent?.trim()??"";t&&!e.includes(t)&&e.push(t);const r=document.getElementById("threshold-continue-button");r&&null!==r.offsetParent&&r.onclick?dispatchClick(r,"#threshold-continue-button (popup)"):dispatchKey("Enter")}else switch(n){case"compatibility":{const e=document.querySelector("video[id^='camera-preview']:not([id*='bottom'])");if(e&&null!==e.offsetParent){dispatchClick(e,"video#camera-preview (select camera)"),r();break}const n=document.querySelector("[data-ee-sound-output-step]");if(n&&null!==n.offsetParent){const e=window,t=e.__SIM_OPTIONS__?.soundOutputPolicy??{},n=Array.from(document.querySelectorAll("[data-ee-sound-output-row]")).filter((e=>null!==e.offsetParent));for(const r of n){const n=r.dataset.eeSoundOutputRow??"",i=r.querySelector("select");if(!i)continue;const a=t[n]??"first";let o;o="none"===a?Array.from(i.options).find((e=>"none"===e.value)):"first"!==a&&a?Array.from(i.options).find((e=>e.value&&"none"!==e.value&&e.textContent?.includes(a))):Array.from(i.options).find((e=>e.value&&"none"!==e.value)),o&&i.value!==o.value&&(i.value=o.value,i.dispatchEvent(new Event("change",{bubbles:!0}))),o&&!i.dataset.simSelected&&(i.dataset.simSelected="1",e.__simSoundOutputActions.push({action:"select",kind:n,value:i.value,label:i.selectedOptions[0]?.textContent?.trim()??""}));const s=r.querySelector("button[data-ee-sound-output-test]");s&&!s.dataset.simClicked&&(s.dataset.simClicked="1",dispatchClick(s,"sound-output test button"),e.__simSoundOutputActions.push({action:"test-button",kind:n}))}const i=document.querySelector("button[data-ee-sound-output-quit]");if(i&&null!==i.offsetParent){e.__simSoundOutputActions.push({action:"quit"}),dispatchClick(i,"sound-output Quit"),r();break}}const i=document.querySelector("[data-ee-sound-output-block0]");if(i&&null!==i.offsetParent){const e=window;if(e.__SIM_OPTIONS__?.soundOutputPolicy?.reconnect&&!e.__simReconnectDidDisconnect){const t=[...e.__simSoundOutputActions??[]].reverse().find((e=>"select"===e.action));if(t?.value){e.__simReconnectDidDisconnect=!0,e.__simDisconnectAudioOutput(t.value),e.__simSoundOutputActions.push({action:"disconnect",id:t.value,label:t.label}),r();break}}}const a=Array.from(document.querySelectorAll("button.btn-outline-secondary")).filter((e=>null!==e.offsetParent&&!e.disabled&&/^[123]$/.test(e.textContent?.trim()??"")));if(a.length>0){const e=window.__SIM_OPTIONS__?.headphoneCheck??"ideal",n="ideal"===e?window.__simHeadphoneCheckTarget:void 0;let i=a[Math.floor(t()*a.length)];"number"==typeof n&&a[n-1]&&(i=a[n-1],delete window.__simHeadphoneCheckTarget),dispatchClick(i,`huggins choice (${e}${"number"==typeof n?", oracle":""})`),r();break}const o=Array.from(document.querySelectorAll("button.btn-success")).find((e=>null!==e.offsetParent&&!e.disabled));if(o){dispatchClick(o,"button.btn-success (compat)"),r();break}const s=document.getElementById("procced-btn")??document.querySelector('button[id*="proceed" i], button[id*="continue" i]');s?(dispatchClick(s,"#procced-btn|proceed|continue"),r()):(dispatchKey("Enter"),r());break}case"consent":dispatchClick(document.getElementById("form-yes"),"#form-yes");break;case"calibration":{const e=document.querySelector(".rc-panel-debug-control-next");if(e){dispatchClick(e,".rc-panel-debug-control-next");break}const t=document.querySelector('button[id*="continue" i], button[id*="proceed" i], button[id*="done" i]')??document.querySelector("button");t?dispatchClick(t,'button[id*="continue|proceed|done" i]'):dispatchKey("Enter");break}case"instructions":{const e=(document.getElementById("easyeyes-title-page")?document.getElementById("easyeyes-title-page-proceed-button"):null)??document.getElementById("threshold-proceed-button");e?dispatchClick(e,`#${e.id}`):dispatchKey(" "),r();break}case"showimage":dispatchKey("return");break;case"fixation":dispatchKey(" ");break;case"reading":{let n=document.querySelectorAll("#characterSet-holder .characterSet");if(0===n.length&&(n=document.querySelectorAll(".phrase-identification-category-item:not(.phrase-identification-item-selected)")),n.length>0){const r=Array.from(n).map((e=>e.textContent??"")),i=selectClickedIndex(r,e,t);dispatchClick(n[i],`[idx=${i}]="${r[i]??""}"`)}else dispatchKey(" ");r();break}case"response":if("adjust"===e.targetTask){dispatchKey("ArrowRight"),dispatchKey("ArrowRight"),dispatchKey(" ");break}if(e.responseClicked){const r=document.querySelectorAll("#characterSet-holder .characterSet"),n=Array.from(r).map((e=>e.textContent??"")),i=selectClickedIndex(n,e,t);dispatchClick(r[i],`.characterSet[idx=${i}]="${n[i]??""}"`)}else e.responseTyped&&e.validCharsTyped.length>0&&dispatchKey(selectTypedResponse(e,t));break;case"debrief":dispatchClick(document.querySelector('button[aria-label*="Yes" i], .swal2-confirm'),'button[aria-label*="Yes" i], .swal2-confirm')}}const ACTION_DELAY_MS=500;function setupInstrumentation(){activateSimulation(),enableInstrumentation(MinimalStim),installParamReaderReporter(ParamReader),installErrorReporter(),installDialogReporter()}const _savedOriginals={getUserMedia:null,enumerateDevices:null,requestFullscreen:null,exitFullscreen:null,fullscreenElementDescriptor:null};let _intervalId=null;function stopSimulatedParticipant(){null!==_intervalId&&(clearInterval(_intervalId),_intervalId=null);const e=navigator.mediaDevices;for(e&&_savedOriginals.getUserMedia&&(e.getUserMedia=_savedOriginals.getUserMedia),e&&_savedOriginals.enumerateDevices&&(e.enumerateDevices=_savedOriginals.enumerateDevices),_savedOriginals.requestFullscreen&&(document.documentElement.requestFullscreen=_savedOriginals.requestFullscreen),_savedOriginals.exitFullscreen&&(document.exitFullscreen=_savedOriginals.exitFullscreen),_savedOriginals.fullscreenElementDescriptor&&Object.defineProperty(document,"fullscreenElement",_savedOriginals.fullscreenElementDescriptor);_simRestores.length;)_simRestores.pop()?.()}let cameraStubInstalled=!1;function installCameraStub(){if(cameraStubInstalled)return;cameraStubInstalled=!0;const e=(()=>{try{const e=document.createElement("canvas");e.width=320,e.height=240;const t=e.getContext("2d");t?.fillRect(0,0,320,240);return e.captureStream?.(30)??e.mozCaptureStream?.(30)??null}catch{return null}})(),t=navigator.mediaDevices??(navigator.mediaDevices={});t.getUserMedia?.bind(t);let r=null;const n=()=>{if(r)return r;try{const e=window.AudioContext;if(!e)return null;const t=new e,n=t.createMediaStreamDestination(),i=t.createOscillator(),a=t.createGain();a.gain.value=0,i.connect(a).connect(n),i.start(),r=n.stream.getAudioTracks()[0]??null}catch{r=null}return r};t.getUserMedia=async t=>{if(e){if(t&&t.audio){const t=n();if(t&&!e.getAudioTracks().length)try{e.addTrack(t)}catch{}}return e}const r=new MediaStream;if(t&&t.audio){const e=n();e&&r.addTrack(e)}return r};const i=t.enumerateDevices?.bind(t);i&&(t.enumerateDevices=async()=>{try{const e=await i();if(e.some((e=>"videoinput"===e.kind)))return e}catch{}return[{deviceId:"sim-camera",groupId:"sim-group",kind:"videoinput",label:"Simulated Camera",toJSON(){}}]})}let audioOutputStubInstalled=!1;const _simRestores=[];function installAudioOutputStub(){if(audioOutputStubInstalled)return;audioOutputStubInstalled=!0;const e=window;e.__simSinkCalls??=[],e.__simMediaPlays??=[],e.__simSoundOutputActions??=[],e.__simAudioOutputs??=[{id:"sim-output-speakers",label:"MacBook Pro Speakers"},{id:"sim-output-airpods",label:"Denis's AirPods Pro #2"}];const t=()=>{navigator.mediaDevices?.dispatchEvent?.(new Event("devicechange"))},r=navigator.mediaDevices;if(r?.enumerateDevices){const t=r.enumerateDevices.bind(r);r.enumerateDevices=async()=>{const r=await t(),n=r.filter((e=>"audiooutput"!==e.kind)),i=r.filter((e=>"audiooutput"===e.kind&&e.label&&e.deviceId));return[...n,...e.__simAudioOutputs.map((e=>({deviceId:e.id,groupId:"sim-output-group",kind:"audiooutput",label:e.label,toJSON(){}}))),...i]}}e.__simAudioOutputTombstones??=[],e.__simConnectAudioOutput=r=>{const n=e.__simAudioOutputTombstones.find((e=>e.label===r)),i=n?.id??"sim-output-"+r.toLowerCase().replace(/[^a-z0-9]+/g,"-");return n&&(e.__simAudioOutputTombstones=e.__simAudioOutputTombstones.filter((e=>e.id!==i))),e.__simAudioOutputs.some((e=>e.id===i))||(e.__simAudioOutputs.push({id:i,label:r}),t()),i},e.__simDisconnectAudioOutput=r=>{const n=e.__simAudioOutputs.find((e=>e.id===r));n&&e.__simAudioOutputTombstones.push(n);const i=e.__simAudioOutputs.length;e.__simAudioOutputs=e.__simAudioOutputs.filter((e=>e.id!==r)),e.__simAudioOutputs.length!==i&&t()};const n=e.__SIM_OPTIONS__??{};for(const i of n.deviceScript??[])setTimeout((()=>{"disconnect"===i.action?e.__simDisconnectAudioOutput(i.id):i.label&&e.__simConnectAudioOutput(i.label)}),Math.max(0,0|i.atMs));if(n.simNoSinkSupport){const e=[];for(const t of["undefined"!=typeof AudioContext?AudioContext.prototype:null,HTMLMediaElement.prototype]){const r=t;r&&"setSinkId"in r&&(e.push([r,r.setSinkId]),delete r.setSinkId)}_simRestores.push((()=>{for(const[t,r]of e)t.setSinkId=r}))}else{const t="undefined"!=typeof AudioContext?[AudioContext.prototype,HTMLMediaElement.prototype]:[HTMLMediaElement.prototype];for(const r of t){const n=r;if(n.__simPatched)continue;n.__simPatched=!0;const i=2===t.length&&r===t[0]?"AudioContext":"HTMLMediaElement",a=n.setSinkId;n.setSinkId=function(...t){const r=t[0],n=e.__simAudioOutputs.some((e=>e.id===r)),o=e.__simAudioOutputs.find((e=>e.id===r))?.label??"";return e.__simSinkCalls.push({target:i,deviceId:r,label:o,t:Date.now()-(e.__simBootTime??Date.now())}),n||"function"!=typeof a?Promise.resolve():a.apply(this,t)},_simRestores.push((()=>{"function"==typeof a?n.setSinkId=a:delete n.setSinkId,n.__simPatched=!1}))}}e.__simBootTime=Date.now(),e.__simGroundTruth=()=>({sinkCalls:e.__simSinkCalls,mediaPlays:e.__simMediaPlays,soundOutputActions:e.__simSoundOutputActions,audioOutputs:e.__simAudioOutputs})}let rcDefaultsInstalled=!1;function installRcDebugDefaults(){if(rcDefaultsInstalled)return;rcDefaultsInstalled=!0;const e=Date.now(),t=()=>{const r=window.RemoteCalibrator;if(r)try{r._cameraSelectionDone=!0,r.calibrationSimulatedBool=!0}catch{}else Date.now()-e<1e4&&setTimeout(t,100)};t()}function startSimulatedParticipant(){if(null!==_intervalId)return;setupInstrumentation(),_savedOriginals.requestFullscreen=document.documentElement.requestFullscreen,_savedOriginals.exitFullscreen=document.exitFullscreen,_savedOriginals.fullscreenElementDescriptor=Object.getOwnPropertyDescriptor(document,"fullscreenElement")??{configurable:!0,get:()=>null},document.documentElement.requestFullscreen=()=>Promise.resolve(),Object.defineProperty(document,"fullscreenElement",{configurable:!0,get:()=>document.documentElement}),document.exitFullscreen=()=>Promise.resolve(),HTMLMediaElement.prototype.play=function(){return(window.__simMediaPlays??=[]).push({src:(this.currentSrc||this.src||"").slice(0,80),id:this.id??"",t:Date.now()-(window.__simBootTime??Date.now())}),Promise.resolve(this)};const t=navigator.mediaDevices??(navigator.mediaDevices={});_savedOriginals.getUserMedia=t.getUserMedia?.bind(t)??null,_savedOriginals.enumerateDevices=t.enumerateDevices?.bind(t)??null,installCameraStub(),installAudioOutputStub(),installRcDebugDefaults();const r=window.__SIM_SEED__,n="number"==typeof r?mulberry32(r):Math.random;if("1"===new URLSearchParams(window.location.search).get("simFastMode")){const e=document.createElement("style");e.textContent="canvas { visibility: hidden !important; }",document.head.appendChild(e)}{let t="",r=null,i=null;_intervalId=setInterval((()=>{try{const e=readEEState(),a=e.phase;if(e.recalibrations!==i&&(i=e.recalibrations,t=""),e.dialogOpen&&("loading"===a||!a)){const i=`__dialog__:${e.dialogOpen}`;return void(i!==t&&(t=i,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null,readEEState().dialogOpen===e.dialogOpen&&(handleLoadingDialog(n)||(t=""))}),ACTION_DELAY_MS)))}if(!("loading"!==a&&a||e.dialogOpen)){if(document.querySelector(".swal2-popup")&&null!==document.querySelector(".swal2-popup")?.parentElement?.offsetParent){const e=`__swal_fallback__:${a??""}`;return void(e!==t&&(t=e,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null,handleLoadingDialog(n)||(t="")}),ACTION_DELAY_MS)))}}if(handleSoundOutputGlobalModals((()=>{})))return;if(!a||"loading"===a)return void logDispatch("tick-return",`loading-early phase=${a}`);{const e=document.querySelector(".swal2-popup"),i=document.querySelectorAll(".swal2-popup .swal2-radio input"),a=!!e&&null!==e.offsetParent&&i.length>0&&!Array.from(i).every((e=>e.disabled));if(!a&&t.startsWith("__midrun_dialog__:")&&(t=""),a){recordVisiblePopupAndInstructionTexts();const i=`__midrun_dialog__:${(e?.textContent||"").trim().slice(0,60)}`;return void(i!==t&&(t=i,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null,handleQADialog(n)||(t="")}),ACTION_DELAY_MS)))}}const o=buildKey(a,e.trial,e.dialogOpen,e.dialogs);if(o===t)return void logDispatch("dedupe-skip",o);t=o,null!==r&&clearTimeout(r),r=setTimeout((()=>{r=null;const e=readEEState(),i=buildKey(e.phase,e.trial,e.dialogOpen,e.dialogs);i===o?(act(e,n,(()=>{t=""})),"complete"===e.phase&&stopSimulatedParticipant()):logDispatch("tick-return",`stale-key ${o} -> ${i}`)}),ACTION_DELAY_MS)}catch(e){console.error("[sim] tick threw:",e)}}),200)}}const populateQuestDefaults=(e,t,r="letter")=>{for(let n=0;n<e.length;n++){const i=e[n].block_condition,a=t.read("thresholdGamma",i),o=""!==a?a:"letter"==r?getGamma(t.read("fontCharacterSet",i)):.5,s={startVal:Math.log10(t.read("thresholdGuess",i)),startValSd:t.read("thresholdGuessLogSd",i),beta:t.read("thresholdBeta",i),delta:t.read("thresholdDelta",i),gamma:o,pThreshold:t.read("thresholdProportionCorrect",i),nTrials:t.read("conditionTrials",i)};for(const t in s)s[t]||console.error(`property: ${t}, value: ${s[t]}`),e[n][t]=s[t]}return e},getGamma=e=>{isNaN(e)||(e=e.toString());const t={};for(let n=0;n<e.length;n++)t.hasOwnProperty(e[n])?t[e[n]]++:t[e[n]]=1;const r=Array.from(new Set(e)).sort(((e,r)=>t[e]<t[r]?1:-1));return t[r.pop()]/e.length},generateBoundingBoxPolies=(e,t)=>{const r={win:t.window,units:"pix",width:1,height:1,ori:0,pos:[0,0],lineWidth:1,opacity:void 0,depth:-10,interpolate:!0,size:0},n={target:new Rect({...r,lineColor:new Color$1("blue"),name:"targetBoundingPoly"}),flanker1:new Rect({...r,lineColor:new Color$1("blue"),name:"flanker1BoundingPoly"}),flanker2:new Rect({...r,lineColor:new Color$1("blue"),name:"flanker2BoundingPoly"})},i={target:new Rect({...r,lineColor:new Color$1("red"),name:"fontCharacterSetBoundingPoly"}),flanker1:new Rect({...r,lineColor:new Color$1("red"),name:"flanker1CharacterSetBoundingPoly"}),flanker2:new Rect({...r,lineColor:new Color$1("red"),name:"flanker2CharacterSetBoundingPoly"})},a={};for(const o of e.block_conditions){const n=String(e.read("fontCharacterSet",o)).split("");e.read("showCharacterSetBoundingBoxBool",o)&&(a[o]=getDisplayCharacterSetBoundingPolies(n,r,t))}return[n,i,a]},getDisplayCharacterSetBoundingPolies=(e,t,r)=>{const[n,i]=[[],[]];for(const a of e){const e=a;i.push(new TextStim({win:r.window,name:`displayCharacterSet_${a}`,text:e,font:"Arial",units:"pix",pos:[0,0],height:1,wrapWidth:void 0,ori:0,color:new Color$1("black"),opacity:1,depth:-10})),n.push(new Rect({...t,lineColor:new Color$1("red"),name:`displayCharacterSetBoundingBox-${a}`}))}return{characters:i,polies:n}},prettyPrintPsychojsBoundingBox=e=>`height : ${toFixedNumber(e.height,0)}, width : ${toFixedNumber(e.width,0)}, x: ${toFixedNumber(e.x)}, y: ${toFixedNumber(e.y)}`,getBoundingBoxVisualRect=e=>{const t=e.getBoundingBox(!0),r={win:e._psychoJS.window,units:"pix",width:1,height:1,ori:0,pos:[0,0],lineWidth:5,opacity:1,depth:-1e3,interpolate:!0,size:[t.width,t.height],pos:[t.left,t.top],autoDraw:!0};return new Rect({...r,lineColor:new Color$1("blue"),name:`boundingBoxVisualRect-${e.name}`})},getBlockPercentCorrect=(e,t,r,n)=>{let i=0,a=0;for(const s of t)e(s)&&(i+=r(s),a+=n(s));if(0===a)return null;const o=Math.round(100*(i/a+Number.EPSILON));return Number.isFinite(o)?o:null},preparePopup=(e,t)=>{const r=document.createElement("div");r.id=`${t}-container`,r.className="popup-container";const n=document.createElement("div");n.id=`${t}-background`,n.className="popup-background",r.appendChild(n);const i=document.createElement("div");i.id=`${t}-popup`,i.className="popup";const a=document.createElement("h1");a.id=`${t}-title`,a.className="popup-title",i.appendChild(a);const o=document.createElement("p");o.id=`${t}-sub-text`,o.className="popup-sub-text",i.appendChild(o);const s=document.createElement("button");return s.id=`${t}-continue-button`,s.className="popup-continue-button",s.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",e)),i.appendChild(s),r.appendChild(i),document.body.appendChild(r),[r,a,o,s]},showPopup=(e,t,r,n=!1,i=!1)=>{document.getElementById(`${e}-container`).style.display="block",document.getElementById(`${e}-title`).innerHTML=renderMarkdown(t),document.getElementById(`${e}-sub-text`).innerHTML=renderMarkdown(r),toggleSubTextVisibility(i,e),toggleProceedButtonVisibility(n,e)},toggleSubTextVisibility=(e,t)=>{document.getElementById(`${t}-sub-text`).style.display=e?"none":"block"},toggleProceedButtonVisibility=(e,t)=>{document.getElementById(`${t}-continue-button`).style.display=e?"none":"block"},hidePopup=e=>{document.getElementById(`${e}-container`).style.display="none"},showPopupProceed=(e,t,r)=>{const n=document.getElementById(`${e}-sub-text`);n.innerHTML=renderMarkdown(t),n.style.display="block",document.getElementById(`${e}-continue-button`).style.display=r?"block":"none"},hidePopupProceed=(e,t)=>{document.getElementById(`${e}-sub-text`).innerHTML=t,document.getElementById(`${e}-continue-button`).style.display="none"},addPopupLogic=async(e,t,r=null,n=void 0,i)=>{const a=status.currentFunction;return status.currentFunction=`popup:${e}`,new Promise((o=>{const s=()=>{document.getElementById(`${e}-continue-button`).onclick=()=>{},hidePopupProceed(e),hidePopup(e),status.currentFunction=a,n&&n.receiver&&(n.receiver.onData=n.onDataCallback),safeExecuteFunc(r),document.removeEventListener("keydown",l),o()},l=e=>{e.preventDefault(),"Enter"===e.key&&(e.stopPropagation(),s(),document.removeEventListener("keydown",l))};(()=>{const e=e=>{e&&["return",readi18nPhrases("T_RETURN",i).toLowerCase()].includes(e.response.toLowerCase())&&s()};n&&n.inUse(status.block)&&(n.receiver.onData=e)})(),canClick(t)&&(showCursor(),document.getElementById(`${e}-continue-button`).onclick=s),canType(t)&&document.addEventListener("keydown",l)}))},prepareTrialBreakProgressBar=()=>{const e=document.createElement("div");e.id="trial-break-progress-bar-wrapper";const t=document.createElement("div");t.id="trial-break-progress",t.style.width="0%",e.appendChild(t),document.body.appendChild(e)},showTrialBreakProgressBar=(e=0)=>{e=Math.max(Math.min(e,1),0),document.getElementById("trial-break-progress-bar-wrapper").style.display="block",document.getElementById("trial-break-progress").style.width=100*e+"%"},hideTrialBreakProgressBar=()=>{document.getElementById("trial-break-progress-bar-wrapper").style.display="none"},initializeEscHandlingDiv=()=>{0==document.getElementById("esc-key-handling-div").children.length&&(document.getElementById("esc-key-handling-div").innerHTML='<div\n class="modal fade"\n id="exampleModal"\n tabindex="-1"\n aria-labelledby="exampleModalLabel"\n aria-hidden="true"\n>\n <div class="modal-dialog">\n <div class="modal-content">\n <div class="modal-header">\n <h3 class="modal-title" id="modalTitle">Escape Key was Pressed</h3>\n </div>\n <div\n class="modal-body"\n id="modalBody"\n style="display: flex; justify-content: space-around"\n >\n <div style="display: grid">\n <button\n type="button"\n id="skip-trial-btn"\n class="btn btn-outline-secondary"\n style="white-space: normal; word-break: break-word;"\n data-bs-dismiss="modal"\n >\n Skip Trial\n </button>\n <span style="text-align: center">(Space)</span>\n </div>\n <div id="skip-block-div" style="display: grid">\n <button\n type="button"\n id="skip-block-btn"\n class="btn btn-outline-secondary"\n style="white-space: normal; word-break: break-word;"\n data-bs-dismiss="modal"\n >\n Skip Block\n </button>\n <span style="text-align: center">(Enter)</span>\n </div>\n <div style="display: grid">\n <button\n type="button"\n id="quit-btn"\n class="btn btn-outline-danger"\n style="white-space: normal; word-break: break-word;"\n data-bs-dismiss="modal"\n >\n Quit\n </button>\n <span style="text-align: center">(Escape)</span>\n </div>\n </div>\n </div>\n </div>\n</div>',document.getElementById("exampleModal").addEventListener("shown.bs.modal",(()=>{const e=["skip-trial-btn","skip-block-btn","quit-btn"].map((e=>document.getElementById(e))).filter((e=>e&&e.clientWidth>0));if(0===e.length)return;const t=Math.min(...e.map((e=>getMaxPossibleFontSize(e.textContent.trim(),e.clientWidth,e.clientHeight,getComputedStyle(e).fontFamily,1.15))));e.forEach((e=>{e.style.fontSize=`${t}px`}))})))},logQuest=(e,t="",r=void 0)=>{r??=status.block_condition;const n=["background-color: lightyellow","border: 2px dashed blue","padding: 2px 2px","border-radius: 1px"].join(";");paramReader.read("logQuestBool",r)&&console.log("%cQUEST. "+e,n,t)},logNotice=(e,t="",r=void 0)=>{if(/EachFrame/.test(e))return;const n=toFixedNumber(performance.now()/1e3,3);r??=status.block_condition;const i=["background-color: lightblue","color: black"].join(";");console.log("%c "+e+" "+n+"(sec)",i,t)},okayToRetryThisTrial=(e,t,r)=>{const n=e.nthTrialAttemptedByCondition.get(e.block_condition)??1,i=e.nthTrialByCondition.get(e.block_condition)??0,a=t.read("conditionTrials",e.block_condition),o=Math.max(0,n-i)<Math.ceil(a*t.read("thresholdAllowedTrialRatio",e.block_condition))-a,s=r.skipBlock&&r.blockId===e.block;return o&&!s},isConditionFinished=(e,t,r,n)=>{const i=t.read("conditionTrials",e);if(i<=0)return!0;if(!n)return!1;return(r.nthTrialByCondition.get(e)??0)>=i},readAllowedTolerances=(e,t,r)=>{e.allowed.thresholdAllowedDurationRatio=t.read("thresholdAllowedDurationRatio",r),e.allowed.thresholdAllowedGazeRErrorDeg=t.read("thresholdAllowedGazeRErrorDeg",r),e.allowed.thresholdAllowedGazeXErrorDeg=t.read("thresholdAllowedGazeXErrorDeg",r),e.allowed.thresholdAllowedGazeYErrorDeg=t.read("thresholdAllowedGazeYErrorDeg",r),e.allowed.thresholdAllowedLatenessSec=t.read("thresholdAllowedLatenessSec",r)},measureGazeError=(e,t,r,n)=>{rc.getGazeNow({wait:1e3*n,frames:9},(t=>{e.measured.gazeMeasurementLatencySec=(t.timestamp-t.value.latencyMs-r)/1e3;const[n,i]=psychojsUnitsFromWindowUnits([t.value.x,t.value.y],[rc.windowWidthPx.value,rc.windowHeightPx.value],Screens[0].fixationConfig.pos);[e.measured.gazeMeasuredXDeg,e.measured.gazeMeasuredYDeg]=XYDegOfPx(0,[n,i]),e.measured.gazeMeasuredRDeg=norm([e.measured.gazeMeasuredXDeg,e.measured.gazeMeasuredYDeg]),simulateActive&&setEEState({gazeMeasuredDeg:`(${e.measured.gazeMeasuredXDeg.toFixed(1)}, ${e.measured.gazeMeasuredYDeg.toFixed(1)}, ${e.measured.gazeMeasuredRDeg.toFixed(1)})`}),e.measured.gazeMeasuredRawDeg=[];for(let r of t.raw){const[t,n]=psychojsUnitsFromWindowUnits([r.x,r.y],[rc.windowWidthPx.value,rc.windowHeightPx.value],Screens[0].fixationConfig.pos),[i,a]=XYDegOfPx(0,[t,n]);e.measured.gazeMeasuredRawDeg.push([toFixedNumber(i,5),toFixedNumber(a,5)])}}))},calculateError=async(e,t,r,n,i)=>{const a=_reportTargetTimingFrames(n);if(void 0===e.targetFinishSec||void 0===e.targetStartSec||null===e.targetStartSec||null===e.targetFinishSec)console.error("targetStartSec or targetFinishSec is missing, in calculateError");else{psychoJS.window.monitorFramePeriod;const n=e.targetFinishSec-e.targetStartSec,i=e.preRenderEndSec-e.preRenderStartSec;t.measured.targetMeasuredDurationSec=n,t.measured.targetMeasuredDurationFrames=a.recordedEnd-a.recordedStart,t.measured.thresholdDurationRatio=n<r?r/n:n/r,t.measured.targetMeasuredLatenessSec=(e.targetDrawnConfirmedTimestamp-e.targetRequestedTimestamp)/1e3,t.measured.targetMeasuredPreRenderSec=i}},addResponseIfTolerableError=(e,t,r,n,i,a,o,s,l=!1,c=!1)=>{addMeasuredErrorToOutput(a,n);const u=_targetDurationAcceptable(n.measured.thresholdDurationRatio,n.allowed.thresholdAllowedDurationRatio)||o,d=_targetLatencyAcceptable(n.measured.targetMeasuredLatenessSec,n.allowed.thresholdAllowedLatenessSec);paramReader.read("_logFontBool")[0]&&logLetterParamsToFormspree({},n.measured.targetMeasuredLatenessSec);const h=[u,d,!letterTiming.blackoutDetectedBool];letterTiming.blackoutDetectedBool?letterConfig.useFontMaxPxShrinkageBool=!0:letterConfig.useFontMaxPxShrinkageBool=!1,letterTiming.blackoutDetectedBool=!1;const p=h,f=["durationAcceptable","latenessAcceptable","noBlackout"];if(i){const e=_gazeErrorAcceptable(n.measured,n.allowed);p.push(e),f.push("gazeAcceptable")}const m=p.every((e=>e));logQuest("Was trial given to QUEST?",m),logQuest("Was answer correct?",!!t),a.experiment.addData("trialGivenToQuestErrorCheckLabels",f.toString()),a.experiment.addData("trialGivenToQuestChecks",p.toString());const g=(m?"good":"bad")+(c?"practice":"test");a.experiment.addData("trialKind",g);const _=okayToRetryThisTrial(status,paramReader,skipTrialOrBlock);status.retryThisTrialBool=status.retryThisTrialBool||(!m||c)&&_;const y=isConditionFinished(status.block_condition,paramReader,status,m);return e.addResponse(t,r,m,l,status.retryThisTrialBool,y),m},addMeasuredErrorToOutput=(e,t)=>{["gazeMeasuredXDeg","gazeMeasuredYDeg","gazeMeasuredRDeg","gazeMeasuredRawDeg","gazeMeasurementLatencySec","targetMeasuredLatenessSec","targetMeasuredDurationSec","targetMeasuredDurationFrames","targetMeasuredPreRenderSec"].forEach((r=>e.experiment.addData(r,t.measured[r])))},_targetDurationAcceptable=(e,t)=>e&&t?e<=t:(warning("Unable to check if target duration is acceptable."),!1),_gazeErrorAcceptable=(e,t)=>{const{gazeMeasuredXDeg:r,gazeMeasuredYDeg:n,gazeMeasuredRDeg:i}=e,{thresholdAllowedGazeXErrorDeg:a,thresholdAllowedGazeYErrorDeg:o,thresholdAllowedGazeRErrorDeg:s}=t;return i&&r&&n&&s&&a&&o?Math.abs(r)<=Math.abs(a)&&Math.abs(n)<=Math.abs(o)&&i<=s:(warning("Unable to check if gaze position is acceptable."),!1)},_targetLatencyAcceptable=(e,t)=>e&&t?e<=t:(warning("Unable to check if target latency is acceptable."),!1),_reportTargetTimingFrames=e=>({nominalStart:e.frameNStart,recordedStart:e.frameNDrawnConfirmed,nominalEnd:e.frameNEnd,recordedEnd:e.frameNFinishConfirmed}),targetsOverlap=e=>{const t=e.map((e=>e.getBoundingBox(!0))).map(rectFromPixiRect);return getPairs(t).some((([e,t])=>isRectTouchingRect(e,t)))},doubleCheckSizeToSpacing=(e,t)=>{if("ratio"===letterConfig.spacingRelationToSize&&!status.currentFunction.includes("instructionSetup")){const r=letterConfig.targetSizeIsHeightBool?Math.abs(e.getBoundingBox(!0).height):Math.abs(e.getBoundingBox(!0).width),n=e.getBoundingBox(!0),i=t.getBoundingBox(!0),a=[n.x,n.y],o=[i.x,i.y],s=distance(a,o);checkSpacingOverSizeRatio(s,r,`${status.currentFunction}MeasuredPx`)}},checkSpacingOverSizeRatio=(e,t,r="")=>{const n=closeEnough(e/t,letterConfig.spacingOverSizeRatio);return n||warning(`!. Size (${toFixedNumber(t,3)}) and spacing (${toFixedNumber(e,3)}) are out of proportion (${toFixedNumber(e/t,3)}, not ${letterConfig.spacingOverSizeRatio}), at ${r}`),n};var interval;const trackCursor=e=>{const t=e.read("_saveCursorPositionBool")[0],r=e.read("saveCursorTrackingHz")[0],n=intervalMsFromHz(r);t&&void 0===interval&&(interval=setInterval(recordCursorPosition,n))},updateTrackCursorHz=e=>{if(void 0!==interval){const t=e.read("saveCursorTrackingHz",status.block_condition),r=intervalMsFromHz(t);clearInterval(interval),interval=setInterval(recordCursorPosition,r)}},defineTargetForCursorTracking=e=>{cursorTracking.target=e},intervalMsFromHz=e=>1/e*1e3,recordCursorPosition=()=>{let e,t,r,n,i,a,o,s,l,c,u,d,h,p,f,m,g=cursorTracking.target;Array.isArray(g)&&(g=g[0]);const _=/_instructionRoutineEachFrame/.test(status.currentFunction),y=void 0!==g&&!0===g._autoDraw;if(y){const[e,t]=g._pos;n=getAppleCoordinatePosition(e,t).toString()}else n="";const b=getCursorLocation();t=getAppleCoordinatePosition(b[0],b[1]).toString(),r=getAppleCoordinatePosition(Screens[0].fixationConfig.pos[0],Screens[0].fixationConfig.pos[1]).toString();const v=void 0!==Screens[0].fixationConfig.stim&&Screens[0].fixationConfig.stim?.stims[0]?._autoDraw;if(void 0!==status.block_condition){i=thisExperimentInfo.experiment,c=thisExperimentInfo.participant,a=status.block,o=status.block_condition,s=showConditionNameConfig$1.name,l=Number(o.split("_")[1]),u=status.trial,e=Date.now()/1e3,d=Screens[0].pxPerCm,h=viewingDistanceCm.current,p=getScreenDimensions(),f=Screens[0].nearestPointXYZPx[0],m=Screens[0].nearestPointXYZPx[1];const g={experiment:i,pavloviaSessionId:c,posixTimeSec:e.toString(),cursorPositionXYPx:t,crosshairPositionXYPx:r,targetPositionXYPx:n,blockNumber:a,block_condition:o,conditionNumber:l,conditionName:s,trialNumber:u,pxPerCm:d.toString(),viewingDistanceCm:h.toString(),screenWidthPx:p[0],screenHeightPx:p[1],nearpointXYPx:getAppleCoordinatePosition(f,m).toString(),trialStep:status.currentFunction,targetBool:y&&!_,crosshairBool:v&&!_};cursorTracking.records.push(g)}};class RsvpReadingResponseModeConfigurationError extends Error{constructor(e){super(e),this.name="RsvpReadingResponseModeConfigurationError"}}const requireBoolean=(e,t)=>{if("boolean"!=typeof e)throw new RsvpReadingResponseModeConfigurationError(`${t} must be a Boolean value for RSVP reading.`);return e},resolveRsvpReadingResponseMode=({responseSpokenBool:e,responseSpokenToExperimenterBool:t})=>{const r=requireBoolean(e,"responseSpokenBool"),n=requireBoolean(t,"responseSpokenToExperimenterBool");if(r&&n)throw new RsvpReadingResponseModeConfigurationError("RSVP reading cannot use automatic speech recognition and human experimenter scoring at the same time.");return r?"automaticSpeech":n?"spoken":"silent"},resolveRsvpReadingBlockResponseModes=({responseSpokenBool:e,responseSpokenToExperimenterBool:t})=>{if(!Array.isArray(e)||!Array.isArray(t))throw new RsvpReadingResponseModeConfigurationError("RSVP reading block response parameters must be arrays.");if(e.length!==t.length)throw new RsvpReadingResponseModeConfigurationError("RSVP reading block response parameters must contain one value per condition.");return e.map(((e,r)=>resolveRsvpReadingResponseMode({responseSpokenBool:e,responseSpokenToExperimenterBool:t[r]})))},isRsvpReadingMatrixResponseMode=e=>"silent"===e,isRsvpReadingExperimenterResponseMode=e=>"spoken"===e,isRsvpReadingAutomaticSpeechResponseMode=e=>"automaticSpeech"===e,getRsvpReadingQuestionResponseType=e=>isRsvpReadingMatrixResponseMode(e)?"silent":"spoken",ZWNJ="",NON_STANDARD_JOIN_CONTROLS=/[\u200B\u200D\u2060\uFEFF]/g,ALL_JOIN_CONTROLS=/[\u200B-\u200D\u2060\uFEFF]/g,JOIN_CONTROL_CHARACTER=/[\u200B-\u200D\u2060\uFEFF]/u,APOSTROPHE_VARIANTS=/[\u2018\u2019\u02BC\u0060\u00B4]/g,DASH_VARIANTS=/[\u2010-\u2015\u2212]/g,EDGE_NON_WORD=/^[^\p{L}\p{N}\p{M}\u200C\u200D]+|[^\p{L}\p{N}\p{M}\u200C\u200D]+$/gu,CONTAINS_LETTER_OR_NUMBER=/[\p{L}\p{N}]/u,NUMBER$1=/\p{N}/u,PUNCTUATION_RUN_BETWEEN_WORD_CHARACTERS=/([\p{L}\p{N}\p{M}])(\p{P}+)(?=([\p{L}\p{N}\p{M}]))/gu,LEXICAL_INTERNAL_PUNCTUATION=new Set(["'","‘","’","ʼ","`","\xb4","-","‐","‑"]),NUMERIC_INTERNAL_PUNCTUATION=new Set([".",",",":","/","٫","٬",".",",",":","/"]),ARABIC_YEH=/\u064A/g,PERSIAN_YEH="ی",PERSIAN_YEH_PATTERN=/\u06CC/g,ARABIC_KAF=/\u0643/g,PERSIAN_KAF="ک",PERSIAN_KAF_PATTERN=/\u06A9/g,TATWEEL=/\u0640/g,ARABIC_DIACRITICS=/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g,PERSIAN_PHONETIC_EQUIVALENTS=Object.freeze({"س":"S","ص":"S","ث":"S","ز":"Z","ذ":"Z","ض":"Z","ظ":"Z","ت":"T","ط":"T","ق":"Q","غ":"Q","ه":"H","ح":"H","ا":"A","آ":"A","أ":"A","إ":"A","ک":"K","ك":"K","ی":"Y","ي":"Y","و":"V","ع":"E"}),PERSIAN_SEPARABLE_PREFIXES=new Set(["می","نمی"]),PERSIAN_SEPARABLE_SUFFIXES=new Set(["ها","های","هایی","تر","ترین"]),normalizeLanguageCode=e=>{const t=String(e??"").trim().replace(/_/g,"-");if(!t)throw new Error("A speech language code is required.");return t},baseLanguage=e=>normalizeLanguageCode(e).split("-")[0].toLowerCase(),localeLowerCase=(e,t)=>{try{return e.toLocaleLowerCase(t)}catch{return e.toLowerCase()}},prepareJoinControls=e=>e.normalize("NFC").replace(NON_STANDARD_JOIN_CONTROLS,ZWNJ).replace(/[\t ]*\u200C+[\t ]*/g,ZWNJ),preparePunctuationBoundaries=e=>e.replace(PUNCTUATION_RUN_BETWEEN_WORD_CHARACTERS,((e,t,r,n)=>{const i=[...r];if(1===i.length&&LEXICAL_INTERNAL_PUNCTUATION.has(i[0]))return e;return NUMBER$1.test(t)&&NUMBER$1.test(n)&&i.every((e=>NUMERIC_INTERNAL_PUNCTUATION.has(e)))?e:`${t} `})),tokenResult=(e,t,r,n,i,a=[])=>({original:e,normalized:t,comparisonKey:r,languageCode:n,profileId:i.id,profileVersion:i.version,phoneticKeys:a}),persianPhoneticKey=e=>[...e].filter((e=>!JOIN_CONTROL_CHARACTER.test(e))).map((e=>PERSIAN_PHONETIC_EQUIVALENTS[e]??e)).join(""),defaultProfile={id:"default",version:"unicode-nfc-v1",prepareText:e=>e.normalize("NFC"),normalizeToken:(e,t)=>{const r=localeLowerCase(e.normalize("NFC").replace(EDGE_NON_WORD,""),t);return tokenResult(e,r,r.replace(ALL_JOIN_CONTROLS,""),t,defaultProfile)}},englishProfile={id:"en",version:"english-nfkc-v1",prepareText:e=>e.normalize("NFKC"),normalizeToken:(e,t)=>{const r=e.normalize("NFKC").replace(APOSTROPHE_VARIANTS,"'").replace(DASH_VARIANTS,"-").toLocaleLowerCase("en-US").replace(EDGE_NON_WORD,"");return tokenResult(e,r,r,t,englishProfile)}},persianProfile={id:"fa",version:"persian-orthographic-v1",prepareText:prepareJoinControls,normalizeToken:(e,t)=>{const r=prepareJoinControls(e).replace(ARABIC_YEH,PERSIAN_YEH).replace(ARABIC_KAF,PERSIAN_KAF).replace(TATWEEL,"").replace(ARABIC_DIACRITICS,"").replace(EDGE_NON_WORD,"");return tokenResult(e,r,r.replace(ALL_JOIN_CONTROLS,""),t,persianProfile,r?[persianPhoneticKey(r)]:[])}},arabicProfile={id:"ar",version:"arabic-orthographic-v1",prepareText:prepareJoinControls,normalizeToken:(e,t)=>{const r=prepareJoinControls(e).replace(PERSIAN_YEH_PATTERN,"ي").replace(PERSIAN_KAF_PATTERN,"ك").replace(TATWEEL,"").replace(ARABIC_DIACRITICS,"").replace(EDGE_NON_WORD,"");return tokenResult(e,r,r.replace(ALL_JOIN_CONTROLS,""),t,arabicProfile)}},resolveProfile=e=>{switch(baseLanguage(e)){case"en":return englishProfile;case"fa":case"fas":return persianProfile;case"ar":case"ara":return arabicProfile;default:return defaultProfile}},normalizeSpeechToken=(e,t)=>{const r=normalizeLanguageCode(t);return resolveProfile(r).normalizeToken(String(e??""),r)},tokenizeSpeechTranscript=(e,t)=>{const r=normalizeLanguageCode(t),n=resolveProfile(r),i=String(e??""),a=preparePunctuationBoundaries(n.prepareText(i)).split(/\s+/u).filter(Boolean).map((e=>n.normalizeToken(e,r))).filter((e=>e.comparisonKey.length>0&&CONTAINS_LETTER_OR_NUMBER.test(e.comparisonKey)));return{rawText:i,languageCode:r,profileId:n.id,profileVersion:n.version,tokens:a}},speechTokenSplitMatchKind=(e,t)=>{if(t.length<2||t.some((t=>t.profileId!==e.profileId))||t.map((e=>e.comparisonKey)).join("")!==e.comparisonKey)return null;if(("fa"===e.profileId||"ar"===e.profileId)&&e.normalized.includes(ZWNJ))return"explicitJoinControl";if("fa"!==e.profileId)return null;const r=t[0].comparisonKey,n=t[t.length-1].comparisonKey;return PERSIAN_SEPARABLE_PREFIXES.has(r)||PERSIAN_SEPARABLE_SUFFIXES.has(n)?"persianAffixBoundary":null},OMISSION_COST=1,INSERTION_COST=1,OUT_OF_ORDER_TARGET_COST=.4,PHONETIC_CANDIDATE_COST=.8,UNRELATED_SUBSTITUTION_COST=2.1,JOINED_TRANSCRIPT_COST=.05,MERGED_TARGETS_COST=.05,MAX_JOINED_TRANSCRIPT_TOKENS=3,MAX_MERGED_TARGET_TOKENS=3,targetIndexLookup=e=>{const t=new Map;return e.forEach(((e,r)=>{const n=t.get(e.comparisonKey)??[];n.push(r),t.set(e.comparisonKey,n)})),t},substitution=(e,t,r,n)=>{if(e.comparisonKey===t.comparisonKey)return{matchKind:"exact",stepCost:0};if((n.get(t.comparisonKey)??[]).some((e=>e!==r)))return{matchKind:"outOfOrderTarget",stepCost:OUT_OF_ORDER_TARGET_COST};const i=new Set(t.phoneticKeys);return e.phoneticKeys.some((e=>i.has(e)))?{matchKind:"phoneticCandidate",stepCost:PHONETIC_CANDIDATE_COST}:{matchKind:"unrelated",stepCost:UNRELATED_SUBSTITUTION_COST}},joinedTranscriptMatchesTarget=(e,t)=>speechTokenSplitMatchKind(e,t),mergedTargetsMatchTranscript=(e,t,r,n)=>e.length>=2&&"fa"===t.profileId&&e.every((e=>"fa"===e.profileId))&&e.map((e=>e.comparisonKey)).join("")===t.comparisonKey&&!r.has(t.comparisonKey)&&1===n.get(t.comparisonKey),mergedTargetKeyCountLookup=e=>{const t=new Map;for(let r=0;r<e.length;r+=1)for(let n=2;n<=MAX_MERGED_TARGET_TOKENS&&r+n<=e.length;n+=1){const i=e.slice(r,r+n);if(i.some((e=>"fa"!==e.profileId)))continue;const a=i.map((e=>e.comparisonKey)).join("");t.set(a,(t.get(a)??0)+1)}return t},alignSpeechTokensToTargets=(e,t)=>{const r=e.length,n=t.length,i=targetIndexLookup(e),a=mergedTargetKeyCountLookup(e),o=Array.from({length:r+1},(()=>Array(n+1).fill(Number.POSITIVE_INFINITY))),s=Array.from({length:r+1},(()=>Array(n+1).fill(void 0)));o[0][0]=0;for(let d=1;d<=r;d+=1)o[d][0]=d*OMISSION_COST,s[d][0]={operation:"omission",matchKind:null,transcriptTokenCount:0,stepCost:OMISSION_COST};for(let d=1;d<=n;d+=1)o[0][d]=d*INSERTION_COST,s[0][d]={operation:"insertion",matchKind:null,transcriptTokenCount:1,stepCost:INSERTION_COST};for(let d=1;d<=r;d+=1)for(let r=1;r<=n;r+=1){const n=substitution(e[d-1],t[r-1],d-1,i),l=o[d-1][r-1]+n.stepCost,c=o[d-1][r]+OMISSION_COST,u=o[d][r-1]+INSERTION_COST;let h=l,p={operation:"diagonal",matchKind:n.matchKind,transcriptTokenCount:1,stepCost:n.stepCost};c<h&&(h=c,p={operation:"omission",matchKind:null,transcriptTokenCount:0,stepCost:OMISSION_COST});const f="exact"===n.matchKind&&u===l&&c>l;(u<h||f)&&(h=u,p={operation:"insertion",matchKind:null,transcriptTokenCount:1,stepCost:INSERTION_COST});for(let i=2;i<=MAX_JOINED_TRANSCRIPT_TOKENS&&i<=r;i+=1){const n=t.slice(r-i,r),a=joinedTranscriptMatchesTarget(e[d-1],n);if(!a)continue;const s=o[d-1][r-i]+JOINED_TRANSCRIPT_COST;s<h&&(h=s,p={operation:"joinedTranscript",matchKind:"joinedTranscript",transcriptTokenCount:i,boundaryMatchKind:a,stepCost:JOINED_TRANSCRIPT_COST})}for(let s=2;s<=MAX_MERGED_TARGET_TOKENS&&s<=d;s+=1){const n=e.slice(d-s,d);if(!mergedTargetsMatchTranscript(n,t[r-1],i,a))continue;const l=o[d-s][r-1]+MERGED_TARGETS_COST;l<h&&(h=l,p={operation:"mergedTargets",matchKind:"mergedTargets",transcriptTokenCount:1,targetTokenCount:s,stepCost:MERGED_TARGETS_COST})}o[d][r]=h,s[d][r]=p}const l=[];let c=r,u=n;for(;c>0||u>0;){const e=s[c][u];if(!e)throw new Error("Speech token alignment is incomplete.");switch(e.operation){case"diagonal":{const t=c-1,r=u-1;l.unshift({operation:"exact"===e.matchKind?"match":"substitution",matchKind:e.matchKind,targetIndex:t,targetIndices:[t],transcriptIndices:[r],beforeTargetIndex:null,cost:e.stepCost}),c-=1,u-=1;break}case"joinedTranscript":{const t=c-1,r=u-e.transcriptTokenCount;l.unshift({operation:"match",matchKind:"joinedTranscript",targetIndex:t,targetIndices:[t],transcriptIndices:Array.from({length:e.transcriptTokenCount},((e,t)=>r+t)),beforeTargetIndex:null,boundaryMatchKind:e.boundaryMatchKind,cost:e.stepCost}),c-=1,u-=e.transcriptTokenCount;break}case"mergedTargets":{const t=e.targetTokenCount??0;if(t<2)throw new Error("Merged speech targets are incomplete.");const r=c-t,n=Array.from({length:t},((e,t)=>r+t));l.unshift({operation:"match",matchKind:"mergedTargets",targetIndex:r,targetIndices:n,transcriptIndices:[u-1],beforeTargetIndex:null,cost:e.stepCost}),c-=t,u-=1;break}case"omission":l.unshift({operation:"omission",matchKind:null,targetIndex:c-1,targetIndices:[c-1],transcriptIndices:[],beforeTargetIndex:null,cost:e.stepCost}),c-=1;break;case"insertion":l.unshift({operation:"insertion",matchKind:null,targetIndex:null,targetIndices:[],transcriptIndices:[u-1],beforeTargetIndex:c,cost:e.stepCost}),u-=1}}return{events:l,totalCost:o[r][n]}},characterSimilarity=(e,t)=>{const r=[...e],n=[...t];if(r.join("")===n.join(""))return 1;if(0===r.length||0===n.length)return 0;let i=Array.from({length:n.length+1},((e,t)=>t)),a=Array(n.length+1).fill(0);for(let o=1;o<=r.length;o+=1){a[0]=o;for(let e=1;e<=n.length;e+=1)a[e]=r[o-1]===n[e-1]?i[e-1]:1+Math.min(i[e-1],i[e],a[e-1]);[i,a]=[a,i]}return 1-i[n.length]/Math.max(r.length,n.length)},RSVP_SPEECH_SCORING_VERSION="rsvp-position-aware-v1";class RsvpSpeechScoringError extends Error{constructor(e,t){super(t),this.name="RsvpSpeechScoringError",this.code=e}}const validatePolicy=e=>{if(!e||!["strict","anyOrder"].includes(e.wordOrder))throw new RsvpSpeechScoringError("invalidPolicy","RSVP speech scoring requires a valid word-order policy.");if(!["ignore","markIncorrect"].includes(e.repetition))throw new RsvpSpeechScoringError("invalidPolicy","RSVP speech scoring requires a valid repetition policy.");if(!["accept","markIncorrect"].includes(e.selfCorrection))throw new RsvpSpeechScoringError("invalidPolicy","RSVP speech scoring requires a valid self-correction policy.")},ensureValidTargets=e=>{e.forEach((e=>{if(!e.comparisonKey)throw new RsvpSpeechScoringError("invalidTargets","RSVP speech target words cannot normalize to empty text.")}))},transcriptText=(e,t)=>0===e.transcriptIndices.length?null:e.transcriptIndices.map((e=>t[e]?.original??"")).filter(Boolean).join(" "),targetEventMap=e=>{const t=new Map;return e.forEach((e=>{e.targetIndices.forEach((r=>t.set(r,e)))})),t},APPROVED_EXACT_MATCH_KINDS=new Set(["exact","joinedTranscript","mergedTargets"]),isApprovedExactMatch=e=>"match"===e.operation&&null!==e.matchKind&&APPROVED_EXACT_MATCH_KINDS.has(e.matchKind),similarityThreshold=(e,t)=>Math.min([...e].length,[...t].length)<=3?2/3:.6,classifyInsertions=(e,t,r)=>{const n=new Map;t.forEach(((e,t)=>{const r=n.get(e.comparisonKey)??[];r.push(t),n.set(e.comparisonKey,r)}));const i=new Map;return e.forEach(((e,t)=>{"match"===e.operation&&e.targetIndices.forEach((e=>i.set(e,t)))})),e.map(((a,o)=>{if("insertion"!==a.operation)return a;const s=a.transcriptIndices[0],l=r[s],c=n.get(l.comparisonKey)??[];if(c.length>0){const e=c.map((e=>({targetIndex:e,eventIndex:i.get(e)}))).filter((e=>void 0!==e.eventIndex&&e.eventIndex<o)).sort(((e,t)=>t.eventIndex-e.eventIndex))[0],r=c.map((e=>({targetIndex:e,eventIndex:i.get(e)}))).filter((e=>void 0!==e.eventIndex&&e.eventIndex>o)).sort(((e,t)=>e.eventIndex-t.eventIndex))[0],n=e?.targetIndex??r?.targetIndex??c.reduce(((e,r)=>{const n=a.beforeTargetIndex??t.length;return Math.abs(r-n)<Math.abs(e-n)?r:e}));return{...a,insertionKind:e?"repetition":"outOfOrderTarget",relatedTargetIndex:n,relatedTargetIndices:[n]}}const u=e.findIndex((e=>"mergedTargets"===e.matchKind&&e.transcriptIndices.some((e=>r[e]?.comparisonKey===l.comparisonKey))));if(u>=0){const t=e[u];return{...a,insertionKind:u<o?"repetition":"outOfOrderTarget",relatedTargetIndex:t.targetIndices[0],relatedTargetIndices:t.targetIndices}}const d=e[o+1];if("match"===d?.operation&&1===d.targetIndices.length&&d.transcriptIndices[0]===s+1){const e=d.targetIndices[0],r=t[e],n=characterSimilarity(l.comparisonKey,r.comparisonKey);if(n>=similarityThreshold(l.comparisonKey,r.comparisonKey))return{...a,insertionKind:"selfCorrectionAttempt",relatedTargetIndex:e,relatedTargetIndices:[e],similarityToTarget:n}}return{...a,insertionKind:"filler"}}))},scoreWithoutOrder=(e,t,r)=>{const n=Array(e.length).fill(0),i=new Map,a=new Set;return e.forEach(((e,r)=>{const o=t.findIndex(((t,r)=>!a.has(r)&&t.comparisonKey===e.comparisonKey));o<0||(n[r]=1,a.add(o),i.set(r,t[o].original))})),r.forEach((e=>{if(!isApprovedExactMatch(e)||"exact"===e.matchKind)return;if(e.targetIndices.some((e=>1===n[e]))||e.transcriptIndices.some((e=>a.has(e))))return;const r=transcriptText(e,t);null!==r&&(e.transcriptIndices.forEach((e=>a.add(e))),e.targetIndices.forEach((e=>{n[e]=1,i.set(e,r)})))})),{vector:n,responseTextByTarget:i}},scoreRsvpSpeechResponse=e=>{if(!Array.isArray(e.targetWords)||0===e.targetWords.length)throw new RsvpSpeechScoringError("invalidTargets","RSVP speech scoring requires at least one target word.");validatePolicy(e.policy);const t=e.targetWords.map((t=>normalizeSpeechToken(t,e.languageCode)));ensureValidTargets(t);const r=tokenizeSpeechTranscript(e.transcript,e.languageCode),n=r.tokens;if(0===n.length)throw new RsvpSpeechScoringError("emptyTranscript","RSVP speech scoring cannot score an empty transcript.");const i=alignSpeechTokensToTargets(t,n),a=classifyInsertions(i.events,t,n),o=targetEventMap(a);let s,l=new Map;if("anyOrder"===e.policy.wordOrder){const e=scoreWithoutOrder(t,n,a);s=e.vector,l=e.responseTextByTarget}else s=t.map(((e,t)=>{const r=o.get(t);if(!r||!isApprovedExactMatch(r))return 0;const i=transcriptText(r,n);return null!==i&&l.set(t,i),1})),a.forEach((e=>{"outOfOrderTarget"===e.insertionKind&&null!==e.beforeTargetIndex&&e.beforeTargetIndex<s.length&&(s[e.beforeTargetIndex]=0)}));"markIncorrect"===e.policy.repetition&&a.forEach((e=>{"repetition"===e.insertionKind&&e.relatedTargetIndices?.forEach((e=>{s[e]=0}))})),"markIncorrect"===e.policy.selfCorrection&&a.forEach((e=>{"selfCorrectionAttempt"===e.insertionKind&&void 0!==e.relatedTargetIndex&&(s[e.relatedTargetIndex]=0)}));const c=new Set;a.forEach((e=>{"outOfOrderTarget"===e.matchKind&&e.targetIndices.forEach((e=>c.add(e))),"outOfOrderTarget"===e.insertionKind&&null!==e.beforeTargetIndex&&e.beforeTargetIndex<t.length&&c.add(e.beforeTargetIndex)}));const u=new Set;a.forEach((t=>{("repetition"===t.insertionKind&&"markIncorrect"===e.policy.repetition||"selfCorrectionAttempt"===t.insertionKind&&"markIncorrect"===e.policy.selfCorrection)&&t.relatedTargetIndices?.forEach((e=>u.add(e)))}));const d=t.map(((t,r)=>{const i=o.get(r),a=s[r];let d;return d=u.has(r)?"rejectedByPolicy":a?"correct":c.has(r)?"outOfOrder":"substitution"===i?.operation?"substitution":"omission",{targetIndex:r,targetWord:e.targetWords[r],responseText:l.get(r)??(i?transcriptText(i,n):null),correct:a,outcome:d}})),h=a.filter((e=>"insertion"===e.operation));return{responseVector:s,targetResults:d,policy:{...e.policy},diagnostics:{scoringVersion:RSVP_SPEECH_SCORING_VERSION,languageCode:r.languageCode,languageProfile:r.profileId,languageProfileVersion:r.profileVersion,normalizedTargetWords:t.map((e=>e.normalized)),normalizedTranscript:n.map((e=>e.normalized)).join(" "),transcriptTokenCount:n.length,insertionCount:h.length,fillerCount:h.filter((e=>"filler"===e.insertionKind)).length,repetitionCount:h.filter((e=>"repetition"===e.insertionKind)).length,selfCorrectionCount:h.filter((e=>"selfCorrectionAttempt"===e.insertionKind)).length,outOfOrderCount:a.filter((e=>"outOfOrderTarget"===e.matchKind||"outOfOrderTarget"===e.insertionKind)).length,omissionCount:a.filter((e=>"omission"===e.operation)).length,substitutionCount:a.filter((e=>"substitution"===e.operation)).length,splitTranscriptCount:a.filter((e=>"joinedTranscript"===e.matchKind)).length,mergedTargetGroupCount:a.filter((e=>"mergedTargets"===e.matchKind)).length,phoneticCandidateCount:a.filter((e=>"phoneticCandidate"===e.matchKind)).length,alignmentCost:i.totalCost,events:a}}},DEFAULT_RSVP_SPEECH_SCORING_POLICY={wordOrder:"anyOrder",repetition:"ignore",selfCorrection:"accept"},runtime$1=rsvpSpeechRuntime$1,response$1=phraseIdentificationResponse,resolveScoringPolicy=e=>{if(e.policy)return e.policy;if("boolean"!=typeof e.ignoreWordOrder)throw new Error("rsvpReadingSTTIgnoreOrderBool must be a Boolean value.");return{...DEFAULT_RSVP_SPEECH_SCORING_POLICY,wordOrder:e.ignoreWordOrder?"anyOrder":"strict"}},resetRsvpSpeechResponseRegistration=()=>{runtime$1.responseRegistrationStatus="pending",runtime$1.responseRegistrationError=void 0,runtime$1.responseDiagnostics=void 0},markInvalid=e=>(runtime$1.responseRegistrationStatus="invalid",runtime$1.responseRegistrationError=e,runtime$1.responseDiagnostics=void 0,{status:"invalid",errorCode:e}),registerRsvpSpeechResult=e=>{if("registered"===runtime$1.responseRegistrationStatus)return{status:"registered",diagnostics:runtime$1.responseDiagnostics};if("invalid"===runtime$1.responseRegistrationStatus)return{status:"invalid",errorCode:runtime$1.responseRegistrationError};const t=e.speechResult??runtime$1.result;if("completed"!==runtime$1.status||!t)return"failed"===runtime$1.status||"closed"===runtime$1.status?markInvalid("postExposureTechnicalFailure"):{status:"waiting"};try{const r=resolveScoringPolicy(e),n=scoreRsvpSpeechResponse({targetWords:e.targetWords,transcript:t.text,languageCode:e.languageCode,policy:r});return response$1.current=n.targetResults.map((e=>e.responseText??"")),response$1.targetWord=n.targetResults.map((e=>e.targetWord)),response$1.correct=[...n.responseVector],response$1.clickTime=[],runtime$1.responseRegistrationStatus="registered",runtime$1.responseRegistrationError=void 0,runtime$1.responseDiagnostics=n.diagnostics,{status:"registered",diagnostics:n.diagnostics}}catch(error){const t="object"==typeof error&&null!==error&&"code"in error&&"string"==typeof error.code?error.code:"scoringError";return markInvalid(t)}};class RSVPReadingTargetSet{constructor(e,t,r,n,i,a,o,s){this.word=e,this.displayText=s||e,this.foilWords=i,this.position=t,this.startTime=void 0,this.durationSec=r,this.orderNumber=n,this.flankerCharacterSet=a.read("rsvpReadingFlankerCharacterSet",o).split(""),this.paramReader=a,this.BC=o,this._heightPx=getRSVPReadingHeightPx(this.paramReader,this.BC),this._spacingPx=this._heightPx*letterConfig.spacingOverSizeRatio,this.flankerLettersUsed=[],this.stims=this.generateStims(),this.stimsNominalPositions=[...this.stims.map((e=>e.getPos()))],this.measuredDuration=void 0}generateStims(){const e=this._generateStimStrings();switch(letterConfig.spacingRelationToSize){case"ratio":return this._generateRatioStims(e);case"typographic":return this._generateTypographicStims(e);default:return console.error(`Unsupported spacingRelationToSize: ${letterConfig.spacingRelationToSize}`),this._generateRatioStims(e)}}_generateStimStrings(){let e=[];if(this.flankerCharacterSet.length>0){const t=this.displayText.length+2;e.push(sampleWithReplacement(this.flankerCharacterSet,t).join("")),e.push(sampleWithReplacement(this.flankerCharacterSet,1).join("")+this.displayText+sampleWithReplacement(this.flankerCharacterSet,1).join("")),e.push(sampleWithReplacement(this.flankerCharacterSet,t).join(""))}else e.push(this.displayText);return e}_generateRatioStims(e){if(e.length>1){const t=[this.position[0],this.position[1]+this._spacingPx],r=[this.position[0],this.position[1]-this._spacingPx];return[..._generateLetterStimsForWord(e[0],t,this._heightPx,this._spacingPx,`topFlanker-${this.orderNumber}`,this.BC,this.paramReader),..._generateLetterStimsForWord(e[1],this.position,this._heightPx,this._spacingPx,`middleRow-${this.orderNumber}`,this.BC,this.paramReader),..._generateLetterStimsForWord(e[2],r,this._heightPx,this._spacingPx,`bottomFlanker-${this.orderNumber}`,this.BC,this.paramReader)]}return _generateLetterStimsForWord(this.displayText,this.position,this._heightPx,this._spacingPx,`middleRow-${this.orderNumber}`,this.BC,this.paramReader)}_generateTypographicStims(e){const t=e.join("\n"),r=new TextStim({name:`typographicReadingTarget-${this.orderNumber}}`,win:psychoJS.window,text:t,font:font.name,pos:this.position,units:"pix",height:this._heightPx,wrapWidth:2*window.innerWidth,ori:0,color:colorRGBASnippetToRGBA(font.colorRGBA),opacity:1,depth:999999,padding:this.paramReader.read("fontPadding",this.BC),characterSet:readFontMetricsCharacterSet(this.paramReader,this.BC),language:font.language,direction:font.direction,kerning:font.kerning,textRendering:font.textRendering});return r.setPadding(this.paramReader.read("fontPadding",this.BC)),readingConfig.height=findReadingSize(this.paramReader.read("readingSetSizeBy",this.BC),this.paramReader,r,"condition"),r.setHeight(readingConfig.height),r.setText(t),font.letterSpacing&&r.setLetterSpacingByProportion(font.letterSpacing),[r]}}class Category{constructor(e,t){this.target=e,this.foils=t,this.elements=shuffle([this.target,...this.foils])}}class rsvpReadingTrialWords{constructor(e,t,r=1,n=1){this.sequence=e;const i=tokenizeWordsIndividually(e),a=e.split(/\s/),o=t.slice(),s=i.map(((e,t)=>{const r=o.map((e=>e[0])).indexOf(e.toLowerCase());let n=o.splice(r,1).pop();return n=[a[t],...n.slice(1)],n})),l=Math.ceil(i.length/r);this.targetWords=[],this.foils=[],this.responseOptions=[],this.displayTexts=[],this.screens=[];for(let c=0;c<l;c++){const e=c*r,t=Math.min(e+r,i.length),o=t-e,l=a.slice(e,t).join(" "),u=Array.from({length:o},((e,t)=>t)),d=shuffle([...u]).slice(0,Math.min(n,o)).sort(((e,t)=>e-t)),h=u.filter((e=>!d.includes(e))).map((t=>a[e+t].toLowerCase())),p=[],f=[];for(const r of d){const t=s[e+r],n=t.slice(1).filter((e=>!h.includes(e.toLowerCase())));this.targetWords.push(t[0]),this.foils.push(n),this.responseOptions.push(shuffle([t[0],...n])),this.displayTexts.push(l),p.push(t[0]),f.push(n)}this.screens.push({displayText:l,allWords:a.slice(e,t),testedWords:p,testedFoils:f})}}}const getThisBlockRSVPReadingWords=(e,t)=>{const r=e.conditions.filter((e=>e.block===t)),n=e.read("conditionTrials",t),i={};return r.forEach(((t,r)=>{const a=t.block_condition,o=e.read("rsvpReadingNumberOfWords",a),s=e.read("rsvpReadingWordsPerScreen",a),l=e.read("rsvpReadingWordsTestedPerScreen",a),c=o,u=n[r],d=getThisBlockPagesForAGivenCondition(e,a,dummyStim,1,u,c).flatMap((e=>e.split("\n"))).map((e=>e.replace(/\t/g,""))),h=d.map((t=>{const n=tokenizeWordsIndividually(t),i=n.length,o=e.read("rsvpReadingNumberOfResponseOptions",a),s=e.read("readingCorpusFoils",a),l=prepareReadingQuestions(i,o,n,readingFrequencyToWordArchive[e.read("readingCorpus",a)],getRsvpReadingQuestionResponseType(rsvpReadingResponse.responseTypeForCurrentBlock[r]),"rsvpReading",e.read("rsvpReadingRequireUniqueWordsBool",a),s,e.read("readingCorpusFoilsExclude",a),e.read("readingCorpus",a),e.read("readingCorpusTargetsExclude",a)).map((e=>[e.correctAnswer,...e.foils])),c=n.map((e=>canonical(e,"individuallyTokenizedWords")));return l.sort(((e,t)=>c.indexOf(canonical(e[0],"responseOptions a[0]"))-c.indexOf(canonical(t[0],"responseOptions b[0]")))),l}));i[a]=d.map(((e,t)=>new rsvpReadingTrialWords(e,h[t],s,l)))})),i},generateRSVPReadingTargetSets=(e,t,r,n)=>{const i=XYPxOfDeg(0,[targetEccentricityDeg.x,targetEccentricityDeg.y]),a=e.screens.map(((e,a)=>new RSVPReadingTargetSet(e.testedWords[0]||e.allWords[0],i,t,a,e.testedFoils[0]||[],r,n,e.displayText))),o=e.targetWords.map(((a,o)=>new RSVPReadingTargetSet(a,i,t,o,e.foils[o],r,n,e.displayTexts[o])));return{displaySets:a,identificationSets:o}},_generateLetterStimsForWord=(e,t,r,n,i,a,o)=>{const s=getEvenlySpacedValues(e.length,n).map((e=>[t[0]+e,t[1]])),l=i?`${i}-letterWordStim-${e}`:`letterWordStim-${e}`,c=readFontMetricsCharacterSet(o,a),u=s.map(((t,n)=>{const i=new TextStim({name:l+`-${e[n]}`,win:psychoJS.window,text:e[n],font:font.name,pos:t,units:"pix",height:r,wrapWidth:void 0,ori:0,color:colorRGBASnippetToRGBA(font.colorRGBA),opacity:1,depth:999999,padding:o.read("fontPadding",a),characterSet:c,language:font.language,direction:font.direction,kerning:font.kerning,textRendering:font.textRendering});return i.setPadding(o.read("fontPadding",a)),i}));return u};let rsvpEndRoutineAtT,restInstructionsBool=!0,start,rsvpDelayBeforeResponseStartT;const _rsvpReading_trialRoutineEachFrame=(e,t,r)=>{const n=void 0===rsvpReadingTargetSets.current&&0===rsvpReadingTargetSets.upcoming.length;if(defineTargetForCursorTracking(n?void 0:rsvpReadingTargetSets.current[0]),void 0===phraseIdentificationResponse.onsetTime&¬eStimulusOnsetForPhraseIdentification(e),rsvpReadingTargetSets.skippedDueToBadTracking)return 1===rsvpReadingTargetSets.skippedDueToBadTracking?(isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType)&&closeActiveRsvpSpeechTrial(),void 0!==start&&rsvpReadingTargetSets.past.length>0&&(rsvpReadingTargetSets.past[rsvpReadingTargetSets.past.length-1].measuredDuration=e-start,start=void 0),!0):(rsvpReadingTargetSets.skippedDueToBadTracking=0,rsvpDelayBeforeResponseStartT=void 0,!1);if(n){const n=rsvpReadingResponse.responseType;void 0===rsvpDelayBeforeResponseStartT&&(rsvpDelayBeforeResponseStartT=e);const i=paramReader.read("rsvpReadingDelayBeforeResponseScreenSec",status.block_condition)??1;if(e<rsvpDelayBeforeResponseStartT+i)return!0;if(restInstructionsBool&&(r.tSTart=e,r.frameNStart=t,isRsvpReadingMatrixResponseMode(n)||r.setText(""),r.setAutoDraw(!0),restInstructionsBool=!1,!isRsvpReadingAutomaticSpeechResponseMode(n)&&(addRevealableTargetWordsToAidSpokenScoring(),keypad.handler&&keypad.handler.inUse(status.block_condition))))if(keypad.handler.start(),isRsvpReadingMatrixResponseMode(n)){const e=isFontLTR(readFontDirection(paramReader,status.block_condition))?0:rsvpReadingTargetSets.identificationTargetSets.length-1,t=rsvpReadingTargetSets.identificationTargetSets[e],r=shuffle([t.word,...t.foilWords]);keypad.handler.update(r)}else keypad.handler.update(["up","down"]);const a=isRsvpReadingAutomaticSpeechResponseMode(n);if(a&&simulateActive&&("capturing"===rsvpSpeechRuntime.status||"finalizing"===rsvpSpeechRuntime.status)){const t=rsvpReadingTargetSets.identificationTargetSets.map((e=>e.word)).join(" "),r="undefined"!=typeof window?window:void 0,n="string"==typeof r?.__EASY_EYES_RSVP_SPEECH_TRANSCRIPT__?r.__EASY_EYES_RSVP_SPEECH_TRANSCRIPT__:t;injectRsvpSpeechTranscriptForSimulation(n,(()=>1e3*e))}const o=a?registerRsvpSpeechResult({targetWords:rsvpReadingTargetSets.identificationTargetSets.map((e=>e.word)),languageCode:paramReader.read("fontLanguage",status.block_condition)||"en",ignoreWordOrder:paramReader.read(RSVP_SPEECH_PARAMETER_NAMES.ignoreOrder,status.block_condition)}):void 0;return(a?"registered"===o?.status||"invalid"===o?.status:phraseIdentificationResponse.current.length>=rsvpReadingTargetSets.numberOfIdentifications)&&(rsvpEndRoutineAtT??=e+.5,e>=rsvpEndRoutineAtT)?(isRsvpReadingExperimenterResponseMode(n)&&removeScientistKeypressFeedback(),a&&"registered"!==o?.status||updateTrialCounterNumbersForRSVPReading(),rsvpEndRoutineAtT=void 0,restInstructionsBool=!0,rsvpDelayBeforeResponseStartT=void 0,!1):(showCursor(),isRsvpReadingMatrixResponseMode(n)&&!rsvpReadingResponse.displayStatus?(showPhraseIdentification(rsvpReadingResponse.screen),rsvpReadingResponse.displayStatus=!0):isRsvpReadingExperimenterResponseMode(n)&&!rsvpReadingResponse.displayStatus&&(addScientistKeypressFeedback(rsvpReadingTargetSets.numberOfIdentifications),rsvpReadingResponse.displayStatus=!0),!0)}if(void 0!==rsvpReadingTargetSets.current&&rsvpReadingTargetSets.current.stims.every((e=>e.status===PsychoJS$1.Status.NOT_STARTED))){const r=0===rsvpReadingTargetSets.past.length;rsvpReadingTargetSets.current.startTime=e,rsvpReadingTargetSets.current.stims.forEach((r=>{r.tStart=e,r.frameNStart=t,r.setAutoDraw(!0)})),start=e,drawTimingBars(showTimingBarsBool.current,"target",!0),r&&isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType)&&startRsvpSpeechCapture()}return e>=rsvpReadingTargetSets.current.startTime+rsvpReadingTargetSets.current.durationSec&&rsvpReadingTargetSets.current.stims.every((e=>e.status===PsychoJS$1.Status.STARTED))&&(rsvpReadingTargetSets.current.stims.forEach((e=>{e.setAutoDraw(!1)})),drawTimingBars(showTimingBarsBool.current,"target",!1),rsvpReadingTargetSets.past.push(rsvpReadingTargetSets.current),rsvpReadingTargetSets.current=rsvpReadingTargetSets.upcoming.shift(),rsvpReadingTargetSets.past[rsvpReadingTargetSets.past.length-1].measuredDuration=e-start,start=void 0,rsvpReadingTargetSets.past[rsvpReadingTargetSets.past.length-1].stims.forEach((e=>e.frameNFinishedConfirmed=t)),void 0===rsvpReadingTargetSets.current&&0===rsvpReadingTargetSets.upcoming.length&&isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType)&&allowRsvpSpeechProviderFinalization()),!0},undrawAllRSVPReadingStims=()=>{[rsvpReadingTargetSets.current?[rsvpReadingTargetSets.current]:[],rsvpReadingTargetSets.upcoming||[],rsvpReadingTargetSets.past||[],rsvpReadingTargetSets.identificationTargetSets||[]].forEach((e=>{e.forEach((e=>{e?.stims?.forEach((e=>{e&&"function"==typeof e.setAutoDraw&&e.setAutoDraw(!1)}))}))}))},getRSVPReadingHeightPx=(e,t)=>{const r=e.read("targetSizeDeg",t),n=[e.read("targetEccentricityXDeg",t),e.read("targetEccentricityYDeg",t)];return Math.round(Math.abs(XYPxOfDeg(0,[n[0],n[1]-r/2])[1]-XYPxOfDeg(0,[n[0],n[1]+r/2])[1]))},registerKeypressForRSVPReading=e=>{if(!e.length)return;const t=getFeedbackCircles(),r=getUnscoredFeedbackCircles(),n=e[t.length-r.length??0];if(!n||!n.name)return;const i="up"===n.name?1:0;phraseIdentificationResponse.clickTime.push(performance.now()),phraseIdentificationResponse.current.push(n),phraseIdentificationResponse.correct.push(i),updateScientistKeypressFeedback(i),_highlightNextWordInRevealedKey()},addScientistKeypressFeedback=e=>{const t=document.createElement("div");t.className="scientist-feedback-circle-container";for(let r=0;r<e;r++){const e=document.createElement("div");e.className="scientist-feedback-circle",t.appendChild(e)}document.body.appendChild(t),phraseIdentificationResponse.onsetTime=performance.now()},updateScientistKeypressFeedback=e=>{const t=getUnscoredFeedbackCircles().shift();t?.classList.add(e?"scientist-feedback-circle-correct":"scientist-feedback-circle-incorrect")},removeScientistKeypressFeedback=()=>{const e=document.querySelector(".scientist-feedback-circle-container");null!=e&&e.parentNode.removeChild(e)},updateTrialCounterNumbersForRSVPReading=()=>{incrementTrialCompletedThisBlock(status.block_condition),phraseIdentificationResponse.correct.every((e=>e))&&incrementTrialCorrectThisBlock(status.block_condition)},constrainRSVPReadingSpeed=e=>{const t=Math.pow(10,e),r=t>10?10/t*t:t,n=r<.03?.03/t*r:r;return Math.log10(n)},addRevealableTargetWordsToAidSpokenScoring=()=>{const e=document.createElement("div");e.className="rsvpReadingTargetWordsKey",e.id="rsvpReadingTargetWordsKey",rsvpReadingTargetSets.identificationTargetSets.forEach(((t,r)=>{const n=document.createElement("div");n.innerText=t.word,n.classList.add("rsvpReadingTargetWord"),n.classList.add(0===r?"rsvpReadingTargetWordCurrent":"rsvpReadingTargetWordNotYetResponded"),e.appendChild(n)})),e.classList.add("hidden"),document.body.appendChild(e),document.addEventListener("keydown",(t=>{t.shiftKey&&"spoken"===rsvpReadingResponse.responseType&&e.classList.toggle("hidden")}))},removeRevealableTargetWordsToAidSpokenScoring=()=>{const e=document.querySelector("#rsvpReadingTargetWordsKey");e&&e.parentNode.removeChild(e)},_highlightNextWordInRevealedKey=()=>{const e=document.querySelector(".rsvpReadingTargetWordCurrent");e&&e.classList.replace("rsvpReadingTargetWordCurrent","rsvpReadingTargetWordAlreadyResponded");const t=[...document.querySelectorAll(".rsvpReadingTargetWordNotYetResponded")].shift();t&&t.classList.replace("rsvpReadingTargetWordNotYetResponded","rsvpReadingTargetWordCurrent")},addRsvpReadingTrialResponsesToData=()=>{reportRsvpReadingTargetDurations(rsvpReadingTargetSets),resetRsvpReadingTiming();const e="silent"===rsvpReadingResponse.responseType||isRsvpReadingAutomaticSpeechResponseMode(rsvpReadingResponse.responseType);psychoJS.experiment.addData("rsvpReadingParticipantResponses",e?phraseIdentificationResponse.current.toString():""),psychoJS.experiment.addData("rsvpReadingTargetWords",rsvpReadingTargetSets.past.map((e=>e.word)).toString()),psychoJS.experiment.addData("rsvpReadingDisplayTexts",rsvpReadingTargetSets.past.map((e=>e.displayText)).toString()),psychoJS.experiment.addData("rsvpReadingTargetWordsForIdentification",rsvpReadingTargetSets.identificationTargetSets.map((e=>e.word)).toString()),psychoJS.experiment.addData("rsvpReadingResponseCorrectBool",phraseIdentificationResponse.correct.map((e=>e?"TRUE":"FALSE")).toString()),psychoJS.experiment.addData("rsvpReadingResponseTimesSec",getPhraseIdentificationReactionTimes().map((e=>toFixedNumber(e,2))).toString())},getFeedbackCircles=()=>[...document.querySelectorAll(".scientist-feedback-circle")],getUnscoredFeedbackCircles=()=>[...getFeedbackCircles().filter((e=>!([...e.classList].includes("scientist-feedback-circle-correct")||[...e.classList].includes("scientist-feedback-circle-incorrect"))))],reportRsvpReadingTargetDurations=e=>{const t=e.past.map((e=>toFixedNumber(e.measuredDuration,3))).join(",");psychoJS.experiment.addData("targetMeasuredDurationSec",t)},resetRsvpReadingTiming=()=>{rsvpReadingTiming.current={},rsvpReadingTiming.past=[]},generateSupplementalRsvpReadingWords=(e,t)=>{const r=e.read("rsvpReadingNumberOfWords",t),n=e.read("rsvpReadingWordsPerScreen",t),i=e.read("rsvpReadingWordsTestedPerScreen",t),a=e.read("rsvpReadingNumberOfResponseOptions",t),o=e.read("readingCorpus",t),s=readingFrequencyToWordArchive[o],l=rsvpReadingResponse.responseTypeForCurrentBlock,c=e.read("conditionTrials",t);if(!s)return console.warn(`No frequency-to-words mapping found for corpus: ${o}`),null;const u=getThisBlockPagesForAGivenCondition(e,t,dummyStim,c,1,r,readingUsedText[o]?.get(t)?.length||0).map((e=>e.split("\n").map((e=>e.replace(/\t/g,"")))))[0].map((o=>{const c=tokenizeWordsIndividually(o),u=prepareReadingQuestions(r,a,c,s,l,"rsvpReading",e.read("rsvpReadingRequireUniqueWordsBool",t),e.read("readingCorpusFoils",t),e.read("readingCorpusFoilsExclude",t),e.read("readingCorpus",t),e.read("readingCorpusTargetsExclude",t)),d=u.map((e=>[e.correctAnswer,...e.foils])),h=u.map((e=>e.correctAnswer)).join(" ");return new rsvpReadingTrialWords(h,d,n,i)})).shift();return u},resolveRsvpSpeechTrialValidity=e=>{if("automaticSpeech"!==e.responseMode)return{validForQuest:!0,consumeTargetWords:!0};return"completed"===e.runtimeStatus&&"registered"===e.responseRegistrationStatus&&e.registeredResponseCount===e.expectedResponseCount?{validForQuest:!0,consumeTargetWords:!0}:"invalid"===e.responseRegistrationStatus?{validForQuest:!1,consumeTargetWords:!0,invalidReason:"postExposureTechnicalFailure"}:e.captureStarted?{validForQuest:!1,consumeTargetWords:!0,invalidReason:"completed"===e.runtimeStatus?"responseNotRegistered":"postExposureTechnicalFailure"}:{validForQuest:!1,consumeTargetWords:!1,invalidReason:"preExposureTechnicalFailure"}},_identify_trialInstructionRoutineEnd=(e,t)=>{removeHandlerForClickingFixation(),e.setAutoDraw(!1),t.setAutoDraw(!1),drawTimingBars(showTimingBarsBool.current,"fixation",!1),letterTiming.crosshairClickedTimestamp=performance.now()},_letter_trialRoutineEnd=(e,t,r,n,i,a,o,s)=>{if(calculateError(letterTiming,tolerances,letterConfig.targetDurationSec,e,letterConfig.delayBeforeStimOnsetSec),letterTiming.trialFirstFrameSec=void 0,letterTiming.targetStartSec=void 0,letterTiming.targetFinishSec=void 0,addTrialStaircaseSummariesToData(t,psychoJS),t instanceof MultiStairHandler$1){const e=t._currentStaircase;logQuest("Level given quest",toFixedNumber(i,3)),!addResponseIfTolerableError(t,n,i,tolerances,usingGaze.current,psychoJS,a,r,o,status.retryThisTrialBool)&&usingGaze.current&&rc.nudgeGaze({showOffset:!0});const s=e._jsQuest.trialCount;psychoJS.experiment.addData("questTrialCountAtEndOfTrial",s)}},_repeatedLetters_trialRoutineFirstFrame=e=>{e.read("calibrateTrackGazeBool",status.block_condition)&&void 0===tolerances.measured.gazeMeasurementLatencySec&&measureGazeError(tolerances,Screens[0],clickedContinue.timestamps[clickedContinue.timestamps.length-1],letterConfig.targetDurationSec)},_repeatedLetters_trialRoutineEachFrame=(e,t,r,n,i,a,o,s)=>{if(e>=r&&repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.NOT_STARTED))&&repeatedLettersConfig.stims.forEach((r=>{r.tStart=e,r.frameNStart=t,r.setAutoDraw(!0)})),repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.STARTED))&&!letterTiming.targetStartSec&&(letterTiming.targetStartSec=e,repeatedLettersConfig.stims.forEach((e=>e.frameNDrawnConfirmed=t)),letterTiming.targetDrawnConfirmedTimestamp=performance.now(),letterTiming.crosshairClickedTimestamp=clickedContinue.timestamps[clickedContinue.timestamps.length-1]),repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.STARTED))&&e>=n&&(repeatedLettersConfig.stims.forEach((e=>{e.setAutoDraw(!1),e.frameNEnd=t})),setTimeout((()=>{showCursor()}),500)),repeatedLettersConfig.stims.every((e=>e.status===PsychoJS$1.Status.FINISHED))&&!letterTiming.targetFinishSec&&(letterTiming.targetFinishSec=e,repeatedLettersConfig.stims.forEach((e=>e.frameNFinishConfirmed=t)),showConditionNameConfig$1.showTargetSpecs)){const e=letterTiming.targetFinishSec-letterTiming.targetStartSec;appendTargetSpecs("targetOnsetSec",Math.round(100*e)/100,`[${isTimingOK(Math.abs(e-letterConfig.targetDurationSec),.02)}]`),drawTargetSpecs(i,a)}e>=r+letterConfig.markingOnsetAfterTargetOffsetSecs+letterConfig.targetDurationSec&&o.status===PsychoJS$1.Status.NOT_STARTED&&(o.tStart=e,o.frameNStart=t,o.setAutoDraw(!0),setupClickableCharacterSet(fontCharacterSet.current,font.name,fontCharacterSet.where,void 0,showCharacterSetResponse,null,"",targetKind.current,status.block_condition,responseType.current),s.tSTart=e,s.frameNStart=t,s.setAutoDraw(!0))},_letter_trialRoutineFirstFrame=(e,t,r,n,i,a)=>{e.read("calibrateTrackGazeBool",status.block_condition)&&measureGazeError(tolerances,Screens[0],clickedContinue.timestamps[clickedContinue.timestamps.length-1],letterConfig.targetDurationSec)},_rsvpReading_trialRoutineEnd=(e,t,r,n)=>{if(addRsvpReadingTrialResponsesToData(),addTrialStaircaseSummariesToData(e,psychoJS),removeRevealableTargetWordsToAidSpokenScoring(),psychoJS.experiment.addData("rsvpReadingResponsesBool",phraseIdentificationResponse.correct.join(",")),e instanceof MultiStairHandler$1){const i=e._currentStaircase,a=phraseIdentificationResponse.correct.map((e=>e?1:0)),o=resolveRsvpSpeechTrialValidity({responseMode:rsvpReadingResponse.responseType,runtimeStatus:rsvpSpeechRuntime$1.status,captureStarted:void 0!==rsvpSpeechRuntime$1.captureStartedAtMs,registeredResponseCount:phraseIdentificationResponse.correct.length,expectedResponseCount:rsvpReadingTargetSets.numberOfIdentifications??a.length,responseRegistrationStatus:rsvpSpeechRuntime$1.responseRegistrationStatus}),s=o.validForQuest,l=okayToRetryThisTrial(status,n,skipTrialOrBlock);if(status.retryThisTrialBool=status.retryThisTrialBool||!s&&l,o.consumeTargetWords&&rsvpReadingWordsForThisBlock.current[status.block_condition].shift(),status.retryThisTrialBool&&o.consumeTargetWords){const e=generateSupplementalRsvpReadingWords(n,status.block_condition);rsvpReadingWordsForThisBlock.current[status.block_condition].push(e)}const c=isConditionFinished(status.block_condition,n,status,s);e.addResponse(a,t,s,r,status.retryThisTrialBool,c);const u=i._jsQuest.trialCount;psychoJS.experiment.addData("questTrialCountAtEndOfTrial",u)}clearPhraseIdentificationRegisters()},snapshotLoopState=(e,t,r)=>({bc:r,stair:e._name??e.name,thisRepN:e.thisRepN,thisTrialN:e.thisTrialN,nStim:e.nStim,nReps:e.nReps,nRemaining:e.nRemaining,stairFinished:!!e.finished,multiFinished:!!t._finished,trialKeyLen:Array.isArray(t.trialKey)?t.trialKey.length:-1,nth:0});function recordLoopTrailRow(e,t,r){if("undefined"==typeof window)return;const n=window,i=n.__simLoopTrail??=[];i.push({...snapshotLoopState(e,t,r),nth:i.length+1})}const skipTrial=()=>{skipTrialOrBlock.skipTrial=!0,skipTrialOrBlock.trialId=status.trial,skipTrialOrBlock.blockId=status.block};var timeWhenTimeout;const handleResponseTimeoutSec=(e,t)=>{if(0===e||void 0===timeWhenTimeout){const e=paramReader.read("responseTimeoutSec",status.block_condition);timeWhenTimeout=t+e}timeWhenTimeout&&t>timeWhenTimeout&&(skipTrial(),timeWhenTimeout=void 0)},addSkipTrialButton=()=>{if(paramReader.read("responseSkipTrialButtonBool",status.block_condition)&&!document.getElementById("skipTrialButton")){const e=document.createElement("button");e.id="skipTrialButton",e.className="btn btn-outline-secondary threshold-button threshold-beep-button";const t=readi18nPhrases("T_skipTrial",rc.language.value);e.innerText=t,e.addEventListener("click",skipTrial),document.body.appendChild(e)}},removeSkipTrialButton=()=>{document.getElementById("skipTrialButton")?.remove()},createSkipBlockKeyHandler=()=>e=>{const t=e.metaKey||e.ctrlKey;if("ArrowRight"===e.code&&e.shiftKey&&t){let e;if(e=status.block_condition?paramReader.read("responseSkipBlockForWhom",status.block_condition):status.block?paramReader.read("responseSkipBlockForWhom",status.block)[0]:"noone","noone"===e||thisExperimentInfo.ProlificSessionID)return;skipBlock()}};function handleResponseSkipBlockForWhom(){const e=createSkipBlockKeyHandler();return document.addEventListener("skip-block",skipBlock),document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}const skipBlock=()=>{skipTrialOrBlock.skipBlock=!0,skipTrialOrBlock.blockId=status.block},RC_CAMERA_RECONNECT_POPUP_QUIT="rc:cameraReconnectPopup:quit",detailSafe=e=>String(e??"").replace(/[(),\n\r]/g," ").replace(/\s+/g," ").trim().slice(0,40),sanitizeTrigger=e=>String(e??"").replace(/[^\w.-]/g,"").slice(0,40),rcMinutesSinceStart=(e,t)=>{const r=e?.getTime();return"number"==typeof r&&isFinite(r)?r/60:t/6e4},rcUnmetNeedsFromReason=(e,t)=>{const r=e&&"object"==typeof e?sanitizeTrigger(e.trigger):"",n=r&&"cameraReconnectPopup"!==r?`rc:${r}:quit`:RC_CAMERA_RECONNECT_POPUP_QUIT;if(!e||"object"!=typeof e)return n;const i=[];return e.snapshot?.status&&i.push(`status=${detailSafe(e.snapshot.status)}`),e.cameraLabel&&i.push(`camera=${detailSafe(e.cameraLabel)}`),e.resumeAttempts&&i.push(`attempts=${detailSafe(e.resumeAttempts)}`),"number"==typeof t&&isFinite(t)&&i.push("min="+Math.round(10*t)/10),i.length?`${n}(${i.join(",")})`:n};var mergeAudioBuffers=mergeBuffers;function mergeBuffers(e,t){for(var r=0,n=0,i=0;i<e.length;i++)e[i].numberOfChannels>r&&(r=e[i].numberOfChannels),e[i].duration>n&&(n=e[i].duration);for(var a=t.createBuffer(r,t.sampleRate*n,t.sampleRate),o=0;o<e.length;o++)for(var s=0;s<e[o].numberOfChannels;s++){var l=a.getChannelData(s),c=e[o].getChannelData(s);for(i=0;i<c.length;i++)l[i]+=c[i];a.getChannelData(s).set(l,0)}return a}const mergeBuffers$1=getDefaultExportFromCjs(mergeAudioBuffers),vocoderPhrase="Ready Baron, go to {Color} {Number} now";var targetList$2={},maskerList$1={};const initVocoderPhraseSoundFiles=async e=>{const t=await loadVocoderPhraseSoundFiles(e);return targetList$2=t.target,maskerList$1=t.maskerList,{targetList:t.target,maskerList:t.maskerList}},getVocoderPhraseTrialData=async(e,t,r,n=10,i=40,a=0,o=10,s=9)=>{var l=populateTargetIndices(s),c=populateMaskerIndices(l),u=Object.keys(targetList$2[r]);const{targetSentenceAudio:d,talker:h,categoriesChosen:p,allCategories:f}=getTargetSentenceAudio(u,e,l,targetList$2[r]);var m=Object.keys(maskerList$1[r]);const g=m.length>0,_=g?getMaskerSentenceAudio(m,t,c,maskerList$1[r],h,p):null,{targetAudioBuffersAligned:y,maskerAudioBuffersAligned:b}=alignTargetAndMaskerAudioBuffers(d,_),v=combineAudioBuffers(y,audioCtx),S=g?combineAudioBuffers(b,audioCtx):null,w=v.getChannelData(0),T=g?S.getChannelData(0):null,E=audioCtx.createBuffer(1,v.length,audioCtx.sampleRate);for(var x=E.getChannelData(0),A=0;A<x.length;A++)x[A]=2*random$1("audio")-1;setWaveFormToZeroDbSPL(w),g&&setWaveFormToZeroDbSPL(T),setWaveFormToZeroDbSPL(x);const C=i-a,R=getMaxValueOfAbsoluteValueOfBuffer(x)/1,D=getGainValue(C),P=g?getMaxValueOfAbsoluteValueOfBuffer(T)/1:0,I=o-a,k=getGainValue(I);adjustSoundDbSPL(x,C),g&&adjustSoundDbSPL(T,I);const M=getCorrectedInDbAndSoundDBSPLForVocoderPhrase(n,a,w,1-P*k-R*D);return adjustSoundDbSPL(w,M.inDB),{trialSound:c.length&&g?mergeBuffers$1([v,S,E],audioCtx):mergeBuffers$1([v,E],audioCtx),categoriesChosen:p,allCategories:f,targetVolumeDbSPL:M.correctedSoundDBSPL}},getCorrectedInDbAndSoundDBSPLForVocoderPhrase=(e,t,r,n)=>{const i=getMaxValueOfAbsoluteValueOfBuffer(r)/1,a=e-t,o=i*getGainValue(a)>n?calculateDBFromRMS(n/i):a;return{inDB:o,correctedSoundDBSPL:t+o}},alignTargetAndMaskerAudioBuffers=(e,t)=>({targetAudioBuffersAligned:e,maskerAudioBuffersAligned:t}),combineAudioBuffers=(e,t)=>{var r=0;e.map((e=>r+=e.length));for(var n=e[0].numberOfChannels,i=t.createBuffer(n,r,e[0].sampleRate),a=0;a<n;a++){var o=i.getChannelData(a),s=0;e.map((e=>{o.set(e.getChannelData(a),s),s+=e.length}))}return i},populateTargetIndices=(e=9)=>{var t=[...Array(e)];return t.forEach(((e,r,n)=>{for(var i=Math.floor(16*random$1("stimuli"));t.includes(i);)i=Math.floor(16*random$1("stimuli"));n[r]=i})),t.sort()},populateMaskerIndices=e=>{for(var t=[],r=0;r<16;r++)e.includes(r)||t.push(r);return t.sort()},getTrialAudioBufferNewImplementation=(e,t,r)=>{const n=r.createBuffer(1,t.hi.length,t.hi.sampleRate),i=n.getChannelData(0);return e.forEach((e=>{const r=new Float32Array(t.hi.length);e<8?t.lo.copyFromChannel(r,e):t.hi.copyFromChannel(r,e-8);for(var n=0;n<r.length;n++)i[n]+=r[n]})),n},getTargetSentenceAudio=(e,t,r,n)=>{var i=[];const a=e[Math.floor(random$1("stimuli")*e.length)],o={},s={};return t.map((async e=>{if("#"===e[0]){const t=e.substring(1),l=Object.keys(n[a][t]),c=l[Math.floor(random$1("stimuli")*l.length)],u=getTrialAudioBufferNewImplementation(r,n[a][t][c],audioCtx);s[t]=Object.keys(n[a][t]),o[t]=c,i.push(u)}else{const t=n[a][e],o=getTrialAudioBufferNewImplementation(r,t,audioCtx);i.push(o)}})),{targetSentenceAudio:i,talker:a,categoriesChosen:o,allCategories:s}},getMaskerSentenceAudio=(e,t,r,n,i,a)=>{var o=[];const s={t:void 0},l={t:i};for(;l.t===i;)s.t=Math.floor(random$1("stimuli")*e.length),l.t=e[s.t];return t.map((e=>{if("#"===e[0]){const t=e.substring(1),i=Object.keys(n[l.t][t]),s={t:void 0},c={t:a[t]};for(;c.t===a[t];)s.t=Math.floor(random$1("stimuli")*i.length),c.t=i[s.t];const u=getTrialAudioBufferNewImplementation(r,n[l.t][t][c.t],audioCtx);o.push(u)}else{const t=n[l.t][e],i=getTrialAudioBufferNewImplementation(r,t,audioCtx);o.push(i)}})),o},vocoderPhraseSetupClickableCategory=(e,t)=>{const r=document.createElement("div");r.id="responseScreen",r.classList.add("responseScreen");const n=document.createElement("div");n.classList.add("vocoder-phrase-header"),n.id="vocoder-phrase-header",n.innerHTML=vocoderPhrase,r.appendChild(n);const i=document.createElement("div");i.classList.add("vocoder-phrase-clickable-category"),i.id="vocoder-phrase-clickable-category",r.appendChild(i);const a=e.all,o=Object.keys(a),s=o.length,l={};o.forEach(((e,r,n)=>{const o=document.createElement("div");o.classList.add("vocoder-phrase-category-container"),o.id="vocoder-phrase-category-container",o.style.marginLeft="10vw";const c=document.createElement("div");c.classList.add("vocoder-phrase-category-title"),c.id="vocoder-phrase-category-title",c.innerHTML=e;const u=document.createElement("div");u.classList.add("vocoder-phrase-category-list"),u.id="vocoder-phrase-category-list",u.style.display="flex",u.style.flexDirection="column",a[e].forEach(((r,n,i)=>{const a=document.createElement("div");a.className="vocoder-phrase-category-item",a.innerHTML=r,a.onclick=()=>{l[e]=r;const n=document.getElementById("vocoder-phrase-header");n.innerHTML=vocoderPhrase,n.innerHTML=n.innerHTML.replace("{"+e+"}",r);const i=u.children;for(let e=0;e<i.length;e++)i[e].innerHTML===r?i[e].classList.add("vocoder-phrase-item-selected"):i[e].classList.remove("vocoder-phrase-item-selected");const a=Object.keys(l),o=[];a.length===s&&(t.clickTime.push(performance.now()),a.map((e=>{o.push(e+"_"+l[e])})),t.current=o)},u.appendChild(a)})),o.appendChild(c),o.appendChild(u),i.appendChild(o)})),document.body.appendChild(r)},vocoderPhraseRemoveClickableCategory=e=>{e.current=[],e.onsetTime=0,e.clickTime=[];const t=document.querySelectorAll(".responseScreen");t.length>0&&t.forEach((e=>{document.body.removeChild(e)}))};var maskerList={},targetList$1={},whiteNoise$1,whiteNoiseData$1;const initToneInMelodySoundFiles=async e=>{const t=await initSoundFilesWithPromiseAll(e);maskerList=t.maskers,targetList$1=t.target},getToneInMelodyTrialData=async(e,t,r,n,i,a,o)=>{var s=Math.floor(random$1("stimuli")*maskerList[e].length),l=await maskerList[e][s].file,c=l.getChannelData(0);setWaveFormToZeroDbSPL(c);var u=0,d=0;const h=i-a;if(o){whiteNoise$1=audioCtx.createBuffer(1,c.length,audioCtx.sampleRate),whiteNoiseData$1=whiteNoise$1.getChannelData(0);for(var p=0;p<whiteNoiseData$1.length;p++)whiteNoiseData$1[p]=2*random$1("audio")-1;setWaveFormToZeroDbSPL(whiteNoiseData$1),u=getMaxValueOfAbsoluteValueOfBuffer(whiteNoiseData$1)/1,d=getGainValue(h)}const f=getMaxValueOfAbsoluteValueOfBuffer(c)/1,m=n-a,g=getGainValue(m);var _,y;if(adjustSoundDbSPL(c,m),o&&adjustSoundDbSPL(whiteNoiseData$1,h),t){s=Math.floor(random$1("stimuli")*targetList$1[e].length);var b=(_=await targetList$1[e][s].file).getChannelData(0);setWaveFormToZeroDbSPL(b);const t=getCorrectedInDbAndSoundDBSPLForToneInMelody(r,a,b,1-f*g-u*d);adjustSoundDbSPL(b,t.inDB),y=t.correctedSoundDBSPL}return t?{trialSoundMelody:mergeBuffers$1(o?[l,_,whiteNoise$1]:[l,_],audioCtx),targetVolume:y}:{trialSoundMelody:o?mergeBuffers$1([l,whiteNoise$1],audioCtx):l}},getCorrectedInDbAndSoundDBSPLForToneInMelody=(e,t,r,n)=>{const i=getMaxValueOfAbsoluteValueOfBuffer(r)/1,a=e-t,o=i*getGainValue(a)>n?calculateDBFromRMS(Math.abs(n/i)):a;return{inDB:o,correctedSoundDBSPL:t+o}};var targetList={},whiteNoise,whiteNoiseData;const initSpeechInNoiseSoundFiles=async e=>{const t=await initSoundFilesWithPromiseAll(e);return targetList=t.target,new Promise(((e,t)=>{const r=setInterval((()=>{0!==Object.keys(targetList).length&&(clearInterval(r),e(!0))}),100)}))},getSpeechInNoiseTrialData=async(e,t,r,n,i)=>{var a,o=Math.floor(random$1("stimuli")*targetList[e].length),s=(a=await targetList[e][o].file).getChannelData(0);setWaveFormToZeroDbSPL(s);var l=0,c=0;if(i){whiteNoise=audioCtx.createBuffer(1,s.length,audioCtx.sampleRate),whiteNoiseData=whiteNoise.getChannelData(0);for(var u=0;u<whiteNoiseData.length;u++)whiteNoiseData[u]=2*random$1("audio")-1;setWaveFormToZeroDbSPL(whiteNoiseData);const e=r-n;l=getMaxValueOfAbsoluteValueOfBuffer(whiteNoiseData)/1,c=getGainValue(e),adjustSoundDbSPL(whiteNoiseData,e)}const d=getCorrectedInDbAndSoundDBSPLForSpeechInNoise(t,n,s,1-l*c);return adjustSoundDbSPL(s,d.inDB),{targetList:targetList[e],trialSound:i?mergeBuffers$1([a,whiteNoise],audioCtx):a,correctAnsIndex:o,targetVolume:d.correctedSoundDBSPL}},getTargetSoundListTrialData=async(e,t,r,n,i)=>{const a=targetSoundListMap[e].currentIndex,o=targetSoundListMap[e].list[a].left,s=targetSoundListMap[e].list[a].right;let l=targetSoundListFiles[e][o],c=targetSoundListFiles[e][s];const u=cloneAudioBuffer(l).getChannelData(0),d=cloneAudioBuffer(c).getChannelData(0);setWaveFormToZeroDbSPL(u),setWaveFormToZeroDbSPL(d);const h=getCorrectedInDbAndSoundDBSPLForSpeechInNoise(t,n,u,1),p=getCorrectedInDbAndSoundDBSPLForSpeechInNoise(t,n,d,1);adjustSoundDbSPL(u,h.inDB),adjustSoundDbSPL(d,p.inDB),targetSoundListTrialData.left={name:o,file:l},targetSoundListTrialData.right={name:s,file:c},targetSoundListTrialData.targetVolume=h.correctedSoundDBSPL,targetSoundListTrialData.whiteNoiseLevel=r,targetSoundListTrialData.trialSound={names:[o,s],file:combineToStereo(audioCtx,l,c)},targetSoundListMap[e].currentIndex++},combineToStereo=(e,t,r)=>{if(t.sampleRate!==r.sampleRate)throw new Error("Left and right buffers must have the same sample rate");const n=Math.max(t.length,r.length),i=t.sampleRate,a=e.createBuffer(2,n,i);a.getChannelData(0).set(t.getChannelData(0));return a.getChannelData(1).set(r.getChannelData(0)),a},getCorrectedInDbAndSoundDBSPLForSpeechInNoise=(e,t,r,n)=>{const i=getMaxValueOfAbsoluteValueOfBuffer(r)/1,a=e-t,o=i*getGainValue(a)>n?calculateDBFromRMS(n/i):a;return{inDB:o,correctedSoundDBSPL:t+o}},t=(e,t,r="")=>{try{const n=readi18nPhrases(e,t);return"string"==typeof n?n:r}catch{return r}},_needSoundOutput={current:"headphone"},HEADPHONE_CHECK_CONFIG={centerFrequencyHz:600,bandwidthFraction:.06,intervalDurationSec:1,interStimulusIntervalSec:.5,fadeSec:.025,fftLength:65536,noisePeak:.5,numTrials:6,passThreshold:4},headphoneCheckIsNeeded=(e=_needSoundOutput.current)=>{const t=(e||"").trim().toLowerCase();return"headphone"===t||"loudspeaker"===t},runHeadphoneCheck=async(t={})=>{const r=(t.requirement??_needSoundOutput.current??"").trim().toLowerCase();if(!headphoneCheckIsNeeded(r))return{ran:!1,requirement:r,numTrials:0,numCorrect:0,passThreshold:HEADPHONE_CHECK_CONFIG.passThreshold,detectedHeadphones:!1,meetsRequirement:!0,responses:[],summary:"",audioDeviceLabel:null};const n=t.mountNode??document.body,i=new(window.AudioContext||window.webkitAudioContext);t.paramReader&&await applySinkToNewContext(i,desiredSinkForBlock0(t.paramReader));const a=await getAudioOutputDeviceLabel(i);let o=[];try{o=await presentHeadphoneCheckUI(i,n,{paramReader:t.paramReader,rc:t.rc})}finally{try{await i.close()}catch(e){}}const s=o.reduce(((e,t)=>e+(t.correct?1:0)),0),l=s>=HEADPHONE_CHECK_CONFIG.passThreshold,c="headphone"===r?l:!l;return{ran:!0,requirement:r,numTrials:HEADPHONE_CHECK_CONFIG.numTrials,numCorrect:s,passThreshold:HEADPHONE_CHECK_CONFIG.passThreshold,detectedHeadphones:l,meetsRequirement:c,responses:o,audioDeviceLabel:a,summary:buildHeadphoneCheckSummary(r,s,HEADPHONE_CHECK_CONFIG.numTrials,l,c,t.rc?.language?.value||"en")}},getAudioOutputDeviceLabel=async e=>{try{if("undefined"==typeof navigator||!navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.enumerateDevices)return null;const t=await navigator.mediaDevices.getUserMedia({audio:!0});if(t){const r=(await navigator.mediaDevices.enumerateDevices()).filter((e=>"audiooutput"===e.kind));if(console.log("outputs",r),0===r.length)return null;let n="default";if(e&&void 0!==e.sinkId){const t="string"==typeof e.sinkId?e.sinkId:e.sinkId?.id??"";t&&(n=t)}const i=r.find((e=>e.deviceId===n))||r.find((e=>"default"===e.deviceId))||r[0];return t.getTracks().forEach((e=>e.stop())),i?.label??""}return null}catch{return null}},buildThreeIntervalBuffer=(e,t)=>{const r=HEADPHONE_CHECK_CONFIG,n=e.sampleRate,i=Math.round(n*r.intervalDurationSec),a=Math.round(n*r.interStimulusIntervalSec),o=3*i+2*a,s=e.createBuffer(2,o,n),l=s.getChannelData(0),c=s.getChannelData(1);for(let u=1;u<=3;u++){const e=u===t,{leftData:r,rightData:o}=generateInterval(n,i,e),s=(u-1)*(i+a);l.set(r,s),c.set(o,s)}return s},generateInterval=(e,t,r)=>{const n=HEADPHONE_CHECK_CONFIG,i=n.fftLength,a=new Float32Array(i);for(let p=0;p<i;p+=2){let e=random$1("audio");const t=random$1("audio");e<1e-12&&(e=1e-12);const r=Math.sqrt(-2*Math.log(e));a[p]=r*Math.cos(2*Math.PI*t),p+1<i&&(a[p+1]=r*Math.sin(2*Math.PI*t))}const o=a;let s;if(r){const t=new Float32Array(i),r=new Float32Array(i);t.set(a),fft(t,r,!1);const o=e/i,l=n.centerFrequencyHz*(1-n.bandwidthFraction),c=n.centerFrequencyHz*(1+n.bandwidthFraction),u=Math.max(1,Math.floor(l/o)),d=Math.min(i/2-1,Math.ceil(c/o));for(let e=u;e<=d;e++)t[e]=-t[e],r[e]=-r[e],t[i-e]=-t[i-e],r[i-e]=-r[i-e];fft(t,r,!0),s=t}else s=a;const l=new Float32Array(t),c=new Float32Array(t);let u=1e-12;for(let p=0;p<t;p++){const e=o[p],t=s[p];l[p]=e,c[p]=t,Math.abs(e)>u&&(u=Math.abs(e)),Math.abs(t)>u&&(u=Math.abs(t))}const d=n.noisePeak/u,h=Math.max(1,Math.round(e*n.fadeSec));for(let p=0;p<t;p++){let e=1;if(p<h)e=.5*(1-Math.cos(Math.PI*p/h));else if(p>t-h){const r=t-1-p;e=.5*(1-Math.cos(Math.PI*r/h))}l[p]*=d*e,c[p]*=d*e}return{leftData:l,rightData:c}},fft=(e,t,r)=>{const n=e.length;for(let a=1,o=0;a<n;a++){let r=n>>1;for(;o&r;r>>=1)o^=r;if(o^=r,a<o){let r=e[a];e[a]=e[o],e[o]=r,r=t[a],t[a]=t[o],t[o]=r}}const i=r?1:-1;for(let a=2;a<=n;a<<=1){const r=a>>1,o=2*i*Math.PI/a,s=Math.cos(o),l=Math.sin(o);for(let i=0;i<n;i+=a){let n=1,a=0;for(let o=0;o<r;o++){const c=e[i+o],u=t[i+o],d=e[i+o+r]*n-t[i+o+r]*a,h=e[i+o+r]*a+t[i+o+r]*n;e[i+o]=c+d,t[i+o]=u+h,e[i+o+r]=c-d,t[i+o+r]=u-h;const p=n*l+a*s;n=n*s-a*l,a=p}}}if(r)for(let a=0;a<n;a++)e[a]/=n,t[a]/=n},drawTargetSequence=()=>{const e=[1,1,2,2,3,3];for(let t=e.length-1;t>0;t--){const r=Math.floor(random$1("audio")*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e},presentHeadphoneCheckUI=async(e,r,{paramReader:n,rc:i}={})=>{const a={retranslate:()=>{}},o=e=>{let t=!1;try{t="rtl"===(readi18nPhrases("EE_LanguageDirection",e)||"LTR").toString().toLowerCase()}catch{t=!1}l.style.direction=t?"rtl":"ltr",l.style.textAlign=t?"right":"left"},s=mountCompatibilityChrome({paramReader:n,rc:i,stepTitle:t("EE_headphoneCheckTitle",i?.language?.value||"en","Headphone check"),onLanguageChange:e=>{s.setStepTitle(t("EE_headphoneCheckTitle",e,"Headphone check")),o(e);try{a.retranslate()}catch(_e){}}}),l=document.createElement("div");l.id="headphone-check-wrapper",l.style.position="absolute",l.style.top=getCompatibilityBodyTopOffset(),l.style.left="20vw",l.style.right="20vw",l.style.minWidth="60vw",l.style.zIndex="10001",l.style.backgroundColor="#eee",l.style.padding="0",l.style.lineHeight="1.5",o(i?.language?.value||"en"),r.appendChild(l);const c=drawTargetSequence();try{await showIntroPage(l,e,{rc:i,pageState:a});const t=[];for(let r=0;r<c.length;r++){const n=c[r],o=buildThreeIntervalBuffer(e,n);publishPhaseEntered(SIM_PHASE.COMPATIBILITY),setEEState({currentFunction:`headphoneCheck ${r+1}/${c.length}`}),simulateActive&&(window.__simHeadphoneCheckTarget=n);const s=await runOneTrial(l,e,{trialIndex:r,numTrials:c.length,target:n,buffer:o,rc:i,pageState:a});t.push({trial:r+1,target:n,response:s,correct:s===n})}return t}finally{a.retranslate=()=>{},l.remove(),s.unmount()}},showIntroPage=(r,n,{rc:i,pageState:a}={})=>new Promise((o=>{r.innerHTML="";const s=document.createElement("div");r.appendChild(s);const l=document.createElement("div");l.style.display="flex",l.style.alignItems="center",l.style.gap="1rem",l.style.marginTop="1.5rem";const c=document.createElement("button");c.classList.add("btn","btn-success"),c.style.width="fit-content",c.style.padding="10px",c.style.minWidth="9rem",l.appendChild(c),r.appendChild(l);const u=()=>{const e=i?.language?.value||"en",r=t("EE_headphoneCheckIntro",e,"Detect a pure tone hidden in noise.\nThere are [[N11]] trials. In each trial, you will hear three one-second bursts of static noise. One burst contains a faint tone.\nChoose which sound—1, 2, or 3—contains the tone.\nYou may replay each trial as often as you like before answering.\nSet the volume to a comfortable level."),n=fillPhrase(r,{N11:HEADPHONE_CHECK_CONFIG.numTrials});s.innerHTML="",n.split("\n").map((e=>e.trim())).filter((e=>e.length>0)).forEach((e=>{const t=document.createElement("p");t.textContent=e,s.appendChild(t)})),c.textContent=t("EE_compatibilityPreviewRunButton",e,"Run tests")};u(),a&&(a.retranslate=u),c.addEventListener("click",(async()=>{try{await n.resume()}catch(e){}a&&(a.retranslate=()=>{}),o()}))})),runOneTrial=(r,n,{trialIndex:i,numTrials:a,buffer:o,rc:s,pageState:l})=>new Promise((c=>{r.innerHTML="";const u=document.createElement("p");r.appendChild(u);const d=document.createElement("button");d.classList.add("btn","btn-secondary"),d.style.width="fit-content",d.style.padding="10px",d.style.minWidth="9rem",d.style.marginTop="0.5rem",d.style.marginRight="0.75rem",d.style.transition="background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease",r.appendChild(d);const h=document.createElement("div");h.style.marginTop="1.5rem",h.style.display="flex",h.style.gap="0.75rem",r.appendChild(h);const p=[1,2,3].map((e=>{const t=document.createElement("button");return t.classList.add("btn","btn-outline-secondary"),t.style.width="5rem",t.style.padding="10px",t.style.fontSize="1rem",t.style.transition="background-color 0.15s ease, color 0.15s ease, outline 0.05s ease, opacity 0.15s ease",t.textContent=String(e),h.appendChild(t),t})),f=document.createElement("div");f.style.position="fixed",f.style.bottom="0",f.style.right="0.25rem",f.style.fontSize="26px",f.style.lineHeight="1",f.style.color="#000",f.style.zIndex="10002",r.appendChild(f);const m=e=>{d.disabled=e,p.forEach((t=>{t.disabled=e}))},g=()=>{const e=s?.language?.value||"en";u.textContent=t("EE_headphoneCheckTrialPrompt",e,"Listen carefully. Which of the three sounds contains the hidden tone?"),d.textContent=t("EE_headphoneCheckPlayAgain",e,"Play again"),f.textContent=fillPhrase(t("EE_headphoneCheckTrialNumber",e,"Trial [[N11]] of [[N22]]"),{N11:i+1,N22:a})};g(),l&&(l.retranslate=g);let _=!1,y=null,b=!1;const v=HEADPHONE_CHECK_CONFIG,S=1e3*v.intervalDurationSec,w=1e3*v.interStimulusIntervalSec,T=[],E=()=>{T.forEach(clearTimeout),T.length=0,p.forEach((e=>{e.style.outline="",e.style.backgroundColor="",e.style.color=""}))},x=async()=>{if(_||b)return;_=!0,m(!0),simulateActive&&setTimeout((()=>{if(_&&!b){_=!1;try{y?.stop()}catch{}y=null,E(),m(!1)}}),1e3*o.duration+1250);try{await n.resume()}catch(e){}const t=n.createBufferSource();t.buffer=o,t.connect(n.destination),y=t,(()=>{for(let e=0;e<3;e++){const t=e*(S+w);T.push(setTimeout((()=>{p.forEach(((t,r)=>{r===e?(t.style.outline="3px solid #4CAF50",t.style.backgroundColor="#e8f5e9"):(t.style.outline="",t.style.backgroundColor="")}))}),t)),T.push(setTimeout((()=>{p[e].style.outline="",p[e].style.backgroundColor=""}),t+S))}})(),t.onended=()=>{_=!1,y=null,E(),b||m(!1)},t.start()},A=t=>{if(b)return;if(t<1||t>3)return;b=!0,m(!0),E();const r=p[t-1];if(r.style.backgroundColor="#333",r.style.color="#fff",y)try{y.stop()}catch(e){}document.removeEventListener("keydown",C),l&&(l.retranslate=()=>{}),setTimeout((()=>{c(t)}),350)};d.addEventListener("click",(()=>{d.disabled||x()})),p.forEach(((e,t)=>{e.addEventListener("click",(()=>{e.disabled||A(t+1)}))}));const C=e=>{if(!b)if(" "===e.key||"Space"===e.code)e.preventDefault(),d.disabled||x();else if("1"===e.key||"2"===e.key||"3"===e.key){const t=Number(e.key);p[t-1].disabled||A(t)}};document.addEventListener("keydown",C),m(!0),setTimeout((()=>{b||x()}),500)})),renderHeadphoneCheckSummary=(e,t="en")=>e&&e.ran?buildHeadphoneCheckSummary(e.requirement,e.numCorrect,e.numTrials,e.detectedHeadphones,e.meetsRequirement,t):"",buildHeadphoneCheckSummary=(e,r,n,i,a,o="en")=>{const s=i?t("EE_headphoneCheckHeadphones",o,"headphones"):t("EE_headphoneCheckLoudspeakersOrUnclear",o,"loudspeakers or unclear"),l="headphone"===e?t("EE_headphoneCheckHeadphones",o,"headphones"):t("EE_headphoneCheckLoudspeakers",o,"loudspeakers"),c=a?t("EE_headphoneCheckSummaryPass",o,"✅ Headphone check passed: [[N11]]/[[N22]] correct. Detected [[DDD]] (required: [[RRR]]).\n"):t("EE_headphoneCheckSummaryFail",o,"❌ Headphone check failed: [[N11]]/[[N22]] correct. Detected [[DDD]] (required: [[RRR]]).");return fillPhrase(c,{N11:r,N22:n,DDD:s,RRR:l})},PREVIEW_PAGE_ID="compatibility-preview-page",buildTestPlan=e=>{const t=[];return willCalibrateDistance(e)&&t.push({id:"chooseCamera",labelKey:"EE_compatibilityTestChooseCamera"}),_needSoundOutput.current=e.read("_needSoundOutput")?.[0]||"headphone",neededSoundOutputKinds(e).length>0&&t.push({id:"soundOutput",labelKey:"RC_SoundOutput"}),headphoneCheckIsNeeded(_needSoundOutput.current)&&t.push({id:"headphoneCheck",labelKey:"headphone"===_needSoundOutput.current?"EE_compatibilityTestHeadphoneCheckHeadphone":"EE_compatibilityTestHeadphoneCheckLoudspeaker"}),t},showCompatibilityPreviewPage=({paramReader:e,rc:t,testPlan:r,knownFacts:n})=>new Promise((i=>{const a=mountCompatibilityChrome({paramReader:e,rc:t,showEyebrow:!1,stepTitle:tryReadPhrase$1("EE_compatibilityTitle1of2",t?.language?.value||"en")||tryReadPhrase$1("EE_compatibilityTitle",t?.language?.value||"en")||"",onLanguageChange:e=>{a.setStepTitle(tryReadPhrase$1("EE_compatibilityTitle1of2",e)||tryReadPhrase$1("EE_compatibilityTitle",e)||""),_()}}),o=document.createElement("div");o.id=PREVIEW_PAGE_ID,o.style.display="flex",o.style.flexDirection="column",o.style.position="absolute",o.style.top=getCompatibilityBodyTopOffset(),o.style.right="20vw",o.style.left="20vw",o.style.minWidth="60vw",o.style.zIndex="10001",o.style.backgroundColor="#eee",o.style.lineHeight="1.5";const s=document.createElement("h2");s.style.margin="0 0 0.5rem 0",s.style.fontSize="1.5rem",s.style.fontWeight="500",s.style.lineHeight="1.4";const l=document.createElement("ul");l.style.listStyle="none",l.style.padding="0",l.style.margin="0 0 1.5rem 0",l.style.fontSize=COMPAT_LIST_FONT_SIZE,l.style.lineHeight=COMPAT_LIST_LINE_HEIGHT;const c=document.createElement("ol");c.style.listStyle="none",c.style.padding="0",c.style.margin="0px 0px 0.8rem",c.style.fontSize=COMPAT_LIST_FONT_SIZE,c.style.lineHeight=COMPAT_LIST_LINE_HEIGHT;const u=resolvePaperRulerAlert(e),d=document.createElement("p");d.style.fontStyle="italic",d.style.opacity="0.85",d.style.margin="0 0 0 0";const h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.gap="1rem",h.style.margin="0 0 0.75rem 0";const p=document.createElement("button");p.classList.add("btn","btn-success"),p.style.width="fit-content",p.style.padding="10px",p.style.minWidth="9rem",p.style.fontWeight="bold",p.style.fontSize="1.3rem",h.appendChild(p);const f=document.createElement("div");f.id="prolific-policy-preview",f.style.fontSize="0.9rem",f.style.position="fixed",f.style.bottom="3rem",f.style.maxWidth="57ch",f.style.zIndex="10001";const m=document.createElement("p");m.id="prolific-rule-preview",m.style.marginBottom="2px",f.appendChild(m);const g=document.createElement("p");g.innerHTML="https://researcher-help.prolific.com/en/article/4ae222",g.style.pointerEvents="none",g.style.marginBottom="0",f.appendChild(g),o.appendChild(s),o.appendChild(l),o.appendChild(h),o.appendChild(c),o.appendChild(d),o.appendChild(f);const _=()=>{const i=t.language.value,a=isLanguageRTL(i);o.style.direction=a?"rtl":"ltr",o.style.textAlign=a?"right":"left";const h=r.length>0;c.innerHTML="";const g=e=>{if(!e)return;const t=document.createElement("li");styleCompatListItemGrid(t);const r=document.createElement("span");r.textContent=`${c.childElementCount+1}.`,r.style.textAlign="start";const n=document.createElement("span");n.innerHTML=e,neutralizeEnlargedInlineIcons(n),t.appendChild(r),t.appendChild(n),c.appendChild(t)},_=()=>{if(willCalibrateScreenSize(e)&&g(renderMarkdown(tryReadPhrase$1("EE_compatibilityNeedCreditCard",i)||"")),u){const e=tryReadPhrase$1(u.phraseKey,i)||"";g(renderPhraseHTML(fillPhrase(e,u.params)))}};r.some((e=>"chooseCamera"===e.id))||_(),r.forEach((e=>{g(renderMarkdown(tryReadPhrase$1(e.labelKey,i)||e.labelKey)),"chooseCamera"===e.id&&_()})),c.style.display=c.childElementCount>0?"":"none";const y=n.some((e=>!e.ok));s.innerHTML=renderMarkdown(tryReadPhrase$1("EE_compatibilityPreviewKnownTitle",i)||""),l.innerHTML=buildKnownFactsList(n,i).innerHTML,y?(d.style.display="",d.innerHTML=renderMarkdown(tryReadPhrase$1("EE_compatibilityPreviewNoteHasIssues",i)||"")):(d.style.display="none",d.innerHTML=""),f.style.textAlign=a?"right":"left",f.style.direction=a?"rtl":"ltr",a?(f.style.right="3rem",f.style.left=""):(f.style.left="3rem",f.style.right=""),m.innerHTML=renderMarkdown(tryReadPhrase$1("EE_ProlificCompatibilityRule",i)||""),p.textContent=h?tryReadPhrase$1("EE_compatibilityPreviewRunButton",i)||"":tryReadPhrase$1("T_proceed",i)||""};_(),document.body.prepend(o),p.focus({preventScroll:!0});let y=!1;const b=()=>{y||(y=!0,p.removeEventListener("click",b),document.removeEventListener("keydown",v,!0),o.remove(),a.unmount(),i())},v=e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),b())};p.addEventListener("click",b),document.addEventListener("keydown",v,!0)})),runCameraSelectionStep=async({paramReader:e,rc:t,keypad:r})=>{const n=formCalibrationList(e).find((e=>"trackDistance"===("string"==typeof e?e:e.name)));if(!n||"function"!=typeof t.selectCamera)return;const i="object"==typeof n&&n.options||{};t.keypadHandler.keypad=r.handler;const a=createCameraPageLanguageMenu(e,t);try{await t.selectCamera(i)}finally{a?.remove()}},runHeadphoneCheckStep=async({paramReader:t,rc:r,psychoJS:n})=>{if(!headphoneCheckIsNeeded(_needSoundOutput.current))return null;try{const e=await runHeadphoneCheck({requirement:_needSoundOutput.current,paramReader:t,rc:r});return n&&(n.experiment.addData("HeadphoneCheck",JSON.stringify(e)),n.experiment.nextEntry()),e}catch(e){return console.error("Headphone check failed to run:",e),null}},runFinalCompatibilityReportStep=async({paramReader:e,rc:t,psychoJS:r,measureMeters:n,headphoneCheckResult:i,keypad:a,KeypadHandler:o,_key_resp_event_handlers:s,_key_resp_allKeys:l,ConnectionManager:c,ConnectionManagerDisplay:u,getConnectionManagerDisplay:d,handleLanguageChangeForConnectionManagerDisplay:h,keypadRequiredInExperiment:p,needPhoneSurveyRef:f,needComputerSurveyBoolRef:m,EasyEyesPeer:g,quitPsychoJS:_})=>{const y=!(!i||!i.ran),b=!y||i.meetsRequirement,v=await checkSystemCompatibility(e,t.language.value,t,!0,r,n,e.read("_needBrowserActualName")[0],b),S=y?e=>{const t=renderHeadphoneCheckSummary(i,e);return t?"\n\n"+t:""}:null,w=!1,T=(e.read("_needCalibratedSound")?.[0]||"").split(",");let E=null;if(f.current){const n={text:readi18nPhrases("RC_smartphoneOkThanks",t.language.value),onError:()=>{Swal.fire({allowOutsideClick:!1,html:renderPhraseHTML(readi18nPhrases("RC_cantDrawQR",t.language.value)),icon:"error",confirmButtonText:readi18nPhrases("RC_cantConnectPhone_Button",t.language.value)}).then((async n=>{if(!n.isConfirmed)return;const{mic:i,loudspeaker:a}=await handleCantReadQROnError(t,r,f.current,T,m.current);f.current&&(r.experiment.addData("Microphone survey",JSON.stringify(i.phoneSurvey)),r.experiment.nextEntry()),m.current&&(r.experiment.addData("Loudspeaker survey",JSON.stringify(a)),r.experiment.nextEntry()),showExperimentEnding(),_("",!0,e)}))}};E=new g.ExperimentPeer(n),await E.init()}return await displayCompatibilityMessage(v.notes,e,t,v.promptRefresh,v.proceed,E,w,!1,m.current,T,r,_,a,o,s,l,c.handler,u,d,h,p,S,b)},runDeviceCompatibilityFlow=async({paramReader:e,rc:t,psychoJS:r,measureMeters:n,keypad:i,KeypadHandler:a,_key_resp_event_handlers:o,_key_resp_allKeys:s,ConnectionManager:l,ConnectionManagerDisplay:c,getConnectionManagerDisplay:u,handleLanguageChangeForConnectionManagerDisplay:d,keypadRequiredInExperiment:h,needPhoneSurveyRef:p,needComputerSurveyBoolRef:f,EasyEyesPeer:m,quitPsychoJS:g})=>{const _=buildTestPlan(e),y=summarizeKnownDeviceFacts(e,t);if(await showCompatibilityPreviewPage({paramReader:e,rc:t,testPlan:_,knownFacts:y}),_.some((e=>"chooseCamera"===e.id))&&(status.currentFunction="compatChooseCamera",await runCameraSelectionStep({paramReader:e,rc:t,keypad:i})),_.some((e=>"soundOutput"===e.id))){status.currentFunction="compatSoundOutput";if(!(await runSoundOutputSelectionStep({paramReader:e,rc:t})))return{proceedButtonClicked:!0,proceedBool:!1,mic:{},loudspeaker:{},gotLoudspeakerMatchBool:!1}}const b=_.some((e=>"headphoneCheck"===e.id))?(status.currentFunction="compatHeadphoneCheck",await runHeadphoneCheckStep({paramReader:e,rc:t,psychoJS:r})):null,v=await runFinalCompatibilityReportStep({paramReader:e,rc:t,psychoJS:r,measureMeters:n,headphoneCheckResult:b,keypad:i,KeypadHandler:a,_key_resp_event_handlers:o,_key_resp_allKeys:s,ConnectionManager:l,ConnectionManagerDisplay:c,getConnectionManagerDisplay:u,handleLanguageChangeForConnectionManagerDisplay:d,keypadRequiredInExperiment:h,needPhoneSurveyRef:p,needComputerSurveyBoolRef:f,EasyEyesPeer:m,quitPsychoJS:g});return v.proceedBool&&(await runSoundOutputBlock0Page({paramReader:e,rc:t}),startSoundOutputReconnectWatch({paramReader:e,rc:t,quitPsychoJS:g})),v};class VernierStim{constructor(){this.color,this.lineWidth=2,this.targetDurationSec,this.targetGapDeg,this.targetLengthDeg,this.targetOffsetDeg,this.targetThicknessDeg,this.directionBool,this.nominalPosPx,this._pos,this.markingFixationMotionRadiusDeg,this.markingFixationMotionSpeedDegPerSec,this._ctx=createDisposableCanvas(1/0),this.stims=[new ShapeStim({name:"upper line",win:psychoJS.window,lineWidth:this.lineWidth,closeShape:!1,lineColor:new Color$1("black"),opacity:void 0,depth:1/0,vertices:[[190,10],[190,50]],units:"pix"}),new ShapeStim({name:"lower line",win:psychoJS.window,lineWidth:2,closeShape:!1,lineColor:new Color$1("black"),opacity:void 0,depth:1/0,vertices:[[210,-10],[210,-50]],units:"pix"})]}setAutoDraw(e){this.stims.forEach((t=>t.setAutoDraw(e)))}setLineWidth(e){this.stims.forEach((t=>t.setLineWidth(e)))}update(e,t,r){this.directionBool=random$1("stimuli")>.5,this.setColor(colorRGBASnippetToRGBA(e.read("targetColorRGBA",t))),this.targetDurationSec=e.read("targetDurationSec",t),this.targetGapDeg=e.read("targetGapDeg",t),this.targetLengthDeg=e.read("targetLengthDeg",t),this.targetThicknessDeg=e.read("targetThicknessDeg",t),this.markingFixationMotionRadiusDeg=e.read("markingFixationMotionRadiusDeg",t),this.markingFixationMotionSpeedDegPerSec=e.read("markingFixationMotionSpeedDegPerSec",t),this.nominalPosPx=XYPxOfDeg(0,[e.read("targetEccentricityXDeg",t),e.read("targetEccentricityYDeg",t)]),this._pos=this.nominalPosPx,this.targetOffsetDeg=this.restrictOffsetDeg(r),this.setVertices(this.getVerticesPx(this.targetOffsetDeg)),this.setLineWidth(Math.abs(XYPxOfDeg(0,[this.targetThicknessDeg,0])[0]))}restrictOffsetDeg(e){const t=[-Screens[0].window._size[0]/2,-Screens[0].window._size[1]/2],r=[Screens[0].window._size[0]/2,Screens[0].window._size[1]/2];let n=new Rectangle(t,r),i=e;for(;!isRectInRect(this.getStimulusRect(i),n)&&i>1e-6;)console.count("Decreasing targetOffsetDeg"),i*=.9;return i}getStimulusRect(e){const[t,r]=this.getVerticesPx(e),n=[t[0][0],t[1][0],r[0][0],r[1][0]],i=[t[0][1],t[1][1],r[0][1],r[1][1]],a=[Math.min(...n),Math.min(...i)];let o=new Rectangle(a,[Math.max(...n),Math.max(...i)]);const s=[targetEccentricityDeg.x,targetEccentricityDeg.y],l=this.markingFixationMotionRadiusDeg>0&&this.markingFixationMotionSpeedDegPerSec>0?[degreesToPixels(this.markingFixationMotionRadiusDeg,s,"horizontal"),degreesToPixels(this.markingFixationMotionRadiusDeg,s,"vertical")]:[0,0];return o=o.inset(-l[0],-l[1]),o}setPos(e){const t=this.stims.map((e=>e.getVertices())).map((e=>e.map((e=>[e[0]-this.nominalPosPx[0],e[1]-this.nominalPosPx[1]])))),r=t.map((t=>t.map((t=>[t[0]+e[0],t[1]+e[1]]))));this.nominalPosPx=e,this._pos=this.nominalPosPx,this.setVertices(r)}setVertices(e){this.stims[0].setVertices(e[0]),this.stims[1].setVertices(e[1])}setColor(e){this.color=new Color$1(e),this.stims.forEach((e=>e.setLineColor(this.color)))}getVerticesDeg(e){const t=e/2,r=this.targetGapDeg/2,n=targetEccentricityDeg.x,i=targetEccentricityDeg.y;return this.directionBool?[[[n-t,i+r+this.targetLengthDeg],[n-t,i+r]],[[n+t,i-r],[n+t,i-r-this.targetLengthDeg]]]:[[[n-t,i-r],[n-t,i-r-this.targetLengthDeg]],[[n+t,i+r+this.targetLengthDeg],[n+t,i+r]]]}getVerticesPx(e){const t=[],r=this.getVerticesDeg(e);for(const[n,i]of r.entries()){t[n]=[];for(const[e,r]of i.entries())t[n][e]=XYPxOfDeg(0,r)}return t}getLowerLineVertices(e){const t=this.directionBool?e:-e,r=targetEccentricityDeg.x+t,n=targetEccentricityDeg.y-this.targetGapDeg/2;return[XYPxOfDeg(0,[r,n]),XYPxOfDeg(0,[r,n+this.targetLengthDeg])]}getUpperLineVertices(e){const t=this.directionBool?-e:e,r=targetEccentricityDeg.x+t,n=targetEccentricityDeg.y+this.targetGapDeg/2;return[XYPxOfDeg(0,[r,n]),XYPxOfDeg(0,[r,n+this.targetLengthDeg])]}_updateIfNeeded(){this.stims.forEach((e=>e._updateIfNeeded()))}get status(){return this.stims[0].status}get tStart(){return this.stims[0].tStart}get frameNStart(){return this.stims[0].frameNStart}set status(e){this.stims.forEach((t=>t.status=e))}set tStart(e){this.stims.forEach((t=>t.tStart=e))}set frameNStart(e){this.stims.forEach((t=>t.frameNStart=e))}}const downloadTextFile=(e,t)=>{const r=document.createElement("a");r.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),r.setAttribute("download",e),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)},saveParticipantIdFile=async(e,t)=>{if(!e)return;const r=`EasyEyes_${t}_${e}.txt`,n=`Please keep this file to facilitate participation in future sessions. When an experiment has several sessions, you can use this file to connect them, while retaining your anonymity.
|
|
272
272
|
|
|
273
273
|
EasyEyesID ${e}
|
|
274
274
|
EasyEyesSession ${t}
|
|
@@ -317,7 +317,7 @@ ${a??""}
|
|
|
317
317
|
</div>
|
|
318
318
|
<div style="font-weight: bold; font-size: 14px;">${e}</div>
|
|
319
319
|
</div>
|
|
320
|
-
`}g+="</div>",g+="\n <style>\n .thumbnail-option:hover {\n border-color:rgb(0, 0, 0) !important;\n background-color: #e7f3ff !important;\n transform: scale(1.02);\n transition: all 0.2s ease;\n }\n .thumbnail-option {\n transition: all 0.2s ease;\n }\n .thumbnail-option img {\n border: 1px solid #ddd;\n border-radius: 4px;\n }\n </style>\n ",f=g}else{f+='<div class="threshold-answers-set">';for(const e of c)f+=`<button class="threshold-button threshold-answer" data-answer="${e}">${e}</button>`;f+="</div>";for(const e of c)m.set(e,e)}else f+='<input type="text" class="threshold-answer">';const _=readFontDirection(paramReader,e),y="horizontal"===paramReader.read("questionAnswerLayout",e),b={title:l,stopKeydownPropagation:!1,showCancelButton:!1,showDenyButton:!1,showConfirmButton:!0,allowEnterKey:!1,allowOutsideClick:!1,allowEscapeKey:!1,...void 0!==t.backdrop?{backdrop:t.backdrop}:{},customClass:{confirmButton:"threshold-button"+(d?" hidden-button":""),container:[isFontLTR(_)?"":"right-to-left",y?"qa-answers-horizontal":"",t.containerClass||""].filter(Boolean).join(" "),title:isFontLTR(_)?"":"right-to-left"},showClass:{popup:"fade-in",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-show"},hideClass:{popup:"",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"}};let v;if(p?(b.html=f,b.focusConfirm=!1,b.showConfirmButton=!1,b.allowEnterKey=!1,b.allowEscapeKey=!1):d?(b.input="radio",b.inputOptions=m,b.inputAttributes={autocapitalize:"off"}):(b.input="textarea",b.inputAttributes={autocapitalize:"off"}),b.didOpen=()=>{if(t.spareFraction>0){const e=document.querySelector(".swal2-container"),r=document.querySelector(".swal2-popup");if(e&&r){const n=t.spareFraction,i=t.where||"top";e.style.position="fixed",e.style.setProperty("background","transparent","important"),e.style.zIndex="1000000",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.padding="0",e.style.margin="0",e.style.overflow="hidden","top"===i?(e.style.top=100*(1-n)+"%",e.style.left="0",e.style.width="100%",e.style.height=100*n+"%"):"bottom"===i?(e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height=100*n+"%"):"left"===i?(e.style.top="0",e.style.left=100*(1-n)+"%",e.style.width=100*n+"%",e.style.height="100%"):(e.style.top="0",e.style.left="0",e.style.width=100*n+"%",e.style.height="100%");const a=window.innerWidth,o=window.innerHeight,s="left"===i||"right"===i?a*n:a,l="top"===i||"bottom"===i?o*n:o,c=.96;r.classList.remove("fade-in"),r.style.animation="none",r.style.maxWidth="none",r.style.maxHeight="none",r.style.margin="0",r.querySelectorAll(".swal2-html-container, .swal2-radio, .swal2-textarea, .swal2-input").forEach((e=>{e.style.maxHeight="none",e.style.overflow="visible"}));const u=()=>{r.style.transform="none";const e=r.scrollWidth,t=r.scrollHeight;if(!e||!t)return;const n=Math.min(1,s*c/e,l*c/t);r.style.transformOrigin="center center",r.style.transform=`scale(${n})`};u(),"undefined"!=typeof ResizeObserver&&new ResizeObserver((()=>u())).observe(r)}}if(p){const e=(e,t)=>{document.querySelectorAll(".thumbnail-option").forEach((e=>{e.style.borderColor="transparent",e.style.backgroundColor="transparent",e.style.transform="scale(1)"})),e.style.borderColor="#007bff",e.style.backgroundColor="#f8f9fa",e.style.transform="scale(1.02)",Swal.close(),window.thumbnailResolveFunction&&window.thumbnailResolveFunction({value:t})};document.querySelectorAll(".thumbnail-option").forEach((t=>{t.addEventListener("click",(()=>{const r=t.getAttribute("data-answer");e(t,r)}))}));const t=setInterval((()=>{if(skipTrialOrBlock.skipBlock)return clearInterval(t),Swal.close(),void(window.thumbnailResolveFunction&&window.thumbnailResolveFunction({value:null}))}),200)}else if(d){const e=setInterval((()=>{if(skipTrialOrBlock.skipBlock)return clearInterval(e),void Swal.close();const t=document.querySelectorAll(".swal2-radio input");for(const r of t)r.checked&&(clearInterval(e),document.getElementsByClassName("swal2-confirm")[0].click())}),200)}else{const e=setInterval((()=>{if(toShowCursor())return clearInterval(e),void Swal.close()}),200)}const r=document.querySelector(".swal2-title");r&&(r.style.fontFamily=instructionFont.current,r.style.font=instructionFont.current),styleNodeAndChildrenRecursively(document.querySelector(".swal2-popup"),{color:colorRGBASnippetToRGBA(paramReader.read("instructionFontColorRGBA",e))})},isFullscreen()||(await requestFullscreenSafe(rc),clearFullscreenWasLost()),p?(v=await withBreadcrumb("questionAndAnswerSwal",(()=>new Promise((e=>{window.thumbnailResolveFunction=e,showCursor(),Swal.fire(b).then((()=>{}))})))),delete window.thumbnailResolveFunction):(showCursor(),v=await withBreadcrumb("questionAndAnswerSwal",(()=>Swal.fire(b)))),v){const t=v.value??"";correctAns.current=s;const o=getQuestionAndAnswerColumnName(h,paramReader.read("conditionName",e));psychoJS.experiment.addData(o,t),psychoJS.experiment.addData("questionAndAnswerNickname"+n,h),psychoJS.experiment.addData("questionAndAnswerQuestion"+n,l),psychoJS.experiment.addData("questionAndAnswerCorrectAnswer"+n,s),psychoJS.experiment.addData("questionAndAnswerImageFileName"+n,imageConfig.currentImageFullFileName),psychoJS.experiment.addData("questionAndAnswerResponse"+n,t);const c=getAnswerValue(`${e}|${r-1}`,t);void 0!==c&&psychoJS.experiment.addData(o+".value",c),t===s?(imageConfig.responsePositiveFeedbackBool&&a.play(),incrementTrialCorrectThisBlock(status.block_condition),i=1):i=0}}return i},imageAdjustState={active:!1,finished:!1,thresholdParameter:"",thresholdGuess:0,thresholdGuessSide:0,currentValue:0,currentXYPx:null,zeroEccentricityXPx:null,pendingOffsetPx:0,stepPx:10,stepMorePx:40,scaleUp:1.05,scaleUpMore:1.2,imageStim:null,keydownHandler:null},imageAdjustStepFallbackPx=10,imageAdjustStepMoreFallbackPx=40,isEccentricityXParameter=e=>"targetEccentricityXDeg"===e||"targetEccentrictyXDeg"===e,restrictImageAdjustToInitialSide=e=>imageAdjustState.thresholdGuessSide?imageAdjustState.thresholdGuessSide>0?Math.max(0,e):Math.min(0,e):e,getImageAdjustScreenXBoundsPx=()=>{const e=psychoJS.window._size[0],t=imageAdjustState.imageStim?imageAdjustState.imageStim.size:void 0,r=Array.isArray(t)&&Number.isFinite(t[0])?Math.abs(t[0]):0,n=Math.max(0,(e-r)/2);return[-n,n]},initializeImageAdjustPositionPx=()=>{const e=Number(imageConfig.targetEccentricityYDeg)||0,t=restrictImageAdjustToInitialSide(Number(imageAdjustState.thresholdGuess)||0),r=XYPxOfDeg(0,[t,e],!0,!1);return!(!Number.isFinite(r[0])||!Number.isFinite(r[1]))&&(imageAdjustState.zeroEccentricityXPx=XYPxOfDeg(0,[0,e],!0,!1)[0],r[0]+=imageAdjustState.pendingOffsetPx,imageAdjustState.pendingOffsetPx=0,imageAdjustState.currentXYPx=r,!0)},applyImageAdjustPosition=()=>{if(!imageAdjustState.active)return;if(!isEccentricityXParameter(imageAdjustState.thresholdParameter))return;if(!imageAdjustState.imageStim)return;if(!imageAdjustState.currentXYPx&&!initializeImageAdjustPositionPx())return;const e=imageAdjustState.currentXYPx;imageAdjustState.thresholdGuessSide&&Number.isFinite(imageAdjustState.zeroEccentricityXPx)&&(e[0]=imageAdjustState.thresholdGuessSide>0?Math.max(imageAdjustState.zeroEccentricityXPx,e[0]):Math.min(imageAdjustState.zeroEccentricityXPx,e[0]));const[t,r]=getImageAdjustScreenXBoundsPx();e[0]=Math.min(r,Math.max(t,e[0])),imageAdjustState.imageStim.setPos([e[0],e[1]]);const n=XYDegOfPx(0,e,!0,!1);imageConfig.targetEccentricityXDeg=n[0],imageAdjustState.currentValue=n[0]},prepareImageAdjust=e=>{if(imageAdjustState.active)return;const t=paramReader.read("thresholdParameter",e);imageAdjustState.thresholdGuess=Number(paramReader.read("thresholdGuess",e))||0,imageAdjustState.thresholdGuessSide=Math.sign(imageAdjustState.thresholdGuess),imageAdjustState.active=!0,imageAdjustState.finished=!1,imageAdjustState.thresholdParameter=t,imageAdjustState.imageStim=null,imageAdjustState.currentXYPx=null,imageAdjustState.zeroEccentricityXPx=null,imageAdjustState.pendingOffsetPx=0,imageAdjustState.scaleUp=Number(paramReader.read("thresholdParameterScaleUp",e)),imageAdjustState.scaleUpMore=Number(paramReader.read("thresholdParameterScaleUpMore",e));const r=Number(paramReader.read("thresholdParameterScaleUp",e)),n=Number(paramReader.read("thresholdParameterScaleUpMore",e)),i=Screens[0].pxPerCm;Number.isFinite(i)&&i>0?(imageAdjustState.stepPx=r*i,imageAdjustState.stepMorePx=n*i):(imageAdjustState.stepPx=imageAdjustStepFallbackPx,imageAdjustState.stepMorePx=imageAdjustStepMoreFallbackPx),isEccentricityXParameter(t)&&(imageAdjustState.currentValue=imageAdjustState.thresholdGuess);const a=async e=>{if(!imageAdjustState.active)return;if(isRecalibrationActive())return;if(!isFullscreen())return void(await requireFullscreenForTrialInitiation());const t=e.key,r=e.code,n="ArrowRight"===t||"ArrowRight"===r,i="ArrowLeft"===t||"ArrowLeft"===r;if(" "===t||"Spacebar"===t||"Space"===r)return e.preventDefault(),void(imageAdjustState.finished=!0);if(!n&&!i)return;e.preventDefault();const a=n?1:-1;if(isEccentricityXParameter(imageAdjustState.thresholdParameter)){const t=e.shiftKey?imageAdjustState.stepMorePx:imageAdjustState.stepPx;imageAdjustState.currentXYPx?imageAdjustState.currentXYPx[0]+=a*t:imageAdjustState.pendingOffsetPx+=a*t,applyImageAdjustPosition()}else if(Number.isFinite(imageAdjustState.currentValue)){const t=e.shiftKey?imageAdjustState.scaleUpMore:imageAdjustState.scaleUp,r=(Math.abs(imageAdjustState.currentValue)+.1)*(t-1);imageAdjustState.currentValue+=a*r}};imageAdjustState.keydownHandler=a,window.addEventListener("keydown",a)},bindImageAdjustStim=e=>{imageAdjustState.active&&(imageAdjustState.imageStim=e,applyImageAdjustPosition())},getImageAdjustReport=()=>{const e=imageAdjustState.thresholdParameter;if(!isEccentricityXParameter(e)||!imageAdjustState.currentXYPx||!imageAdjustState.imageStim)return{parameter:e,value:imageAdjustState.currentValue,maxAllowedEccDeg:void 0};const t=imageAdjustState.currentXYPx,r=XYDegOfPx(0,t,!0,!1)[0],[n,i]=getImageAdjustScreenXBoundsPx(),a=imageAdjustState.thresholdGuessSide<0?n:i;return{parameter:e,value:r,maxAllowedEccDeg:XYDegOfPx(0,[a,t[1]],!0,!1)[0]}},stopImageAdjust=()=>{imageAdjustState.keydownHandler&&window.removeEventListener("keydown",imageAdjustState.keydownHandler),imageAdjustState.active=!1,imageAdjustState.finished=!1,imageAdjustState.thresholdGuessSide=0,imageAdjustState.keydownHandler=null,imageAdjustState.imageStim=null,imageAdjustState.currentXYPx=null,imageAdjustState.zeroEccentricityXPx=null,imageAdjustState.pendingOffsetPx=0},createTransparentImage=()=>{const e=document.createElement("canvas");e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,1,1);const t=e.toDataURL("image/png"),r=new Image;return r.src=t,r};let waitingTransparencyFrames=0,realImageLoaded=!1,realImageElement=null,doneSettingRealImage=!1,qaStarted=!1,qaFinished=!1,storedArgs={showImage:null,trialCounter:null,spareFraction:0,where:"top",blockCondition:null};const showImageBegin=(e,t,r,n,i,a,o,s,l,c,u,d,h,p,f=0,m="top",g=null)=>async function(){if(storedArgs.showImage=h,storedArgs.trialCounter=i,storedArgs.spareFraction=Math.max(0,Math.min(1,Number(f)||0)),storedArgs.where=["top","bottom","left","right"].includes(m)?m:"top",storedArgs.blockCondition=g,waitingTransparencyFrames=0,realImageLoaded=!1,realImageElement=null,doneSettingRealImage=!1,qaStarted=!1,qaFinished=!1,numFrames=0,a&&a.setAutoDraw(!1),o&&o.setAutoDraw(!1),showConditionNameConfig$1.show=l,showConditionNameConfig$1.name=c,showConditionNameConfig$1.showTargetSpecs=u,updateTargetSpecs({showImage:e,showImageSpareFraction:f,showImageWhere:m}),drawTargetSpecs(o,s),screenBackground.colorRGBA=d,psychoJS.window.color=new Color$1(screenBackground.colorRGBA),psychoJS.window._needUpdate=!0,h.setAutoDraw(!1),h._needUpdate=!0,h.setImage(createTransparentImage()),h.setAutoDraw(!0),realImageElement=document.createElement("img"),realImageElement.src=`./images/${e}`,realImageElement.id="showImageEle",realImageElement.style.display="block",realImageElement.style.margin="auto",realImageElement.onload=()=>{realImageLoaded=!0},r||n){let e=getTrialInfoStr(p,r,n,void 0,void 0,status.nthBlock,totalBlocks.current,viewingDistanceCm.current,targetKind.current);e&&(i.setText(e),i.setPos([window.innerWidth/2,-window.innerHeight/2]),updateColor(i,"instruction",status.block),i.setAutoDraw(!0))}return psychoJS.eventManager.clearKeys(),Scheduler$1.Event.NEXT};var numFrames=0;const showImageEachFrame=(t,r,n)=>async function(){if(toShowCursor())return Scheduler$1.Event.NEXT;if(numFrames++,waitingTransparencyFrames++,!doneSettingRealImage){if(waitingTransparencyFrames<=2)return Scheduler$1.Event.FLIP_REPEAT;if(!realImageLoaded)return Scheduler$1.Event.FLIP_REPEAT;const e=window.innerHeight,t=window.innerWidth,i=realImageElement.naturalHeight,a=realImageElement.naturalWidth,o=storedArgs.spareFraction,s=storedArgs.where;let l,c,u=0,d=0;const h=Math.max(0,Math.min(1,o)),p=t/e;let f,m;"top"===s||"bottom"===s?(f=p,m=1-h,d="top"===s?h/2:-h/2):(f=(1-h)*p,m=1,u="left"===s?-h*p/2:h*p/2);const g=a/i;g>f/m?(l=f,c=f/g):(c=m,l=m*g),storedArgs.showImage.setImage(realImageElement),storedArgs.showImage.setSize([l,c]),storedArgs.showImage.setPos([u,d]),storedArgs.showImage._needUpdate=!0,storedArgs.showImage.setAutoDraw(!0),storedArgs.trialCounter._needUpdate=!0,storedArgs.trialCounter.setAutoDraw(!0);const _=storedArgs.blockCondition||status.block_condition,y=_&&areQuestionAndAnswerParametersPresent(_);if(r&&!y){const e=document.createElement("button");e.id="showImageButton",e.classList.add("threshold-button","threshold-proceed-button"),e.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",n)),e.addEventListener("click",(()=>{clickedContinue.current=!0})),document.body.appendChild(e)}doneSettingRealImage=!0}const i=storedArgs.blockCondition||status.block_condition;if(doneSettingRealImage&&!qaStarted&&i&&areQuestionAndAnswerParametersPresent(i)){qaStarted=!0;const t=i;(async()=>{const r=document.getElementById("experiment-progress-container"),n=r&&r.style.left&&"auto"!==r.style.left?"padding-left":"padding-right",i=document.createElement("style");i.textContent=`.swal2-qa-padded { ${n}: 60px !important; box-sizing: border-box !important; }`,document.head.appendChild(i);try{parseImageQuestionAndAnswer(t,{skipIdentify:!0}),await questionAndAnswerForImage(t,{spareFraction:storedArgs.spareFraction,where:storedArgs.where,backdrop:!1,containerClass:"swal2-qa-padded"})}catch(e){console.warn("showImage QA failed:",e)}finally{i.remove(),qaFinished=!0}})()}if(qaStarted)return qaFinished?Scheduler$1.Event.NEXT:Scheduler$1.Event.FLIP_REPEAT;const a=psychoJS.eventManager.getKeys({keyList:["return"]}),o=keypad.handler&&keypad.handler.inUse(status.block)&&_key_resp_allKeys.current.map((e=>e.name)).some((e=>["return",readi18nPhrases("T_RETURN",n).toLowerCase()].includes(e.toLowerCase())));return numFrames>5&&t&&(a.length>0||o)?(keypad.handler&&keypad.handler.clearKeys(),Scheduler$1.Event.NEXT):r&&clickedContinue.current?(clickedContinue.current=!1,Scheduler$1.Event.NEXT):Scheduler$1.Event.FLIP_REPEAT},showImageEnd=e=>async function(){const t=document.getElementById("showImageEle");t&&t.remove();const r=document.getElementById("showImageButton");return r&&r.remove(),e.setAutoDraw(!1),e._needUpdate=!0,Scheduler$1.Event.NEXT},createExperimentParagaph=(e,t,r={})=>{const n=document.createElement("p");return n.innerText=e,n.id=t,r&&(r.className&&(n.className=r.className),r.style&&Object.assign(n.style,r.style)),n},createExperimentHeader=(e,t,r={})=>{const n=document.createElement("h2");return n.innerText=e,n.id=t,r&&(r.className&&(n.className=r.className),r.style&&Object.assign(n.style,r.style)),n},isWindowMaximized=e=>(console.log("Window innerWidth",e.innerWidth,"Window screen.availWidth",e.screen.availWidth,"Window innerHeight",e.innerHeight,"Window screen.availHeight",e.screen.availHeight),e.innerWidth===e.screen.availWidth&&e.innerHeight<=e.screen.availHeight),handleWindowOpen=(e,t,r,n,i={},a,o)=>{const s=openWindow(e,t,i);if(s){const e={name:r,usePsychoJSBool:!1,pxPerCm:0,Hz:0,eyeXYZPxLeft:[0,0,0],eyeXYZPxRight:[0,0,0],fixationXYZPx:[0,0,0],eye:r,viewingDistanceCm:0,viewingDistanceCmUsedForCalculations:0,nearestPointXYZPx:[0,0],nearestPointXYZDeg:[0,0],rc:null,window:s,isWindowMaximized:isWindowMaximized(s),measurements:{screenName:"",widthCm:0,heightCm:0,leftMarginCm:0,rightMarginCm:0,topMarginCm:0,bottomMarginCm:0,widthPx:s.innerWidth,heightPx:s.innerHeight},measurementContainer:null,fixationConfig:{nominalPos:[0,0],pos:[0,0],offset:void 0,show:!0,strokeLength:45,strokeWidth:2,color:void 0,markingBlankedNearTargetBool:void 0,markingBlankingPos:void 0,markingBlankingRadiusReEccentricity:void 0,markingBlankingRadiusReTargetHeight:void 0,markingFixationHotSpotRadiusDeg:void 0,markingFixationHotSpotRadiusPx:void 0,markingFixationMotionRadiusDeg:void 0,markingFixationMotionPeriodSec:void 0,markingFixationStrokeLengthDeg:void 0,markingFixationStrokeThicknessDeg:void 0,markingFixationStrokeThickening:void 0,markingOffsetBeforeTargetOnsetSecs:void 0,markingOnsetAfterTargetOffsetSecs:void 0,markingFixationMotionSpeedDegPerSec:void 0,stim:void 0,fixationPosAfterDelay:void 0,trackingTimeAfterDelay:void 0,preserveOffset:!1}};Screens.push(e),s.onload=async()=>{const t=getMonitorNumberingMapForAllMonitors("left"===r?1:3),n=getMonitorNumberComponent("left"===r?1:3);s.document.body.appendChild(t),s.document.body.appendChild(n),s.addEventListener("resize",(async()=>{if(isWindowMaximized(s)&&(e.isWindowMaximized=!0,t.remove(),n.remove(),Screens.every((e=>e.isWindowMaximized)))){const e=Screens.find((e=>"left"===e.name));if(e){const{measurements:t,screenContainer:r}=await inputForMultipleMonitorMeasurements(e.window.document.body,a,e.window);e.measurements=t,e.measurementContainer=r}const t=Screens.find((e=>"Main"===e.name));if(t){const{measurements:e,screenContainer:r}=await inputForMultipleMonitorMeasurements(t.window.document.body,a,t.window);t.measurements=e,t.measurementContainer=r}const r=Screens.find((e=>"right"===e.name));if(r){const{measurements:e,screenContainer:t}=await inputForMultipleMonitorMeasurements(r.window.document.body,a,r.window);r.measurements=e,r.measurementContainer=t}Screens.forEach((e=>e.measurementContainer?.remove())),Screens.forEach((e=>e.window.removeEventListener("resize",(()=>{})))),o()}}))}}console.log("Screens",Screens)},openWindow=(e,t,r={})=>{const n=`width='${r.width}', height='${r.height}', left='${r.left}', top='${r.top}'`;return window.open(e,t,n)},startMultipleDisplayRoutine=async(e,t)=>{viewMonitorsXYDeg.maxNumberOfMonitors<=1||(await showExplanationPage(t),console.log("Number of screens",viewMonitorsXYDeg.maxNumberOfMonitors,viewMonitorsXYDeg.values),await new Promise((async e=>{for(let r=1;r<viewMonitorsXYDeg.maxNumberOfMonitors;r++){const n="components/multiple-displays/peripheralDisplay.html",i=`window${r}`,a=1==r?"left":"right";console.log("Opening window",n,i,a);handleWindowOpen(n,i,a,"",{left:100*r,top:0,width:1e3,height:1e3},t,e)}})))},showExplanationPage=async e=>{const t=document.createElement("div");t.style.zIndex="999999",t.style.position="absolute",t.style.top="5vh",t.style.left="10vw",t.style.width="70vw";const r=createExperimentHeader("Multiple Monitors Required","multiple-display-header",{style:{marginBottom:"20px"}}),n=createExperimentParagaph(" This experiment needs multiple monotirs. For that, we need to open multiple browser windows as popups. Click on the Test button to make sure popups are allowed on your browser for this site.","multiple-display-explanation",{style:{marginBottom:"20px"}}),i=document.createElement("button");i.innerText=readi18nPhrases("T_proceed",e),i.className="form-input-btn",i.id="multiple-display-proceed",i.style.margin="0",i.style.width="auto",document.body.appendChild(t),t.appendChild(r),t.appendChild(n),await showTestPopupButton(e,t),n.innerText="It appears popups are allowed on your browser. Once you click on the Proceed button, the experiment will automatically open several new windows. Each of these windows is intended to be displayed on a different monitor. Please follow the instructions on each of the windows to drag them to the appropriate monitor.",t.appendChild(i),await new Promise((e=>{i.onclick=()=>{r.remove(),n.remove(),i.remove(),t.remove(),e()}}))},testPopupBlocking=()=>new Promise(((e,t)=>{const r=[];let n=0;for(let i=0;i<3;i++){const e=window.open("",`testWindow${i}`,"width=100,height=100");e&&(n++,r.push(e))}3===n?(r.forEach((e=>e.close())),e(!0)):(r.forEach((e=>e?.close())),t(!1))})),showTestPopupButton=async(e,t)=>{const r=document.createElement("button");r.innerText="Test",r.className="form-input-btn",r.id="popup-test-proceed",r.style.margin="0",r.style.width="auto",t.appendChild(r),await new Promise((e=>{r.onclick=async()=>{try{await testPopupBlocking()&&(r.remove(),alert("Popups are allowed in your browser."),e())}catch{alert("Popups are blocked in your browser. Please enable them and try again.")}}}))},inputForMultipleMonitorMeasurements=async(e,t,r=null,n="")=>{const i={screenName:n,widthCm:0,heightCm:0,leftMarginCm:0,rightMarginCm:0,topMarginCm:0,bottomMarginCm:0,widthPx:0,heightPx:0};return{measurements:i,screenContainer:await measurementForm(i,e,0,t,r)}},measurementForm=async(e,t,r,n,i=null)=>await new Promise((a=>{const o=r+1,s=e,l=document.createElement("div");l.style.position="absolute",l.style.width="100vw",l.style.height="100vh",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center";const c=document.createElement("p");c.innerText=readi18nPhrases("RC_MeasureWidthHeightAndMargins",n),c.style.position="absolute",c.style.top="0",c.style.left="20px",c.style.fontSize="1.5rem",l.appendChild(c);const u=document.createElement("div");u.style.position="relative",u.style.width="60%",u.style.height="60%",u.style.border="2px solid black",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center";const d=document.createElement("div");d.style.width="80%",d.style.height="80%",d.style.border="2px solid black",d.style.position="relative",u.appendChild(d),l.appendChild(u);const h="http://www.w3.org/2000/svg",p=document.createElementNS(h,"svg");p.setAttribute("width","100%"),p.setAttribute("height","100%"),p.style.position="absolute",p.style.top="0",p.style.left="0";const f=document.createElementNS(h,"line");f.setAttribute("x1","0%"),f.setAttribute("y1","50%"),f.setAttribute("x2","100%"),f.setAttribute("y2","50%"),f.setAttribute("stroke","black"),f.setAttribute("stroke-width","2");const m=document.createElementNS(h,"line");m.setAttribute("x1","0%"),m.setAttribute("y1","50%"),m.setAttribute("x2","2%"),m.setAttribute("y2","48%"),m.setAttribute("stroke","black"),m.setAttribute("stroke-width","2");const g=document.createElementNS(h,"line");g.setAttribute("x1","0%"),g.setAttribute("y1","50%"),g.setAttribute("x2","2%"),g.setAttribute("y2","52%"),g.setAttribute("stroke","black"),g.setAttribute("stroke-width","2");const _=document.createElementNS(h,"line");_.setAttribute("x1","100%"),_.setAttribute("y1","50%"),_.setAttribute("x2","98%"),_.setAttribute("y2","48%"),_.setAttribute("stroke","black"),_.setAttribute("stroke-width","2");const y=document.createElementNS(h,"line");y.setAttribute("x1","100%"),y.setAttribute("y1","50%"),y.setAttribute("x2","98%"),y.setAttribute("y2","52%"),y.setAttribute("stroke","black"),y.setAttribute("stroke-width","2"),p.appendChild(f),p.appendChild(m),p.appendChild(g),p.appendChild(_),p.appendChild(y);const b=document.createElementNS(h,"line");b.setAttribute("x1","50%"),b.setAttribute("y1","0%"),b.setAttribute("x2","50%"),b.setAttribute("y2","100%"),b.setAttribute("stroke","black"),b.setAttribute("stroke-width","2");const v=document.createElementNS(h,"line");v.setAttribute("x1","50%"),v.setAttribute("y1","0%"),v.setAttribute("x2","48%"),v.setAttribute("y2","2%"),v.setAttribute("stroke","black"),v.setAttribute("stroke-width","2");const S=document.createElementNS(h,"line");S.setAttribute("x1","50%"),S.setAttribute("y1","0%"),S.setAttribute("x2","52%"),S.setAttribute("y2","2%"),S.setAttribute("stroke","black"),S.setAttribute("stroke-width","2");const w=document.createElementNS(h,"line");w.setAttribute("x1","50%"),w.setAttribute("y1","100%"),w.setAttribute("x2","48%"),w.setAttribute("y2","98%"),w.setAttribute("stroke","black"),w.setAttribute("stroke-width","2");const T=document.createElementNS(h,"line");T.setAttribute("x1","50%"),T.setAttribute("y1","100%"),T.setAttribute("x2","52%"),T.setAttribute("y2","98%"),T.setAttribute("stroke","black"),T.setAttribute("stroke-width","2"),p.appendChild(b),p.appendChild(v),p.appendChild(S),p.appendChild(w),p.appendChild(T);const E=document.createElementNS(h,"line");E.setAttribute("x1","50%"),E.setAttribute("y1","80%"),E.setAttribute("x2","50%"),E.setAttribute("y2","100%"),E.setAttribute("stroke","black"),E.setAttribute("stroke-width","2");const x=document.createElementNS(h,"line");x.setAttribute("x1","50%"),x.setAttribute("y1","80%"),x.setAttribute("x2","49.5%"),x.setAttribute("y2","81%"),x.setAttribute("stroke","black"),x.setAttribute("stroke-width","2");const A=document.createElementNS(h,"line");A.setAttribute("x1","50%"),A.setAttribute("y1","80%"),A.setAttribute("x2","50.5%"),A.setAttribute("y2","81%"),A.setAttribute("stroke","black"),A.setAttribute("stroke-width","2");const C=document.createElementNS(h,"line");C.setAttribute("x1","50%"),C.setAttribute("y1","100%"),C.setAttribute("x2","49.5%"),C.setAttribute("y2","99%"),C.setAttribute("stroke","black"),C.setAttribute("stroke-width","2");const R=document.createElementNS(h,"line");R.setAttribute("x1","50%"),R.setAttribute("y1","100%"),R.setAttribute("x2","50.5%"),R.setAttribute("y2","99%"),R.setAttribute("stroke","black"),R.setAttribute("stroke-width","2");const D=document.createElementNS(h,"svg");D.setAttribute("width","100%"),D.setAttribute("height","100%"),D.style.position="absolute",D.style.top="0",D.style.left="0",D.appendChild(E),D.appendChild(x),D.appendChild(A),D.appendChild(C),D.appendChild(R),l.appendChild(D),d.appendChild(p);const P=createInputField(readi18nPhrases("RC_Width",n),`width-${o}`,"number",{style:{alignItems:"baseline"}});P.style.position="absolute",P.style.top="50%",P.style.left="20%",P.style.transform="translateX(-50%)";const I=createInputField(readi18nPhrases("RC_Height",n),`height-${o}`,"number",{style:{alignItems:"baseline"}});I.style.position="absolute",I.style.top="30%",I.style.left="50%",I.style.transform="translateY(-50%)",d.appendChild(P),d.appendChild(I);const k=createInputField(readi18nPhrases("RC_LeftMargin",n),`left-margin-${o}`,"number",{style:{alignItems:"flex-start"}},"","column");k.style.position="absolute",k.style.left="0",k.style.top="50%",k.style.transform="translateY(-50%)";const M=createInputField(readi18nPhrases("RC_RightMargin",n),`right-margin-${o}`,"number",{style:{alignItems:"flex-end"}},"","column");M.style.position="absolute",M.style.right="0",M.style.top="50%",M.style.transform="translateY(-50%)";const $=createInputField(readi18nPhrases("RC_TopMargin",n),`top-margin-${o}`,"number",{style:{alignItems:"baseline"}});$.style.position="absolute",$.style.top="0",$.style.left="50%",$.style.transform="translateX(-50%)";const O=createInputField(readi18nPhrases("RC_BottomMargin",n),`bottom-margin-${o}`,"number",{style:{alignItems:"baseline"}});O.style.position="absolute",O.style.bottom="0",O.style.left="50%",O.style.transform="translateX(-50%)";const N=createInputField(readi18nPhrases("RC_Elevation",n),`elevation-${o}`,"number",{style:{alignItems:"baseline"}});N.style.position="absolute",N.style.bottom="10%",N.style.left="50%";const F=document.createElement("button");F.innerText=readi18nPhrases("T_proceed",n),F.classList.add("form-input-btn"),F.style.position="absolute",F.style.bottom="5%",F.style.margin="0px",F.style.left="76%",F.onclick=()=>{s.width=parseFloat(P.querySelector("input")?.value||"0"),s.height=parseFloat(I.querySelector("input")?.value||"0"),s.leftMargin=parseFloat(k.querySelector("input")?.value||"0"),s.rightMargin=parseFloat(M.querySelector("input")?.value||"0"),s.topMargin=parseFloat($.querySelector("input")?.value||"0"),s.bottomMargin=parseFloat(O.querySelector("input")?.value||"0"),s.elevation=parseFloat(N.querySelector("input")?.value||"0"),s.width>0&&s.height>0?(P.querySelector("input")?.setAttribute("readonly","true"),I.querySelector("input")?.setAttribute("readonly","true"),k.querySelector("input")?.setAttribute("readonly","true"),M.querySelector("input")?.setAttribute("readonly","true"),$.querySelector("input")?.setAttribute("readonly","true"),O.querySelector("input")?.setAttribute("readonly","true"),N.querySelector("input")?.setAttribute("readonly","true"),F.remove(),a(l)):i&&i.alert("Please fill out all fields with valid values.")},u.appendChild(k),u.appendChild(M),u.appendChild($),u.appendChild(O),l.appendChild(N),l.appendChild(F),t.appendChild(l)})),createInputField=(e,t,r,n={},i="",a="row")=>{const o=document.createElement("input");o.type=r,o.id=t,o.value=i,o.style.borderRadius="15px",o.style.width="60px",o.style.height="25px",o.style.fontSize="1rem",o.style.border="1px solid black",o.style.marginTop="10px",o.style.marginBottom="10px";const s=document.createElement("p");s.innerText=e,s.style.margin="0",s.style.marginRight="10px";const l=document.createElement("span");l.innerText="cm",l.style.marginLeft="10px";const c=document.createElement("div");return c.style.display="flex",c.style.flexDirection=a,c.style.zIndex="99999999",c.appendChild(s),c.appendChild(o),c.appendChild(l),n&&n.style&&Object.assign(c.style,n.style),c},getMonitorNumberingMapForAllMonitors=e=>{const t=getAlignmentDirection(),r=viewMonitorsXYDeg.maxNumberOfMonitors,n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.flexDirection="column",n.style.justifyContent="center",n.style.alignItems="center",n.style.zIndex="999999",n.style.position="absolute";const i=document.createElement("div");i.style.fontWeight="bold",i.style.color="black",i.style.backgroundColor="white",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center";const a=Array.from({length:r},((e,t)=>t+1));"horizontal"===t?a.forEach((e=>{const t=document.createElement("span");t.innerText=e.toString(),t.style.margin="0 10px",t.style.border="3px solid black",t.style.width=50/r+"vw",t.style.height="20vh",t.style.textAlign="center",t.style.fontSize=15/r+"rem",i.appendChild(t)})):a.reverse().forEach((e=>{i.style.flexDirection="column";const t=document.createElement("span");t.innerText=e.toString(),t.style.margin="0 10px",t.style.border="3px solid black",t.style.width="20vw",t.style.height=50/r+"vh",t.style.textAlign="center",t.style.fontSize=15/r+"rem",i.appendChild(t)}));const o=document.createElement("p");return o.innerHTML=`Drag me to monitor <b>${e}</b>`,o.style.margin="20px",o.style.fontSize="2rem",n.appendChild(i),n.appendChild(o),n},getMonitorNumberComponent=e=>{const t=document.createElement("div");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex="999999",t.style.fontSize="5rem",t.style.width="15vw",t.style.height="15vh",t.style.textAlign="center",t.style.border="3px solid black",t.style.fontWeight="bold",t.style.color="black",t.style.backgroundColor="white",t.innerText=e.toString(),t},getAlignmentDirection=()=>getHorizontalRange()>getVerticalRange()?"horizontal":"vertical",getHorizontalRange=()=>{const e=viewMonitorsXYDeg.values.map((e=>e.map((e=>e[0]))));console.log("xValues",e);return Math.max(...e.flat())-Math.min(...e.flat())},getVerticalRange=()=>{const e=viewMonitorsXYDeg.values.map((e=>e.map((e=>e[1]))));console.log("yValues",e);return Math.max(...e.flat())-Math.min(...e.flat())};async function loadGlossary(e){const[t,r]=e.split("/").filter(Boolean),n=`${await getEasyEyesBaseUrl()}/.netlify/functions/glossary?username=${t}&experiment=${r}`;let i=0;for(;;)try{const e=await fetch(n);return await e.json()}catch{await wait(getRetryDelayMs(i++))}}const glossaryData=await loadGlossary(window.location.pathname),TITLE_PAGE_ID="easyeyes-title-page",TITLE_PAGE_BUTTON_ID="easyeyes-title-page-proceed-button",TITLE_PAGE_LANGUAGE_WRAPPER_ID="easyeyes-title-page-language-wrapper",TITLE_PAGE_LANGUAGE_TOP_MOBILE="7rem",isRTLLanguage=e=>"rtl"===(readi18nPhrases("EE_LanguageDirection",e)||"LTR").toString().toLowerCase(),tryReadPhrase=(e,t)=>{try{return readi18nPhrases(e,t)||""}catch{return""}};async function showTitlePage(e,t){const r=(e.read("_showTitlePage")?.[0]||"title").trim();if("none"===r)return;const n=e.read("_online1Title")?.[0]||"",i="titleAndDescription"===r&&e.read("_online2Description")?.[0]||"";if(!n&&!i)return;const a=()=>t?.language?.value||"en",o=()=>readi18nPhrases("T_proceed",a())||"Proceed";return new Promise((r=>{document.body.classList.add("easyeyes-gray-bg"),document.documentElement.classList.add("easyeyes-gray-bg"),document.body.style.backgroundColor="#eee";const s=document.body.style.overflow;document.body.style.overflow="hidden";const l=document.createElement("div");l.id=TITLE_PAGE_ID,l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: #eee;\n z-index: 1000000;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n ";const c=window.matchMedia("(max-width: 480px)").matches,u=c?"1rem":"2rem",d=!!e.read("_languageSelectionByParticipantBool")?.[0],h=document.createElement("div");h.style.flex="1",h.style.maxWidth="900px",h.style.boxSizing="border-box",h.style.padding="0 0 clamp(20px, 5vh, 60px) 0";const p="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif",f=document.createElement("div");f.id="easyeyes-title-page-title-block",f.style.position="fixed",f.style.top=c?"1rem":"2rem",f.style.margin="0",f.style.padding="0",f.style.maxWidth=c?"calc(100vw - 2rem)":"calc(100vw - 4rem)",f.style.color="#000",f.style.pointerEvents="none",f.style.zIndex="1000007",f.style.fontFamily=p;const m=document.createElement("div");m.id="easyeyes-title-page-welcome",m.style.margin="0 0 0.15em 0",m.style.padding="0",m.style.fontFamily=p,m.style.fontSize="1.4rem",m.style.fontWeight="400",m.style.color="#000",m.style.lineHeight="1.6",m.textContent=tryReadPhrase("EE_Welcome",a()),m.textContent||(m.style.display="none");const g=document.createElement("h1");g.id="easyeyes-title-page-title",g.style.margin="0",g.style.padding="0",g.style.fontFamily=p,g.style.fontSize=c?"1.8rem":"2.5rem",g.style.fontWeight="400",g.style.color="#000",g.style.lineHeight=c?"120%":"100%",g.style.whiteSpace="pre-line",g.innerHTML=renderMarkdown(n),f.appendChild(m),f.appendChild(g);let _=null;i&&(_=document.createElement("div"),_.style.cssText="\n font-size: clamp(16px, 2vw, 18px);\n line-height: 1.5;\n margin-bottom: clamp(20px, 4vh, 40px);\n ",_.innerHTML=renderMarkdown(i),_.firstElementChild&&(_.firstElementChild.style.marginTop="0"),h.appendChild(_));let y=null;d&&(y=createLanguageSelector({rc:t,id:TITLE_PAGE_LANGUAGE_WRAPPER_ID,topMobile:TITLE_PAGE_LANGUAGE_TOP_MOBILE,zIndex:"1000008",onChange:()=>{w(),S(),v()}}));const b=c?16:24,v=()=>{let e=f.getBoundingClientRect().bottom+b;y&&c&&(y.wrapper.style.top=`${Math.ceil(e)}px`,e=y.wrapper.getBoundingClientRect().bottom+b),h.style.paddingTop=`${Math.ceil(e)}px`},S=()=>{const e=isRTLLanguage(a());h.style.direction=e?"rtl":"ltr",h.style.textAlign=e?"right":"left",e?(h.style.marginLeft="auto",h.style.marginRight=u):(h.style.marginLeft=u,h.style.marginRight="auto"),m.style.direction=e?"rtl":"ltr",m.style.textAlign=e?"right":"left",_&&(_.style.direction=e?"rtl":"ltr",_.style.textAlign=e?"right":"left"),e?(f.style.right=u,f.style.left="",f.style.textAlign="right",f.style.direction="rtl"):(f.style.left=u,f.style.right="",f.style.textAlign="left",f.style.direction="ltr")};S();const w=()=>{const e=a();m.textContent=tryReadPhrase("EE_Welcome",e),m.style.display=m.textContent?"":"none",T.innerText=o()};l.appendChild(f),y&&l.appendChild(y.wrapper),l.appendChild(h);const T=document.createElement("button");T.id=TITLE_PAGE_BUTTON_ID,T.classList.add("btn","btn-success"),T.type="button",T.tabIndex=0,T.innerText=o(),T.style.width="fit-content",T.style.padding="10px",T.style.margin="5rem auto",T.style.display="block",T.style.fontWeight="bold",l.appendChild(T),document.body.appendChild(l),v();const E="function"==typeof ResizeObserver?new ResizeObserver((()=>v())):null;E&&(E.observe(f),y&&E.observe(y.wrapper)),window.addEventListener("resize",v),document.fonts?.ready?.then(v).catch((()=>{})),simulateActive&&(publishPhaseEntered$1(SIM_PHASE.INSTRUCTIONS),publishResponseAffordance({validCharsTyped:" "})),T.focus({preventScroll:!0});let x=!1;const A=e=>{e.preventDefault(),x||(x||(x=!0,T.removeEventListener("click",A),window.removeEventListener("resize",v),E?.disconnect(),document.body.style.overflow=s,l.parentNode&&l.parentNode.removeChild(l),r()),requestNativeFullscreen().then((e=>{e&&clearFullscreenWasLost()})))};T.addEventListener("click",A)}))}const getStimulus=(e,t,r)=>{const n=t.read("targetKind",e);if(!_isAllNecessaryStateProvided(r,n))throw new Error("Failed to get stimulus, missing input parameters");switch("proposedLevel"in r&&void 0!==r.proposedLevel&&(r.proposedLevel=Math.min(r.proposedLevel,Math.log10(t.read("thresholdParameterMax",e)))),viewingDistanceCm.current=rc.viewingDistanceCm?rc.viewingDistanceCm.value:Math.min(viewingDistanceCm.desired,viewingDistanceCm.max),Screens[0].viewingDistanceCm=viewingDistanceCm.current,updateNearestPointFromRc(0,rc),n){case"letter":return getLettersStimulus(e,t,r);case"repeatedLetters":return getRepeatedLettersStimulus(e,t,r);case"rsvpReading":return getRsvpReadingStimulus(e,t,r);case"vernier":return getVernierStimulus(e,t,r);default:throw new Error(`targetKind == ${n} not yet supported by getStimulus`)}},getLettersStimulus=(e,t,r)=>{let n,i,a;if(1===Number(t.read("EasyEyesLettersVersion",e))){const a=r.proposedLevel,o=r.characterSetBoundingRect;({level:n,stimulusParameters:i}=getLettersStimulusV1(e,t,a,o))}else({level:n,stimulusParameters:i,characterSetBoundingRect:a}=getLettersStimulusV2(e,t,r.characterSetBoundingRect,r.stage,r.characters,r.proposedLevel));let o={};const s=r.frameN,l=_getLetterTextStims(t,e,i,r.characters,r.textStims);return Object.entries(l).forEach((([e,t])=>{"target"===e&&(o.preRenderStartSec=performance.now()/1e3),t.setOpacity(0),t.setAutoDraw(!0),t.status=PsychoJS$1.Status.NOT_STARTED})),{level:n,stimulusParameters:i,stims:l,characterSetBoundingRect:a,letterTiming:o,preRenderFrameN:s}},_getLetterTextStims=(e,t,r,n,i)=>{const a={};switch(e.read("thresholdParameter",t)){case"targetSizeDeg":a.target=getTargetStim(r,e,t,n.target,i.target);break;case"spacingDeg":switch(e.read("spacingRelationToSize",t)){case"none":case"ratio":a.target=getTargetStim(r,e,t,n.target,i.target),a.flanker1=getTargetStim(r,e,t,n.flanker1,i.flanker1,1),a.flanker2=getTargetStim(r,e,t,n.flanker2,i.flanker2,2),i.hasOwnProperty("flanker3")&&(a.flanker3=getTargetStim(r,e,t,n.flanker3,i.flanker3,3)),i.hasOwnProperty("flanker4")&&(a.flanker4=getTargetStim(r,e,t,n.flanker4,i.flanker4,4));break;case"typographic":const o=n.flanker1+n.target+n.flanker2;a.target=getTargetStim(r,e,t,o,i.target)}}return a},getLettersStimulusV1=(e,t,r,n)=>{const[i,a]=restrictLevel(r,t.read("thresholdParameter",e),n,t.read("spacingDirection",e),t.read("spacingRelationToSize",e),t.read("spacingSymmetry",e),t.read("spacingOverSizeRatio",e),t.read("targetSizeIsHeightBool",e),t.read("spacingIsOuterBool",e));return{level:i,stimulusParameters:a}},getLettersStimulusV2=(e,t,r,n,i,a)=>{if(!("afterFixation"!==n||i?.target&&a))throw new Error(`targetCharacter (${i?.target}) and proposedLevel (${a}) must be provided for afterFixation letter stimulus generation.`);let o,s,l;if("beforeFixation"===n){let n;[n,s,l]=restrictLevelBeforeFixation(readTargetTask(e),t.read("targetKind",e),t.read("thresholdParameter",e),t.read("spacingRelationToSize",e),t.read("spacingSymmetry",e),t.read("spacingOverSizeRatio",e),isFontLTR(readFontDirection(t,e)),r,String(t.read("fontCharacterSet",e)).split(""),t.read("spacingDirection",e),t.read("targetSizeIsHeightBool",e),i)}else{if("afterFixation"!==n)throw new Error(`Invalid stage ${n}`);if([o,s]=restrictLevelAfterFixation(a,t.read("thresholdParameter",e),r,t.read("spacingDirection",e),t.read("spacingRelationToSize",e),t.read("spacingSymmetry",e),t.read("spacingOverSizeRatio",e),t.read("targetSizeIsHeightBool",e),t.read("spacingIsOuterBool",e),t.read("showBoundingBoxBool",e),isFontLTR(readFontDirection(t,e)),readTargetTask(e),t.read("targetKind",e),i?.target,t.read("fontSizeReferencePx",e)),l=r,"target is offscreen"===o){const{targetLocationPx:e,targetEccentricityDeg:t,screenRectPx:r,screenRectDeg:n,fixationXYPX:i,viewingDistanceCm:a,screenWidthCm:o,screenHeightCm:l}=s;throw new Error(`Target is off screen. Target location ${e} px, eccentricity ${t} deg. Screen rect ${r} px = ${n} deg. Fixation ${i} px. Screen size ${o}x${l} cm. Viewing distance ${a} cm.`)}}return{level:Number(o),stimulusParameters:s,characterSetBoundingRect:l}},getRepeatedLettersStimulus=(e,t,r)=>{const[n,i]=restrictRepeatedLettersSpacing(r.proposedLevel,[t.read("targetEccentricityXDeg",e),t.read("targetEccentricityYDeg",e)],r.characterSetBoundingRect);return{stims:generateRepeatedLettersStims(i),level:n,stimulusParameters:i}},getRsvpReadingStimulus=(e,t,r)=>{const{displaySets:n,identificationSets:i}=generateRSVPReadingTargetSets(r.thisTrialWords,r.durationSec,t,e);return{targetSets:n,identificationSets:i}},getVernierStimulus=(e,t,r)=>{const n=r.vernier;return n.update(t,e,Math.pow(10,r.proposedLevel)),{vernier:n}},_isAllNecessaryStateProvided=(e,t)=>{switch(t){case"letter":if(!e.hasOwnProperty("proposedLevel")||!e.hasOwnProperty("characterSetBoundingRect"))return warning(`Missing information needed to generate letter stimuli, expected 'proposedLevel' and 'characterSetBoundingRect'. ${e.toString()}`),!1;break;case"repeatedLetters":if(!e.hasOwnProperty("proposedLevel")||!e.hasOwnProperty("characterSetBoundingRect"))return warning(`Missing information needed to generate repeated letter stimuli, expected 'proposedLevel' and 'characterSetBoundingRect'. ${e.toString()}`),!1;break;case"rsvpReading":if(!e.hasOwnProperty("thisTrialWords")||!e.hasOwnProperty("durationSec"))return warning(`Missing information needed to generate rsvpReading stimuli, expected 'thisTrialWords' and 'durationSec'. ${e.toString()}`),!1;break;case"vernier":if(!e.hasOwnProperty("proposedLevel")||!e.hasOwnProperty("vernier"))return warning(`Missing information needed to generate vernier stimuli, expected 'proposedLevel' and 'vernier'. ${e.toString()}`),!1;break;default:warning(`targetKind '${t}' not supported by stimulusGeneration::_isAllNecessaryStateProvided.`)}return!0},onStimulusGeneratedLetter=(e,t,r,n,i,a,o,s,l)=>{defineTargetForCursorTracking(e.stims.target);const c={};c.flankerXYDegs=e.stimulusParameters.flankerXYDegs;const u=Object.values(e.stims);if(s.push(...u),t.read("showBoundingBoxBool",r)&&s.push(...u.map(getBoundingBoxVisualRect)),"target is offscreen"===e.level)throw new Error(`Target is off screen. Target location ${e.stimulusParameters.targetLocationPx} px, eccentricity ${e.stimulusParameters.targetEccentricityDeg} deg. Screen rect ${e.stimulusParameters.screenRectPx} px = ${e.stimulusParameters.screenRectDeg} deg. Fixation ${e.stimulusParameters.fixationXYPX} px. Screen size ${e.stimulusParameters.screenWidthCm}x${e.stimulusParameters.screenHeightCm} cm. Viewing distance ${e.stimulusParameters.viewingDistanceCm} cm.`);const d=t.read("EasyEyesLettersVersion",r);if("beforeFixation"!==l||2!==d){t.read("_logFontBool")[0]&&logLetterParamsToFormspree(getFormspreeLoggingInfoLetter(r,t,o,i[0],a,e.stimulusParameters)),n.experiment?.addData("level",e.level);const s=i[0].window?._size??[window.innerWidth,window.innerHeight],l=e=>Array.isArray(e)?rcScreenXYPxToPsychoJSXYPx(e,s).join(", "):e;n.experiment?.addData("nearestXYPx_left",l(rc.improvedDistanceTrackingData?.left?.nearestXYPx)),n.experiment?.addData("nearestDistanceCm_left",rc.improvedDistanceTrackingData?.left?.nearestDistanceCm),n.experiment?.addData("distanceCm_left",rc.improvedDistanceTrackingData?.left?.distanceCm),n.experiment?.addData("nearestXYPx_right",l(rc.improvedDistanceTrackingData?.right?.nearestXYPx)),n.experiment?.addData("nearestDistanceCm_right",rc.improvedDistanceTrackingData?.right?.nearestDistanceCm),n.experiment?.addData("distanceCm_right",rc.improvedDistanceTrackingData?.right?.distanceCm),n.experiment?.addData("nearestXYPx",l(rc.improvedDistanceTrackingData?.nearestXYPx)),n.experiment?.addData("nearestDistanceCm",rc.improvedDistanceTrackingData?.nearestDistanceCm),n.experiment?.addData("distanceCm",rc.improvedDistanceTrackingData?.distanceCm),n.experiment?.addData("nearEye",rc.improvedDistanceTrackingData?.nearEye),n.experiment?.addData("oldDistanceCm",rc.improvedDistanceTrackingData?.oldDistanceCm),2===d&&(n.experiment?.addData("minTargetSizeDeg",e.stimulusParameters.minDeg),n.experiment?.addData("maxTargetSizeDeg",e.stimulusParameters.maxDeg)),updateTargetSpecs(e.stimulusParameters,"letter"),t.read("_trackGazeExternallyBool")[0]&&recordStimulusPositionsForEyetracking(e.stims.target,"trialInstructionRoutineBegin"),n.experiment?.addData("fontSizePx",e.stimulusParameters.heightPx),n.experiment?.addData("actualSpacingDeg",e.stimulusParameters.spacingDeg);const c="typographic"===t.read("spacingRelationToSize",r)?o.target:`${o.flanker1}, ${o.target}, ${o.flanker2}`;if(n.experiment?.addData("crowdingTriplets",c),"spacingDeg"===t.read("thresholdParameter",r)&&["none","ratio"].includes(t.read("spacingRelationToSize",r))){n.experiment?.addData("flankerLocationsPx",e.stimulusParameters.targetAndFlankersXYPx.slice(1));const i=t.read("spacingIsOuterBool",r)?norm([e.stimulusParameters.targetAndFlankersXYPx[0][0]-e.stimulusParameters.targetAndFlankersXYPx[1][0],e.stimulusParameters.targetAndFlankersXYPx[0][1]-e.stimulusParameters.targetAndFlankersXYPx[1][1]]):norm([e.stimulusParameters.targetAndFlankersXYPx[0][0]-e.stimulusParameters.targetAndFlankersXYPx[2][0],e.stimulusParameters.targetAndFlankersXYPx[0][1]-e.stimulusParameters.targetAndFlankersXYPx[2][1]]);n.experiment?.addData("targetSpacingPx",i)}n.experiment?.addData("targetBoundingBox",prettyPrintPsychojsBoundingBox(e.stims.target.getBoundingBox(!0))),Object.keys(e.stims).filter((e=>"target"!==e)).forEach((t=>{const r=e.stims[t];n.experiment?.addData(`${t}BoundingBox`,prettyPrintPsychojsBoundingBox(r.getBoundingBox(!0)))}));const u=targetsOverlap([e.stims.target,...Object.values(e.stims).filter((t=>t!==e.stims.target))]);n.experiment?.addData("targetsOverlappedBool",u?"TRUE":"FALSE");const h=e.stims.target.getHeight(),p=pxToPt(h);n.experiment?.addData("fontNominalSizePx",h),n.experiment?.addData("fontNominalSizePt",p)}return{letterConfig:c,preRenderFrameN:e.preRenderFrameN,letterTiming:e.letterTiming}},onStimulusGeneratedRepeatedLetters=(e,t,r,n,i)=>{defineTargetForCursorTracking(e.stims),updateTargetSpecs(e.stimulusParameters,"repeatedLetters")},onStimulusGeneratedRsvpReading=(e,t,r,n,i,a,o,s)=>{if(!e.targetSets||!Array.isArray(e.targetSets)||0===e.targetSets.length)return void warning("Invalid target sets for RSVP reading");clearPhraseIdentificationRegisters(),isRsvpReadingAutomaticSpeechResponseMode(o)&&resetRsvpSpeechResponseRegistration();const l={upcoming:e.targetSets,past:[],identificationTargetSets:e.identificationSets,current:void 0,skippedDueToBadTracking:0},c={current:l.identificationTargetSets.map((e=>e.word.toLowerCase()))};a.experiment?.addData("rsvpReadingTargetNumberOfSets",l.upcoming.length),a.experiment?.addData("rsvpReadingTargetSets",e.targetSets.toString());const u={categories:l.upcoming.map((e=>new Category(e.word,e.foilWords))),identificationCategories:l.identificationTargetSets.map((e=>new Category(e.word,e.foilWords)))};return a.experiment?.addData("rsvpReadingResponseCategories",u.identificationCategories.toString()),"silent"===o&&(u.screen=setupPhraseIdentification(u.identificationCategories,n,i,l.upcoming[0]._heightPx),a.experiment?.addData("rsvpReadingResponseScreenHTML",u.screen.innerHTML)),l.current=l.upcoming.shift(),updateTargetSpecs({targetWordDurationSec:s,rsvpReadingNumberOfWords:n.read("rsvpReadingNumberOfWords",i),rsvpReadingResponseModality:o},"rsvpReading",n,i),{rsvpReadingTargetSets:l,correctAns:c,rsvpReadingResponse:u}},onStimulusGeneratedVernier=(e,t,r,n,i,a)=>{defineTargetForCursorTracking(e),t.read("_trackGazeExternallyBool")[0]&&recordStimulusPositionsForEyetracking(e,"trialInstructionRoutineBegin");const o=[n,i],s={current:o[e.directionBool?0:1]},l=Math.log10(e.targetOffsetDeg);return a.experiment?.addData("level",l),t.read("showTargetSpecsBool",r)&&updateTargetSpecs({targetOffsetDeg:e.targetOffsetDeg,targetDurationSec:t.read("targetDurationSec",r)}),{validAns:o,correctAns:s,level:l}},onStimulusGenerationFailed=(e,t)=>{if(warning(`Failed to get viable stimulus (onStimulusGenerated failed), skipping trial. Error: ${t.error}`),skipTrial(),"letter"===e){const{error:e,level:r,debug:n,screen:i,block_condition:a,reader:o,characters:s,viewingDistanceCm:l}=t;warning(`Failed to get viable stimulus (restrictLevelAfterFixation failed), skipping trial. level: ${r}. Error: ${e}`),n||logLetterParamsToFormspree(getFormspreeLoggingInfoLetter(a,o,s,i,l)),i.fixationConfig.fixationPosAfterDelay=void 0}},DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,GLOBAL_OBJ=globalThis,SDK_VERSION="10.32.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||SDK_VERSION,t[SDK_VERSION]=t[SDK_VERSION]||{}}function getGlobalSingleton(e,t,r=GLOBAL_OBJ){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[SDK_VERSION]=n[SDK_VERSION]||{};return i[e]||(i[e]=t())}const PREFIX="Sentry Logger ",originalConsoleMethods={};function consoleSandbox(e){if(!("console"in GLOBAL_OBJ))return e();const t=GLOBAL_OBJ.console,r={},n=Object.keys(originalConsoleMethods);n.forEach((e=>{const n=originalConsoleMethods[e];r[e]=t[e],t[e]=n}));try{return e()}finally{n.forEach((e=>{t[e]=r[e]}))}}function enable(){_getLoggerSettings().enabled=!0}function disable(){_getLoggerSettings().enabled=!1}function isEnabled(){return _getLoggerSettings().enabled}function log(...e){_maybeLog("log",...e)}function warn(...e){_maybeLog("warn",...e)}function error(...e){_maybeLog("error",...e)}function _maybeLog(e,...t){DEBUG_BUILD&&isEnabled()&&consoleSandbox((()=>{GLOBAL_OBJ.console[e](`${PREFIX}[${e}]:`,...t)}))}function _getLoggerSettings(){return DEBUG_BUILD?getGlobalSingleton("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const debug={enable:enable,disable:disable,isEnabled:isEnabled,log:log,warn:warn,error:error},objectToString=Object.prototype.toString;function isBuiltin(e,t){return objectToString.call(e)===`[object ${t}]`}function isPlainObject(e){return isBuiltin(e,"Object")}function isThenable(e){return Boolean(e?.then&&"function"==typeof e.then)}function addNonEnumerableProperty(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{DEBUG_BUILD&&debug.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function truncate(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function getCrypto(){const e=GLOBAL_OBJ;return e.crypto||e.msCrypto}let emptyUuid;function getRandomByte(){return 16*Math.random()}function uuid4(e=getCrypto()){try{if(e?.randomUUID)return e.randomUUID().replace(/-/g,"")}catch{}return emptyUuid||(emptyUuid=[1e7]+1e3+4e3+8e3+1e11),emptyUuid.replace(/[018]/g,(e=>(e^(15&getRandomByte())>>e/4).toString(16)))}const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){const{performance:e}=GLOBAL_OBJ;if(!e?.now||!e.timeOrigin)return dateTimestampInSeconds;const t=e.timeOrigin;return()=>(t+e.now())/ONE_SECOND_IN_MS}let _cachedTimestampInSeconds;function timestampInSeconds(){return(_cachedTimestampInSeconds??(_cachedTimestampInSeconds=createUnixTimestampInSecondsFunc()))()}function updateSession(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||timestampInSeconds(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:uuid4()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function merge(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&0===Object.keys(t).length)return e;const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=merge(n[i],t[i],r-1));return n}function generateTraceId(){return uuid4()}const SCOPE_SPAN_FIELD="_sentrySpan";function _setSpanForScope(e,t){t?addNonEnumerableProperty(e,SCOPE_SPAN_FIELD,t):delete e[SCOPE_SPAN_FIELD]}function _getSpanForScope(e){return e[SCOPE_SPAN_FIELD]}const DEFAULT_MAX_BREADCRUMBS=100;class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId(),sampleRand:Math.random()}}clone(){const e=new Scope;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,_setSpanForScope(e,_getSpanForScope(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,r=t instanceof Scope?t.getScopeData():isPlainObject(t)?e:void 0,{tags:n,attributes:i,extra:a,user:o,contexts:s,level:l,fingerprint:c=[],propagationContext:u}=r||{};return this._tags={...this._tags,...n},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),l&&(this._level=l),c.length&&(this._fingerprint=c),u&&(this._propagationContext=u),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,_setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:DEFAULT_MAX_BREADCRUMBS;if(r<=0)return this;const n={timestamp:dateTimestampInSeconds(),...e,message:e.message?truncate(e.message,2048):e.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=merge(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t?.event_id||uuid4();if(!this._client)return DEBUG_BUILD&&debug.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r?.event_id||uuid4();if(!this._client)return DEBUG_BUILD&&debug.warn("No client configured on scope - will not capture message!"),n;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=t?.event_id||uuid4();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(DEBUG_BUILD&&debug.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function getDefaultCurrentScope(){return getGlobalSingleton("defaultCurrentScope",(()=>new Scope))}function getDefaultIsolationScope(){return getGlobalSingleton("defaultIsolationScope",(()=>new Scope))}class AsyncContextStack{constructor(e,t){let r,n;r=e||new Scope,n=t||new Scope,this._stack=[{scope:r}],this._isolationScope=n}withScope(t){const r=this._pushScope();let n;try{n=t(r)}catch(e){throw this._popScope(),e}return isThenable(n)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function getAsyncContextStack(){const e=getSentryCarrier(getMainCarrier());return e.stack=e.stack||new AsyncContextStack(getDefaultCurrentScope(),getDefaultIsolationScope())}function withScope(e){return getAsyncContextStack().withScope(e)}function withSetScope(e,t){const r=getAsyncContextStack();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function withIsolationScope(e){return getAsyncContextStack().withScope((()=>e(getAsyncContextStack().getIsolationScope())))}function getStackAsyncContextStrategy(){return{withIsolationScope:withIsolationScope,withScope:withScope,withSetScope:withSetScope,withSetIsolationScope:(e,t)=>withIsolationScope(t),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}function getAsyncContextStrategy(e){const t=getSentryCarrier(e);return t.acs?t.acs:getStackAsyncContextStrategy()}function getCurrentScope(){return getAsyncContextStrategy(getMainCarrier()).getCurrentScope()}function parseEventHintOrCaptureContext(e){if(e)return hintIsScopeOrFunction(e)||hintIsScopeContext(e)?{captureContext:e}:e}function hintIsScopeOrFunction(e){return e instanceof Scope||"function"==typeof e}const captureContextKeys=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function hintIsScopeContext(e){return Object.keys(e).some((e=>captureContextKeys.includes(e)))}function captureException(e,t){return getCurrentScope().captureException(e,parseEventHintOrCaptureContext(t))}const SENSITIVE_KEY=/token|authorization|password|secret|spreadsheet|workbook|content|participant/i,sanitize=(e,t=0)=>t>4?"[Truncated]":null==e?e:"string"==typeof e?e.replace(/(access_token|oauthToken|authorization)=([^&\s]+)/gi,"$1=[Filtered]").replace(/Bearer\s+[A-Za-z0-9._~-]+/gi,"Bearer [Filtered]"):["number","boolean"].includes(typeof e)?e:Array.isArray(e)?e.slice(0,50).map((e=>sanitize(e,t+1))):"object"!=typeof e?String(e):Object.fromEntries(Object.entries(e).map((([e,r])=>[e,SENSITIVE_KEY.test(e)?"[Filtered]":sanitize(r,t+1)])));function captureError(e,t="",r={}){console.error(t,e),captureException(e,{tags:{context:t},extra:sanitize(r)})}const saveSnapshot=async(e,t,r)=>{try{const n=await fetch(await getBoxApiUrl(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:e,experimentID:t,participantID:r})});if(!n.ok){const e=`Box upload failed: ${(await n.json().catch((()=>({error:n.statusText})))).error} (Status: ${n.status})`;return captureError(new Error(e),"Snapshot upload error"),null}return await n.json()}catch(err){return captureError(err,"Snapshot upload error"),null}},getBoxApiUrl=async()=>await getEasyEyesBaseUrl()+"/.netlify/functions/box-api",capturedVideoFrameListener=()=>{document.addEventListener("rc-video-frame-captured",(async e=>{const{image:t}=e.detail;if(t)try{const e=await saveSnapshot(t,experimentId(),participantId());addSnapshotsLinkToExperimentResult(e.snapshotsLink)}catch(error){captureError$1(error,"capturedVideoFrameListener",{experimentId:experimentId(),participantId:participantId(),hasImage:!!t})}}))},addSnapshotsLinkToExperimentResult=e=>{if(e&&psychoJS?.experiment){psychoJS.experiment._currentTrialData.hasOwnProperty("snapshotsLink")||psychoJS.experiment.addData("snapshotsLink",e)}},experimentId=()=>{let e;const t=window.location.pathname.split("/").filter((e=>e));if("localhost"===window.location.hostname){const r=t.indexOf("index.html");e=r>0?t[r-1]:t[t.length-1]}else e=t[t.length-1];return e},participantId=()=>thisExperimentInfo.PavloviaSessionID,loadCSS=e=>new Promise(((t,r)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=e,n.onload=t,n.onerror=r,document.head.appendChild(n)})),cssPromises=[];cssPromises.push(loadCSS("js/threshold.css")),cssPromises.push(loadCSS("https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css")),await Promise.all(cssPromises);const{PsychoJS:PsychoJS}=core,{TrialHandler:TrialHandler,MultiStairHandler:MultiStairHandler}=data$1,{Scheduler:Scheduler}=util;initGlossary(glossaryData);const strHash=e=>{let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)>>>0;return t},chaosSeed=window.__SIM_OPTIONS__&&window.__SIM_OPTIONS__.chaos||new URLSearchParams(window.location.search).get("chaos")||null,chaosState=chaosSeed?{targetDistinct:strHash(String(chaosSeed))%22+2,seen:new Set,fired:!1}:null,setCurrentFn=e=>{if(status.currentFunction=e,logNotice(`In ${e}.`),simulateActive&&setEEState({currentFunction:e}),chaosState&&!chaosState.fired&&!chaosState.seen.has(e)&&(chaosState.seen.add(e),chaosState.seen.size>=chaosState.targetDistinct))throw chaosState.fired=!0,new Error(`CHAOS injected at ${e}`)};var videoblob=[],actualStimulusLevel;const video=document.createElement("video");video.style.position="absolute",video.style.zIndex=2e4,document.createElement("source");const loader=document.createElement("loader"),loaderText=document.createElement("p");let video_flag=1;window.jsQUEST=jsQUEST$1;const fontsRequired={},parseWindowURL=()=>{const e=new URLSearchParams(window.location.search);return{participant:e.get("participant"),session:e.get("session"),study_id:e.get("study_id"),completedDaisyChainBefore:e.get("completedDaisyChainBefore")}},daisyChainURLBefore=e=>{if(!e)return;const{participant:t,session:r,study_id:n,completedDaisyChainBefore:i}=parseWindowURL();if(i)return;const a=`${e}?external_id=${t}&participant=${t}&session=${r}&study_id=${n}&completedDaisyChainBefore=true`;window.location=a},paramReaderInitialized=async e=>{const t=e.read("_daisyChainURLBefore")[0];daisyChainURLBefore(t);const r=e.read("simulateParticipantBool","__ALL_BLOCKS__").some(Boolean);if(r){startSimulatedParticipant();const t=e.read("targetKind","__ALL_BLOCKS__").filter(Boolean);publishBootEvent({experimentName:thisExperimentInfo?.name??"",blockCount:e._blockCount??0,conditionCount:e._experiment?.length??0,targetKinds:[...new Set(t)].join(","),language:e.read("_language")[0]??"",seed:window.__SIM_SEED__??""})}if(r||rc&&rc.checkInitialized()&&rc.language&&rc.language.value||window.location.reload(),handleLanguage(e.read("_language")[0],rc,!0),saveProlificInfo(thisExperimentInfo),setCurrentFn("paramReaderInitialized"),void 0!==psychoJS._window)return;if(useMatlab.current=e.read("_trackGazeExternallyBool")[0],simulateActive&&setEEState({usingGaze:useMatlab.current}),debugBool.current=e.read("_debugBool")[0],void 0===thisExperimentInfo.experiment&&(thisExperimentInfo.experiment=getPavloviaProjectName()),buildWindowErrorHandling(e),e.read("_participantIDGetBool")[0]){const t=(e,t=null,r)=>{e&&(thisExperimentInfo.participant=e,void 0!==r&&e===r?thisExperimentInfo.setSession(t&&isNaN(Number(t))?t:Number(t)+1):thisExperimentInfo.setSession(1),thisExperimentInfo.EasyEyesID=e,thisExperimentInfo.PavloviaSessionID=e)};if(!(await checkCrossSessionId(t,rc.language.value,e)))return void showExperimentEnding$1()}else thisExperimentInfo.participant=rc.id.value,thisExperimentInfo.setSession(1),thisExperimentInfo.EasyEyesID=rc.id.value,thisExperimentInfo.PavloviaSessionID=rc.id.value;const n=window.location.href.split("/");if(e.read("_logParticipantsBool")[0]){const e={logParameter:"_logParticipantsBool",ExperimentName:n[n.length-2],deviceType:rc.deviceType.value,OS:"Mac"===rc.systemFamily.value?"macOS":rc.systemFamily.value,browser:rc.browser.value,browserVersion:rc.browserVersion.value,prolificSession:thisExperimentInfo.ProlificSessionID,prolificParticipantID:thisExperimentInfo.ProlificParticipantID,pavloviaID:thisExperimentInfo.PavloviaSessionID,date:MonotonicClock.getDateStr(),UTC:MonotonicClock.getTimeZone()};await sendEmailForDebugging(e)}await loadFonts(e,fontsRequired),await loadRecruitmentServiceConfig(),await loadReadingCorpus(e),ifTrue$2(e.read("showFPSBool","__ALL_BLOCKS__"))&&(stats.current=new Stats,stats.current.showPanel(0),document.body.appendChild(stats.current.dom),stats.current.dom.style.display="none",stats.on=!1);await (async()=>{initFullscreenPauseOverlay(),experiment(e.blockCount)})(),document.getElementById("root").classList.add("initialized")},paramReader=new ParamReader("conditions",(e=>{paramReaderInitialized(e)}));var conditionName,targetSpecs,trialCounter,showImage,targetImage,characterSetBoundingRects={};const experiment=t=>{setCurrentFn("experiment");const r=new Set(paramReader.conditions.map((e=>Number(e.block))));var n;window.experimentProgressInfo=Array(r.size);var i,a,o,s,l,c,u,d,h,p,f,m,g,_,y,b,v,S,w=!0;preparePopup(rc.language.value,thisExperimentInfo.name),prepareTrialBreakProgressBar(),initializeEscHandlingDiv();const T=[];blockOrder.current=getBlockOrder(paramReader);for(const e of blockOrder.current)T.push({name:`conditions/block_${e}.csv`,path:`conditions/block_${e}.csv`});thisExperimentInfo.experimentFilename=paramReader.read("!experimentFilename")[0];for(let e in fontsRequired){logger$1(e,fontsRequired[e]);let t=fontsRequired[e].split("."),r=t[0].split("/");r.push(t[1]);let n=r[1]+"."+r[2];T.push({name:n,path:fontsRequired[e]})}const E=getCorrectSynth(psychoJS);getPurrSynth(psychoJS);const x=getReadingSound();registerSoundOutputTarget(E.getNativeContext()),registerSoundOutputTarget(x),registerSoundOutputTarget(audioCtx),screenBackground.colorRGBA=colorRGBASnippetToRGBA(paramReader.read("screenColorRGBA","__ALL_BLOCKS__")[0]),configureScreenColorPipeline(paramReader);const A=paramReader.read("screenColorRGBA","__ALL_BLOCKS__")[0]||screenBackground.defaultColorRGBA;psychoJS.openWindow({fullscr:!debug$1,color:new Color$1(colorRGBSnippetToRGB(A)),units:"height",waitBlanking:!0}),logScreenColorPipelineReport(psychoJS),installColorPipelineProbe(psychoJS,{force:colorPipelineTestRequested(paramReader)}),(new URLSearchParams(window.location.search).has("textStimContract")||new URLSearchParams(window.location.search).has("textstimcontract"))&&(window.__textStimContract=async e=>{const t=[];for(const r of e){if(r.fontUrl){const e=new FontFace(r.font,await (await fetch(r.fontUrl)).arrayBuffer());await e.load(),document.fonts.add(e)}const e=new TextStim({win:psychoJS.window,name:"contract",text:r.text,font:r.font,height:r.height??40,units:"pix",letterSpacing:r.letterSpacing??0,language:r.language??"en",direction:r.direction??"ltr",wrapWidth:1/0,autoLog:!1});e._updateIfNeeded();const n=e.getBoundingBox(!0).width,i=e.measureText(r.text).width;t.push({...r,authoritative:n,cheap:i,diff:Math.abs(n-i)})}return t}),initMouse();const C=new Scheduler(psychoJS);var R;psychoJS.schedule(C),C.add((async function(){registerUnloadExitStamp(),runDiagnosisReport(),await initializeAndRegisterSubmodules(),"function"==typeof rc.setOnQuit&&rc.setOnQuit((e=>{const t=e?.trigger;"cameraReconnectPopup"===t||"chooseScreenQuit"===t?(showExperimentEnding$1(),quitPsychoJS("",!1,paramReader,!0,!1,rcUnmetNeedsFromReason(e,rcMinutesSinceStart(clock.global,performance.now()))),recruitmentServiceData?.incompatibleCode&&window.open("https://app.prolific.com/submissions/complete?cc="+recruitmentServiceData?.incompatibleCode)):showFullscreenPauseOverlay()}));"function"==typeof rc.onCameraDisconnected&&rc.onCameraDisconnected(((e,t)=>warning(`rcCameraDisconnected:${t?.status??"unknown"}:${t?.trackReadyState??"unknown"} ${e??""}`.trim())));"function"==typeof rc.onCameraReconnected&&rc.onCameraReconnected((()=>warning("rcCameraReconnected")));setCurrentFn("titlePage"),await showTitlePage(paramReader,rc),needPhoneSurvey.current=paramReader.read("_needSmartphoneSurveyBool")[0],needComputerSurveyBool.current=paramReader.read("_needComputerSurveyBool")[0],await async function(t){if(setCurrentFn("updateInfo"),thisExperimentInfo.date=MonotonicClock.getDateStr()+" "+MonotonicClock.getTimeZone(),thisExperimentInfo.psychopyVersion=`${psychoJSPackage.version}-threshold-prod`,thisExperimentInfo.hardwareConcurrency=rc.concurrency.value,thisExperimentInfo.deviceType=rc.deviceType.value,thisExperimentInfo.deviceSystem=rc.system.value,thisExperimentInfo.deviceSystemFamily=rc.systemFamily.value,thisExperimentInfo.deviceBrowser=rc.browser.value,thisExperimentInfo.deviceBrowserVersion=rc.browserVersion.value,thisExperimentInfo.deviceLanguage=rc.userLanguage.value,loudspeakerBrowserDetails.current.browser=rc.browser.value,loudspeakerBrowserDetails.current.browserVersion=rc.browserVersion.value,rc.browserVersion.value&&rc.browserVersion.value.includes(".")){const e=rc.browserVersion.value.split(".");if(e.length>1){const t=e[0];parseInt(t)>=100?loudspeakerBrowserDetails.current.browserVersion=e[0]:loudspeakerBrowserDetails.current.browserVersion=e[0]+"."+e[1]}}thisExperimentInfo.psychojsWindowDimensions=`[${psychoJS._window._size.toString()}]`,thisExperimentInfo.monitorFrameRate=psychoJS.window.getActualFrameRate(),psychoJS.experiment.addData("frameRateReportedByPsychoJS",thisExperimentInfo.monitorFrameRate),rc.stressFps?psychoJS.experiment.addData("frameRateUnderStress",rc.stressFps.value):rc.performanceCompute&&await rc.performanceCompute((e=>{psychoJS.experiment.addData("computeRandomMHz",e.value.computeRandomMHz)}));thisExperimentInfo.experiment=getPavloviaProjectName();{const e=psychoJS.experiment.nextEntry.bind(psychoJS.experiment);psychoJS.experiment.nextEntry=(...t)=>("currentFunction"in psychoJS.experiment._currentTrialData||psychoJS.experiment.addData("currentFunction",status.currentFunction??""),e(...t))}psychoJS.experiment.addData("URL",window.location.href||""),psychoJS.experiment.addData("expName",thisExperimentInfo.name),psychoJS.experiment.addData("psychopyVersion",thisExperimentInfo.version),psychoJS.experiment.addData("hardwareConcurrency",thisExperimentInfo.hardwareConcurrency);try{const e=navigator.deviceMemory;psychoJS.experiment.addData("deviceMemoryGB",e)}catch(e){console.log("Error adding deviceMemoryGB to psychoJS.experiment",e)}psychoJS.experiment.addData("deviceType",thisExperimentInfo.deviceType),psychoJS.experiment.addData("deviceSystem",thisExperimentInfo.deviceSystem),psychoJS.experiment.addData("deviceSystemFamily",thisExperimentInfo.deviceSystemFamily),psychoJS.experiment.addData("deviceBrowser",thisExperimentInfo.deviceBrowser),psychoJS.experiment.addData("deviceBrowserVersion",thisExperimentInfo.deviceBrowserVersion),psychoJS.experiment.addData("deviceLanguage",thisExperimentInfo.deviceLanguage),psychoJS.experiment.addData("psychojsWindowDimensions",thisExperimentInfo.psychojsWindowDimensions),psychoJS.experiment.addData("participant",thisExperimentInfo.participant),psychoJS.experiment.addData("session",thisExperimentInfo.session),psychoJS.experiment.addData("EasyEyesID",thisExperimentInfo.EasyEyesID),psychoJS.experiment.addData("PavloviaSessionID",thisExperimentInfo.PavloviaSessionID),psychoJS.experiment.addData("ProlificParticipantID",thisExperimentInfo.ProlificParticipantID),psychoJS.experiment.addData("ProlificSessionID",thisExperimentInfo.ProlificSessionID),psychoJS.experiment.addData("ProlificStudyID",thisExperimentInfo.ProlificStudyID);try{psychoJS.experiment.addData("devicePixelRatio",window.devicePixelRatio)}catch(e){console.log("Error adding devicePixelRatio to psychoJS.experiment",e)}t&&psychoJS.experiment.nextEntry()}(needPhoneSurvey.current),setCurrentFn("compatibilityFlow"),simulateActive&&publishPhaseEntered$1(SIM_PHASE.COMPATIBILITY);const{proceedButtonClicked:t,proceedBool:r,mic:n,loudspeaker:i,gotLoudspeakerMatchBool:a}=await runDeviceCompatibilityFlow({paramReader:paramReader,rc:rc,psychoJS:psychoJS,measureMeters:measureMeters,keypad:keypad,KeypadHandler:KeypadHandler,_key_resp_event_handlers:_key_resp_event_handlers,_key_resp_allKeys:_key_resp_allKeys,ConnectionManager:ConnectionManager,ConnectionManagerDisplay:ConnectionManagerDisplay,getConnectionManagerDisplay:getConnectionManagerDisplay,handleLanguageChangeForConnectionManagerDisplay:handleLanguageChangeForConnectionManagerDisplay,keypadRequiredInExperiment:keypadRequiredInExperiment,needPhoneSurveyRef:needPhoneSurvey,needComputerSurveyBoolRef:needComputerSurveyBool,EasyEyesPeer:EasyEyesPeer,quitPsychoJS:quitPsychoJS});gotLoudspeakerMatch.current=a,microphoneInfo$1.current.micFullName=n.micFullName,microphoneInfo$1.current.micFullSerialNumber=n.micFullSerialNumber,microphoneInfo$1.current.micrFullManufacturerName=n.micrFullManufacturerName,microphoneInfo$1.current.phoneSurvey=n.phoneSurvey,needComputerSurveyBool.current?loudspeakerInfo$1.current.loudspeakerSurvey=i:loudspeakerInfo$1.current=i;needPhoneSurvey.current&&(psychoJS.experiment.addData("Microphone survey",JSON.stringify(microphoneInfo$1.current.phoneSurvey)),psychoJS.experiment.nextEntry());needComputerSurveyBool.current&&(psychoJS.experiment.addData("Loudspeaker survey",JSON.stringify(loudspeakerInfo$1.current.loudspeakerSurvey)),psychoJS.experiment.nextEntry());soundOutputSelectionsLocked()&&neededSoundOutputKinds(paramReader).length>0&&(psychoJS.experiment.addData("soundOutputLoudspeakers",formatSoundOutputSelection(getSoundOutputSelection("loudspeakers"))),psychoJS.experiment.addData("soundOutputHeadphones",formatSoundOutputSelection(getSoundOutputSelection("headphones"))),psychoJS.experiment.nextEntry());if(hideCompatibilityMessage(),t&&!r)return showExperimentEnding$1(),quitPsychoJS("",!1,paramReader,!0,!1,"compatibilityNotMet"),void(recruitmentServiceData?.incompatibleCode&&window.open("https://app.prolific.com/submissions/complete?cc="+recruitmentServiceData?.incompatibleCode));setCurrentFn("consentForm"),simulateActive&&publishPhaseEntered$1(SIM_PHASE.CONSENT);const o=await showForm(paramReader.read("_consentForm")[0],!0);if(hideForm(),!o)return status.consentGiven=!1,psychoJS.experiment.addData("consentGiven","FALSE"),hideForm(),void quitPsychoJS("","",paramReader,void 0,void 0,"consentDeclined");paramReader.read("_consentForm")[0]&&(status.consentGiven=!0,psychoJS.experiment.addData("consentGiven","TRUE"));paramReader.read("_saveSnapshotsBool")[0]&&capturedVideoFrameListener();const s=ifTrue$2(paramReader.read(getGlossary()._calibrateMicrophonesBool.name,"__ALL_BLOCKS__"));if(s&&r){const e=paramReader.read("_authors")[0],t=paramReader.read("_authorAffiliations")[0],r=paramReader.read("_authorEmails")[0],n=Math.floor(1e5+9e5*random$1("session")).toString(),i=getPavloviaProjectName()||"EasyEyes Experiment",a=readi18nPhrases("RC_VerificationEmailSubject",rc.language.value)||"EEE — Verify authorship for microphone calibration",o=readi18nPhrases("RC_VerificationEmail",rc.language.value)||"To calibrate microphones, please copy and paste the following code into the EEE web page:\n123456",s=readi18nPhrases("RC_VerificationEnterCode",rc.language.value)||"REQUIRED. To verify authorship please enter the 6-digit code sent by email to AAA.";console.log(`Demo: Email would be sent to ${r} with code: ${n}`),console.log(`Subject template: ${a}`),console.log(`Message template: ${o}`);try{const e=await fetch("https://easyeyes.app/.netlify/functions/email-verification/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({authorEmails:r,verificationCode:n,experimentName:i,emailSubjectTemplate:a,emailMessageTemplate:o,language:rc.language.value})});if(!e.ok)throw new Error(`Failed to send verification email: ${e.status}`);const t=await e.json();console.log("Email sent successfully:",t)}catch(error){return console.error("Email sending error:",error),await Swal.fire({title:"Email Error",text:"Failed to send verification email. Please check your internet connection and try again.",icon:"error",confirmButtonText:"Proceed"}),showExperimentEnding$1(),void quitPsychoJS("Email sending failed",!1,paramReader,!0,!1,"emailSendFailed")}let l=0;const c=4;let u=!1;for(;l<c&&!u;){l++;const i=await new Promise((e=>{Swal.fire({title:"Email Verification Required"+(l>1?` (Attempt ${l}/${c})`:""),html:`
|
|
320
|
+
`}g+="</div>",g+="\n <style>\n .thumbnail-option:hover {\n border-color:rgb(0, 0, 0) !important;\n background-color: #e7f3ff !important;\n transform: scale(1.02);\n transition: all 0.2s ease;\n }\n .thumbnail-option {\n transition: all 0.2s ease;\n }\n .thumbnail-option img {\n border: 1px solid #ddd;\n border-radius: 4px;\n }\n </style>\n ",f=g}else{f+='<div class="threshold-answers-set">';for(const e of c)f+=`<button class="threshold-button threshold-answer" data-answer="${e}">${e}</button>`;f+="</div>";for(const e of c)m.set(e,e)}else f+='<input type="text" class="threshold-answer">';const _=readFontDirection(paramReader,e),y="horizontal"===paramReader.read("questionAnswerLayout",e),b={title:l,stopKeydownPropagation:!1,showCancelButton:!1,showDenyButton:!1,showConfirmButton:!0,allowEnterKey:!1,allowOutsideClick:!1,allowEscapeKey:!1,...void 0!==t.backdrop?{backdrop:t.backdrop}:{},customClass:{confirmButton:"threshold-button"+(d?" hidden-button":""),container:[isFontLTR(_)?"":"right-to-left",y?"qa-answers-horizontal":"",t.containerClass||""].filter(Boolean).join(" "),title:isFontLTR(_)?"":"right-to-left"},showClass:{popup:"fade-in",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-show"},hideClass:{popup:"",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"}};let v;if(p?(b.html=f,b.focusConfirm=!1,b.showConfirmButton=!1,b.allowEnterKey=!1,b.allowEscapeKey=!1):d?(b.input="radio",b.inputOptions=m,b.inputAttributes={autocapitalize:"off"}):(b.input="textarea",b.inputAttributes={autocapitalize:"off"}),b.didOpen=()=>{if(t.spareFraction>0){const e=document.querySelector(".swal2-container"),r=document.querySelector(".swal2-popup");if(e&&r){const n=t.spareFraction,i=t.where||"top";e.style.position="fixed",e.style.setProperty("background","transparent","important"),e.style.zIndex="1000000",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.padding="0",e.style.margin="0",e.style.overflow="hidden","top"===i?(e.style.top=100*(1-n)+"%",e.style.left="0",e.style.width="100%",e.style.height=100*n+"%"):"bottom"===i?(e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height=100*n+"%"):"left"===i?(e.style.top="0",e.style.left=100*(1-n)+"%",e.style.width=100*n+"%",e.style.height="100%"):(e.style.top="0",e.style.left="0",e.style.width=100*n+"%",e.style.height="100%");const a=window.innerWidth,o=window.innerHeight,s="left"===i||"right"===i?a*n:a,l="top"===i||"bottom"===i?o*n:o,c=.96;r.classList.remove("fade-in"),r.style.animation="none",r.style.maxWidth="none",r.style.maxHeight="none",r.style.margin="0",r.querySelectorAll(".swal2-html-container, .swal2-radio, .swal2-textarea, .swal2-input").forEach((e=>{e.style.maxHeight="none",e.style.overflow="visible"}));const u=()=>{r.style.transform="none";const e=r.scrollWidth,t=r.scrollHeight;if(!e||!t)return;const n=Math.min(1,s*c/e,l*c/t);r.style.transformOrigin="center center",r.style.transform=`scale(${n})`};u(),"undefined"!=typeof ResizeObserver&&new ResizeObserver((()=>u())).observe(r)}}if(p){const e=(e,t)=>{document.querySelectorAll(".thumbnail-option").forEach((e=>{e.style.borderColor="transparent",e.style.backgroundColor="transparent",e.style.transform="scale(1)"})),e.style.borderColor="#007bff",e.style.backgroundColor="#f8f9fa",e.style.transform="scale(1.02)",Swal.close(),window.thumbnailResolveFunction&&window.thumbnailResolveFunction({value:t})};document.querySelectorAll(".thumbnail-option").forEach((t=>{t.addEventListener("click",(()=>{const r=t.getAttribute("data-answer");e(t,r)}))}));const t=setInterval((()=>{if(skipTrialOrBlock.skipBlock)return clearInterval(t),Swal.close(),void(window.thumbnailResolveFunction&&window.thumbnailResolveFunction({value:null}))}),200)}else if(d){const e=setInterval((()=>{if(skipTrialOrBlock.skipBlock)return clearInterval(e),void Swal.close();const t=document.querySelectorAll(".swal2-radio input");for(const r of t)r.checked&&(clearInterval(e),document.getElementsByClassName("swal2-confirm")[0].click())}),200)}else{const e=setInterval((()=>{if(toShowCursor())return clearInterval(e),void Swal.close()}),200)}const r=document.querySelector(".swal2-title");r&&(r.style.fontFamily=instructionFont.current,r.style.font=instructionFont.current),styleNodeAndChildrenRecursively(document.querySelector(".swal2-popup"),{color:colorRGBASnippetToRGBA(paramReader.read("instructionFontColorRGBA",e))})},isFullscreen()||(await requestFullscreenSafe(rc),clearFullscreenWasLost()),p?(v=await withBreadcrumb("questionAndAnswerSwal",(()=>new Promise((e=>{window.thumbnailResolveFunction=e,showCursor(),Swal.fire(b).then((()=>{}))})))),delete window.thumbnailResolveFunction):(showCursor(),v=await withBreadcrumb("questionAndAnswerSwal",(()=>Swal.fire(b)))),v){const t=v.value??"";correctAns.current=s;const o=getQuestionAndAnswerColumnName(h,paramReader.read("conditionName",e));psychoJS.experiment.addData(o,t),psychoJS.experiment.addData("questionAndAnswerNickname"+n,h),psychoJS.experiment.addData("questionAndAnswerQuestion"+n,l),psychoJS.experiment.addData("questionAndAnswerCorrectAnswer"+n,s),psychoJS.experiment.addData("questionAndAnswerImageFileName"+n,imageConfig.currentImageFullFileName),psychoJS.experiment.addData("questionAndAnswerResponse"+n,t);const c=getAnswerValue(`${e}|${r-1}`,t);void 0!==c&&psychoJS.experiment.addData(o+".value",c),t===s?(imageConfig.responsePositiveFeedbackBool&&a.play(),incrementTrialCorrectThisBlock(status.block_condition),i=1):i=0}}return i},imageAdjustState={active:!1,finished:!1,thresholdParameter:"",thresholdGuess:0,thresholdGuessSide:0,currentValue:0,currentXYPx:null,zeroEccentricityXPx:null,pendingOffsetPx:0,stepPx:10,stepMorePx:40,scaleUp:1.05,scaleUpMore:1.2,imageStim:null,keydownHandler:null},imageAdjustStepFallbackPx=10,imageAdjustStepMoreFallbackPx=40,isEccentricityXParameter=e=>"targetEccentricityXDeg"===e||"targetEccentrictyXDeg"===e,restrictImageAdjustToInitialSide=e=>imageAdjustState.thresholdGuessSide?imageAdjustState.thresholdGuessSide>0?Math.max(0,e):Math.min(0,e):e,getImageAdjustScreenXBoundsPx=()=>{const e=psychoJS.window._size[0],t=imageAdjustState.imageStim?imageAdjustState.imageStim.size:void 0,r=Array.isArray(t)&&Number.isFinite(t[0])?Math.abs(t[0]):0,n=Math.max(0,(e-r)/2);return[-n,n]},initializeImageAdjustPositionPx=()=>{const e=Number(imageConfig.targetEccentricityYDeg)||0,t=restrictImageAdjustToInitialSide(Number(imageAdjustState.thresholdGuess)||0),r=XYPxOfDeg(0,[t,e],!0,!1);return!(!Number.isFinite(r[0])||!Number.isFinite(r[1]))&&(imageAdjustState.zeroEccentricityXPx=XYPxOfDeg(0,[0,e],!0,!1)[0],r[0]+=imageAdjustState.pendingOffsetPx,imageAdjustState.pendingOffsetPx=0,imageAdjustState.currentXYPx=r,!0)},applyImageAdjustPosition=()=>{if(!imageAdjustState.active)return;if(!isEccentricityXParameter(imageAdjustState.thresholdParameter))return;if(!imageAdjustState.imageStim)return;if(!imageAdjustState.currentXYPx&&!initializeImageAdjustPositionPx())return;const e=imageAdjustState.currentXYPx;imageAdjustState.thresholdGuessSide&&Number.isFinite(imageAdjustState.zeroEccentricityXPx)&&(e[0]=imageAdjustState.thresholdGuessSide>0?Math.max(imageAdjustState.zeroEccentricityXPx,e[0]):Math.min(imageAdjustState.zeroEccentricityXPx,e[0]));const[t,r]=getImageAdjustScreenXBoundsPx();e[0]=Math.min(r,Math.max(t,e[0])),imageAdjustState.imageStim.setPos([e[0],e[1]]);const n=XYDegOfPx(0,e,!0,!1);imageConfig.targetEccentricityXDeg=n[0],imageAdjustState.currentValue=n[0]},prepareImageAdjust=e=>{if(imageAdjustState.active)return;const t=paramReader.read("thresholdParameter",e);imageAdjustState.thresholdGuess=Number(paramReader.read("thresholdGuess",e))||0,imageAdjustState.thresholdGuessSide=Math.sign(imageAdjustState.thresholdGuess),imageAdjustState.active=!0,imageAdjustState.finished=!1,imageAdjustState.thresholdParameter=t,imageAdjustState.imageStim=null,imageAdjustState.currentXYPx=null,imageAdjustState.zeroEccentricityXPx=null,imageAdjustState.pendingOffsetPx=0,imageAdjustState.scaleUp=Number(paramReader.read("thresholdParameterScaleUp",e)),imageAdjustState.scaleUpMore=Number(paramReader.read("thresholdParameterScaleUpMore",e));const r=Number(paramReader.read("thresholdParameterScaleUp",e)),n=Number(paramReader.read("thresholdParameterScaleUpMore",e)),i=Screens[0].pxPerCm;Number.isFinite(i)&&i>0?(imageAdjustState.stepPx=r*i,imageAdjustState.stepMorePx=n*i):(imageAdjustState.stepPx=imageAdjustStepFallbackPx,imageAdjustState.stepMorePx=imageAdjustStepMoreFallbackPx),isEccentricityXParameter(t)&&(imageAdjustState.currentValue=imageAdjustState.thresholdGuess);const a=async e=>{if(!imageAdjustState.active)return;if(isRecalibrationActive())return;if(!isFullscreen())return void(await requireFullscreenForTrialInitiation());const t=e.key,r=e.code,n="ArrowRight"===t||"ArrowRight"===r,i="ArrowLeft"===t||"ArrowLeft"===r;if(" "===t||"Spacebar"===t||"Space"===r)return e.preventDefault(),void(imageAdjustState.finished=!0);if(!n&&!i)return;e.preventDefault();const a=n?1:-1;if(isEccentricityXParameter(imageAdjustState.thresholdParameter)){const t=e.shiftKey?imageAdjustState.stepMorePx:imageAdjustState.stepPx;imageAdjustState.currentXYPx?imageAdjustState.currentXYPx[0]+=a*t:imageAdjustState.pendingOffsetPx+=a*t,applyImageAdjustPosition()}else if(Number.isFinite(imageAdjustState.currentValue)){const t=e.shiftKey?imageAdjustState.scaleUpMore:imageAdjustState.scaleUp,r=(Math.abs(imageAdjustState.currentValue)+.1)*(t-1);imageAdjustState.currentValue+=a*r}};imageAdjustState.keydownHandler=a,window.addEventListener("keydown",a)},bindImageAdjustStim=e=>{imageAdjustState.active&&(imageAdjustState.imageStim=e,applyImageAdjustPosition())},getImageAdjustReport=()=>{const e=imageAdjustState.thresholdParameter;if(!isEccentricityXParameter(e)||!imageAdjustState.currentXYPx||!imageAdjustState.imageStim)return{parameter:e,value:imageAdjustState.currentValue,maxAllowedEccDeg:void 0};const t=imageAdjustState.currentXYPx,r=XYDegOfPx(0,t,!0,!1)[0],[n,i]=getImageAdjustScreenXBoundsPx(),a=imageAdjustState.thresholdGuessSide<0?n:i;return{parameter:e,value:r,maxAllowedEccDeg:XYDegOfPx(0,[a,t[1]],!0,!1)[0]}},stopImageAdjust=()=>{imageAdjustState.keydownHandler&&window.removeEventListener("keydown",imageAdjustState.keydownHandler),imageAdjustState.active=!1,imageAdjustState.finished=!1,imageAdjustState.thresholdGuessSide=0,imageAdjustState.keydownHandler=null,imageAdjustState.imageStim=null,imageAdjustState.currentXYPx=null,imageAdjustState.zeroEccentricityXPx=null,imageAdjustState.pendingOffsetPx=0},createTransparentImage=()=>{const e=document.createElement("canvas");e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,1,1);const t=e.toDataURL("image/png"),r=new Image;return r.src=t,r};let waitingTransparencyFrames=0,realImageLoaded=!1,realImageElement=null,doneSettingRealImage=!1,qaStarted=!1,qaFinished=!1,storedArgs={showImage:null,trialCounter:null,spareFraction:0,where:"top",blockCondition:null};const showImageBegin=(e,t,r,n,i,a,o,s,l,c,u,d,h,p,f=0,m="top",g=null)=>async function(){if(storedArgs.showImage=h,storedArgs.trialCounter=i,storedArgs.spareFraction=Math.max(0,Math.min(1,Number(f)||0)),storedArgs.where=["top","bottom","left","right"].includes(m)?m:"top",storedArgs.blockCondition=g,waitingTransparencyFrames=0,realImageLoaded=!1,realImageElement=null,doneSettingRealImage=!1,qaStarted=!1,qaFinished=!1,numFrames=0,a&&a.setAutoDraw(!1),o&&o.setAutoDraw(!1),showConditionNameConfig$1.show=l,showConditionNameConfig$1.name=c,showConditionNameConfig$1.showTargetSpecs=u,updateTargetSpecs({showImage:e,showImageSpareFraction:f,showImageWhere:m}),drawTargetSpecs(o,s),screenBackground.colorRGBA=d,psychoJS.window.color=new Color$1(screenBackground.colorRGBA),psychoJS.window._needUpdate=!0,h.setAutoDraw(!1),h._needUpdate=!0,h.setImage(createTransparentImage()),h.setAutoDraw(!0),realImageElement=document.createElement("img"),realImageElement.src=`./images/${e}`,realImageElement.id="showImageEle",realImageElement.style.display="block",realImageElement.style.margin="auto",realImageElement.onload=()=>{realImageLoaded=!0},r||n){let e=getTrialInfoStr(p,r,n,void 0,void 0,status.nthBlock,totalBlocks.current,viewingDistanceCm.current,targetKind.current);e&&(i.setText(e),i.setPos([window.innerWidth/2,-window.innerHeight/2]),updateColor(i,"instruction",status.block),i.setAutoDraw(!0))}return psychoJS.eventManager.clearKeys(),Scheduler$1.Event.NEXT};var numFrames=0;const showImageEachFrame=(t,r,n)=>async function(){if(toShowCursor())return Scheduler$1.Event.NEXT;if(numFrames++,waitingTransparencyFrames++,!doneSettingRealImage){if(waitingTransparencyFrames<=2)return Scheduler$1.Event.FLIP_REPEAT;if(!realImageLoaded)return Scheduler$1.Event.FLIP_REPEAT;const e=window.innerHeight,t=window.innerWidth,i=realImageElement.naturalHeight,a=realImageElement.naturalWidth,o=storedArgs.spareFraction,s=storedArgs.where;let l,c,u=0,d=0;const h=Math.max(0,Math.min(1,o)),p=t/e;let f,m;"top"===s||"bottom"===s?(f=p,m=1-h,d="top"===s?h/2:-h/2):(f=(1-h)*p,m=1,u="left"===s?-h*p/2:h*p/2);const g=a/i;g>f/m?(l=f,c=f/g):(c=m,l=m*g),storedArgs.showImage.setImage(realImageElement),storedArgs.showImage.setSize([l,c]),storedArgs.showImage.setPos([u,d]),storedArgs.showImage._needUpdate=!0,storedArgs.showImage.setAutoDraw(!0),storedArgs.trialCounter._needUpdate=!0,storedArgs.trialCounter.setAutoDraw(!0);const _=storedArgs.blockCondition||status.block_condition,y=_&&areQuestionAndAnswerParametersPresent(_);if(r&&!y){const e=document.createElement("button");e.id="showImageButton",e.classList.add("threshold-button","threshold-proceed-button"),e.innerHTML=renderMarkdown(readi18nPhrases("T_proceed",n)),e.addEventListener("click",(()=>{clickedContinue.current=!0})),document.body.appendChild(e)}doneSettingRealImage=!0}const i=storedArgs.blockCondition||status.block_condition;if(doneSettingRealImage&&!qaStarted&&i&&areQuestionAndAnswerParametersPresent(i)){qaStarted=!0;const t=i;(async()=>{const r=document.getElementById("experiment-progress-container"),n=r&&r.style.left&&"auto"!==r.style.left?"padding-left":"padding-right",i=document.createElement("style");i.textContent=`.swal2-qa-padded { ${n}: 60px !important; box-sizing: border-box !important; }`,document.head.appendChild(i);try{parseImageQuestionAndAnswer(t,{skipIdentify:!0}),await questionAndAnswerForImage(t,{spareFraction:storedArgs.spareFraction,where:storedArgs.where,backdrop:!1,containerClass:"swal2-qa-padded"})}catch(e){console.warn("showImage QA failed:",e)}finally{i.remove(),qaFinished=!0}})()}if(qaStarted)return qaFinished?Scheduler$1.Event.NEXT:Scheduler$1.Event.FLIP_REPEAT;const a=psychoJS.eventManager.getKeys({keyList:["return"]}),o=keypad.handler&&keypad.handler.inUse(status.block)&&_key_resp_allKeys.current.map((e=>e.name)).some((e=>["return",readi18nPhrases("T_RETURN",n).toLowerCase()].includes(e.toLowerCase())));return numFrames>5&&t&&(a.length>0||o)?(keypad.handler&&keypad.handler.clearKeys(),Scheduler$1.Event.NEXT):r&&clickedContinue.current?(clickedContinue.current=!1,Scheduler$1.Event.NEXT):Scheduler$1.Event.FLIP_REPEAT},showImageEnd=e=>async function(){const t=document.getElementById("showImageEle");t&&t.remove();const r=document.getElementById("showImageButton");return r&&r.remove(),e.setAutoDraw(!1),e._needUpdate=!0,Scheduler$1.Event.NEXT},createExperimentParagaph=(e,t,r={})=>{const n=document.createElement("p");return n.innerText=e,n.id=t,r&&(r.className&&(n.className=r.className),r.style&&Object.assign(n.style,r.style)),n},createExperimentHeader=(e,t,r={})=>{const n=document.createElement("h2");return n.innerText=e,n.id=t,r&&(r.className&&(n.className=r.className),r.style&&Object.assign(n.style,r.style)),n},isWindowMaximized=e=>(console.log("Window innerWidth",e.innerWidth,"Window screen.availWidth",e.screen.availWidth,"Window innerHeight",e.innerHeight,"Window screen.availHeight",e.screen.availHeight),e.innerWidth===e.screen.availWidth&&e.innerHeight<=e.screen.availHeight),handleWindowOpen=(e,t,r,n,i={},a,o)=>{const s=openWindow(e,t,i);if(s){const e={name:r,usePsychoJSBool:!1,pxPerCm:0,Hz:0,eyeXYZPxLeft:[0,0,0],eyeXYZPxRight:[0,0,0],fixationXYZPx:[0,0,0],eye:r,viewingDistanceCm:0,viewingDistanceCmUsedForCalculations:0,nearestPointXYZPx:[0,0],nearestPointXYZDeg:[0,0],rc:null,window:s,isWindowMaximized:isWindowMaximized(s),measurements:{screenName:"",widthCm:0,heightCm:0,leftMarginCm:0,rightMarginCm:0,topMarginCm:0,bottomMarginCm:0,widthPx:s.innerWidth,heightPx:s.innerHeight},measurementContainer:null,fixationConfig:{nominalPos:[0,0],pos:[0,0],offset:void 0,show:!0,strokeLength:45,strokeWidth:2,color:void 0,markingBlankedNearTargetBool:void 0,markingBlankingPos:void 0,markingBlankingRadiusReEccentricity:void 0,markingBlankingRadiusReTargetHeight:void 0,markingFixationHotSpotRadiusDeg:void 0,markingFixationHotSpotRadiusPx:void 0,markingFixationMotionRadiusDeg:void 0,markingFixationMotionPeriodSec:void 0,markingFixationStrokeLengthDeg:void 0,markingFixationStrokeThicknessDeg:void 0,markingFixationStrokeThickening:void 0,markingOffsetBeforeTargetOnsetSecs:void 0,markingOnsetAfterTargetOffsetSecs:void 0,markingFixationMotionSpeedDegPerSec:void 0,stim:void 0,fixationPosAfterDelay:void 0,trackingTimeAfterDelay:void 0,preserveOffset:!1}};Screens.push(e),s.onload=async()=>{const t=getMonitorNumberingMapForAllMonitors("left"===r?1:3),n=getMonitorNumberComponent("left"===r?1:3);s.document.body.appendChild(t),s.document.body.appendChild(n),s.addEventListener("resize",(async()=>{if(isWindowMaximized(s)&&(e.isWindowMaximized=!0,t.remove(),n.remove(),Screens.every((e=>e.isWindowMaximized)))){const e=Screens.find((e=>"left"===e.name));if(e){const{measurements:t,screenContainer:r}=await inputForMultipleMonitorMeasurements(e.window.document.body,a,e.window);e.measurements=t,e.measurementContainer=r}const t=Screens.find((e=>"Main"===e.name));if(t){const{measurements:e,screenContainer:r}=await inputForMultipleMonitorMeasurements(t.window.document.body,a,t.window);t.measurements=e,t.measurementContainer=r}const r=Screens.find((e=>"right"===e.name));if(r){const{measurements:e,screenContainer:t}=await inputForMultipleMonitorMeasurements(r.window.document.body,a,r.window);r.measurements=e,r.measurementContainer=t}Screens.forEach((e=>e.measurementContainer?.remove())),Screens.forEach((e=>e.window.removeEventListener("resize",(()=>{})))),o()}}))}}console.log("Screens",Screens)},openWindow=(e,t,r={})=>{const n=`width='${r.width}', height='${r.height}', left='${r.left}', top='${r.top}'`;return window.open(e,t,n)},startMultipleDisplayRoutine=async(e,t)=>{viewMonitorsXYDeg.maxNumberOfMonitors<=1||(await showExplanationPage(t),console.log("Number of screens",viewMonitorsXYDeg.maxNumberOfMonitors,viewMonitorsXYDeg.values),await new Promise((async e=>{for(let r=1;r<viewMonitorsXYDeg.maxNumberOfMonitors;r++){const n="components/multiple-displays/peripheralDisplay.html",i=`window${r}`,a=1==r?"left":"right";console.log("Opening window",n,i,a);handleWindowOpen(n,i,a,"",{left:100*r,top:0,width:1e3,height:1e3},t,e)}})))},showExplanationPage=async e=>{const t=document.createElement("div");t.style.zIndex="999999",t.style.position="absolute",t.style.top="5vh",t.style.left="10vw",t.style.width="70vw";const r=createExperimentHeader("Multiple Monitors Required","multiple-display-header",{style:{marginBottom:"20px"}}),n=createExperimentParagaph(" This experiment needs multiple monotirs. For that, we need to open multiple browser windows as popups. Click on the Test button to make sure popups are allowed on your browser for this site.","multiple-display-explanation",{style:{marginBottom:"20px"}}),i=document.createElement("button");i.innerText=readi18nPhrases("T_proceed",e),i.className="form-input-btn",i.id="multiple-display-proceed",i.style.margin="0",i.style.width="auto",document.body.appendChild(t),t.appendChild(r),t.appendChild(n),await showTestPopupButton(e,t),n.innerText="It appears popups are allowed on your browser. Once you click on the Proceed button, the experiment will automatically open several new windows. Each of these windows is intended to be displayed on a different monitor. Please follow the instructions on each of the windows to drag them to the appropriate monitor.",t.appendChild(i),await new Promise((e=>{i.onclick=()=>{r.remove(),n.remove(),i.remove(),t.remove(),e()}}))},testPopupBlocking=()=>new Promise(((e,t)=>{const r=[];let n=0;for(let i=0;i<3;i++){const e=window.open("",`testWindow${i}`,"width=100,height=100");e&&(n++,r.push(e))}3===n?(r.forEach((e=>e.close())),e(!0)):(r.forEach((e=>e?.close())),t(!1))})),showTestPopupButton=async(e,t)=>{const r=document.createElement("button");r.innerText="Test",r.className="form-input-btn",r.id="popup-test-proceed",r.style.margin="0",r.style.width="auto",t.appendChild(r),await new Promise((e=>{r.onclick=async()=>{try{await testPopupBlocking()&&(r.remove(),alert("Popups are allowed in your browser."),e())}catch{alert("Popups are blocked in your browser. Please enable them and try again.")}}}))},inputForMultipleMonitorMeasurements=async(e,t,r=null,n="")=>{const i={screenName:n,widthCm:0,heightCm:0,leftMarginCm:0,rightMarginCm:0,topMarginCm:0,bottomMarginCm:0,widthPx:0,heightPx:0};return{measurements:i,screenContainer:await measurementForm(i,e,0,t,r)}},measurementForm=async(e,t,r,n,i=null)=>await new Promise((a=>{const o=r+1,s=e,l=document.createElement("div");l.style.position="absolute",l.style.width="100vw",l.style.height="100vh",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center";const c=document.createElement("p");c.innerText=readi18nPhrases("RC_MeasureWidthHeightAndMargins",n),c.style.position="absolute",c.style.top="0",c.style.left="20px",c.style.fontSize="1.5rem",l.appendChild(c);const u=document.createElement("div");u.style.position="relative",u.style.width="60%",u.style.height="60%",u.style.border="2px solid black",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center";const d=document.createElement("div");d.style.width="80%",d.style.height="80%",d.style.border="2px solid black",d.style.position="relative",u.appendChild(d),l.appendChild(u);const h="http://www.w3.org/2000/svg",p=document.createElementNS(h,"svg");p.setAttribute("width","100%"),p.setAttribute("height","100%"),p.style.position="absolute",p.style.top="0",p.style.left="0";const f=document.createElementNS(h,"line");f.setAttribute("x1","0%"),f.setAttribute("y1","50%"),f.setAttribute("x2","100%"),f.setAttribute("y2","50%"),f.setAttribute("stroke","black"),f.setAttribute("stroke-width","2");const m=document.createElementNS(h,"line");m.setAttribute("x1","0%"),m.setAttribute("y1","50%"),m.setAttribute("x2","2%"),m.setAttribute("y2","48%"),m.setAttribute("stroke","black"),m.setAttribute("stroke-width","2");const g=document.createElementNS(h,"line");g.setAttribute("x1","0%"),g.setAttribute("y1","50%"),g.setAttribute("x2","2%"),g.setAttribute("y2","52%"),g.setAttribute("stroke","black"),g.setAttribute("stroke-width","2");const _=document.createElementNS(h,"line");_.setAttribute("x1","100%"),_.setAttribute("y1","50%"),_.setAttribute("x2","98%"),_.setAttribute("y2","48%"),_.setAttribute("stroke","black"),_.setAttribute("stroke-width","2");const y=document.createElementNS(h,"line");y.setAttribute("x1","100%"),y.setAttribute("y1","50%"),y.setAttribute("x2","98%"),y.setAttribute("y2","52%"),y.setAttribute("stroke","black"),y.setAttribute("stroke-width","2"),p.appendChild(f),p.appendChild(m),p.appendChild(g),p.appendChild(_),p.appendChild(y);const b=document.createElementNS(h,"line");b.setAttribute("x1","50%"),b.setAttribute("y1","0%"),b.setAttribute("x2","50%"),b.setAttribute("y2","100%"),b.setAttribute("stroke","black"),b.setAttribute("stroke-width","2");const v=document.createElementNS(h,"line");v.setAttribute("x1","50%"),v.setAttribute("y1","0%"),v.setAttribute("x2","48%"),v.setAttribute("y2","2%"),v.setAttribute("stroke","black"),v.setAttribute("stroke-width","2");const S=document.createElementNS(h,"line");S.setAttribute("x1","50%"),S.setAttribute("y1","0%"),S.setAttribute("x2","52%"),S.setAttribute("y2","2%"),S.setAttribute("stroke","black"),S.setAttribute("stroke-width","2");const w=document.createElementNS(h,"line");w.setAttribute("x1","50%"),w.setAttribute("y1","100%"),w.setAttribute("x2","48%"),w.setAttribute("y2","98%"),w.setAttribute("stroke","black"),w.setAttribute("stroke-width","2");const T=document.createElementNS(h,"line");T.setAttribute("x1","50%"),T.setAttribute("y1","100%"),T.setAttribute("x2","52%"),T.setAttribute("y2","98%"),T.setAttribute("stroke","black"),T.setAttribute("stroke-width","2"),p.appendChild(b),p.appendChild(v),p.appendChild(S),p.appendChild(w),p.appendChild(T);const E=document.createElementNS(h,"line");E.setAttribute("x1","50%"),E.setAttribute("y1","80%"),E.setAttribute("x2","50%"),E.setAttribute("y2","100%"),E.setAttribute("stroke","black"),E.setAttribute("stroke-width","2");const x=document.createElementNS(h,"line");x.setAttribute("x1","50%"),x.setAttribute("y1","80%"),x.setAttribute("x2","49.5%"),x.setAttribute("y2","81%"),x.setAttribute("stroke","black"),x.setAttribute("stroke-width","2");const A=document.createElementNS(h,"line");A.setAttribute("x1","50%"),A.setAttribute("y1","80%"),A.setAttribute("x2","50.5%"),A.setAttribute("y2","81%"),A.setAttribute("stroke","black"),A.setAttribute("stroke-width","2");const C=document.createElementNS(h,"line");C.setAttribute("x1","50%"),C.setAttribute("y1","100%"),C.setAttribute("x2","49.5%"),C.setAttribute("y2","99%"),C.setAttribute("stroke","black"),C.setAttribute("stroke-width","2");const R=document.createElementNS(h,"line");R.setAttribute("x1","50%"),R.setAttribute("y1","100%"),R.setAttribute("x2","50.5%"),R.setAttribute("y2","99%"),R.setAttribute("stroke","black"),R.setAttribute("stroke-width","2");const D=document.createElementNS(h,"svg");D.setAttribute("width","100%"),D.setAttribute("height","100%"),D.style.position="absolute",D.style.top="0",D.style.left="0",D.appendChild(E),D.appendChild(x),D.appendChild(A),D.appendChild(C),D.appendChild(R),l.appendChild(D),d.appendChild(p);const P=createInputField(readi18nPhrases("RC_Width",n),`width-${o}`,"number",{style:{alignItems:"baseline"}});P.style.position="absolute",P.style.top="50%",P.style.left="20%",P.style.transform="translateX(-50%)";const I=createInputField(readi18nPhrases("RC_Height",n),`height-${o}`,"number",{style:{alignItems:"baseline"}});I.style.position="absolute",I.style.top="30%",I.style.left="50%",I.style.transform="translateY(-50%)",d.appendChild(P),d.appendChild(I);const k=createInputField(readi18nPhrases("RC_LeftMargin",n),`left-margin-${o}`,"number",{style:{alignItems:"flex-start"}},"","column");k.style.position="absolute",k.style.left="0",k.style.top="50%",k.style.transform="translateY(-50%)";const M=createInputField(readi18nPhrases("RC_RightMargin",n),`right-margin-${o}`,"number",{style:{alignItems:"flex-end"}},"","column");M.style.position="absolute",M.style.right="0",M.style.top="50%",M.style.transform="translateY(-50%)";const $=createInputField(readi18nPhrases("RC_TopMargin",n),`top-margin-${o}`,"number",{style:{alignItems:"baseline"}});$.style.position="absolute",$.style.top="0",$.style.left="50%",$.style.transform="translateX(-50%)";const O=createInputField(readi18nPhrases("RC_BottomMargin",n),`bottom-margin-${o}`,"number",{style:{alignItems:"baseline"}});O.style.position="absolute",O.style.bottom="0",O.style.left="50%",O.style.transform="translateX(-50%)";const N=createInputField(readi18nPhrases("RC_Elevation",n),`elevation-${o}`,"number",{style:{alignItems:"baseline"}});N.style.position="absolute",N.style.bottom="10%",N.style.left="50%";const F=document.createElement("button");F.innerText=readi18nPhrases("T_proceed",n),F.classList.add("form-input-btn"),F.style.position="absolute",F.style.bottom="5%",F.style.margin="0px",F.style.left="76%",F.onclick=()=>{s.width=parseFloat(P.querySelector("input")?.value||"0"),s.height=parseFloat(I.querySelector("input")?.value||"0"),s.leftMargin=parseFloat(k.querySelector("input")?.value||"0"),s.rightMargin=parseFloat(M.querySelector("input")?.value||"0"),s.topMargin=parseFloat($.querySelector("input")?.value||"0"),s.bottomMargin=parseFloat(O.querySelector("input")?.value||"0"),s.elevation=parseFloat(N.querySelector("input")?.value||"0"),s.width>0&&s.height>0?(P.querySelector("input")?.setAttribute("readonly","true"),I.querySelector("input")?.setAttribute("readonly","true"),k.querySelector("input")?.setAttribute("readonly","true"),M.querySelector("input")?.setAttribute("readonly","true"),$.querySelector("input")?.setAttribute("readonly","true"),O.querySelector("input")?.setAttribute("readonly","true"),N.querySelector("input")?.setAttribute("readonly","true"),F.remove(),a(l)):i&&i.alert("Please fill out all fields with valid values.")},u.appendChild(k),u.appendChild(M),u.appendChild($),u.appendChild(O),l.appendChild(N),l.appendChild(F),t.appendChild(l)})),createInputField=(e,t,r,n={},i="",a="row")=>{const o=document.createElement("input");o.type=r,o.id=t,o.value=i,o.style.borderRadius="15px",o.style.width="60px",o.style.height="25px",o.style.fontSize="1rem",o.style.border="1px solid black",o.style.marginTop="10px",o.style.marginBottom="10px";const s=document.createElement("p");s.innerText=e,s.style.margin="0",s.style.marginRight="10px";const l=document.createElement("span");l.innerText="cm",l.style.marginLeft="10px";const c=document.createElement("div");return c.style.display="flex",c.style.flexDirection=a,c.style.zIndex="99999999",c.appendChild(s),c.appendChild(o),c.appendChild(l),n&&n.style&&Object.assign(c.style,n.style),c},getMonitorNumberingMapForAllMonitors=e=>{const t=getAlignmentDirection(),r=viewMonitorsXYDeg.maxNumberOfMonitors,n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.flexDirection="column",n.style.justifyContent="center",n.style.alignItems="center",n.style.zIndex="999999",n.style.position="absolute";const i=document.createElement("div");i.style.fontWeight="bold",i.style.color="black",i.style.backgroundColor="white",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center";const a=Array.from({length:r},((e,t)=>t+1));"horizontal"===t?a.forEach((e=>{const t=document.createElement("span");t.innerText=e.toString(),t.style.margin="0 10px",t.style.border="3px solid black",t.style.width=50/r+"vw",t.style.height="20vh",t.style.textAlign="center",t.style.fontSize=15/r+"rem",i.appendChild(t)})):a.reverse().forEach((e=>{i.style.flexDirection="column";const t=document.createElement("span");t.innerText=e.toString(),t.style.margin="0 10px",t.style.border="3px solid black",t.style.width="20vw",t.style.height=50/r+"vh",t.style.textAlign="center",t.style.fontSize=15/r+"rem",i.appendChild(t)}));const o=document.createElement("p");return o.innerHTML=`Drag me to monitor <b>${e}</b>`,o.style.margin="20px",o.style.fontSize="2rem",n.appendChild(i),n.appendChild(o),n},getMonitorNumberComponent=e=>{const t=document.createElement("div");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex="999999",t.style.fontSize="5rem",t.style.width="15vw",t.style.height="15vh",t.style.textAlign="center",t.style.border="3px solid black",t.style.fontWeight="bold",t.style.color="black",t.style.backgroundColor="white",t.innerText=e.toString(),t},getAlignmentDirection=()=>getHorizontalRange()>getVerticalRange()?"horizontal":"vertical",getHorizontalRange=()=>{const e=viewMonitorsXYDeg.values.map((e=>e.map((e=>e[0]))));console.log("xValues",e);return Math.max(...e.flat())-Math.min(...e.flat())},getVerticalRange=()=>{const e=viewMonitorsXYDeg.values.map((e=>e.map((e=>e[1]))));console.log("yValues",e);return Math.max(...e.flat())-Math.min(...e.flat())};async function loadGlossary(e){const[t,r]=e.split("/").filter(Boolean),n=`${await getEasyEyesBaseUrl()}/.netlify/functions/glossary?username=${t}&experiment=${r}`;let i=0;for(;;)try{const e=await fetch(n);return await e.json()}catch{await wait(getRetryDelayMs(i++))}}const glossaryData=await loadGlossary(window.location.pathname),TITLE_PAGE_ID="easyeyes-title-page",TITLE_PAGE_BUTTON_ID="easyeyes-title-page-proceed-button",TITLE_PAGE_LANGUAGE_WRAPPER_ID="easyeyes-title-page-language-wrapper",TITLE_PAGE_LANGUAGE_TOP_MOBILE="7rem",isRTLLanguage=e=>"rtl"===(readi18nPhrases("EE_LanguageDirection",e)||"LTR").toString().toLowerCase(),tryReadPhrase=(e,t)=>{try{return readi18nPhrases(e,t)||""}catch{return""}};async function showTitlePage(e,t){const r=(e.read("_showTitlePage")?.[0]||"title").trim();if("none"===r)return;const n=e.read("_online1Title")?.[0]||"",i="titleAndDescription"===r&&e.read("_online2Description")?.[0]||"";if(!n&&!i)return;const a=()=>t?.language?.value||"en",o=()=>readi18nPhrases("T_proceed",a())||"Proceed";return new Promise((r=>{document.body.classList.add("easyeyes-gray-bg"),document.documentElement.classList.add("easyeyes-gray-bg"),document.body.style.backgroundColor="#eee";const s=document.body.style.overflow;document.body.style.overflow="hidden";const l=document.createElement("div");l.id=TITLE_PAGE_ID,l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: #eee;\n z-index: 1000000;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n ";const c=window.matchMedia("(max-width: 480px)").matches,u=c?"1rem":"2rem",d=!!e.read("_languageSelectionByParticipantBool")?.[0],h=document.createElement("div");h.style.flex="1",h.style.maxWidth="900px",h.style.boxSizing="border-box",h.style.padding="0 0 clamp(20px, 5vh, 60px) 0";const p="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif",f=document.createElement("div");f.id="easyeyes-title-page-title-block",f.style.position="fixed",f.style.top=c?"1rem":"2rem",f.style.margin="0",f.style.padding="0",f.style.maxWidth=c?"calc(100vw - 2rem)":"calc(100vw - 4rem)",f.style.color="#000",f.style.pointerEvents="none",f.style.zIndex="1000007",f.style.fontFamily=p;const m=document.createElement("div");m.id="easyeyes-title-page-welcome",m.style.margin="0 0 0.15em 0",m.style.padding="0",m.style.fontFamily=p,m.style.fontSize="1.4rem",m.style.fontWeight="400",m.style.color="#000",m.style.lineHeight="1.6",m.textContent=tryReadPhrase("EE_Welcome",a()),m.textContent||(m.style.display="none");const g=document.createElement("h1");g.id="easyeyes-title-page-title",g.style.margin="0",g.style.padding="0",g.style.fontFamily=p,g.style.fontSize=c?"1.8rem":"2.5rem",g.style.fontWeight="400",g.style.color="#000",g.style.lineHeight=c?"120%":"100%",g.style.whiteSpace="pre-line",g.innerHTML=renderMarkdown(n),f.appendChild(m),f.appendChild(g);let _=null;i&&(_=document.createElement("div"),_.style.cssText="\n font-size: clamp(16px, 2vw, 18px);\n line-height: 1.5;\n margin-bottom: clamp(20px, 4vh, 40px);\n ",_.innerHTML=renderMarkdown(i),_.firstElementChild&&(_.firstElementChild.style.marginTop="0"),h.appendChild(_));let y=null;d&&(y=createLanguageSelector({rc:t,id:TITLE_PAGE_LANGUAGE_WRAPPER_ID,topMobile:TITLE_PAGE_LANGUAGE_TOP_MOBILE,zIndex:"1000008",onChange:()=>{w(),S(),v()}}));const b=c?16:24,v=()=>{let e=f.getBoundingClientRect().bottom+b;y&&c&&(y.wrapper.style.top=`${Math.ceil(e)}px`,e=y.wrapper.getBoundingClientRect().bottom+b),h.style.paddingTop=`${Math.ceil(e)}px`},S=()=>{const e=isRTLLanguage(a());h.style.direction=e?"rtl":"ltr",h.style.textAlign=e?"right":"left",e?(h.style.marginLeft="auto",h.style.marginRight=u):(h.style.marginLeft=u,h.style.marginRight="auto"),m.style.direction=e?"rtl":"ltr",m.style.textAlign=e?"right":"left",_&&(_.style.direction=e?"rtl":"ltr",_.style.textAlign=e?"right":"left"),e?(f.style.right=u,f.style.left="",f.style.textAlign="right",f.style.direction="rtl"):(f.style.left=u,f.style.right="",f.style.textAlign="left",f.style.direction="ltr")};S();const w=()=>{const e=a();m.textContent=tryReadPhrase("EE_Welcome",e),m.style.display=m.textContent?"":"none",T.innerText=o()};l.appendChild(f),y&&l.appendChild(y.wrapper),l.appendChild(h);const T=document.createElement("button");T.id=TITLE_PAGE_BUTTON_ID,T.classList.add("btn","btn-success"),T.type="button",T.tabIndex=0,T.innerText=o(),T.style.width="fit-content",T.style.padding="10px",T.style.margin="5rem auto",T.style.display="block",T.style.fontWeight="bold",l.appendChild(T),document.body.appendChild(l),v();const E="function"==typeof ResizeObserver?new ResizeObserver((()=>v())):null;E&&(E.observe(f),y&&E.observe(y.wrapper)),window.addEventListener("resize",v),document.fonts?.ready?.then(v).catch((()=>{})),simulateActive&&(publishPhaseEntered$1(SIM_PHASE.INSTRUCTIONS),publishResponseAffordance({validCharsTyped:" "})),T.focus({preventScroll:!0});let x=!1;const A=e=>{e.preventDefault(),x||(x||(x=!0,T.removeEventListener("click",A),window.removeEventListener("resize",v),E?.disconnect(),document.body.style.overflow=s,l.parentNode&&l.parentNode.removeChild(l),r()),requestNativeFullscreen().then((e=>{e&&clearFullscreenWasLost()})))};T.addEventListener("click",A)}))}const getStimulus=(e,t,r)=>{const n=t.read("targetKind",e);if(!_isAllNecessaryStateProvided(r,n))throw new Error("Failed to get stimulus, missing input parameters");switch("proposedLevel"in r&&void 0!==r.proposedLevel&&(r.proposedLevel=Math.min(r.proposedLevel,Math.log10(t.read("thresholdParameterMax",e)))),viewingDistanceCm.current=rc.viewingDistanceCm?rc.viewingDistanceCm.value:Math.min(viewingDistanceCm.desired,viewingDistanceCm.max),Screens[0].viewingDistanceCm=viewingDistanceCm.current,updateNearestPointFromRc(0,rc),n){case"letter":return getLettersStimulus(e,t,r);case"repeatedLetters":return getRepeatedLettersStimulus(e,t,r);case"rsvpReading":return getRsvpReadingStimulus(e,t,r);case"vernier":return getVernierStimulus(e,t,r);default:throw new Error(`targetKind == ${n} not yet supported by getStimulus`)}},getLettersStimulus=(e,t,r)=>{let n,i,a;if(1===Number(t.read("EasyEyesLettersVersion",e))){const a=r.proposedLevel,o=r.characterSetBoundingRect;({level:n,stimulusParameters:i}=getLettersStimulusV1(e,t,a,o))}else({level:n,stimulusParameters:i,characterSetBoundingRect:a}=getLettersStimulusV2(e,t,r.characterSetBoundingRect,r.stage,r.characters,r.proposedLevel));let o={};const s=r.frameN,l=_getLetterTextStims(t,e,i,r.characters,r.textStims);return Object.entries(l).forEach((([e,t])=>{"target"===e&&(o.preRenderStartSec=performance.now()/1e3),t.setOpacity(0),t.setAutoDraw(!0),t.status=PsychoJS$1.Status.NOT_STARTED})),{level:n,stimulusParameters:i,stims:l,characterSetBoundingRect:a,letterTiming:o,preRenderFrameN:s}},_getLetterTextStims=(e,t,r,n,i)=>{const a={};switch(e.read("thresholdParameter",t)){case"targetSizeDeg":a.target=getTargetStim(r,e,t,n.target,i.target);break;case"spacingDeg":switch(e.read("spacingRelationToSize",t)){case"none":case"ratio":a.target=getTargetStim(r,e,t,n.target,i.target),a.flanker1=getTargetStim(r,e,t,n.flanker1,i.flanker1,1),a.flanker2=getTargetStim(r,e,t,n.flanker2,i.flanker2,2),i.hasOwnProperty("flanker3")&&(a.flanker3=getTargetStim(r,e,t,n.flanker3,i.flanker3,3)),i.hasOwnProperty("flanker4")&&(a.flanker4=getTargetStim(r,e,t,n.flanker4,i.flanker4,4));break;case"typographic":const o=n.flanker1+n.target+n.flanker2;a.target=getTargetStim(r,e,t,o,i.target)}}return a},getLettersStimulusV1=(e,t,r,n)=>{const[i,a]=restrictLevel(r,t.read("thresholdParameter",e),n,t.read("spacingDirection",e),t.read("spacingRelationToSize",e),t.read("spacingSymmetry",e),t.read("spacingOverSizeRatio",e),t.read("targetSizeIsHeightBool",e),t.read("spacingIsOuterBool",e));return{level:i,stimulusParameters:a}},getLettersStimulusV2=(e,t,r,n,i,a)=>{if(!("afterFixation"!==n||i?.target&&a))throw new Error(`targetCharacter (${i?.target}) and proposedLevel (${a}) must be provided for afterFixation letter stimulus generation.`);let o,s,l;if("beforeFixation"===n){let n;[n,s,l]=restrictLevelBeforeFixation(readTargetTask(e),t.read("targetKind",e),t.read("thresholdParameter",e),t.read("spacingRelationToSize",e),t.read("spacingSymmetry",e),t.read("spacingOverSizeRatio",e),isFontLTR(readFontDirection(t,e)),r,String(t.read("fontCharacterSet",e)).split(""),t.read("spacingDirection",e),t.read("targetSizeIsHeightBool",e),i)}else{if("afterFixation"!==n)throw new Error(`Invalid stage ${n}`);if([o,s]=restrictLevelAfterFixation(a,t.read("thresholdParameter",e),r,t.read("spacingDirection",e),t.read("spacingRelationToSize",e),t.read("spacingSymmetry",e),t.read("spacingOverSizeRatio",e),t.read("targetSizeIsHeightBool",e),t.read("spacingIsOuterBool",e),t.read("showBoundingBoxBool",e),isFontLTR(readFontDirection(t,e)),readTargetTask(e),t.read("targetKind",e),i?.target,t.read("fontSizeReferencePx",e)),l=r,"target is offscreen"===o){const{targetLocationPx:e,targetEccentricityDeg:t,screenRectPx:r,screenRectDeg:n,fixationXYPX:i,viewingDistanceCm:a,screenWidthCm:o,screenHeightCm:l}=s;throw new Error(`Target is off screen. Target location ${e} px, eccentricity ${t} deg. Screen rect ${r} px = ${n} deg. Fixation ${i} px. Screen size ${o}x${l} cm. Viewing distance ${a} cm.`)}}return{level:Number(o),stimulusParameters:s,characterSetBoundingRect:l}},getRepeatedLettersStimulus=(e,t,r)=>{const[n,i]=restrictRepeatedLettersSpacing(r.proposedLevel,[t.read("targetEccentricityXDeg",e),t.read("targetEccentricityYDeg",e)],r.characterSetBoundingRect);return{stims:generateRepeatedLettersStims(i),level:n,stimulusParameters:i}},getRsvpReadingStimulus=(e,t,r)=>{const{displaySets:n,identificationSets:i}=generateRSVPReadingTargetSets(r.thisTrialWords,r.durationSec,t,e);return{targetSets:n,identificationSets:i}},getVernierStimulus=(e,t,r)=>{const n=r.vernier;return n.update(t,e,Math.pow(10,r.proposedLevel)),{vernier:n}},_isAllNecessaryStateProvided=(e,t)=>{switch(t){case"letter":if(!e.hasOwnProperty("proposedLevel")||!e.hasOwnProperty("characterSetBoundingRect"))return warning(`Missing information needed to generate letter stimuli, expected 'proposedLevel' and 'characterSetBoundingRect'. ${e.toString()}`),!1;break;case"repeatedLetters":if(!e.hasOwnProperty("proposedLevel")||!e.hasOwnProperty("characterSetBoundingRect"))return warning(`Missing information needed to generate repeated letter stimuli, expected 'proposedLevel' and 'characterSetBoundingRect'. ${e.toString()}`),!1;break;case"rsvpReading":if(!e.hasOwnProperty("thisTrialWords")||!e.hasOwnProperty("durationSec"))return warning(`Missing information needed to generate rsvpReading stimuli, expected 'thisTrialWords' and 'durationSec'. ${e.toString()}`),!1;break;case"vernier":if(!e.hasOwnProperty("proposedLevel")||!e.hasOwnProperty("vernier"))return warning(`Missing information needed to generate vernier stimuli, expected 'proposedLevel' and 'vernier'. ${e.toString()}`),!1;break;default:warning(`targetKind '${t}' not supported by stimulusGeneration::_isAllNecessaryStateProvided.`)}return!0},onStimulusGeneratedLetter=(e,t,r,n,i,a,o,s,l)=>{defineTargetForCursorTracking(e.stims.target);const c={};c.flankerXYDegs=e.stimulusParameters.flankerXYDegs;const u=Object.values(e.stims);if(s.push(...u),t.read("showBoundingBoxBool",r)&&s.push(...u.map(getBoundingBoxVisualRect)),"target is offscreen"===e.level)throw new Error(`Target is off screen. Target location ${e.stimulusParameters.targetLocationPx} px, eccentricity ${e.stimulusParameters.targetEccentricityDeg} deg. Screen rect ${e.stimulusParameters.screenRectPx} px = ${e.stimulusParameters.screenRectDeg} deg. Fixation ${e.stimulusParameters.fixationXYPX} px. Screen size ${e.stimulusParameters.screenWidthCm}x${e.stimulusParameters.screenHeightCm} cm. Viewing distance ${e.stimulusParameters.viewingDistanceCm} cm.`);const d=t.read("EasyEyesLettersVersion",r);if("beforeFixation"!==l||2!==d){t.read("_logFontBool")[0]&&logLetterParamsToFormspree(getFormspreeLoggingInfoLetter(r,t,o,i,a,e.stimulusParameters)),n.experiment?.addData("level",e.level);const s=i.window?._size??[window.innerWidth,window.innerHeight],l=e=>Array.isArray(e)?rcScreenXYPxToPsychoJSXYPx(e,s).join(", "):e;n.experiment?.addData("nearestXYPx_left",l(rc.improvedDistanceTrackingData?.left?.nearestXYPx)),n.experiment?.addData("nearestDistanceCm_left",rc.improvedDistanceTrackingData?.left?.nearestDistanceCm),n.experiment?.addData("distanceCm_left",rc.improvedDistanceTrackingData?.left?.distanceCm),n.experiment?.addData("nearestXYPx_right",l(rc.improvedDistanceTrackingData?.right?.nearestXYPx)),n.experiment?.addData("nearestDistanceCm_right",rc.improvedDistanceTrackingData?.right?.nearestDistanceCm),n.experiment?.addData("distanceCm_right",rc.improvedDistanceTrackingData?.right?.distanceCm),n.experiment?.addData("nearestXYPx",l(rc.improvedDistanceTrackingData?.nearestXYPx)),n.experiment?.addData("nearestDistanceCm",rc.improvedDistanceTrackingData?.nearestDistanceCm),n.experiment?.addData("distanceCm",rc.improvedDistanceTrackingData?.distanceCm),n.experiment?.addData("nearEye",rc.improvedDistanceTrackingData?.nearEye),n.experiment?.addData("oldDistanceCm",rc.improvedDistanceTrackingData?.oldDistanceCm),2===d&&(n.experiment?.addData("minTargetSizeDeg",e.stimulusParameters.minDeg),n.experiment?.addData("maxTargetSizeDeg",e.stimulusParameters.maxDeg)),updateTargetSpecs(e.stimulusParameters,"letter"),t.read("_trackGazeExternallyBool")[0]&&recordStimulusPositionsForEyetracking(e.stims.target,"trialInstructionRoutineBegin"),n.experiment?.addData("fontSizePx",e.stimulusParameters.heightPx),n.experiment?.addData("actualSpacingDeg",e.stimulusParameters.spacingDeg);const c="typographic"===t.read("spacingRelationToSize",r)?o.target:`${o.flanker1}, ${o.target}, ${o.flanker2}`;if(n.experiment?.addData("crowdingTriplets",c),"spacingDeg"===t.read("thresholdParameter",r)&&["none","ratio"].includes(t.read("spacingRelationToSize",r))){n.experiment?.addData("flankerLocationsPx",e.stimulusParameters.targetAndFlankersXYPx.slice(1));const i=t.read("spacingIsOuterBool",r)?norm([e.stimulusParameters.targetAndFlankersXYPx[0][0]-e.stimulusParameters.targetAndFlankersXYPx[1][0],e.stimulusParameters.targetAndFlankersXYPx[0][1]-e.stimulusParameters.targetAndFlankersXYPx[1][1]]):norm([e.stimulusParameters.targetAndFlankersXYPx[0][0]-e.stimulusParameters.targetAndFlankersXYPx[2][0],e.stimulusParameters.targetAndFlankersXYPx[0][1]-e.stimulusParameters.targetAndFlankersXYPx[2][1]]);n.experiment?.addData("targetSpacingPx",i)}n.experiment?.addData("targetBoundingBox",prettyPrintPsychojsBoundingBox(e.stims.target.getBoundingBox(!0))),Object.keys(e.stims).filter((e=>"target"!==e)).forEach((t=>{const r=e.stims[t];n.experiment?.addData(`${t}BoundingBox`,prettyPrintPsychojsBoundingBox(r.getBoundingBox(!0)))}));const u=targetsOverlap([e.stims.target,...Object.values(e.stims).filter((t=>t!==e.stims.target))]);n.experiment?.addData("targetsOverlappedBool",u?"TRUE":"FALSE");const h=e.stims.target.getHeight(),p=pxToPt(h);n.experiment?.addData("fontNominalSizePx",h),n.experiment?.addData("fontNominalSizePt",p)}return{letterConfig:c,preRenderFrameN:e.preRenderFrameN,letterTiming:e.letterTiming}},onStimulusGeneratedRepeatedLetters=(e,t,r,n,i)=>{defineTargetForCursorTracking(e.stims),updateTargetSpecs(e.stimulusParameters,"repeatedLetters")},onStimulusGeneratedRsvpReading=(e,t,r,n,i,a,o,s)=>{if(!e.targetSets||!Array.isArray(e.targetSets)||0===e.targetSets.length)return void warning("Invalid target sets for RSVP reading");clearPhraseIdentificationRegisters(),isRsvpReadingAutomaticSpeechResponseMode(o)&&resetRsvpSpeechResponseRegistration();const l={upcoming:e.targetSets,past:[],identificationTargetSets:e.identificationSets,current:void 0,skippedDueToBadTracking:0},c={current:l.identificationTargetSets.map((e=>e.word.toLowerCase()))};a.experiment?.addData("rsvpReadingTargetNumberOfSets",l.upcoming.length),a.experiment?.addData("rsvpReadingTargetSets",e.targetSets.toString());const u={categories:l.upcoming.map((e=>new Category(e.word,e.foilWords))),identificationCategories:l.identificationTargetSets.map((e=>new Category(e.word,e.foilWords)))};return a.experiment?.addData("rsvpReadingResponseCategories",u.identificationCategories.toString()),"silent"===o&&(u.screen=setupPhraseIdentification(u.identificationCategories,n,i,l.upcoming[0]._heightPx),a.experiment?.addData("rsvpReadingResponseScreenHTML",u.screen.innerHTML)),l.current=l.upcoming.shift(),updateTargetSpecs({targetWordDurationSec:s,rsvpReadingNumberOfWords:n.read("rsvpReadingNumberOfWords",i),rsvpReadingResponseModality:o},"rsvpReading",n,i),{rsvpReadingTargetSets:l,correctAns:c,rsvpReadingResponse:u}},onStimulusGeneratedVernier=(e,t,r,n,i,a)=>{defineTargetForCursorTracking(e),t.read("_trackGazeExternallyBool")[0]&&recordStimulusPositionsForEyetracking(e,"trialInstructionRoutineBegin");const o=[n,i],s={current:o[e.directionBool?0:1]},l=Math.log10(e.targetOffsetDeg);return a.experiment?.addData("level",l),t.read("showTargetSpecsBool",r)&&updateTargetSpecs({targetOffsetDeg:e.targetOffsetDeg,targetDurationSec:t.read("targetDurationSec",r)}),{validAns:o,correctAns:s,level:l}},onStimulusGenerationFailed=(e,t)=>{if(warning(`Failed to get viable stimulus (onStimulusGenerated failed), skipping trial. Error: ${t.error}`),skipTrial(),"letter"===e){const{error:e,level:r,debug:n,screen:i,block_condition:a,reader:o,characters:s,viewingDistanceCm:l}=t;warning(`Failed to get viable stimulus (restrictLevelAfterFixation failed), skipping trial. level: ${r}. Error: ${e}`),n||logLetterParamsToFormspree(getFormspreeLoggingInfoLetter(a,o,s,i,l)),i.fixationConfig.fixationPosAfterDelay=void 0}},DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,GLOBAL_OBJ=globalThis,SDK_VERSION="10.32.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||SDK_VERSION,t[SDK_VERSION]=t[SDK_VERSION]||{}}function getGlobalSingleton(e,t,r=GLOBAL_OBJ){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[SDK_VERSION]=n[SDK_VERSION]||{};return i[e]||(i[e]=t())}const PREFIX="Sentry Logger ",originalConsoleMethods={};function consoleSandbox(e){if(!("console"in GLOBAL_OBJ))return e();const t=GLOBAL_OBJ.console,r={},n=Object.keys(originalConsoleMethods);n.forEach((e=>{const n=originalConsoleMethods[e];r[e]=t[e],t[e]=n}));try{return e()}finally{n.forEach((e=>{t[e]=r[e]}))}}function enable(){_getLoggerSettings().enabled=!0}function disable(){_getLoggerSettings().enabled=!1}function isEnabled(){return _getLoggerSettings().enabled}function log(...e){_maybeLog("log",...e)}function warn(...e){_maybeLog("warn",...e)}function error(...e){_maybeLog("error",...e)}function _maybeLog(e,...t){DEBUG_BUILD&&isEnabled()&&consoleSandbox((()=>{GLOBAL_OBJ.console[e](`${PREFIX}[${e}]:`,...t)}))}function _getLoggerSettings(){return DEBUG_BUILD?getGlobalSingleton("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const debug={enable:enable,disable:disable,isEnabled:isEnabled,log:log,warn:warn,error:error},objectToString=Object.prototype.toString;function isBuiltin(e,t){return objectToString.call(e)===`[object ${t}]`}function isPlainObject(e){return isBuiltin(e,"Object")}function isThenable(e){return Boolean(e?.then&&"function"==typeof e.then)}function addNonEnumerableProperty(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{DEBUG_BUILD&&debug.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function truncate(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function getCrypto(){const e=GLOBAL_OBJ;return e.crypto||e.msCrypto}let emptyUuid;function getRandomByte(){return 16*Math.random()}function uuid4(e=getCrypto()){try{if(e?.randomUUID)return e.randomUUID().replace(/-/g,"")}catch{}return emptyUuid||(emptyUuid=[1e7]+1e3+4e3+8e3+1e11),emptyUuid.replace(/[018]/g,(e=>(e^(15&getRandomByte())>>e/4).toString(16)))}const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){const{performance:e}=GLOBAL_OBJ;if(!e?.now||!e.timeOrigin)return dateTimestampInSeconds;const t=e.timeOrigin;return()=>(t+e.now())/ONE_SECOND_IN_MS}let _cachedTimestampInSeconds;function timestampInSeconds(){return(_cachedTimestampInSeconds??(_cachedTimestampInSeconds=createUnixTimestampInSecondsFunc()))()}function updateSession(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||timestampInSeconds(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:uuid4()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function merge(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&0===Object.keys(t).length)return e;const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=merge(n[i],t[i],r-1));return n}function generateTraceId(){return uuid4()}const SCOPE_SPAN_FIELD="_sentrySpan";function _setSpanForScope(e,t){t?addNonEnumerableProperty(e,SCOPE_SPAN_FIELD,t):delete e[SCOPE_SPAN_FIELD]}function _getSpanForScope(e){return e[SCOPE_SPAN_FIELD]}const DEFAULT_MAX_BREADCRUMBS=100;class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId(),sampleRand:Math.random()}}clone(){const e=new Scope;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,_setSpanForScope(e,_getSpanForScope(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,r=t instanceof Scope?t.getScopeData():isPlainObject(t)?e:void 0,{tags:n,attributes:i,extra:a,user:o,contexts:s,level:l,fingerprint:c=[],propagationContext:u}=r||{};return this._tags={...this._tags,...n},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),l&&(this._level=l),c.length&&(this._fingerprint=c),u&&(this._propagationContext=u),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,_setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:DEFAULT_MAX_BREADCRUMBS;if(r<=0)return this;const n={timestamp:dateTimestampInSeconds(),...e,message:e.message?truncate(e.message,2048):e.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=merge(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t?.event_id||uuid4();if(!this._client)return DEBUG_BUILD&&debug.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r?.event_id||uuid4();if(!this._client)return DEBUG_BUILD&&debug.warn("No client configured on scope - will not capture message!"),n;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=t?.event_id||uuid4();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(DEBUG_BUILD&&debug.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function getDefaultCurrentScope(){return getGlobalSingleton("defaultCurrentScope",(()=>new Scope))}function getDefaultIsolationScope(){return getGlobalSingleton("defaultIsolationScope",(()=>new Scope))}class AsyncContextStack{constructor(e,t){let r,n;r=e||new Scope,n=t||new Scope,this._stack=[{scope:r}],this._isolationScope=n}withScope(t){const r=this._pushScope();let n;try{n=t(r)}catch(e){throw this._popScope(),e}return isThenable(n)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function getAsyncContextStack(){const e=getSentryCarrier(getMainCarrier());return e.stack=e.stack||new AsyncContextStack(getDefaultCurrentScope(),getDefaultIsolationScope())}function withScope(e){return getAsyncContextStack().withScope(e)}function withSetScope(e,t){const r=getAsyncContextStack();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function withIsolationScope(e){return getAsyncContextStack().withScope((()=>e(getAsyncContextStack().getIsolationScope())))}function getStackAsyncContextStrategy(){return{withIsolationScope:withIsolationScope,withScope:withScope,withSetScope:withSetScope,withSetIsolationScope:(e,t)=>withIsolationScope(t),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}function getAsyncContextStrategy(e){const t=getSentryCarrier(e);return t.acs?t.acs:getStackAsyncContextStrategy()}function getCurrentScope(){return getAsyncContextStrategy(getMainCarrier()).getCurrentScope()}function parseEventHintOrCaptureContext(e){if(e)return hintIsScopeOrFunction(e)||hintIsScopeContext(e)?{captureContext:e}:e}function hintIsScopeOrFunction(e){return e instanceof Scope||"function"==typeof e}const captureContextKeys=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function hintIsScopeContext(e){return Object.keys(e).some((e=>captureContextKeys.includes(e)))}function captureException(e,t){return getCurrentScope().captureException(e,parseEventHintOrCaptureContext(t))}const SENSITIVE_KEY=/token|authorization|password|secret|spreadsheet|workbook|content|participant/i,sanitize=(e,t=0)=>t>4?"[Truncated]":null==e?e:"string"==typeof e?e.replace(/(access_token|oauthToken|authorization)=([^&\s]+)/gi,"$1=[Filtered]").replace(/Bearer\s+[A-Za-z0-9._~-]+/gi,"Bearer [Filtered]"):["number","boolean"].includes(typeof e)?e:Array.isArray(e)?e.slice(0,50).map((e=>sanitize(e,t+1))):"object"!=typeof e?String(e):Object.fromEntries(Object.entries(e).map((([e,r])=>[e,SENSITIVE_KEY.test(e)?"[Filtered]":sanitize(r,t+1)])));function captureError(e,t="",r={}){console.error(t,e),captureException(e,{tags:{context:t},extra:sanitize(r)})}const saveSnapshot=async(e,t,r)=>{try{const n=await fetch(await getBoxApiUrl(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:e,experimentID:t,participantID:r})});if(!n.ok){const e=`Box upload failed: ${(await n.json().catch((()=>({error:n.statusText})))).error} (Status: ${n.status})`;return captureError(new Error(e),"Snapshot upload error"),null}return await n.json()}catch(err){return captureError(err,"Snapshot upload error"),null}},getBoxApiUrl=async()=>await getEasyEyesBaseUrl()+"/.netlify/functions/box-api",capturedVideoFrameListener=()=>{document.addEventListener("rc-video-frame-captured",(async e=>{const{image:t}=e.detail;if(t)try{const e=await saveSnapshot(t,experimentId(),participantId());addSnapshotsLinkToExperimentResult(e.snapshotsLink)}catch(error){captureError$1(error,"capturedVideoFrameListener",{experimentId:experimentId(),participantId:participantId(),hasImage:!!t})}}))},addSnapshotsLinkToExperimentResult=e=>{if(e&&psychoJS?.experiment){psychoJS.experiment._currentTrialData.hasOwnProperty("snapshotsLink")||psychoJS.experiment.addData("snapshotsLink",e)}},experimentId=()=>{let e;const t=window.location.pathname.split("/").filter((e=>e));if("localhost"===window.location.hostname){const r=t.indexOf("index.html");e=r>0?t[r-1]:t[t.length-1]}else e=t[t.length-1];return e},participantId=()=>thisExperimentInfo.PavloviaSessionID,loadCSS=e=>new Promise(((t,r)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=e,n.onload=t,n.onerror=r,document.head.appendChild(n)})),cssPromises=[];cssPromises.push(loadCSS("js/threshold.css")),cssPromises.push(loadCSS("https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css")),await Promise.all(cssPromises);const{PsychoJS:PsychoJS}=core,{TrialHandler:TrialHandler,MultiStairHandler:MultiStairHandler}=data$1,{Scheduler:Scheduler}=util;initGlossary(glossaryData);const strHash=e=>{let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)>>>0;return t},chaosSeed=window.__SIM_OPTIONS__&&window.__SIM_OPTIONS__.chaos||new URLSearchParams(window.location.search).get("chaos")||null,chaosState=chaosSeed?{targetDistinct:strHash(String(chaosSeed))%22+2,seen:new Set,fired:!1}:null,setCurrentFn=e=>{if(status.currentFunction=e,logNotice(`In ${e}.`),simulateActive&&setEEState({currentFunction:e}),chaosState&&!chaosState.fired&&!chaosState.seen.has(e)&&(chaosState.seen.add(e),chaosState.seen.size>=chaosState.targetDistinct))throw chaosState.fired=!0,new Error(`CHAOS injected at ${e}`)};var videoblob=[],actualStimulusLevel;const video=document.createElement("video");video.style.position="absolute",video.style.zIndex=2e4,document.createElement("source");const loader=document.createElement("loader"),loaderText=document.createElement("p");let video_flag=1;window.jsQUEST=jsQUEST$1;const fontsRequired={},parseWindowURL=()=>{const e=new URLSearchParams(window.location.search);return{participant:e.get("participant"),session:e.get("session"),study_id:e.get("study_id"),completedDaisyChainBefore:e.get("completedDaisyChainBefore")}},daisyChainURLBefore=e=>{if(!e)return;const{participant:t,session:r,study_id:n,completedDaisyChainBefore:i}=parseWindowURL();if(i)return;const a=`${e}?external_id=${t}&participant=${t}&session=${r}&study_id=${n}&completedDaisyChainBefore=true`;window.location=a},paramReaderInitialized=async e=>{const t=e.read("_daisyChainURLBefore")[0];daisyChainURLBefore(t);const r=e.read("simulateParticipantBool","__ALL_BLOCKS__").some(Boolean);if(r){startSimulatedParticipant();const t=e.read("targetKind","__ALL_BLOCKS__").filter(Boolean);publishBootEvent({experimentName:thisExperimentInfo?.name??"",blockCount:e._blockCount??0,conditionCount:e._experiment?.length??0,targetKinds:[...new Set(t)].join(","),language:e.read("_language")[0]??"",seed:window.__SIM_SEED__??""})}if(r||rc&&rc.checkInitialized()&&rc.language&&rc.language.value||window.location.reload(),handleLanguage(e.read("_language")[0],rc,!0),saveProlificInfo(thisExperimentInfo),setCurrentFn("paramReaderInitialized"),void 0!==psychoJS._window)return;if(useMatlab.current=e.read("_trackGazeExternallyBool")[0],simulateActive&&setEEState({usingGaze:useMatlab.current}),debugBool.current=e.read("_debugBool")[0],void 0===thisExperimentInfo.experiment&&(thisExperimentInfo.experiment=getPavloviaProjectName()),buildWindowErrorHandling(e),e.read("_participantIDGetBool")[0]){const t=(e,t=null,r)=>{e&&(thisExperimentInfo.participant=e,void 0!==r&&e===r?thisExperimentInfo.setSession(t&&isNaN(Number(t))?t:Number(t)+1):thisExperimentInfo.setSession(1),thisExperimentInfo.EasyEyesID=e,thisExperimentInfo.PavloviaSessionID=e)};if(!(await checkCrossSessionId(t,rc.language.value,e)))return void showExperimentEnding$1()}else thisExperimentInfo.participant=rc.id.value,thisExperimentInfo.setSession(1),thisExperimentInfo.EasyEyesID=rc.id.value,thisExperimentInfo.PavloviaSessionID=rc.id.value;const n=window.location.href.split("/");if(e.read("_logParticipantsBool")[0]){const e={logParameter:"_logParticipantsBool",ExperimentName:n[n.length-2],deviceType:rc.deviceType.value,OS:"Mac"===rc.systemFamily.value?"macOS":rc.systemFamily.value,browser:rc.browser.value,browserVersion:rc.browserVersion.value,prolificSession:thisExperimentInfo.ProlificSessionID,prolificParticipantID:thisExperimentInfo.ProlificParticipantID,pavloviaID:thisExperimentInfo.PavloviaSessionID,date:MonotonicClock.getDateStr(),UTC:MonotonicClock.getTimeZone()};await sendEmailForDebugging(e)}await loadFonts(e,fontsRequired),await loadRecruitmentServiceConfig(),await loadReadingCorpus(e),ifTrue$2(e.read("showFPSBool","__ALL_BLOCKS__"))&&(stats.current=new Stats,stats.current.showPanel(0),document.body.appendChild(stats.current.dom),stats.current.dom.style.display="none",stats.on=!1);await (async()=>{initFullscreenPauseOverlay(),experiment(e.blockCount)})(),document.getElementById("root").classList.add("initialized")},paramReader=new ParamReader("conditions",(e=>{paramReaderInitialized(e)}));var conditionName,targetSpecs,trialCounter,showImage,targetImage,characterSetBoundingRects={};const experiment=t=>{setCurrentFn("experiment");const r=new Set(paramReader.conditions.map((e=>Number(e.block))));var n;window.experimentProgressInfo=Array(r.size);var i,a,o,s,l,c,u,d,h,p,f,m,g,_,y,b,v,S,w=!0;preparePopup(rc.language.value,thisExperimentInfo.name),prepareTrialBreakProgressBar(),initializeEscHandlingDiv();const T=[];blockOrder.current=getBlockOrder(paramReader);for(const e of blockOrder.current)T.push({name:`conditions/block_${e}.csv`,path:`conditions/block_${e}.csv`});thisExperimentInfo.experimentFilename=paramReader.read("!experimentFilename")[0];for(let e in fontsRequired){logger$1(e,fontsRequired[e]);let t=fontsRequired[e].split("."),r=t[0].split("/");r.push(t[1]);let n=r[1]+"."+r[2];T.push({name:n,path:fontsRequired[e]})}const E=getCorrectSynth(psychoJS);getPurrSynth(psychoJS);const x=getReadingSound();registerSoundOutputTarget(E.getNativeContext()),registerSoundOutputTarget(x),registerSoundOutputTarget(audioCtx),screenBackground.colorRGBA=colorRGBASnippetToRGBA(paramReader.read("screenColorRGBA","__ALL_BLOCKS__")[0]),configureScreenColorPipeline(paramReader);const A=paramReader.read("screenColorRGBA","__ALL_BLOCKS__")[0]||screenBackground.defaultColorRGBA;psychoJS.openWindow({fullscr:!debug$1,color:new Color$1(colorRGBSnippetToRGB(A)),units:"height",waitBlanking:!0}),logScreenColorPipelineReport(psychoJS),installColorPipelineProbe(psychoJS,{force:colorPipelineTestRequested(paramReader)}),(new URLSearchParams(window.location.search).has("textStimContract")||new URLSearchParams(window.location.search).has("textstimcontract"))&&(window.__textStimContract=async e=>{const t=[];for(const r of e){if(r.fontUrl){const e=new FontFace(r.font,await (await fetch(r.fontUrl)).arrayBuffer());await e.load(),document.fonts.add(e)}const e=new TextStim({win:psychoJS.window,name:"contract",text:r.text,font:r.font,height:r.height??40,units:"pix",letterSpacing:r.letterSpacing??0,language:r.language??"en",direction:r.direction??"ltr",wrapWidth:1/0,autoLog:!1});e._updateIfNeeded();const n=e.getBoundingBox(!0).width,i=e.measureText(r.text).width;t.push({...r,authoritative:n,cheap:i,diff:Math.abs(n-i)})}return t}),initMouse();const C=new Scheduler(psychoJS);var R;psychoJS.schedule(C),C.add((async function(){registerUnloadExitStamp(),runDiagnosisReport(),await initializeAndRegisterSubmodules(),"function"==typeof rc.setOnQuit&&rc.setOnQuit((e=>{const t=e?.trigger;"cameraReconnectPopup"===t||"chooseScreenQuit"===t?(showExperimentEnding$1(),quitPsychoJS("",!1,paramReader,!0,!1,rcUnmetNeedsFromReason(e,rcMinutesSinceStart(clock.global,performance.now()))),recruitmentServiceData?.incompatibleCode&&window.open("https://app.prolific.com/submissions/complete?cc="+recruitmentServiceData?.incompatibleCode)):showFullscreenPauseOverlay()}));"function"==typeof rc.onCameraDisconnected&&rc.onCameraDisconnected(((e,t)=>warning(`rcCameraDisconnected:${t?.status??"unknown"}:${t?.trackReadyState??"unknown"} ${e??""}`.trim())));"function"==typeof rc.onCameraReconnected&&rc.onCameraReconnected((()=>warning("rcCameraReconnected")));setCurrentFn("titlePage"),await showTitlePage(paramReader,rc),needPhoneSurvey.current=paramReader.read("_needSmartphoneSurveyBool")[0],needComputerSurveyBool.current=paramReader.read("_needComputerSurveyBool")[0],await async function(t){if(setCurrentFn("updateInfo"),thisExperimentInfo.date=MonotonicClock.getDateStr()+" "+MonotonicClock.getTimeZone(),thisExperimentInfo.psychopyVersion=`${psychoJSPackage.version}-threshold-prod`,thisExperimentInfo.hardwareConcurrency=rc.concurrency.value,thisExperimentInfo.deviceType=rc.deviceType.value,thisExperimentInfo.deviceSystem=rc.system.value,thisExperimentInfo.deviceSystemFamily=rc.systemFamily.value,thisExperimentInfo.deviceBrowser=rc.browser.value,thisExperimentInfo.deviceBrowserVersion=rc.browserVersion.value,thisExperimentInfo.deviceLanguage=rc.userLanguage.value,loudspeakerBrowserDetails.current.browser=rc.browser.value,loudspeakerBrowserDetails.current.browserVersion=rc.browserVersion.value,rc.browserVersion.value&&rc.browserVersion.value.includes(".")){const e=rc.browserVersion.value.split(".");if(e.length>1){const t=e[0];parseInt(t)>=100?loudspeakerBrowserDetails.current.browserVersion=e[0]:loudspeakerBrowserDetails.current.browserVersion=e[0]+"."+e[1]}}thisExperimentInfo.psychojsWindowDimensions=`[${psychoJS._window._size.toString()}]`,thisExperimentInfo.monitorFrameRate=psychoJS.window.getActualFrameRate(),psychoJS.experiment.addData("frameRateReportedByPsychoJS",thisExperimentInfo.monitorFrameRate),rc.stressFps?psychoJS.experiment.addData("frameRateUnderStress",rc.stressFps.value):rc.performanceCompute&&await rc.performanceCompute((e=>{psychoJS.experiment.addData("computeRandomMHz",e.value.computeRandomMHz)}));thisExperimentInfo.experiment=getPavloviaProjectName();{const e=psychoJS.experiment.nextEntry.bind(psychoJS.experiment);psychoJS.experiment.nextEntry=(...t)=>("currentFunction"in psychoJS.experiment._currentTrialData||psychoJS.experiment.addData("currentFunction",status.currentFunction??""),e(...t))}psychoJS.experiment.addData("URL",window.location.href||""),psychoJS.experiment.addData("expName",thisExperimentInfo.name),psychoJS.experiment.addData("psychopyVersion",thisExperimentInfo.version),psychoJS.experiment.addData("hardwareConcurrency",thisExperimentInfo.hardwareConcurrency);try{const e=navigator.deviceMemory;psychoJS.experiment.addData("deviceMemoryGB",e)}catch(e){console.log("Error adding deviceMemoryGB to psychoJS.experiment",e)}psychoJS.experiment.addData("deviceType",thisExperimentInfo.deviceType),psychoJS.experiment.addData("deviceSystem",thisExperimentInfo.deviceSystem),psychoJS.experiment.addData("deviceSystemFamily",thisExperimentInfo.deviceSystemFamily),psychoJS.experiment.addData("deviceBrowser",thisExperimentInfo.deviceBrowser),psychoJS.experiment.addData("deviceBrowserVersion",thisExperimentInfo.deviceBrowserVersion),psychoJS.experiment.addData("deviceLanguage",thisExperimentInfo.deviceLanguage),psychoJS.experiment.addData("psychojsWindowDimensions",thisExperimentInfo.psychojsWindowDimensions),psychoJS.experiment.addData("participant",thisExperimentInfo.participant),psychoJS.experiment.addData("session",thisExperimentInfo.session),psychoJS.experiment.addData("EasyEyesID",thisExperimentInfo.EasyEyesID),psychoJS.experiment.addData("PavloviaSessionID",thisExperimentInfo.PavloviaSessionID),psychoJS.experiment.addData("ProlificParticipantID",thisExperimentInfo.ProlificParticipantID),psychoJS.experiment.addData("ProlificSessionID",thisExperimentInfo.ProlificSessionID),psychoJS.experiment.addData("ProlificStudyID",thisExperimentInfo.ProlificStudyID);try{psychoJS.experiment.addData("devicePixelRatio",window.devicePixelRatio)}catch(e){console.log("Error adding devicePixelRatio to psychoJS.experiment",e)}t&&psychoJS.experiment.nextEntry()}(needPhoneSurvey.current),setCurrentFn("compatibilityFlow"),simulateActive&&publishPhaseEntered$1(SIM_PHASE.COMPATIBILITY);const{proceedButtonClicked:t,proceedBool:r,mic:n,loudspeaker:i,gotLoudspeakerMatchBool:a}=await runDeviceCompatibilityFlow({paramReader:paramReader,rc:rc,psychoJS:psychoJS,measureMeters:measureMeters,keypad:keypad,KeypadHandler:KeypadHandler,_key_resp_event_handlers:_key_resp_event_handlers,_key_resp_allKeys:_key_resp_allKeys,ConnectionManager:ConnectionManager,ConnectionManagerDisplay:ConnectionManagerDisplay,getConnectionManagerDisplay:getConnectionManagerDisplay,handleLanguageChangeForConnectionManagerDisplay:handleLanguageChangeForConnectionManagerDisplay,keypadRequiredInExperiment:keypadRequiredInExperiment,needPhoneSurveyRef:needPhoneSurvey,needComputerSurveyBoolRef:needComputerSurveyBool,EasyEyesPeer:EasyEyesPeer,quitPsychoJS:quitPsychoJS});gotLoudspeakerMatch.current=a,microphoneInfo$1.current.micFullName=n.micFullName,microphoneInfo$1.current.micFullSerialNumber=n.micFullSerialNumber,microphoneInfo$1.current.micrFullManufacturerName=n.micrFullManufacturerName,microphoneInfo$1.current.phoneSurvey=n.phoneSurvey,needComputerSurveyBool.current?loudspeakerInfo$1.current.loudspeakerSurvey=i:loudspeakerInfo$1.current=i;needPhoneSurvey.current&&(psychoJS.experiment.addData("Microphone survey",JSON.stringify(microphoneInfo$1.current.phoneSurvey)),psychoJS.experiment.nextEntry());needComputerSurveyBool.current&&(psychoJS.experiment.addData("Loudspeaker survey",JSON.stringify(loudspeakerInfo$1.current.loudspeakerSurvey)),psychoJS.experiment.nextEntry());soundOutputSelectionsLocked()&&neededSoundOutputKinds(paramReader).length>0&&(psychoJS.experiment.addData("soundOutputLoudspeakers",formatSoundOutputSelection(getSoundOutputSelection("loudspeakers"))),psychoJS.experiment.addData("soundOutputHeadphones",formatSoundOutputSelection(getSoundOutputSelection("headphones"))),psychoJS.experiment.nextEntry());if(hideCompatibilityMessage(),t&&!r)return showExperimentEnding$1(),quitPsychoJS("",!1,paramReader,!0,!1,"compatibilityNotMet"),void(recruitmentServiceData?.incompatibleCode&&window.open("https://app.prolific.com/submissions/complete?cc="+recruitmentServiceData?.incompatibleCode));setCurrentFn("consentForm"),simulateActive&&publishPhaseEntered$1(SIM_PHASE.CONSENT);const o=await showForm(paramReader.read("_consentForm")[0],!0);if(hideForm(),!o)return status.consentGiven=!1,psychoJS.experiment.addData("consentGiven","FALSE"),hideForm(),void quitPsychoJS("","",paramReader,void 0,void 0,"consentDeclined");paramReader.read("_consentForm")[0]&&(status.consentGiven=!0,psychoJS.experiment.addData("consentGiven","TRUE"));paramReader.read("_saveSnapshotsBool")[0]&&capturedVideoFrameListener();const s=ifTrue$2(paramReader.read(getGlossary()._calibrateMicrophonesBool.name,"__ALL_BLOCKS__"));if(s&&r){const e=paramReader.read("_authors")[0],t=paramReader.read("_authorAffiliations")[0],r=paramReader.read("_authorEmails")[0],n=Math.floor(1e5+9e5*random$1("session")).toString(),i=getPavloviaProjectName()||"EasyEyes Experiment",a=readi18nPhrases("RC_VerificationEmailSubject",rc.language.value)||"EEE — Verify authorship for microphone calibration",o=readi18nPhrases("RC_VerificationEmail",rc.language.value)||"To calibrate microphones, please copy and paste the following code into the EEE web page:\n123456",s=readi18nPhrases("RC_VerificationEnterCode",rc.language.value)||"REQUIRED. To verify authorship please enter the 6-digit code sent by email to AAA.";console.log(`Demo: Email would be sent to ${r} with code: ${n}`),console.log(`Subject template: ${a}`),console.log(`Message template: ${o}`);try{const e=await fetch("https://easyeyes.app/.netlify/functions/email-verification/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({authorEmails:r,verificationCode:n,experimentName:i,emailSubjectTemplate:a,emailMessageTemplate:o,language:rc.language.value})});if(!e.ok)throw new Error(`Failed to send verification email: ${e.status}`);const t=await e.json();console.log("Email sent successfully:",t)}catch(error){return console.error("Email sending error:",error),await Swal.fire({title:"Email Error",text:"Failed to send verification email. Please check your internet connection and try again.",icon:"error",confirmButtonText:"Proceed"}),showExperimentEnding$1(),void quitPsychoJS("Email sending failed",!1,paramReader,!0,!1,"emailSendFailed")}let l=0;const c=4;let u=!1;for(;l<c&&!u;){l++;const i=await new Promise((e=>{Swal.fire({title:"Email Verification Required"+(l>1?` (Attempt ${l}/${c})`:""),html:`
|
|
321
321
|
<div style="text-align: center; margin-bottom: 20px;">
|
|
322
322
|
${l>1?'<p style="color: #e74c3c; font-size: 0.9em; margin-bottom: 10px;"><strong>Incorrect code entered.</strong> Please try again.</p>':""}
|
|
323
323
|
<p style="margin-bottom: 15px;">${s.replace("AAA",r.replace(/</g,"<").replace(/>/g,">"))}</p>
|