From 6856320b7c9ec10628fe3b775546e1e86042e586 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Mon, 1 Dec 2025 12:14:54 +0100 Subject: [PATCH 01/15] Extend EPUBNavigatorDelegate to support rendering custom native overlay - provide the ability add custom native overlay to EPUB resources - possible to render any type wrapped inside XHTML spine element (e.g. PDF) --- .../EPUB/EPUBNavigatorViewController.swift | 10 ++++++++++ Sources/Navigator/EPUB/EPUBSpreadView.swift | 8 ++++++++ Sources/Navigator/EPUB/Scripts/src/utils.js | 15 +++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 55ffe5b318..877500c0da 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -18,12 +18,17 @@ import WebKit // MARK: - WebView Customization func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) + + /// Called when spread is loaded (wrapper around type which cannot directly be EPUB spine elements, e.g. PDF ) + func navigator(_ navigator: EPUBNavigatorViewController, renderNativeOverlay spreadView: UIView, using params: Any) } public extension EPUBNavigatorDelegate { func navigator(_ navigator: EPUBNavigatorViewController, viewportDidChange viewport: EPUBNavigatorViewController.Viewport?) {} func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) {} + + func navigator(_ navigator: EPUBNavigatorViewController, renderNativeOverlay spreadView: UIView, using params: Any) {} } public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) @@ -1021,6 +1026,10 @@ extension EPUBNavigatorViewController: EPUBNavigatorViewModelDelegate { } extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { + func spreadView(_ spreadView: EPUBSpreadView, renderNativeOverlayWithParams params: Any) { + delegate?.navigator(self, renderNativeOverlay: spreadView, using: params) + } + func spreadViewContentInset(_ spreadView: EPUBSpreadView) -> UIEdgeInsets { if let inset = delegate?.navigatorContentInset(self) { return inset @@ -1078,6 +1087,7 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } await spreadView.evaluateScript("(function() {\n\(script)\n})();") + await spreadView.evaluateScript("(function() { readium.renderNativeOverlay(); })();") } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 27a52c2b95..005d4a9373 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -36,6 +36,9 @@ protocol EPUBSpreadViewDelegate: AnyObject { /// Called when the user triggered an input pointer event. func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) + /// Called when the spread view finished loading and has loaded page which is wrapper around some type which is not support as EPUB spine element (like PDF) + func spreadView(_ spreadView: EPUBSpreadView, renderNativeOverlayWithParams params: Any) + /// Called when the user triggered an input key event. func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) @@ -413,6 +416,7 @@ class EPUBSpreadView: UIView, Loggable, PageView { registerJSMessage(named: "selectionChanged") { [weak self] in self?.selectionDidChange($0) } registerJSMessage(named: "decorationActivated") { [weak self] in self?.decorationDidActivate($0) } registerJSMessage(named: "keyEventReceived") { [weak self] in self?.didReceiveKeyEvent($0) } + registerJSMessage(named: "renderNativeOverlay") { [weak self] in self?.renderNativeOverlay($0) } } /// Add the message handlers for incoming javascript events. @@ -448,6 +452,10 @@ class EPUBSpreadView: UIView, Loggable, PageView { delegate?.spreadView(self, didReceive: keyEvent) } + private func renderNativeOverlay(_ params: Any) { + delegate?.spreadView(self, renderNativeOverlayWithParams: params) + } + // MARK: - Decorator /// Called by the JavaScript layer when the user activates a decoration. diff --git a/Sources/Navigator/EPUB/Scripts/src/utils.js b/Sources/Navigator/EPUB/Scripts/src/utils.js index 3b25be58df..e78438e991 100644 --- a/Sources/Navigator/EPUB/Scripts/src/utils.js +++ b/Sources/Navigator/EPUB/Scripts/src/utils.js @@ -386,3 +386,18 @@ export function logError(e) { message: e.message, }); } + +export function renderNativeOverlay() { + try { + var linkResource = document.querySelector("link.wrapped-resource"); + var kind = linkResource.getAttribute("kind"); + var src = linkResource.getAttribute("href"); + var payload = { + kind: kind, + src: src, + }; + webkit.messageHandlers.renderNativeOverlay.postMessage(payload); + } catch (e) { + console.warn("Wrapper fallback active:", e); + } +} From bb8ad55aece76efc8770368332b0d2b69da574ea Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Mon, 1 Dec 2025 12:51:11 +0100 Subject: [PATCH 02/15] Regenerate EPUB bundled script --- Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js | 2 +- .../Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js | 2 +- Sources/Navigator/EPUB/Scripts/src/index.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js index 5ac7056e48..0e731a3068 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js @@ -1,2 +1,2 @@ -(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(G(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!G(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return G(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(H(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function H(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){H("CLIENT RECT: remove contained"),r.delete(e);break}}else H("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){H("CLIENT RECT: remove small, but keep otherwise empty!");break}H("CLIENT RECT: remove small"),o.splice(t,1)}}return H(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||G(t.right,e,n))&&(t.topr||G(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else H("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&G(t.left,e.right,r))&&(e.left=0&&G(e.left,t.right,r))&&(t.top=0&&G(t.top,e.bottom,r))&&(e.top=0&&G(e.top,t.bottom,r))}function G(t,e,r){return Math.abs(t-e)<=r}function H(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Gt(t){return Array.isArray(t)?t.filter(zt):[]}function Ht(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Ht(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Ht(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Gt(r.whitelist),blacklist:Gt(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); +(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={renderNativeOverlay:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.renderNativeOverlay.postMessage(e)}catch(t){console.warn("Wrapper fallback active:",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); //# sourceMappingURL=readium-fixed.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js index 6ec8cd752c..117d0d4c9a 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js @@ -1,2 +1,2 @@ -(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var E=b(b(t));x["%Error.prototype%"]=E}var S=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=S(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,E=RegExp.prototype.test,S=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||E.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var E=String(e);return w?$(e,E):E}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(S.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(S.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!E()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;S()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function E(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function S(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(S()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,E=o?g+b:0,S=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-E-v,O=S+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(S*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(S,A,i),contentRect:new Q(f,c,S,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,Et=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),St=new Et,At=function(t){!mt&&t>0&&St.start(),!(mt+=t)&&St.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Ee(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Se(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Ee):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Se)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(E()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)}))})()})(); +(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Ee(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={renderNativeOverlay:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.renderNativeOverlay.postMessage(e)}catch(t){console.warn("Wrapper fallback active:",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)}))})()})(); //# sourceMappingURL=readium-reflowable.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Scripts/src/index.js b/Sources/Navigator/EPUB/Scripts/src/index.js index a4189576b0..b126edb215 100644 --- a/Sources/Navigator/EPUB/Scripts/src/index.js +++ b/Sources/Navigator/EPUB/Scripts/src/index.js @@ -18,12 +18,14 @@ import { scrollToLocator, setProperty, setCSSProperties, + renderNativeOverlay, } from "./utils"; import { getDecorations, registerTemplates } from "./decorator"; // Public API used by the navigator. global.readium = { // utils + renderNativeOverlay: renderNativeOverlay, scrollToId: scrollToId, scrollToPosition: scrollToPosition, scrollToLocator: scrollToLocator, From b9f17bec0932f7d01453d831c387e0265628d75c Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Mon, 1 Dec 2025 13:26:01 +0100 Subject: [PATCH 03/15] Update guides --- .../Navigator/EPUB native spread layout.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/Guides/Navigator/EPUB native spread layout.md diff --git a/docs/Guides/Navigator/EPUB native spread layout.md b/docs/Guides/Navigator/EPUB native spread layout.md new file mode 100644 index 0000000000..d6a513b7e2 --- /dev/null +++ b/docs/Guides/Navigator/EPUB native spread layout.md @@ -0,0 +1,16 @@ +# EPUBNavigatorDelegate + +Readium allows rendering EPUB spine elements in a custom way (e.g. PDF is rendered using PDFKit instead of being loaded in WKWebView). +Client can add custom overlay on top of WKWebView using +```swift +func navigator(_ navigator: EPUBNavigatorViewController, renderNativeOverlay spreadView: UIView, using params: Any) +``` + delegate method. + +In order for this method to be invoked for given ```EPUBSpreadView```, loaded XHTML resource must have ```link``` tag element inside ```head``` block. + +```html + +``` + +Link tag must have class set to ```wrapped-resource```. ```href``` attribute is used to identify resource registered in EPUB which client can render in custom way, and ```kind``` is arbtrary type used by client to define how given resource should be rendered. From 18834d0ec378d1e9d89b16f0da0313f587b13b08 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Wed, 3 Dec 2025 09:15:35 +0100 Subject: [PATCH 04/15] Rename navigator delegate method for adding custom overlay --- .../EPUB/Assets/Static/scripts/readium-fixed.js | 2 +- .../EPUB/Assets/Static/scripts/readium-reflowable.js | 2 +- .../Navigator/EPUB/EPUBNavigatorViewController.swift | 12 ++++++------ Sources/Navigator/EPUB/EPUBSpreadView.swift | 10 +++++----- Sources/Navigator/EPUB/Scripts/src/index.js | 4 ++-- Sources/Navigator/EPUB/Scripts/src/utils.js | 6 +++--- docs/Guides/Navigator/EPUB native spread layout.md | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js index 0e731a3068..8f4a2e6093 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js @@ -1,2 +1,2 @@ -(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={renderNativeOverlay:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.renderNativeOverlay.postMessage(e)}catch(t){console.warn("Wrapper fallback active:",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); +(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function _(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!_(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(W(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!_(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=_(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return W(t,e.left,e.top,r)&&W(t,e.right,e.top,r)&&W(t,e.left,e.bottom,r)&&W(t,e.right,e.bottom,r)}function W(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function _(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),_(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(W(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function Wt(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const _t={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||Wt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&Wt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(Wt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return Wt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},_t),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{We(t)||(_e(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{We(t)||(_e(t),Ue("up",t))})),r.g.readium={extractWrappedResources:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.extractWrappedResources.postMessage(e)}catch(t){console.warn("Wrapped resource not available",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); //# sourceMappingURL=readium-fixed.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js index 117d0d4c9a..84e4d40047 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js @@ -1,2 +1,2 @@ -(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Ee(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={renderNativeOverlay:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.renderNativeOverlay.postMessage(e)}catch(t){console.warn("Wrapper fallback active:",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)}))})()})(); +(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function _(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!_(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(W(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!_(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=_(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return W(t,e.left,e.top,r)&&W(t,e.right,e.top,r)&&W(t,e.left,e.bottom,r)&&W(t,e.right,e.bottom,r)}function W(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function _(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),_(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(W(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function Wt(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const _t={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||Wt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&Wt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(Wt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return Wt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Ee(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},_t),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{We(t)||(_e(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{We(t)||(_e(t),Ue("up",t))})),r.g.readium={extractWrappedResources:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.extractWrappedResources.postMessage(e)}catch(t){console.warn("Wrapped resource not available",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)}))})()})(); //# sourceMappingURL=readium-reflowable.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 877500c0da..ca46ec5df4 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -19,8 +19,8 @@ import WebKit func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) - /// Called when spread is loaded (wrapper around type which cannot directly be EPUB spine elements, e.g. PDF ) - func navigator(_ navigator: EPUBNavigatorViewController, renderNativeOverlay spreadView: UIView, using params: Any) + /// Called when spread is loaded (contains reference to a type which cannot directly be EPUB spine element, e.g. PDF ) + func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) } public extension EPUBNavigatorDelegate { @@ -28,7 +28,7 @@ public extension EPUBNavigatorDelegate { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) {} - func navigator(_ navigator: EPUBNavigatorViewController, renderNativeOverlay spreadView: UIView, using params: Any) {} + func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) {} } public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) @@ -1026,8 +1026,8 @@ extension EPUBNavigatorViewController: EPUBNavigatorViewModelDelegate { } extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { - func spreadView(_ spreadView: EPUBSpreadView, renderNativeOverlayWithParams params: Any) { - delegate?.navigator(self, renderNativeOverlay: spreadView, using: params) + func spreadView(_ spreadView: EPUBSpreadView, didExtractResources resources: Any) { + delegate?.navigator(self, didExtractResources: resources, for: spreadView) } func spreadViewContentInset(_ spreadView: EPUBSpreadView) -> UIEdgeInsets { @@ -1087,7 +1087,7 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } await spreadView.evaluateScript("(function() {\n\(script)\n})();") - await spreadView.evaluateScript("(function() { readium.renderNativeOverlay(); })();") + await spreadView.evaluateScript("(function() { readium.extractWrappedResources(); })();") } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 005d4a9373..97f6702bfe 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -36,8 +36,8 @@ protocol EPUBSpreadViewDelegate: AnyObject { /// Called when the user triggered an input pointer event. func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) - /// Called when the spread view finished loading and has loaded page which is wrapper around some type which is not support as EPUB spine element (like PDF) - func spreadView(_ spreadView: EPUBSpreadView, renderNativeOverlayWithParams params: Any) + /// Called when the spread view finished loading and has loaded page which is wrapper around some type which is not supported as EPUB spine element (like PDF) + func spreadView(_ spreadView: EPUBSpreadView, didExtractResources resources: Any) /// Called when the user triggered an input key event. func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) @@ -416,7 +416,7 @@ class EPUBSpreadView: UIView, Loggable, PageView { registerJSMessage(named: "selectionChanged") { [weak self] in self?.selectionDidChange($0) } registerJSMessage(named: "decorationActivated") { [weak self] in self?.decorationDidActivate($0) } registerJSMessage(named: "keyEventReceived") { [weak self] in self?.didReceiveKeyEvent($0) } - registerJSMessage(named: "renderNativeOverlay") { [weak self] in self?.renderNativeOverlay($0) } + registerJSMessage(named: "extractWrappedResources") { [weak self] in self?.extractWrappedResources($0) } } /// Add the message handlers for incoming javascript events. @@ -452,8 +452,8 @@ class EPUBSpreadView: UIView, Loggable, PageView { delegate?.spreadView(self, didReceive: keyEvent) } - private func renderNativeOverlay(_ params: Any) { - delegate?.spreadView(self, renderNativeOverlayWithParams: params) + private func extractWrappedResources(_ resources: Any) { + delegate?.spreadView(self, didExtractResources: resources) } // MARK: - Decorator diff --git a/Sources/Navigator/EPUB/Scripts/src/index.js b/Sources/Navigator/EPUB/Scripts/src/index.js index b126edb215..904c716726 100644 --- a/Sources/Navigator/EPUB/Scripts/src/index.js +++ b/Sources/Navigator/EPUB/Scripts/src/index.js @@ -18,14 +18,14 @@ import { scrollToLocator, setProperty, setCSSProperties, - renderNativeOverlay, + extractWrappedResources, } from "./utils"; import { getDecorations, registerTemplates } from "./decorator"; // Public API used by the navigator. global.readium = { // utils - renderNativeOverlay: renderNativeOverlay, + extractWrappedResources: extractWrappedResources, scrollToId: scrollToId, scrollToPosition: scrollToPosition, scrollToLocator: scrollToLocator, diff --git a/Sources/Navigator/EPUB/Scripts/src/utils.js b/Sources/Navigator/EPUB/Scripts/src/utils.js index e78438e991..38b8978845 100644 --- a/Sources/Navigator/EPUB/Scripts/src/utils.js +++ b/Sources/Navigator/EPUB/Scripts/src/utils.js @@ -387,7 +387,7 @@ export function logError(e) { }); } -export function renderNativeOverlay() { +export function extractWrappedResources() { try { var linkResource = document.querySelector("link.wrapped-resource"); var kind = linkResource.getAttribute("kind"); @@ -396,8 +396,8 @@ export function renderNativeOverlay() { kind: kind, src: src, }; - webkit.messageHandlers.renderNativeOverlay.postMessage(payload); + webkit.messageHandlers.extractWrappedResources.postMessage(payload); } catch (e) { - console.warn("Wrapper fallback active:", e); + console.warn("Wrapped resource not available", e); } } diff --git a/docs/Guides/Navigator/EPUB native spread layout.md b/docs/Guides/Navigator/EPUB native spread layout.md index d6a513b7e2..f3f399c1f9 100644 --- a/docs/Guides/Navigator/EPUB native spread layout.md +++ b/docs/Guides/Navigator/EPUB native spread layout.md @@ -3,7 +3,7 @@ Readium allows rendering EPUB spine elements in a custom way (e.g. PDF is rendered using PDFKit instead of being loaded in WKWebView). Client can add custom overlay on top of WKWebView using ```swift -func navigator(_ navigator: EPUBNavigatorViewController, renderNativeOverlay spreadView: UIView, using params: Any) +func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) ``` delegate method. @@ -13,4 +13,4 @@ In order for this method to be invoked for given ```EPUBSpreadView```, loaded XH ``` -Link tag must have class set to ```wrapped-resource```. ```href``` attribute is used to identify resource registered in EPUB which client can render in custom way, and ```kind``` is arbtrary type used by client to define how given resource should be rendered. +Link tag must have class set to ```wrapped-resource```. ```href``` attribute is used to identify resource registered in EPUB which client can render in custom way, and ```kind``` is arbitrary type used by client to define how given resource should be rendered. From 43a5ae7fa4af76abd15ca390fd9e4d7b42d53c46 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Thu, 4 Dec 2025 16:28:12 +0100 Subject: [PATCH 05/15] Allow providing external page view --- .../Navigator/EPUB/CustomTypeSpreadView.swift | 19 +++++ .../EPUB/EPUBNavigatorViewController.swift | 78 ++++++++++++++++--- Sources/Streamer/Parser/EPUB/OPFParser.swift | 16 +++- 3 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 Sources/Navigator/EPUB/CustomTypeSpreadView.swift diff --git a/Sources/Navigator/EPUB/CustomTypeSpreadView.swift b/Sources/Navigator/EPUB/CustomTypeSpreadView.swift new file mode 100644 index 0000000000..606281deda --- /dev/null +++ b/Sources/Navigator/EPUB/CustomTypeSpreadView.swift @@ -0,0 +1,19 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// +import Foundation +import UIKit +import ReadiumShared + +class CustomTypeSpreadView: UIView, Loggable, PageView { + + + + + func go(to location: PageLocation) async { + // Custom layout resources are always fully visible so we don't use the + // location + } +} diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index ca46ec5df4..da149ca85c 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -11,6 +11,30 @@ import SwiftSoup import UIKit import WebKit +extension Publication { + func readingOrderLinks(for spread: EPUBSpread) -> [Link] { + spread.readingOrderIndices.map({ index in + readingOrder[index] + }) + } +} + +public extension Properties { + + var customOptions: [String: Any]? { + guard let custom = otherProperties["custom"] as? [String: String], + let src = custom["src"], + let kind = custom["kind"] else { + return nil + } + return [ + "src": src, + "kind": kind + ] + } + +} + @MainActor public protocol EPUBNavigatorDelegate: VisualNavigatorDelegate, SelectableNavigatorDelegate { /// Called when the viewport is updated. func navigator(_ navigator: EPUBNavigatorViewController, viewportDidChange viewport: EPUBNavigatorViewController.Viewport?) @@ -21,6 +45,8 @@ import WebKit /// Called when spread is loaded (contains reference to a type which cannot directly be EPUB spine element, e.g. PDF ) func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) + + func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? } public extension EPUBNavigatorDelegate { @@ -29,6 +55,10 @@ public extension EPUBNavigatorDelegate { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) {} func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) {} + + func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? { + nil + } } public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) @@ -1269,19 +1299,45 @@ extension EPUBNavigatorViewController: EditingActionsControllerDelegate { extension EPUBNavigatorViewController: PaginationViewDelegate { func paginationView(_ paginationView: PaginationView, pageViewAtIndex index: Int) -> (UIView & PageView)? { let spread = spreads[index] - let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self - let spreadView = spreadViewType.init( - viewModel: viewModel, - spread: spread, - scripts: [], - animatedLoad: false - ) - spreadView.delegate = self + + let linksForSpread: [Link] = publication.readingOrderLinks(for: spread) + let isCustom = linksForSpread.contains(where: { $0.properties.customOptions != nil }) + + if isCustom, let customView = delegate?.navigator(self, viewForReadingOrderLinks: linksForSpread) { + let customTypeSpreadContainer = CustomTypeSpreadView(frame: .zero) +//// customTypeSpreadContainer.translatesAutoresizingMaskIntoConstraints = false + customView.view.translatesAutoresizingMaskIntoConstraints = false +// +// customView.view.frame = customTypeSpreadContainer.bounds +// customView.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] + customTypeSpreadContainer.addSubview(customView.view) + NSLayoutConstraint.activate([ + customTypeSpreadContainer.leadingAnchor.constraint(equalTo: customView.view.leadingAnchor), + customTypeSpreadContainer.trailingAnchor.constraint(equalTo: customView.view.trailingAnchor), + customTypeSpreadContainer.topAnchor.constraint(equalTo: customView.view.topAnchor), + customTypeSpreadContainer.bottomAnchor.constraint(equalTo: customView.view.bottomAnchor) + ]) + addChild(customView) + +// customTypeSpreadContainer.backgroundColor = .yellow + + return customTypeSpreadContainer + } else { + + let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self + let spreadView = spreadViewType.init( + viewModel: viewModel, + spread: spread, + scripts: [], + animatedLoad: false + ) + spreadView.delegate = self - let userContentController = spreadView.webView.configuration.userContentController - delegate?.navigator(self, setupUserScripts: userContentController) + let userContentController = spreadView.webView.configuration.userContentController + delegate?.navigator(self, setupUserScripts: userContentController) - return spreadView + return spreadView + } } func paginationViewDidUpdateViews(_ paginationView: PaginationView) { diff --git a/Sources/Streamer/Parser/EPUB/OPFParser.swift b/Sources/Streamer/Parser/EPUB/OPFParser.swift index 35e219ca70..78b7a4a002 100644 --- a/Sources/Streamer/Parser/EPUB/OPFParser.swift +++ b/Sources/Streamer/Parser/EPUB/OPFParser.swift @@ -201,7 +201,7 @@ final class OPFParser: Loggable { let stringProperties = "\(manifestItem.attr("properties") ?? "") \(spineItem?.attr("properties") ?? "")" .components(separatedBy: .whitespaces) .map { $0.trimmingCharacters(in: .whitespacesAndNewlines) } - + var rels: [LinkRelation] = [] if stringProperties.contains("nav") { rels.append(.contents) @@ -234,6 +234,7 @@ final class OPFParser: Loggable { private func parseStringProperties(_ properties: [String]) -> [String: Any] { var contains: [String] = [] var page: Properties.Page? + var custom: [String: Any] = [:] for property in properties { switch property { @@ -258,7 +259,14 @@ final class OPFParser: Loggable { case "page-spread-center", "rendition:page-spread-center": page = .center default: - continue + let customProperty = property.split(separator: ":") + if customProperty.count == 2 { + let key = String(customProperty[0]) + let value = String(customProperty[1]) + custom[key] = value + } else { + continue + } } } @@ -269,6 +277,10 @@ final class OPFParser: Loggable { if let page = page { otherProperties["page"] = page.rawValue } + + if !custom.isEmpty { + otherProperties["custom"] = custom + } return otherProperties } From f8eda403c95f39f7b0ca8c4df63d4bee956cc4f0 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Mon, 8 Dec 2025 12:06:55 +0100 Subject: [PATCH 06/15] Fix lint warnings --- .../Navigator/EPUB/CustomTypeSpreadView.swift | 10 +--- .../EPUB/EPUBNavigatorViewController.swift | 57 ++++++------------- Sources/Navigator/EPUB/EPUBSpreadView.swift | 8 --- Sources/Streamer/Parser/EPUB/OPFParser.swift | 12 ++-- 4 files changed, 26 insertions(+), 61 deletions(-) diff --git a/Sources/Navigator/EPUB/CustomTypeSpreadView.swift b/Sources/Navigator/EPUB/CustomTypeSpreadView.swift index 606281deda..449ae11d60 100644 --- a/Sources/Navigator/EPUB/CustomTypeSpreadView.swift +++ b/Sources/Navigator/EPUB/CustomTypeSpreadView.swift @@ -3,17 +3,13 @@ // Use of this source code is governed by the BSD-style license // available in the top-level LICENSE file of the project. // + import Foundation -import UIKit import ReadiumShared +import UIKit class CustomTypeSpreadView: UIView, Loggable, PageView { - - - - func go(to location: PageLocation) async { - // Custom layout resources are always fully visible so we don't use the - // location + // Custom layout resources are always fully visible so we don't use the location } } diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index da149ca85c..789852c83f 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -11,28 +11,21 @@ import SwiftSoup import UIKit import WebKit -extension Publication { - func readingOrderLinks(for spread: EPUBSpread) -> [Link] { - spread.readingOrderIndices.map({ index in - readingOrder[index] - }) +public extension Properties { + struct RenderCustomMetadata { + public let href: String + public let type: String } -} -public extension Properties { - - var customOptions: [String: Any]? { - guard let custom = otherProperties["custom"] as? [String: String], - let src = custom["src"], - let kind = custom["kind"] else { + var customOptions: RenderCustomMetadata? { + guard let custom = otherProperties["renderCustom"] as? [String: String], + let href = custom["document"], + let type = custom["custom-type"] + else { return nil } - return [ - "src": src, - "kind": kind - ] + return RenderCustomMetadata(href: href, type: type) } - } @MainActor public protocol EPUBNavigatorDelegate: VisualNavigatorDelegate, SelectableNavigatorDelegate { @@ -43,9 +36,6 @@ public extension Properties { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) - /// Called when spread is loaded (contains reference to a type which cannot directly be EPUB spine element, e.g. PDF ) - func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) - func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? } @@ -54,8 +44,6 @@ public extension EPUBNavigatorDelegate { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) {} - func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) {} - func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? { nil } @@ -1056,10 +1044,6 @@ extension EPUBNavigatorViewController: EPUBNavigatorViewModelDelegate { } extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { - func spreadView(_ spreadView: EPUBSpreadView, didExtractResources resources: Any) { - delegate?.navigator(self, didExtractResources: resources, for: spreadView) - } - func spreadViewContentInset(_ spreadView: EPUBSpreadView) -> UIEdgeInsets { if let inset = delegate?.navigatorContentInset(self) { return inset @@ -1117,7 +1101,6 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } await spreadView.evaluateScript("(function() {\n\(script)\n})();") - await spreadView.evaluateScript("(function() { readium.extractWrappedResources(); })();") } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { @@ -1299,31 +1282,25 @@ extension EPUBNavigatorViewController: EditingActionsControllerDelegate { extension EPUBNavigatorViewController: PaginationViewDelegate { func paginationView(_ paginationView: PaginationView, pageViewAtIndex index: Int) -> (UIView & PageView)? { let spread = spreads[index] - - let linksForSpread: [Link] = publication.readingOrderLinks(for: spread) - let isCustom = linksForSpread.contains(where: { $0.properties.customOptions != nil }) - + + let linksForSpread: [Link] = spread.readingOrderIndices.map { index in + publication.readingOrder[index] + } + let isCustom = linksForSpread.contains(where: { $0.properties.customOptions != nil }) + if isCustom, let customView = delegate?.navigator(self, viewForReadingOrderLinks: linksForSpread) { let customTypeSpreadContainer = CustomTypeSpreadView(frame: .zero) -//// customTypeSpreadContainer.translatesAutoresizingMaskIntoConstraints = false customView.view.translatesAutoresizingMaskIntoConstraints = false -// -// customView.view.frame = customTypeSpreadContainer.bounds -// customView.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] customTypeSpreadContainer.addSubview(customView.view) NSLayoutConstraint.activate([ customTypeSpreadContainer.leadingAnchor.constraint(equalTo: customView.view.leadingAnchor), customTypeSpreadContainer.trailingAnchor.constraint(equalTo: customView.view.trailingAnchor), customTypeSpreadContainer.topAnchor.constraint(equalTo: customView.view.topAnchor), - customTypeSpreadContainer.bottomAnchor.constraint(equalTo: customView.view.bottomAnchor) + customTypeSpreadContainer.bottomAnchor.constraint(equalTo: customView.view.bottomAnchor), ]) addChild(customView) - -// customTypeSpreadContainer.backgroundColor = .yellow - return customTypeSpreadContainer } else { - let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self let spreadView = spreadViewType.init( viewModel: viewModel, diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 97f6702bfe..27a52c2b95 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -36,9 +36,6 @@ protocol EPUBSpreadViewDelegate: AnyObject { /// Called when the user triggered an input pointer event. func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) - /// Called when the spread view finished loading and has loaded page which is wrapper around some type which is not supported as EPUB spine element (like PDF) - func spreadView(_ spreadView: EPUBSpreadView, didExtractResources resources: Any) - /// Called when the user triggered an input key event. func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) @@ -416,7 +413,6 @@ class EPUBSpreadView: UIView, Loggable, PageView { registerJSMessage(named: "selectionChanged") { [weak self] in self?.selectionDidChange($0) } registerJSMessage(named: "decorationActivated") { [weak self] in self?.decorationDidActivate($0) } registerJSMessage(named: "keyEventReceived") { [weak self] in self?.didReceiveKeyEvent($0) } - registerJSMessage(named: "extractWrappedResources") { [weak self] in self?.extractWrappedResources($0) } } /// Add the message handlers for incoming javascript events. @@ -452,10 +448,6 @@ class EPUBSpreadView: UIView, Loggable, PageView { delegate?.spreadView(self, didReceive: keyEvent) } - private func extractWrappedResources(_ resources: Any) { - delegate?.spreadView(self, didExtractResources: resources) - } - // MARK: - Decorator /// Called by the JavaScript layer when the user activates a decoration. diff --git a/Sources/Streamer/Parser/EPUB/OPFParser.swift b/Sources/Streamer/Parser/EPUB/OPFParser.swift index 78b7a4a002..c377a9ed0d 100644 --- a/Sources/Streamer/Parser/EPUB/OPFParser.swift +++ b/Sources/Streamer/Parser/EPUB/OPFParser.swift @@ -201,7 +201,7 @@ final class OPFParser: Loggable { let stringProperties = "\(manifestItem.attr("properties") ?? "") \(spineItem?.attr("properties") ?? "")" .components(separatedBy: .whitespaces) .map { $0.trimmingCharacters(in: .whitespacesAndNewlines) } - + var rels: [LinkRelation] = [] if stringProperties.contains("nav") { rels.append(.contents) @@ -234,7 +234,7 @@ final class OPFParser: Loggable { private func parseStringProperties(_ properties: [String]) -> [String: Any] { var contains: [String] = [] var page: Properties.Page? - var custom: [String: Any] = [:] + var renderCustom: [String: Any] = [:] for property in properties { switch property { @@ -263,7 +263,7 @@ final class OPFParser: Loggable { if customProperty.count == 2 { let key = String(customProperty[0]) let value = String(customProperty[1]) - custom[key] = value + renderCustom[key] = value } else { continue } @@ -277,9 +277,9 @@ final class OPFParser: Loggable { if let page = page { otherProperties["page"] = page.rawValue } - - if !custom.isEmpty { - otherProperties["custom"] = custom + + if !renderCustom.isEmpty { + otherProperties["renderCustom"] = renderCustom } return otherProperties From 08acf63569545be0b12f50b1bfb08e7720ced9bc Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Mon, 8 Dec 2025 17:08:25 +0100 Subject: [PATCH 07/15] Handle spreads in landscape --- .../Navigator/EPUB/CustomTypeSpreadView.swift | 15 ---- .../EPUB/CustomTypeSpreadViewWrapper.swift | 32 +++++++++ .../EPUB/EPUBNavigatorViewController.swift | 72 ++++++++++++++----- Sources/Navigator/EPUB/EPUBSpreadView.swift | 2 +- .../EPUB/EPUBSpreadViewContainer.swift | 12 ++++ 5 files changed, 98 insertions(+), 35 deletions(-) delete mode 100644 Sources/Navigator/EPUB/CustomTypeSpreadView.swift create mode 100644 Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift create mode 100644 Sources/Navigator/EPUB/EPUBSpreadViewContainer.swift diff --git a/Sources/Navigator/EPUB/CustomTypeSpreadView.swift b/Sources/Navigator/EPUB/CustomTypeSpreadView.swift deleted file mode 100644 index 449ae11d60..0000000000 --- a/Sources/Navigator/EPUB/CustomTypeSpreadView.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// Copyright 2025 Readium Foundation. All rights reserved. -// Use of this source code is governed by the BSD-style license -// available in the top-level LICENSE file of the project. -// - -import Foundation -import ReadiumShared -import UIKit - -class CustomTypeSpreadView: UIView, Loggable, PageView { - func go(to location: PageLocation) async { - // Custom layout resources are always fully visible so we don't use the location - } -} diff --git a/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift b/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift new file mode 100644 index 0000000000..b660eb2415 --- /dev/null +++ b/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift @@ -0,0 +1,32 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation +import ReadiumShared +import UIKit + +class CustomTypeSpreadViewWrapper: UIView, Loggable, PageView, EPUBSpreadViewContainer { + + let spread: EPUBSpread + + init(spread: EPUBSpread) { + self.spread = spread + super.init(frame: .zero) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func progression(in index: ReadingOrder.Index) -> ClosedRange { + // To be overridden in subclasses if the resource supports a progression. + 0 ... 1 + } + + func go(to location: PageLocation) async { + // Custom layout resources are always fully visible so we don't use the location + } +} diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 789852c83f..3028b79ac2 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -12,19 +12,19 @@ import UIKit import WebKit public extension Properties { - struct RenderCustomMetadata { + struct RenderMetadata { public let href: String public let type: String } - var customOptions: RenderCustomMetadata? { + var renderOptions: RenderMetadata? { guard let custom = otherProperties["renderCustom"] as? [String: String], let href = custom["document"], let type = custom["custom-type"] else { return nil } - return RenderCustomMetadata(href: href, type: type) + return RenderMetadata(href: href, type: type) } } @@ -680,7 +680,7 @@ open class EPUBNavigatorViewController: InputObservableViewController, return (pendingLocator, nil) } - guard let spreadView = paginationView?.currentView as? EPUBSpreadView else { + guard let spreadView = paginationView?.currentView as? EPUBSpreadViewContainer else { return (nil, nil) } @@ -1286,35 +1286,69 @@ extension EPUBNavigatorViewController: PaginationViewDelegate { let linksForSpread: [Link] = spread.readingOrderIndices.map { index in publication.readingOrder[index] } - let isCustom = linksForSpread.contains(where: { $0.properties.customOptions != nil }) + let isCustom = linksForSpread.contains(where: { $0.properties.renderOptions != nil }) if isCustom, let customView = delegate?.navigator(self, viewForReadingOrderLinks: linksForSpread) { - let customTypeSpreadContainer = CustomTypeSpreadView(frame: .zero) + let customTypeSpreadContainer = CustomTypeSpreadViewWrapper(spread: spread) customView.view.translatesAutoresizingMaskIntoConstraints = false customTypeSpreadContainer.addSubview(customView.view) + addChild(customView) + NSLayoutConstraint.activate([ customTypeSpreadContainer.leadingAnchor.constraint(equalTo: customView.view.leadingAnchor), customTypeSpreadContainer.trailingAnchor.constraint(equalTo: customView.view.trailingAnchor), customTypeSpreadContainer.topAnchor.constraint(equalTo: customView.view.topAnchor), customTypeSpreadContainer.bottomAnchor.constraint(equalTo: customView.view.bottomAnchor), ]) - addChild(customView) + + // handle case when only one page in spread is custom view + if linksForSpread.count == 2 { + let spreadView = createSpreadView(spread: spread) + if linksForSpread[0].properties.renderOptions == nil { + customTypeSpreadContainer.addSubview(spreadView) + NSLayoutConstraint.activate([ + customTypeSpreadContainer.leadingAnchor.constraint(equalTo: spreadView.leadingAnchor), + customTypeSpreadContainer.topAnchor.constraint(equalTo: spreadView.topAnchor), + customTypeSpreadContainer.bottomAnchor.constraint(equalTo: spreadView.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5) + ]) + } else if linksForSpread[1].properties.renderOptions == nil { + customTypeSpreadContainer.addSubview(spreadView) + NSLayoutConstraint.activate([ + customTypeSpreadContainer.trailingAnchor.constraint(equalTo: spreadView.trailingAnchor), + customTypeSpreadContainer.topAnchor.constraint(equalTo: spreadView.topAnchor), + customTypeSpreadContainer.bottomAnchor.constraint(equalTo: spreadView.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5) + ]) + } + } + +// customTypeSpreadContainer.setNeedsLayout() +// customTypeSpreadContainer.layoutIfNeeded() + + customTypeSpreadContainer.setNeedsUpdateConstraints() + return customTypeSpreadContainer } else { - let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self - let spreadView = spreadViewType.init( - viewModel: viewModel, - spread: spread, - scripts: [], - animatedLoad: false - ) - spreadView.delegate = self + return createSpreadView(spread: spread) + } + } + + + private func createSpreadView(spread: EPUBSpread) -> EPUBSpreadView { + let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self + let spreadView = spreadViewType.init( + viewModel: viewModel, + spread: spread, + scripts: [], + animatedLoad: false + ) + spreadView.delegate = self - let userContentController = spreadView.webView.configuration.userContentController - delegate?.navigator(self, setupUserScripts: userContentController) + let userContentController = spreadView.webView.configuration.userContentController + delegate?.navigator(self, setupUserScripts: userContentController) - return spreadView - } + return spreadView } func paginationViewDidUpdateViews(_ paginationView: PaginationView) { diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 27a52c2b95..530ee348af 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -43,7 +43,7 @@ protocol EPUBSpreadViewDelegate: AnyObject { func spreadViewDidTerminate() } -class EPUBSpreadView: UIView, Loggable, PageView { +class EPUBSpreadView: UIView, Loggable, PageView, EPUBSpreadViewContainer { weak var delegate: EPUBSpreadViewDelegate? let viewModel: EPUBNavigatorViewModel let spread: EPUBSpread diff --git a/Sources/Navigator/EPUB/EPUBSpreadViewContainer.swift b/Sources/Navigator/EPUB/EPUBSpreadViewContainer.swift new file mode 100644 index 0000000000..26ef9a1060 --- /dev/null +++ b/Sources/Navigator/EPUB/EPUBSpreadViewContainer.swift @@ -0,0 +1,12 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import ReadiumShared + +protocol EPUBSpreadViewContainer { + var spread: EPUBSpread { get } + func progression(in index: ReadingOrder.Index) -> ClosedRange +} From e5da5644a6bb5604139df5e15783fce29712673b Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Tue, 9 Dec 2025 12:12:06 +0100 Subject: [PATCH 08/15] Remove unused code --- .../Assets/Static/scripts/readium-fixed.js | 2 +- .../Static/scripts/readium-reflowable.js | 2 +- .../EPUB/CustomTypeSpreadViewWrapper.swift | 10 +++--- .../EPUB/EPUBNavigatorViewController.swift | 34 ++++++++----------- Sources/Navigator/EPUB/Scripts/src/index.js | 2 -- Sources/Navigator/EPUB/Scripts/src/utils.js | 15 -------- 6 files changed, 21 insertions(+), 44 deletions(-) diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js index 8f4a2e6093..5ac7056e48 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js @@ -1,2 +1,2 @@ -(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function _(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!_(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(W(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!_(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=_(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return W(t,e.left,e.top,r)&&W(t,e.right,e.top,r)&&W(t,e.left,e.bottom,r)&&W(t,e.right,e.bottom,r)}function W(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function _(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),_(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(W(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function Wt(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const _t={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||Wt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&Wt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(Wt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return Wt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},_t),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{We(t)||(_e(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{We(t)||(_e(t),Ue("up",t))})),r.g.readium={extractWrappedResources:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.extractWrappedResources.postMessage(e)}catch(t){console.warn("Wrapped resource not available",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); +(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(G(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!G(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return G(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(H(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function H(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){H("CLIENT RECT: remove contained"),r.delete(e);break}}else H("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){H("CLIENT RECT: remove small, but keep otherwise empty!");break}H("CLIENT RECT: remove small"),o.splice(t,1)}}return H(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||G(t.right,e,n))&&(t.topr||G(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else H("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&G(t.left,e.right,r))&&(e.left=0&&G(e.left,t.right,r))&&(t.top=0&&G(t.top,e.bottom,r))&&(e.top=0&&G(e.top,t.bottom,r))}function G(t,e,r){return Math.abs(t-e)<=r}function H(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Gt(t){return Array.isArray(t)?t.filter(zt):[]}function Ht(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Ht(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Ht(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Gt(r.whitelist),blacklist:Gt(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); //# sourceMappingURL=readium-fixed.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js index 84e4d40047..6ec8cd752c 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js @@ -1,2 +1,2 @@ -(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function _(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?$(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!_(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(W(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!_(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!S()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;E()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function S(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function E(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(E()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=_(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return W(t,e.left,e.top,r)&&W(t,e.right,e.top,r)&&W(t,e.left,e.bottom,r)&&W(t,e.right,e.bottom,r)}function W(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function _(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),_(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(W(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function Wt(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const _t={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||Wt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&Wt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(Wt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return Wt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Ee(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},_t),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{We(t)||(_e(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{We(t)||(_e(t),Ue("up",t))})),r.g.readium={extractWrappedResources:function(){try{var t=document.querySelector("link.wrapped-resource"),e={kind:t.getAttribute("kind"),src:t.getAttribute("href")};webkit.messageHandlers.extractWrappedResources.postMessage(e)}catch(t){console.warn("Wrapped resource not available",t)}},scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(S()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)}))})()})(); +(()=>{var t={9116:(t,e)=>{"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var E=b(b(t));x["%Error.prototype%"]=E}var S=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,$=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=S(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=$("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},648:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,E=RegExp.prototype.test,S=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||E.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(1740),D=k.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==G(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==G(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var E=String(e);return w?$(e,E):E}if("bigint"==typeof e){var j=String(e)+"n";return w?$(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return H(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(S.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==G(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==G(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(G(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(S.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function G(t){return h.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),i=Object;t.exports=n((function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.c)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=1===t.direction,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=i(t)+e;return new u(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const u=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return $(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}var h;window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){var t;new ResizeObserver((()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame((function(){v=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(x()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!x()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),w()}))})).observe(document.body)}),!1);var g,m,b=!1,v=0;function w(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(x()&&!E()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;h={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;S()&&(e=Math.abs(e)),h={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(b||window.requestAnimationFrame((function(){var t;t=h,webkit.messageHandlers.progressionChanged.postMessage(t),b=!1})),b=!0)}function x(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function E(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function S(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function A(t){return x()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){const e=t+(S()?-1:1);return e-e%v}function T(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new l(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",w),document.addEventListener("selectionchange",(50,g=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(m),m=setTimeout((function(){g.apply(t,e),m=null}),50)}));const M=!1;function $(t){let e=k({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function k(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function D(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){G("CLIENT RECT: remove contained"),r.delete(e);break}}else G("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){G("CLIENT RECT: remove small, but keep otherwise empty!");break}G("CLIENT RECT: remove small"),o.splice(t,1)}}return G(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||H(t.right,e,n))&&(t.topr||H(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else G("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function z(t,e,r){return(t.left=0&&H(t.left,e.right,r))&&(e.left=0&&H(e.left,t.right,r))&&(t.top=0&&H(t.top,e.bottom,r))&&(e.top=0&&H(e.top,t.bottom,r))}function H(t,e,r){return Math.abs(t-e)<=r}function G(){M&&C.apply(null,arguments)}var V,q=[],X="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Y(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},et=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,E=o?g+b:0,S=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-E-v,O=S+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(S*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(S,A,i),contentRect:new Q(f,c,S,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=function(){var t=1/0,e=[];q.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(e){var r=new pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,Et=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),St=new Et,At=function(t){!mt&&t>0&&St.start(),!(mt+=t)&&St.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Rt.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var $t=0;function kt(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Ht(t){return Array.isArray(t)?t.filter(zt):[]}function Gt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Gt(t))return t.contains(e)||_t("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const r=e.getRootNode({composed:!1});return Gt(r)?(r!==document&&_t("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return _t("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Ee(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Se(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Ee):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Se)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Ht(r.whitelist),blacklist:Ht(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{_e(t)||(We(t),Ue("down",t))})),window.addEventListener("keyup",(t=>{_e(t)||(We(t),Ue("up",t))})),r.g.readium={scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(t<0||t>1)console.error(`Expected a valid progression in scrollToPosition, got ${t}`);else if(x())if(E()){let e=document.scrollingElement.scrollWidth*t;document.scrollingElement.scrollLeft=-e}else{let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(t){let e=r.findIndex((e=>e.decoration.id===t));if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function c(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const u=getComputedStyle(document.body).writingMode,c="vertical-rl"===u||"vertical-lr"===u,s=document.scrollingElement,{scrollLeft:l,scrollTop:f}=s,p=c?window.innerHeight:window.innerWidth,y=c?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,h=(c?y:p)/d;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-l+"px":t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-l+s.clientWidth}px`:t.style.left=`${r.left+l}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=`${-e.right-l+s.clientWidth}px`:t.style.left=`${e.left+l}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+l}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+l}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+l}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!u.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=D(r.range,t).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left));for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,u),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=u,g(t,b,b,u),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+$t++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)}))})()})(); //# sourceMappingURL=readium-reflowable.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift b/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift index b660eb2415..78b4b50bce 100644 --- a/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift +++ b/Sources/Navigator/EPUB/CustomTypeSpreadViewWrapper.swift @@ -9,23 +9,23 @@ import ReadiumShared import UIKit class CustomTypeSpreadViewWrapper: UIView, Loggable, PageView, EPUBSpreadViewContainer { - let spread: EPUBSpread - + init(spread: EPUBSpread) { self.spread = spread super.init(frame: .zero) } - + + @available(*, unavailable) required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - + func progression(in index: ReadingOrder.Index) -> ClosedRange { // To be overridden in subclasses if the resource supports a progression. 0 ... 1 } - + func go(to location: PageLocation) async { // Custom layout resources are always fully visible so we don't use the location } diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 3028b79ac2..361203a557 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -1293,50 +1293,44 @@ extension EPUBNavigatorViewController: PaginationViewDelegate { customView.view.translatesAutoresizingMaskIntoConstraints = false customTypeSpreadContainer.addSubview(customView.view) addChild(customView) - + NSLayoutConstraint.activate([ customTypeSpreadContainer.leadingAnchor.constraint(equalTo: customView.view.leadingAnchor), customTypeSpreadContainer.trailingAnchor.constraint(equalTo: customView.view.trailingAnchor), customTypeSpreadContainer.topAnchor.constraint(equalTo: customView.view.topAnchor), customTypeSpreadContainer.bottomAnchor.constraint(equalTo: customView.view.bottomAnchor), ]) - + // handle case when only one page in spread is custom view if linksForSpread.count == 2 { - let spreadView = createSpreadView(spread: spread) if linksForSpread[0].properties.renderOptions == nil { + let spreadView = createSpreadView(spread: spread) customTypeSpreadContainer.addSubview(spreadView) NSLayoutConstraint.activate([ - customTypeSpreadContainer.leadingAnchor.constraint(equalTo: spreadView.leadingAnchor), - customTypeSpreadContainer.topAnchor.constraint(equalTo: spreadView.topAnchor), - customTypeSpreadContainer.bottomAnchor.constraint(equalTo: spreadView.bottomAnchor), - spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5) + spreadView.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), + spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), ]) } else if linksForSpread[1].properties.renderOptions == nil { + let spreadView = createSpreadView(spread: spread) customTypeSpreadContainer.addSubview(spreadView) NSLayoutConstraint.activate([ - customTypeSpreadContainer.trailingAnchor.constraint(equalTo: spreadView.trailingAnchor), - customTypeSpreadContainer.topAnchor.constraint(equalTo: spreadView.topAnchor), - customTypeSpreadContainer.bottomAnchor.constraint(equalTo: spreadView.bottomAnchor), - spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5) + spreadView.trailingAnchor.constraint(equalTo: customTypeSpreadContainer.trailingAnchor), + spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), ]) } } - -// customTypeSpreadContainer.setNeedsLayout() -// customTypeSpreadContainer.layoutIfNeeded() - - customTypeSpreadContainer.setNeedsUpdateConstraints() - return customTypeSpreadContainer } else { return createSpreadView(spread: spread) } } - - + private func createSpreadView(spread: EPUBSpread) -> EPUBSpreadView { - let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self + let spreadViewType = EPUBReflowableSpreadView.self // (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self let spreadView = spreadViewType.init( viewModel: viewModel, spread: spread, diff --git a/Sources/Navigator/EPUB/Scripts/src/index.js b/Sources/Navigator/EPUB/Scripts/src/index.js index 904c716726..a4189576b0 100644 --- a/Sources/Navigator/EPUB/Scripts/src/index.js +++ b/Sources/Navigator/EPUB/Scripts/src/index.js @@ -18,14 +18,12 @@ import { scrollToLocator, setProperty, setCSSProperties, - extractWrappedResources, } from "./utils"; import { getDecorations, registerTemplates } from "./decorator"; // Public API used by the navigator. global.readium = { // utils - extractWrappedResources: extractWrappedResources, scrollToId: scrollToId, scrollToPosition: scrollToPosition, scrollToLocator: scrollToLocator, diff --git a/Sources/Navigator/EPUB/Scripts/src/utils.js b/Sources/Navigator/EPUB/Scripts/src/utils.js index 38b8978845..3b25be58df 100644 --- a/Sources/Navigator/EPUB/Scripts/src/utils.js +++ b/Sources/Navigator/EPUB/Scripts/src/utils.js @@ -386,18 +386,3 @@ export function logError(e) { message: e.message, }); } - -export function extractWrappedResources() { - try { - var linkResource = document.querySelector("link.wrapped-resource"); - var kind = linkResource.getAttribute("kind"); - var src = linkResource.getAttribute("href"); - var payload = { - kind: kind, - src: src, - }; - webkit.messageHandlers.extractWrappedResources.postMessage(payload); - } catch (e) { - console.warn("Wrapped resource not available", e); - } -} From 6993f9389a38b364705f8a1ab28d03ac9117dd1a Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Tue, 9 Dec 2025 12:22:42 +0100 Subject: [PATCH 09/15] Update documentation --- docs/Guides/Navigator/EPUB native spread layout.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Guides/Navigator/EPUB native spread layout.md b/docs/Guides/Navigator/EPUB native spread layout.md index f3f399c1f9..987f270d8c 100644 --- a/docs/Guides/Navigator/EPUB native spread layout.md +++ b/docs/Guides/Navigator/EPUB native spread layout.md @@ -1,16 +1,16 @@ # EPUBNavigatorDelegate Readium allows rendering EPUB spine elements in a custom way (e.g. PDF is rendered using PDFKit instead of being loaded in WKWebView). -Client can add custom overlay on top of WKWebView using +Client can provide custom view for given page using ```swift -func navigator(_ navigator: EPUBNavigatorViewController, didExtractResources resources: Any, for spreadView: UIView) +func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? ``` delegate method. -In order for this method to be invoked for given ```EPUBSpreadView```, loaded XHTML resource must have ```link``` tag element inside ```head``` block. +In order for this method to be invoked for given resource/spine element must have ```properties``` attribute configured with appropriate metadata needed to able to render custom spread. ```html - + ``` -Link tag must have class set to ```wrapped-resource```. ```href``` attribute is used to identify resource registered in EPUB which client can render in custom way, and ```kind``` is arbitrary type used by client to define how given resource should be rendered. +```properties``` attribute contains document reference and custom type which are used by the client to render given resource. From 465fb26b0c2a7ca37f0713e7177798077997b27d Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Tue, 9 Dec 2025 13:39:38 +0100 Subject: [PATCH 10/15] Remove commented out code --- Sources/Navigator/EPUB/EPUBNavigatorViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 361203a557..84554f3115 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -1330,7 +1330,7 @@ extension EPUBNavigatorViewController: PaginationViewDelegate { } private func createSpreadView(spread: EPUBSpread) -> EPUBSpreadView { - let spreadViewType = EPUBReflowableSpreadView.self // (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self + let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self let spreadView = spreadViewType.init( viewModel: viewModel, spread: spread, From 0ff0cb92b378a6d36d38a9f70c6f8e39116ddc32 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Thu, 11 Dec 2025 14:05:58 +0100 Subject: [PATCH 11/15] Remove OPFParser changes --- .../EPUB/EPUBNavigatorViewController.swift | 148 +++++++++++------- Sources/Streamer/Parser/EPUB/OPFParser.swift | 14 +- 2 files changed, 91 insertions(+), 71 deletions(-) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 84554f3115..f76595231a 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -11,23 +11,6 @@ import SwiftSoup import UIKit import WebKit -public extension Properties { - struct RenderMetadata { - public let href: String - public let type: String - } - - var renderOptions: RenderMetadata? { - guard let custom = otherProperties["renderCustom"] as? [String: String], - let href = custom["document"], - let type = custom["custom-type"] - else { - return nil - } - return RenderMetadata(href: href, type: type) - } -} - @MainActor public protocol EPUBNavigatorDelegate: VisualNavigatorDelegate, SelectableNavigatorDelegate { /// Called when the viewport is updated. func navigator(_ navigator: EPUBNavigatorViewController, viewportDidChange viewport: EPUBNavigatorViewController.Viewport?) @@ -36,7 +19,7 @@ public extension Properties { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) - func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? + func navigator(_ navigator: EPUBNavigatorViewController, viewControllersForReadingOrderLinks links: [Link]) -> (left: UIViewController?, center: UIViewController?, right: UIViewController?) } public extension EPUBNavigatorDelegate { @@ -44,8 +27,8 @@ public extension EPUBNavigatorDelegate { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) {} - func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? { - nil + func navigator(_ navigator: EPUBNavigatorViewController, viewControllersForReadingOrderLinks links: [Link]) -> (left: UIViewController?, center: UIViewController?, right: UIViewController?) { + (left: nil, center: nil, right: nil) } } @@ -1286,51 +1269,18 @@ extension EPUBNavigatorViewController: PaginationViewDelegate { let linksForSpread: [Link] = spread.readingOrderIndices.map { index in publication.readingOrder[index] } - let isCustom = linksForSpread.contains(where: { $0.properties.renderOptions != nil }) - if isCustom, let customView = delegate?.navigator(self, viewForReadingOrderLinks: linksForSpread) { - let customTypeSpreadContainer = CustomTypeSpreadViewWrapper(spread: spread) - customView.view.translatesAutoresizingMaskIntoConstraints = false - customTypeSpreadContainer.addSubview(customView.view) - addChild(customView) - - NSLayoutConstraint.activate([ - customTypeSpreadContainer.leadingAnchor.constraint(equalTo: customView.view.leadingAnchor), - customTypeSpreadContainer.trailingAnchor.constraint(equalTo: customView.view.trailingAnchor), - customTypeSpreadContainer.topAnchor.constraint(equalTo: customView.view.topAnchor), - customTypeSpreadContainer.bottomAnchor.constraint(equalTo: customView.view.bottomAnchor), - ]) - - // handle case when only one page in spread is custom view - if linksForSpread.count == 2 { - if linksForSpread[0].properties.renderOptions == nil { - let spreadView = createSpreadView(spread: spread) - customTypeSpreadContainer.addSubview(spreadView) - NSLayoutConstraint.activate([ - spreadView.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), - spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), - spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), - spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), - ]) - } else if linksForSpread[1].properties.renderOptions == nil { - let spreadView = createSpreadView(spread: spread) - customTypeSpreadContainer.addSubview(spreadView) - NSLayoutConstraint.activate([ - spreadView.trailingAnchor.constraint(equalTo: customTypeSpreadContainer.trailingAnchor), - spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), - spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), - spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), - ]) - } - } - return customTypeSpreadContainer + let customVCs = delegate?.navigator(self, viewControllersForReadingOrderLinks: linksForSpread) + // at least one page in spread is custom view + if let customVCs, customVCs.left != nil || customVCs.right != nil || customVCs.center != nil { + return createCustomSpread(spread: spread, customViewControllers: customVCs, linksForSpread: linksForSpread) } else { return createSpreadView(spread: spread) } } private func createSpreadView(spread: EPUBSpread) -> EPUBSpreadView { - let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self + let spreadViewType = EPUBReflowableSpreadView.self // (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self let spreadView = spreadViewType.init( viewModel: viewModel, spread: spread, @@ -1356,3 +1306,85 @@ extension EPUBNavigatorViewController: PaginationViewDelegate { spreads[index].positionCount(in: readingOrder, positionsByReadingOrder: positionsByReadingOrder) } } + +extension EPUBNavigatorViewController { + private func createCustomSpread( + spread: EPUBSpread, + customViewControllers customVCs: (left: UIViewController?, center: UIViewController?, right: UIViewController?), + linksForSpread: [Link] + ) -> (UIView & PageView)? { + let customTypeSpreadContainer = CustomTypeSpreadViewWrapper(spread: spread) + + if let left = customVCs.left { + customTypeSpreadContainer.addSubview(left.view) + addChild(left) + NSLayoutConstraint.activate([ + left.view.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), + left.view.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + left.view.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + left.view.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), + ]) + } + + if let center = customVCs.center { + customTypeSpreadContainer.addSubview(center.view) + addChild(center) + NSLayoutConstraint.activate([ + center.view.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), + center.view.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + center.view.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + center.view.trailingAnchor.constraint(equalTo: customTypeSpreadContainer.trailingAnchor), + ]) + } + + if let right = customVCs.right { + customTypeSpreadContainer.addSubview(right.view) + addChild(right) + NSLayoutConstraint.activate([ + right.view.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), + right.view.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + right.view.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + right.view.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), + ]) + } + + // handle case when only one page in two pages spread is custom view + if linksForSpread.count == 2, customVCs.center == nil { + if customVCs.left == nil { + let spreadView = + createSpreadView( + spread: EPUBSpread( + spread: false, + readingOrderIndices: spread.readingOrderIndices.lowerBound ... spread.readingOrderIndices.lowerBound, + readingProgression: spread.readingProgression + ) + ) + customTypeSpreadContainer.addSubview(spreadView) + NSLayoutConstraint.activate([ + spreadView.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), + spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), + ]) + } else if customVCs.right == nil { + let spreadView = + createSpreadView( + spread: EPUBSpread( + spread: false, + readingOrderIndices: spread.readingOrderIndices.upperBound ... spread.readingOrderIndices.upperBound, + readingProgression: spread.readingProgression + ) + ) + customTypeSpreadContainer.addSubview(spreadView) + NSLayoutConstraint.activate([ + spreadView.trailingAnchor.constraint(equalTo: customTypeSpreadContainer.trailingAnchor), + spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), + ]) + } + } + + return customTypeSpreadContainer + } +} diff --git a/Sources/Streamer/Parser/EPUB/OPFParser.swift b/Sources/Streamer/Parser/EPUB/OPFParser.swift index c377a9ed0d..35e219ca70 100644 --- a/Sources/Streamer/Parser/EPUB/OPFParser.swift +++ b/Sources/Streamer/Parser/EPUB/OPFParser.swift @@ -234,7 +234,6 @@ final class OPFParser: Loggable { private func parseStringProperties(_ properties: [String]) -> [String: Any] { var contains: [String] = [] var page: Properties.Page? - var renderCustom: [String: Any] = [:] for property in properties { switch property { @@ -259,14 +258,7 @@ final class OPFParser: Loggable { case "page-spread-center", "rendition:page-spread-center": page = .center default: - let customProperty = property.split(separator: ":") - if customProperty.count == 2 { - let key = String(customProperty[0]) - let value = String(customProperty[1]) - renderCustom[key] = value - } else { - continue - } + continue } } @@ -278,10 +270,6 @@ final class OPFParser: Loggable { otherProperties["page"] = page.rawValue } - if !renderCustom.isEmpty { - otherProperties["renderCustom"] = renderCustom - } - return otherProperties } } From 942097e271f2dd3159cbe0e1069798ac2ec561ef Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Fri, 12 Dec 2025 11:06:02 +0100 Subject: [PATCH 12/15] Remove commented out code --- Sources/Navigator/EPUB/EPUBNavigatorViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index f76595231a..a245c9b33f 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -1280,7 +1280,7 @@ extension EPUBNavigatorViewController: PaginationViewDelegate { } private func createSpreadView(spread: EPUBSpread) -> EPUBSpreadView { - let spreadViewType = EPUBReflowableSpreadView.self // (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self + let spreadViewType = (publication.metadata.layout == .fixed) ? EPUBFixedSpreadView.self : EPUBReflowableSpreadView.self let spreadView = spreadViewType.init( viewModel: viewModel, spread: spread, From d24c5c5fc8d7f0f3dc87682e8db16c8cddd84434 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Fri, 12 Dec 2025 11:16:34 +0100 Subject: [PATCH 13/15] Update documentation --- .../Navigator/EPUB native spread layout.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/Guides/Navigator/EPUB native spread layout.md b/docs/Guides/Navigator/EPUB native spread layout.md index 987f270d8c..9f8614fb97 100644 --- a/docs/Guides/Navigator/EPUB native spread layout.md +++ b/docs/Guides/Navigator/EPUB native spread layout.md @@ -1,16 +1,14 @@ # EPUBNavigatorDelegate Readium allows rendering EPUB spine elements in a custom way (e.g. PDF is rendered using PDFKit instead of being loaded in WKWebView). -Client can provide custom view for given page using +Client can provide custom view for given spread using ```swift -func navigator(_ navigator: EPUBNavigatorViewController, viewForReadingOrderLinks links: [Link]) -> UIViewController? + func navigator(_ navigator: EPUBNavigatorViewController, viewControllersForReadingOrderLinks links: [Link]) -> (left: UIViewController?, center: UIViewController?, right: UIViewController?) ``` delegate method. + + Returned tuple contains left and right pages if spread has 2 pages. Center property is used in case spread has 1 page. + In case any of spread pages doesn't require custom view ```nil``` is returned for such page, and readium will fallback to webview rendering. -In order for this method to be invoked for given resource/spine element must have ```properties``` attribute configured with appropriate metadata needed to able to render custom spread. - -```html - -``` - -```properties``` attribute contains document reference and custom type which are used by the client to render given resource. +```links``` contains array of EPUB spine element links (if spread has 2 pages it will have 2 links, otherwise 1 link). +EPUB document could hold JSON resource which contains mapping of spine element links to metadata model needed to perform custom rendering (e.g. asset hrefs, custom view type info ...) From 056b2fb6b70a9f4d826c43129a7af48da47504f7 Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Tue, 13 Jan 2026 14:06:54 +0100 Subject: [PATCH 14/15] Add did scroll event support --- .../EPUB/EPUBNavigatorViewController.swift | 22 +++++++++++++++++++ .../EPUB/EPUBReflowableSpreadView.swift | 17 ++++++++++++++ Sources/Navigator/EPUB/EPUBSpreadView.swift | 3 +++ Sources/Navigator/VisualNavigator.swift | 18 +++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index a245c9b33f..697fc73e87 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -1231,6 +1231,12 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } } + func spreadView(_ spreadView: EPUBSpreadView, didScrollIn direction: ScrollDirection) { + if paginationView?.currentView == spreadView { + delegate?.navigator(self, didScrollIn: direction) + } + } + func spreadView(_ spreadView: EPUBSpreadView, present viewController: UIViewController) { present(viewController, animated: true) } @@ -1383,6 +1389,22 @@ extension EPUBNavigatorViewController { spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor, multiplier: 0.5), ]) } + } else { + let spreadView = + createSpreadView( + spread: EPUBSpread( + spread: false, + readingOrderIndices: spread.readingOrderIndices.lowerBound ... spread.readingOrderIndices.upperBound, + readingProgression: spread.readingProgression + ) + ) + customTypeSpreadContainer.addSubview(spreadView) + NSLayoutConstraint.activate([ + spreadView.leadingAnchor.constraint(equalTo: customTypeSpreadContainer.leadingAnchor), + spreadView.topAnchor.constraint(equalTo: customTypeSpreadContainer.topAnchor), + spreadView.bottomAnchor.constraint(equalTo: customTypeSpreadContainer.bottomAnchor), + spreadView.widthAnchor.constraint(equalTo: customTypeSpreadContainer.widthAnchor), + ]) } return customTypeSpreadContainer diff --git a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift index 24eda8d15a..d7885729b2 100644 --- a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift @@ -314,6 +314,8 @@ final class EPUBReflowableSpreadView: EPUBSpreadView { private var progression: ClosedRange? // To check if a progression change was cancelled or not. private var previousProgression: ClosedRange? + // Previous scroll offset for determining scroll direction. + private var previousScrollOffset: CGPoint? // Called by the javascript code to notify that scrolling ended. private func progressionDidChange(_ body: Any) { @@ -377,5 +379,20 @@ final class EPUBReflowableSpreadView: EPUBSpreadView { override func scrollViewDidScroll(_ scrollView: UIScrollView) { super.scrollViewDidScroll(scrollView) setNeedsNotifyPagesDidChange() + + let currentOffset = scrollView.contentOffset + if let previousOffset = previousScrollOffset { + // Determine direction based on scroll axis (vertical vs horizontal) + let direction: ScrollDirection + if viewModel.scroll, !viewModel.verticalText { + // Vertical scrolling mode + direction = currentOffset.y > previousOffset.y ? .forward : .backward + } else { + // Horizontal scrolling/pagination mode + direction = currentOffset.x > previousOffset.x ? .forward : .backward + } + delegate?.spreadView(self, didScrollIn: direction) + } + previousScrollOffset = currentOffset } } diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 530ee348af..97ea7e5834 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -30,6 +30,9 @@ protocol EPUBSpreadViewDelegate: AnyObject { /// Called when the pages visible in the spread changed. func spreadViewPagesDidChange(_ spreadView: EPUBSpreadView) + /// Called when the user scrolls through the content. + func spreadView(_ spreadView: EPUBSpreadView, didScrollIn direction: ScrollDirection) + /// Called when the spread view needs to present a view controller. func spreadView(_ spreadView: EPUBSpreadView, present viewController: UIViewController) diff --git a/Sources/Navigator/VisualNavigator.swift b/Sources/Navigator/VisualNavigator.swift index 5edc793f52..2ddbb7dbc0 100644 --- a/Sources/Navigator/VisualNavigator.swift +++ b/Sources/Navigator/VisualNavigator.swift @@ -85,6 +85,14 @@ public struct VisualNavigatorPresentation { } } +/// Direction of a scroll event. +public enum ScrollDirection { + /// Scrolling up (vertical) or left (horizontal). + case backward + /// Scrolling down (vertical) or right (horizontal). + case forward +} + @MainActor public protocol VisualNavigatorDelegate: NavigatorDelegate { /// Returns the content insets that the navigator applies to its view. /// @@ -119,6 +127,12 @@ public struct VisualNavigatorPresentation { /// Return `true` to navigate to the link, or `false` if you intend to /// present the link yourself func navigator(_ navigator: VisualNavigator, shouldNavigateToLink link: Link) -> Bool + + /// Called when the user scrolls through the content. + /// + /// - Parameter direction: The direction of the scroll (forward = down/right, + /// backward = up/left). + func navigator(_ navigator: VisualNavigator, didScrollIn direction: ScrollDirection) } public extension VisualNavigatorDelegate { @@ -145,4 +159,8 @@ public extension VisualNavigatorDelegate { func navigator(_ navigator: VisualNavigator, shouldNavigateToLink link: Link) -> Bool { true } + + func navigator(_ navigator: VisualNavigator, didScrollIn direction: ScrollDirection) { + // Optional + } } From 3ea75b5e19f766693cf8df4919862968afbe759c Mon Sep 17 00:00:00 2001 From: Leonard Beus Date: Tue, 13 Jan 2026 14:10:06 +0100 Subject: [PATCH 15/15] Fix lint warnings --- Sources/Navigator/EPUB/EPUBNavigatorViewController.swift | 2 +- Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift | 2 +- Sources/Navigator/EPUB/EPUBSpreadView.swift | 2 +- Sources/Navigator/VisualNavigator.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 697fc73e87..bf96cfb75a 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -1,5 +1,5 @@ // -// Copyright 2025 Readium Foundation. All rights reserved. +// Copyright 2026 Readium Foundation. All rights reserved. // Use of this source code is governed by the BSD-style license // available in the top-level LICENSE file of the project. // diff --git a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift index d7885729b2..1599866487 100644 --- a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift @@ -1,5 +1,5 @@ // -// Copyright 2025 Readium Foundation. All rights reserved. +// Copyright 2026 Readium Foundation. All rights reserved. // Use of this source code is governed by the BSD-style license // available in the top-level LICENSE file of the project. // diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 97ea7e5834..eb57b09195 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -1,5 +1,5 @@ // -// Copyright 2025 Readium Foundation. All rights reserved. +// Copyright 2026 Readium Foundation. All rights reserved. // Use of this source code is governed by the BSD-style license // available in the top-level LICENSE file of the project. // diff --git a/Sources/Navigator/VisualNavigator.swift b/Sources/Navigator/VisualNavigator.swift index 2ddbb7dbc0..b6f6cee347 100644 --- a/Sources/Navigator/VisualNavigator.swift +++ b/Sources/Navigator/VisualNavigator.swift @@ -1,5 +1,5 @@ // -// Copyright 2025 Readium Foundation. All rights reserved. +// Copyright 2026 Readium Foundation. All rights reserved. // Use of this source code is governed by the BSD-style license // available in the top-level LICENSE file of the project. //