diff --git a/.gitignore b/.gitignore index aa9dcb3071..bb72bb5c85 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.json.bak *node_modules* +*source-docx* \ No newline at end of file diff --git a/sdkjs-plugins/content/zotero/LICENSE b/sdkjs-plugins/content/zotero/LICENSE new file mode 100644 index 0000000000..7fc72555c9 --- /dev/null +++ b/sdkjs-plugins/content/zotero/LICENSE @@ -0,0 +1,31 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2025 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ \ No newline at end of file diff --git a/sdkjs-plugins/content/zotero/dist/bundle.es5.js b/sdkjs-plugins/content/zotero/dist/bundle.es5.js index 6c6028d553..ed39b78179 100644 --- a/sdkjs-plugins/content/zotero/dist/bundle.es5.js +++ b/sdkjs-plugins/content/zotero/dist/bundle.es5.js @@ -29,13 +29,13 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -(function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function t(e,t){this.v=e,this.k=t}function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function _(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function y(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +(function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function t(e,t){this.v=e,this.k=t}function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function _(e,t,n){return(t=j(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function y(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(){throw TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(e){for(var t=1;t3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&pr||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(T(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,T(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,T(d,`constructor`,l),T(l,`constructor`,c),c.displayName=`GeneratorFunction`,T(l,i,`GeneratorFunction`),T(d),T(d,i,`Generator`),T(d,r,function(){return this}),T(d,`toString`,function(){return`[object Generator]`}),(w=function(){return{w:a,m:f}})()}function T(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}T=function(e,t,n,r){function a(t,n){T(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},T(e,t,n,r)}function E(e,t){return r(e)||y(e,t)||j(e,t)||b()}function D(e){return i(e)||v(e)||j(e)||x()}function O(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function k(e){var t=O(e,`string`);return typeof t==`symbol`?t:t+``}function A(e){"@babel/helpers - typeof";return A=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},A(e)}function j(e,t){if(e){if(typeof e==`string`)return n(e,t);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function M(e){var n,r;function i(n,r){try{var o=e[n](r),s=o.value,c=s instanceof t;Promise.resolve(c?s.v:s).then(function(t){if(c){var r=n===`return`?`return`:`next`;if(!s.k||t.done)return i(r,t);t=e[r](t).value}a(o.done?`return`:`normal`,t)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,t){switch(e){case`return`:n.resolve({value:t,done:!0});break;case`throw`:n.reject(t);break;default:n.resolve({value:t,done:!1})}(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof e.return!=`function`&&(this.return=void 0)}M.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},M.prototype.next=function(e){return this._invoke(`next`,e)},M.prototype.throw=function(e){return this._invoke(`throw`,e)},M.prototype.return=function(e){return this._invoke(`return`,e)};var N=e(((e,t)=>{var n=function(e){return e&&e.Math===Math&&e};t.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof global==`object`&&global)||n(typeof e==`object`&&e)||(function(){return this})()||Function(`return this`)()})),P=e(((e,t)=>{t.exports=function(e){try{return!!e()}catch{return!0}}})),F=e(((e,t)=>{t.exports=!P()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})})),I=e(((e,t)=>{t.exports=!P()(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})})),L=e(((e,t)=>{var n=I(),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}})),ee=e((e=>{var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t})),te=e(((e,t)=>{t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}})),R=e(((e,t)=>{var n=I(),r=Function.prototype,i=r.call,a=n&&r.bind.bind(i,i);t.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}})),z=e(((e,t)=>{var n=R(),r=n({}.toString),i=n(``.slice);t.exports=function(e){return i(r(e),8,-1)}})),ne=e(((e,t)=>{var n=R(),r=P(),i=z(),a=Object,o=n(``.split);t.exports=r(function(){return!a(`z`).propertyIsEnumerable(0)})?function(e){return i(e)===`String`?o(e,``):a(e)}:a})),re=e(((e,t)=>{t.exports=function(e){return e==null}})),B=e(((e,t)=>{var n=re(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`Can't call method on `+e);return e}})),ie=e(((e,t)=>{var n=ne(),r=B();t.exports=function(e){return n(r(e))}})),V=e(((e,t)=>{var n=typeof document==`object`&&document.all;t.exports=n===void 0&&n!==void 0?function(e){return typeof e==`function`||e===n}:function(e){return typeof e==`function`}})),H=e(((e,t)=>{var n=V();t.exports=function(e){return typeof e==`object`?e!==null:n(e)}})),ae=e(((e,t)=>{var n=N(),r=V(),i=function(e){return r(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?i(n[e]):n[e]&&n[e][t]}})),oe=e(((e,t)=>{t.exports=R()({}.isPrototypeOf)})),se=e(((e,t)=>{var n=N().navigator,r=n&&n.userAgent;t.exports=r?String(r):``})),ce=e(((e,t)=>{var n=N(),r=se(),i=n.process,a=n.Deno,o=i&&i.versions||a&&a.version,s=o&&o.v8,c,l;s&&(c=s.split(`.`),l=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!l&&r&&(c=r.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/),c&&(l=+c[1]))),t.exports=l})),le=e(((e,t)=>{var n=ce(),r=P(),i=N().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol(`symbol detection`);return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})})),ue=e(((e,t)=>{t.exports=le()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})),de=e(((e,t)=>{var n=ae(),r=V(),i=oe(),a=ue(),o=Object;t.exports=a?function(e){return typeof e==`symbol`}:function(e){var t=n(`Symbol`);return r(t)&&i(t.prototype,o(e))}})),fe=e(((e,t)=>{var n=String;t.exports=function(e){try{return n(e)}catch{return`Object`}}})),pe=e(((e,t)=>{var n=V(),r=fe(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a function`)}})),me=e(((e,t)=>{var n=pe(),r=re();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}})),he=e(((e,t)=>{var n=L(),r=V(),i=H(),a=TypeError;t.exports=function(e,t){var o,s;if(t===`string`&&r(o=e.toString)&&!i(s=n(o,e))||r(o=e.valueOf)&&!i(s=n(o,e))||t!==`string`&&r(o=e.toString)&&!i(s=n(o,e)))return s;throw new a(`Can't convert object to primitive value`)}})),ge=e(((e,t)=>{t.exports=!1})),_e=e(((e,t)=>{var n=N(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch{n[e]=t}return t}})),ve=e(((e,t)=>{var n=ge(),r=N(),i=_e(),a=`__core-js_shared__`,o=t.exports=r[a]||i(a,{});(o.versions||=[]).push({version:`3.47.0`,mode:n?`pure`:`global`,copyright:`© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)`,license:`https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE`,source:`https://github.com/zloirock/core-js`})})),ye=e(((e,t)=>{var n=ve();t.exports=function(e,t){return n[e]||(n[e]=t||{})}})),be=e(((e,t)=>{var n=B(),r=Object;t.exports=function(e){return r(n(e))}})),U=e(((e,t)=>{var n=R(),r=be(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}})),xe=e(((e,t)=>{var n=R(),r=0,i=Math.random(),a=n(1.1.toString);t.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+a(++r+i,36)}})),W=e(((e,t)=>{var n=N(),r=ye(),i=U(),a=xe(),o=le(),s=ue(),c=n.Symbol,l=r(`wks`),u=s?c.for||c:c&&c.withoutSetter||a;t.exports=function(e){return i(l,e)||(l[e]=o&&i(c,e)?c[e]:u(`Symbol.`+e)),l[e]}})),Se=e(((e,t)=>{var n=L(),r=H(),i=de(),a=me(),o=he(),s=W(),c=TypeError,l=s(`toPrimitive`);t.exports=function(e,t){if(!r(e)||i(e))return e;var s=a(e,l),u;if(s){if(t===void 0&&(t=`default`),u=n(s,e,t),!r(u)||i(u))return u;throw new c(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),o(e,t)}})),Ce=e(((e,t)=>{var n=Se(),r=de();t.exports=function(e){var t=n(e,`string`);return r(t)?t:t+``}})),we=e(((e,t)=>{var n=N(),r=H(),i=n.document,a=r(i)&&r(i.createElement);t.exports=function(e){return a?i.createElement(e):{}}})),Te=e(((e,t)=>{var n=F(),r=P(),i=we();t.exports=!n&&!r(function(){return Object.defineProperty(i(`div`),"a",{get:function(){return 7}}).a!==7})})),Ee=e((e=>{var t=F(),n=L(),r=ee(),i=te(),a=ie(),o=Ce(),s=U(),c=Te(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=a(e),t=o(t),c)try{return l(e,t)}catch{}if(s(e,t))return i(!n(r.f,e,t),e[t])}})),De=e(((e,t)=>{var n=F(),r=P();t.exports=n&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})})),Oe=e(((e,t)=>{var n=H(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not an object`)}})),ke=e((e=>{var t=F(),n=Te(),r=De(),i=Oe(),a=Ce(),o=TypeError,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=`enumerable`,u=`configurable`,d=`writable`;e.f=t?r?function(e,t,n){if(i(e),t=a(t),i(n),typeof e==`function`&&t===`prototype`&&`value`in n&&d in n&&!n[d]){var r=c(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:u in n?n[u]:r[u],enumerable:l in n?n[l]:r[l],writable:!1})}return s(e,t,n)}:s:function(e,t,r){if(i(e),t=a(t),i(r),n)try{return s(e,t,r)}catch{}if(`get`in r||`set`in r)throw new o(`Accessors not supported`);return`value`in r&&(e[t]=r.value),e}})),Ae=e(((e,t)=>{var n=F(),r=ke(),i=te();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}})),je=e(((e,t)=>{var n=F(),r=U(),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=r(i,`name`);t.exports={EXISTS:o,PROPER:o&&(function(){}).name===`something`,CONFIGURABLE:o&&(!n||n&&a(i,`name`).configurable)}})),Me=e(((e,t)=>{var n=R(),r=V(),i=ve(),a=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),t.exports=i.inspectSource})),Ne=e(((e,t)=>{var n=N(),r=V(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))})),Pe=e(((e,t)=>{var n=ye(),r=xe(),i=n(`keys`);t.exports=function(e){return i[e]||(i[e]=r(e))}})),Fe=e(((e,t)=>{t.exports={}})),Ie=e(((e,t)=>{var n=Ne(),r=N(),i=H(),a=Ae(),o=U(),s=ve(),c=Pe(),l=Fe(),u=`Object already initialized`,d=r.TypeError,f=r.WeakMap,p,m,h,g=function(e){return h(e)?m(e):p(e,{})},_=function(e){return function(t){var n;if(!i(t)||(n=m(t)).type!==e)throw new d(`Incompatible receiver, `+e+` required`);return n}};if(n||s.state){var v=s.state||=new f;v.get=v.get,v.has=v.has,v.set=v.set,p=function(e,t){if(v.has(e))throw new d(u);return t.facade=e,v.set(e,t),t},m=function(e){return v.get(e)||{}},h=function(e){return v.has(e)}}else{var y=c(`state`);l[y]=!0,p=function(e,t){if(o(e,y))throw new d(u);return t.facade=e,a(e,y,t),t},m=function(e){return o(e,y)?e[y]:{}},h=function(e){return o(e,y)}}t.exports={set:p,get:m,has:h,enforce:g,getterFor:_}})),Le=e(((e,t)=>{var n=R(),r=P(),i=V(),a=U(),o=F(),s=je().CONFIGURABLE,c=Me(),l=Ie(),u=l.enforce,d=l.get,f=String,p=Object.defineProperty,m=n(``.slice),h=n(``.replace),g=n([].join),_=o&&!r(function(){return p(function(){},`length`,{value:8}).length!==8}),v=String(String).split(`String`),y=t.exports=function(e,t,n){m(f(t),0,7)===`Symbol(`&&(t=`[`+h(f(t),/^Symbol\(([^)]*)\).*$/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!a(e,`name`)||s&&e.name!==t)&&(o?p(e,`name`,{value:t,configurable:!0}):e.name=t),_&&n&&a(n,`arity`)&&e.length!==n.arity&&p(e,`length`,{value:n.arity});try{n&&a(n,`constructor`)&&n.constructor?o&&p(e,`prototype`,{writable:!1}):e.prototype&&=void 0}catch{}var r=u(e);return a(r,`source`)||(r.source=g(v,typeof t==`string`?t:``)),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||c(this)},`toString`)})),Re=e(((e,t)=>{var n=V(),r=ke(),i=Le(),a=_e();t.exports=function(e,t,o,s){s||={};var c=s.enumerable,l=s.name===void 0?t:s.name;if(n(o)&&i(o,l,s),s.global)c?e[t]=o:a(t,o);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch{}c?e[t]=o:r.f(e,t,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}})),ze=e(((e,t)=>{var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}})),Be=e(((e,t)=>{var n=ze();t.exports=function(e){var t=+e;return t!==t||t===0?0:n(t)}})),Ve=e(((e,t)=>{var n=Be(),r=Math.max,i=Math.min;t.exports=function(e,t){var a=n(e);return a<0?r(a+t,0):i(a,t)}})),He=e(((e,t)=>{var n=Be(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}})),Ue=e(((e,t)=>{var n=He();t.exports=function(e){return n(e.length)}})),We=e(((e,t)=>{var n=ie(),r=Ve(),i=Ue(),a=function(e){return function(t,a,o){var s=n(t),c=i(s);if(c===0)return!e&&-1;var l=r(o,c),u;if(e&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===a)return e||l||0;return!e&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}})),Ge=e(((e,t)=>{var n=R(),r=U(),i=ie(),a=We().indexOf,o=Fe(),s=n([].push);t.exports=function(e,t){var n=i(e),c=0,l=[],u;for(u in n)!r(o,u)&&r(n,u)&&s(l,u);for(;t.length>c;)r(n,u=t[c++])&&(~a(l,u)||s(l,u));return l}})),Ke=e(((e,t)=>{t.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]})),qe=e((e=>{var t=Ge(),n=Ke().concat(`length`,`prototype`);e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}})),Je=e((e=>{e.f=Object.getOwnPropertySymbols})),Ye=e(((e,t)=>{var n=ae(),r=R(),i=qe(),a=Je(),o=Oe(),s=r([].concat);t.exports=n(`Reflect`,`ownKeys`)||function(e){var t=i.f(o(e)),n=a.f;return n?s(t,n(e)):t}})),Xe=e(((e,t)=>{var n=U(),r=Ye(),i=Ee(),a=ke();t.exports=function(e,t,o){for(var s=r(t),c=a.f,l=i.f,u=0;u{var n=P(),r=V(),i=/#|\.prototype\./,a=function(e,t){var i=s[o(e)];return i===l?!0:i===c?!1:r(t)?n(t):!!t},o=a.normalize=function(e){return String(e).replace(i,`.`).toLowerCase()},s=a.data={},c=a.NATIVE=`N`,l=a.POLYFILL=`P`;t.exports=a})),G=e(((e,t)=>{var n=N(),r=Ee().f,i=Ae(),a=Re(),o=_e(),s=Xe(),c=Ze();t.exports=function(e,t){var l=e.target,u=e.global,d=e.stat,f,p=u?n:d?n[l]||o(l,{}):n[l]&&n[l].prototype,m,h,g,_;if(p)for(m in t){if(g=t[m],e.dontCallGetSet?(_=r(p,m),h=_&&_.value):h=p[m],f=c(u?m:l+(d?`.`:`#`)+m,e.forced),!f&&h!==void 0){if(typeof g==typeof h)continue;s(g,h)}(e.sham||h&&h.sham)&&i(g,`sham`,!0),a(p,m,g,e)}}})),Qe=e(((e,t)=>{var n=z(),r=R();t.exports=function(e){if(n(e)===`Function`)return r(e)}})),$e=e(((e,t)=>{var n=Qe(),r=pe(),i=I(),a=n(n.bind);t.exports=function(e,t){return r(e),t===void 0?e:i?a(e,t):function(){return e.apply(t,arguments)}}})),et=e(((e,t)=>{var n=z();t.exports=Array.isArray||function(e){return n(e)===`Array`}})),tt=e(((e,t)=>{var n=W()(`toStringTag`),r={};r[n]=`z`,t.exports=String(r)===`[object z]`})),nt=e(((e,t)=>{var n=tt(),r=V(),i=z(),a=W()(`toStringTag`),o=Object,s=i(function(){return arguments}())===`Arguments`,c=function(e,t){try{return e[t]}catch{}};t.exports=n?i:function(e){var t,n,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=c(t=o(e),a))==`string`?n:s?i(t):(l=i(t))===`Object`&&r(t.callee)?`Arguments`:l}})),rt=e(((e,t)=>{var n=R(),r=P(),i=V(),a=nt(),o=ae(),s=Me(),c=function(){},l=o(`Reflect`,`construct`),u=/^\s*(?:class|function)\b/,d=n(u.exec),f=!u.test(c),p=function(e){if(!i(e))return!1;try{return l(c,[],e),!0}catch{return!1}},m=function(e){if(!i(e))return!1;switch(a(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return f||!!d(u,s(e))}catch{return!0}};m.sham=!0,t.exports=!l||r(function(){var e;return p(p.call)||!p(Object)||!p(function(){e=!0})||e})?m:p})),it=e(((e,t)=>{var n=et(),r=rt(),i=H(),a=W()(`species`),o=Array;t.exports=function(e){var t;return n(e)&&(t=e.constructor,r(t)&&(t===o||n(t.prototype))?t=void 0:i(t)&&(t=t[a],t===null&&(t=void 0))),t===void 0?o:t}})),at=e(((e,t)=>{var n=it();t.exports=function(e,t){return new(n(e))(t===0?0:t)}})),ot=e(((e,t)=>{var n=$e(),r=R(),i=ne(),a=be(),o=Ue(),s=at(),c=r([].push),l=function(e){var t=e===1,r=e===2,l=e===3,u=e===4,d=e===6,f=e===7,p=e===5||d;return function(m,h,g,_){for(var v=a(m),y=i(v),b=o(y),x=n(h,g),S=0,C=_||s,w=t?C(m,b):r||f?C(m,0):void 0,T,E;b>S;S++)if((p||S in y)&&(T=y[S],E=x(T,S,v),e))if(t)w[S]=E;else if(E)switch(e){case 3:return!0;case 5:return T;case 6:return S;case 2:c(w,T)}else switch(e){case 4:return!1;case 7:c(w,T)}return d?-1:l||u?u:w}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}})),st=e(((e,t)=>{var n=P(),r=W(),i=ce(),a=r(`species`);t.exports=function(e){return i>=51||!n(function(){var t=[],n=t.constructor={};return n[a]=function(){return{foo:1}},t[e](Boolean).foo!==1})}})),ct=e((()=>{var e=G(),t=ot().filter;e({target:`Array`,proto:!0,forced:!st()(`filter`)},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),lt=e(((e,t)=>{var n=Ge(),r=Ke();t.exports=Object.keys||function(e){return n(e,r)}})),ut=e((e=>{var t=F(),n=De(),r=ke(),i=Oe(),a=ie(),o=lt();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n=a(t),s=o(t),c=s.length,l=0,u;c>l;)r.f(e,u=s[l++],n[u]);return e}})),dt=e(((e,t)=>{t.exports=ae()(`document`,`documentElement`)})),ft=e(((e,t)=>{var n=Oe(),r=ut(),i=Ke(),a=Fe(),o=dt(),s=we(),c=Pe(),l=`>`,u=`<`,d=`prototype`,f=`script`,p=c(`IE_PROTO`),m=function(){},h=function(e){return u+f+l+e+u+`/`+f+l},g=function(e){e.write(h(``)),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){var e=s(`iframe`),t=`java`+f+`:`,n;return e.style.display=`none`,o.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(h(`document.F=Object`)),n.close(),n.F},v,y=function(){try{v=new ActiveXObject(`htmlfile`)}catch{}y=typeof document<`u`?document.domain&&v?g(v):_():g(v);for(var e=i.length;e--;)delete y[d][i[e]];return y()};a[p]=!0,t.exports=Object.create||function(e,t){var i;return e===null?i=y():(m[d]=n(e),i=new m,m[d]=null,i[p]=e),t===void 0?i:r.f(i,t)}})),pt=e(((e,t)=>{var n=W(),r=ft(),i=ke().f,a=n(`unscopables`),o=Array.prototype;o[a]===void 0&&i(o,a,{configurable:!0,value:r(null)}),t.exports=function(e){o[a][e]=!0}})),mt=e((()=>{var e=G(),t=We().includes,n=P(),r=pt();e({target:`Array`,proto:!0,forced:n(function(){return![,].includes()})},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r(`includes`)})),ht=e(((e,t)=>{t.exports={}})),gt=e(((e,t)=>{t.exports=!P()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})})),_t=e(((e,t)=>{var n=U(),r=V(),i=be(),a=Pe(),o=gt(),s=a(`IE_PROTO`),c=Object,l=c.prototype;t.exports=o?c.getPrototypeOf:function(e){var t=i(e);if(n(t,s))return t[s];var a=t.constructor;return r(a)&&t instanceof a?a.prototype:t instanceof c?l:null}})),vt=e(((e,t)=>{var n=P(),r=V(),i=H(),a=ft(),o=_t(),s=Re(),c=W(),l=ge(),u=c(`iterator`),d=!1,f,p,m;[].keys&&(m=[].keys(),`next`in m?(p=o(o(m)),p!==Object.prototype&&(f=p)):d=!0),!i(f)||n(function(){var e={};return f[u].call(e)!==e})?f={}:l&&(f=a(f)),r(f[u])||s(f,u,function(){return this}),t.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:d}})),yt=e(((e,t)=>{var n=ke().f,r=U(),i=W()(`toStringTag`);t.exports=function(e,t,a){e&&!a&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}})),bt=e(((e,t)=>{var n=vt().IteratorPrototype,r=ft(),i=te(),a=yt(),o=ht(),s=function(){return this};t.exports=function(e,t,c,l){var u=t+` Iterator`;return e.prototype=r(n,{next:i(+!l,c)}),a(e,u,!1,!0),o[u]=s,e}})),xt=e(((e,t)=>{var n=R(),r=pe();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch{}}})),St=e(((e,t)=>{var n=H();t.exports=function(e){return n(e)||e===null}})),Ct=e(((e,t)=>{var n=St(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(`Can't set `+r(e)+` as a prototype`)}})),wt=e(((e,t)=>{var n=xt(),r=H(),i=B(),a=Ct();t.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},o;try{o=n(Object.prototype,`__proto__`,`set`),o(t,[]),e=t instanceof Array}catch{}return function(t,n){return i(t),a(n),r(t)&&(e?o(t,n):t.__proto__=n),t}}():void 0)})),Tt=e(((e,t)=>{var n=G(),r=L(),i=ge(),a=je(),o=V(),s=bt(),c=_t(),l=wt(),u=yt(),d=Ae(),f=Re(),p=W(),m=ht(),h=vt(),g=a.PROPER,_=a.CONFIGURABLE,v=h.IteratorPrototype,y=h.BUGGY_SAFARI_ITERATORS,b=p(`iterator`),x=`keys`,S=`values`,C=`entries`,w=function(){return this};t.exports=function(e,t,a,p,h,T,E){s(a,t,p);var D=function(e){if(e===h&&M)return M;if(!y&&e&&e in A)return A[e];switch(e){case x:return function(){return new a(this,e)};case S:return function(){return new a(this,e)};case C:return function(){return new a(this,e)}}return function(){return new a(this)}},O=t+` Iterator`,k=!1,A=e.prototype,j=A[b]||A[`@@iterator`]||h&&A[h],M=!y&&j||D(h),N=t===`Array`&&A.entries||j,P,F,I;if(N&&(P=c(N.call(new e)),P!==Object.prototype&&P.next&&(!i&&c(P)!==v&&(l?l(P,v):o(P[b])||f(P,b,w)),u(P,O,!0,!0),i&&(m[O]=w))),g&&h===S&&j&&j.name!==S&&(!i&&_?d(A,`name`,S):(k=!0,M=function(){return r(j,this)})),h)if(F={values:D(S),keys:T?M:D(x),entries:D(C)},E)for(I in F)(y||k||!(I in A))&&f(A,I,F[I]);else n({target:t,proto:!0,forced:y||k},F);return(!i||E)&&A[b]!==M&&f(A,b,M,{name:h}),m[t]=M,F}})),Et=e(((e,t)=>{t.exports=function(e,t){return{value:e,done:t}}})),Dt=e(((e,t)=>{var n=ie(),r=pt(),i=ht(),a=Ie(),o=ke().f,s=Tt(),c=Et(),l=ge(),u=F(),d=`Array Iterator`,f=a.set,p=a.getterFor(d);t.exports=s(Array,`Array`,function(e,t){f(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case`keys`:return c(n,!1);case`values`:return c(t[n],!1)}return c([n,t[n]],!1)},`values`);var m=i.Arguments=i.Array;if(r(`keys`),r(`values`),r(`entries`),!l&&u&&m.name!==`values`)try{o(m,`name`,{value:`values`})}catch{}})),Ot=e(((e,t)=>{var n=P();t.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){return 1},1)})}})),kt=e((()=>{var e=G(),t=R(),n=ne(),r=ie(),i=Ot(),a=t([].join);e({target:`Array`,proto:!0,forced:n!==Object||!i(`join`,`,`)},{join:function(e){return a(r(this),e===void 0?`,`:e)}})})),At=e((()=>{var e=G(),t=ot().map;e({target:`Array`,proto:!0,forced:!st()(`map`)},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),jt=e(((e,t)=>{var n=Le(),r=ke();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}})),Mt=e((()=>{var e=F(),t=je().EXISTS,n=R(),r=jt(),i=Function.prototype,a=n(i.toString),o=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=n(o.exec);e&&!t&&r(i,`name`,{configurable:!0,get:function(){try{return s(o,a(this))[1]}catch{return``}}})})),Nt=e((()=>{var e=G(),t=be(),n=lt();e({target:`Object`,stat:!0,forced:P()(function(){n(1)})},{keys:function(e){return n(t(e))}})})),Pt=e(((e,t)=>{var n=tt(),r=nt();t.exports=n?{}.toString:function(){return`[object `+r(this)+`]`}})),Ft=e((()=>{var e=tt(),t=Re(),n=Pt();e||t(Object.prototype,`toString`,n,{unsafe:!0})})),It=e(((e,t)=>{var n=N(),r=se(),i=z(),a=function(e){return r.slice(0,e.length)===e};t.exports=(function(){return a(`Bun/`)?`BUN`:a(`Cloudflare-Workers`)?`CLOUDFLARE`:a(`Deno/`)?`DENO`:a(`Node.js/`)?`NODE`:n.Bun&&typeof Bun.version==`string`?`BUN`:n.Deno&&typeof Deno.version==`object`?`DENO`:i(n.process)===`process`?`NODE`:n.window&&n.document?`BROWSER`:`REST`})()})),Lt=e(((e,t)=>{t.exports=It()===`NODE`})),Rt=e(((e,t)=>{t.exports=N()})),zt=e(((e,t)=>{var n=ae(),r=jt(),i=W(),a=F(),o=i(`species`);t.exports=function(e){var t=n(e);a&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}})),Bt=e(((e,t)=>{var n=oe(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r(`Incorrect invocation`)}})),Vt=e(((e,t)=>{var n=rt(),r=fe(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a constructor`)}})),Ht=e(((e,t)=>{var n=Oe(),r=Vt(),i=re(),a=W()(`species`);t.exports=function(e,t){var o=n(e).constructor,s;return o===void 0||i(s=n(o)[a])?t:r(s)}})),Ut=e(((e,t)=>{var n=I(),r=Function.prototype,i=r.apply,a=r.call;t.exports=typeof Reflect==`object`&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})})),Wt=e(((e,t)=>{t.exports=R()([].slice)})),Gt=e(((e,t)=>{var n=TypeError;t.exports=function(e,t){if(e{var n=se();t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)})),qt=e(((e,t)=>{var n=N(),r=Ut(),i=$e(),a=V(),o=U(),s=P(),c=dt(),l=Wt(),u=we(),d=Gt(),f=Kt(),p=Lt(),m=n.setImmediate,h=n.clearImmediate,g=n.process,_=n.Dispatch,v=n.Function,y=n.MessageChannel,b=n.String,x=0,S={},C=`onreadystatechange`,w,T,E,D;s(function(){w=n.location});var O=function(e){if(o(S,e)){var t=S[e];delete S[e],t()}},k=function(e){return function(){O(e)}},A=function(e){O(e.data)},j=function(e){n.postMessage(b(e),w.protocol+`//`+w.host)};(!m||!h)&&(m=function(e){d(arguments.length,1);var t=a(e)?e:v(e),n=l(arguments,1);return S[++x]=function(){r(t,void 0,n)},T(x),x},h=function(e){delete S[e]},p?T=function(e){g.nextTick(k(e))}:_&&_.now?T=function(e){_.now(k(e))}:y&&!f?(E=new y,D=E.port2,E.port1.onmessage=A,T=i(D.postMessage,D)):n.addEventListener&&a(n.postMessage)&&!n.importScripts&&w&&w.protocol!==`file:`&&!s(j)?(T=j,n.addEventListener(`message`,A,!1)):T=C in u(`script`)?function(e){c.appendChild(u(`script`))[C]=function(){c.removeChild(this),O(e)}}:function(e){setTimeout(k(e),0)}),t.exports={set:m,clear:h}})),Jt=e(((e,t)=>{var n=N(),r=F(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(n,e);return t&&t.value}})),Yt=e(((e,t)=>{var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}},t.exports=n})),Xt=e(((e,t)=>{var n=se();t.exports=/ipad|iphone|ipod/i.test(n)&&typeof Pebble<`u`})),Zt=e(((e,t)=>{var n=se();t.exports=/web0s(?!.*chrome)/i.test(n)})),Qt=e(((e,t)=>{var n=N(),r=Jt(),i=$e(),a=qt().set,o=Yt(),s=Kt(),c=Xt(),l=Zt(),u=Lt(),d=n.MutationObserver||n.WebKitMutationObserver,f=n.document,p=n.process,m=n.Promise,h=r(`queueMicrotask`),g,_,v,y,b;if(!h){var x=new o,S=function(){var e,t;for(u&&(e=p.domain)&&e.exit();t=x.get();)try{t()}catch(e){throw x.head&&g(),e}e&&e.enter()};!s&&!u&&!l&&d&&f?(_=!0,v=f.createTextNode(``),new d(S).observe(v,{characterData:!0}),g=function(){v.data=_=!_}):!c&&m&&m.resolve?(y=m.resolve(void 0),y.constructor=m,b=i(y.then,y),g=function(){b(S)}):u?g=function(){p.nextTick(S)}:(a=i(a,n),g=function(){a(S)}),h=function(e){x.head||g(),x.add(e)}}t.exports=h})),$t=e(((e,t)=>{t.exports=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}}})),en=e(((e,t)=>{t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}})),tn=e(((e,t)=>{t.exports=N().Promise})),nn=e(((e,t)=>{var n=N(),r=tn(),i=V(),a=Ze(),o=Me(),s=W(),c=It(),l=ge(),u=ce(),d=r&&r.prototype,f=s(`species`),p=!1,m=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:a(`Promise`,function(){var e=o(r),t=e!==String(r);if(!t&&u===66||l&&!(d.catch&&d.finally))return!0;if(!u||u<51||!/native code/.test(e)){var n=new r(function(e){e(1)}),i=function(e){e(function(){},function(){})},a=n.constructor={};if(a[f]=i,p=n.then(function(){})instanceof i,!p)return!0}return!t&&(c===`BROWSER`||c===`DENO`)&&!m}),REJECTION_EVENT:m,SUBCLASSING:p}})),rn=e(((e,t)=>{var n=pe(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(t!==void 0||i!==void 0)throw new r(`Bad Promise constructor`);t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}})),an=e((()=>{var e=G(),t=ge(),n=Lt(),r=N(),i=Rt(),a=L(),o=Re(),s=wt(),c=yt(),l=zt(),u=pe(),d=V(),f=H(),p=Bt(),m=Ht(),h=qt().set,g=Qt(),_=$t(),v=en(),y=Yt(),b=Ie(),x=tn(),S=nn(),C=rn(),w=`Promise`,T=S.CONSTRUCTOR,E=S.REJECTION_EVENT,D=S.SUBCLASSING,O=b.getterFor(w),k=b.set,A=x&&x.prototype,j=x,M=A,P=r.TypeError,F=r.document,I=r.process,ee=C.f,te=ee,R=!!(F&&F.createEvent&&r.dispatchEvent),z=`unhandledrejection`,ne=`rejectionhandled`,re=0,B=1,ie=2,ae=1,oe=2,se,ce,le,ue,de=function(e){var t;return f(e)&&d(t=e.then)?t:!1},fe=function(e,t){var n=t.value,r=t.state===B,i=r?e.ok:e.fail,o=e.resolve,s=e.reject,c=e.domain,l,u,d;try{i?(r||(t.rejection===oe&&ye(t),t.rejection=ae),i===!0?l=n:(c&&c.enter(),l=i(n),c&&(c.exit(),d=!0)),l===e.promise?s(new P(`Promise-chain cycle`)):(u=de(l))?a(u,l,o,s):o(l)):s(n)}catch(e){c&&!d&&c.exit(),s(e)}},me=function(e,t){e.notified||(e.notified=!0,g(function(){for(var n=e.reactions,r;r=n.get();)fe(r,e);e.notified=!1,t&&!e.rejection&&_e(e)}))},he=function(e,t,n){var i,a;R?(i=F.createEvent(`Event`),i.promise=t,i.reason=n,i.initEvent(e,!1,!0),r.dispatchEvent(i)):i={promise:t,reason:n},!E&&(a=r[`on`+e])?a(i):e===z&&_(`Unhandled promise rejection`,n)},_e=function(e){a(h,r,function(){var t=e.facade,r=e.value,i=ve(e),a;if(i&&(a=v(function(){n?I.emit(`unhandledRejection`,r,t):he(z,t,r)}),e.rejection=n||ve(e)?oe:ae,a.error))throw a.value})},ve=function(e){return e.rejection!==ae&&!e.parent},ye=function(e){a(h,r,function(){var t=e.facade;n?I.emit(`rejectionHandled`,t):he(ne,t,e.value)})},be=function(e,t,n){return function(r){e(t,r,n)}},U=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=ie,me(e,!0))},xe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new P(`Promise can't be resolved itself`);var r=de(t);r?g(function(){var n={done:!1};try{a(r,t,be(xe,n,e),be(U,n,e))}catch(t){U(n,t,e)}}):(e.value=t,e.state=B,me(e,!1))}catch(t){U({done:!1},t,e)}}};if(T&&(j=function(e){p(this,M),u(e),a(se,this);var t=O(this);try{e(be(xe,t),be(U,t))}catch(e){U(t,e)}},M=j.prototype,se=function(e){k(this,{type:w,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:re,value:null})},se.prototype=o(M,`then`,function(e,t){var r=O(this),i=ee(m(this,j));return r.parent=!0,i.ok=d(e)?e:!0,i.fail=d(t)&&t,i.domain=n?I.domain:void 0,r.state===re?r.reactions.add(i):g(function(){fe(i,r)}),i.promise}),ce=function(){var e=new se,t=O(e);this.promise=e,this.resolve=be(xe,t),this.reject=be(U,t)},C.f=ee=function(e){return e===j||e===le?new ce(e):te(e)},!t&&d(x)&&A!==Object.prototype)){ue=A.then,D||o(A,`then`,function(e,t){var n=this;return new j(function(e,t){a(ue,n,e,t)}).then(e,t)},{unsafe:!0});try{delete A.constructor}catch{}s&&s(A,M)}e({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:j}),le=i.Promise,c(j,w,!1,!0),l(w)})),on=e(((e,t)=>{var n=W(),r=ht(),i=n(`iterator`),a=Array.prototype;t.exports=function(e){return e!==void 0&&(r.Array===e||a[i]===e)}})),sn=e(((e,t)=>{var n=nt(),r=me(),i=re(),a=ht(),o=W()(`iterator`);t.exports=function(e){if(!i(e))return r(e,o)||r(e,`@@iterator`)||a[n(e)]}})),cn=e(((e,t)=>{var n=L(),r=pe(),i=Oe(),a=fe(),o=sn(),s=TypeError;t.exports=function(e,t){var c=arguments.length<2?o(e):t;if(r(c))return i(n(c,e));throw new s(a(e)+` is not iterable`)}})),ln=e(((e,t)=>{var n=L(),r=Oe(),i=me();t.exports=function(e,t,a){var o,s;r(e);try{if(o=i(e,`return`),!o){if(t===`throw`)throw a;return a}o=n(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw a;if(s)throw o;return r(o),a}})),un=e(((e,t)=>{var n=$e(),r=L(),i=Oe(),a=fe(),o=on(),s=Ue(),c=oe(),l=cn(),u=sn(),d=ln(),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},m=p.prototype;t.exports=function(e,t,h){var g=h&&h.that,_=!!(h&&h.AS_ENTRIES),v=!!(h&&h.IS_RECORD),y=!!(h&&h.IS_ITERATOR),b=!!(h&&h.INTERRUPTED),x=n(t,g),S,C,w,T,E,D,O,k=function(e){return S&&d(S,`normal`),new p(!0,e)},A=function(e){return _?(i(e),b?x(e[0],e[1],k):x(e[0],e[1])):b?x(e,k):x(e)};if(v)S=e.iterator;else if(y)S=e;else{if(C=u(e),!C)throw new f(a(e)+` is not iterable`);if(o(C)){for(w=0,T=s(e);T>w;w++)if(E=A(e[w]),E&&c(m,E))return E;return new p(!1)}S=l(e,C)}for(D=v?e.next:S.next;!(O=r(D,S)).done;){try{E=A(O.value)}catch(e){d(S,`throw`,e)}if(typeof E==`object`&&E&&c(m,E))return E}return new p(!1)}})),dn=e(((e,t)=>{var n=W()(`iterator`),r=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch{}t.exports=function(e,t){try{if(!t&&!r)return!1}catch{return!1}var i=!1;try{var a={};a[n]=function(){return{next:function(){return{done:i=!0}}}},e(a)}catch{}return i}})),fn=e(((e,t)=>{var n=tn(),r=dn();t.exports=nn().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})})),pn=e((()=>{var e=G(),t=L(),n=pe(),r=rn(),i=en(),a=un();e({target:`Promise`,stat:!0,forced:fn()},{all:function(e){var o=this,s=r.f(o),c=s.resolve,l=s.reject,u=i(function(){var r=n(o.resolve),i=[],s=0,u=1;a(e,function(e){var n=s++,a=!1;u++,t(r,o,e).then(function(e){a||(a=!0,i[n]=e,--u||c(i))},l)}),--u||c(i)});return u.error&&l(u.value),s.promise}})})),mn=e((()=>{var e=G(),t=ge(),n=nn().CONSTRUCTOR,r=tn(),i=ae(),a=V(),o=Re(),s=r&&r.prototype;if(e({target:`Promise`,proto:!0,forced:n,real:!0},{catch:function(e){return this.then(void 0,e)}}),!t&&a(r)){var c=i(`Promise`).prototype.catch;s.catch!==c&&o(s,`catch`,c,{unsafe:!0})}})),hn=e((()=>{var e=G(),t=L(),n=pe(),r=rn(),i=en(),a=un();e({target:`Promise`,stat:!0,forced:fn()},{race:function(e){var o=this,s=r.f(o),c=s.reject,l=i(function(){var r=n(o.resolve);a(e,function(e){t(r,o,e).then(s.resolve,c)})});return l.error&&c(l.value),s.promise}})})),gn=e((()=>{var e=G(),t=rn(),n=nn().CONSTRUCTOR;e({target:`Promise`,stat:!0,forced:n},{reject:function(e){var n=t.f(this),r=n.reject;return r(e),n.promise}})})),_n=e(((e,t)=>{var n=Oe(),r=H(),i=rn();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var a=i.f(e),o=a.resolve;return o(t),a.promise}})),vn=e((()=>{var e=G(),t=ae(),n=ge(),r=tn(),i=nn().CONSTRUCTOR,a=_n(),o=t(`Promise`),s=n&&!i;e({target:`Promise`,stat:!0,forced:n||i},{resolve:function(e){return a(s&&this===o?r:this,e)}})})),yn=e((()=>{an(),pn(),mn(),hn(),gn(),vn()})),bn=e((()=>{var e=G(),t=ge(),n=tn(),r=P(),i=ae(),a=V(),o=Ht(),s=_n(),c=Re(),l=n&&n.prototype;if(e({target:`Promise`,proto:!0,real:!0,forced:!!n&&r(function(){l.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=o(this,i(`Promise`)),n=a(e);return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}}),!t&&a(n)){var u=i(`Promise`).prototype.finally;l.finally!==u&&c(l,`finally`,u,{unsafe:!0})}})),xn=e(((e,t)=>{var n=nt(),r=String;t.exports=function(e){if(n(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return r(e)}})),Sn=e(((e,t)=>{var n=Oe();t.exports=function(){var e=n(this),t=``;return e.hasIndices&&(t+=`d`),e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),e.dotAll&&(t+=`s`),e.unicode&&(t+=`u`),e.unicodeSets&&(t+=`v`),e.sticky&&(t+=`y`),t}})),Cn=e(((e,t)=>{var n=P(),r=N().RegExp,i=n(function(){var e=r(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!==null}),a=i||n(function(){return!r(`a`,`y`).sticky});t.exports={BROKEN_CARET:i||n(function(){var e=r(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!==null}),MISSED_STICKY:a,UNSUPPORTED_Y:i}})),wn=e(((e,t)=>{var n=P(),r=N().RegExp;t.exports=n(function(){var e=r(`.`,`s`);return!(e.dotAll&&e.test(` -`)&&e.flags===`s`)})})),Tn=e(((e,t)=>{var n=P(),r=N().RegExp;t.exports=n(function(){var e=r(`(?b)`,`g`);return e.exec(`b`).groups.a!==`b`||`b`.replace(e,`$c`)!==`bc`})})),En=e(((e,t)=>{var n=L(),r=R(),i=xn(),a=Sn(),o=Cn(),s=ye(),c=ft(),l=Ie().get,u=wn(),d=Tn(),f=s(`native-string-replace`,String.prototype.replace),p=RegExp.prototype.exec,m=p,h=r(``.charAt),g=r(``.indexOf),_=r(``.replace),v=r(``.slice),y=(function(){var e=/a/,t=/b*/g;return n(p,e,`a`),n(p,t,`a`),e.lastIndex!==0||t.lastIndex!==0})(),b=o.BROKEN_CARET,x=/()??/.exec(``)[1]!==void 0;(y||x||b||u||d)&&(m=function(e){var t=this,r=l(t),o=i(e),s=r.raw,u,d,S,C,w,T,E;if(s)return s.lastIndex=t.lastIndex,u=n(m,s,o),t.lastIndex=s.lastIndex,u;var D=r.groups,O=b&&t.sticky,k=n(a,t),A=t.source,j=0,M=o;if(O&&(k=_(k,`y`,``),g(k,`g`)===-1&&(k+=`g`),M=v(o,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&h(o,t.lastIndex-1)!==` -`)&&(A=`(?: `+A+`)`,M=` `+M,j++),d=RegExp(`^(?:`+A+`)`,k)),x&&(d=RegExp(`^`+A+`$(?!\\s)`,k)),y&&(S=t.lastIndex),C=n(p,O?d:t,M),O?C?(C.input=v(C.input,j),C[0]=v(C[0],j),C.index=t.lastIndex,t.lastIndex+=C[0].length):t.lastIndex=0:y&&C&&(t.lastIndex=t.global?C.index+C[0].length:S),x&&C&&C.length>1&&n(f,C[0],d,function(){for(w=1;w{var e=G(),t=En();e({target:`RegExp`,proto:!0,forced:/./.exec!==t},{exec:t})})),On=e(((e,t)=>{var n=R(),r=Be(),i=xn(),a=B(),o=n(``.charAt),s=n(``.charCodeAt),c=n(``.slice),l=function(e){return function(t,n){var l=i(a(t)),u=r(n),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=s(l,u),f<55296||f>56319||u+1===d||(p=s(l,u+1))<56320||p>57343?e?o(l,u):f:e?c(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};t.exports={codeAt:l(!1),charAt:l(!0)}})),kn=e((()=>{var e=On().charAt,t=xn(),n=Ie(),r=Tt(),i=Et(),a=`String Iterator`,o=n.set,s=n.getterFor(a);r(String,`String`,function(e){o(this,{type:a,string:t(e),index:0})},function(){var t=s(this),n=t.string,r=t.index,a;return r>=n.length?i(void 0,!0):(a=e(n,r),t.index+=a.length,i(a,!1))})})),An=e(((e,t)=>{Dn();var n=L(),r=Re(),i=En(),a=P(),o=W(),s=Ae(),c=o(`species`),l=RegExp.prototype;t.exports=function(e,t,u,d){var f=o(e),p=!a(function(){var t={};return t[f]=function(){return 7},``[e](t)!==7}),m=p&&!a(function(){var t=!1,n=/a/;if(e===`split`){var r={};r[c]=function(){return n},n={constructor:r,flags:``},n[f]=/./[f]}return n.exec=function(){return t=!0,null},n[f](``),!t});if(!p||!m||u){var h=/./[f],g=t(f,``[e],function(e,t,r,a,o){var s=t.exec;return s===i||s===l.exec?p&&!o?{done:!0,value:n(h,t,r,a)}:{done:!0,value:n(e,r,t,a)}:{done:!1}});r(String.prototype,e,g[0]),r(l,f,g[1])}d&&s(l[f],`sham`,!0)}})),jn=e(((e,t)=>{var n=On().charAt;t.exports=function(e,t,r){return t+(r?n(e,t).length:1)}})),Mn=e(((e,t)=>{var n=R(),r=be(),i=Math.floor,a=n(``.charAt),o=n(``.replace),s=n(``.slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,n,u,d,f){var p=n+e.length,m=u.length,h=l;return d!==void 0&&(d=r(d),h=c),o(f,h,function(r,o){var c;switch(a(o,0)){case`$`:return`$`;case`&`:return e;case"`":return s(t,0,n);case`'`:return s(t,p);case`<`:c=d[s(o,1,-1)];break;default:var l=+o;if(l===0)return r;if(l>m){var f=i(l/10);return f===0?r:f<=m?u[f-1]===void 0?a(o,1):u[f-1]+a(o,1):r}c=u[l-1]}return c===void 0?``:c})}})),Nn=e(((e,t)=>{var n=N(),r=P(),i=n.RegExp;t.exports={correct:!r(function(){var e=!0;try{i(`.`,`d`)}catch{e=!1}var t={},n=``,r=e?`dgimsy`:`gimsy`,a=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},o={dotAll:`s`,global:`g`,ignoreCase:`i`,multiline:`m`,sticky:`y`};for(var s in e&&(o.hasIndices=`d`),o)a(s,o[s]);return Object.getOwnPropertyDescriptor(i.prototype,`flags`).get.call(t)!==r||n!==r})}})),Pn=e(((e,t)=>{var n=L(),r=U(),i=oe(),a=Nn(),o=Sn(),s=RegExp.prototype;t.exports=a.correct?function(e){return e.flags}:function(e){return!a.correct&&i(s,e)&&!r(e,`flags`)?n(o,e):e.flags}})),Fn=e(((e,t)=>{var n=L(),r=Oe(),i=V(),a=z(),o=En(),s=TypeError;t.exports=function(e,t){var c=e.exec;if(i(c)){var l=n(c,e,t);return l!==null&&r(l),l}if(a(e)===`RegExp`)return n(o,e,t);throw new s(`RegExp#exec called on incompatible receiver`)}})),In=e((()=>{var e=Ut(),t=L(),n=R(),r=An(),i=P(),a=Oe(),o=V(),s=H(),c=Be(),l=He(),u=xn(),d=B(),f=jn(),p=me(),m=Mn(),h=Pn(),g=Fn(),_=W()(`replace`),v=Math.max,y=Math.min,b=n([].concat),x=n([].push),S=n(``.indexOf),C=n(``.slice),w=function(e){return e===void 0?e:String(e)},T=(function(){return`a`.replace(/./,`$0`)===`$0`})(),E=(function(){return/./[_]?/./[_](`a`,`$0`)===``:!1})();r(`replace`,function(n,r,i){var T=E?`$`:`$0`;return[function(e,n){var i=d(this),a=s(e)?p(e,_):void 0;return a?t(a,e,i,n):t(r,u(i),e,n)},function(t,n){var s=a(this),d=u(t);if(typeof n==`string`&&S(n,T)===-1&&S(n,`$<`)===-1){var p=i(r,s,d,n);if(p.done)return p.value}var _=o(n);_||(n=u(n));var E=u(h(s)),D=S(E,`g`)!==-1,O;D&&(O=S(E,`u`)!==-1,s.lastIndex=0);for(var k=[],A;A=g(s,d),!(A===null||(x(k,A),!D));)u(A[0])===``&&(s.lastIndex=f(d,l(s.lastIndex),O));for(var j=``,M=0,N=0;N=M&&(j+=C(d,M,F)+L,M=F+P.length)}return j+C(d,M)}]},!!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$`)!==`7`})||!T||E)})),Ln=e(((e,t)=>{t.exports=` -\v\f\r \xA0               \u2028\u2029`})),Rn=e(((e,t)=>{var n=R(),r=B(),i=xn(),a=Ln(),o=n(``.replace),s=RegExp(`^[`+a+`]+`),c=RegExp(`(^|[^`+a+`])[`+a+`]+$`),l=function(e){return function(t){var n=i(r(t));return e&1&&(n=o(n,s,``)),e&2&&(n=o(n,c,`$1`)),n}};t.exports={start:l(1),end:l(2),trim:l(3)}})),zn=e(((e,t)=>{var n=je().PROPER,r=P(),i=Ln(),a=`​…᠎`;t.exports=function(e){return r(function(){return!!i[e]()||a[e]()!==a||n&&i[e].name!==e})}})),Bn=e((()=>{var e=G(),t=Rn().trim;e({target:`String`,proto:!0,forced:zn()(`trim`)},{trim:function(){return t(this)}})})),Vn=e(((e,t)=>{var n=H(),r=Ae();t.exports=function(e,t){n(t)&&`cause`in t&&r(e,`cause`,t.cause)}})),Hn=e(((e,t)=>{var n=R(),r=Error,i=n(``.replace),a=(function(e){return String(new r(e).stack)})(`zxcasd`),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(a);t.exports=function(e,t){if(s&&typeof e==`string`&&!r.prepareStackTrace)for(;t--;)e=i(e,o,``);return e}})),Un=e(((e,t)=>{var n=P(),r=te();t.exports=!n(function(){var e=Error(`a`);return`stack`in e?(Object.defineProperty(e,"stack",r(1,7)),e.stack!==7):!0})})),Wn=e(((e,t)=>{var n=Ae(),r=Hn(),i=Un(),a=Error.captureStackTrace;t.exports=function(e,t,o,s){i&&(a?a(e,t):n(e,`stack`,r(o,s)))}})),Gn=e(((e,t)=>{var n=xn();t.exports=function(e,t){return e===void 0?arguments.length<2?``:t:n(e)}})),Kn=e((()=>{var e=G(),t=oe(),n=_t(),r=wt(),i=Xe(),a=ft(),o=Ae(),s=te(),c=Vn(),l=Wn(),u=un(),d=Gn(),f=W()(`toStringTag`),p=Error,m=[].push,h=function(e,i){var s=t(g,this),_;r?_=r(new p,s?n(this):g):(_=s?this:a(g),o(_,f,`Error`)),i!==void 0&&o(_,`message`,d(i)),l(_,h,_.stack,1),arguments.length>2&&c(_,arguments[2]);var v=[];return u(e,m,{that:v}),o(_,`errors`,v),_};r?r(h,p):i(h,p,{name:!0});var g=h.prototype=a(p.prototype,{constructor:s(1,h),message:s(1,``),name:s(1,`AggregateError`)});e({global:!0,constructor:!0,arity:2},{AggregateError:h})})),qn=e((()=>{Kn()})),Jn=e((()=>{qn()})),Yn=e((()=>{var e=G(),t=L(),n=pe(),r=rn(),i=en(),a=un();e({target:`Promise`,stat:!0,forced:fn()},{allSettled:function(e){var o=this,s=r.f(o),c=s.resolve,l=s.reject,u=i(function(){var r=n(o.resolve),i=[],s=0,l=1;a(e,function(e){var n=s++,a=!1;l++,t(r,o,e).then(function(e){a||(a=!0,i[n]={status:`fulfilled`,value:e},--l||c(i))},function(e){a||(a=!0,i[n]={status:`rejected`,reason:e},--l||c(i))})}),--l||c(i)});return u.error&&l(u.value),s.promise}})})),Xn=e((()=>{Yn()})),Zn=e((()=>{var e=G(),t=L(),n=pe(),r=ae(),i=rn(),a=en(),o=un(),s=fn(),c=`No one promise resolved`;e({target:`Promise`,stat:!0,forced:s},{any:function(e){var s=this,l=r(`AggregateError`),u=i.f(s),d=u.resolve,f=u.reject,p=a(function(){var r=n(s.resolve),i=[],a=0,u=1,p=!1;o(e,function(e){var n=a++,o=!1;u++,t(r,s,e).then(function(e){o||p||(p=!0,d(e))},function(e){o||p||(o=!0,i[n]=e,--u||f(new l(i,c)))})}),--u||f(new l(i,c))});return p.error&&f(p.value),u.promise}})})),Qn=e((()=>{Zn()})),$n=e(((e,t)=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}})),er=e(((e,t)=>{var n=we()(`span`).classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r})),tr=e(((e,t)=>{var n=ot().forEach;t.exports=Ot()(`forEach`)?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})),nr=e((()=>{var e=N(),t=$n(),n=er(),r=tr(),i=Ae(),a=function(e){if(e&&e.forEach!==r)try{i(e,`forEach`,r)}catch{e.forEach=r}};for(var o in t)t[o]&&a(e[o]&&e[o].prototype);a(n)})),rr=e((()=>{var e=N(),t=$n(),n=er(),r=Dt(),i=Ae(),a=yt(),o=W()(`iterator`),s=r.values,c=function(e,n){if(e){if(e[o]!==s)try{i(e,o,s)}catch{e[o]=s}if(a(e,n,!0),t[n]){for(var c in r)if(e[c]!==r[c])try{i(e,c,r[c])}catch{e[c]=r[c]}}}};for(var l in t)c(e[l]&&e[l].prototype,l);c(n,`DOMTokenList`)}));ct(),mt(),Dt(),kt(),At(),Nt(),Ft(),yn(),bn(),Dn(),kn(),In(),Bn(),Jn(),Xn(),Qn(),nr(),rr(),Mt();var ir={addStylesForComponents:function(e){var t=``;e[`background-toolbar`]&&(t+=`.loader-body, +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(e){for(var t=1;t3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&pr||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(D(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,D(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,D(d,`constructor`,l),D(l,`constructor`,c),c.displayName=`GeneratorFunction`,D(l,i,`GeneratorFunction`),D(d),D(d,i,`Generator`),D(d,r,function(){return this}),D(d,`toString`,function(){return`[object Generator]`}),(E=function(){return{w:a,m:f}})()}function D(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}D=function(e,t,n,r){function a(t,n){D(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},D(e,t,n,r)}function O(e,t){return r(e)||y(e,t)||ee(e,t)||b()}function k(e){return i(e)||v(e)||ee(e)||x()}function A(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function j(e){var t=A(e,`string`);return typeof t==`symbol`?t:t+``}function M(e){"@babel/helpers - typeof";return M=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},M(e)}function ee(e,t){if(e){if(typeof e==`string`)return n(e,t);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function N(e){var n,r;function i(n,r){try{var o=e[n](r),s=o.value,c=s instanceof t;Promise.resolve(c?s.v:s).then(function(t){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||t.done)return i(r,t);t=e[r](t).value}a(!!o.done,t)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof e.return!=`function`&&(this.return=void 0)}N.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},N.prototype.next=function(e){return this._invoke(`next`,e)},N.prototype.throw=function(e){return this._invoke(`throw`,e)},N.prototype.return=function(e){return this._invoke(`return`,e)};var P=e(((e,t)=>{var n=function(e){return e&&e.Math===Math&&e};t.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof global==`object`&&global)||n(typeof e==`object`&&e)||(function(){return this})()||Function(`return this`)()})),F=e(((e,t)=>{t.exports=function(e){try{return!!e()}catch{return!0}}})),I=e(((e,t)=>{t.exports=!F()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})})),L=e(((e,t)=>{t.exports=!F()(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})})),R=e(((e,t)=>{var n=L(),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}})),te=e((e=>{var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t})),ne=e(((e,t)=>{t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}})),z=e(((e,t)=>{var n=L(),r=Function.prototype,i=r.call,a=n&&r.bind.bind(i,i);t.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}})),re=e(((e,t)=>{var n=z(),r=n({}.toString),i=n(``.slice);t.exports=function(e){return i(r(e),8,-1)}})),B=e(((e,t)=>{var n=z(),r=F(),i=re(),a=Object,o=n(``.split);t.exports=r(function(){return!a(`z`).propertyIsEnumerable(0)})?function(e){return i(e)===`String`?o(e,``):a(e)}:a})),ie=e(((e,t)=>{t.exports=function(e){return e==null}})),V=e(((e,t)=>{var n=ie(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`Can't call method on `+e);return e}})),ae=e(((e,t)=>{var n=B(),r=V();t.exports=function(e){return n(r(e))}})),H=e(((e,t)=>{var n=typeof document==`object`&&document.all;t.exports=n===void 0&&n!==void 0?function(e){return typeof e==`function`||e===n}:function(e){return typeof e==`function`}})),U=e(((e,t)=>{var n=H();t.exports=function(e){return typeof e==`object`?e!==null:n(e)}})),W=e(((e,t)=>{var n=P(),r=H(),i=function(e){return r(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?i(n[e]):n[e]&&n[e][t]}})),oe=e(((e,t)=>{t.exports=z()({}.isPrototypeOf)})),se=e(((e,t)=>{var n=P().navigator,r=n&&n.userAgent;t.exports=r?String(r):``})),ce=e(((e,t)=>{var n=P(),r=se(),i=n.process,a=n.Deno,o=i&&i.versions||a&&a.version,s=o&&o.v8,c,l;s&&(c=s.split(`.`),l=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!l&&r&&(c=r.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/),c&&(l=+c[1]))),t.exports=l})),le=e(((e,t)=>{var n=ce(),r=F(),i=P().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol(`symbol detection`);return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})})),ue=e(((e,t)=>{t.exports=le()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})),de=e(((e,t)=>{var n=W(),r=H(),i=oe(),a=ue(),o=Object;t.exports=a?function(e){return typeof e==`symbol`}:function(e){var t=n(`Symbol`);return r(t)&&i(t.prototype,o(e))}})),fe=e(((e,t)=>{var n=String;t.exports=function(e){try{return n(e)}catch{return`Object`}}})),pe=e(((e,t)=>{var n=H(),r=fe(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a function`)}})),me=e(((e,t)=>{var n=pe(),r=ie();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}})),he=e(((e,t)=>{var n=R(),r=H(),i=U(),a=TypeError;t.exports=function(e,t){var o,s;if(t===`string`&&r(o=e.toString)&&!i(s=n(o,e))||r(o=e.valueOf)&&!i(s=n(o,e))||t!==`string`&&r(o=e.toString)&&!i(s=n(o,e)))return s;throw new a(`Can't convert object to primitive value`)}})),ge=e(((e,t)=>{t.exports=!1})),_e=e(((e,t)=>{var n=P(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch{n[e]=t}return t}})),ve=e(((e,t)=>{var n=ge(),r=P(),i=_e(),a=`__core-js_shared__`,o=t.exports=r[a]||i(a,{});(o.versions||=[]).push({version:`3.47.0`,mode:n?`pure`:`global`,copyright:`© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)`,license:`https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE`,source:`https://github.com/zloirock/core-js`})})),ye=e(((e,t)=>{var n=ve();t.exports=function(e,t){return n[e]||(n[e]=t||{})}})),be=e(((e,t)=>{var n=V(),r=Object;t.exports=function(e){return r(n(e))}})),xe=e(((e,t)=>{var n=z(),r=be(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}})),Se=e(((e,t)=>{var n=z(),r=0,i=Math.random(),a=n(1.1.toString);t.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+a(++r+i,36)}})),G=e(((e,t)=>{var n=P(),r=ye(),i=xe(),a=Se(),o=le(),s=ue(),c=n.Symbol,l=r(`wks`),u=s?c.for||c:c&&c.withoutSetter||a;t.exports=function(e){return i(l,e)||(l[e]=o&&i(c,e)?c[e]:u(`Symbol.`+e)),l[e]}})),Ce=e(((e,t)=>{var n=R(),r=U(),i=de(),a=me(),o=he(),s=G(),c=TypeError,l=s(`toPrimitive`);t.exports=function(e,t){if(!r(e)||i(e))return e;var s=a(e,l),u;if(s){if(t===void 0&&(t=`default`),u=n(s,e,t),!r(u)||i(u))return u;throw new c(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),o(e,t)}})),we=e(((e,t)=>{var n=Ce(),r=de();t.exports=function(e){var t=n(e,`string`);return r(t)?t:t+``}})),Te=e(((e,t)=>{var n=P(),r=U(),i=n.document,a=r(i)&&r(i.createElement);t.exports=function(e){return a?i.createElement(e):{}}})),Ee=e(((e,t)=>{var n=I(),r=F(),i=Te();t.exports=!n&&!r(function(){return Object.defineProperty(i(`div`),"a",{get:function(){return 7}}).a!==7})})),De=e((e=>{var t=I(),n=R(),r=te(),i=ne(),a=ae(),o=we(),s=xe(),c=Ee(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=a(e),t=o(t),c)try{return l(e,t)}catch{}if(s(e,t))return i(!n(r.f,e,t),e[t])}})),Oe=e(((e,t)=>{var n=I(),r=F();t.exports=n&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})})),ke=e(((e,t)=>{var n=U(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not an object`)}})),Ae=e((e=>{var t=I(),n=Ee(),r=Oe(),i=ke(),a=we(),o=TypeError,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=`enumerable`,u=`configurable`,d=`writable`;e.f=t?r?function(e,t,n){if(i(e),t=a(t),i(n),typeof e==`function`&&t===`prototype`&&`value`in n&&d in n&&!n[d]){var r=c(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:u in n?n[u]:r[u],enumerable:l in n?n[l]:r[l],writable:!1})}return s(e,t,n)}:s:function(e,t,r){if(i(e),t=a(t),i(r),n)try{return s(e,t,r)}catch{}if(`get`in r||`set`in r)throw new o(`Accessors not supported`);return`value`in r&&(e[t]=r.value),e}})),je=e(((e,t)=>{var n=I(),r=Ae(),i=ne();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}})),Me=e(((e,t)=>{var n=I(),r=xe(),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=r(i,`name`);t.exports={EXISTS:o,PROPER:o&&(function(){}).name===`something`,CONFIGURABLE:o&&(!n||n&&a(i,`name`).configurable)}})),Ne=e(((e,t)=>{var n=z(),r=H(),i=ve(),a=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),t.exports=i.inspectSource})),Pe=e(((e,t)=>{var n=P(),r=H(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))})),Fe=e(((e,t)=>{var n=ye(),r=Se(),i=n(`keys`);t.exports=function(e){return i[e]||(i[e]=r(e))}})),Ie=e(((e,t)=>{t.exports={}})),Le=e(((e,t)=>{var n=Pe(),r=P(),i=U(),a=je(),o=xe(),s=ve(),c=Fe(),l=Ie(),u=`Object already initialized`,d=r.TypeError,f=r.WeakMap,p,m,h,g=function(e){return h(e)?m(e):p(e,{})},_=function(e){return function(t){var n;if(!i(t)||(n=m(t)).type!==e)throw new d(`Incompatible receiver, `+e+` required`);return n}};if(n||s.state){var v=s.state||=new f;v.get=v.get,v.has=v.has,v.set=v.set,p=function(e,t){if(v.has(e))throw new d(u);return t.facade=e,v.set(e,t),t},m=function(e){return v.get(e)||{}},h=function(e){return v.has(e)}}else{var y=c(`state`);l[y]=!0,p=function(e,t){if(o(e,y))throw new d(u);return t.facade=e,a(e,y,t),t},m=function(e){return o(e,y)?e[y]:{}},h=function(e){return o(e,y)}}t.exports={set:p,get:m,has:h,enforce:g,getterFor:_}})),Re=e(((e,t)=>{var n=z(),r=F(),i=H(),a=xe(),o=I(),s=Me().CONFIGURABLE,c=Ne(),l=Le(),u=l.enforce,d=l.get,f=String,p=Object.defineProperty,m=n(``.slice),h=n(``.replace),g=n([].join),_=o&&!r(function(){return p(function(){},`length`,{value:8}).length!==8}),v=String(String).split(`String`),y=t.exports=function(e,t,n){m(f(t),0,7)===`Symbol(`&&(t=`[`+h(f(t),/^Symbol\(([^)]*)\).*$/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!a(e,`name`)||s&&e.name!==t)&&(o?p(e,`name`,{value:t,configurable:!0}):e.name=t),_&&n&&a(n,`arity`)&&e.length!==n.arity&&p(e,`length`,{value:n.arity});try{n&&a(n,`constructor`)&&n.constructor?o&&p(e,`prototype`,{writable:!1}):e.prototype&&=void 0}catch{}var r=u(e);return a(r,`source`)||(r.source=g(v,typeof t==`string`?t:``)),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||c(this)},`toString`)})),ze=e(((e,t)=>{var n=H(),r=Ae(),i=Re(),a=_e();t.exports=function(e,t,o,s){s||={};var c=s.enumerable,l=s.name===void 0?t:s.name;if(n(o)&&i(o,l,s),s.global)c?e[t]=o:a(t,o);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch{}c?e[t]=o:r.f(e,t,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}})),Be=e(((e,t)=>{var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}})),Ve=e(((e,t)=>{var n=Be();t.exports=function(e){var t=+e;return t!==t||t===0?0:n(t)}})),He=e(((e,t)=>{var n=Ve(),r=Math.max,i=Math.min;t.exports=function(e,t){var a=n(e);return a<0?r(a+t,0):i(a,t)}})),Ue=e(((e,t)=>{var n=Ve(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}})),We=e(((e,t)=>{var n=Ue();t.exports=function(e){return n(e.length)}})),Ge=e(((e,t)=>{var n=ae(),r=He(),i=We(),a=function(e){return function(t,a,o){var s=n(t),c=i(s);if(c===0)return!e&&-1;var l=r(o,c),u;if(e&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===a)return e||l||0;return!e&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}})),Ke=e(((e,t)=>{var n=z(),r=xe(),i=ae(),a=Ge().indexOf,o=Ie(),s=n([].push);t.exports=function(e,t){var n=i(e),c=0,l=[],u;for(u in n)!r(o,u)&&r(n,u)&&s(l,u);for(;t.length>c;)r(n,u=t[c++])&&(~a(l,u)||s(l,u));return l}})),qe=e(((e,t)=>{t.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]})),Je=e((e=>{var t=Ke(),n=qe().concat(`length`,`prototype`);e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}})),Ye=e((e=>{e.f=Object.getOwnPropertySymbols})),Xe=e(((e,t)=>{var n=W(),r=z(),i=Je(),a=Ye(),o=ke(),s=r([].concat);t.exports=n(`Reflect`,`ownKeys`)||function(e){var t=i.f(o(e)),n=a.f;return n?s(t,n(e)):t}})),Ze=e(((e,t)=>{var n=xe(),r=Xe(),i=De(),a=Ae();t.exports=function(e,t,o){for(var s=r(t),c=a.f,l=i.f,u=0;u{var n=F(),r=H(),i=/#|\.prototype\./,a=function(e,t){var i=s[o(e)];return i===l?!0:i===c?!1:r(t)?n(t):!!t},o=a.normalize=function(e){return String(e).replace(i,`.`).toLowerCase()},s=a.data={},c=a.NATIVE=`N`,l=a.POLYFILL=`P`;t.exports=a})),K=e(((e,t)=>{var n=P(),r=De().f,i=je(),a=ze(),o=_e(),s=Ze(),c=Qe();t.exports=function(e,t){var l=e.target,u=e.global,d=e.stat,f,p=u?n:d?n[l]||o(l,{}):n[l]&&n[l].prototype,m,h,g,_;if(p)for(m in t){if(g=t[m],e.dontCallGetSet?(_=r(p,m),h=_&&_.value):h=p[m],f=c(u?m:l+(d?`.`:`#`)+m,e.forced),!f&&h!==void 0){if(typeof g==typeof h)continue;s(g,h)}(e.sham||h&&h.sham)&&i(g,`sham`,!0),a(p,m,g,e)}}})),$e=e(((e,t)=>{var n=re(),r=z();t.exports=function(e){if(n(e)===`Function`)return r(e)}})),et=e(((e,t)=>{var n=$e(),r=pe(),i=L(),a=n(n.bind);t.exports=function(e,t){return r(e),t===void 0?e:i?a(e,t):function(){return e.apply(t,arguments)}}})),tt=e(((e,t)=>{var n=re();t.exports=Array.isArray||function(e){return n(e)===`Array`}})),nt=e(((e,t)=>{var n=G()(`toStringTag`),r={};r[n]=`z`,t.exports=String(r)===`[object z]`})),rt=e(((e,t)=>{var n=nt(),r=H(),i=re(),a=G()(`toStringTag`),o=Object,s=i(function(){return arguments}())===`Arguments`,c=function(e,t){try{return e[t]}catch{}};t.exports=n?i:function(e){var t,n,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=c(t=o(e),a))==`string`?n:s?i(t):(l=i(t))===`Object`&&r(t.callee)?`Arguments`:l}})),it=e(((e,t)=>{var n=z(),r=F(),i=H(),a=rt(),o=W(),s=Ne(),c=function(){},l=o(`Reflect`,`construct`),u=/^\s*(?:class|function)\b/,d=n(u.exec),f=!u.test(c),p=function(e){if(!i(e))return!1;try{return l(c,[],e),!0}catch{return!1}},m=function(e){if(!i(e))return!1;switch(a(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return f||!!d(u,s(e))}catch{return!0}};m.sham=!0,t.exports=!l||r(function(){var e;return p(p.call)||!p(Object)||!p(function(){e=!0})||e})?m:p})),at=e(((e,t)=>{var n=tt(),r=it(),i=U(),a=G()(`species`),o=Array;t.exports=function(e){var t;return n(e)&&(t=e.constructor,r(t)&&(t===o||n(t.prototype))?t=void 0:i(t)&&(t=t[a],t===null&&(t=void 0))),t===void 0?o:t}})),ot=e(((e,t)=>{var n=at();t.exports=function(e,t){return new(n(e))(t===0?0:t)}})),st=e(((e,t)=>{var n=et(),r=z(),i=B(),a=be(),o=We(),s=ot(),c=r([].push),l=function(e){var t=e===1,r=e===2,l=e===3,u=e===4,d=e===6,f=e===7,p=e===5||d;return function(m,h,g,_){for(var v=a(m),y=i(v),b=o(y),x=n(h,g),S=0,C=_||s,w=t?C(m,b):r||f?C(m,0):void 0,T,E;b>S;S++)if((p||S in y)&&(T=y[S],E=x(T,S,v),e))if(t)w[S]=E;else if(E)switch(e){case 3:return!0;case 5:return T;case 6:return S;case 2:c(w,T)}else switch(e){case 4:return!1;case 7:c(w,T)}return d?-1:l||u?u:w}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}})),ct=e(((e,t)=>{var n=F(),r=G(),i=ce(),a=r(`species`);t.exports=function(e){return i>=51||!n(function(){var t=[],n=t.constructor={};return n[a]=function(){return{foo:1}},t[e](Boolean).foo!==1})}})),lt=e((()=>{var e=K(),t=st().filter;e({target:`Array`,proto:!0,forced:!ct()(`filter`)},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),ut=e(((e,t)=>{var n=Ke(),r=qe();t.exports=Object.keys||function(e){return n(e,r)}})),dt=e((e=>{var t=I(),n=Oe(),r=Ae(),i=ke(),a=ae(),o=ut();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n=a(t),s=o(t),c=s.length,l=0,u;c>l;)r.f(e,u=s[l++],n[u]);return e}})),ft=e(((e,t)=>{t.exports=W()(`document`,`documentElement`)})),pt=e(((e,t)=>{var n=ke(),r=dt(),i=qe(),a=Ie(),o=ft(),s=Te(),c=Fe(),l=`>`,u=`<`,d=`prototype`,f=`script`,p=c(`IE_PROTO`),m=function(){},h=function(e){return u+f+l+e+u+`/`+f+l},g=function(e){e.write(h(``)),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){var e=s(`iframe`),t=`java`+f+`:`,n;return e.style.display=`none`,o.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(h(`document.F=Object`)),n.close(),n.F},v,y=function(){try{v=new ActiveXObject(`htmlfile`)}catch{}y=typeof document<`u`?document.domain&&v?g(v):_():g(v);for(var e=i.length;e--;)delete y[d][i[e]];return y()};a[p]=!0,t.exports=Object.create||function(e,t){var i;return e===null?i=y():(m[d]=n(e),i=new m,m[d]=null,i[p]=e),t===void 0?i:r.f(i,t)}})),mt=e(((e,t)=>{var n=G(),r=pt(),i=Ae().f,a=n(`unscopables`),o=Array.prototype;o[a]===void 0&&i(o,a,{configurable:!0,value:r(null)}),t.exports=function(e){o[a][e]=!0}})),ht=e((()=>{var e=K(),t=st().find,n=mt(),r=`find`,i=!0;r in[]&&[,][r](function(){i=!1}),e({target:`Array`,proto:!0,forced:i},{find:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),n(r)})),gt=e((()=>{var e=K(),t=Ge().includes,n=F(),r=mt();e({target:`Array`,proto:!0,forced:n(function(){return![,].includes()})},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r(`includes`)})),_t=e(((e,t)=>{t.exports={}})),vt=e(((e,t)=>{t.exports=!F()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})})),yt=e(((e,t)=>{var n=xe(),r=H(),i=be(),a=Fe(),o=vt(),s=a(`IE_PROTO`),c=Object,l=c.prototype;t.exports=o?c.getPrototypeOf:function(e){var t=i(e);if(n(t,s))return t[s];var a=t.constructor;return r(a)&&t instanceof a?a.prototype:t instanceof c?l:null}})),bt=e(((e,t)=>{var n=F(),r=H(),i=U(),a=pt(),o=yt(),s=ze(),c=G(),l=ge(),u=c(`iterator`),d=!1,f,p,m;[].keys&&(m=[].keys(),`next`in m?(p=o(o(m)),p!==Object.prototype&&(f=p)):d=!0),!i(f)||n(function(){var e={};return f[u].call(e)!==e})?f={}:l&&(f=a(f)),r(f[u])||s(f,u,function(){return this}),t.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:d}})),xt=e(((e,t)=>{var n=Ae().f,r=xe(),i=G()(`toStringTag`);t.exports=function(e,t,a){e&&!a&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}})),St=e(((e,t)=>{var n=bt().IteratorPrototype,r=pt(),i=ne(),a=xt(),o=_t(),s=function(){return this};t.exports=function(e,t,c,l){var u=t+` Iterator`;return e.prototype=r(n,{next:i(+!l,c)}),a(e,u,!1,!0),o[u]=s,e}})),Ct=e(((e,t)=>{var n=z(),r=pe();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch{}}})),wt=e(((e,t)=>{var n=U();t.exports=function(e){return n(e)||e===null}})),Tt=e(((e,t)=>{var n=wt(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(`Can't set `+r(e)+` as a prototype`)}})),Et=e(((e,t)=>{var n=Ct(),r=U(),i=V(),a=Tt();t.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},o;try{o=n(Object.prototype,`__proto__`,`set`),o(t,[]),e=t instanceof Array}catch{}return function(t,n){return i(t),a(n),r(t)&&(e?o(t,n):t.__proto__=n),t}}():void 0)})),Dt=e(((e,t)=>{var n=K(),r=R(),i=ge(),a=Me(),o=H(),s=St(),c=yt(),l=Et(),u=xt(),d=je(),f=ze(),p=G(),m=_t(),h=bt(),g=a.PROPER,_=a.CONFIGURABLE,v=h.IteratorPrototype,y=h.BUGGY_SAFARI_ITERATORS,b=p(`iterator`),x=`keys`,S=`values`,C=`entries`,w=function(){return this};t.exports=function(e,t,a,p,h,T,E){s(a,t,p);var D=function(e){if(e===h&&M)return M;if(!y&&e&&e in A)return A[e];switch(e){case x:return function(){return new a(this,e)};case S:return function(){return new a(this,e)};case C:return function(){return new a(this,e)}}return function(){return new a(this)}},O=t+` Iterator`,k=!1,A=e.prototype,j=A[b]||A[`@@iterator`]||h&&A[h],M=!y&&j||D(h),ee=t===`Array`&&A.entries||j,N,P,F;if(ee&&(N=c(ee.call(new e)),N!==Object.prototype&&N.next&&(!i&&c(N)!==v&&(l?l(N,v):o(N[b])||f(N,b,w)),u(N,O,!0,!0),i&&(m[O]=w))),g&&h===S&&j&&j.name!==S&&(!i&&_?d(A,`name`,S):(k=!0,M=function(){return r(j,this)})),h)if(P={values:D(S),keys:T?M:D(x),entries:D(C)},E)for(F in P)(y||k||!(F in A))&&f(A,F,P[F]);else n({target:t,proto:!0,forced:y||k},P);return(!i||E)&&A[b]!==M&&f(A,b,M,{name:h}),m[t]=M,P}})),Ot=e(((e,t)=>{t.exports=function(e,t){return{value:e,done:t}}})),kt=e(((e,t)=>{var n=ae(),r=mt(),i=_t(),a=Le(),o=Ae().f,s=Dt(),c=Ot(),l=ge(),u=I(),d=`Array Iterator`,f=a.set,p=a.getterFor(d);t.exports=s(Array,`Array`,function(e,t){f(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case`keys`:return c(n,!1);case`values`:return c(t[n],!1)}return c([n,t[n]],!1)},`values`);var m=i.Arguments=i.Array;if(r(`keys`),r(`values`),r(`entries`),!l&&u&&m.name!==`values`)try{o(m,`name`,{value:`values`})}catch{}})),At=e(((e,t)=>{var n=F();t.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){return 1},1)})}})),jt=e((()=>{var e=K(),t=z(),n=B(),r=ae(),i=At(),a=t([].join);e({target:`Array`,proto:!0,forced:n!==Object||!i(`join`,`,`)},{join:function(e){return a(r(this),e===void 0?`,`:e)}})})),Mt=e((()=>{var e=K(),t=st().map;e({target:`Array`,proto:!0,forced:!ct()(`map`)},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})})),Nt=e(((e,t)=>{var n=I(),r=Ae(),i=ne();t.exports=function(e,t,a){n?r.f(e,t,i(0,a)):e[t]=a}})),Pt=e(((e,t)=>{t.exports=z()([].slice)})),Ft=e((()=>{var e=K(),t=tt(),n=it(),r=U(),i=He(),a=We(),o=ae(),s=Nt(),c=G(),l=ct(),u=Pt(),d=l(`slice`),f=c(`species`),p=Array,m=Math.max;e({target:`Array`,proto:!0,forced:!d},{slice:function(e,c){var l=o(this),d=a(l),h=i(e,d),g=i(c===void 0?d:c,d),_,v,y;if(t(l)&&(_=l.constructor,n(_)&&(_===p||t(_.prototype))?_=void 0:r(_)&&(_=_[f],_===null&&(_=void 0)),_===p||_===void 0))return u(l,h,g);for(v=new(_===void 0?p:_)(m(g-h,0)),y=0;h{var n=Re(),r=Ae();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}})),Lt=e((()=>{var e=I(),t=Me().EXISTS,n=z(),r=It(),i=Function.prototype,a=n(i.toString),o=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=n(o.exec);e&&!t&&r(i,`name`,{configurable:!0,get:function(){try{return s(o,a(this))[1]}catch{return``}}})})),Rt=e(((e,t)=>{t.exports=P()})),zt=e(((e,t)=>{var n=H(),r=U(),i=Et();t.exports=function(e,t,a){var o,s;return i&&n(o=t.constructor)&&o!==a&&r(s=o.prototype)&&s!==a.prototype&&i(e,s),e}})),Bt=e(((e,t)=>{t.exports=z()(1.1.valueOf)})),Vt=e(((e,t)=>{var n=rt(),r=String;t.exports=function(e){if(n(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return r(e)}})),Ht=e(((e,t)=>{t.exports=` +\v\f\r \xA0               \u2028\u2029`})),Ut=e(((e,t)=>{var n=z(),r=V(),i=Vt(),a=Ht(),o=n(``.replace),s=RegExp(`^[`+a+`]+`),c=RegExp(`(^|[^`+a+`])[`+a+`]+$`),l=function(e){return function(t){var n=i(r(t));return e&1&&(n=o(n,s,``)),e&2&&(n=o(n,c,`$1`)),n}};t.exports={start:l(1),end:l(2),trim:l(3)}})),Wt=e((()=>{var e=K(),t=ge(),n=I(),r=P(),i=Rt(),a=z(),o=Qe(),s=xe(),c=zt(),l=oe(),u=de(),d=Ce(),f=F(),p=Je().f,m=De().f,h=Ae().f,g=Bt(),_=Ut().trim,v=`Number`,y=r[v],b=i[v],x=y.prototype,S=r.TypeError,C=a(``.slice),w=a(``.charCodeAt),T=function(e){var t=d(e,`number`);return typeof t==`bigint`?t:E(t)},E=function(e){var t=d(e,`number`),n,r,i,a,o,s,c,l;if(u(t))throw new S(`Cannot convert a Symbol value to a number`);if(typeof t==`string`&&t.length>2){if(t=_(t),n=w(t,0),n===43||n===45){if(r=w(t,2),r===88||r===120)return NaN}else if(n===48){switch(w(t,1)){case 66:case 98:i=2,a=49;break;case 79:case 111:i=8,a=55;break;default:return+t}for(o=C(t,2),s=o.length,c=0;ca)return NaN;return parseInt(o,i)}}return+t},D=o(v,!y(` 0o1`)||!y(`0b1`)||y(`+0x1`)),O=function(e){return l(x,e)&&f(function(){g(e)})},k=function(e){var t=arguments.length<1?0:y(T(e));return O(this)?c(Object(t),this,k):t};k.prototype=x,D&&!t&&(x.constructor=k),e({global:!0,constructor:!0,wrap:!0,forced:D},{Number:k});var A=function(e,t){for(var r=n?p(t):`MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range`.split(`,`),i=0,a;r.length>i;i++)s(t,a=r[i])&&!s(e,a)&&h(e,a,m(t,a))};t&&b&&A(i[v],b),(D||t)&&A(i[v],y)})),Gt=e(((e,t)=>{var n=I(),r=z(),i=R(),a=F(),o=ut(),s=Ye(),c=te(),l=be(),u=B(),d=Object.assign,f=Object.defineProperty,p=r([].concat);t.exports=!d||a(function(){if(n&&d({b:1},d(f({},`a`,{enumerable:!0,get:function(){f(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(`assign detection`),i=`abcdefghijklmnopqrst`;return e[r]=7,i.split(``).forEach(function(e){t[e]=e}),d({},e)[r]!==7||o(d({},t)).join(``)!==i})?function(e,t){for(var r=l(e),a=arguments.length,d=1,f=s.f,m=c.f;a>d;)for(var h=u(arguments[d++]),g=f?p(o(h),f(h)):o(h),_=g.length,v=0,y;_>v;)y=g[v++],(!n||i(m,h,y))&&(r[y]=h[y]);return r}:d})),Kt=e((()=>{var e=K(),t=Gt();e({target:`Object`,stat:!0,arity:2,forced:Object.assign!==t},{assign:t})})),qt=e((()=>{var e=K(),t=be(),n=ut();e({target:`Object`,stat:!0,forced:F()(function(){n(1)})},{keys:function(e){return n(t(e))}})})),Jt=e(((e,t)=>{var n=nt(),r=rt();t.exports=n?{}.toString:function(){return`[object `+r(this)+`]`}})),Yt=e((()=>{var e=nt(),t=ze(),n=Jt();e||t(Object.prototype,`toString`,n,{unsafe:!0})})),Xt=e(((e,t)=>{var n=P(),r=se(),i=re(),a=function(e){return r.slice(0,e.length)===e};t.exports=(function(){return a(`Bun/`)?`BUN`:a(`Cloudflare-Workers`)?`CLOUDFLARE`:a(`Deno/`)?`DENO`:a(`Node.js/`)?`NODE`:n.Bun&&typeof Bun.version==`string`?`BUN`:n.Deno&&typeof Deno.version==`object`?`DENO`:i(n.process)===`process`?`NODE`:n.window&&n.document?`BROWSER`:`REST`})()})),Zt=e(((e,t)=>{t.exports=Xt()===`NODE`})),Qt=e(((e,t)=>{var n=W(),r=It(),i=G(),a=I(),o=i(`species`);t.exports=function(e){var t=n(e);a&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}})),$t=e(((e,t)=>{var n=oe(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r(`Incorrect invocation`)}})),en=e(((e,t)=>{var n=it(),r=fe(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a constructor`)}})),tn=e(((e,t)=>{var n=ke(),r=en(),i=ie(),a=G()(`species`);t.exports=function(e,t){var o=n(e).constructor,s;return o===void 0||i(s=n(o)[a])?t:r(s)}})),nn=e(((e,t)=>{var n=L(),r=Function.prototype,i=r.apply,a=r.call;t.exports=typeof Reflect==`object`&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})})),rn=e(((e,t)=>{var n=TypeError;t.exports=function(e,t){if(e{var n=se();t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)})),on=e(((e,t)=>{var n=P(),r=nn(),i=et(),a=H(),o=xe(),s=F(),c=ft(),l=Pt(),u=Te(),d=rn(),f=an(),p=Zt(),m=n.setImmediate,h=n.clearImmediate,g=n.process,_=n.Dispatch,v=n.Function,y=n.MessageChannel,b=n.String,x=0,S={},C=`onreadystatechange`,w,T,E,D;s(function(){w=n.location});var O=function(e){if(o(S,e)){var t=S[e];delete S[e],t()}},k=function(e){return function(){O(e)}},A=function(e){O(e.data)},j=function(e){n.postMessage(b(e),w.protocol+`//`+w.host)};(!m||!h)&&(m=function(e){d(arguments.length,1);var t=a(e)?e:v(e),n=l(arguments,1);return S[++x]=function(){r(t,void 0,n)},T(x),x},h=function(e){delete S[e]},p?T=function(e){g.nextTick(k(e))}:_&&_.now?T=function(e){_.now(k(e))}:y&&!f?(E=new y,D=E.port2,E.port1.onmessage=A,T=i(D.postMessage,D)):n.addEventListener&&a(n.postMessage)&&!n.importScripts&&w&&w.protocol!==`file:`&&!s(j)?(T=j,n.addEventListener(`message`,A,!1)):T=C in u(`script`)?function(e){c.appendChild(u(`script`))[C]=function(){c.removeChild(this),O(e)}}:function(e){setTimeout(k(e),0)}),t.exports={set:m,clear:h}})),sn=e(((e,t)=>{var n=P(),r=I(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(n,e);return t&&t.value}})),cn=e(((e,t)=>{var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}},t.exports=n})),ln=e(((e,t)=>{var n=se();t.exports=/ipad|iphone|ipod/i.test(n)&&typeof Pebble<`u`})),un=e(((e,t)=>{var n=se();t.exports=/web0s(?!.*chrome)/i.test(n)})),dn=e(((e,t)=>{var n=P(),r=sn(),i=et(),a=on().set,o=cn(),s=an(),c=ln(),l=un(),u=Zt(),d=n.MutationObserver||n.WebKitMutationObserver,f=n.document,p=n.process,m=n.Promise,h=r(`queueMicrotask`),g,_,v,y,b;if(!h){var x=new o,S=function(){var e,t;for(u&&(e=p.domain)&&e.exit();t=x.get();)try{t()}catch(e){throw x.head&&g(),e}e&&e.enter()};!s&&!u&&!l&&d&&f?(_=!0,v=f.createTextNode(``),new d(S).observe(v,{characterData:!0}),g=function(){v.data=_=!_}):!c&&m&&m.resolve?(y=m.resolve(void 0),y.constructor=m,b=i(y.then,y),g=function(){b(S)}):u?g=function(){p.nextTick(S)}:(a=i(a,n),g=function(){a(S)}),h=function(e){x.head||g(),x.add(e)}}t.exports=h})),fn=e(((e,t)=>{t.exports=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}}})),pn=e(((e,t)=>{t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}})),mn=e(((e,t)=>{t.exports=P().Promise})),hn=e(((e,t)=>{var n=P(),r=mn(),i=H(),a=Qe(),o=Ne(),s=G(),c=Xt(),l=ge(),u=ce(),d=r&&r.prototype,f=s(`species`),p=!1,m=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:a(`Promise`,function(){var e=o(r),t=e!==String(r);if(!t&&u===66||l&&!(d.catch&&d.finally))return!0;if(!u||u<51||!/native code/.test(e)){var n=new r(function(e){e(1)}),i=function(e){e(function(){},function(){})},a=n.constructor={};if(a[f]=i,p=n.then(function(){})instanceof i,!p)return!0}return!t&&(c===`BROWSER`||c===`DENO`)&&!m}),REJECTION_EVENT:m,SUBCLASSING:p}})),gn=e(((e,t)=>{var n=pe(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(t!==void 0||i!==void 0)throw new r(`Bad Promise constructor`);t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}})),_n=e((()=>{var e=K(),t=ge(),n=Zt(),r=P(),i=Rt(),a=R(),o=ze(),s=Et(),c=xt(),l=Qt(),u=pe(),d=H(),f=U(),p=$t(),m=tn(),h=on().set,g=dn(),_=fn(),v=pn(),y=cn(),b=Le(),x=mn(),S=hn(),C=gn(),w=`Promise`,T=S.CONSTRUCTOR,E=S.REJECTION_EVENT,D=S.SUBCLASSING,O=b.getterFor(w),k=b.set,A=x&&x.prototype,j=x,M=A,ee=r.TypeError,N=r.document,F=r.process,I=C.f,L=I,te=!!(N&&N.createEvent&&r.dispatchEvent),ne=`unhandledrejection`,z=`rejectionhandled`,re=0,B=1,ie=2,V=1,ae=2,W,oe,se,ce,le=function(e){var t;return f(e)&&d(t=e.then)?t:!1},ue=function(e,t){var n=t.value,r=t.state===B,i=r?e.ok:e.fail,o=e.resolve,s=e.reject,c=e.domain,l,u,d;try{i?(r||(t.rejection===ae&&_e(t),t.rejection=V),i===!0?l=n:(c&&c.enter(),l=i(n),c&&(c.exit(),d=!0)),l===e.promise?s(new ee(`Promise-chain cycle`)):(u=le(l))?a(u,l,o,s):o(l)):s(n)}catch(e){c&&!d&&c.exit(),s(e)}},de=function(e,t){e.notified||(e.notified=!0,g(function(){for(var n=e.reactions,r;r=n.get();)ue(r,e);e.notified=!1,t&&!e.rejection&&me(e)}))},fe=function(e,t,n){var i,a;te?(i=N.createEvent(`Event`),i.promise=t,i.reason=n,i.initEvent(e,!1,!0),r.dispatchEvent(i)):i={promise:t,reason:n},!E&&(a=r[`on`+e])?a(i):e===ne&&_(`Unhandled promise rejection`,n)},me=function(e){a(h,r,function(){var t=e.facade,r=e.value,i=he(e),a;if(i&&(a=v(function(){n?F.emit(`unhandledRejection`,r,t):fe(ne,t,r)}),e.rejection=n||he(e)?ae:V,a.error))throw a.value})},he=function(e){return e.rejection!==V&&!e.parent},_e=function(e){a(h,r,function(){var t=e.facade;n?F.emit(`rejectionHandled`,t):fe(z,t,e.value)})},ve=function(e,t,n){return function(r){e(t,r,n)}},ye=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=ie,de(e,!0))},be=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new ee(`Promise can't be resolved itself`);var r=le(t);r?g(function(){var n={done:!1};try{a(r,t,ve(be,n,e),ve(ye,n,e))}catch(t){ye(n,t,e)}}):(e.value=t,e.state=B,de(e,!1))}catch(t){ye({done:!1},t,e)}}};if(T&&(j=function(e){p(this,M),u(e),a(W,this);var t=O(this);try{e(ve(be,t),ve(ye,t))}catch(e){ye(t,e)}},M=j.prototype,W=function(e){k(this,{type:w,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:re,value:null})},W.prototype=o(M,`then`,function(e,t){var r=O(this),i=I(m(this,j));return r.parent=!0,i.ok=d(e)?e:!0,i.fail=d(t)&&t,i.domain=n?F.domain:void 0,r.state===re?r.reactions.add(i):g(function(){ue(i,r)}),i.promise}),oe=function(){var e=new W,t=O(e);this.promise=e,this.resolve=ve(be,t),this.reject=ve(ye,t)},C.f=I=function(e){return e===j||e===se?new oe(e):L(e)},!t&&d(x)&&A!==Object.prototype)){ce=A.then,D||o(A,`then`,function(e,t){var n=this;return new j(function(e,t){a(ce,n,e,t)}).then(e,t)},{unsafe:!0});try{delete A.constructor}catch{}s&&s(A,M)}e({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:j}),se=i.Promise,c(j,w,!1,!0),l(w)})),vn=e(((e,t)=>{var n=G(),r=_t(),i=n(`iterator`),a=Array.prototype;t.exports=function(e){return e!==void 0&&(r.Array===e||a[i]===e)}})),yn=e(((e,t)=>{var n=rt(),r=me(),i=ie(),a=_t(),o=G()(`iterator`);t.exports=function(e){if(!i(e))return r(e,o)||r(e,`@@iterator`)||a[n(e)]}})),bn=e(((e,t)=>{var n=R(),r=pe(),i=ke(),a=fe(),o=yn(),s=TypeError;t.exports=function(e,t){var c=arguments.length<2?o(e):t;if(r(c))return i(n(c,e));throw new s(a(e)+` is not iterable`)}})),xn=e(((e,t)=>{var n=R(),r=ke(),i=me();t.exports=function(e,t,a){var o,s;r(e);try{if(o=i(e,`return`),!o){if(t===`throw`)throw a;return a}o=n(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw a;if(s)throw o;return r(o),a}})),Sn=e(((e,t)=>{var n=et(),r=R(),i=ke(),a=fe(),o=vn(),s=We(),c=oe(),l=bn(),u=yn(),d=xn(),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},m=p.prototype;t.exports=function(e,t,h){var g=h&&h.that,_=!!(h&&h.AS_ENTRIES),v=!!(h&&h.IS_RECORD),y=!!(h&&h.IS_ITERATOR),b=!!(h&&h.INTERRUPTED),x=n(t,g),S,C,w,T,E,D,O,k=function(e){return S&&d(S,`normal`),new p(!0,e)},A=function(e){return _?(i(e),b?x(e[0],e[1],k):x(e[0],e[1])):b?x(e,k):x(e)};if(v)S=e.iterator;else if(y)S=e;else{if(C=u(e),!C)throw new f(a(e)+` is not iterable`);if(o(C)){for(w=0,T=s(e);T>w;w++)if(E=A(e[w]),E&&c(m,E))return E;return new p(!1)}S=l(e,C)}for(D=v?e.next:S.next;!(O=r(D,S)).done;){try{E=A(O.value)}catch(e){d(S,`throw`,e)}if(typeof E==`object`&&E&&c(m,E))return E}return new p(!1)}})),Cn=e(((e,t)=>{var n=G()(`iterator`),r=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch{}t.exports=function(e,t){try{if(!t&&!r)return!1}catch{return!1}var i=!1;try{var a={};a[n]=function(){return{next:function(){return{done:i=!0}}}},e(a)}catch{}return i}})),wn=e(((e,t)=>{var n=mn(),r=Cn();t.exports=hn().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})})),Tn=e((()=>{var e=K(),t=R(),n=pe(),r=gn(),i=pn(),a=Sn();e({target:`Promise`,stat:!0,forced:wn()},{all:function(e){var o=this,s=r.f(o),c=s.resolve,l=s.reject,u=i(function(){var r=n(o.resolve),i=[],s=0,u=1;a(e,function(e){var n=s++,a=!1;u++,t(r,o,e).then(function(e){a||(a=!0,i[n]=e,--u||c(i))},l)}),--u||c(i)});return u.error&&l(u.value),s.promise}})})),En=e((()=>{var e=K(),t=ge(),n=hn().CONSTRUCTOR,r=mn(),i=W(),a=H(),o=ze(),s=r&&r.prototype;if(e({target:`Promise`,proto:!0,forced:n,real:!0},{catch:function(e){return this.then(void 0,e)}}),!t&&a(r)){var c=i(`Promise`).prototype.catch;s.catch!==c&&o(s,`catch`,c,{unsafe:!0})}})),Dn=e((()=>{var e=K(),t=R(),n=pe(),r=gn(),i=pn(),a=Sn();e({target:`Promise`,stat:!0,forced:wn()},{race:function(e){var o=this,s=r.f(o),c=s.reject,l=i(function(){var r=n(o.resolve);a(e,function(e){t(r,o,e).then(s.resolve,c)})});return l.error&&c(l.value),s.promise}})})),On=e((()=>{var e=K(),t=gn(),n=hn().CONSTRUCTOR;e({target:`Promise`,stat:!0,forced:n},{reject:function(e){var n=t.f(this),r=n.reject;return r(e),n.promise}})})),kn=e(((e,t)=>{var n=ke(),r=U(),i=gn();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var a=i.f(e),o=a.resolve;return o(t),a.promise}})),An=e((()=>{var e=K(),t=W(),n=ge(),r=mn(),i=hn().CONSTRUCTOR,a=kn(),o=t(`Promise`),s=n&&!i;e({target:`Promise`,stat:!0,forced:n||i},{resolve:function(e){return a(s&&this===o?r:this,e)}})})),jn=e((()=>{_n(),Tn(),En(),Dn(),On(),An()})),Mn=e((()=>{var e=K(),t=ge(),n=mn(),r=F(),i=W(),a=H(),o=tn(),s=kn(),c=ze(),l=n&&n.prototype;if(e({target:`Promise`,proto:!0,real:!0,forced:!!n&&r(function(){l.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=o(this,i(`Promise`)),n=a(e);return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}}),!t&&a(n)){var u=i(`Promise`).prototype.finally;l.finally!==u&&c(l,`finally`,u,{unsafe:!0})}})),Nn=e(((e,t)=>{var n=ke();t.exports=function(){var e=n(this),t=``;return e.hasIndices&&(t+=`d`),e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),e.dotAll&&(t+=`s`),e.unicode&&(t+=`u`),e.unicodeSets&&(t+=`v`),e.sticky&&(t+=`y`),t}})),Pn=e(((e,t)=>{var n=F(),r=P().RegExp,i=n(function(){var e=r(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!==null}),a=i||n(function(){return!r(`a`,`y`).sticky});t.exports={BROKEN_CARET:i||n(function(){var e=r(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!==null}),MISSED_STICKY:a,UNSUPPORTED_Y:i}})),Fn=e(((e,t)=>{var n=F(),r=P().RegExp;t.exports=n(function(){var e=r(`.`,`s`);return!(e.dotAll&&e.test(` +`)&&e.flags===`s`)})})),In=e(((e,t)=>{var n=F(),r=P().RegExp;t.exports=n(function(){var e=r(`(?b)`,`g`);return e.exec(`b`).groups.a!==`b`||`b`.replace(e,`$c`)!==`bc`})})),Ln=e(((e,t)=>{var n=R(),r=z(),i=Vt(),a=Nn(),o=Pn(),s=ye(),c=pt(),l=Le().get,u=Fn(),d=In(),f=s(`native-string-replace`,String.prototype.replace),p=RegExp.prototype.exec,m=p,h=r(``.charAt),g=r(``.indexOf),_=r(``.replace),v=r(``.slice),y=(function(){var e=/a/,t=/b*/g;return n(p,e,`a`),n(p,t,`a`),e.lastIndex!==0||t.lastIndex!==0})(),b=o.BROKEN_CARET,x=/()??/.exec(``)[1]!==void 0;(y||x||b||u||d)&&(m=function(e){var t=this,r=l(t),o=i(e),s=r.raw,u,d,S,C,w,T,E;if(s)return s.lastIndex=t.lastIndex,u=n(m,s,o),t.lastIndex=s.lastIndex,u;var D=r.groups,O=b&&t.sticky,k=n(a,t),A=t.source,j=0,M=o;if(O&&(k=_(k,`y`,``),g(k,`g`)===-1&&(k+=`g`),M=v(o,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&h(o,t.lastIndex-1)!==` +`)&&(A=`(?: `+A+`)`,M=` `+M,j++),d=RegExp(`^(?:`+A+`)`,k)),x&&(d=RegExp(`^`+A+`$(?!\\s)`,k)),y&&(S=t.lastIndex),C=n(p,O?d:t,M),O?C?(C.input=v(C.input,j),C[0]=v(C[0],j),C.index=t.lastIndex,t.lastIndex+=C[0].length):t.lastIndex=0:y&&C&&(t.lastIndex=t.global?C.index+C[0].length:S),x&&C&&C.length>1&&n(f,C[0],d,function(){for(w=1;w{var e=K(),t=Ln();e({target:`RegExp`,proto:!0,forced:/./.exec!==t},{exec:t})})),zn=e(((e,t)=>{var n=re(),r=ae(),i=Je().f,a=Pt(),o=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch{return a(o)}};t.exports.f=function(e){return o&&n(e)===`Window`?s(e):i(r(e))}})),Bn=e(((e,t)=>{t.exports=F()(function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})})),Vn=e(((e,t)=>{var n=F(),r=U(),i=re(),a=Bn(),o=Object.isExtensible;t.exports=n(function(){o(1)})||a?function(e){return!r(e)||a&&i(e)===`ArrayBuffer`?!1:o?o(e):!0}:o})),Hn=e(((e,t)=>{t.exports=!F()(function(){return Object.isExtensible(Object.preventExtensions({}))})})),Un=e(((e,t)=>{var n=K(),r=z(),i=Ie(),a=U(),o=xe(),s=Ae().f,c=Je(),l=zn(),u=Vn(),d=Se(),f=Hn(),p=!1,m=d(`meta`),h=0,g=function(e){s(e,m,{value:{objectID:`O`+ h++,weakData:{}}})},_=t.exports={enable:function(){_.enable=function(){},p=!0;var e=c.f,t=r([].splice),i={};i[m]=1,e(i).length&&(c.f=function(n){for(var r=e(n),i=0,a=r.length;i{var n=K(),r=P(),i=z(),a=Qe(),o=ze(),s=Un(),c=Sn(),l=$t(),u=H(),d=ie(),f=U(),p=F(),m=Cn(),h=xt(),g=zt();t.exports=function(e,t,_){var v=e.indexOf(`Map`)!==-1,y=e.indexOf(`Weak`)!==-1,b=v?`set`:`add`,x=r[e],S=x&&x.prototype,C=x,w={},T=function(e){var t=i(S[e]);o(S,e,e===`add`?function(e){return t(this,e===0?0:e),this}:e===`delete`?function(e){return y&&!f(e)?!1:t(this,e===0?0:e)}:e===`get`?function(e){return y&&!f(e)?void 0:t(this,e===0?0:e)}:e===`has`?function(e){return y&&!f(e)?!1:t(this,e===0?0:e)}:function(e,n){return t(this,e===0?0:e,n),this})};if(a(e,!u(x)||!(y||S.forEach&&!p(function(){new x().entries().next()}))))C=_.getConstructor(t,e,v,b),s.enable();else if(a(e,!0)){var E=new C,D=E[b](y?{}:-0,1)!==E,O=p(function(){E.has(1)}),k=m(function(e){new x(e)}),A=!y&&p(function(){for(var e=new x,t=5;t--;)e[b](t,t);return!e.has(-0)});k||(C=t(function(e,t){l(e,S);var n=g(new x,e,C);return d(t)||c(t,n[b],{that:n,AS_ENTRIES:v}),n}),C.prototype=S,S.constructor=C),(O||A)&&(T(`delete`),T(`has`),v&&T(`get`)),(A||D)&&T(b),y&&S.clear&&delete S.clear}return w[e]=C,n({global:!0,constructor:!0,forced:C!==x},w),h(C,e),y||_.setStrong(C,e,v),C}})),Gn=e(((e,t)=>{var n=ze();t.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}})),Kn=e(((e,t)=>{var n=pt(),r=It(),i=Gn(),a=et(),o=$t(),s=ie(),c=Sn(),l=Dt(),u=Ot(),d=Qt(),f=I(),p=Un().fastKey,m=Le(),h=m.set,g=m.getterFor;t.exports={getConstructor:function(e,t,l,u){var d=e(function(e,r){o(e,m),h(e,{type:t,index:n(null),first:null,last:null,size:0}),f||(e.size=0),s(r)||c(r,e[u],{that:e,AS_ENTRIES:l})}),m=d.prototype,_=g(t),v=function(e,t,n){var r=_(e),i=y(e,t),a,o;return i?i.value=n:(r.last=i={index:o=p(t,!0),key:t,value:n,previous:a=r.last,next:null,removed:!1},r.first||=i,a&&(a.next=i),f?r.size++:e.size++,o!==`F`&&(r.index[o]=i)),e},y=function(e,t){var n=_(e),r=p(t),i;if(r!==`F`)return n.index[r];for(i=n.first;i;i=i.next)if(i.key===t)return i};return i(m,{clear:function(){for(var e=this,t=_(e),r=t.first;r;)r.removed=!0,r.previous&&=r.previous.next=null,r=r.next;t.first=t.last=null,t.index=n(null),f?t.size=0:e.size=0},delete:function(e){var t=this,n=_(t),r=y(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),f?n.size--:t.size--}return!!r},forEach:function(e){for(var t=_(this),n=a(e,arguments.length>1?arguments[1]:void 0),r;r=r?r.next:t.first;)for(n(r.value,r.key,this);r&&r.removed;)r=r.previous},has:function(e){return!!y(this,e)}}),i(m,l?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,e===0?0:e,t)}}:{add:function(e){return v(this,e=e===0?0:e,e)}}),f&&r(m,`size`,{configurable:!0,get:function(){return _(this).size}}),d},setStrong:function(e,t,n){var r=t+` Iterator`,i=g(t),a=g(r);l(e,t,function(e,t){h(this,{type:r,target:e,state:i(e),kind:t,last:null})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return!e.target||!(e.last=n=n?n.next:e.state.first)?(e.target=null,u(void 0,!0)):u(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1)},n?`entries`:`values`,!n,!0),d(t)}}})),qn=e((()=>{Wn()(`Set`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Kn())})),Jn=e((()=>{qn()})),Yn=e(((e,t)=>{var n=z(),r=Ve(),i=Vt(),a=V(),o=n(``.charAt),s=n(``.charCodeAt),c=n(``.slice),l=function(e){return function(t,n){var l=i(a(t)),u=r(n),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=s(l,u),f<55296||f>56319||u+1===d||(p=s(l,u+1))<56320||p>57343?e?o(l,u):f:e?c(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};t.exports={codeAt:l(!1),charAt:l(!0)}})),Xn=e((()=>{var e=Yn().charAt,t=Vt(),n=Le(),r=Dt(),i=Ot(),a=`String Iterator`,o=n.set,s=n.getterFor(a);r(String,`String`,function(e){o(this,{type:a,string:t(e),index:0})},function(){var t=s(this),n=t.string,r=t.index,a;return r>=n.length?i(void 0,!0):(a=e(n,r),t.index+=a.length,i(a,!1))})})),Zn=e(((e,t)=>{Rn();var n=R(),r=ze(),i=Ln(),a=F(),o=G(),s=je(),c=o(`species`),l=RegExp.prototype;t.exports=function(e,t,u,d){var f=o(e),p=!a(function(){var t={};return t[f]=function(){return 7},``[e](t)!==7}),m=p&&!a(function(){var t=!1,n=/a/;if(e===`split`){var r={};r[c]=function(){return n},n={constructor:r,flags:``},n[f]=/./[f]}return n.exec=function(){return t=!0,null},n[f](``),!t});if(!p||!m||u){var h=/./[f],g=t(f,``[e],function(e,t,r,a,o){var s=t.exec;return s===i||s===l.exec?p&&!o?{done:!0,value:n(h,t,r,a)}:{done:!0,value:n(e,r,t,a)}:{done:!1}});r(String.prototype,e,g[0]),r(l,f,g[1])}d&&s(l[f],`sham`,!0)}})),Qn=e(((e,t)=>{var n=Yn().charAt;t.exports=function(e,t,r){return t+(r?n(e,t).length:1)}})),$n=e(((e,t)=>{var n=z(),r=be(),i=Math.floor,a=n(``.charAt),o=n(``.replace),s=n(``.slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,n,u,d,f){var p=n+e.length,m=u.length,h=l;return d!==void 0&&(d=r(d),h=c),o(f,h,function(r,o){var c;switch(a(o,0)){case`$`:return`$`;case`&`:return e;case"`":return s(t,0,n);case`'`:return s(t,p);case`<`:c=d[s(o,1,-1)];break;default:var l=+o;if(l===0)return r;if(l>m){var f=i(l/10);return f===0?r:f<=m?u[f-1]===void 0?a(o,1):u[f-1]+a(o,1):r}c=u[l-1]}return c===void 0?``:c})}})),er=e(((e,t)=>{var n=P(),r=F(),i=n.RegExp;t.exports={correct:!r(function(){var e=!0;try{i(`.`,`d`)}catch{e=!1}var t={},n=``,r=e?`dgimsy`:`gimsy`,a=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},o={dotAll:`s`,global:`g`,ignoreCase:`i`,multiline:`m`,sticky:`y`};for(var s in e&&(o.hasIndices=`d`),o)a(s,o[s]);return Object.getOwnPropertyDescriptor(i.prototype,`flags`).get.call(t)!==r||n!==r})}})),tr=e(((e,t)=>{var n=R(),r=xe(),i=oe(),a=er(),o=Nn(),s=RegExp.prototype;t.exports=a.correct?function(e){return e.flags}:function(e){return!a.correct&&i(s,e)&&!r(e,`flags`)?n(o,e):e.flags}})),nr=e(((e,t)=>{var n=R(),r=ke(),i=H(),a=re(),o=Ln(),s=TypeError;t.exports=function(e,t){var c=e.exec;if(i(c)){var l=n(c,e,t);return l!==null&&r(l),l}if(a(e)===`RegExp`)return n(o,e,t);throw new s(`RegExp#exec called on incompatible receiver`)}})),rr=e((()=>{var e=nn(),t=R(),n=z(),r=Zn(),i=F(),a=ke(),o=H(),s=U(),c=Ve(),l=Ue(),u=Vt(),d=V(),f=Qn(),p=me(),m=$n(),h=tr(),g=nr(),_=G()(`replace`),v=Math.max,y=Math.min,b=n([].concat),x=n([].push),S=n(``.indexOf),C=n(``.slice),w=function(e){return e===void 0?e:String(e)},T=(function(){return`a`.replace(/./,`$0`)===`$0`})(),E=(function(){return/./[_]?/./[_](`a`,`$0`)===``:!1})();r(`replace`,function(n,r,i){var T=E?`$`:`$0`;return[function(e,n){var i=d(this),a=s(e)?p(e,_):void 0;return a?t(a,e,i,n):t(r,u(i),e,n)},function(t,n){var s=a(this),d=u(t);if(typeof n==`string`&&S(n,T)===-1&&S(n,`$<`)===-1){var p=i(r,s,d,n);if(p.done)return p.value}var _=o(n);_||(n=u(n));var E=u(h(s)),D=S(E,`g`)!==-1,O;D&&(O=S(E,`u`)!==-1,s.lastIndex=0);for(var k=[],A;A=g(s,d),!(A===null||(x(k,A),!D));)u(A[0])===``&&(s.lastIndex=f(d,l(s.lastIndex),O));for(var j=``,M=0,ee=0;ee=M&&(j+=C(d,M,P)+I,M=P+N.length)}return j+C(d,M)}]},!!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$`)!==`7`})||!T||E)})),ir=e(((e,t)=>{var n=Me().PROPER,r=F(),i=Ht(),a=`​…᠎`;t.exports=function(e){return r(function(){return!!i[e]()||a[e]()!==a||n&&i[e].name!==e})}})),ar=e((()=>{var e=K(),t=Ut().trim;e({target:`String`,proto:!0,forced:ir()(`trim`)},{trim:function(){return t(this)}})})),or=e(((e,t)=>{var n=U(),r=je();t.exports=function(e,t){n(t)&&`cause`in t&&r(e,`cause`,t.cause)}})),sr=e(((e,t)=>{var n=z(),r=Error,i=n(``.replace),a=(function(e){return String(new r(e).stack)})(`zxcasd`),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(a);t.exports=function(e,t){if(s&&typeof e==`string`&&!r.prepareStackTrace)for(;t--;)e=i(e,o,``);return e}})),cr=e(((e,t)=>{var n=F(),r=ne();t.exports=!n(function(){var e=Error(`a`);return`stack`in e?(Object.defineProperty(e,"stack",r(1,7)),e.stack!==7):!0})})),lr=e(((e,t)=>{var n=je(),r=sr(),i=cr(),a=Error.captureStackTrace;t.exports=function(e,t,o,s){i&&(a?a(e,t):n(e,`stack`,r(o,s)))}})),ur=e(((e,t)=>{var n=Vt();t.exports=function(e,t){return e===void 0?arguments.length<2?``:t:n(e)}})),dr=e((()=>{var e=K(),t=oe(),n=yt(),r=Et(),i=Ze(),a=pt(),o=je(),s=ne(),c=or(),l=lr(),u=Sn(),d=ur(),f=G()(`toStringTag`),p=Error,m=[].push,h=function(e,i){var s=t(g,this),_;r?_=r(new p,s?n(this):g):(_=s?this:a(g),o(_,f,`Error`)),i!==void 0&&o(_,`message`,d(i)),l(_,h,_.stack,1),arguments.length>2&&c(_,arguments[2]);var v=[];return u(e,m,{that:v}),o(_,`errors`,v),_};r?r(h,p):i(h,p,{name:!0});var g=h.prototype=a(p.prototype,{constructor:s(1,h),message:s(1,``),name:s(1,`AggregateError`)});e({global:!0,constructor:!0,arity:2},{AggregateError:h})})),fr=e((()=>{dr()})),pr=e((()=>{fr()})),mr=e((()=>{var e=K(),t=R(),n=pe(),r=gn(),i=pn(),a=Sn();e({target:`Promise`,stat:!0,forced:wn()},{allSettled:function(e){var o=this,s=r.f(o),c=s.resolve,l=s.reject,u=i(function(){var r=n(o.resolve),i=[],s=0,l=1;a(e,function(e){var n=s++,a=!1;l++,t(r,o,e).then(function(e){a||(a=!0,i[n]={status:`fulfilled`,value:e},--l||c(i))},function(e){a||(a=!0,i[n]={status:`rejected`,reason:e},--l||c(i))})}),--l||c(i)});return u.error&&l(u.value),s.promise}})})),hr=e((()=>{mr()})),gr=e((()=>{var e=K(),t=R(),n=pe(),r=W(),i=gn(),a=pn(),o=Sn(),s=wn(),c=`No one promise resolved`;e({target:`Promise`,stat:!0,forced:s},{any:function(e){var s=this,l=r(`AggregateError`),u=i.f(s),d=u.resolve,f=u.reject,p=a(function(){var r=n(s.resolve),i=[],a=0,u=1,p=!1;o(e,function(e){var n=a++,o=!1;u++,t(r,s,e).then(function(e){o||p||(p=!0,d(e))},function(e){o||p||(o=!0,i[n]=e,--u||f(new l(i,c)))})}),--u||f(new l(i,c))});return p.error&&f(p.value),u.promise}})})),_r=e((()=>{gr()})),vr=e(((e,t)=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}})),yr=e(((e,t)=>{var n=Te()(`span`).classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r})),br=e(((e,t)=>{var n=st().forEach;t.exports=At()(`forEach`)?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})),xr=e((()=>{var e=P(),t=vr(),n=yr(),r=br(),i=je(),a=function(e){if(e&&e.forEach!==r)try{i(e,`forEach`,r)}catch{e.forEach=r}};for(var o in t)t[o]&&a(e[o]&&e[o].prototype);a(n)})),Sr=e((()=>{var e=P(),t=vr(),n=yr(),r=kt(),i=je(),a=xt(),o=G()(`iterator`),s=r.values,c=function(e,n){if(e){if(e[o]!==s)try{i(e,o,s)}catch{e[o]=s}if(a(e,n,!0),t[n]){for(var c in r)if(e[c]!==r[c])try{i(e,c,r[c])}catch{e[c]=r[c]}}}};for(var l in t)c(e[l]&&e[l].prototype,l);c(n,`DOMTokenList`)}));lt(),ht(),gt(),kt(),jt(),Mt(),Ft(),Wt(),Kt(),qt(),Yt(),jn(),Mn(),Rn(),Jn(),Xn(),rr(),ar(),pr(),hr(),_r(),xr(),Sr(),Lt();var Cr={addStylesForComponents:function(e){var t=``;e[`background-toolbar`]&&(t+=`.loader-body, .loader-bg { background-color: `+e[`background-toolbar`]+`; } `,t+=`.loader-body { box-shadow: 0 0 99px 99px `+e[`background-toolbar`]+`; } `),e[`background-loader`]&&(t+=`.loader-image { color: `+e[`background-loader`]+`; } @@ -132,15 +132,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,t+=`.radio-button-container:hover .radio-visual, .checkbox-container:hover:not(.checkbox--disabled) .checkbox-visual { border-color: `+e[`border-control-focus`]+`; } `),t+=`body, input, textarea, select, button { font-size: `+n+`; } -`;var r=document.getElementById(`componentsStyles`);return r?(r.innerHTML=t,t):(r=document.createElement(`style`),r.id=`componentsStyles`,r.innerHTML=t,document.getElementsByTagName(`head`)[0].appendChild(r),t)},fixThemeForIE:function(e){return e[`background-toolbar`]||=`#f7f7f7`,e[`text-normal`]||=`rgb(51, 51, 51)`,e[`text-secondary`]||=`#848484`,e[`highlight-button-hover`]||=`#e0e0e0`,e[`background-normal`]||=`white`,e[`background-loader`]||=`rgba(24, 24, 24, 0.9)`,e[`highlight-button-pressed`]||=`#cbcbcb`,e[`text-inverse`]||=`white`,e[`border-regular-control`]||=`#c0c0c0`,e[`border-error`]||=`#f62211`,e[`border-control-focus`]||=`#848484`,e[`highlight-primary-dialog-button-hover`]||=`#1c1c1c`,e[`background-primary-dialog-button`]||=`#444444`,e[`background-toolbar-additional`]||=`#efefef`,e[`text-tertiary`]||=`#bdbdbd`,e}};function ar(){this._states=[`mainState`,`loginState`,`settingsState`],this._routes=[`main`,`login`,`settings`],this._currentRoute=`login`,this._currentRouteIndex=1,this._containers=this._states.map(function(e){var t=document.getElementById(e);if(!t)throw Error(`container ${e} not found`);return t})}ar.prototype.getRoute=function(){return this._currentRoute},ar.prototype._setCurrentRoute=function(e){this._containers[this._currentRouteIndex].classList.add(`hidden`),this._currentRoute=e,this._currentRouteIndex=this._routes.indexOf(e),this._containers[this._currentRouteIndex].classList.remove(`hidden`)},ar.prototype.openMain=function(){this._setCurrentRoute(`main`)},ar.prototype.openLogin=function(){this._setCurrentRoute(`login`)},ar.prototype.openSettings=function(){this._setCurrentRoute(`settings`)};var or={restApiUrl:`https://api.zotero.org/`,desktopApiUrl:`http://127.0.0.1:23119/api/`},sr={_done:!1,_desktop:!1,_hasPermission:!0,_online:!1,_hasKey:!1,_timeout:1e3,_callback:function(e){},_desktopVersion:function(){if(window.navigator&&window.navigator.userAgent.toLowerCase().indexOf(`ascdesktopeditor`)<0)return!1;if(window.location&&window.location.protocol==`file:`)return!0;var e=window.document.currentScript?window.document.currentScript.getAttribute(`src`):``;return!!(e&&e.indexOf(`file:///`)==0)}(),runApisChecker:function(e){var t=this;t._done=!1;function n(){t._done||t._checkApiAvailable(e).then(function(e){t._done||((e.online&&e.hasKey||e.desktop&&e.hasPermission)&&(t._done=!0),t._callback(e),setTimeout(n,t._timeout))})}return n(),{subscribe:function(e){t._callback=e},unsubscribe:function(){t._done=!0,t._callback=function(){}}}},checkStatus:function(e){return this._checkApiAvailable(e)},successfullyLoggedInUsingApiKey:function(){this._done=!0,this._callback({online:!0,hasKey:!0,desktop:this._desktop,hasPermission:this._hasPermission,desktopVersion:this._desktopVersion})},_checkApiAvailable:function(e){var t=this;return Promise.all([fetch(or.restApiUrl,{method:`GET`,cache:`no-cache`}).then(function(e){return e.status===200}).catch(function(){return!1}),t._sendDesktopRequest(or.desktopApiUrl).then(function(e){return t._hasPermission=e.hasPermission,e.isZoteroRunning}).catch(function(){return!1})]).then(function(n){return t._online=n[0],t._desktop=n[1],t._hasKey=e.hasSettings(),{online:t._online,hasKey:t._hasKey,desktop:t._desktop,hasPermission:t._hasPermission,desktopVersion:t._desktopVersion}})},_sendDesktopRequest:function(e){var t=this;return new Promise(function(n,r){if(!t._desktopVersion){n({hasPermission:!1,isZoteroRunning:!1});return}window.AscSimpleRequest.createRequest({url:e,method:`GET`,headers:{"Zotero-API-Version":`3`,"User-Agent":`AscDesktopEditor`},complete:function(e){var t=!1,r=!1;e.responseStatus==403?(t=!1,r=!0):e.responseStatus===200&&(r=!0,t=!0),n({hasPermission:t,isZoteroRunning:r})},error:function(e){e.statusCode==-102&&(e.statusCode=404),r(e)}})})}},cr=e(((e,t)=>{var n=V(),r=H(),i=wt();t.exports=function(e,t,a){var o,s;return i&&n(o=t.constructor)&&o!==a&&r(s=o.prototype)&&s!==a.prototype&&i(e,s),e}})),lr=e(((e,t)=>{t.exports=R()(1.1.valueOf)})),ur=e((()=>{var e=G(),t=ge(),n=F(),r=N(),i=Rt(),a=R(),o=Ze(),s=U(),c=cr(),l=oe(),u=de(),d=Se(),f=P(),p=qe().f,m=Ee().f,h=ke().f,g=lr(),_=Rn().trim,v=`Number`,y=r[v],b=i[v],x=y.prototype,S=r.TypeError,C=a(``.slice),w=a(``.charCodeAt),T=function(e){var t=d(e,`number`);return typeof t==`bigint`?t:E(t)},E=function(e){var t=d(e,`number`),n,r,i,a,o,s,c,l;if(u(t))throw new S(`Cannot convert a Symbol value to a number`);if(typeof t==`string`&&t.length>2){if(t=_(t),n=w(t,0),n===43||n===45){if(r=w(t,2),r===88||r===120)return NaN}else if(n===48){switch(w(t,1)){case 66:case 98:i=2,a=49;break;case 79:case 111:i=8,a=55;break;default:return+t}for(o=C(t,2),s=o.length,c=0;ca)return NaN;return parseInt(o,i)}}return+t},D=o(v,!y(` 0o1`)||!y(`0b1`)||y(`+0x1`)),O=function(e){return l(x,e)&&f(function(){g(e)})},k=function(e){var t=arguments.length<1?0:y(T(e));return O(this)?c(Object(t),this,k):t};k.prototype=x,D&&!t&&(x.constructor=k),e({global:!0,constructor:!0,wrap:!0,forced:D},{Number:k});var A=function(e,t){for(var r=n?p(t):`MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range`.split(`,`),i=0,a;r.length>i;i++)s(t,a=r[i])&&!s(e,a)&&h(e,a,m(t,a))};t&&b&&A(i[v],b),(D||t)&&A(i[v],y)})),dr=e(((e,t)=>{var n=P(),r=W(),i=F(),a=ge(),o=r(`iterator`);t.exports=!n(function(){var e=new URL(`b?a=1&b=2&c=3`,`https://a`),t=e.searchParams,n=new URLSearchParams(`a=1&a=2&b=3`),r=``;return e.pathname=`c%20d`,t.forEach(function(e,n){t.delete(`b`),r+=n+e}),n.delete(`a`,2),n.delete(`b`,void 0),a&&(!e.toJSON||!n.has(`a`,1)||n.has(`a`,2)||!n.has(`a`,void 0)||n.has(`b`))||!t.size&&(a||!i)||!t.sort||e.href!==`https://a/c%20d?a=1&c=3`||t.get(`c`)!==`3`||String(new URLSearchParams(`?a=1`))!==`a=1`||!t[o]||new URL(`https://a@b`).username!==`a`||new URLSearchParams(new URLSearchParams(`a=b`)).get(`a`)!==`b`||new URL(`https://тест`).host!==`xn--e1aybc`||new URL(`https://a#б`).hash!==`#%D0%B1`||r!==`a1c3`||new URL(`https://x`,void 0).host!==`x`})})),fr=e(((e,t)=>{var n=F(),r=R(),i=L(),a=P(),o=lt(),s=Je(),c=ee(),l=be(),u=ne(),d=Object.assign,f=Object.defineProperty,p=r([].concat);t.exports=!d||a(function(){if(n&&d({b:1},d(f({},`a`,{enumerable:!0,get:function(){f(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(`assign detection`),i=`abcdefghijklmnopqrst`;return e[r]=7,i.split(``).forEach(function(e){t[e]=e}),d({},e)[r]!==7||o(d({},t)).join(``)!==i})?function(e,t){for(var r=l(e),a=arguments.length,d=1,f=s.f,m=c.f;a>d;)for(var h=u(arguments[d++]),g=f?p(o(h),f(h)):o(h),_=g.length,v=0,y;_>v;)y=g[v++],(!n||i(m,h,y))&&(r[y]=h[y]);return r}:d})),pr=e(((e,t)=>{var n=Oe(),r=ln();t.exports=function(e,t,i,a){try{return a?t(n(i)[0],i[1]):t(i)}catch(t){r(e,`throw`,t)}}})),mr=e(((e,t)=>{var n=F(),r=ke(),i=te();t.exports=function(e,t,a){n?r.f(e,t,i(0,a)):e[t]=a}})),hr=e(((e,t)=>{var n=$e(),r=L(),i=be(),a=pr(),o=on(),s=rt(),c=Ue(),l=mr(),u=cn(),d=sn(),f=Array;t.exports=function(e){var t=i(e),p=s(this),m=arguments.length,h=m>1?arguments[1]:void 0,g=h!==void 0;g&&(h=n(h,m>2?arguments[2]:void 0));var _=d(t),v=0,y,b,x,S,C,w;if(_&&!(this===f&&o(_)))for(b=p?new this:[],S=u(t,_),C=S.next;!(x=r(C,S)).done;v++)w=g?a(S,h,[x.value,v],!0):x.value,l(b,v,w);else for(y=c(t),b=p?new this(y):f(y);y>v;v++)w=g?h(t[v],v):t[v],l(b,v,w);return b.length=v,b}})),gr=e(((e,t)=>{var n=R(),r=2147483647,i=36,a=1,o=26,s=38,c=700,l=72,u=128,d=`-`,f=/[^\0-\u007E]/,p=/[.\u3002\uFF0E\uFF61]/g,m=`Overflow: input needs wider integers to process`,h=i-a,g=RangeError,_=n(p.exec),v=Math.floor,y=String.fromCharCode,b=n(``.charCodeAt),x=n([].join),S=n([].push),C=n(``.replace),w=n(``.split),T=n(``.toLowerCase),E=function(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=v(e/t);e>h*o>>1;)e=v(e/h),r+=i;return v(r+(h+1)*e/(e+s))},k=function(e){var t=[];e=E(e);var n=e.length,s=u,c=0,f=l,p,h;for(p=0;p=s&&hv((r-c)/w))throw new g(m);for(c+=(C-s)*w,s=C,p=0;pr)throw new g(m);if(h===s){for(var T=c,k=i;;){var A=k<=f?a:k>=f+o?o:k-f;if(T{var e=G(),t=R(),n=Ve(),r=RangeError,i=String.fromCharCode,a=String.fromCodePoint,o=t([].join);e({target:`String`,stat:!0,arity:1,forced:!!a&&a.length!==1},{fromCodePoint:function(e){for(var t=[],a=arguments.length,s=0,c;a>s;){if(c=+arguments[s++],n(c,1114111)!==c)throw new r(c+` is not a valid code point`);t[s]=c<65536?i(c):i(((c-=65536)>>10)+55296,c%1024+56320)}return o(t,``)}})})),vr=e(((e,t)=>{var n=Re();t.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}})),yr=e(((e,t)=>{var n=Wt(),r=Math.floor,i=function(e,t){var a=e.length;if(a<8)for(var o=1,s,c;o0;)e[c]=e[--c];c!==o++&&(e[c]=s)}else for(var l=r(a/2),u=i(n(e,0,l),t),d=i(n(e,l),t),f=u.length,p=d.length,m=0,h=0;m{Dt(),_r();var n=G(),r=N(),i=Jt(),a=ae(),o=L(),s=R(),c=F(),l=dr(),u=Re(),d=jt(),f=vr(),p=yt(),m=bt(),h=Ie(),g=Bt(),_=V(),v=U(),y=$e(),b=nt(),x=Oe(),S=H(),C=xn(),w=ft(),T=te(),E=cn(),D=sn(),O=Et(),k=Gt(),A=W(),j=yr(),M=A(`iterator`),P=`URLSearchParams`,I=P+`Iterator`,ee=h.set,z=h.getterFor(P),ne=h.getterFor(I),re=i(`fetch`),B=i(`Request`),ie=i(`Headers`),oe=B&&B.prototype,se=ie&&ie.prototype,ce=r.TypeError,le=r.encodeURIComponent,ue=String.fromCharCode,de=a(`String`,`fromCodePoint`),fe=parseInt,pe=s(``.charAt),me=s([].join),he=s([].push),ge=s(``.replace),_e=s([].shift),ve=s([].splice),ye=s(``.split),be=s(``.slice),xe=s(/./.exec),Se=/\+/g,Ce=`�`,we=/^[0-9a-f]+$/i,Te=function(e,t){var n=be(e,t,t+2);return xe(we,n)?fe(n,16):NaN},Ee=function(e){for(var t=0,n=128;n>0&&(e&n)!==0;n>>=1)t++;return t},De=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},ke=function(e){e=ge(e,Se,` `);for(var t=e.length,n=``,r=0;rt){n+=`%`,r++;continue}var a=Te(e,r+1);if(a!==a){n+=i,r++;continue}r+=2;var o=Ee(a);if(o===0)i=ue(a);else{if(o===1||o>4){n+=Ce,r++;continue}for(var s=[a],c=1;ct||pe(e,r)!==`%`));){var l=Te(e,r+1);if(l!==l){r+=3;break}if(l>191||l<128)break;he(s,l),r+=2,c++}if(s.length!==o){n+=Ce;continue}var u=De(s);u===null?n+=Ce:i=de(u)}}n+=i,r++}return n},Ae=/[!'()~]|%20/g,je={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`},Me=function(e){return je[e]},Ne=function(e){return ge(le(e),Ae,Me)},Pe=m(function(e,t){ee(this,{type:I,target:z(e).entries,index:0,kind:t})},P,function(){var e=ne(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,O(void 0,!0);var r=t[n];switch(e.kind){case`keys`:return O(r.key,!1);case`values`:return O(r.value,!1)}return O([r.key,r.value],!1)},!0),Fe=function(e){this.entries=[],this.url=null,e!==void 0&&(S(e)?this.parseObject(e):this.parseQuery(typeof e==`string`?pe(e,0)===`?`?be(e,1):e:C(e)))};Fe.prototype={type:P,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,n=D(e),r,i,a,s,c,l,u;if(n)for(r=E(e,n),i=r.next;!(a=o(i,r)).done;){if(s=E(x(a.value)),c=s.next,(l=o(c,s)).done||(u=o(c,s)).done||!o(c,s).done)throw new ce(`Expected sequence with length 2`);he(t,{key:C(l.value),value:C(u.value)})}else for(var d in e)v(e,d)&&he(t,{key:d,value:C(e[d])})},parseQuery:function(e){if(e)for(var t=this.entries,n=ye(e,`&`),r=0,i,a;r0?arguments[0]:void 0,t=ee(this,new Fe(e));c||(this.size=t.entries.length)},ze=Le.prototype;if(f(ze,{append:function(e,t){var n=z(this);k(arguments.length,2),he(n.entries,{key:C(e),value:C(t)}),c||this.size++,n.updateURL()},delete:function(e){for(var t=z(this),n=k(arguments.length,1),r=t.entries,i=C(e),a=n<2?void 0:arguments[1],o=a===void 0?a:C(a),s=0;st.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=z(this).entries,n=y(e,arguments.length>1?arguments[1]:void 0),r=0,i;r1?He(arguments[1]):{})}}),_(B)){var Ue=function(e){return g(this,oe),new B(e,arguments.length>1?He(arguments[1]):{})};oe.constructor=Ue,Ue.prototype=oe,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ue})}}t.exports={URLSearchParams:Le,getState:z}})),xr=e((()=>{kn();var e=G(),t=F(),n=dr(),r=N(),i=$e(),a=R(),o=Re(),s=jt(),c=Bt(),l=U(),u=fr(),d=hr(),f=Wt(),p=On().codeAt,m=gr(),h=xn(),g=yt(),_=Gt(),v=br(),y=Ie(),b=y.set,x=y.getterFor(`URL`),S=v.URLSearchParams,C=v.getState,w=r.URL,T=r.TypeError,E=r.parseInt,D=Math.floor,O=Math.pow,k=a(``.charAt),A=a(/./.exec),j=a([].join),M=a(1.1.toString),P=a([].pop),I=a([].push),L=a(``.replace),ee=a([].shift),te=a(``.split),z=a(``.slice),ne=a(``.toLowerCase),re=a([].unshift),B=`Invalid authority`,ie=`Invalid scheme`,V=`Invalid host`,H=`Invalid port`,ae=/[a-z]/i,oe=/[\d+-.a-z]/i,se=/\d/,ce=/^0x/i,le=/^[0-7]+$/,ue=/^\d+$/,de=/^[\da-f]+$/i,fe=/[\0\t\n\r #%/:<>?@[\\\]^|]/,pe=/[\0\t\n\r #/:<>?@[\\\]^|]/,me=/^[\u0000-\u0020]+/,he=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ge=/[\t\n\r]/g,_e,ve=function(e){var t=te(e,`.`),n,r,i,a,o,s,c;if(t.length&&t[t.length-1]===``&&t.length--,n=t.length,n>4)return e;for(r=[],i=0;i1&&k(a,0)===`0`&&(o=A(ce,a)?16:8,a=z(a,o===8?1:2)),a===``)s=0;else{if(!A(o===10?ue:o===8?le:de,a))return e;s=E(a,o)}I(r,s)}for(i=0;i=O(256,5-n))return null}else if(s>255)return null;for(c=P(r),i=0;i6))return;for(s=0;f();){if(c=null,s>0)if(f()===`.`&&s<4)i++;else return;if(!A(se,f()))return;for(;A(se,f());){if(l=E(f(),10),c===null)c=l;else if(c===0)return;else c=c*10+l;if(c>255)return;i++}t[n]=t[n]*256+c,s++,(s===2||s===4)&&n++}if(s!==4)return;break}else if(f()===`:`){if(i++,!f())return}else if(f())return;t[n++]=a}if(r!==null)for(u=n-r,n=7;n!==0&&u>0;)d=t[n],t[n--]=t[r+u-1],t[r+--u]=d;else if(n!==8)return;return t},be=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)e[a]===0?(r===null&&(r=a),++i):(i>n&&(t=r,n=i),r=null,i=0);return i>n?r:t},xe=function(e){var t,n,r,i;if(typeof e==`number`){for(t=[],n=0;n<4;n++)re(t,e%256),e=D(e/256);return j(t,`.`)}if(typeof e==`object`){for(t=``,r=be(e),n=0;n<8;n++)i&&e[n]===0||(i&&=!1,r===n?(t+=n?`:`:`::`,i=!0):(t+=M(e[n],16),n<7&&(t+=`:`)));return`[`+t+`]`}return e},W={},Se=u({},W,{" ":1,'"':1,"<":1,">":1,"`":1}),Ce=u({},Se,{"#":1,"?":1,"{":1,"}":1}),we=u({},Ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(e,t){var n=p(e,0);return n>32&&n<127&&!l(t,e)?e:encodeURIComponent(e)},Ee={ftp:21,file:null,http:80,https:443,ws:80,wss:443},De=function(e,t){var n;return e.length===2&&A(ae,k(e,0))&&((n=k(e,1))===`:`||!t&&n===`|`)},Oe=function(e){var t;return e.length>1&&De(z(e,0,2))&&(e.length===2||(t=k(e,2))===`/`||t===`\\`||t===`?`||t===`#`)},ke=function(e){return e===`.`||ne(e)===`%2e`},Ae=function(e){return e=ne(e),e===`..`||e===`%2e.`||e===`.%2e`||e===`%2e%2e`},je={},Me={},Ne={},Pe={},Fe={},Le={},ze={},Be={},Ve={},He={},Ue={},We={},Ge={},Ke={},qe={},Je={},Ye={},Xe={},Ze={},Qe={},et={},tt=function(e,t,n){var r=h(e),i,a,o;if(t){if(a=this.parse(r),a)throw new T(a);this.searchParams=null}else{if(n!==void 0&&(i=new tt(n,!0)),a=this.parse(r,null,i),a)throw new T(a);o=C(new S),o.bindURL(this),this.searchParams=o}};tt.prototype={type:`URL`,parse:function(e,t,n){var r=this,i=t||je,a=0,o=``,s=!1,c=!1,u=!1,p,m,g,_;for(e=h(e),t||(r.scheme=``,r.username=``,r.password=``,r.host=null,r.port=null,r.path=[],r.query=null,r.fragment=null,r.cannotBeABaseURL=!1,e=L(e,me,``),e=L(e,he,`$1`)),e=L(e,ge,``),p=d(e);a<=p.length;){switch(m=p[a],i){case je:if(m&&A(ae,m))o+=ne(m),i=Me;else if(t)return ie;else{i=Ne;continue}break;case Me:if(m&&(A(oe,m)||m===`+`||m===`-`||m===`.`))o+=ne(m);else if(m===`:`){if(t&&(r.isSpecial()!==l(Ee,o)||o===`file`&&(r.includesCredentials()||r.port!==null)||r.scheme===`file`&&!r.host))return;if(r.scheme=o,t){r.isSpecial()&&Ee[r.scheme]===r.port&&(r.port=null);return}o=``,r.scheme===`file`?i=Ke:r.isSpecial()&&n&&n.scheme===r.scheme?i=Pe:r.isSpecial()?i=Be:p[a+1]===`/`?(i=Fe,a++):(r.cannotBeABaseURL=!0,I(r.path,``),i=Ze)}else if(t)return ie;else{o=``,i=Ne,a=0;continue}break;case Ne:if(!n||n.cannotBeABaseURL&&m!==`#`)return ie;if(n.cannotBeABaseURL&&m===`#`){r.scheme=n.scheme,r.path=f(n.path),r.query=n.query,r.fragment=``,r.cannotBeABaseURL=!0,i=et;break}i=n.scheme===`file`?Ke:Le;continue;case Pe:if(m===`/`&&p[a+1]===`/`)i=Ve,a++;else{i=Le;continue}break;case Fe:if(m===`/`){i=He;break}else{i=Xe;continue}case Le:if(r.scheme=n.scheme,m===_e)r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.query=n.query;else if(m===`/`||m===`\\`&&r.isSpecial())i=ze;else if(m===`?`)r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.query=``,i=Qe;else if(m===`#`)r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.query=n.query,r.fragment=``,i=et;else{r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.path.length--,i=Xe;continue}break;case ze:if(r.isSpecial()&&(m===`/`||m===`\\`))i=Ve;else if(m===`/`)i=He;else{r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,i=Xe;continue}break;case Be:if(i=Ve,m!==`/`||k(o,a+1)!==`/`)continue;a++;break;case Ve:if(m!==`/`&&m!==`\\`){i=He;continue}break;case He:if(m===`@`){s&&(o=`%40`+o),s=!0,g=d(o);for(var v=0;v65535)return H;r.port=r.isSpecial()&&x===Ee[r.scheme]?null:x,o=``}if(t)return;i=Ye;continue}else return H;break;case Ke:if(r.scheme=`file`,m===`/`||m===`\\`)i=qe;else if(n&&n.scheme===`file`)switch(m){case _e:r.host=n.host,r.path=f(n.path),r.query=n.query;break;case`?`:r.host=n.host,r.path=f(n.path),r.query=``,i=Qe;break;case`#`:r.host=n.host,r.path=f(n.path),r.query=n.query,r.fragment=``,i=et;break;default:Oe(j(f(p,a),``))||(r.host=n.host,r.path=f(n.path),r.shortenPath()),i=Xe;continue}else{i=Xe;continue}break;case qe:if(m===`/`||m===`\\`){i=Je;break}n&&n.scheme===`file`&&!Oe(j(f(p,a),``))&&(De(n.path[0],!0)?I(r.path,n.path[0]):r.host=n.host),i=Xe;continue;case Je:if(m===_e||m===`/`||m===`\\`||m===`?`||m===`#`){if(!t&&De(o))i=Xe;else if(o===``){if(r.host=``,t)return;i=Ye}else{if(_=r.parseHost(o),_)return _;if(r.host===`localhost`&&(r.host=``),t)return;o=``,i=Ye}continue}else o+=m;break;case Ye:if(r.isSpecial()){if(i=Xe,m!==`/`&&m!==`\\`)continue}else if(!t&&m===`?`)r.query=``,i=Qe;else if(!t&&m===`#`)r.fragment=``,i=et;else if(m!==_e&&(i=Xe,m!==`/`))continue;break;case Xe:if(m===_e||m===`/`||m===`\\`&&r.isSpecial()||!t&&(m===`?`||m===`#`)){if(Ae(o)?(r.shortenPath(),m!==`/`&&!(m===`\\`&&r.isSpecial())&&I(r.path,``)):ke(o)?m!==`/`&&!(m===`\\`&&r.isSpecial())&&I(r.path,``):(r.scheme===`file`&&!r.path.length&&De(o)&&(r.host&&=``,o=k(o,0)+`:`),I(r.path,o)),o=``,r.scheme===`file`&&(m===_e||m===`?`||m===`#`))for(;r.path.length>1&&r.path[0]===``;)ee(r.path);m===`?`?(r.query=``,i=Qe):m===`#`&&(r.fragment=``,i=et)}else o+=Te(m,Ce);break;case Ze:m===`?`?(r.query=``,i=Qe):m===`#`?(r.fragment=``,i=et):m!==_e&&(r.path[0]+=Te(m,W));break;case Qe:!t&&m===`#`?(r.fragment=``,i=et):m!==_e&&(m===`'`&&r.isSpecial()?r.query+=`%27`:m===`#`?r.query+=`%23`:r.query+=Te(m,W));break;case et:m!==_e&&(r.fragment+=Te(m,Se));break}a++}},parseHost:function(e){var t,n,r;if(k(e,0)===`[`){if(k(e,e.length-1)!==`]`||(t=ye(z(e,1,-1)),!t))return V;this.host=t}else if(this.isSpecial()){if(e=m(e),A(fe,e)||(t=ve(e),t===null))return V;this.host=t}else{if(A(pe,e))return V;for(t=``,n=d(e),r=0;r1?arguments[1]:void 0));t||(n.href=r.serialize(),n.origin=r.getOrigin(),n.protocol=r.getProtocol(),n.username=r.getUsername(),n.password=r.getPassword(),n.host=r.getHost(),n.hostname=r.getHostname(),n.port=r.getPort(),n.pathname=r.getPathname(),n.search=r.getSearch(),n.searchParams=r.getSearchParams(),n.hash=r.getHash())},rt=nt.prototype,it=function(e,t){return{get:function(){return x(this)[e]()},set:t&&function(e){return x(this)[t](e)},configurable:!0,enumerable:!0}};if(t&&(s(rt,`href`,it(`serialize`,`setHref`)),s(rt,`origin`,it(`getOrigin`)),s(rt,`protocol`,it(`getProtocol`,`setProtocol`)),s(rt,`username`,it(`getUsername`,`setUsername`)),s(rt,`password`,it(`getPassword`,`setPassword`)),s(rt,`host`,it(`getHost`,`setHost`)),s(rt,`hostname`,it(`getHostname`,`setHostname`)),s(rt,`port`,it(`getPort`,`setPort`)),s(rt,`pathname`,it(`getPathname`,`setPathname`)),s(rt,`search`,it(`getSearch`,`setSearch`)),s(rt,`searchParams`,it(`getSearchParams`)),s(rt,`hash`,it(`getHash`,`setHash`))),o(rt,`toJSON`,function(){return x(this).serialize()},{enumerable:!0}),o(rt,`toString`,function(){return x(this).serialize()},{enumerable:!0}),w){var at=w.createObjectURL,ot=w.revokeObjectURL;at&&o(nt,`createObjectURL`,i(at,w)),ot&&o(nt,`revokeObjectURL`,i(ot,w))}g(nt,`URL`),e({global:!0,constructor:!0,forced:!n,sham:!t},{URL:nt})})),Sr=e((()=>{xr()})),Cr=e((()=>{var e=G(),t=L();e({target:`URL`,proto:!0,enumerable:!0},{toJSON:function(){return t(URL.prototype.toString,this)}})})),wr=e((()=>{br()})),Tr=e(((e,t)=>{var n=TypeError,r=9007199254740991;t.exports=function(e){if(e>r)throw n(`Maximum allowed index exceeded`);return e}})),Er=e((()=>{var e=G(),t=P(),n=et(),r=H(),i=be(),a=Ue(),o=Tr(),s=mr(),c=at(),l=st(),u=W(),d=ce(),f=u(`isConcatSpreadable`),p=d>=51||!t(function(){var e=[];return e[f]=!1,e.concat()[0]!==e}),m=function(e){if(!r(e))return!1;var t=e[f];return t===void 0?n(e):!!t};e({target:`Array`,proto:!0,arity:1,forced:!p||!l(`concat`)},{concat:function(e){var t=i(this),n=c(t,0),r=0,l,u,d,f,p;for(l=-1,d=arguments.length;l{var n=H(),r=z(),i=W()(`match`);t.exports=function(e){var t;return n(e)&&((t=e[i])===void 0?r(e)===`RegExp`:!!t)}})),Or=e(((e,t)=>{var n=Dr(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`The method doesn't accept regular expressions`);return e}})),kr=e(((e,t)=>{var n=W()(`match`);t.exports=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[n]=!1,`/./`[e](t)}catch{}}return!1}})),Ar=e((()=>{var e=G(),t=R(),n=Or(),r=B(),i=xn(),a=kr(),o=t(``.indexOf);e({target:`String`,proto:!0,forced:!a(`includes`)},{includes:function(e){return!!~o(i(r(this)),i(n(e)),arguments.length>1?arguments[1]:void 0)}})})),jr=e(((e,t)=>{t.exports=!P()(function(){return Object.isExtensible(Object.preventExtensions({}))})})),Mr=e(((e,t)=>{var n=z(),r=ie(),i=qe().f,a=Wt(),o=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch{return a(o)}};t.exports.f=function(e){return o&&n(e)===`Window`?s(e):i(r(e))}})),Nr=e(((e,t)=>{t.exports=P()(function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})})),Pr=e(((e,t)=>{var n=P(),r=H(),i=z(),a=Nr(),o=Object.isExtensible;t.exports=n(function(){o(1)})||a?function(e){return!r(e)||a&&i(e)===`ArrayBuffer`?!1:o?o(e):!0}:o})),Fr=e(((e,t)=>{var n=G(),r=R(),i=Fe(),a=H(),o=U(),s=ke().f,c=qe(),l=Mr(),u=Pr(),d=xe(),f=jr(),p=!1,m=d(`meta`),h=0,g=function(e){s(e,m,{value:{objectID:`O`+ h++,weakData:{}}})},_=t.exports={enable:function(){_.enable=function(){},p=!0;var e=c.f,t=r([].splice),i={};i[m]=1,e(i).length&&(c.f=function(n){for(var r=e(n),i=0,a=r.length;i{var n=G(),r=N(),i=R(),a=Ze(),o=Re(),s=Fr(),c=un(),l=Bt(),u=V(),d=re(),f=H(),p=P(),m=dn(),h=yt(),g=cr();t.exports=function(e,t,_){var v=e.indexOf(`Map`)!==-1,y=e.indexOf(`Weak`)!==-1,b=v?`set`:`add`,x=r[e],S=x&&x.prototype,C=x,w={},T=function(e){var t=i(S[e]);o(S,e,e===`add`?function(e){return t(this,e===0?0:e),this}:e===`delete`?function(e){return y&&!f(e)?!1:t(this,e===0?0:e)}:e===`get`?function(e){return y&&!f(e)?void 0:t(this,e===0?0:e)}:e===`has`?function(e){return y&&!f(e)?!1:t(this,e===0?0:e)}:function(e,n){return t(this,e===0?0:e,n),this})};if(a(e,!u(x)||!(y||S.forEach&&!p(function(){new x().entries().next()}))))C=_.getConstructor(t,e,v,b),s.enable();else if(a(e,!0)){var E=new C,D=E[b](y?{}:-0,1)!==E,O=p(function(){E.has(1)}),k=m(function(e){new x(e)}),A=!y&&p(function(){for(var e=new x,t=5;t--;)e[b](t,t);return!e.has(-0)});k||(C=t(function(e,t){l(e,S);var n=g(new x,e,C);return d(t)||c(t,n[b],{that:n,AS_ENTRIES:v}),n}),C.prototype=S,S.constructor=C),(O||A)&&(T(`delete`),T(`has`),v&&T(`get`)),(A||D)&&T(b),y&&S.clear&&delete S.clear}return w[e]=C,n({global:!0,constructor:!0,forced:C!==x},w),h(C,e),y||_.setStrong(C,e,v),C}})),Lr=e(((e,t)=>{var n=R(),r=vr(),i=Fr().getWeakData,a=Bt(),o=Oe(),s=re(),c=H(),l=un(),u=ot(),d=U(),f=Ie(),p=f.set,m=f.getterFor,h=u.find,g=u.findIndex,_=n([].splice),v=0,y=function(e){return e.frozen||=new b},b=function(){this.entries=[]},x=function(e,t){return h(e.entries,function(e){return e[0]===t})};b.prototype={get:function(e){var t=x(this,e);if(t)return t[1]},has:function(e){return!!x(this,e)},set:function(e,t){var n=x(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,function(t){return t[0]===e});return~t&&_(this.entries,t,1),!!~t}},t.exports={getConstructor:function(e,t,n,u){var f=e(function(e,r){a(e,h),p(e,{type:t,id:v++,frozen:null}),s(r)||l(r,e[u],{that:e,AS_ENTRIES:n})}),h=f.prototype,g=m(t),_=function(e,t,n){var r=g(e),a=i(o(t),!0);return a===!0?y(r).set(t,n):a[r.id]=n,e};return r(h,{delete:function(e){var t=g(this);if(!c(e))return!1;var n=i(e);return n===!0?y(t).delete(e):n&&d(n,t.id)&&delete n[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var n=i(e);return n===!0?y(t).has(e):n&&d(n,t.id)}}),r(h,n?{get:function(e){var t=g(this);if(c(e)){var n=i(e);if(n===!0)return y(t).get(e);if(n)return n[t.id]}},set:function(e,t){return _(this,e,t)}}:{add:function(e){return _(this,e,!0)}}),f}}})),Rr=e((()=>{var e=jr(),t=N(),n=R(),r=vr(),i=Fr(),a=Ir(),o=Lr(),s=H(),c=Ie().enforce,l=P(),u=Ne(),d=Object,f=Array.isArray,p=d.isExtensible,m=d.isFrozen,h=d.isSealed,g=d.freeze,_=d.seal,v=!t.ActiveXObject&&`ActiveXObject`in t,y,b=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},x=a(`WeakMap`,b,o),S=x.prototype,C=n(S.set),w=function(){return e&&l(function(){var e=g([]);return C(new x,e,1),!m(e)})};if(u)if(v){y=o.getConstructor(b,`WeakMap`,!0),i.enable();var T=n(S.delete),E=n(S.has),D=n(S.get);r(S,{delete:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,T(this,e)||t.frozen.delete(e)}return T(this,e)},has:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)||t.frozen.has(e)}return E(this,e)},get:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)?D(this,e):t.frozen.get(e)}return D(this,e)},set:function(e,t){if(s(e)&&!p(e)){var n=c(this);n.frozen||=new y,E(this,e)?C(this,e,t):n.frozen.set(e,t)}else C(this,e,t);return this}})}else w()&&r(S,{set:function(e,t){var n;return f(e)&&(m(e)?n=g:h(e)&&(n=_)),C(this,e,t),n&&n(e),this}})})),zr=e((()=>{Rr()})),Br=e((()=>{Ir()(`WeakSet`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Lr())})),Vr=e((()=>{Br()}));ur(),Sr(),Cr(),wr(),Er(),Ar(),zr(),Vr();var Hr=new WeakMap,Ur=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,Kr=new WeakMap,qr=new WeakMap,Jr=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Zr=new WeakMap,Qr=new WeakSet,$r=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};l(this,e),p(this,Qr),d(this,Hr,void 0),d(this,Ur,void 0),d(this,Wr,void 0),d(this,Gr,void 0),d(this,Kr,void 0),d(this,qr,void 0),d(this,Jr,void 0),d(this,Yr,void 0),d(this,Xr,void 0),d(this,Zr,void 0),f(Hr,this,t.maxRetries||5),f(Ur,this,t.initialDelay||1e3),f(Wr,this,t.maxDelay||5e3),f(Gr,this,t.backoffFactor||2),f(Kr,this,t.retryOn||[429,502,503,504]),f(qr,this,10),f(Jr,this,5e3),f(Yr,this,[]),f(Xr,this,0),f(Zr,this,0)}return h(e,[{key:`fetchWithRetry`,value:function(){var e=s(w().m(function e(t,n,r){var i,o,s,c,l;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a(Qr,this,ti).call(this);case 1:return e.n=2,fetch(t,{headers:n});case 2:if(i=e.v,!i.ok){e.n=3;break}return e.a(2,i);case 3:if(!(u(Kr,this).includes(i.status)&&r=u(Hr,this))){e.n=7;break}throw s=``,l instanceof Error&&(s=l.message),Error(`Request failed after ${u(Hr,this)} attempts: ${s}`);case 7:if(!(r=u(qr,this))){e.n=2;break}if(n=u(Yr,this)[0],r=Date.now()-n,!(r0)){e.n=3;break}return e.n=3,a(Qr,this,ii).call(this,c-s);case 3:f(Zr,this,Date.now());case 4:return e.a(2)}},e,this)})),ni.apply(this,arguments)}function ri(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)?.headers.get(`Retry-After`);if(t){var n=parseInt(t);if(n>86400){var r=parseInt(t)*1e3;return Math.max(0,r-Date.now())}return n*1e3}var i=u(Ur,this)*u(Gr,this)**+e,a=Math.random()*1e3;return Math.min(i+a,u(Wr,this))}function ii(e){return new Promise(function(t){return setTimeout(t,e)})}var ai=function(){this._apiKey=null,this._userId=0,this._userGroups=[],this._isOnlineAvailable=!0,this._fetcher=new $r({maxRetries:5,initialDelay:5e3})};ai.prototype.ZOTERO_API_VERSION=`3`,ai.prototype.USER_AGENT=`AscDesktopEditor`,ai.prototype.DEFAULT_FORMAT=`csljson`,ai.prototype.STORAGE_KEYS={USER_ID:`zoteroUserId`,API_KEY:`zoteroApiKey`},ai.prototype.API_PATHS={USERS:`users`,GROUPS:`groups`,ITEMS:`items`,KEYS:`keys`},ai.prototype._getBaseUrl=function(){return this._isOnlineAvailable?or.restApiUrl:or.desktopApiUrl},ai.prototype._getDesktopRequest=function(e){var t=this;return new Promise(function(n,r){window.AscSimpleRequest.createRequest({url:e,method:`GET`,headers:{"Zotero-API-Version":t.ZOTERO_API_VERSION,"User-Agent":t.USER_AGENT},complete:n,error:function(e){e.statusCode===-102&&(e.statusCode=404,e.message=`Connection to Zotero failed. Make sure Zotero is running`),r(e)}})})},ai.prototype._getOnlineRequest=function(e){var t={"Zotero-API-Version":this.ZOTERO_API_VERSION,"Zotero-API-Key":this._apiKey||``};return fetch(e,{headers:t}).then(function(e){if(!e.ok){var t=e.status+` `+e.statusText;throw console.error(t),Error(t)}return e}).catch(function(e){throw A(e)===`object`&&(e.message=`Connection to Zotero failed`),e})},ai.prototype._getRequestWithOfflineSupport=function(e){return this._isOnlineAvailable?this._getOnlineRequest(e):this._getDesktopRequest(e.href)},ai.prototype._buildGetRequest=function(e,t){t||={};var n=new URL(e,this._getBaseUrl());return Object.keys(t).forEach(function(e){t[e]!==void 0&&t[e]!==null&&n.searchParams.append(e,t[e])}),this._getRequestWithOfflineSupport(n)},ai.prototype._parseLinkHeader=function(e){var t={},n=/<(.*?)>; rel="(.*?)"/g;if(!e)return t;for(var r;(r=n.exec(e.trim()))!==null;)t[r[2]]=r[1];return t},ai.prototype._parseDesktopItemsResponse=function(e,t){return e.then(function(e){return{items:JSON.parse(e.responseText),id:t}})},ai.prototype._parseItemsResponse=function(e,t){var n=this;return e.then(function(e){return Promise.all([e.json(),e])}).then(function(e){var r=e[0],i=e[1],a=n._parseLinkHeader(i.headers.get(`Link`)||``),o={items:r,id:t};return A(r)===`object`&&r.items&&(o.items=r.items),a.next&&(o.next=function(){return n._parseItemsResponse(n._getOnlineRequest(new URL(a.next)),t)}),o})},ai.prototype._parseResponse=function(e,t){if(this._isOnlineAvailable){var n=e;return this._parseItemsResponse(n,t)}else{var r=e;return this._parseDesktopItemsResponse(r,t)}},ai.prototype.getItems=function(e,t,n){var r=this;n||=r.DEFAULT_FORMAT;var i={format:n,itemType:`-attachment`};e?i.q=e:t?i.itemKey=t.join(`,`):(i.limit=20,this._isOnlineAvailable||(i.format=`json`));var a=r.API_PATHS.USERS+`/`+r._userId+`/`+r.API_PATHS.ITEMS,o=r._buildGetRequest(a,i);return r._parseResponse(o,r._userId)},ai.prototype.getGroupItems=function(e,t,n,r){var i=this;r||=i.DEFAULT_FORMAT;var a={format:r};e?a.q=e:n&&(a.itemKey=n.join(`,`));var o=i.API_PATHS.GROUPS+`/`+t+`/`+i.API_PATHS.ITEMS,s=i._buildGetRequest(o,a);return i._parseResponse(s,t)},ai.prototype.getUserGroups=function(){var e=this;return new Promise(function(t,n){if(e._userGroups.length>0){t(e._userGroups);return}var r=e.API_PATHS.USERS+`/`+e._userId+`/groups`;e._buildGetRequest(r).then(function(t){if(e._isOnlineAvailable){var n=t;if(!n.ok)throw Error(n.status+` `+n.statusText);return n.json()}return JSON.parse(t.responseText)}).then(function(n){e._userGroups=n.map(function(e){return{id:e.id,name:e.data.name}}),t(e._userGroups)}).catch(n)})},ai.prototype.setApiKey=function(e){var t=this,n=this.API_PATHS.KEYS+`/`+e;return this._buildGetRequest(n).then(function(e){var t=e;if(!t.ok)throw Error(t.status+` `+t.statusText);return t.json()}).then(function(n){return t._saveSettings(n.userID,e),!0})},ai.prototype._applySettings=function(e,t){this._userId=e,this._apiKey=t},ai.prototype._saveSettings=function(e,t){this._applySettings(e,t),localStorage.setItem(this.STORAGE_KEYS.USER_ID,String(e)),localStorage.setItem(this.STORAGE_KEYS.API_KEY,t)},ai.prototype.hasSettings=function(){var e=localStorage.getItem(this.STORAGE_KEYS.USER_ID),t=localStorage.getItem(this.STORAGE_KEYS.API_KEY);return e&&t?(this._applySettings(Number(e),t),!0):!1},ai.prototype.clearSettings=function(){localStorage.removeItem(this.STORAGE_KEYS.USER_ID),localStorage.removeItem(this.STORAGE_KEYS.API_KEY),this._userGroups=[],this._userId=0,this._apiKey=null},ai.prototype.getUserId=function(){return this._userId},ai.prototype.setIsOnlineAvailable=function(e){this._isOnlineAvailable=e};var oi=e((()=>{var e=je().PROPER,t=Re(),n=Oe(),r=xn(),i=P(),a=Pn(),o=`toString`,s=RegExp.prototype,c=s[o],l=i(function(){return c.call({source:`a`,flags:`b`})!==`/a/b`}),u=e&&c.name!==o;(l||u)&&t(s,o,function(){var e=n(this),t=r(e.source),i=r(a(e));return`/`+t+`/`+i},{unsafe:!0})})),si=e((()=>{var e=G(),t=et(),n=rt(),r=H(),i=Ve(),a=Ue(),o=ie(),s=mr(),c=W(),l=st(),u=Wt(),d=l(`slice`),f=c(`species`),p=Array,m=Math.max;e({target:`Array`,proto:!0,forced:!d},{slice:function(e,c){var l=o(this),d=a(l),h=i(e,d),g=i(c===void 0?d:c,d),_,v,y;if(t(l)&&(_=l.constructor,n(_)&&(_===p||t(_.prototype))?_=void 0:r(_)&&(_=_[f],_===null&&(_=void 0)),_===p||_===void 0))return u(l,h,g);for(v=new(_===void 0?p:_)(m(g-h,0)),y=0;h{var n=ke().f;t.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}})),li=e((()=>{var e=F(),t=N(),n=R(),r=Ze(),i=cr(),a=Ae(),o=ft(),s=qe().f,c=oe(),l=Dr(),u=xn(),d=Pn(),f=Cn(),p=ci(),m=Re(),h=P(),g=U(),_=Ie().enforce,v=zt(),y=W(),b=wn(),x=Tn(),S=y(`match`),C=t.RegExp,w=C.prototype,T=t.SyntaxError,E=n(w.exec),D=n(``.charAt),O=n(``.replace),k=n(``.indexOf),A=n(``.slice),j=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,I=/a/g,L=new C(M)!==M,ee=f.MISSED_STICKY,te=f.UNSUPPORTED_Y,z=e&&(!L||ee||b||x||h(function(){return I[S]=!1,C(M)!==M||C(I)===I||String(C(M,`i`))!==`/a/i`})),ne=function(e){for(var t=e.length,n=0,r=``,i=!1,a;n<=t;n++){if(a=D(e,n),a===`\\`){r+=a+D(e,++n);continue}!i&&a===`.`?r+=`[\\s\\S]`:(a===`[`?i=!0:a===`]`&&(i=!1),r+=a)}return r},re=function(e){for(var t=e.length,n=0,r=``,i=[],a=o(null),s=!1,c=!1,l=0,u=``,d;n<=t;n++){if(d=D(e,n),d===`\\`)d+=D(e,++n);else if(d===`]`)s=!1;else if(!s)switch(!0){case d===`[`:s=!0;break;case d===`(`:if(r+=d,A(e,n+1,n+3)===`?:`)continue;E(j,A(e,n+1))&&(n+=2,c=!0),l++;continue;case d===`>`&&c:if(u===``||g(a,u))throw new T(`Invalid capture group name`);a[u]=!0,i[i.length]=[u,l],c=!1,u=``;continue}c?u+=d:r+=d}return[r,i]};if(r(`RegExp`,z)){for(var B=function(e,t){var n=c(w,this),r=l(e),o=t===void 0,s=[],f=e,p,m,h,g,v,y;if(!n&&r&&o&&e.constructor===B)return e;if((r||c(w,e))&&(e=e.source,o&&(t=d(f))),e=e===void 0?``:u(e),t=t===void 0?``:u(t),f=e,b&&`dotAll`in M&&(m=!!t&&k(t,`s`)>-1,m&&(t=O(t,/s/g,``))),p=t,ee&&`sticky`in M&&(h=!!t&&k(t,`y`)>-1,h&&te&&(t=O(t,/y/g,``))),x&&(g=re(e),e=g[0],s=g[1]),v=i(C(e,t),n?this:w,B),(m||h||s.length)&&(y=_(v),m&&(y.dotAll=!0,y.raw=B(ne(e),p)),h&&(y.sticky=!0),s.length&&(y.groups=s)),e!==f)try{a(v,`source`,f===``?`(?:)`:f)}catch{}return v},ie=s(C),V=0;ie.length>V;)p(B,C,ie[V++]);w.constructor=B,B.prototype=w,m(t,`RegExp`,B,{constructor:!0})}v(`RegExp`)})),ui=e(((e,t)=>{t.exports=Object.is||function(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}})),di=e((()=>{var e=L(),t=An(),n=Oe(),r=H(),i=B(),a=ui(),o=xn(),s=me(),c=Fn();t(`search`,function(t,l,u){return[function(n){var a=i(this),c=r(n)?s(n,t):void 0;return c?e(c,n,a):new RegExp(n)[t](o(a))},function(e){var t=n(this),r=o(e),i=u(l,t,r);if(i.done)return i.value;var s=t.lastIndex;a(s,0)||(t.lastIndex=0);var d=c(t,r);return a(t.lastIndex,s)||(t.lastIndex=s),d===null?-1:d.index}]})}));si(),li(),oi(),di();function fi(e,t){var n=this;if(t||={},typeof e==`string`){var r=document.getElementById(e);r instanceof HTMLInputElement&&(e=r)}if(e instanceof HTMLInputElement)this.input=e;else throw Error(`Invalid input element`);for(var i in this._container=document.createElement(`div`),this._options={type:t.type||e.type||`text`,placeholder:t.placeholder||e.placeholder||``,value:t.value||e.value||``,autofocus:t.autofocus||!1,disabled:t.disabled||!1,readonly:t.readonly||!1,required:t.required||!1,showCounter:t.showCounter||!1,showClear:t.showClear===void 0?!0:t.showClear,autocomplete:t.autocomplete||`off`},t)this._options.hasOwnProperty(i)||(this._options[i]=t[i]);this._id=e.id||`input_`+Math.random().toString(36).slice(2,9),this.isFocused=!1,this.isValid=!0,this._validationMessage=``,this._subscribers=[],this._boundHandles={focus:function(e){n._handleFocus(e)},blur:function(e){n._handleBlur(e)},input:function(e){n._handleInput(e)},keydown:function(e){n._handleKeydown(e)},clear:function(){n.clear()},validate:function(){n.validate()}},this._clearButton=null,this._counter=null,this._counterCurrent=null,this._counterMax=null,this._validationElement=document.createElement(`div`),this._options.type===`search`&&(this._searchIcon=document.createElement(`span`),this._boundHandles.search=this._triggerSubmit.bind(this),this._container.classList.add(`input-field-search`)),this._createDOM(),this._bindEvents(),this._updateState(),this._options.autofocus&&setTimeout(function(e){return function(){e.focus()}}(this),100)}fi.prototype={constructor:fi,input:null,_container:null,_options:{},_id:``,isFocused:!1,isValid:!0,_validationMessage:``,_subscribers:[],_boundHandles:null,_clearButton:null,_counter:null,_counterCurrent:null,_counterMax:null,_validationElement:null,_createDOM:function(){var e=this.input.parentNode,t=document.createDocumentFragment();t.appendChild(this._container),this._container.className+=` input-field-container input-field-container-`+this._id;var n=document.createElement(`div`);this._container.appendChild(n),n.className+=` input-field`,this._options.disabled&&(n.className+=` input-field-disabled`);var r=document.createElement(`div`);if(n.appendChild(r),r.className+=` input-field-main`,this.input.className+=` input-field-element i18n`,this.input.type=this._options.type||`text`,this.input.placeholder=this._options.placeholder||``,this.input.value=String(this._options.value)||``,this._options.disabled&&(this.input.disabled=!0),this._options.readonly&&(this.input.readOnly=!0),this._options.required&&(this.input.required=!0),this._options.maxLength&&(this.input.maxLength=this._options.maxLength),this._options.pattern&&(this.input.pattern=this._options.pattern),this._options.autocomplete&&(this.input.autocomplete=this._options.autocomplete),this._options.showCounter){this._counter=document.createElement(`div`),n.appendChild(this._counter),this._counter.className+=` input-field-counter`,this._counterCurrent=document.createElement(`span`),this._counterCurrent.className+=` input-field-counter-current`,this._counterCurrent.textContent=`0`,this._counter.appendChild(this._counterCurrent);var i=document.createElement(`span`);i.textContent=`/`,this._counter.appendChild(i),this._counterMax=document.createElement(`span`),this._counterMax.className+=` input-field-counter-max`,this._counterMax.textContent=String(this._options.maxLength)||`∞`,this._counter.appendChild(this._counterMax)}n.appendChild(this._validationElement),this._validationElement.className+=` input-field-validation`,this._validationElement.style.display=`none`,this._options.showClear&&(this.input.className+=` input-field-clearable`,this._clearButton=document.createElement(`button`),n.appendChild(this._clearButton),this._clearButton.className+=` input-field-clear`,this._clearButton.style.display=`none`,this._clearButton.textContent=`×`),this._options.showSearchIcon&&(this._searchIcon.classList.add(`input-field-search-icon`),this._searchIcon.innerHTML=``,r.appendChild(this._searchIcon)),e&&e.insertBefore(t,this.input),r.appendChild(this.input)},_bindEvents:function(){this.input.addEventListener(`focus`,this._boundHandles.focus),this.input.addEventListener(`blur`,this._boundHandles.blur),this.input.addEventListener(`input`,this._boundHandles.input),this.input.addEventListener(`keydown`,this._boundHandles.keydown),this._clearButton&&this._clearButton.addEventListener(`click`,this._boundHandles.clear),this._options.showSearchIcon&&this._boundHandles.search&&this._searchIcon.addEventListener(`click`,this._boundHandles.search),this.input.addEventListener(`change`,this._boundHandles.validate)},_handleFocus:function(e){this.isFocused=!0,this._container.className+=` input-field-focused`,this._updateClearButton(),this._triggerFocusEvent(e)},_handleBlur:function(e){this.isFocused=!1;for(var t=this._container.className.split(` `),n=[],r=0;r0;this._clearButton.style.display=e?`block`:`none`}},_updateCounter:function(){if(this._counter&&this._options.maxLength){var e=this.input.value.length,t=this._options.maxLength;if(this._counterCurrent&&(this._counterCurrent.textContent=String(e)),this._counterMax&&(this._counterMax.textContent=String(t)),e>t*.9){var n=this._counter.className.split(` `);n.indexOf(`input-field-counter-warning`)===-1&&(this._counter.className+=` input-field-counter-warning`)}else this._counter.className=this._counter.className.split(` `).filter(function(e){return e!==`input-field-counter-warning`}).join(` `);if(e>t){var n=this._counter.className.split(` `);n.indexOf(`input-field-counter-error`)===-1&&(this._counter.className+=` input-field-counter-error`)}else this._counter.className=this._counter.className.split(` `).filter(function(e){return e!==`input-field-counter-error`}).join(` `)}},validate:function(){if(!this._options.validation)return this.isValid=!0,!0;var e=this.input.value,t=!0,n=``;if(this._options.required&&!e.trim()?(t=!1,n=`This field is required`):this._options.minLength&&e.lengththis._options.maxLength?(t=!1,n=`Maximum length is `+this._options.maxLength+` characters`):this._options.pattern&&!new RegExp(this._options.pattern).test(e)&&(t=!1,n=`Invalid format`),t&&typeof this._options.validation==`function`){var r=this._options.validation(e);r&&!r.isValid&&(t=!1,n=r.message||`Invalid value`)}return this.isValid=t,this._validationMessage=n,this.updateValidationState(),t},updateValidationState:function(){if(!this.isValid){this._validationElement.textContent=this._validationMessage,this._validationElement.style.display=`block`;var e=this._container.className.split(` `);e.indexOf(`input-field-invalid`)===-1&&(this._container.className+=` input-field-invalid`),this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-valid`}).join(` `)}else if(this.input.value.length>0){this._validationElement.style.display=`none`;var e=this._container.className.split(` `);e.indexOf(`input-field-valid`)===-1&&(this._container.className+=` input-field-valid`),this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-invalid`}).join(` `)}else this._validationElement.style.display=`none`,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-valid`&&e!==`input-field-invalid`}).join(` `)},_updateState:function(){this._updateClearButton(),this._updateCounter(),this.validate()},getValue:function(){return this.input.value.trim()},setValue:function(e){this.input.value=e,this._updateState(),this._triggerChange()},setPlaceholder:function(e){this.input.placeholder=e,this._options.placeholder=e},clear:function(e){e=e===void 0?!0:e,this.setValue(``),e&&this.input.focus()},focus:function(){this.input.focus()},blur:function(){this.input.blur()},enable:function(){this.input.disabled=!1,this._options.disabled=!1,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-disabled`}).join(` `)},disable:function(){this.input.disabled=!0,this._options.disabled=!0,this._container.className.split(` `).indexOf(`input-field-disabled`)===-1&&(this._container.className+=` input-field-disabled`)},subscribe:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},_triggerInputEvent:function(e){var t={value:this.input.value,originalEvent:e};this._subscribers.forEach(function(e){e({type:`inputfield:input`,detail:t})})},_triggerFocusEvent:function(e){var t={value:this.input.value,originalEvent:e};this._subscribers.forEach(function(e){e({type:`inputfield:focus`,detail:t})})},_triggerBlurEvent:function(e){var t={value:this.input.value,originalEvent:e};this._subscribers.forEach(function(e){e({type:`inputfield:blur`,detail:t})})},_triggerChange:function(){var e={value:this.input.value,isValid:this.isValid};this._subscribers.forEach(function(t){t({type:`inputfield:change`,detail:e})})},_triggerSubmit:function(){var e={value:this.input.value,isValid:this.isValid};this._subscribers.forEach(function(t){t({type:`inputfield:submit`,detail:e})})},destroy:function(){if(this._subscribers=[],this._boundHandles)try{this.input.removeEventListener(`focus`,this._boundHandles.focus),this.input.removeEventListener(`blur`,this._boundHandles.blur),this.input.removeEventListener(`input`,this._boundHandles.input),this.input.removeEventListener(`keydown`,this._boundHandles.keydown),this._clearButton&&this._clearButton.removeEventListener(`click`,this._boundHandles.clear),this._options.showSearchIcon&&this._boundHandles.search&&this._searchIcon.removeEventListener(`click`,this._boundHandles.search),this.input.removeEventListener(`change`,this._boundHandles.validate)}catch(e){console.error(e)}this._container.innerHTML=``,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-container`}).join(` `)}},e((()=>{var e=G(),t=fr();e({target:`Object`,stat:!0,arity:2,forced:Object.assign!==t},{assign:t})}))();function pi(e,t){if(typeof e==`string`){var n=document.getElementById(e);n instanceof HTMLElement&&(e=n)}if(e instanceof HTMLElement)this.container=e;else throw Error(`Invalid container element`);this._options=Object.assign(this._options,t),this._isShow=!1}pi.prototype={constructor:pi,_options:{type:`info`,text:``,title:``,duration:0,closeButton:!0,autoClose:!1,closeOnClickOutside:!0},_outsideClickListener:null,_element:null,_timeoutId:null,_create:function(){var e=document.createElement(`div`);e.className=`message message-`+this._options.type,e.setAttribute(`role`,`alert`);var t=this._options.title;if(!t)switch(t=`Error`,this._options.type){case`success`:t=`Success`;break;case`warning`:t=`Warning`;break;case`info`:t=`Information`;break}var n=this._options.text;if(!n)switch(n=``,this._options.type){case`success`:n=`Operation completed successfully.`;break;case`warning`:n=`Please be cautious.`;break;case`error`:n=`Something went wrong.`;break}if(e.innerHTML=`
`+t+``+n+`
`,this._options.closeButton){var r=document.createElement(`button`);r.className=`message-close`,r.textContent=`×`,r.setAttribute(`aria-label`,`Close`),r.onclick=this.close.bind(this),e.appendChild(r)}return e},addOutsideClickListener:function(){this._outsideClickListener&&document.removeEventListener(`click`,this._outsideClickListener);var e=this;this._outsideClickListener=function(t){t.target instanceof HTMLElement&&e._element&&!e._element.contains(t.target)&&e.close()},setTimeout(function(){e._outsideClickListener&&document.addEventListener(`click`,e._outsideClickListener)},10)},removeOutsideClickListener:function(){this._outsideClickListener&&=(document.removeEventListener(`click`,this._outsideClickListener),null)},show:function(e,t){if(this._isShow)return this;this._isShow=!0,this.container.classList.contains(`message-container`)||this.container.classList.add(`message-container`),t&&(this._options.title=t),e&&(this._options.text=e);var n=this._create();return this._element=n,this.container.appendChild(n),setTimeout(function(){n.style.opacity=`1`,n.style.transform=`translateY(0)`},10),this._options.autoClose&&Number(this._options.duration)>0&&(this._timeoutId=setTimeout(this.close.bind(this),this._options.duration)),this._options.closeOnClickOutside&&this.addOutsideClickListener(),this},close:function(){if(this._isShow=!1,!(!this._element||!this._element.parentNode)){this._timeoutId&&=(clearTimeout(this._timeoutId),null),this.removeOutsideClickListener();var e=this._element;e.style.opacity=`0`,e.style.transform=`translateY(-20px)`,setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},300)}}};function mi(e,t){var n=this;if(typeof e==`string`){var r=document.getElementById(e);r instanceof HTMLButtonElement&&(e=r)}if(e instanceof HTMLButtonElement)this._button=e;else throw Error(`Invalid button`);this._container=document.createElement(`div`),this._options=t||{},this._options.text=this._options.text||e.textContent.trim(),this._options.type=this._options.type||`button`,this._options.variant=this._options.variant||`primary`,this._options.size=this._options.size||`medium`,this._options.iconPosition=this._options.iconPosition||`left`,this.isLoading=!1,this._originalText=this._options.text,this._subscribers=[],this._boundHandles={click:function(e){n._handleClick(e)},mouseenter:function(){n._handleMouseEnter()},mouseleave:function(){n._handleMouseLeave()},focus:function(){n._handleFocus()},blur:function(){n._handleBlur()},keydown:function(e){n._handleKeydown(e)}},this._createDOM(),this._bindEvents(),this.updateState()}mi.prototype={constructor:mi,_button:null,_buttonText:null,_spinner:null,_badgeElement:null,_createDOM:function(){var e=this._button.parentNode,t=document.createDocumentFragment();if(t.appendChild(this._container),this._container.className+=` custom-button-container`,this._button.className+=` custom-button`,this._button.className+=` custom-button-`+this._options.variant,this._button.className+=` custom-button-`+this._options.size,this._options.disabled&&(this._button.className+=` custom-button-disabled`),this._options.loading&&(this._container.className+=` custom-button-loading`),this._options.type&&(this._button.type=this._options.type),this._options.tooltip&&(this._button.title=this._options.tooltip),this._options.disabled&&(this._button.disabled=!0),this._options.text)if(this._button.textContent=``,this._buttonText=document.createElement(`span`),this._buttonText.className=`custom-button-text`,this._buttonText.textContent=this._options.text||``,this._options.icon){var n=document.createElement(`span`);n.className=`custom-button-icon`,this._options.iconPosition===`left`?(n.className+=` custom-button-icon-left`,this._button.appendChild(n),this._button.appendChild(this._buttonText)):(n.className+=` custom-button-icon-right`,this._button.appendChild(this._buttonText),this._button.appendChild(n)),n.innerHTML=this._options.icon}else this._button.appendChild(this._buttonText);this._options.loading&&(this._spinner=document.createElement(`span`),this._spinner.className=`custom-button-spinner`,this._button.appendChild(this._spinner)),this._options.badge&&(this._badgeElement=document.createElement(`span`),this._badgeElement.className=`custom-button-badge`,this._badgeElement.textContent=this._options.badge,this._button.appendChild(this._badgeElement)),e&&e.insertBefore(t,this._button),this._container.appendChild(this._button)},_bindEvents:function(){this._button.addEventListener(`click`,this._boundHandles.click),this._button.addEventListener(`mouseenter`,this._boundHandles.mouseenter),this._button.addEventListener(`mouseleave`,this._boundHandles.mouseleave),this._button.addEventListener(`focus`,this._boundHandles.focus),this._button.addEventListener(`blur`,this._boundHandles.blur),this._button.addEventListener(`keydown`,this._boundHandles.keydown)},_handleClick:function(e){if(this._options.disabled||this.isLoading){e.preventDefault(),e.stopPropagation();return}this.triggerClickEvent(e)},_handleMouseEnter:function(){this._button.className.split(` `).indexOf(`custom-button-hover`)===-1&&(this._button.className+=` custom-button-hover`),this.triggerEvent(`mouseenter`)},_handleMouseLeave:function(){this._button.className=this._button.className.split(` `).filter(function(e){return e!==`custom-button-hover`}).join(` `),this.triggerEvent(`mouseleave`)},_handleFocus:function(){this._button.className.split(` `).indexOf(`custom-button-focused`)===-1&&(this._button.className+=` custom-button-focused`),this.triggerEvent(`focus`)},_handleBlur:function(){this._button.className=this._button.className.split(` `).filter(function(e){return e!==`custom-button-focused`}).join(` `),this.triggerEvent(`blur`)},_handleKeydown:function(e){var t=e.key||e.keyCode;t===` `||t===`Enter`||t===32||t===13?this._button.tagName===`BUTTON`||(e.preventDefault(),this._button.click()):(t===`Escape`||t===27)&&this._button.blur(),this.triggerEvent(`keydown`,{key:t})},subscribe:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},setText:function(e){e!==void 0&&(this._options.text=e,this._buttonText||(this._buttonText=document.createElement(`span`),this._buttonText.className=`custom-button-text`,this._buttonText.textContent=``,this._button.appendChild(this._buttonText)),this._buttonText.textContent=e)},setIcon:function(e,t){this._options.icon=e,this._options.iconPosition=t||`left`},setBadge:function(e){e!==void 0&&(this._options.badge=e,this._badgeElement&&(this._badgeElement.textContent=e,this._badgeElement.style.display=e?`flex`:`none`))},setVariant:function(e){if(e!==void 0){var t=`custom-button-`+this._options.variant,n=`custom-button-`+e;this._button.className=this._button.className.split(` `).filter(function(e){return e!==t}).join(` `)+` `+n,this._options.variant=e}},setSize:function(e){if(e!==void 0){var t=`custom-button-`+this._options.size,n=`custom-button-`+e;this._button.className=this._button.className.split(` `).filter(function(e){return e!==t}).join(` `)+` `+n,this._options.size=e}},enable:function(){this._options.disabled=!1,this._button.disabled=!1,this._button.className=this._button.className.split(` `).filter(function(e){return e!==`custom-button-disabled`}).join(` `)},disable:function(){this._options.disabled=!0,this._button.disabled=!0,this._button.className.split(` `).indexOf(`custom-button-disabled`)===-1&&(this._button.className+=` custom-button-disabled`)},startLoading:function(){this.isLoading=!0,this._options.text!==void 0&&(this._originalText=this._options.text),this._container.className.split(` `).indexOf(`custom-button-loading`)===-1&&(this._container.className+=` custom-button-loading`),this._spinner&&(this._spinner.style.display=`inline-block`),this._buttonText&&(this._buttonText.textContent=`Loading...`),this._button.disabled=!0},stopLoading:function(){this.isLoading=!1,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`custom-button-loading`}).join(` `),this._spinner&&(this._spinner.style.display=`none`),this._buttonText&&(this._buttonText.textContent=this._originalText),this._button.disabled=!!this._options.disabled},setTooltip:function(e){e!==void 0&&(this._options.tooltip=e,this._button.title=e||``)},triggerClickEvent:function(e){var t={originalEvent:e,button:this};this._subscribers.forEach(function(e){e({type:`button:click`,detail:t})})},triggerEvent:function(e,t){t||={},t.button=this,this._subscribers.forEach(function(n){n({type:`button:`+e,detail:t})})},updateState:function(){this._options.disabled?this.disable():this.enable(),this._options.loading&&this.startLoading()},destroy:function(){if(this._subscribers=[],this._boundHandles)try{this._button.removeEventListener(`click`,this._boundHandles.click),this._button.removeEventListener(`mouseenter`,this._boundHandles.mouseenter),this._button.removeEventListener(`mouseleave`,this._boundHandles.mouseleave),this._button.removeEventListener(`focus`,this._boundHandles.focus),this._button.removeEventListener(`blur`,this._boundHandles.blur),this._button.removeEventListener(`keydown`,this._boundHandles.keydown)}catch(e){console.error(e)}this._container.innerHTML=``;var e=this._container.className.split(` `).filter(function(e){return e!==`custom-button-container`}).join(` `);this._container.className=e}};var hi=e(((e,t)=>{var n=F(),r=et(),i=TypeError,a=Object.getOwnPropertyDescriptor;t.exports=n&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(r(e)&&!a(e,`length`).writable)throw new i(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t}})),gi=e(((e,t)=>{var n=fe(),r=TypeError;t.exports=function(e,t){if(!delete e[t])throw new r(`Cannot delete property `+n(t)+` of `+n(e))}})),_i=e((()=>{var e=G(),t=be(),n=Ve(),r=Be(),i=Ue(),a=hi(),o=Tr(),s=at(),c=mr(),l=gi(),u=st()(`splice`),d=Math.max,f=Math.min;e({target:`Array`,proto:!0,forced:!u},{splice:function(e,u){var p=t(this),m=i(p),h=n(e,m),g=arguments.length,_,v,y,b,x,S;for(g===0?_=v=0:g===1?(_=0,v=m-h):(_=g-2,v=f(d(r(u),0),m-h)),o(m+_-v),y=s(p,v),b=0;bm-v+_;b--)l(p,b-1)}else if(_>v)for(b=m-v;b>h;b--)x=b+v-1,S=b+_-1,x in p?p[S]=p[x]:l(p,S);for(b=0;b<_;b++)p[b+h]=arguments[b+2];return a(p,m-v+_),y}})})),vi=e(((e,t)=>{var n=ft(),r=jt(),i=vr(),a=$e(),o=Bt(),s=re(),c=un(),l=Tt(),u=Et(),d=zt(),f=F(),p=Fr().fastKey,m=Ie(),h=m.set,g=m.getterFor;t.exports={getConstructor:function(e,t,l,u){var d=e(function(e,r){o(e,m),h(e,{type:t,index:n(null),first:null,last:null,size:0}),f||(e.size=0),s(r)||c(r,e[u],{that:e,AS_ENTRIES:l})}),m=d.prototype,_=g(t),v=function(e,t,n){var r=_(e),i=y(e,t),a,o;return i?i.value=n:(r.last=i={index:o=p(t,!0),key:t,value:n,previous:a=r.last,next:null,removed:!1},r.first||=i,a&&(a.next=i),f?r.size++:e.size++,o!==`F`&&(r.index[o]=i)),e},y=function(e,t){var n=_(e),r=p(t),i;if(r!==`F`)return n.index[r];for(i=n.first;i;i=i.next)if(i.key===t)return i};return i(m,{clear:function(){for(var e=this,t=_(e),r=t.first;r;)r.removed=!0,r.previous&&=r.previous.next=null,r=r.next;t.first=t.last=null,t.index=n(null),f?t.size=0:e.size=0},delete:function(e){var t=this,n=_(t),r=y(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),f?n.size--:t.size--}return!!r},forEach:function(e){for(var t=_(this),n=a(e,arguments.length>1?arguments[1]:void 0),r;r=r?r.next:t.first;)for(n(r.value,r.key,this);r&&r.removed;)r=r.previous},has:function(e){return!!y(this,e)}}),i(m,l?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,e===0?0:e,t)}}:{add:function(e){return v(this,e=e===0?0:e,e)}}),f&&r(m,`size`,{configurable:!0,get:function(){return _(this).size}}),d},setStrong:function(e,t,n){var r=t+` Iterator`,i=g(t),a=g(r);l(e,t,function(e,t){h(this,{type:r,target:e,state:i(e),kind:t,last:null})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return!e.target||!(e.last=n=n?n.next:e.state.first)?(e.target=null,u(void 0,!0)):u(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1)},n?`entries`:`values`,!n,!0),d(t)}}})),yi=e((()=>{Ir()(`Map`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},vi())})),bi=e((()=>{yi()}));_i(),bi();var K=new WeakMap,xi=new WeakMap,Si=new WeakMap,Ci=new WeakMap,q=new WeakMap,wi=new WeakMap,Ti=new WeakMap,Ei=new WeakSet,Di=function(){function e(t,n){if(l(this,e),p(this,Ei),d(this,K,void 0),d(this,xi,void 0),d(this,Si,void 0),d(this,Ci,null),d(this,q,void 0),d(this,wi,new Map),d(this,Ti,[]),typeof t==`string`){var r=document.getElementById(t);r instanceof HTMLInputElement&&(t=r)}if(!(t instanceof HTMLInputElement))throw Error(`Invalid input element`);if(f(xi,this,t),f(q,this,Object.assign({id:`radio_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,checked:!1,disabled:!1,indeterminate:!1,label:``,name:``,value:`on`},n)),a(Ei,this,Oi).call(this),f(K,this,document.createElement(`div`)),f(Si,this,document.createElement(`span`)),a(Ei,this,ki).call(this),a(Ei,this,ji).call(this),a(Ei,this,Mi).call(this),!u(q,this).name)throw Error(`Name attribute is required`);var i=Pi._.get(u(q,this).name);i||(i=[],Pi._.set(u(q,this).name,i)),i.push(this)}return h(e,[{key:`subscribe`,value:function(e){var t=this;return u(Ti,this).push(e),{unsubscribe:function(){f(Ti,t,u(Ti,t).filter(function(t){return t!==e}))}}}},{key:`getElement`,value:function(){return u(K,this)}},{key:`check`,value:function(e){var t=this;if(!(u(q,this).disabled||u(q,this).checked)){if(u(q,this).name){var n=Pi._.get(u(q,this).name);n&&n.forEach(function(e){e!==t&&u(q,e).checked&&e.uncheck()})}u(q,this).checked=!0,a(Ei,this,Mi).call(this),!e&&a(Ei,this,Ni).call(this)}}},{key:`uncheck`,value:function(e){u(q,this).disabled||!u(q,this).checked||(u(q,this).checked=!1,a(Ei,this,Mi).call(this),!e&&a(Ei,this,Ni).call(this))}},{key:`enable`,value:function(){u(q,this).disabled&&(u(q,this).disabled=!1,u(xi,this).disabled=!1,u(K,this).setAttribute(`aria-disabled`,`false`),u(q,this).checked?u(K,this).tabIndex=0:a(Ei,this,Ai).call(this),u(K,this).classList.remove(`radio--disabled`))}},{key:`disable`,value:function(){u(q,this).disabled||(u(q,this).disabled=!0,u(xi,this).disabled=!0,u(K,this).setAttribute(`aria-disabled`,`true`),u(K,this).tabIndex=-1,u(K,this).classList.add(`radio--disabled`))}},{key:`setLabel`,value:function(e){u(q,this).label=e,u(Ci,this)?u(Ci,this).textContent=e:e&&(f(Ci,this,document.createElement(`label`)),u(Ci,this).className=`radio-label`,u(Ci,this).htmlFor=String(u(q,this).id),u(Ci,this).textContent=e,u(K,this).appendChild(u(Ci,this)))}},{key:`getState`,value:function(){return{checked:!!u(q,this).checked,disabled:!!u(q,this).disabled,value:u(q,this).value||``,name:u(q,this).name||``}}},{key:`destroy`,value:function(){var e=this;if(f(Ti,this,[]),u(q,this).name){var t=Pi._.get(u(q,this).name);if(t){var n=t.indexOf(this);n>=0&&t.splice(n,1)}u(wi,this).forEach(function(t,n){u(K,e).removeEventListener(n,t)}),u(wi,this).clear(),u(K,this)&&u(K,this).parentNode&&u(K,this).parentNode.removeChild(u(K,this)),f(Ci,this,null)}}}])}();function Oi(){u(xi,this).type=`radio`;var e=u(xi,this).getAttribute(`id`),t=u(xi,this).getAttribute(`name`),n=u(xi,this).getAttribute(`value`),r=u(xi,this).getAttribute(`checked`),i=u(xi,this).getAttribute(`disabled`);e===null?u(q,this).id&&u(xi,this).setAttribute(`id`,u(q,this).id):u(q,this).id=e,t===null?u(q,this).name&&u(xi,this).setAttribute(`name`,u(q,this).name):u(q,this).name=t,n===null?u(q,this).value&&u(xi,this).setAttribute(`value`,u(q,this).value):u(q,this).value=n,r===null?u(q,this).checked&&u(xi,this).setAttribute(`checked`,`true`):u(q,this).checked=r===`true`,i===null?u(q,this).disabled&&u(xi,this).setAttribute(`disabled`,`true`):u(q,this).disabled=i===`true`}function ki(){var e=u(xi,this).parentNode,t=document.createDocumentFragment();t.appendChild(u(K,this)),u(K,this).classList.add(`radio-button-container`),u(K,this).setAttribute(`role`,`radio`),u(K,this).setAttribute(`aria-checked`,String(!!u(q,this).checked)),u(K,this).setAttribute(`aria-disabled`,String(!!u(q,this).disabled)),u(K,this).tabIndex=u(q,this).disabled?-1:0,u(Si,this).className=`radio-visual`,u(Si,this).setAttribute(`aria-hidden`,`true`),u(q,this).label&&(f(Ci,this,document.createElement(`label`)),u(Ci,this).className=`i18n radio-label`,u(Ci,this).htmlFor=String(u(q,this).id),u(Ci,this).textContent=u(q,this).label),u(q,this).disabled&&u(K,this).classList.add(`radio--disabled`),e&&e.insertBefore(t,u(xi,this)),u(K,this).appendChild(u(xi,this)),u(K,this).appendChild(u(Si,this)),u(Ci,this)&&u(K,this).appendChild(u(Ci,this)),a(Ei,this,Ai).call(this)}function Ai(){var e=this;if(u(q,this).checked)u(K,this).tabIndex=u(q,this).disabled?-1:0;else if(u(q,this).name&&Pi._.has(u(q,this).name)){var t=Pi._.get(u(q,this).name),n=!1;t&&t.forEach(function(t){u(q,t).checked&&t!==e&&(n=!0)}),!n&&!u(q,this).checked&&!u(q,this).disabled?u(K,this).tabIndex=0:u(K,this).tabIndex=-1}}function ji(){var e=this,t=function(t){t.preventDefault(),!u(q,e).disabled&&!u(q,e).checked&&(e.check(),u(K,e).focus())},n=function(t){if(!u(q,e).disabled)switch(t.key){case` `:case`Spacebar`:case`Enter`:t.preventDefault(),u(q,e).checked||e.check();break}},r=function(){u(K,e).classList.add(`radio--focused`)},i=function(){u(K,e).classList.remove(`radio--focused`)};u(wi,this).set(`click`,t),u(wi,this).set(`keydown`,n),u(wi,this).set(`focus`,r),u(wi,this).set(`blur`,i),u(K,this).addEventListener(`click`,t),u(K,this).addEventListener(`keydown`,n),u(K,this).addEventListener(`focus`,r),u(K,this).addEventListener(`blur`,i)}function Mi(){u(K,this).setAttribute(`aria-checked`,String(!!u(q,this).checked)),u(K,this).classList.toggle(`radio--checked`,u(q,this).checked),u(xi,this).checked=!!u(q,this).checked,a(Ei,this,Ai).call(this)}function Ni(e){var t={type:`radio:change`,detail:this.getState()};e&&(t.originalEvent=e),u(Ti,this).forEach(function(e){e(t)})}var Pi={_:new Map};function Fi(e,t){if(typeof e==`string`){var n=document.getElementById(e);n instanceof HTMLInputElement&&(e=n)}if(!(e instanceof HTMLInputElement))throw Error(`Invalid input element`);this._options=Object.assign({id:`checkbox_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,checked:!1,disabled:!1,indeterminate:!1,label:``,name:``,value:`on`},t),this._options.disabled=t.disabled||!1,this._handlers=new Map,this._createDOM(e),this._setupEventListeners(),this._updateVisualState(),this._subscribers=[]}Fi.prototype={constructor:Fi,_container:null,_input:null,_visualCheckbox:null,_labelElement:null,_createDOM:function(e){var t=e.parentNode,n=document.createDocumentFragment();this._container=document.createElement(`div`),n.appendChild(this._container),this._container.classList.add(`checkbox-container`),this._container.setAttribute(`role`,`checkbox`),this._container.setAttribute(`aria-checked`,this._options.checked?`true`:`false`),this._container.setAttribute(`aria-disabled`,this._options.disabled?`true`:`false`),this._container.tabIndex=this._options.disabled?-1:0,this._input=e;var r=this._input.getAttribute(`id`);r===null?this._options.id&&this._input.setAttribute(`id`,this._options.id):this._options.id=r,this._input.type=`checkbox`,this._options.name&&(this._input.name=this._options.name),this._options.value&&(this._input.value=this._options.value),this._input.checked=!!this._options.checked,this._options.disabled&&(this._input.disabled=!0),this._options.indeterminate&&(this._input.indeterminate=!0),this._visualCheckbox=document.createElement(`span`),this._visualCheckbox.className=`checkbox-visual`,this._visualCheckbox.setAttribute(`aria-hidden`,`true`);var i=`http://www.w3.org/2000/svg`,a=document.createElementNS(i,`svg`);a.setAttribute(`viewBox`,`0 0 10 8`),a.setAttribute(`class`,`checkbox-checkmark`);var o=document.createElementNS(i,`path`);o.setAttribute(`d`,`M0.682129 3.40702L3.68213 6.20702L9.18218 0.707116`),o.setAttribute(`fill`,`none`),o.setAttribute(`stroke`,`currentColor`),o.setAttribute(`stroke-width`,`2`),a.appendChild(o),this._visualCheckbox.appendChild(a);var s=document.createElement(`span`);if(s.className=`checkbox-indeterminate`,this._visualCheckbox.appendChild(s),this._options.label)this._labelElement=document.createElement(`label`),this._labelElement.className=`checkbox-label i18n`,this._options.id&&(this._labelElement.htmlFor=this._options.id),this._labelElement.textContent=this._options.label,this._options.title&&this._labelElement.setAttribute(`title`,this._options.label);else{var c=document.querySelector(`label[for='`+this._options.id+`']`);c instanceof HTMLLabelElement&&(this._labelElement=c)}this._options.disabled&&this._container.classList.add(`checkbox--disabled`),t&&t.insertBefore(n,e),this._container.appendChild(this._input),this._container.appendChild(this._visualCheckbox),this._labelElement&&this._container.appendChild(this._labelElement)},_setupEventListeners:function(){var e=this;if(this._container){var t=function(t){t.preventDefault(),!e._options.disabled&&e._container&&(e.toggle(),e._container.focus())},n=function(t){if(!e._options.disabled)switch(t.key){case` `:case`Spacebar`:case`Enter`:t.preventDefault(),e.toggle();break;case`ArrowRight`:case`ArrowDown`:t.preventDefault(),!e._options.checked&&!e._options.indeterminate&&(e._options.checked?e.setIndeterminate():e.check());break;case`ArrowLeft`:case`ArrowUp`:t.preventDefault(),(e._options.checked||e._options.indeterminate)&&(e._options.indeterminate?e.uncheck():e.setIndeterminate());break}},r=function(){e._container&&e._container.classList.add(`checkbox--focused`)},i=function(){e._container&&e._container.classList.remove(`checkbox--focused`)};this._handlers.set(`click`,t),this._handlers.set(`keydown`,n),this._handlers.set(`focus`,r),this._handlers.set(`blur`,i),this._container.addEventListener(`click`,t),this._container.addEventListener(`keydown`,n),this._container.addEventListener(`focus`,r),this._container.addEventListener(`blur`,i)}},_updateVisualState:function(){!this._container||!this._input||(this._container.setAttribute(`aria-checked`,this._options.indeterminate?`mixed`:String(this._options.checked)),this._container.classList.toggle(`checkbox--checked`,this._options.checked),this._container.classList.toggle(`checkbox--indeterminate`,this._options.indeterminate),this._input.checked=!!this._options.checked,this._input.indeterminate=!!this._options.indeterminate)},toggle:function(){return this._options.disabled?!!this._options.checked:(this._options.indeterminate?(this._options.indeterminate=!1,this._options.checked=!0):this._options.checked=!this._options.checked,this._updateVisualState(),this._triggerChange(),this._options.checked)},check:function(e){this._options.disabled||this._options.checked&&!this._options.indeterminate||(this._options.checked=!0,this._options.indeterminate=!1,this._updateVisualState(),e||this._triggerChange())},uncheck:function(e){this._options.disabled||!this._options.checked&&!this._options.indeterminate||(this._options.checked=!1,this._options.indeterminate=!1,this._updateVisualState(),e||this._triggerChange())},setIndeterminate:function(){this._options.disabled||this._options.indeterminate||(this._options.indeterminate=!0,this._updateVisualState(),this._triggerChange())},enable:function(){!this._options.disabled||!this._container||!this._input||(this._options.disabled=!1,this._input.disabled=!1,this._container.setAttribute(`aria-disabled`,`false`),this._container.tabIndex=0,this._container.classList.remove(`checkbox--disabled`))},disable:function(){this._options.disabled||!this._container||!this._input||(this._options.disabled=!0,this._input.disabled=!0,this._container.setAttribute(`aria-disabled`,`true`),this._container.tabIndex=-1,this._container.classList.add(`checkbox--disabled`))},setLabel:function(e){this._options.label=e,this._labelElement?this._labelElement.textContent=e:e&&this._container&&(this._labelElement=document.createElement(`label`),this._labelElement.className=`checkbox-label`,this._options.id&&(this._labelElement.htmlFor=this._options.id),this._labelElement.textContent=e,this._container.appendChild(this._labelElement)),this._options.title&&this._labelElement&&this._labelElement.setAttribute(`title`,e)},getState:function(){return this._input?{checked:this._input.checked,disabled:this._input.disabled,value:this._input.value}:{checked:!1,disabled:!1,value:``}},subscribe:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},_triggerChange:function(e){var t={type:`checkbox:change`,detail:this.getState()};e&&(t.originalEvent=e),this._subscribers.forEach(function(e){e(t)})},destroy:function(){var e=this;this._subscribers=[],this._handlers.forEach(function(t,n){e._container&&e._container.removeEventListener(n,t)}),this._handlers.clear(),this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=null,this._input=null,this._visualCheckbox=null,this._labelElement=null}};var Ii=e((e=>{e.f=W()})),Li=e(((e,t)=>{var n=Rt(),r=U(),i=Ii(),a=ke().f;t.exports=function(e){var t=n.Symbol||={};r(t,e)||a(t,e,{value:i.f(e)})}})),Ri=e(((e,t)=>{var n=L(),r=ae(),i=W(),a=Re();t.exports=function(){var e=r(`Symbol`),t=e&&e.prototype,o=t&&t.valueOf,s=i(`toPrimitive`);t&&!t[s]&&a(t,s,function(e){return n(o,this)},{arity:1})}})),zi=e((()=>{var e=G(),t=N(),n=L(),r=R(),i=ge(),a=F(),o=le(),s=P(),c=U(),l=oe(),u=Oe(),d=ie(),f=Ce(),p=xn(),m=te(),h=ft(),g=lt(),_=qe(),v=Mr(),y=Je(),b=Ee(),x=ke(),S=ut(),C=ee(),w=Re(),T=jt(),E=ye(),D=Pe(),O=Fe(),k=xe(),A=W(),j=Ii(),M=Li(),I=Ri(),z=yt(),ne=Ie(),re=ot().forEach,B=D(`hidden`),V=`Symbol`,H=`prototype`,ae=ne.set,se=ne.getterFor(V),ce=Object[H],ue=t.Symbol,de=ue&&ue[H],fe=t.RangeError,pe=t.TypeError,me=t.QObject,he=b.f,_e=x.f,ve=v.f,be=C.f,Se=r([].push),we=E(`symbols`),Te=E(`op-symbols`),De=E(`wks`),Ae=!me||!me[H]||!me[H].findChild,je=function(e,t,n){var r=he(ce,t);r&&delete ce[t],_e(e,t,n),r&&e!==ce&&_e(ce,t,r)},Me=a&&s(function(){return h(_e({},`a`,{get:function(){return _e(this,`a`,{value:7}).a}})).a!==7})?je:_e,Ne=function(e,t){var n=we[e]=h(de);return ae(n,{type:V,tag:e,description:t}),a||(n.description=t),n},Le=function(e,t,n){e===ce&&Le(Te,t,n),u(e);var r=f(t);return u(n),c(we,r)?(n.enumerable?(c(e,B)&&e[B][r]&&(e[B][r]=!1),n=h(n,{enumerable:m(0,!1)})):(c(e,B)||_e(e,B,m(1,h(null))),e[B][r]=!0),Me(e,r,n)):_e(e,r,n)},ze=function(e,t){u(e);var r=d(t);return re(g(r).concat(We(r)),function(t){(!a||n(Ve,r,t))&&Le(e,t,r[t])}),e},Be=function(e,t){return t===void 0?h(e):ze(h(e),t)},Ve=function(e){var t=f(e),r=n(be,this,t);return this===ce&&c(we,t)&&!c(Te,t)?!1:r||!c(this,t)||!c(we,t)||c(this,B)&&this[B][t]?r:!0},He=function(e,t){var n=d(e),r=f(t);if(!(n===ce&&c(we,r)&&!c(Te,r))){var i=he(n,r);return i&&c(we,r)&&!(c(n,B)&&n[B][r])&&(i.enumerable=!0),i}},Ue=function(e){var t=ve(d(e)),n=[];return re(t,function(e){!c(we,e)&&!c(O,e)&&Se(n,e)}),n},We=function(e){var t=e===ce,n=ve(t?Te:d(e)),r=[];return re(n,function(e){c(we,e)&&(!t||c(ce,e))&&Se(r,we[e])}),r};o||(ue=function(){if(l(de,this))throw new pe(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:p(arguments[0]),r=k(e),i=function(e){var a=this===void 0?t:this;a===ce&&n(i,Te,e),c(a,B)&&c(a[B],r)&&(a[B][r]=!1);var o=m(1,e);try{Me(a,r,o)}catch(e){if(!(e instanceof fe))throw e;je(a,r,o)}};return a&&Ae&&Me(ce,r,{configurable:!0,set:i}),Ne(r,e)},de=ue[H],w(de,`toString`,function(){return se(this).tag}),w(ue,`withoutSetter`,function(e){return Ne(k(e),e)}),C.f=Ve,x.f=Le,S.f=ze,b.f=He,_.f=v.f=Ue,y.f=We,j.f=function(e){return Ne(A(e),e)},a&&(T(de,`description`,{configurable:!0,get:function(){return se(this).description}}),i||w(ce,`propertyIsEnumerable`,Ve,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!o,sham:!o},{Symbol:ue}),re(g(De),function(e){M(e)}),e({target:V,stat:!0,forced:!o},{useSetter:function(){Ae=!0},useSimple:function(){Ae=!1}}),e({target:`Object`,stat:!0,forced:!o,sham:!a},{create:Be,defineProperty:Le,defineProperties:ze,getOwnPropertyDescriptor:He}),e({target:`Object`,stat:!0,forced:!o},{getOwnPropertyNames:Ue}),I(),z(ue,V),O[B]=!0})),Bi=e(((e,t)=>{t.exports=le()&&!!Symbol.for&&!!Symbol.keyFor})),Vi=e((()=>{var e=G(),t=ae(),n=U(),r=xn(),i=ye(),a=Bi(),o=i(`string-to-symbol-registry`),s=i(`symbol-to-string-registry`);e({target:`Symbol`,stat:!0,forced:!a},{for:function(e){var i=r(e);if(n(o,i))return o[i];var a=t(`Symbol`)(i);return o[i]=a,s[a]=i,a}})})),Hi=e((()=>{var e=G(),t=U(),n=de(),r=fe(),i=ye(),a=Bi(),o=i(`symbol-to-string-registry`);e({target:`Symbol`,stat:!0,forced:!a},{keyFor:function(e){if(!n(e))throw TypeError(r(e)+` is not a symbol`);if(t(o,e))return o[e]}})})),Ui=e(((e,t)=>{var n=H(),r=Ie().get;t.exports=function(e){if(!n(e))return!1;var t=r(e);return!!t&&t.type===`RawJSON`}})),Wi=e(((e,t)=>{var n=R(),r=U(),i=SyntaxError,a=parseInt,o=String.fromCharCode,s=n(``.charAt),c=n(``.slice),l=n(/./.exec),u={'\\"':`"`,"\\\\":`\\`,"\\/":`/`,"\\b":`\b`,"\\f":`\f`,"\\n":` -`,"\\r":`\r`,"\\t":` `},d=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;t.exports=function(e,t){for(var n=!0,p=``;t{t.exports=!P()(function(){var e=`9007199254740993`,t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e})})),Ki=e((()=>{var e=G(),t=ae(),n=Ut(),r=L(),i=R(),a=P(),o=et(),s=V(),c=Ui(),l=de(),u=z(),d=xn(),f=Wt(),p=Wi(),m=xe(),h=le(),g=Gi(),_=String,v=t(`JSON`,`stringify`),y=i(/./.exec),b=i(``.charAt),x=i(``.charCodeAt),S=i(``.replace),C=i(``.slice),w=i([].push),T=i(1.1.toString),E=/[\uD800-\uDFFF]/g,D=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,k=m(),A=k.length,j=!h||a(function(){var e=t(`Symbol`)(`stringify detection`);return v([e])!==`[null]`||v({a:e})!==`{}`||v(Object(e))!==`{}`}),M=a(function(){return v(`\udf06\ud834`)!==`"\\udf06\\ud834"`||v(`\udead`)!==`"\\udead"`}),N=j?function(e,t){var i=f(arguments),a=I(t);if(!(!s(a)&&(e===void 0||l(e))))return i[1]=function(e,t){if(s(a)&&(t=r(a,this,_(e),t)),!l(t))return t},n(v,null,i)}:v,F=function(e,t,n){var r=b(n,t-1),i=b(n,t+1);return y(D,e)&&!y(O,i)||y(O,e)&&!y(D,r)?`\\u`+T(x(e,0),16):e},I=function(e){if(s(e))return e;if(o(e)){for(var t=e.length,n=[],r=0;r{var e=G(),t=le(),n=P(),r=Je(),i=be();e({target:`Object`,stat:!0,forced:!t||n(function(){r.f(1)})},{getOwnPropertySymbols:function(e){var t=r.f;return t?t(i(e)):[]}})})),Ji=e((()=>{zi(),Vi(),Hi(),Ki(),qi()})),Yi=e((()=>{var e=G(),t=F(),n=N(),r=R(),i=U(),a=V(),o=oe(),s=xn(),c=jt(),l=Xe(),u=n.Symbol,d=u&&u.prototype;if(t&&a(u)&&(!(`description`in d)||u().description!==void 0)){var f={},p=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:s(arguments[0]),t=o(d,this)?new u(e):e===void 0?u():u(e);return e===``&&(f[t]=!0),t};l(p,u),p.prototype=d,d.constructor=p;var m=String(u(`description detection`))===`Symbol(description detection)`,h=r(d.valueOf),g=r(d.toString),_=/^Symbol\((.*)\)[^)]+$/,v=r(``.replace),y=r(``.slice);c(d,`description`,{configurable:!0,get:function(){var e=h(this);if(i(f,e))return``;var t=g(e),n=m?y(t,7,-1):v(t,_,`$1`);return n===``?void 0:n}}),e({global:!0,constructor:!0,forced:!0},{Symbol:p})}})),Xi=e((()=>{var e=G(),t=ot().find,n=pt(),r=`find`,i=!0;r in[]&&[,][r](function(){i=!1}),e({target:`Array`,proto:!0,forced:i},{find:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),n(r)})),Zi=e((()=>{var e=G(),t=hr();e({target:`Array`,stat:!0,forced:!dn()(function(e){Array.from(e)})},{from:t})})),Qi=e(((e,t)=>{var n=se().match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]})),$i=e(((e,t)=>{var n=se();t.exports=/MSIE|Trident/.test(n)})),ea=e(((e,t)=>{var n=se().match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]})),ta=e((()=>{var e=G(),t=R(),n=pe(),r=be(),i=Ue(),a=gi(),o=xn(),s=P(),c=yr(),l=Ot(),u=Qi(),d=$i(),f=ce(),p=ea(),m=[],h=t(m.sort),g=t(m.push),_=s(function(){m.sort(void 0)}),v=s(function(){m.sort(null)}),y=l(`sort`),b=!s(function(){if(f)return f<70;if(!(u&&u>3)){if(d)return!0;if(p)return p<603;var e=``,t,n,r,i;for(t=65;t<76;t++){switch(n=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)m.push({k:n+i,v:r})}for(m.sort(function(e,t){return t.v-e.v}),i=0;io(n)?1:-1:+e(t,n)||0}};e({target:`Array`,proto:!0,forced:x},{sort:function(e){e!==void 0&&n(e);var t=r(this);if(b)return e===void 0?h(t):h(t,e);var o=[],s=i(t),l,u;for(u=0;u{Ir()(`Set`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},vi())})),ra=e((()=>{na()}));Ji(),Yi(),Xi(),Zi(),ta(),ra();var J=new WeakSet,ia=function(){function e(t,n){var r=this;if(l(this,e),p(this,J),typeof t==`string`){var i=document.getElementById(t);if(i instanceof HTMLSelectElement)t=i;else if(i instanceof HTMLElement)this._container=i;else throw Error(`Invalid selectbox`)}else t instanceof HTMLElement&&(this._container=t);if(t instanceof HTMLSelectElement)this._selectbox=t,this._container=document.createElement(`div`);else if(!(this._container instanceof HTMLElement))throw Error(`Invalid container`);this._options=Object.assign(n,{placeholder:n.placeholder||`Select...`,searchable:n.searchable||!1,sortable:n.sortable||!1,translate:n.translate,multiple:n.multiple||!1,usePortal:n.usePortal||!1,description:n.description||``}),this._selectedValues=new Set,this.isOpen=!1,this._items=[],this._customItems=[],this._subscribers=[],this._boundHandles={toggle:function(e){a(J,r,sa).call(r,e)},search:function(e){a(J,r,la).call(r,e)},close:function(e){e.target instanceof HTMLElement&&!r._container.contains(e.target)&&!e.target.classList.contains(`selectbox-option`)&&a(J,r,ca).call(r)},keydown:function(e){a(J,r,da).call(r,e)},dropdownClick:function(e){a(J,r,pa).call(r,e)},scrollCheck:function(){if(r._headerRectOnOpen){var e=r._header.getBoundingClientRect();Math.abs(e.top-r._headerRectOnOpen.top)>1&&a(J,r,ca).call(r)}}},this._optionsContainer=null,this.searchInput=null,this._select=document.createElement(`div`),this._header=document.createElement(`div`),this._selectedText=document.createElement(`span`),this._arrow=document.createElement(`span`),this._dropdown=document.createElement(`div`),a(J,this,aa).call(this),a(J,this,oa).call(this),a(J,this,fa).call(this),ya._.add(this)}return h(e,[{key:`openDropdown`,value:function(){this.isOpen||document.addEventListener(`click`,this._boundHandles.close),this.isOpen=!0,this._dropdown.style.display=`block`,this._headerRectOnOpen=this._header.getBoundingClientRect(),document.addEventListener(`scroll`,this._boundHandles.scrollCheck,!0),this._arrow.className+=` selectbox-arrow-open`,this._header.className+=` selectbox-header-open`,this.searchInput&&setTimeout(function(e){return function(){e.searchInput&&e.searchInput.focus()}}(this),100),a(J,this,fa).call(this),a(J,this,ha).call(this)}},{key:`subscribe`,value:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}}},{key:`addItem`,value:function(e,t,n){if(n||=!1,this._items.some(function(t){return t&&t.value===e})){var r=this._items.find(function(t){return t&&t.value===e});r&&(r.selected=n)}else this._items.push({value:e,text:t,selected:n}),this._options.sortable&&this._items.sort(function(e,t){return e&&t?e.text.localeCompare(t.text):e?-1:+!!t});n&&(this._options.multiple||this._selectedValues.clear(),this._selectedValues.add(e)),a(J,this,ma).call(this)}},{key:`addItems`,value:function(e,t){var n=this;e.forEach(function(e,r){if(!n._items.some(function(t){return t&&t.value===e[0]})){var i=t?e[0]===t:r===0;i&&(n._options.multiple||n._selectedValues.clear(),n._selectedValues.add(e[0])),n._items.push({value:e[0],text:e[1],selected:i})}},this),this.isOpen&&a(J,this,fa).call(this),a(J,this,ma).call(this)}},{key:`addCustomItem`,value:function(e,t){this._customItems.push({value:e,text:t,selected:!1})}},{key:`addSeparator`,value:function(){this._items.push(null)}},{key:`removeItem`,value:function(e){this._items=this._items.filter(function(t){return t===null||t.value!==e}),this._customItems=this._customItems.filter(function(t){return t===null||t.value!==e}),this._selectedValues.delete(e),a(J,this,ma).call(this)}},{key:`getSelectedValue`,value:function(){if(this._options.multiple)return console.error(`Method getSelectedValue is only available for single-select boxes.`),null;var e=Array.from(this._selectedValues);return e.length>0?e[0]:null}},{key:`getSelectedValues`,value:function(){if(this._options.multiple)return Array.from(this._selectedValues);var e=Array.from(this._selectedValues);return e.length>0?e[0]:null}},{key:`selectItems`,value:function(e,t){var n=this;if(!this._options.multiple&&Array.isArray(e)){console.error(`Method selectItem is only available for multi-select boxes.`);return}var r=``;if(this._options.multiple){var i=function(e){if(n._optionsContainer){var t=n._optionsContainer.querySelector(`[data-value="`+e+`"]`);if(t){var r=t.querySelector(`input[type="checkbox"]`);r&&r instanceof HTMLInputElement&&(r.checked=!0),t.classList.add(`selectbox-option-selected`),t.classList.add(`checkbox--checked`)}}};if(Array.isArray(e))for(var o=0;o0){var t=this._items[0];t&&this._selectedValues.add(t.value)}a(J,this,ma).call(this),a(J,this,fa).call(this)}},{key:`destroy`,value:function(){this._subscribers=[],ya._.delete(this);try{this._header&&this._boundHandles&&this._header.removeEventListener(`click`,this._boundHandles.toggle),this.searchInput&&this._boundHandles&&this.searchInput.removeEventListener(`input`,this._boundHandles.search),this._dropdown&&this._boundHandles&&this._dropdown.removeEventListener(`click`,this._boundHandles.dropdownClick),document&&this._boundHandles&&document.removeEventListener(`click`,this._boundHandles.close),this._header&&this._boundHandles&&this._header.removeEventListener(`keydown`,this._boundHandles.keydown),this._dropdown&&this._boundHandles&&this._dropdown.removeEventListener(`keydown`,this._boundHandles.keydown)}catch(e){console.error(e)}this._container.innerHTML=``;for(var e=this._container.className.split(` `),t=[],n=0;n`,this._header.appendChild(this._arrow),this._dropdown.className+=` selectbox-dropdown`,this._options.usePortal&&(this._dropdown.className+=` selectbox-fixed`),this._select.appendChild(this._dropdown),this._options.description){var t=document.createElement(`div`);t.className+=` i18n selectbox-description`,t.textContent=this._options.description,this._dropdown.appendChild(t)}if(this._options.searchable){var n=document.createElement(`div`);n.className+=` selectbox-search`,this._dropdown.appendChild(n),this.searchInput=document.createElement(`input`),this.searchInput.className+=` selectbox-search-input`,this.searchInput.type=`text`,this.searchInput.placeholder=`Search...`,n.appendChild(this.searchInput)}if(this._optionsContainer=document.createElement(`div`),this._optionsContainer.className+=` selectbox-options`,this._dropdown.appendChild(this._optionsContainer),this._container.appendChild(e),this._selectbox){var r=this._selectbox.parentNode;if(r){r.insertBefore(this._container,this._selectbox);var i=a(J,this,va).call(this,this._selectbox);this.addItems(i.values,i.selectedValue),this._selectbox.remove()}}}function oa(){this._header.addEventListener(`click`,this._boundHandles.toggle),this.searchInput&&this.searchInput.addEventListener(`input`,this._boundHandles.search),this._dropdown.addEventListener(`click`,this._boundHandles.dropdownClick),this._dropdown.addEventListener(`wheel`,function(e){e.stopPropagation()}),this._header.addEventListener(`keydown`,this._boundHandles.keydown),this._dropdown.addEventListener(`keydown`,this._boundHandles.keydown)}function sa(e){if(e&&e.stopPropagation(),this.isOpen?a(J,this,ca).call(this):this.openDropdown(),e&&e.type===`click`){var t=g(ya._),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;r.isOpen&&r!==this&&a(J,r,ca).call(r)}}catch(e){t.e(e)}finally{t.f()}}}function ca(){this.isOpen&&document&&this._boundHandles&&(document.removeEventListener(`click`,this._boundHandles.close),document.removeEventListener(`scroll`,this._boundHandles.scrollCheck,!0)),this.isOpen=!1,this._dropdown.style.display=`none`,this._options.usePortal?(this._dropdown.style.left=``,this._dropdown.style.width=``,this._dropdown.style.top=``):this._dropdown.classList.remove(`selectbox-dropdown-top`);for(var e=this._arrow.className.split(` `),t=[],n=0;n0)n=r[r.length-1],this._selectedValues.add(n.value);else{for(var i=Array.from(this._selectedValues),o=-1,s=0;s0)n=r[0],this._selectedValues.add(n.value);else{for(var i=Array.from(this._selectedValues),o=-1,s=0;sr?this._dropdown.style.top=t.top-n-2+`px`:this._dropdown.style.top=t.bottom+2+`px`}else this._dropdown.getBoundingClientRect().bottom>e&&this._dropdown.classList.add(`selectbox-dropdown-top`)}function ga(e,t){for(var n=Array.from(this._selectedValues),r=[],i=0;i{var e=G(),t=Qe(),n=Ee().f,r=He(),i=xn(),a=Or(),o=B(),s=kr(),c=ge(),l=t(``.slice),u=Math.min,d=s(`endsWith`);e({target:`String`,proto:!0,forced:!(!c&&!d&&function(){var e=n(String.prototype,`endsWith`);return e&&!e.writable}())&&!d},{endsWith:function(e){var t=i(o(this));a(e);var n=arguments.length>1?arguments[1]:void 0,s=t.length,c=n===void 0?s:u(r(n),s),d=i(e);return l(t,c-d.length,c)===d}})})),Ea=e((()=>{var e=G(),t=L(),n=R(),r=B(),i=V(),a=H(),o=Dr(),s=xn(),c=me(),l=Pn(),u=Mn(),d=W(),f=ge(),p=d(`replace`),m=TypeError,h=n(``.indexOf),g=n(``.replace),_=n(``.slice),v=Math.max;e({target:`String`,proto:!0},{replaceAll:function(e,n){var d=r(this),y,b,x,S,C,w,T,E,D,O,k=0,A=``;if(a(e)){if(y=o(e),y&&(b=s(r(l(e))),!~h(b,`g`)))throw new m("`.replaceAll` does not allow non-global regexes");if(x=c(e,p),x)return t(x,e,d,n);if(f&&y)return g(s(d),e,n)}for(S=s(d),C=s(e),w=i(n),w||(n=s(n)),T=C.length,E=v(1,T),D=h(S,C);D!==-1;)O=w?s(n(C,D,S)):u(C,S,D,[],void 0,n),A+=_(S,k,D)+O,k=D+T,D=D+E>S.length?-1:h(S,C,D+E);return k{Ea()})),Oa=e((()=>{var e=G(),t=Qe(),n=Ee().f,r=He(),i=xn(),a=Or(),o=B(),s=kr(),c=ge(),l=t(``.slice),u=Math.min,d=s(`startsWith`);e({target:`String`,proto:!0,forced:!(!c&&!d&&function(){var e=n(String.prototype,`startsWith`);return e&&!e.writable}())&&!d},{startsWith:function(e){var t=i(o(this));a(e);var n=r(u(arguments.length>1?arguments[1]:void 0,t.length)),s=i(e);return l(t,n,n+s.length)===s}})}));Ta(),Da(),Oa();var ka=function(){function e(){l(this,e)}return h(e,null,[{key:`purifyHtml`,value:function(t){if(typeof t!=`string`||t.length===0)return``;var n=a(e,this,ja)._,r=new DOMParser().parseFromString(`
`+t+`
`,`text/html`).getElementById(`__purify_root__`);if(!r)return``;for(var i=function(e){var t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}},o=Array.from(r.getElementsByTagName(`*`)),s=0,c=o;s`,o);if(c===-1){n.text+=t[o],o++;continue}var l=t.substring(s?o+2:o+1,c).trim(),u=l.split(` `);if(u.length===0){n.text+=t[o],o++;continue}var d=u[0].toLowerCase();if(d===`br`){n.text+=` -`,o=c+1;continue}var f=d;if(l.indexOf(`font-variant:small-caps`)===-1?l.indexOf(`text-decoration:underline`)!==-1&&(f=`u`):f=`sc`,a(e,this,ja)._.has(d))if(s){for(var p=r.length-1;p>=0;p--)if(r[p].tag===d){var m=r.splice(p,1)[0],h=m.start,g=m.styleTag;n.formatting.push({type:g,start:h,end:i});break}}else r.push({tag:d,start:i,styleTag:f});o=c+1}else n.text+=t[o],i++,o++;return n.formatting.sort(function(e,t){return e.start===t.start?t.end-e.end:e.start-t.start}),n}}])}();function Aa(e){for(var t=/^\s*(javascript|vbscript|data)\s*:/i,n=0,r=Array.from(e.attributes);n=0;t--){var n=Asc.scope.formatting[t],r=e.GetRange(n.start,n.end);r&&(n.type===`sup`?r.SetVertAlign(`superscript`):n.type===`sub`?r.SetVertAlign(`subscript`):n.type===`sc`?r.SetSmallCaps(!0):n.type===`u`?r.SetUnderline(!0):n.type===`b`?r.SetBold(!0):(n.type===`i`||n.type===`em`)&&r.SetItalic(!0))}},r,n,t)})}},{key:`formatAfterUpdate`,value:function(e,t){var n=!0,r=!1;return Asc.scope.fieldId=e,Asc.scope.text=t.text,Asc.scope.formatting=t.formatting,new Promise(function(e){Asc.plugin.callCommand(function(){var e=Api.GetDocument(),t=e.GetRangeBySelect();if(!t)return;function n(e,t){t===`sup`?e.SetVertAlign(`superscript`):t===`sub`?e.SetVertAlign(`subscript`):t===`sc`?e.SetSmallCaps(!0):t===`u`?e.SetUnderline(!0):t===`b`?e.SetBold(!0):(t===`i`||t===`em`)&&e.SetItalic(!0)}if(Asc.scope.formatting.length===1){var r=Asc.scope.formatting[0];if(r.start===0&&r.end===t.GetText().length){n(t,r.type);return}}e.MoveCursorToPos(t.GetEndPos()-Asc.scope.text.length);for(var i=e.GetCurrentRun(),a=Asc.scope.formatting.length-1;a>=0;a--){var o=Asc.scope.formatting[a],s=i.GetRange(o.start,o.end);s&&n(s,o.type)}},r,n,e)})}}])}(),Pa=new WeakMap,Fa=new WeakMap,Ia=new WeakMap,La=new WeakMap,Ra=new WeakMap,za=new WeakMap,X=new WeakSet,Ba=function(){function e(t,n,r,i){l(this,e),p(this,X),d(this,Pa,void 0),d(this,Fa,void 0),d(this,Ia,void 0),d(this,La,void 0),d(this,Ra,void 0),d(this,za,void 0),f(Pa,this,`ZOTERO_CITATION`),f(Ia,this,`ZOTERO_BIBLIOGRAPHY`),f(Fa,this,t),f(La,this,n),f(Ra,this,r),f(za,this,i)}return h(e,[{key:`addBibliography`,value:function(){var e=s(w().m(function e(t,n){var r=this,i,o,s,c,l;return w().w(function(e){for(;;)switch(e.n){case 0:if(i=window.Asc.scope.editorVersion,!(i&&i<9004e3)){e.n=1;break}return o=ka.parseHtmlFormatting(t),s=``,c={FieldId:s,Value:u(Ra,this)+n+u(za,this),Content:o.text},e.a(2,a(X,this,Va).call(this,c).then(function(){return r.getCurrentField()}).then(function(e){if(s=e?.FieldId||``,o.formatting.length)return Na.formatAfterInsert(o.formatting)}).then(function(){return s}));case 1:return l={FieldId:``,Value:u(Ra,this)+n+u(za,this),Content:` `},e.n=2,a(X,this,Xa).call(this,l,t);case 2:return e.a(2,e.v);case 3:return e.a(2)}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`addCitation`,value:function(){var e=s(w().m(function e(t,n,r){var i,o,s;return w().w(function(e){for(;;)switch(e.n){case 0:if(i=ka.parseHtmlFormatting(t),o={FieldId:``,Value:u(Fa,this)+` `+u(La,this)+n,Content:i.text},s=!!(r&&[`footnotes`,`endnotes`].indexOf(r)!==-1),!s){e.n=1;break}return e.n=1,a(X,this,Ha).call(this,r);case 1:return e.n=2,a(X,this,Va).call(this,o);case 2:if(i.formatting.length){e.n=3;break}return e.a(2,s);case 3:return e.n=4,Na.formatAfterInsert(i.formatting);case 4:if(!s){e.n=5;break}return e.n=5,a(X,this,Ja).call(this);case 5:return e.a(2,s)}},e,this)}));function t(t,n,r){return e.apply(this,arguments)}return t}()},{key:`getCurrentField`,value:function(){return new Promise(function(e,t){window.Asc.plugin.executeMethod(`GetCurrentAddinField`,void 0,e)})}},{key:`getAddinZoteroFields`,value:function(){var e=this;return new Promise(function(t,n){a(X,e,Ua).call(e).then(function(r){try{r.length&&(r=r.filter(function(t){return t.Value.indexOf(u(Fa,e))!==-1||t.Value.indexOf(u(Ra,e))!==-1||t.Value.indexOf(u(Pa,e))!==-1||t.Value.indexOf(u(Ia,e))!==-1}))}catch(e){n(e)}t(r)})})}},{key:`saveAsText`,value:function(){return this.getAddinZoteroFields().then(function(e){if(!e.length)return window.Asc.plugin.executeCommand(`close`,``),!1;var t=e.map(function(e){return new Promise(function(t){window.Asc.plugin.executeMethod(`RemoveFieldWrapper`,[e.FieldId],t)})});return Promise.all(t).then(function(){return!0}).catch(function(e){return console.error(e),!1})})}},{key:`updateAddinFields`,value:function(){var e=s(w().m(function e(t){var n=this,r,i,o,s,c,l,d,f,p,m,h,_,v;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.map(function(e){return e.FieldId}),i=window.Asc.scope.editorVersion,o=t.filter(function(e){return e.Value.indexOf(u(Ra,n))===0}),!(o.length&&i&&i>=9004e3)){e.n=3;break}return t=t.filter(function(e){return e.Value.indexOf(u(Ra,n))!==0}),s=o[0],e.n=1,a(X,this,qa).call(this,s.FieldId);case 1:return c=s.Content||``,s.Content=` `,e.n=2,a(X,this,Ka).call(this);case 2:return e.n=3,a(X,this,Xa).call(this,s,c);case 3:return l=a(X,this,Wa).call(this,t),e.n=4,new Promise(function(e){window.Asc.plugin.executeMethod(`UpdateAddinFields`,[t],e)});case 4:if(l.size){e.n=5;break}return e.a(2,r);case 5:d=g(l),e.p=6,d.s();case 7:if((f=d.n()).done){e.n=11;break}return p=E(f.value,2),m=p[0],h=p[1],e.n=8,a(X,this,qa).call(this,m);case 8:if(_=e.v,_){e.n=9;break}return e.a(3,10);case 9:return e.n=10,Na.formatAfterUpdate(m,h);case 10:e.n=7;break;case 11:e.n=13;break;case 12:e.p=12,v=e.v,d.e(v);case 13:return e.p=13,d.f(),e.f(13);case 14:return e.a(2,r)}},e,this,[[6,12,13,14]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`convertNotesToText`,value:function(){var e=s(w().m(function e(t){var n,r,i,o,s,c;return w().w(function(e){for(;;)switch(e.n){case 0:n=a(X,this,Wa).call(this,t),r=0;case 1:if(!(r{var e=G(),t=ot().findIndex,n=pt(),r=`findIndex`,i=!0;r in[]&&[,][r](function(){i=!1}),e({target:`Array`,proto:!0,forced:i},{findIndex:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),n(r)}))();var Qa=new WeakMap,$a=new WeakMap,eo=new WeakMap,to=new WeakSet,no=function(){function e(){l(this,e),p(this,to),d(this,Qa,void 0),d(this,$a,void 0),d(this,eo,void 0),f(Qa,this,[]),f($a,this,[]),f(eo,this,[]),this.size=0}return h(e,[{key:`getItem`,value:function(e){e=e.toString();var t=u($a,this).indexOf(e);return t>=0?u(Qa,this)[t]:null}},{key:`getItemIndex`,value:function(e){return e=e.toString(),u($a,this).indexOf(e)}},{key:`clear`,value:function(){return f(Qa,this,[]),f(eo,this,[]),f($a,this,[]),this.size=0,this}},{key:`deleteItem`,value:function(e){e=e.toString();var t=u($a,this).indexOf(e);return t>=0&&(u(Qa,this).splice(t,1),u($a,this).splice(t,1),this.size--),this}},{key:`forEachItem`,value:function(e){for(var t=0;t=0}},{key:`addCslCitation`,value:function(e){var t=this;return u(eo,this).push(e),e.setNoteIndex(u(eo,this).length),e.getCitationItems().forEach(function(e){a(to,t,ro).call(t,e.id,e)}),this}},{key:`getAllCitationsInJson`,value:function(){return u(eo,this).map(function(e){return e.toJSON()})}},{key:`getCitation`,value:function(e){return u(eo,this).find(function(t){return t.citationID===e})}},{key:`getCitationIndex`,value:function(e){return u(eo,this).findIndex(function(t){return t.citationID===e})}},{key:`getCitationsPre`,value:function(e){var t=[];return u(eo,this).find(function(n,r){return n.citationID===e?!0:(t.push([n.citationID,r+1]),!1)}),t}},{key:`getCitationsPost`,value:function(e){for(var t=[],n=this.getCitationIndex(e)+1;n=0?(u(Qa,this)[n]=t,this):(u(Qa,this).push(t),u($a,this).push(e),this.size++,this)}function Z(e){if(typeof e!=`string`&&typeof e!=`number`)throw Error(`CitationItemData: id is required`);this._id=e,this._type=void 0,this._citationKey=void 0,this._categories=[],this._language=void 0,this._journalAbbreviation=void 0,this._shortTitle=void 0,this._author=[],this._chair=[],this._collectionEditor=[],this._compiler=[],this._composer=[],this._containerAuthor=[],this._contributor=[],this._curator=[],this._director=[],this._editor=[],this._editorialDirector=[],this._executiveProducer=[],this._guest=[],this._host=[],this._illustrator=[],this._narrator=[],this._organizer=[],this._originalAuthor=[],this._performer=[],this._producer=[],this._recipient=[],this._reviewedAuthor=[],this._scriptwriter=[],this._seriesCreator=[],this._translator=[],this._accessed={},this._container={},this._eventDate={},this._issued={},this._originalDate={},this._submitted={},this._abstract=void 0,this._annote=void 0,this._archive=void 0,this._archiveCollection=void 0,this._archiveLocation=void 0,this._archivePlace=void 0,this._authority=void 0,this._callNumber=void 0,this._chapterNumber=void 0,this._citationNumber=void 0,this._citationLabel=void 0,this._collectionNumber=void 0,this._collectionTitle=void 0,this._containerTitle=void 0,this._containerTitleShort=void 0,this._dimensions=void 0,this._DOI=void 0,this._edition=void 0,this._event=void 0,this._eventTitle=void 0,this._eventPlace=void 0,this._firstReferenceNoteNumber=void 0,this._genre=void 0,this._ISBN=void 0,this._ISSN=void 0,this._issue=void 0,this._jurisdiction=void 0,this._keyword=void 0,this._locator=void 0,this._medium=void 0,this._note=void 0,this._number=void 0,this._numberOfPages=void 0,this._numberOfVolumes=void 0,this._originalPublisher=void 0,this._originalPublisherPlace=void 0,this._originalTitle=void 0,this._page=void 0,this._part=void 0,this._partTitle=void 0,this._pageFirst=void 0,this._PMCID=void 0,this._PMID=void 0,this._printing=void 0,this._publisher=void 0,this._publisherPlace=void 0,this._references=void 0,this._reviewedGenre=void 0,this._reviewedTitle=void 0,this._scale=void 0,this._section=void 0,this._source=void 0,this._status=void 0,this._title=void 0,this._titleShort=void 0,this._URL=void 0,this._version=void 0,this._volume=void 0,this._volumeTitle=void 0,this._volumeTitleShort=void 0,this._yearSuffix=void 0,this._custom={},this.schema=`https://raw.githubusercontent.com/citation-style-language/schema/master/schemas/input/csl-data.json#/items`}Z.prototype._addCustomProperty=function(e,t){return this._custom[e]=t,this},Z.prototype.getCustomProperty=function(e){return Object.hasOwnProperty.call(this._custom,e)?this._custom[e]:null},Z.prototype.fillFromObject=function(e){if(Object.hasOwnProperty.call(e,`type`)&&(this._type=e.type),Object.hasOwnProperty.call(e,`categories`)&&(this._categories=e.categories),Object.hasOwnProperty.call(e,`citation-key`)&&(this._citationKey=e[`citation-key`]),Object.hasOwnProperty.call(e,`language`)&&(this._language=e.language),Object.hasOwnProperty.call(e,`journalAbbreviation`)&&(this._journalAbbreviation=e.journalAbbreviation),Object.hasOwnProperty.call(e,`shortTitle`)&&(this._shortTitle=e.shortTitle),Object.hasOwnProperty.call(e,`author`)&&(this._author=e.author),Object.hasOwnProperty.call(e,`chair`)&&(this._chair=e.chair),Object.hasOwnProperty.call(e,`collection-editor`)&&(this._collectionEditor=e[`collection-editor`]),Object.hasOwnProperty.call(e,`compiler`)&&(this._compiler=e.compiler),Object.hasOwnProperty.call(e,`composer`)&&(this._composer=e.composer),Object.hasOwnProperty.call(e,`container-author`)&&(this._containerAuthor=e[`container-author`]),Object.hasOwnProperty.call(e,`contributor`)&&(this._contributor=e.contributor),Object.hasOwnProperty.call(e,`curator`)&&(this._curator=e.curator),Object.hasOwnProperty.call(e,`director`)&&(this._director=e.director),Object.hasOwnProperty.call(e,`editorial-director`)&&(this._editorialDirector=e[`editorial-director`]),Object.hasOwnProperty.call(e,`editor`)&&(this._editor=e.editor),Object.hasOwnProperty.call(e,`executive-producer`)&&(this._executiveProducer=e[`executive-producer`]),Object.hasOwnProperty.call(e,`guest`)&&(this._guest=e.guest),Object.hasOwnProperty.call(e,`host`)&&(this._host=e.host),Object.hasOwnProperty.call(e,`illustrator`)&&(this._illustrator=e.illustrator),Object.hasOwnProperty.call(e,`narrator`)&&(this._narrator=e.narrator),Object.hasOwnProperty.call(e,`organizer`)&&(this._organizer=e.organizer),Object.hasOwnProperty.call(e,`original-author`)&&(this._originalAuthor=e[`original-author`]),Object.hasOwnProperty.call(e,`performer`)&&(this._performer=e.performer),Object.hasOwnProperty.call(e,`producer`)&&(this._producer=e.producer),Object.hasOwnProperty.call(e,`recipient`)&&(this._recipient=e.recipient),Object.hasOwnProperty.call(e,`reviewed-author`)&&(this._reviewedAuthor=e[`reviewed-author`]),Object.hasOwnProperty.call(e,`script-writer`)&&(this._scriptWriter=e[`script-writer`]),Object.hasOwnProperty.call(e,`series-creator`)&&(this._seriesCreator=e[`series-creator`]),Object.hasOwnProperty.call(e,`translator`)&&(this._translator=e.translator),Object.hasOwnProperty.call(e,`accessed`)&&(this._accessed=e.accessed),Object.hasOwnProperty.call(e,`container`)&&(this._container=e.container),Object.hasOwnProperty.call(e,`event-date`)&&(this._eventDate=e[`event-date`]),Object.hasOwnProperty.call(e,`issued`)&&(this._issued=e.issued),Object.hasOwnProperty.call(e,`original-date`)&&(this._originalDate=e[`original-date`]),Object.hasOwnProperty.call(e,`submitted`)&&(this._submitted=e.submitted),Object.hasOwnProperty.call(e,`abstract`)&&(this._abstract=e.abstract),Object.hasOwnProperty.call(e,`annote`)&&(this._annote=e.annote),Object.hasOwnProperty.call(e,`archive`)&&(this._archive=e.archive),Object.hasOwnProperty.call(e,`archive_collection`)&&(this._archiveCollection=e.archive_collection),Object.hasOwnProperty.call(e,`archive_location`)&&(this._archiveLocation=e.archive_location),Object.hasOwnProperty.call(e,`archive-place`)&&(this._archivePlace=e[`archive-place`]),Object.hasOwnProperty.call(e,`authority`)&&(this._authority=e.authority),Object.hasOwnProperty.call(e,`call-number`)&&(this._callNumber=e[`call-number`]),Object.hasOwnProperty.call(e,`chapter-number`)&&(this._chapterNumber=e[`chapter-number`]),Object.hasOwnProperty.call(e,`citation-number`)&&(this._citationNumber=e[`citation-number`]),Object.hasOwnProperty.call(e,`citation-label`)&&(this._citationLabel=e[`citation-label`]),Object.hasOwnProperty.call(e,`collection-number`)&&(this._collectionNumber=e[`collection-number`]),Object.hasOwnProperty.call(e,`collection-title`)&&(this._collectionTitle=e[`collection-title`]),Object.hasOwnProperty.call(e,`container-title`)&&(this._containerTitle=e[`container-title`]),Object.hasOwnProperty.call(e,`container-title-short`)&&(this._containerTitleShort=e[`container-title-short`]),Object.hasOwnProperty.call(e,`dimensions`)&&(this._dimensions=e.dimensions),Object.hasOwnProperty.call(e,`DOI`)&&(this._DOI=e.DOI),Object.hasOwnProperty.call(e,`edition`)&&(this._edition=e.edition),Object.hasOwnProperty.call(e,`event`)&&(this._event=e.event),Object.hasOwnProperty.call(e,`event-title`)&&(this._eventTitle=e[`event-title`]),Object.hasOwnProperty.call(e,`event-place`)&&(this._eventPlace=e[`event-place`]),Object.hasOwnProperty.call(e,`first-reference-note-number`)&&(this._firstReferenceNoteNumber=e[`first-reference-note-number`]),Object.hasOwnProperty.call(e,`genre`)&&(this._genre=e.genre),Object.hasOwnProperty.call(e,`ISBN`)&&(this._ISBN=e.ISBN),Object.hasOwnProperty.call(e,`ISSN`)&&(this._ISSN=e.ISSN),Object.hasOwnProperty.call(e,`issue`)&&(this._issue=e.issue),Object.hasOwnProperty.call(e,`jurisdiction`)&&(this._jurisdiction=e.jurisdiction),Object.hasOwnProperty.call(e,`keyword`)&&(this._keyword=e.keyword),Object.hasOwnProperty.call(e,`locator`)&&(this._locator=e.locator),Object.hasOwnProperty.call(e,`medium`)&&(this._medium=e.medium),Object.hasOwnProperty.call(e,`note`)&&(this._note=e.note),Object.hasOwnProperty.call(e,`number`)&&(this._number=e.number),Object.hasOwnProperty.call(e,`number-of-pages`)&&(this._numberOfPages=e[`number-of-pages`]),Object.hasOwnProperty.call(e,`number-of-volumes`)&&(this._numberOfVolumes=e[`number-of-volumes`]),Object.hasOwnProperty.call(e,`original-publisher`)&&(this._originalPublisher=e[`original-publisher`]),Object.hasOwnProperty.call(e,`original-publisher-place`)&&(this._originalPublisherPlace=e[`original-publisher-place`]),Object.hasOwnProperty.call(e,`original-title`)&&(this._originalTitle=e[`original-title`]),Object.hasOwnProperty.call(e,`page`)&&(this._page=e.page),Object.hasOwnProperty.call(e,`page-first`)&&(this._pageFirst=e[`page-first`]),Object.hasOwnProperty.call(e,`part`)&&(this._part=e.part),Object.hasOwnProperty.call(e,`part-title`)&&(this._partTitle=e[`part-title`]),Object.hasOwnProperty.call(e,`PMCID`)&&(this._PMCID=e.PMCID),Object.hasOwnProperty.call(e,`PMID`)&&(this._PMID=e.PMID),Object.hasOwnProperty.call(e,`printing`)&&(this._printing=e.printing),Object.hasOwnProperty.call(e,`publisher`)&&(this._publisher=e.publisher),Object.hasOwnProperty.call(e,`publisher-place`)&&(this._publisherPlace=e[`publisher-place`]),Object.hasOwnProperty.call(e,`references`)&&(this._references=e.references),Object.hasOwnProperty.call(e,`reviewed-genre`)&&(this._reviewedGenre=e[`reviewed-genre`]),Object.hasOwnProperty.call(e,`reviewed-title`)&&(this._reviewedTitle=e[`reviewed-title`]),Object.hasOwnProperty.call(e,`scale`)&&(this._scale=e.scale),Object.hasOwnProperty.call(e,`section`)&&(this._section=e.section),Object.hasOwnProperty.call(e,`source`)&&(this._source=e.source),Object.hasOwnProperty.call(e,`status`)&&(this._status=e.status),Object.hasOwnProperty.call(e,`title`)&&(this._title=e.title),Object.hasOwnProperty.call(e,`title-short`)&&(this._titleShort=e[`title-short`]),Object.hasOwnProperty.call(e,`URL`)&&(this._URL=e.URL),Object.hasOwnProperty.call(e,`version`)&&(this._version=e.version),Object.hasOwnProperty.call(e,`volume`)&&(this._volume=e.volume),Object.hasOwnProperty.call(e,`volume-title`)&&(this._volumeTitle=e[`volume-title`]),Object.hasOwnProperty.call(e,`volume-title-short`)&&(this._volumeTitleShort=e[`volume-title-short`]),Object.hasOwnProperty.call(e,`year-suffix`)&&(this._yearSuffix=e[`year-suffix`]),Object.hasOwnProperty.call(e,`custom`)&&(this._custom=e.custom),Object.hasOwnProperty.call(e,`userID`)&&this._addCustomProperty(`userID`,e.userID),Object.hasOwnProperty.call(e,`groupID`)&&this._addCustomProperty(`groupID`,e.groupID),Object.hasOwnProperty.call(e,`creators`)){var t=this;e.creators.forEach(function(e){var n={};e.firstName&&(n.given=e.firstName),e.lastName&&(n.family=e.lastName),!t._author.some(function(e){return!(e.family!==n.family&&(e.family||n.family)||e.given!==n.given&&(e.given||n.given))})&&t._author.push(n)},this)}Object.hasOwnProperty.call(e,`libraryCatalog`)&&(this._source=e.libraryCatalog),Object.hasOwnProperty.call(e,`place`)&&(this._eventPlace=e.place,this._publisherPlace=e.place),Object.hasOwnProperty.call(e,`numberOfVolumes`)&&(this._numberOfVolumes=e.numberOfVolumes),Object.hasOwnProperty.call(e,`callNumber`)&&(this._callNumber=e.callNumber),Object.hasOwnProperty.call(e,`seriesNumber`)&&(this._collectionNumber=e.seriesNumber),Object.hasOwnProperty.call(e,`series`)&&(this._collectionTitle=e.series),Object.hasOwnProperty.call(e,`bookTitle`)&&(this._containerTitle=e.bookTitle),Object.hasOwnProperty.call(e,`extra`)&&(this._note=e.extra),Object.hasOwnProperty.call(e,`rights`)&&(this._license=e.rights),Object.hasOwnProperty.call(e,`archiveLocation`)&&(this._archiveLocation=e.archiveLocation),Object.hasOwnProperty.call(e,`abstractNote`)&&(this._abstract=e.abstractNote)},Z.prototype.getTitle=function(){return this._title},Z.prototype.getType=function(){return this._type},Z.prototype.setType=function(e){return this._type=e,this},Z.prototype.setCitationKey=function(e){return this._citationKey=e,this},Z.prototype.setCategories=function(e){return this._categories=e,this},Z.prototype.setLanguage=function(e){return this._language=e,this},Z.prototype.setJournalAbbreviation=function(e){return this._journalAbbreviation=e,this},Z.prototype.setShortTitle=function(e){return this._shortTitle=e,this},Z.prototype.setAuthor=function(e){return this._author=Array.isArray(e)?e:[e],this},Z.prototype.setChair=function(e){return this._chair=Array.isArray(e)?e:[e],this},Z.prototype.setCollectionEditor=function(e){return this._collectionEditor=Array.isArray(e)?e:[e],this},Z.prototype.setCompiler=function(e){return this._compiler=Array.isArray(e)?e:[e],this},Z.prototype.setComposer=function(e){return this._composer=Array.isArray(e)?e:[e],this},Z.prototype.setContainerAuthor=function(e){return this._containerAuthor=Array.isArray(e)?e:[e],this},Z.prototype.setContributor=function(e){return this._contributor=Array.isArray(e)?e:[e],this},Z.prototype.setCurator=function(e){return this._curator=Array.isArray(e)?e:[e],this},Z.prototype.setDirector=function(e){return this._director=Array.isArray(e)?e:[e],this},Z.prototype.setEditor=function(e){return this._editor=Array.isArray(e)?e:[e],this},Z.prototype.setEditorialDirector=function(e){return this._editorialDirector=Array.isArray(e)?e:[e],this},Z.prototype.setExecutiveProducer=function(e){return this._executiveProducer=Array.isArray(e)?e:[e],this},Z.prototype.setGuest=function(e){return this._guest=Array.isArray(e)?e:[e],this},Z.prototype.setHost=function(e){return this._host=Array.isArray(e)?e:[e],this},Z.prototype.setIllustrator=function(e){return this._illustrator=Array.isArray(e)?e:[e],this},Z.prototype.setNarrator=function(e){return this._narrator=Array.isArray(e)?e:[e],this},Z.prototype.setOrganizer=function(e){return this._organizer=Array.isArray(e)?e:[e],this},Z.prototype.setOriginalAuthor=function(e){return this._originalAuthor=Array.isArray(e)?e:[e],this},Z.prototype.setPerformer=function(e){return this._performer=Array.isArray(e)?e:[e],this},Z.prototype.setProducer=function(e){return this._producer=Array.isArray(e)?e:[e],this},Z.prototype.setRecipient=function(e){return this._recipient=Array.isArray(e)?e:[e],this},Z.prototype.setReviewedAuthor=function(e){return this._reviewedAuthor=Array.isArray(e)?e:[e],this},Z.prototype.setScriptwriter=function(e){return this._scriptwriter=Array.isArray(e)?e:[e],this},Z.prototype.setSeriesCreator=function(e){return this._seriesCreator=Array.isArray(e)?e:[e],this},Z.prototype.setTranslator=function(e){return this._translator=Array.isArray(e)?e:[e],this},Z.prototype.setAccessed=function(e){return this._accessed=e||{},this},Z.prototype.setContainer=function(e){return this._container=e||{},this},Z.prototype.setEventDate=function(e){return this._eventDate=e||{},this},Z.prototype.setIssued=function(e){return this._issued=e||{},this},Z.prototype.setOriginalDate=function(e){return this._originalDate=e||{},this},Z.prototype.setSubmitted=function(e){return this._submitted=e||{},this},Z.prototype.setAbstract=function(e){return this._abstract=e,this},Z.prototype.setAnnote=function(e){return this._annote=e,this},Z.prototype.setArchive=function(e){return this._archive=e,this},Z.prototype.setArchiveCollection=function(e){return this._archiveCollection=e,this},Z.prototype.setArchiveLocation=function(e){return this._archiveLocation=e,this},Z.prototype.setArchivePlace=function(e){return this._archivePlace=e,this},Z.prototype.setAuthority=function(e){return this._authority=e,this},Z.prototype.setCallNumber=function(e){return this._callNumber=e,this},Z.prototype.setChapterNumber=function(e){return this._chapterNumber=e,this},Z.prototype.setCitationNumber=function(e){return this._citationNumber=e,this},Z.prototype.setCitationLabel=function(e){return this._citationLabel=e,this},Z.prototype.setCollectionNumber=function(e){return this._collectionNumber=e,this},Z.prototype.setCollectionTitle=function(e){return this._collectionTitle=e,this},Z.prototype.setContainerTitle=function(e){return this._containerTitle=e,this},Z.prototype.setContainerTitleShort=function(e){return this._containerTitleShort=e,this},Z.prototype.setDimensions=function(e){return this._dimensions=e,this},Z.prototype.setDOI=function(e){return this._DOI=e,this},Z.prototype.setEdition=function(e){return this._edition=e,this},Z.prototype.setEvent=function(e){return this._event=e,this},Z.prototype.setEventTitle=function(e){return this._eventTitle=e,this},Z.prototype.setEventPlace=function(e){return this._eventPlace=e,this},Z.prototype.setFirstReferenceNoteNumber=function(e){return this._firstReferenceNoteNumber=e,this},Z.prototype.setGenre=function(e){return this._genre=e,this},Z.prototype.setISBN=function(e){return this._ISBN=e,this},Z.prototype.setISSN=function(e){return this._ISSN=e,this},Z.prototype.setIssue=function(e){return this._issue=e,this},Z.prototype.setJurisdiction=function(e){return this._jurisdiction=e,this},Z.prototype.setKeyword=function(e){return this._keyword=e,this},Z.prototype.setLocator=function(e){return this._locator=e,this},Z.prototype.setMedium=function(e){return this._medium=e,this},Z.prototype.setNote=function(e){return this._note=e,this},Z.prototype.setNumber=function(e){return this._number=e,this},Z.prototype.setNumberOfPages=function(e){return this._numberOfPages=e,this},Z.prototype.setNumberOfVolumes=function(e){return this._numberOfVolumes=e,this},Z.prototype.setOriginalPublisher=function(e){return this._originalPublisher=e,this},Z.prototype.setOriginalPublisherPlace=function(e){return this._originalPublisherPlace=e,this},Z.prototype.setOriginalTitle=function(e){return this._originalTitle=e,this},Z.prototype.setPage=function(e){return this._page=e,this},Z.prototype.setPageFirst=function(e){return this._pageFirst=e,this},Z.prototype.setPart=function(e){return this._part=e,this},Z.prototype.setPartTitle=function(e){return this._partTitle=e,this},Z.prototype.setPMCID=function(e){return this._PMCID=e,this},Z.prototype.setPMID=function(e){return this._PMID=e,this},Z.prototype.setPrinting=function(e){return this._printing=e,this},Z.prototype.setPublisher=function(e){return this._publisher=e,this},Z.prototype.setPublisherPlace=function(e){return this._publisherPlace=e,this},Z.prototype.setReferences=function(e){return this._references=e,this},Z.prototype.setReviewedGenre=function(e){return this._reviewedGenre=e,this},Z.prototype.setReviewedTitle=function(e){return this._reviewedTitle=e,this},Z.prototype.setScale=function(e){return this._scale=e,this},Z.prototype.setSection=function(e){return this._section=e,this},Z.prototype.setSource=function(e){return this._source=e,this},Z.prototype.setStatus=function(e){return this._status=e,this},Z.prototype.setTitle=function(e){return this._title=e,this},Z.prototype.setTitleShort=function(e){return this._titleShort=e,this},Z.prototype.setURL=function(e){return this._URL=e,this},Z.prototype.setVersion=function(e){return this._version=e,this},Z.prototype.setVolume=function(e){return this._volume=e,this},Z.prototype.setVolumeTitle=function(e){return this._volumeTitle=e,this},Z.prototype.setVolumeTitleShort=function(e){return this._volumeTitleShort=e,this},Z.prototype.setYearSuffix=function(e){return this._yearSuffix=e,this},Z.prototype.setCustom=function(e){return this._custom=Object.assign(this._custom,e),this},Z.prototype.toJSON=function(e){var t={};return t.id=this._id,this._type!==void 0&&this._type!==``&&(t.type=this._type),this._citationKey!==void 0&&this._citationKey!==``&&(t[`citation-key`]=this._citationKey),this._categories.length>0&&(t.categories=this._categories),this._language!==void 0&&this._language!==``&&(t.language=this._language),this._journalAbbreviation!==void 0&&this._journalAbbreviation!==``&&(t.journalAbbreviation=this._journalAbbreviation),this._shortTitle!==void 0&&this._shortTitle!==``&&(t.shortTitle=this._shortTitle,this._titleShort===void 0&&(t[`title-short`]=this._shortTitle)),this._author.length>0&&(t.author=this._author),this._chair.length>0&&(t.chair=this._chair),this._collectionEditor.length>0&&(t[`collection-editor`]=this._collectionEditor),this._compiler.length>0&&(t.compiler=this._compiler),this._composer.length>0&&(t.composer=this._composer),this._containerAuthor.length>0&&(t[`container-author`]=this._containerAuthor),this._contributor.length>0&&(t.contributor=this._contributor),this._curator.length>0&&(t.curator=this._curator),this._director.length>0&&(t.director=this._director),this._editor.length>0&&(t.editor=this._editor),this._editorialDirector.length>0&&(t[`editorial-director`]=this._editorialDirector),this._executiveProducer.length>0&&(t[`executive-producer`]=this._executiveProducer),this._guest.length>0&&(t.guest=this._guest),this._host.length>0&&(t.host=this._host),this._illustrator.length>0&&(t.illustrator=this._illustrator),this._narrator.length>0&&(t.narrator=this._narrator),this._organizer.length>0&&(t.organizer=this._organizer),this._originalAuthor.length>0&&(t[`original-author`]=this._originalAuthor),this._performer.length>0&&(t.performer=this._performer),this._producer.length>0&&(t.producer=this._producer),this._recipient.length>0&&(t.recipient=this._recipient),this._reviewedAuthor.length>0&&(t[`reviewed-author`]=this._reviewedAuthor),this._scriptwriter.length>0&&(t[`script-writer`]=this._scriptwriter),this._seriesCreator.length>0&&(t[`series-creator`]=this._seriesCreator),this._translator.length>0&&(t.translator=this._translator),Object.keys(this._accessed).length>0&&(t.accessed=this._accessed),Object.keys(this._container).length>0&&(t.container=this._container),Object.keys(this._eventDate).length>0&&(t[`event-date`]=this._eventDate),Object.keys(this._issued).length>0&&(t.issued=this._issued),Object.keys(this._originalDate).length>0&&(t[`original-date`]=this._originalDate),Object.keys(this._submitted).length>0&&(t.submitted=this._submitted),this._abstract!==void 0&&this._abstract!==``&&(t.abstract=this._abstract),this._annote!==void 0&&this._annote!==``&&(t.annote=this._annote),this._archive!==void 0&&this._archive!==``&&(t.archive=this._archive),this._archiveCollection!==void 0&&this._archiveCollection!==``&&(t.archive_collection=this._archiveCollection),this._archiveLocation!==void 0&&this._archiveLocation!==``&&(t.archive_location=this._archiveLocation),this._archivePlace!==void 0&&this._archivePlace!==``&&(t[`archive-place`]=this._archivePlace),this._authority!==void 0&&this._authority!==``&&(t.authority=this._authority),this._callNumber!==void 0&&this._callNumber!==``&&(t[`call-number`]=this._callNumber),this._chapterNumber!==void 0&&this._chapterNumber!==``&&(t[`chapter-number`]=this._chapterNumber),this._citationNumber!==void 0&&this._citationNumber!==``&&(t[`citation-number`]=this._citationNumber),this._citationLabel!==void 0&&this._citationLabel!==``&&(t[`citation-label`]=this._citationLabel),this._collectionNumber!==void 0&&this._collectionNumber!==``&&(t[`collection-number`]=this._collectionNumber),this._collectionTitle!==void 0&&this._collectionTitle!==``&&(t[`collection-title`]=this._collectionTitle),this._containerTitle!==void 0&&this._containerTitle!==``&&(t[`container-title`]=this._containerTitle),this._containerTitleShort!==void 0&&this._containerTitleShort!==``&&(t[`container-title-short`]=this._containerTitleShort),this._dimensions!==void 0&&this._dimensions!==``&&(t.dimensions=this._dimensions),this._DOI!==void 0&&this._DOI!==``&&(t.DOI=this._DOI),this._edition!==void 0&&this._edition!==``&&(t.edition=this._edition),this._event!==void 0&&this._event!==``&&(t.event=this._event),this._eventTitle!==void 0&&this._eventTitle!==``&&(t[`event-title`]=this._eventTitle),this._eventPlace!==void 0&&this._eventPlace!==``&&(t[`event-place`]=this._eventPlace),this._firstReferenceNoteNumber!==void 0&&this._firstReferenceNoteNumber!==``&&(t[`first-reference-note-number`]=this._firstReferenceNoteNumber),this._genre!==void 0&&this._genre!==``&&(t.genre=this._genre),this._ISBN!==void 0&&this._ISBN!==``&&(t.ISBN=this._ISBN),this._ISSN!==void 0&&this._ISSN!==``&&(t.ISSN=this._ISSN),this._issue!==void 0&&this._issue!==``&&(t.issue=this._issue),this._jurisdiction!==void 0&&this._jurisdiction!==``&&(t.jurisdiction=this._jurisdiction),this._keyword!==void 0&&this._keyword!==``&&(t.keyword=this._keyword),this._locator!==void 0&&this._locator!==``&&(t.locator=this._locator),this._medium!==void 0&&this._medium!==``&&(t.medium=this._medium),this._note!==void 0&&this._note!==``&&(t.note=this._note),this._number!==void 0&&this._number!==``&&(t.number=this._number),this._numberOfPages!==void 0&&this._numberOfPages!==``&&(t[`number-of-pages`]=this._numberOfPages),this._numberOfVolumes!==void 0&&this._numberOfVolumes!==``&&(t[`number-of-volumes`]=this._numberOfVolumes),this._originalPublisher!==void 0&&this._originalPublisher!==``&&(t[`original-publisher`]=this._originalPublisher),this._originalPublisherPlace!==void 0&&this._originalPublisherPlace!==``&&(t[`original-publisher-place`]=this._originalPublisherPlace),this._originalTitle!==void 0&&this._originalTitle!==``&&(t[`original-title`]=this._originalTitle),this._page!==void 0&&this._page!==``&&(t.page=this._page),this._pageFirst!==void 0&&this._pageFirst!==``&&(t[`page-first`]=this._pageFirst),this._part!==void 0&&this._part!==``&&(t.part=this._part),this._partTitle!==void 0&&this._partTitle!==``&&(t[`part-title`]=this._partTitle),this._PMCID!==void 0&&this._PMCID!==``&&(t.PMCID=this._PMCID),this._PMID!==void 0&&this._PMID!==``&&(t.PMID=this._PMID),this._printing!==void 0&&this._printing!==``&&(t.printing=this._printing),this._publisher!==void 0&&this._publisher!==``&&(t.publisher=this._publisher),this._publisherPlace!==void 0&&this._publisherPlace!==``&&(t[`publisher-place`]=this._publisherPlace),this._references!==void 0&&this._references!==``&&(t.references=this._references),this._reviewedGenre!==void 0&&this._reviewedGenre!==``&&(t[`reviewed-genre`]=this._reviewedGenre),this._reviewedTitle!==void 0&&this._reviewedTitle!==``&&(t[`reviewed-title`]=this._reviewedTitle),this._scale!==void 0&&this._scale!==``&&(t.scale=this._scale),this._section!==void 0&&this._section!==``&&(t.section=this._section),this._source!==void 0&&this._source!==``&&(t.source=this._source),this._status!==void 0&&this._status!==``&&(t.status=this._status),this._title!==void 0&&this._title!==``&&(t.title=this._title),this._titleShort!==void 0&&this._titleShort!==``&&(t[`title-short`]=this._titleShort),this._URL!==void 0&&this._URL!==``&&(t.URL=this._URL),this._version!==void 0&&this._version!==``&&(t.version=this._version),this._volume!==void 0&&this._volume!==``&&(t.volume=this._volume),this._volumeTitle!==void 0&&this._volumeTitle!==``&&(t[`volume-title`]=this._volumeTitle),this._volumeTitleShort!==void 0&&this._volumeTitleShort!==``&&(t[`volume-title-short`]=this._volumeTitleShort),this._yearSuffix!==void 0&&this._yearSuffix!==``&&(t[`year-suffix`]=this._yearSuffix),Object.keys(this._custom).length!==0&&(t.custom=this._custom),this._license!==void 0&&this._license!==``&&(t.license=this._license),t};function io(e){if(typeof e!=`string`&&typeof e!=`number`)throw Error(`CitationItem: id is required`);this.id=e,this._itemData=new Z(e),this._prefix=void 0,this._suffix=void 0,this._locator=void 0,this._label=void 0,this._suppressAuthor=void 0,this._authorOnly=void 0,this._uris=[]}io.prototype.fillFromObject=function(e){var t=this;Object.hasOwnProperty.call(e,`version`)&&Object.hasOwnProperty.call(e,`library`)?(this._itemData.fillFromObject(e.data),Object.hasOwnProperty.call(e,`links`)&&(Object.hasOwnProperty.call(e.links,`self`)&&this.addUri(e.links.self.href),Object.hasOwnProperty.call(e.links,`alternate`)&&this.addUri(e.links.alternate.href))):Object.hasOwnProperty.call(e,`itemData`)?this._itemData.fillFromObject(e.itemData):this._itemData.fillFromObject(e),Object.hasOwnProperty.call(e,`prefix`)&&(this._prefix=e.prefix),Object.hasOwnProperty.call(e,`suffix`)&&(this._suffix=e.suffix),Object.hasOwnProperty.call(e,`locator`)&&(this._locator=e.locator),Object.hasOwnProperty.call(e,`label`)&&(this._label=e.label),Object.hasOwnProperty.call(e,`suppress-author`)&&(this._suppressAuthor=e[`suppress-author`]),Object.hasOwnProperty.call(e,`author-only`)&&(this._authorOnly=e[`author-only`]),Object.hasOwnProperty.call(e,`uris`)&&e.uris.forEach(function(e){t.addUri(e)},this)},io.prototype.getInfoForCitationCluster=function(){var e={id:this.id,"suppress-author":this._suppressAuthor};return this._prefix&&(e.prefix=this._prefix),this._suffix&&(e.suffix=this._suffix),this._locator&&(e.locator=this._locator),this._label&&(e.label=this._label),e},io.prototype.getItemData=function(){return this._itemData},io.prototype.getProperty=function(e){return this._itemData.getCustomProperty(e)===null?null:this._itemData.getCustomProperty(e)},io.prototype.setPrefix=function(e){return this._prefix=e,this},io.prototype.setSuffix=function(e){return this._suffix=e,this},io.prototype.setLocator=function(e){return this._locator=e,this},io.prototype.setLabel=function(e){if(e){if(`act.appendix.article-locator.book.canon.chapter.column.elocation.equation.figure.folio.issue.line.note.opus.page.paragraph.part.rule.scene.section.sub-verbo.supplement.table.timestamp.title-locator.verse.version.volume`.split(`.`).indexOf(e)===-1)throw Error(`CitationItem.setLocator: Invalid label "`+e+`"`);this._label=e}return this},io.prototype.setSuppressAuthor=function(e){return this._suppressAuthor=e,this},io.prototype.setAuthorOnly=function(e){return this._authorOnly=e,this},io.prototype.addUri=function(e){return this._uris.indexOf(e)===-1&&this._uris.push(e),this},io.prototype.toJSON=function(e){var t={};return t.id=this.id,this._itemData&&(t.itemData=this._itemData.toJSON?this._itemData.toJSON(e||!1):this._itemData),this._prefix!==void 0&&(t.prefix=this._prefix),this._suffix!==void 0&&(t.suffix=this._suffix),this._locator!==void 0&&(t.locator=this._locator),this._label!==void 0&&(t.label=this._label),this._suppressAuthor!==void 0&&(t[`suppress-author`]=this._suppressAuthor),this._authorOnly!==void 0&&(t[`author-only`]=this._authorOnly),this._uris.length&&(t.uris=this._uris),t},io.prototype.toFlatJSON=function(e){var t={id:this.id,index:e};this._suppressAuthor!==void 0&&(t[`suppress-author`]=this._suppressAuthor);var n=this._itemData.toJSON();return Object.assign(t,n),this._itemData.getCustomProperty(`userID`)!==void 0&&this._itemData.getCustomProperty(`userID`)!==null&&(t.userID=String(this._itemData.getCustomProperty(`userID`))),this._itemData.getCustomProperty(`groupID`)!==void 0&&this._itemData.getCustomProperty(`groupID`)!==null&&(t.groupID=String(this._itemData.getCustomProperty(`groupID`))),t};var ao=new WeakSet,oo=function(){function e(t){l(this,e),p(this,ao),t||=a(ao,this,ho).call(this),go._.has(t)&&(console.warn(`Citation ID must be unique`),t=a(ao,this,ho).call(this)),go._.add(t),this.citationID=t,this._citationItems=[],this._properties={},this._manualOverride={},this._schema=`https://raw.githubusercontent.com/citation-style-language/schema/master/schemas/input/csl-citation.json`}return h(e,[{key:`fillFromObject`,value:function(e){return Object.hasOwnProperty.call(e,`properties`)||Object.hasOwnProperty.call(e,`manualOverride`)||Object.hasOwnProperty.call(e,`schema`)?a(ao,this,so).call(this,e):Object.hasOwnProperty.call(e,`citationItems`)?a(ao,this,co).call(this,e):Object.hasOwnProperty.call(e,`version`)&&Object.hasOwnProperty.call(e,`library`)?a(ao,this,uo).call(this,e):a(ao,this,lo).call(this,e)}},{key:`getCitationItems`,value:function(){return this._citationItems}},{key:`getDoNotUpdate`,value:function(){return Object.hasOwnProperty.call(this._properties,`dontUpdate`)?!!this._properties.dontUpdate:Object.hasOwnProperty.call(this._manualOverride,`isManuallyOverridden`)?!!this._manualOverride.isManuallyOverridden:!1}},{key:`getInfoForCitationCluster`,value:function(){return this._citationItems.map(function(e){return e.getInfoForCitationCluster()},this)}},{key:`getPlainCitation`,value:function(){return Object.hasOwnProperty.call(this._properties,`plainCitation`)?String(this._properties.plainCitation):this._manualOverride&&Object.keys(this._manualOverride).length>0?String(this._manualOverride.citeprocText):``}},{key:`setDoNotUpdate`,value:function(){return a(ao,this,po).call(this,{dontUpdate:!0}),this}},{key:`setNoteIndex`,value:function(e){return a(ao,this,po).call(this,{noteIndex:e}),this}},{key:`setPlainCitation`,value:function(e){return a(ao,this,po).call(this,{plainCitation:e}),this}},{key:`setManualOverride`,value:function(e,t){var n={citeprocText:e,isManuallyOverridden:!!t,manualOverrideText:t||``};return this._manualOverride=n,this}},{key:`validate`,value:function(){var e=[];if(this._schema||e.push(`Schema is required`),this.citationID||e.push(`citationID is required`),this._citationItems&&Array.isArray(this._citationItems))for(var t=0;t0&&(e.properties=this._properties),this._manualOverride&&Object.keys(this._manualOverride).length>0&&(e.manualOverride=this._manualOverride),this._citationItems&&this._citationItems.length>0&&(e.citationItems=this._citationItems.map(function(e){return e.toJSON()})),e}}],[{key:`resetUsedIDs`,value:function(){go._=new Set}}])}();function so(e){var t=this;if(Object.hasOwnProperty.call(e,`schema`),Object.hasOwnProperty.call(e,`properties`)&&a(ao,this,po).call(this,e.properties),Object.hasOwnProperty.call(e,`manualOverride`)&&(this._manualOverride=e.manualOverride),!Object.hasOwnProperty.call(e,`citationItems`))return console.error(`citationItems is empty`),0;var n=this._citationItems.map(function(e){return e.id});return e.citationItems.forEach(function(e){var r=e.id,i;n.indexOf(r)>=0?i=t._citationItems[n.indexOf(r)]:(i=new io(r),n.push(r)),typeof r==`number`&&(r=a(ao,t,mo).call(t,e)),i.fillFromObject(e),a(ao,t,fo).call(t,i)},this),n.length}function co(e){var t=this;return e.citationItems.length===0?(console.error(`CSLCitation.citationItems: citationItems is empty`),0):(e.citationItems.length>1&&console.warn(`CSLCitation.citationItems: citationItems has more than one item`),e.citationItems.forEach(function(e){a(ao,t,lo).call(t,e)},this),1)}function lo(e){var t=e.id,n,r=this._citationItems.map(function(e){return e.id});return n=r.indexOf(t)>=0?this._citationItems[r.indexOf(t)]:new io(t),n.fillFromObject(e),a(ao,this,fo).call(this,n),1}function uo(e){if(!Object.hasOwnProperty.call(e,`data`))return console.error(`Invalid citation object`),0;var t=this._citationItems.map(function(e){return e.id}),n=e.data.key,r=t.indexOf(n)>=0?this._citationItems[t.indexOf(n)]:new io(n);return r.fillFromObject(e),a(ao,this,fo).call(this,r),1}function fo(e){var t=this._citationItems.map(function(e){return e.id});return t.indexOf(e.id)>=0?(this._citationItems[t.indexOf(e.id)]=e,this):(this._citationItems.push(e),this)}function po(e){var t=this;return Object.keys(e).forEach(function(n){Object.hasOwnProperty.call(e,n)&&(t._properties[n]=e[n])},this),this}function mo(e){if(Object.hasOwnProperty.call(e,`uris`)&&e.uris.length){var t=e.uris[0].lastIndexOf(`/`);return e.uris[0].slice(t+1)}return e.id}function ho(){return Math.random().toString(36).substring(2,15)}var go={_:new Set},Q=new WeakMap,_o=new WeakMap,vo=new WeakMap,yo=new WeakMap,bo=new WeakSet,xo=function(){function e(){l(this,e),p(this,bo),d(this,Q,void 0),d(this,_o,void 0),d(this,vo,void 0),d(this,yo,void 0),f(Q,this,null),f(_o,this,window.Asc.plugin.button),f(vo,this,Asc.plugin.onThemeChanged),f(yo,this,Asc.plugin.onTranslate)}return h(e,[{key:`show`,value:function(e,t){var n=this;u(Q,this)&&a(bo,this,Co).call(this),f(Q,this,new window.Asc.PluginWindow);var r={name:`Zotero`,url:`info-window.html`,description:window.Asc.plugin.tr(e),isVisual:!0,buttons:[{text:window.Asc.plugin.tr(`Yes`),primary:!0,isViewer:!1},{text:window.Asc.plugin.tr(`No`),primary:!1}],isModal:!1,EditorsSupport:[`word`],size:[380,240],isViewer:!0,isDisplayedInViewer:!1,isInsideMode:!1};return a(bo,this,So).call(this,r,t,`default`),u(Q,this).show(r),new Promise(function(e,t){window.Asc.plugin.button=function(t,r){e(t===0),a(bo,n,Co).call(n)}})}},{key:`showEditWindow`,value:function(e){var t=this;u(Q,this)&&a(bo,this,Co).call(this),f(Q,this,new window.Asc.PluginWindow);var n={name:`Zotero`,url:`edit-window.html`,description:window.Asc.plugin.tr(`Edit citation`),isVisual:!0,buttons:[{text:window.Asc.plugin.tr(`Save`),primary:!0,isViewer:!1},{text:window.Asc.plugin.tr(`Cancel`),primary:!1}],isModal:!1,EditorsSupport:[`word`],size:[380,150],isViewer:!0,isDisplayedInViewer:!1,isInsideMode:!1};return a(bo,this,So).call(this,n,e,`default`),u(Q,this).show(n),new Promise(function(e,n){window.Asc.plugin.button=function(){var n=s(w().m(function n(r,i){var o;return w().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,new Promise(function(e){if(!u(Q,t)){e(null);return}u(Q,t).attachEvent(`onSaveFields`,e),u(Q,t).command(`onClickSave`)});case 1:o=n.v,e(r===0?o:null),a(bo,t,Co).call(t);case 2:return n.a(2)}},n)}));return function(e,t){return n.apply(this,arguments)}}()})}},{key:`showInfoWindow`,value:function(e,t,n){var r=this;u(Q,this)&&a(bo,this,Co).call(this),typeof n!=`string`&&(n=`warning`),f(Q,this,new window.Asc.PluginWindow);var i={name:`Zotero`,url:`info-window.html`,description:window.Asc.plugin.tr(e),isVisual:!0,buttons:[{text:window.Asc.plugin.tr(`OK`),primary:!0,isViewer:!1}],isModal:!1,EditorsSupport:[`word`],size:[350,76],isViewer:!0,isDisplayedInViewer:!1,isInsideMode:!1};return a(bo,this,So).call(this,i,window.Asc.plugin.tr(t),n),u(Q,this).show(i),new Promise(function(e,t){window.Asc.plugin.button=function(t,n){e(t===0),a(bo,r,Co).call(r)}})}}])}();function So(e,t,n){var r=this;u(Q,this)&&(f(_o,this,window.Asc.plugin.button),f(vo,this,Asc.plugin.onThemeChanged),f(yo,this,Asc.plugin.onTranslate),window.Asc.plugin.onThemeChanged=function(e){var t;(t=u(Q,r))==null||t.command(`onThemeChanged`,e),u(vo,r).call(r,e)},window.Asc.plugin.onTranslate=function(){var e;(e=u(Q,r))==null||e.command(`onTranslate`),u(yo,r).call(r)},u(Q,this).attachEvent(`onWindowReady`,function(){if(n===`warning`){var e;(e=u(Q,r))==null||e.command(`onWarning`,t)}else if(n===`success`){var i;(i=u(Q,r))==null||i.command(`onSuccess`,t)}else{var a;(a=u(Q,r))==null||a.command(`onAttachedContent`,t)}}),u(Q,this).attachEvent(`onUpdateHeight`,function(t){Asc.plugin.executeMethod(`ResizeWindow`,[u(Q,r)?.id,[e.size[0]-2,t]],function(){})}))}function Co(){u(Q,this)&&(u(Q,this).close(),f(Q,this,null)),window.Asc.plugin.button=u(_o,this),window.Asc.plugin.onThemeChanged=u(vo,this)}var wo=new WeakMap,$=new WeakSet,To=function(){function e(t,n,r){l(this,e),p(this,$),d(this,wo,void 0),this._bibPlaceholderIfEmpty=`Please insert some citation into the document.`,this._citPrefixNew=`ZOTERO_ITEM`,this._citSuffixNew=`CSL_CITATION`,this._citPrefix=`ZOTERO_CITATION`,this._bibPrefixNew=`ZOTERO_BIBL`,this._bibSuffixNew=`CSL_BIBLIOGRAPHY`,this._bibPrefix=`ZOTERO_BIBLIOGRAPHY`,this._sdk=r,this._localesManager=t,this._cslStylesManager=n,this._storage=new no,this._formatter,this.citationDocService=new Ba(this._citPrefixNew,this._citSuffixNew,this._bibPrefixNew,this._bibSuffixNew),f(wo,this,new xo)}return h(e,[{key:`getCurrentField`,value:function(){var e=s(w().m(function e(){return w().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.getCurrentField())}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`saveAsText`,value:function(){var e=s(w().m(function e(){var t;return w().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.citationDocService.saveAsText();case 1:return t=e.v,t&&this.showSuccessMessage(`All active Zotero citations and Bibliography have been replaced.`),e.a(2,t)}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`insertSelectedCitations`,value:function(){var e=s(w().m(function e(t){var n=this,r,i,o,s;return w().w(function(e){for(;;)switch(e.n){case 0:return r=this,e.n=1,a($,this,Mo).call(this);case 1:for(o in a($,this,Lo).call(this),i=new oo(``),t)s=t[o],i.fillFromObject(s);return e.a(2,a($,this,Oo).call(this,t).then(function(e){return e.forEach(function(e){i.fillFromObject(e)}),n._storage.addCslCitation(i),a($,r,Eo).call(r,i)}))}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`insertSelectedCitationsToCurrentField`,value:function(){var e=s(w().m(function e(t,n){var r=this,i,o,s,c,l,u,d,f,p;return w().w(function(e){for(;;)switch(e.n){case 0:for(c in i=a($,this,jo).call(this,n),o=i.citationID,s=new oo(``),s.fillFromObject(i),t)l=t[c],s.fillFromObject(l);return e.n=1,a($,this,Oo).call(this,t);case 1:return u=e.v,u.forEach(function(e){s.fillFromObject(e)}),e.n=2,a($,this,Mo).call(this,s.toJSON(),o);case 2:if(d=e.v,f=d.fieldsWithCitations,a($,this,Lo).call(this),p=f.find(function(e){return e.cslCitation.citationID===o})?.cslCitation,p){e.n=3;break}throw Error(`Citation not found`);case 3:return e.a(2,a($,this,Do).call(this,p).then(function(e){return n.Content=e,n.Value=r._citPrefixNew+` `+r._citSuffixNew+JSON.stringify(p.toJSON()),n}))}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`insertBibliography`,value:function(){var e=s(w().m(function e(){var t,n,r,i,o,s,c,l;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,Mo).call(this);case 1:if(t=e.v,n=t.fieldsWithCitations,r=t.bibFieldValue,i=t.bibField,o=n.length===0,a($,this,Lo).call(this),!i){e.n=3;break}return e.n=2,a($,this,Po).call(this,o,i);case 2:return c=e.v,s=[c],e.a(2,this.citationDocService.updateAddinFields(s).then(function(e){return e?e[0]:``}));case 3:return e.a(2,a($,this,No).call(this,o,r));case 4:e.n=6;break;case 5:throw e.p=5,l=e.v,l;case 6:return e.a(2)}},e,this,[[0,5]])}));function t(){return e.apply(this,arguments)}return t}()},{key:`moveCursorToField`,value:function(){var e=s(w().m(function e(t,n){return w().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.moveCursorToField(t,n))}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`moveCursorOutsideField`,value:function(){var e=s(w().m(function e(t,n){return w().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.moveCursorOutsideField(t,n))}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`moveCursorRight`,value:function(){var e=s(w().m(function e(){return w().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.moveCursorRight())}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`updateCslItems`,value:function(){var e=s(w().m(function e(t){var n,r,i,o,s,c,l,u;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,Mo).call(this);case 1:if(n=e.v,r=n.fieldsWithCitations,i=n.bibField,o=r.length===0,a($,this,Lo).call(this),s=[],t===void 0&&(c=this._cslStylesManager.getLastUsedFormat(),c===`numeric`&&(t=!0)),typeof t!=`boolean`){e.n=3;break}return e.n=2,a($,this,Fo).call(this,r,t);case 2:s=e.v;case 3:if(!i){e.n=5;break}return l=s,e.n=4,a($,this,Po).call(this,o,i);case 4:l.push.call(l,e.v);case 5:if(!(s&&s.length)){e.n=6;break}return e.a(2,this.citationDocService.updateAddinFields(s));case 6:e.n=8;break;case 7:throw e.p=7,u=e.v,u;case 8:return e.a(2)}},e,this,[[0,7]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`updateCslItemsInNotes`,value:function(){var e=s(w().m(function e(t){var n,r,i,o,s,c,l,u;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,Mo).call(this);case 1:return n=e.v,r=n.fieldsWithCitations,i=n.bibField,o=r.length===0,a($,this,Lo).call(this),e.n=2,a($,this,Fo).call(this,r,!1);case 2:if(s=e.v,!(s&&s.length)){e.n=3;break}return e.n=3,this.citationDocService.convertNotesStyle(s,t);case 3:if(!i){e.n=5;break}return e.n=4,a($,this,Po).call(this,o,i);case 4:return l=e.v,c=[l],e.n=5,this.citationDocService.updateAddinFields(c);case 5:e.n=7;break;case 6:throw e.p=6,u=e.v,u;case 7:return e.a(2)}},e,this,[[0,6]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`updateItem`,value:function(){var e=s(w().m(function e(t,n){var r,i,o,s;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,Mo).call(this,t,t.citationID);case 1:return r=e.v,i=r.fieldsWithCitations,r.bibField,i.length,a($,this,Lo).call(this),t&&(i=i.filter(function(e){return e.cslCitation.citationID===t.citationID})),e.n=2,a($,this,Fo).call(this,i,!0);case 2:if(o=e.v,!(n&&o&&o.length)){e.n=4;break}return e.n=3,this.citationDocService.convertNotesStyle(o,n);case 3:o=[];case 4:if(!(o&&o.length)){e.n=5;break}return e.a(2,this.citationDocService.updateAddinFields(o));case 5:e.n=7;break;case 6:throw e.p=6,s=e.v,s;case 7:return e.a(2)}},e,this,[[0,6]])}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`switchingBetweenNotesAndText`,value:function(){var e=s(w().m(function e(t){var n,r,i,o,s,c,l,u;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,Mo).call(this);case 1:return n=e.v,r=n.fieldsWithCitations,i=n.bibField,o=r.length===0,a($,this,Lo).call(this),e.n=2,a($,this,Fo).call(this,r,!0);case 2:if(s=e.v,!(s&&s.length)){e.n=5;break}if(!t){e.n=4;break}return e.n=3,this.citationDocService.convertTextToNotes(s,t);case 3:e.n=5;break;case 4:return e.n=5,this.citationDocService.convertNotesToText(s);case 5:if(!i){e.n=7;break}return e.n=6,a($,this,Po).call(this,o,i);case 6:return l=e.v,c=[l],e.n=7,this.citationDocService.updateAddinFields(c);case 7:e.n=9;break;case 8:throw e.p=8,u=e.v,u;case 9:return e.a(2)}},e,this,[[0,8]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`convertNotesStyle`,value:function(){var e=s(w().m(function e(t){var n,r,i,o;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,Mo).call(this);case 1:return n=e.v,r=n.fieldsWithCitations,a($,this,Lo).call(this),e.n=2,a($,this,Fo).call(this,r,!1,!0);case 2:if(i=e.v,!(!i||!i.length)){e.n=3;break}return e.a(2);case 3:return e.n=4,this.citationDocService.convertNotesStyle(i,t);case 4:e.n=6;break;case 5:throw e.p=5,o=e.v,o;case 6:return e.a(2)}},e,this,[[0,5]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`showEditCitationWindow`,value:function(){var e=s(w().m(function e(t){var n,r;return w().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2,null);case 1:return n=a($,this,jo).call(this,t),e.n=2,u(wo,this).showEditWindow(n);case 2:if(r=e.v,r){e.n=3;break}return e.a(2,null);case 3:return e.a(2,r)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`showWarningMessage`,value:function(){var e=s(w().m(function e(t){return w().w(function(e){for(;;)switch(e.n){case 0:u(wo,this).showInfoWindow(`Warning!`,t);case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`showSuccessMessage`,value:function(){var e=s(w().m(function e(t){return w().w(function(e){for(;;)switch(e.n){case 0:u(wo,this).showInfoWindow(`Success!`,t,`success`);case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}();function Eo(e){var t=this,n=this,r=!1;return Promise.resolve().then(function(){if(e.getCitationItems().forEach(function(e){n._storage.hasItem(e.id)||(r=!0)}),r){var t=[];n._storage.forEachItem(function(e,n){t.push(n)}),n._formatter.updateItems(t)}}).then(function(){return a($,t,Ao).call(t,e)}).then(function(t){var r=null;return n._cslStylesManager.getLastUsedFormat()===`note`&&(r=n._cslStylesManager.getLastUsedNotesStyle()),n.citationDocService.addCitation(t,JSON.stringify(e.toJSON()),r)})}function Do(e){var t=this,n=this,r=!1;return Promise.resolve().then(function(){if(e.getCitationItems().forEach(function(e){n._storage.hasItem(e.id)||(r=!0)}),r){var t=[];n._storage.forEachItem(function(e,n){t.push(n)}),n._formatter.updateItems(t)}}).then(function(){return a($,t,Ao).call(t,e)})}function Oo(e){var t=[],n={};for(var r in e){var i=e[r],a=i.userID,o=i.groupID;a?t.push(i.id):o&&(n[o]||(n[o]=[]),n[o].push(i.id))}var s=[];for(var c in t.length&&s.push(this._sdk.getItems(null,t,`json`).then(function(e){return e.items||[]})),n)Object.hasOwnProperty.call(n,c)&&s.push(this._sdk.getGroupItems(null,c,n[c],`json`).then(function(e){return e.items||[]}));return Promise.all(s).then(function(e){return e.reduce(function(e,t){return e.concat(t)},[])})}function ko(){try{for(var e=Array(this._storage.size),t=this._formatter.makeBibliography(),n=0;n{var n=F(),r=G(),i=I(),a=ge(),o=r(`iterator`);t.exports=!n(function(){var e=new URL(`b?a=1&b=2&c=3`,`https://a`),t=e.searchParams,n=new URLSearchParams(`a=1&a=2&b=3`),r=``;return e.pathname=`c%20d`,t.forEach(function(e,n){t.delete(`b`),r+=n+e}),n.delete(`a`,2),n.delete(`b`,void 0),a&&(!e.toJSON||!n.has(`a`,1)||n.has(`a`,2)||!n.has(`a`,void 0)||n.has(`b`))||!t.size&&(a||!i)||!t.sort||e.href!==`https://a/c%20d?a=1&c=3`||t.get(`c`)!==`3`||String(new URLSearchParams(`?a=1`))!==`a=1`||!t[o]||new URL(`https://a@b`).username!==`a`||new URLSearchParams(new URLSearchParams(`a=b`)).get(`a`)!==`b`||new URL(`https://тест`).host!==`xn--e1aybc`||new URL(`https://a#б`).hash!==`#%D0%B1`||r!==`a1c3`||new URL(`https://x`,void 0).host!==`x`})})),kr=e(((e,t)=>{var n=ke(),r=xn();t.exports=function(e,t,i,a){try{return a?t(n(i)[0],i[1]):t(i)}catch(t){r(e,`throw`,t)}}})),Ar=e(((e,t)=>{var n=et(),r=R(),i=be(),a=kr(),o=vn(),s=it(),c=We(),l=Nt(),u=bn(),d=yn(),f=Array;t.exports=function(e){var t=i(e),p=s(this),m=arguments.length,h=m>1?arguments[1]:void 0,g=h!==void 0;g&&(h=n(h,m>2?arguments[2]:void 0));var _=d(t),v=0,y,b,x,S,C,w;if(_&&!(this===f&&o(_)))for(b=p?new this:[],S=u(t,_),C=S.next;!(x=r(C,S)).done;v++)w=g?a(S,h,[x.value,v],!0):x.value,l(b,v,w);else for(y=c(t),b=p?new this(y):f(y);y>v;v++)w=g?h(t[v],v):t[v],l(b,v,w);return b.length=v,b}})),jr=e(((e,t)=>{var n=z(),r=2147483647,i=36,a=1,o=26,s=38,c=700,l=72,u=128,d=`-`,f=/[^\0-\u007E]/,p=/[.\u3002\uFF0E\uFF61]/g,m=`Overflow: input needs wider integers to process`,h=i-a,g=RangeError,_=n(p.exec),v=Math.floor,y=String.fromCharCode,b=n(``.charCodeAt),x=n([].join),S=n([].push),C=n(``.replace),w=n(``.split),T=n(``.toLowerCase),E=function(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=v(e/t);e>h*o>>1;)e=v(e/h),r+=i;return v(r+(h+1)*e/(e+s))},k=function(e){var t=[];e=E(e);var n=e.length,s=u,c=0,f=l,p,h;for(p=0;p=s&&hv((r-c)/w))throw new g(m);for(c+=(C-s)*w,s=C,p=0;pr)throw new g(m);if(h===s){for(var T=c,k=i;;){var A=k<=f?a:k>=f+o?o:k-f;if(T{var e=K(),t=z(),n=He(),r=RangeError,i=String.fromCharCode,a=String.fromCodePoint,o=t([].join);e({target:`String`,stat:!0,arity:1,forced:!!a&&a.length!==1},{fromCodePoint:function(e){for(var t=[],a=arguments.length,s=0,c;a>s;){if(c=+arguments[s++],n(c,1114111)!==c)throw new r(c+` is not a valid code point`);t[s]=c<65536?i(c):i(((c-=65536)>>10)+55296,c%1024+56320)}return o(t,``)}})})),Nr=e(((e,t)=>{var n=Pt(),r=Math.floor,i=function(e,t){var a=e.length;if(a<8)for(var o=1,s,c;o0;)e[c]=e[--c];c!==o++&&(e[c]=s)}else for(var l=r(a/2),u=i(n(e,0,l),t),d=i(n(e,l),t),f=u.length,p=d.length,m=0,h=0;m{kt(),Mr();var n=K(),r=P(),i=sn(),a=W(),o=R(),s=z(),c=I(),l=Or(),u=ze(),d=It(),f=Gn(),p=xt(),m=St(),h=Le(),g=$t(),_=H(),v=xe(),y=et(),b=rt(),x=ke(),S=U(),C=Vt(),w=pt(),T=ne(),E=bn(),D=yn(),O=Ot(),k=rn(),A=G(),j=Nr(),M=A(`iterator`),ee=`URLSearchParams`,N=ee+`Iterator`,F=h.set,L=h.getterFor(ee),te=h.getterFor(N),re=i(`fetch`),B=i(`Request`),ie=i(`Headers`),V=B&&B.prototype,ae=ie&&ie.prototype,oe=r.TypeError,se=r.encodeURIComponent,ce=String.fromCharCode,le=a(`String`,`fromCodePoint`),ue=parseInt,de=s(``.charAt),fe=s([].join),pe=s([].push),me=s(``.replace),he=s([].shift),ge=s([].splice),_e=s(``.split),ve=s(``.slice),ye=s(/./.exec),be=/\+/g,Se=`�`,Ce=/^[0-9a-f]+$/i,we=function(e,t){var n=ve(e,t,t+2);return ye(Ce,n)?ue(n,16):NaN},Te=function(e){for(var t=0,n=128;n>0&&(e&n)!==0;n>>=1)t++;return t},Ee=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},De=function(e){e=me(e,be,` `);for(var t=e.length,n=``,r=0;rt){n+=`%`,r++;continue}var a=we(e,r+1);if(a!==a){n+=i,r++;continue}r+=2;var o=Te(a);if(o===0)i=ce(a);else{if(o===1||o>4){n+=Se,r++;continue}for(var s=[a],c=1;ct||de(e,r)!==`%`));){var l=we(e,r+1);if(l!==l){r+=3;break}if(l>191||l<128)break;pe(s,l),r+=2,c++}if(s.length!==o){n+=Se;continue}var u=Ee(s);u===null?n+=Se:i=le(u)}}n+=i,r++}return n},Oe=/[!'()~]|%20/g,Ae={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`},je=function(e){return Ae[e]},Me=function(e){return me(se(e),Oe,je)},Ne=m(function(e,t){F(this,{type:N,target:L(e).entries,index:0,kind:t})},ee,function(){var e=te(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,O(void 0,!0);var r=t[n];switch(e.kind){case`keys`:return O(r.key,!1);case`values`:return O(r.value,!1)}return O([r.key,r.value],!1)},!0),Pe=function(e){this.entries=[],this.url=null,e!==void 0&&(S(e)?this.parseObject(e):this.parseQuery(typeof e==`string`?de(e,0)===`?`?ve(e,1):e:C(e)))};Pe.prototype={type:ee,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,n=D(e),r,i,a,s,c,l,u;if(n)for(r=E(e,n),i=r.next;!(a=o(i,r)).done;){if(s=E(x(a.value)),c=s.next,(l=o(c,s)).done||(u=o(c,s)).done||!o(c,s).done)throw new oe(`Expected sequence with length 2`);pe(t,{key:C(l.value),value:C(u.value)})}else for(var d in e)v(e,d)&&pe(t,{key:d,value:C(e[d])})},parseQuery:function(e){if(e)for(var t=this.entries,n=_e(e,`&`),r=0,i,a;r0?arguments[0]:void 0,t=F(this,new Pe(e));c||(this.size=t.entries.length)},Ie=Fe.prototype;if(f(Ie,{append:function(e,t){var n=L(this);k(arguments.length,2),pe(n.entries,{key:C(e),value:C(t)}),c||this.size++,n.updateURL()},delete:function(e){for(var t=L(this),n=k(arguments.length,1),r=t.entries,i=C(e),a=n<2?void 0:arguments[1],o=a===void 0?a:C(a),s=0;st.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=L(this).entries,n=y(e,arguments.length>1?arguments[1]:void 0),r=0,i;r1?Ve(arguments[1]):{})}}),_(B)){var He=function(e){return g(this,V),new B(e,arguments.length>1?Ve(arguments[1]):{})};V.constructor=He,He.prototype=V,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:He})}}t.exports={URLSearchParams:Fe,getState:L}})),Fr=e((()=>{Xn();var e=K(),t=I(),n=Or(),r=P(),i=et(),a=z(),o=ze(),s=It(),c=$t(),l=xe(),u=Gt(),d=Ar(),f=Pt(),p=Yn().codeAt,m=jr(),h=Vt(),g=xt(),_=rn(),v=Pr(),y=Le(),b=y.set,x=y.getterFor(`URL`),S=v.URLSearchParams,C=v.getState,w=r.URL,T=r.TypeError,E=r.parseInt,D=Math.floor,O=Math.pow,k=a(``.charAt),A=a(/./.exec),j=a([].join),M=a(1.1.toString),ee=a([].pop),N=a([].push),F=a(``.replace),L=a([].shift),R=a(``.split),te=a(``.slice),ne=a(``.toLowerCase),re=a([].unshift),B=`Invalid authority`,ie=`Invalid scheme`,V=`Invalid host`,ae=`Invalid port`,H=/[a-z]/i,U=/[\d+-.a-z]/i,W=/\d/,oe=/^0x/i,se=/^[0-7]+$/,ce=/^\d+$/,le=/^[\da-f]+$/i,ue=/[\0\t\n\r #%/:<>?@[\\\]^|]/,de=/[\0\t\n\r #/:<>?@[\\\]^|]/,fe=/^[\u0000-\u0020]+/,pe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,me=/[\t\n\r]/g,he,ge=function(e){var t=R(e,`.`),n,r,i,a,o,s,c;if(t.length&&t[t.length-1]===``&&t.length--,n=t.length,n>4)return e;for(r=[],i=0;i1&&k(a,0)===`0`&&(o=A(oe,a)?16:8,a=te(a,o===8?1:2)),a===``)s=0;else{if(!A(o===10?ce:o===8?se:le,a))return e;s=E(a,o)}N(r,s)}for(i=0;i=O(256,5-n))return null}else if(s>255)return null;for(c=ee(r),i=0;i6))return;for(s=0;f();){if(c=null,s>0)if(f()===`.`&&s<4)i++;else return;if(!A(W,f()))return;for(;A(W,f());){if(l=E(f(),10),c===null)c=l;else if(c===0)return;else c=c*10+l;if(c>255)return;i++}t[n]=t[n]*256+c,s++,(s===2||s===4)&&n++}if(s!==4)return;break}else if(f()===`:`){if(i++,!f())return}else if(f())return;t[n++]=a}if(r!==null)for(u=n-r,n=7;n!==0&&u>0;)d=t[n],t[n--]=t[r+u-1],t[r+--u]=d;else if(n!==8)return;return t},ve=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)e[a]===0?(r===null&&(r=a),++i):(i>n&&(t=r,n=i),r=null,i=0);return i>n?r:t},ye=function(e){var t,n,r,i;if(typeof e==`number`){for(t=[],n=0;n<4;n++)re(t,e%256),e=D(e/256);return j(t,`.`)}if(typeof e==`object`){for(t=``,r=ve(e),n=0;n<8;n++)i&&e[n]===0||(i&&=!1,r===n?(t+=n?`:`:`::`,i=!0):(t+=M(e[n],16),n<7&&(t+=`:`)));return`[`+t+`]`}return e},be={},Se=u({},be,{" ":1,'"':1,"<":1,">":1,"`":1}),G=u({},Se,{"#":1,"?":1,"{":1,"}":1}),Ce=u({},G,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),we=function(e,t){var n=p(e,0);return n>32&&n<127&&!l(t,e)?e:encodeURIComponent(e)},Te={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ee=function(e,t){var n;return e.length===2&&A(H,k(e,0))&&((n=k(e,1))===`:`||!t&&n===`|`)},De=function(e){var t;return e.length>1&&Ee(te(e,0,2))&&(e.length===2||(t=k(e,2))===`/`||t===`\\`||t===`?`||t===`#`)},Oe=function(e){return e===`.`||ne(e)===`%2e`},ke=function(e){return e=ne(e),e===`..`||e===`%2e.`||e===`.%2e`||e===`%2e%2e`},Ae={},je={},Me={},Ne={},Pe={},Fe={},Ie={},Re={},Be={},Ve={},He={},Ue={},We={},Ge={},Ke={},qe={},Je={},Ye={},Xe={},Ze={},Qe={},$e=function(e,t,n){var r=h(e),i,a,o;if(t){if(a=this.parse(r),a)throw new T(a);this.searchParams=null}else{if(n!==void 0&&(i=new $e(n,!0)),a=this.parse(r,null,i),a)throw new T(a);o=C(new S),o.bindURL(this),this.searchParams=o}};$e.prototype={type:`URL`,parse:function(e,t,n){var r=this,i=t||Ae,a=0,o=``,s=!1,c=!1,u=!1,p,m,g,_;for(e=h(e),t||(r.scheme=``,r.username=``,r.password=``,r.host=null,r.port=null,r.path=[],r.query=null,r.fragment=null,r.cannotBeABaseURL=!1,e=F(e,fe,``),e=F(e,pe,`$1`)),e=F(e,me,``),p=d(e);a<=p.length;){switch(m=p[a],i){case Ae:if(m&&A(H,m))o+=ne(m),i=je;else if(t)return ie;else{i=Me;continue}break;case je:if(m&&(A(U,m)||m===`+`||m===`-`||m===`.`))o+=ne(m);else if(m===`:`){if(t&&(r.isSpecial()!==l(Te,o)||o===`file`&&(r.includesCredentials()||r.port!==null)||r.scheme===`file`&&!r.host))return;if(r.scheme=o,t){r.isSpecial()&&Te[r.scheme]===r.port&&(r.port=null);return}o=``,r.scheme===`file`?i=Ge:r.isSpecial()&&n&&n.scheme===r.scheme?i=Ne:r.isSpecial()?i=Re:p[a+1]===`/`?(i=Pe,a++):(r.cannotBeABaseURL=!0,N(r.path,``),i=Xe)}else if(t)return ie;else{o=``,i=Me,a=0;continue}break;case Me:if(!n||n.cannotBeABaseURL&&m!==`#`)return ie;if(n.cannotBeABaseURL&&m===`#`){r.scheme=n.scheme,r.path=f(n.path),r.query=n.query,r.fragment=``,r.cannotBeABaseURL=!0,i=Qe;break}i=n.scheme===`file`?Ge:Fe;continue;case Ne:if(m===`/`&&p[a+1]===`/`)i=Be,a++;else{i=Fe;continue}break;case Pe:if(m===`/`){i=Ve;break}else{i=Ye;continue}case Fe:if(r.scheme=n.scheme,m===he)r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.query=n.query;else if(m===`/`||m===`\\`&&r.isSpecial())i=Ie;else if(m===`?`)r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.query=``,i=Ze;else if(m===`#`)r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.query=n.query,r.fragment=``,i=Qe;else{r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,r.path=f(n.path),r.path.length--,i=Ye;continue}break;case Ie:if(r.isSpecial()&&(m===`/`||m===`\\`))i=Be;else if(m===`/`)i=Ve;else{r.username=n.username,r.password=n.password,r.host=n.host,r.port=n.port,i=Ye;continue}break;case Re:if(i=Be,m!==`/`||k(o,a+1)!==`/`)continue;a++;break;case Be:if(m!==`/`&&m!==`\\`){i=Ve;continue}break;case Ve:if(m===`@`){s&&(o=`%40`+o),s=!0,g=d(o);for(var v=0;v65535)return ae;r.port=r.isSpecial()&&x===Te[r.scheme]?null:x,o=``}if(t)return;i=Je;continue}else return ae;break;case Ge:if(r.scheme=`file`,m===`/`||m===`\\`)i=Ke;else if(n&&n.scheme===`file`)switch(m){case he:r.host=n.host,r.path=f(n.path),r.query=n.query;break;case`?`:r.host=n.host,r.path=f(n.path),r.query=``,i=Ze;break;case`#`:r.host=n.host,r.path=f(n.path),r.query=n.query,r.fragment=``,i=Qe;break;default:De(j(f(p,a),``))||(r.host=n.host,r.path=f(n.path),r.shortenPath()),i=Ye;continue}else{i=Ye;continue}break;case Ke:if(m===`/`||m===`\\`){i=qe;break}n&&n.scheme===`file`&&!De(j(f(p,a),``))&&(Ee(n.path[0],!0)?N(r.path,n.path[0]):r.host=n.host),i=Ye;continue;case qe:if(m===he||m===`/`||m===`\\`||m===`?`||m===`#`){if(!t&&Ee(o))i=Ye;else if(o===``){if(r.host=``,t)return;i=Je}else{if(_=r.parseHost(o),_)return _;if(r.host===`localhost`&&(r.host=``),t)return;o=``,i=Je}continue}else o+=m;break;case Je:if(r.isSpecial()){if(i=Ye,m!==`/`&&m!==`\\`)continue}else if(!t&&m===`?`)r.query=``,i=Ze;else if(!t&&m===`#`)r.fragment=``,i=Qe;else if(m!==he&&(i=Ye,m!==`/`))continue;break;case Ye:if(m===he||m===`/`||m===`\\`&&r.isSpecial()||!t&&(m===`?`||m===`#`)){if(ke(o)?(r.shortenPath(),m!==`/`&&!(m===`\\`&&r.isSpecial())&&N(r.path,``)):Oe(o)?m!==`/`&&!(m===`\\`&&r.isSpecial())&&N(r.path,``):(r.scheme===`file`&&!r.path.length&&Ee(o)&&(r.host&&=``,o=k(o,0)+`:`),N(r.path,o)),o=``,r.scheme===`file`&&(m===he||m===`?`||m===`#`))for(;r.path.length>1&&r.path[0]===``;)L(r.path);m===`?`?(r.query=``,i=Ze):m===`#`&&(r.fragment=``,i=Qe)}else o+=we(m,G);break;case Xe:m===`?`?(r.query=``,i=Ze):m===`#`?(r.fragment=``,i=Qe):m!==he&&(r.path[0]+=we(m,be));break;case Ze:!t&&m===`#`?(r.fragment=``,i=Qe):m!==he&&(m===`'`&&r.isSpecial()?r.query+=`%27`:m===`#`?r.query+=`%23`:r.query+=we(m,be));break;case Qe:m!==he&&(r.fragment+=we(m,Se));break}a++}},parseHost:function(e){var t,n,r;if(k(e,0)===`[`){if(k(e,e.length-1)!==`]`||(t=_e(te(e,1,-1)),!t))return V;this.host=t}else if(this.isSpecial()){if(e=m(e),A(ue,e)||(t=ge(e),t===null))return V;this.host=t}else{if(A(de,e))return V;for(t=``,n=d(e),r=0;r1?arguments[1]:void 0));t||(n.href=r.serialize(),n.origin=r.getOrigin(),n.protocol=r.getProtocol(),n.username=r.getUsername(),n.password=r.getPassword(),n.host=r.getHost(),n.hostname=r.getHostname(),n.port=r.getPort(),n.pathname=r.getPathname(),n.search=r.getSearch(),n.searchParams=r.getSearchParams(),n.hash=r.getHash())},nt=tt.prototype,rt=function(e,t){return{get:function(){return x(this)[e]()},set:t&&function(e){return x(this)[t](e)},configurable:!0,enumerable:!0}};if(t&&(s(nt,`href`,rt(`serialize`,`setHref`)),s(nt,`origin`,rt(`getOrigin`)),s(nt,`protocol`,rt(`getProtocol`,`setProtocol`)),s(nt,`username`,rt(`getUsername`,`setUsername`)),s(nt,`password`,rt(`getPassword`,`setPassword`)),s(nt,`host`,rt(`getHost`,`setHost`)),s(nt,`hostname`,rt(`getHostname`,`setHostname`)),s(nt,`port`,rt(`getPort`,`setPort`)),s(nt,`pathname`,rt(`getPathname`,`setPathname`)),s(nt,`search`,rt(`getSearch`,`setSearch`)),s(nt,`searchParams`,rt(`getSearchParams`)),s(nt,`hash`,rt(`getHash`,`setHash`))),o(nt,`toJSON`,function(){return x(this).serialize()},{enumerable:!0}),o(nt,`toString`,function(){return x(this).serialize()},{enumerable:!0}),w){var it=w.createObjectURL,at=w.revokeObjectURL;it&&o(tt,`createObjectURL`,i(it,w)),at&&o(tt,`revokeObjectURL`,i(at,w))}g(tt,`URL`),e({global:!0,constructor:!0,forced:!n,sham:!t},{URL:tt})})),Ir=e((()=>{Fr()})),Lr=e((()=>{var e=K(),t=R();e({target:`URL`,proto:!0,enumerable:!0},{toJSON:function(){return t(URL.prototype.toString,this)}})})),Rr=e((()=>{Pr()})),zr=e(((e,t)=>{var n=TypeError,r=9007199254740991;t.exports=function(e){if(e>r)throw n(`Maximum allowed index exceeded`);return e}})),Br=e((()=>{var e=K(),t=F(),n=tt(),r=U(),i=be(),a=We(),o=zr(),s=Nt(),c=ot(),l=ct(),u=G(),d=ce(),f=u(`isConcatSpreadable`),p=d>=51||!t(function(){var e=[];return e[f]=!1,e.concat()[0]!==e}),m=function(e){if(!r(e))return!1;var t=e[f];return t===void 0?n(e):!!t};e({target:`Array`,proto:!0,arity:1,forced:!p||!l(`concat`)},{concat:function(e){var t=i(this),n=c(t,0),r=0,l,u,d,f,p;for(l=-1,d=arguments.length;l{var n=U(),r=re(),i=G()(`match`);t.exports=function(e){var t;return n(e)&&((t=e[i])===void 0?r(e)===`RegExp`:!!t)}})),Hr=e(((e,t)=>{var n=Vr(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`The method doesn't accept regular expressions`);return e}})),Ur=e(((e,t)=>{var n=G()(`match`);t.exports=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[n]=!1,`/./`[e](t)}catch{}}return!1}})),Wr=e((()=>{var e=K(),t=z(),n=Hr(),r=V(),i=Vt(),a=Ur(),o=t(``.indexOf);e({target:`String`,proto:!0,forced:!a(`includes`)},{includes:function(e){return!!~o(i(r(this)),i(n(e)),arguments.length>1?arguments[1]:void 0)}})})),Gr=e(((e,t)=>{var n=z(),r=Gn(),i=Un().getWeakData,a=$t(),o=ke(),s=ie(),c=U(),l=Sn(),u=st(),d=xe(),f=Le(),p=f.set,m=f.getterFor,h=u.find,g=u.findIndex,_=n([].splice),v=0,y=function(e){return e.frozen||=new b},b=function(){this.entries=[]},x=function(e,t){return h(e.entries,function(e){return e[0]===t})};b.prototype={get:function(e){var t=x(this,e);if(t)return t[1]},has:function(e){return!!x(this,e)},set:function(e,t){var n=x(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,function(t){return t[0]===e});return~t&&_(this.entries,t,1),!!~t}},t.exports={getConstructor:function(e,t,n,u){var f=e(function(e,r){a(e,h),p(e,{type:t,id:v++,frozen:null}),s(r)||l(r,e[u],{that:e,AS_ENTRIES:n})}),h=f.prototype,g=m(t),_=function(e,t,n){var r=g(e),a=i(o(t),!0);return a===!0?y(r).set(t,n):a[r.id]=n,e};return r(h,{delete:function(e){var t=g(this);if(!c(e))return!1;var n=i(e);return n===!0?y(t).delete(e):n&&d(n,t.id)&&delete n[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var n=i(e);return n===!0?y(t).has(e):n&&d(n,t.id)}}),r(h,n?{get:function(e){var t=g(this);if(c(e)){var n=i(e);if(n===!0)return y(t).get(e);if(n)return n[t.id]}},set:function(e,t){return _(this,e,t)}}:{add:function(e){return _(this,e,!0)}}),f}}})),Kr=e((()=>{var e=Hn(),t=P(),n=z(),r=Gn(),i=Un(),a=Wn(),o=Gr(),s=U(),c=Le().enforce,l=F(),u=Pe(),d=Object,f=Array.isArray,p=d.isExtensible,m=d.isFrozen,h=d.isSealed,g=d.freeze,_=d.seal,v=!t.ActiveXObject&&`ActiveXObject`in t,y,b=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},x=a(`WeakMap`,b,o),S=x.prototype,C=n(S.set),w=function(){return e&&l(function(){var e=g([]);return C(new x,e,1),!m(e)})};if(u)if(v){y=o.getConstructor(b,`WeakMap`,!0),i.enable();var T=n(S.delete),E=n(S.has),D=n(S.get);r(S,{delete:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,T(this,e)||t.frozen.delete(e)}return T(this,e)},has:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)||t.frozen.has(e)}return E(this,e)},get:function(e){if(s(e)&&!p(e)){var t=c(this);return t.frozen||=new y,E(this,e)?D(this,e):t.frozen.get(e)}return D(this,e)},set:function(e,t){if(s(e)&&!p(e)){var n=c(this);n.frozen||=new y,E(this,e)?C(this,e,t):n.frozen.set(e,t)}else C(this,e,t);return this}})}else w()&&r(S,{set:function(e,t){var n;return f(e)&&(m(e)?n=g:h(e)&&(n=_)),C(this,e,t),n&&n(e),this}})})),qr=e((()=>{Kr()})),Jr=e((()=>{Wn()(`WeakSet`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Gr())})),Yr=e((()=>{Jr()}));Ir(),Lr(),Rr(),Br(),Wr(),qr(),Yr();var Xr=new WeakMap,Zr=new WeakMap,Qr=new WeakMap,$r=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ri=new WeakMap,ii=new WeakMap,ai=new WeakMap,oi=new WeakSet,si=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};l(this,e),p(this,oi),d(this,Xr,void 0),d(this,Zr,void 0),d(this,Qr,void 0),d(this,$r,void 0),d(this,ei,void 0),d(this,ti,void 0),d(this,ni,void 0),d(this,ri,void 0),d(this,ii,void 0),d(this,ai,void 0),f(Xr,this,t.maxRetries||5),f(Zr,this,t.initialDelay||1e3),f(Qr,this,t.maxDelay||5e3),f($r,this,t.backoffFactor||2),f(ei,this,t.retryOn||[429,502,503,504]),f(ti,this,10),f(ni,this,5e3),f(ri,this,[]),f(ii,this,0),f(ai,this,0)}return h(e,[{key:`fetchWithRetry`,value:function(){var e=s(E().m(function e(t,n,r){var i,o,s,c,l;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a(oi,this,li).call(this);case 1:return e.n=2,fetch(t,{headers:n});case 2:if(i=e.v,!i.ok){e.n=3;break}return e.a(2,i);case 3:if(!(u(ei,this).includes(i.status)&&r=u(Xr,this))){e.n=7;break}throw s=``,l instanceof Error&&(s=l.message),Error(`Request failed after ${u(Xr,this)} attempts: ${s}`);case 7:if(!(r=u(ti,this))){e.n=2;break}if(n=u(ri,this)[0],r=Date.now()-n,!(r0)){e.n=3;break}return e.n=3,a(oi,this,fi).call(this,c-s);case 3:f(ai,this,Date.now());case 4:return e.a(2)}},e,this)})),ui.apply(this,arguments)}function di(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)?.headers.get(`Retry-After`);if(t){var n=parseInt(t);if(n>86400){var r=parseInt(t)*1e3;return Math.max(0,r-Date.now())}return n*1e3}var i=u(Zr,this)*u($r,this)**+e,a=Math.random()*1e3;return Math.min(i+a,u(Qr,this))}function fi(e){return new Promise(function(t){return setTimeout(t,e)})}var pi=`https://api.zotero.org/`,mi=function(){this._apiKey=null,this._userId=0,this._userGroups=[],this._userGroupsLoaded=!1,this._isOnlineAvailable=!0,this._fetcher=new si({maxRetries:5,initialDelay:5e3})};mi.prototype.ZOTERO_API_VERSION=`3`,mi.prototype.USER_AGENT=`AscDesktopEditor`,mi.prototype.DEFAULT_FORMAT=`csljson`,mi.prototype.SEARCH_RESULT_LIMIT=50,mi.prototype.STORAGE_KEYS={USER_ID:`zoteroUserId`,API_KEY:`zoteroApiKey`},mi.prototype.API_PATHS={USERS:`users`,GROUPS:`groups`,ITEMS:`items`,KEYS:`keys`},mi.prototype._getBaseUrl=function(){return this._isOnlineAvailable?pi:Tr.desktopApiUrl},mi.prototype._getDesktopRequest=function(e){var t=this;return new Promise(function(n,r){window.AscSimpleRequest.createRequest({url:e,method:`GET`,headers:{"Zotero-API-Version":t.ZOTERO_API_VERSION,"User-Agent":t.USER_AGENT,"Cache-Control":`no-cache`},complete:n,error:function(e){e.statusCode===-102&&(e.statusCode=404,e.message=`Connection to Zotero failed. Make sure Zotero is running`),r(e)}})})},mi.prototype._getOnlineRequest=function(e){var t={"Zotero-API-Version":this.ZOTERO_API_VERSION,"Zotero-API-Key":this._apiKey||``};return fetch(e,{headers:t,cache:`no-store`}).then(function(e){if(!e.ok){var t=e.status+` `+e.statusText;throw console.error(t),Error(t)}return e}).catch(function(e){throw M(e)===`object`&&(e.message=`Connection to Zotero failed`),e})},mi.prototype._getRequestWithOfflineSupport=function(e){return this._isOnlineAvailable?this._getOnlineRequest(e):this._getDesktopRequest(e.href)},mi.prototype._buildGetRequest=function(e,t){t||={};var n=new URL(e,this._getBaseUrl());return Object.keys(t).forEach(function(e){t[e]!==void 0&&t[e]!==null&&n.searchParams.append(e,t[e])}),this._getRequestWithOfflineSupport(n)},mi.prototype._parseLinkHeader=function(e){var t={},n=/<(.*?)>; rel="(.*?)"/g;if(!e)return t;for(var r;(r=n.exec(e.trim()))!==null;)t[r[2]]=r[1];return t},mi.prototype._parseDesktopItemsResponse=function(e,t){return e.then(function(e){return{items:JSON.parse(e.responseText),id:t}})},mi.prototype._parseItemsResponse=function(e,t){var n=this;return e.then(function(e){return Promise.all([e.json(),e])}).then(function(e){var r=e[0],i=e[1],a=n._parseLinkHeader(i.headers.get(`Link`)||``),o={items:r,id:t};return M(r)===`object`&&r.items&&(o.items=r.items),a.next&&(o.next=function(){return n._parseItemsResponse(n._getOnlineRequest(new URL(a.next)),t)}),o})},mi.prototype._parseResponse=function(e,t){if(this._isOnlineAvailable){var n=e;return this._parseItemsResponse(n,t)}else{var r=e;return this._parseDesktopItemsResponse(r,t)}},mi.prototype.getItems=function(e,t,n){var r=this;n||=r.DEFAULT_FORMAT;var i={format:n};e?(i.q=e,i.limit=r.SEARCH_RESULT_LIMIT,i.itemType=`-attachment`,this._isOnlineAvailable||(i.format=`json`)):t?i.itemKey=t.join(`,`):(i.limit=20,i.itemType=`-attachment`,this._isOnlineAvailable||(i.format=`json`));var a=r.API_PATHS.USERS+`/`+r._userId+`/`+r.API_PATHS.ITEMS,o=r._buildGetRequest(a,i);return r._parseResponse(o,r._userId)},mi.prototype.getGroupItems=function(e,t,n,r){var i=this;r||=i.DEFAULT_FORMAT;var a={format:r};e?(a.q=e,a.limit=i.SEARCH_RESULT_LIMIT,this._isOnlineAvailable||(a.format=`json`)):n&&(a.itemKey=n.join(`,`));var o=i.API_PATHS.GROUPS+`/`+t+`/`+i.API_PATHS.ITEMS,s=i._buildGetRequest(o,a);return i._parseResponse(s,t)},mi.prototype.searchUserItemsEverything=function(e){var t=this.API_PATHS.USERS+`/`+this._userId+`/`+this.API_PATHS.ITEMS,n=this._buildGetRequest(t,{format:`json`,q:e,qmode:`everything`,itemType:`-attachment`,limit:10});return this._parseResponse(n,this._userId)},mi.prototype.getItemByKey=function(e,t){var n=this.API_PATHS.USERS+`/`+this._userId+`/`+this.API_PATHS.ITEMS+`/`+e,r=this._buildGetRequest(n,{format:t||this.DEFAULT_FORMAT});return this._parseResponse(r,this._userId)},mi.prototype.getGroupItemByKey=function(e,t,n){var r=this.API_PATHS.GROUPS+`/`+e+`/`+this.API_PATHS.ITEMS+`/`+t,i=this._buildGetRequest(r,{format:n||this.DEFAULT_FORMAT});return this._parseResponse(i,e)},mi.prototype.getUserGroups=function(){var e=this;return new Promise(function(t,n){if(e._userGroupsLoaded){t(e._userGroups);return}var r=e.API_PATHS.USERS+`/`+e._userId+`/groups`;e._buildGetRequest(r).then(function(t){if(e._isOnlineAvailable){var n=t;if(!n.ok)throw Error(n.status+` `+n.statusText);return n.json()}return JSON.parse(t.responseText)}).then(function(n){e._userGroups=n.map(function(e){return{id:e.id,name:e.data.name}}),e._userGroupsLoaded=!0,t(e._userGroups)}).catch(n)})},mi.prototype.setApiKey=function(e){var t=this,n=this.API_PATHS.KEYS+`/`+e;return this._buildGetRequest(n).then(function(e){var t=e;if(!t.ok)throw Error(t.status+` `+t.statusText);return t.json()}).then(function(n){return t._saveSettings(n.userID,e),!0})},mi.prototype._applySettings=function(e,t){this._userId=e,this._apiKey=t},mi.prototype._saveSettings=function(e,t){this._applySettings(e,t),localStorage.setItem(this.STORAGE_KEYS.USER_ID,String(e)),localStorage.setItem(this.STORAGE_KEYS.API_KEY,t)},mi.prototype.hasSettings=function(){var e=localStorage.getItem(this.STORAGE_KEYS.USER_ID),t=localStorage.getItem(this.STORAGE_KEYS.API_KEY);return e&&t?(this._applySettings(Number(e),t),!0):!1},mi.prototype.clearSettings=function(){localStorage.removeItem(this.STORAGE_KEYS.USER_ID),localStorage.removeItem(this.STORAGE_KEYS.API_KEY),this._userGroups=[],this._userGroupsLoaded=!1,this._userId=0,this._apiKey=null},mi.prototype.getUserId=function(){return this._userId},mi.prototype.setIsOnlineAvailable=function(e){this._isOnlineAvailable=e},mi.prototype.getIsOnlineAvailable=function(){return this._isOnlineAvailable};var hi=e((()=>{var e=Me().PROPER,t=ze(),n=ke(),r=Vt(),i=F(),a=tr(),o=`toString`,s=RegExp.prototype,c=s[o],l=i(function(){return c.call({source:`a`,flags:`b`})!==`/a/b`}),u=e&&c.name!==o;(l||u)&&t(s,o,function(){var e=n(this),t=r(e.source),i=r(a(e));return`/`+t+`/`+i},{unsafe:!0})})),gi=e(((e,t)=>{var n=Ae().f;t.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}})),_i=e((()=>{var e=I(),t=P(),n=z(),r=Qe(),i=zt(),a=je(),o=pt(),s=Je().f,c=oe(),l=Vr(),u=Vt(),d=tr(),f=Pn(),p=gi(),m=ze(),h=F(),g=xe(),_=Le().enforce,v=Qt(),y=G(),b=Fn(),x=In(),S=y(`match`),C=t.RegExp,w=C.prototype,T=t.SyntaxError,E=n(w.exec),D=n(``.charAt),O=n(``.replace),k=n(``.indexOf),A=n(``.slice),j=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,ee=/a/g,N=new C(M)!==M,L=f.MISSED_STICKY,R=f.UNSUPPORTED_Y,te=e&&(!N||L||b||x||h(function(){return ee[S]=!1,C(M)!==M||C(ee)===ee||String(C(M,`i`))!==`/a/i`})),ne=function(e){for(var t=e.length,n=0,r=``,i=!1,a;n<=t;n++){if(a=D(e,n),a===`\\`){r+=a+D(e,++n);continue}!i&&a===`.`?r+=`[\\s\\S]`:(a===`[`?i=!0:a===`]`&&(i=!1),r+=a)}return r},re=function(e){for(var t=e.length,n=0,r=``,i=[],a=o(null),s=!1,c=!1,l=0,u=``,d;n<=t;n++){if(d=D(e,n),d===`\\`)d+=D(e,++n);else if(d===`]`)s=!1;else if(!s)switch(!0){case d===`[`:s=!0;break;case d===`(`:if(r+=d,A(e,n+1,n+3)===`?:`)continue;E(j,A(e,n+1))&&(n+=2,c=!0),l++;continue;case d===`>`&&c:if(u===``||g(a,u))throw new T(`Invalid capture group name`);a[u]=!0,i[i.length]=[u,l],c=!1,u=``;continue}c?u+=d:r+=d}return[r,i]};if(r(`RegExp`,te)){for(var B=function(e,t){var n=c(w,this),r=l(e),o=t===void 0,s=[],f=e,p,m,h,g,v,y;if(!n&&r&&o&&e.constructor===B)return e;if((r||c(w,e))&&(e=e.source,o&&(t=d(f))),e=e===void 0?``:u(e),t=t===void 0?``:u(t),f=e,b&&`dotAll`in M&&(m=!!t&&k(t,`s`)>-1,m&&(t=O(t,/s/g,``))),p=t,L&&`sticky`in M&&(h=!!t&&k(t,`y`)>-1,h&&R&&(t=O(t,/y/g,``))),x&&(g=re(e),e=g[0],s=g[1]),v=i(C(e,t),n?this:w,B),(m||h||s.length)&&(y=_(v),m&&(y.dotAll=!0,y.raw=B(ne(e),p)),h&&(y.sticky=!0),s.length&&(y.groups=s)),e!==f)try{a(v,`source`,f===``?`(?:)`:f)}catch{}return v},ie=s(C),V=0;ie.length>V;)p(B,C,ie[V++]);w.constructor=B,B.prototype=w,m(t,`RegExp`,B,{constructor:!0})}v(`RegExp`)})),vi=e(((e,t)=>{t.exports=Object.is||function(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}})),yi=e((()=>{var e=R(),t=Zn(),n=ke(),r=U(),i=V(),a=vi(),o=Vt(),s=me(),c=nr();t(`search`,function(t,l,u){return[function(n){var a=i(this),c=r(n)?s(n,t):void 0;return c?e(c,n,a):new RegExp(n)[t](o(a))},function(e){var t=n(this),r=o(e),i=u(l,t,r);if(i.done)return i.value;var s=t.lastIndex;a(s,0)||(t.lastIndex=0);var d=c(t,r);return a(t.lastIndex,s)||(t.lastIndex=s),d===null?-1:d.index}]})}));_i(),hi(),yi();function bi(e,t){var n=this;if(t||={},typeof e==`string`){var r=document.getElementById(e);r instanceof HTMLInputElement&&(e=r)}if(e instanceof HTMLInputElement)this.input=e;else throw Error(`Invalid input element`);for(var i in this._container=document.createElement(`div`),this._options={type:t.type||e.type||`text`,placeholder:t.placeholder||e.placeholder||``,value:t.value||e.value||``,autofocus:t.autofocus||!1,disabled:t.disabled||!1,readonly:t.readonly||!1,required:t.required||!1,showCounter:t.showCounter||!1,showClear:t.showClear===void 0?!0:t.showClear,autocomplete:t.autocomplete||`off`},t)this._options.hasOwnProperty(i)||(this._options[i]=t[i]);this._id=e.id||`input_`+Math.random().toString(36).slice(2,9),this.isFocused=!1,this.isValid=!0,this._validationMessage=``,this._subscribers=[],this._boundHandles={focus:function(e){n._handleFocus(e)},blur:function(e){n._handleBlur(e)},input:function(e){n._handleInput(e)},keydown:function(e){n._handleKeydown(e)},clear:function(){n.clear()},validate:function(){n.validate()}},this._clearButton=null,this._counter=null,this._counterCurrent=null,this._counterMax=null,this._validationElement=document.createElement(`div`),this._options.type===`search`&&(this._searchIcon=document.createElement(`span`),this._boundHandles.search=this._triggerSubmit.bind(this),this._container.classList.add(`input-field-search`)),this._createDOM(),this._bindEvents(),this._updateState(),this._options.autofocus&&setTimeout(function(e){return function(){e.focus()}}(this),100)}bi.prototype={constructor:bi,input:null,_container:null,_options:{},_id:``,isFocused:!1,isValid:!0,_validationMessage:``,_subscribers:[],_boundHandles:null,_clearButton:null,_counter:null,_counterCurrent:null,_counterMax:null,_validationElement:null,_createDOM:function(){var e=this.input.parentNode,t=document.createDocumentFragment();t.appendChild(this._container),this._container.className+=` input-field-container input-field-container-`+this._id;var n=document.createElement(`div`);this._container.appendChild(n),n.className+=` input-field`,this._options.disabled&&(n.className+=` input-field-disabled`);var r=document.createElement(`div`);if(n.appendChild(r),r.className+=` input-field-main`,this.input.className+=` input-field-element i18n`,this.input.type=this._options.type||`text`,this.input.placeholder=this._options.placeholder||``,this.input.value=String(this._options.value)||``,this._options.disabled&&(this.input.disabled=!0),this._options.readonly&&(this.input.readOnly=!0),this._options.required&&(this.input.required=!0),this._options.maxLength&&(this.input.maxLength=this._options.maxLength),this._options.pattern&&(this.input.pattern=this._options.pattern),this._options.autocomplete&&(this.input.autocomplete=this._options.autocomplete),this._options.showCounter){this._counter=document.createElement(`div`),n.appendChild(this._counter),this._counter.className+=` input-field-counter`,this._counterCurrent=document.createElement(`span`),this._counterCurrent.className+=` input-field-counter-current`,this._counterCurrent.textContent=`0`,this._counter.appendChild(this._counterCurrent);var i=document.createElement(`span`);i.textContent=`/`,this._counter.appendChild(i),this._counterMax=document.createElement(`span`),this._counterMax.className+=` input-field-counter-max`,this._counterMax.textContent=String(this._options.maxLength)||`∞`,this._counter.appendChild(this._counterMax)}n.appendChild(this._validationElement),this._validationElement.className+=` input-field-validation`,this._validationElement.style.display=`none`,this._options.showClear&&(this.input.className+=` input-field-clearable`,this._clearButton=document.createElement(`button`),n.appendChild(this._clearButton),this._clearButton.className+=` input-field-clear`,this._clearButton.style.display=`none`,this._clearButton.textContent=`×`),this._options.showSearchIcon&&(this._searchIcon.classList.add(`input-field-search-icon`),this._searchIcon.innerHTML=``,r.appendChild(this._searchIcon)),e&&e.insertBefore(t,this.input),r.appendChild(this.input)},_bindEvents:function(){this.input.addEventListener(`focus`,this._boundHandles.focus),this.input.addEventListener(`blur`,this._boundHandles.blur),this.input.addEventListener(`input`,this._boundHandles.input),this.input.addEventListener(`keydown`,this._boundHandles.keydown),this._clearButton&&this._clearButton.addEventListener(`click`,this._boundHandles.clear),this._options.showSearchIcon&&this._boundHandles.search&&this._searchIcon.addEventListener(`click`,this._boundHandles.search),this.input.addEventListener(`change`,this._boundHandles.validate)},_handleFocus:function(e){this.isFocused=!0,this._container.className+=` input-field-focused`,this._updateClearButton(),this._triggerFocusEvent(e)},_handleBlur:function(e){this.isFocused=!1;for(var t=this._container.className.split(` `),n=[],r=0;r0;this._clearButton.style.display=e?`block`:`none`}},_updateCounter:function(){if(this._counter&&this._options.maxLength){var e=this.input.value.length,t=this._options.maxLength;if(this._counterCurrent&&(this._counterCurrent.textContent=String(e)),this._counterMax&&(this._counterMax.textContent=String(t)),e>t*.9){var n=this._counter.className.split(` `);n.indexOf(`input-field-counter-warning`)===-1&&(this._counter.className+=` input-field-counter-warning`)}else this._counter.className=this._counter.className.split(` `).filter(function(e){return e!==`input-field-counter-warning`}).join(` `);if(e>t){var n=this._counter.className.split(` `);n.indexOf(`input-field-counter-error`)===-1&&(this._counter.className+=` input-field-counter-error`)}else this._counter.className=this._counter.className.split(` `).filter(function(e){return e!==`input-field-counter-error`}).join(` `)}},validate:function(){if(!this._options.validation)return this.isValid=!0,!0;var e=this.input.value,t=!0,n=``;if(this._options.required&&!e.trim()?(t=!1,n=`This field is required`):this._options.minLength&&e.lengththis._options.maxLength?(t=!1,n=`Maximum length is `+this._options.maxLength+` characters`):this._options.pattern&&!new RegExp(this._options.pattern).test(e)&&(t=!1,n=`Invalid format`),t&&typeof this._options.validation==`function`){var r=this._options.validation(e);r&&!r.isValid&&(t=!1,n=r.message||`Invalid value`)}return this.isValid=t,this._validationMessage=n,this.updateValidationState(),t},updateValidationState:function(){if(!this.isValid){this._validationElement.textContent=this._validationMessage,this._validationElement.style.display=`block`;var e=this._container.className.split(` `);e.indexOf(`input-field-invalid`)===-1&&(this._container.className+=` input-field-invalid`),this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-valid`}).join(` `)}else if(this.input.value.length>0){this._validationElement.style.display=`none`;var e=this._container.className.split(` `);e.indexOf(`input-field-valid`)===-1&&(this._container.className+=` input-field-valid`),this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-invalid`}).join(` `)}else this._validationElement.style.display=`none`,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-valid`&&e!==`input-field-invalid`}).join(` `)},_updateState:function(){this._updateClearButton(),this._updateCounter(),this.validate()},getValue:function(){return this.input.value.trim()},setValue:function(e){this.input.value=e,this._updateState(),this._triggerChange()},setPlaceholder:function(e){this.input.placeholder=e,this._options.placeholder=e},clear:function(e){e=e===void 0?!0:e,this.setValue(``),e&&this.input.focus()},focus:function(){this.input.focus()},blur:function(){this.input.blur()},enable:function(){this.input.disabled=!1,this._options.disabled=!1,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-disabled`}).join(` `)},disable:function(){this.input.disabled=!0,this._options.disabled=!0,this._container.className.split(` `).indexOf(`input-field-disabled`)===-1&&(this._container.className+=` input-field-disabled`)},subscribe:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},_triggerInputEvent:function(e){var t={value:this.input.value,originalEvent:e};this._subscribers.forEach(function(e){e({type:`inputfield:input`,detail:t})})},_triggerFocusEvent:function(e){var t={value:this.input.value,originalEvent:e};this._subscribers.forEach(function(e){e({type:`inputfield:focus`,detail:t})})},_triggerBlurEvent:function(e){var t={value:this.input.value,originalEvent:e};this._subscribers.forEach(function(e){e({type:`inputfield:blur`,detail:t})})},_triggerChange:function(){var e={value:this.input.value,isValid:this.isValid};this._subscribers.forEach(function(t){t({type:`inputfield:change`,detail:e})})},_triggerSubmit:function(){var e={value:this.input.value,isValid:this.isValid};this._subscribers.forEach(function(t){t({type:`inputfield:submit`,detail:e})})},destroy:function(){if(this._subscribers=[],this._boundHandles)try{this.input.removeEventListener(`focus`,this._boundHandles.focus),this.input.removeEventListener(`blur`,this._boundHandles.blur),this.input.removeEventListener(`input`,this._boundHandles.input),this.input.removeEventListener(`keydown`,this._boundHandles.keydown),this._clearButton&&this._clearButton.removeEventListener(`click`,this._boundHandles.clear),this._options.showSearchIcon&&this._boundHandles.search&&this._searchIcon.removeEventListener(`click`,this._boundHandles.search),this.input.removeEventListener(`change`,this._boundHandles.validate)}catch(e){console.error(e)}this._container.innerHTML=``,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`input-field-container`}).join(` `)}};function xi(e,t){if(typeof e==`string`){var n=document.getElementById(e);n instanceof HTMLElement&&(e=n)}if(e instanceof HTMLElement)this.container=e;else throw Error(`Invalid container element`);this._options=Object.assign(this._options,t),this._isShow=!1}xi.prototype={constructor:xi,_options:{type:`info`,text:``,title:``,duration:0,closeButton:!0,autoClose:!1,closeOnClickOutside:!0},_outsideClickListener:null,_element:null,_timeoutId:null,_create:function(){var e=document.createElement(`div`);e.className=`message message-`+this._options.type,e.setAttribute(`role`,`alert`);var t=this._options.title;if(!t)switch(t=`Error`,this._options.type){case`success`:t=`Success`;break;case`warning`:t=`Warning`;break;case`info`:t=`Information`;break}var n=this._options.text;if(!n)switch(n=``,this._options.type){case`success`:n=`Operation completed successfully.`;break;case`warning`:n=`Please be cautious.`;break;case`error`:n=`Something went wrong.`;break}if(e.innerHTML=`
`+t+``+n+`
`,this._options.closeButton){var r=document.createElement(`button`);r.className=`message-close`,r.textContent=`×`,r.setAttribute(`aria-label`,`Close`),r.onclick=this.close.bind(this),e.appendChild(r)}return e},addOutsideClickListener:function(){this._outsideClickListener&&document.removeEventListener(`click`,this._outsideClickListener);var e=this;this._outsideClickListener=function(t){t.target instanceof HTMLElement&&e._element&&!e._element.contains(t.target)&&e.close()},setTimeout(function(){e._outsideClickListener&&document.addEventListener(`click`,e._outsideClickListener)},10)},removeOutsideClickListener:function(){this._outsideClickListener&&=(document.removeEventListener(`click`,this._outsideClickListener),null)},show:function(e,t){if(this._isShow)return this;this._isShow=!0,this.container.classList.contains(`message-container`)||this.container.classList.add(`message-container`),t&&(this._options.title=t),e&&(this._options.text=e);var n=this._create();return this._element=n,this.container.appendChild(n),setTimeout(function(){n.style.opacity=`1`,n.style.transform=`translateY(0)`},10),this._options.autoClose&&Number(this._options.duration)>0&&(this._timeoutId=setTimeout(this.close.bind(this),this._options.duration)),this._options.closeOnClickOutside&&this.addOutsideClickListener(),this},close:function(){if(this._isShow=!1,!(!this._element||!this._element.parentNode)){this._timeoutId&&=(clearTimeout(this._timeoutId),null),this.removeOutsideClickListener();var e=this._element;e.style.opacity=`0`,e.style.transform=`translateY(-20px)`,setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},300)}}};function Si(e,t){var n=this;if(typeof e==`string`){var r=document.getElementById(e);r instanceof HTMLButtonElement&&(e=r)}if(e instanceof HTMLButtonElement)this._button=e;else throw Error(`Invalid button`);this._container=document.createElement(`div`),this._options=t||{},this._options.text=this._options.text||e.textContent.trim(),this._options.type=this._options.type||`button`,this._options.variant=this._options.variant||`primary`,this._options.size=this._options.size||`medium`,this._options.iconPosition=this._options.iconPosition||`left`,this.isLoading=!1,this._originalText=this._options.text,this._subscribers=[],this._boundHandles={click:function(e){n._handleClick(e)},mouseenter:function(){n._handleMouseEnter()},mouseleave:function(){n._handleMouseLeave()},focus:function(){n._handleFocus()},blur:function(){n._handleBlur()},keydown:function(e){n._handleKeydown(e)}},this._createDOM(),this._bindEvents(),this.updateState()}Si.prototype={constructor:Si,_button:null,_buttonText:null,_spinner:null,_badgeElement:null,_createDOM:function(){var e=this._button.parentNode,t=document.createDocumentFragment();if(t.appendChild(this._container),this._container.className+=` custom-button-container`,this._button.className+=` custom-button`,this._button.className+=` custom-button-`+this._options.variant,this._button.className+=` custom-button-`+this._options.size,this._options.disabled&&(this._button.className+=` custom-button-disabled`),this._options.loading&&(this._container.className+=` custom-button-loading`),this._options.type&&(this._button.type=this._options.type),this._options.tooltip&&(this._button.title=this._options.tooltip),this._options.disabled&&(this._button.disabled=!0),this._options.text)if(this._button.textContent=``,this._buttonText=document.createElement(`span`),this._buttonText.className=`custom-button-text`,this._buttonText.textContent=this._options.text||``,this._options.icon){var n=document.createElement(`span`);n.className=`custom-button-icon`,this._options.iconPosition===`left`?(n.className+=` custom-button-icon-left`,this._button.appendChild(n),this._button.appendChild(this._buttonText)):(n.className+=` custom-button-icon-right`,this._button.appendChild(this._buttonText),this._button.appendChild(n)),n.innerHTML=this._options.icon}else this._button.appendChild(this._buttonText);this._options.loading&&(this._spinner=document.createElement(`span`),this._spinner.className=`custom-button-spinner`,this._button.appendChild(this._spinner)),this._options.badge&&(this._badgeElement=document.createElement(`span`),this._badgeElement.className=`custom-button-badge`,this._badgeElement.textContent=this._options.badge,this._button.appendChild(this._badgeElement)),e&&e.insertBefore(t,this._button),this._container.appendChild(this._button)},_bindEvents:function(){this._button.addEventListener(`click`,this._boundHandles.click),this._button.addEventListener(`mouseenter`,this._boundHandles.mouseenter),this._button.addEventListener(`mouseleave`,this._boundHandles.mouseleave),this._button.addEventListener(`focus`,this._boundHandles.focus),this._button.addEventListener(`blur`,this._boundHandles.blur),this._button.addEventListener(`keydown`,this._boundHandles.keydown)},_handleClick:function(e){if(this._options.disabled||this.isLoading){e.preventDefault(),e.stopPropagation();return}this.triggerClickEvent(e)},_handleMouseEnter:function(){this._button.className.split(` `).indexOf(`custom-button-hover`)===-1&&(this._button.className+=` custom-button-hover`),this.triggerEvent(`mouseenter`)},_handleMouseLeave:function(){this._button.className=this._button.className.split(` `).filter(function(e){return e!==`custom-button-hover`}).join(` `),this.triggerEvent(`mouseleave`)},_handleFocus:function(){this._button.className.split(` `).indexOf(`custom-button-focused`)===-1&&(this._button.className+=` custom-button-focused`),this.triggerEvent(`focus`)},_handleBlur:function(){this._button.className=this._button.className.split(` `).filter(function(e){return e!==`custom-button-focused`}).join(` `),this.triggerEvent(`blur`)},_handleKeydown:function(e){var t=e.key||e.keyCode;t===` `||t===`Enter`||t===32||t===13?this._button.tagName===`BUTTON`||(e.preventDefault(),this._button.click()):(t===`Escape`||t===27)&&this._button.blur(),this.triggerEvent(`keydown`,{key:t})},subscribe:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},setText:function(e){e!==void 0&&(this._options.text=e,this._buttonText||(this._buttonText=document.createElement(`span`),this._buttonText.className=`custom-button-text`,this._buttonText.textContent=``,this._button.appendChild(this._buttonText)),this._buttonText.textContent=e)},setIcon:function(e,t){this._options.icon=e,this._options.iconPosition=t||`left`},setBadge:function(e){e!==void 0&&(this._options.badge=e,this._badgeElement&&(this._badgeElement.textContent=e,this._badgeElement.style.display=e?`flex`:`none`))},setVariant:function(e){if(e!==void 0){var t=`custom-button-`+this._options.variant,n=`custom-button-`+e;this._button.className=this._button.className.split(` `).filter(function(e){return e!==t}).join(` `)+` `+n,this._options.variant=e}},setSize:function(e){if(e!==void 0){var t=`custom-button-`+this._options.size,n=`custom-button-`+e;this._button.className=this._button.className.split(` `).filter(function(e){return e!==t}).join(` `)+` `+n,this._options.size=e}},enable:function(){this._options.disabled=!1,this._button.disabled=!1,this._button.className=this._button.className.split(` `).filter(function(e){return e!==`custom-button-disabled`}).join(` `)},disable:function(){this._options.disabled=!0,this._button.disabled=!0,this._button.className.split(` `).indexOf(`custom-button-disabled`)===-1&&(this._button.className+=` custom-button-disabled`)},startLoading:function(){this.isLoading=!0,this._options.text!==void 0&&(this._originalText=this._options.text),this._container.className.split(` `).indexOf(`custom-button-loading`)===-1&&(this._container.className+=` custom-button-loading`),this._spinner&&(this._spinner.style.display=`inline-block`),this._buttonText&&(this._buttonText.textContent=`Loading...`),this._button.disabled=!0},stopLoading:function(){this.isLoading=!1,this._container.className=this._container.className.split(` `).filter(function(e){return e!==`custom-button-loading`}).join(` `),this._spinner&&(this._spinner.style.display=`none`),this._buttonText&&(this._buttonText.textContent=this._originalText),this._button.disabled=!!this._options.disabled},setTooltip:function(e){e!==void 0&&(this._options.tooltip=e,this._button.title=e||``)},triggerClickEvent:function(e){var t={originalEvent:e,button:this};this._subscribers.forEach(function(e){e({type:`button:click`,detail:t})})},triggerEvent:function(e,t){t||={},t.button=this,this._subscribers.forEach(function(n){n({type:`button:`+e,detail:t})})},updateState:function(){this._options.disabled?this.disable():this.enable(),this._options.loading&&this.startLoading()},destroy:function(){if(this._subscribers=[],this._boundHandles)try{this._button.removeEventListener(`click`,this._boundHandles.click),this._button.removeEventListener(`mouseenter`,this._boundHandles.mouseenter),this._button.removeEventListener(`mouseleave`,this._boundHandles.mouseleave),this._button.removeEventListener(`focus`,this._boundHandles.focus),this._button.removeEventListener(`blur`,this._boundHandles.blur),this._button.removeEventListener(`keydown`,this._boundHandles.keydown)}catch(e){console.error(e)}this._container.innerHTML=``;var e=this._container.className.split(` `).filter(function(e){return e!==`custom-button-container`}).join(` `);this._container.className=e}};var Ci=e(((e,t)=>{var n=I(),r=tt(),i=TypeError,a=Object.getOwnPropertyDescriptor;t.exports=n&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(r(e)&&!a(e,`length`).writable)throw new i(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t}})),wi=e(((e,t)=>{var n=fe(),r=TypeError;t.exports=function(e,t){if(!delete e[t])throw new r(`Cannot delete property `+n(t)+` of `+n(e))}})),Ti=e((()=>{var e=K(),t=be(),n=He(),r=Ve(),i=We(),a=Ci(),o=zr(),s=ot(),c=Nt(),l=wi(),u=ct()(`splice`),d=Math.max,f=Math.min;e({target:`Array`,proto:!0,forced:!u},{splice:function(e,u){var p=t(this),m=i(p),h=n(e,m),g=arguments.length,_,v,y,b,x,S;for(g===0?_=v=0:g===1?(_=0,v=m-h):(_=g-2,v=f(d(r(u),0),m-h)),o(m+_-v),y=s(p,v),b=0;bm-v+_;b--)l(p,b-1)}else if(_>v)for(b=m-v;b>h;b--)x=b+v-1,S=b+_-1,x in p?p[S]=p[x]:l(p,S);for(b=0;b<_;b++)p[b+h]=arguments[b+2];return a(p,m-v+_),y}})})),Ei=e((()=>{Wn()(`Map`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Kn())})),Di=e((()=>{Ei()}));Ti(),Di();var q=new WeakMap,Oi=new WeakMap,ki=new WeakMap,Ai=new WeakMap,J=new WeakMap,ji=new WeakMap,Mi=new WeakMap,Ni=new WeakSet,Pi=function(){function e(t,n){if(l(this,e),p(this,Ni),d(this,q,void 0),d(this,Oi,void 0),d(this,ki,void 0),d(this,Ai,null),d(this,J,void 0),d(this,ji,new Map),d(this,Mi,[]),typeof t==`string`){var r=document.getElementById(t);r instanceof HTMLInputElement&&(t=r)}if(!(t instanceof HTMLInputElement))throw Error(`Invalid input element`);if(f(Oi,this,t),f(J,this,Object.assign({id:`radio_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,checked:!1,disabled:!1,indeterminate:!1,label:``,name:``,value:`on`},n)),a(Ni,this,Fi).call(this),f(q,this,document.createElement(`div`)),f(ki,this,document.createElement(`span`)),a(Ni,this,Ii).call(this),a(Ni,this,Ri).call(this),a(Ni,this,zi).call(this),!u(J,this).name)throw Error(`Name attribute is required`);var i=Vi._.get(u(J,this).name);i||(i=[],Vi._.set(u(J,this).name,i)),i.push(this)}return h(e,[{key:`subscribe`,value:function(e){var t=this;return u(Mi,this).push(e),{unsubscribe:function(){f(Mi,t,u(Mi,t).filter(function(t){return t!==e}))}}}},{key:`getElement`,value:function(){return u(q,this)}},{key:`check`,value:function(e){var t=this;if(!(u(J,this).disabled||u(J,this).checked)){if(u(J,this).name){var n=Vi._.get(u(J,this).name);n&&n.forEach(function(e){e!==t&&u(J,e).checked&&e.uncheck()})}u(J,this).checked=!0,a(Ni,this,zi).call(this),!e&&a(Ni,this,Bi).call(this)}}},{key:`uncheck`,value:function(e){u(J,this).disabled||!u(J,this).checked||(u(J,this).checked=!1,a(Ni,this,zi).call(this),!e&&a(Ni,this,Bi).call(this))}},{key:`enable`,value:function(){u(J,this).disabled&&(u(J,this).disabled=!1,u(Oi,this).disabled=!1,u(q,this).setAttribute(`aria-disabled`,`false`),u(J,this).checked?u(q,this).tabIndex=0:a(Ni,this,Li).call(this),u(q,this).classList.remove(`radio--disabled`))}},{key:`disable`,value:function(){u(J,this).disabled||(u(J,this).disabled=!0,u(Oi,this).disabled=!0,u(q,this).setAttribute(`aria-disabled`,`true`),u(q,this).tabIndex=-1,u(q,this).classList.add(`radio--disabled`))}},{key:`setLabel`,value:function(e){u(J,this).label=e,u(Ai,this)?u(Ai,this).textContent=e:e&&(f(Ai,this,document.createElement(`label`)),u(Ai,this).className=`radio-label`,u(Ai,this).htmlFor=String(u(J,this).id),u(Ai,this).textContent=e,u(q,this).appendChild(u(Ai,this)))}},{key:`getState`,value:function(){return{checked:!!u(J,this).checked,disabled:!!u(J,this).disabled,value:u(J,this).value||``,name:u(J,this).name||``}}},{key:`destroy`,value:function(){var e=this;if(f(Mi,this,[]),u(J,this).name){var t=Vi._.get(u(J,this).name);if(t){var n=t.indexOf(this);n>=0&&t.splice(n,1)}u(ji,this).forEach(function(t,n){u(q,e).removeEventListener(n,t)}),u(ji,this).clear(),u(q,this)&&u(q,this).parentNode&&u(q,this).parentNode.removeChild(u(q,this)),f(Ai,this,null)}}}])}();function Fi(){u(Oi,this).type=`radio`;var e=u(Oi,this).getAttribute(`id`),t=u(Oi,this).getAttribute(`name`),n=u(Oi,this).getAttribute(`value`),r=u(Oi,this).getAttribute(`checked`),i=u(Oi,this).getAttribute(`disabled`);e===null?u(J,this).id&&u(Oi,this).setAttribute(`id`,u(J,this).id):u(J,this).id=e,t===null?u(J,this).name&&u(Oi,this).setAttribute(`name`,u(J,this).name):u(J,this).name=t,n===null?u(J,this).value&&u(Oi,this).setAttribute(`value`,u(J,this).value):u(J,this).value=n,r===null?u(J,this).checked&&u(Oi,this).setAttribute(`checked`,`true`):u(J,this).checked=r===`true`,i===null?u(J,this).disabled&&u(Oi,this).setAttribute(`disabled`,`true`):u(J,this).disabled=i===`true`}function Ii(){var e=u(Oi,this).parentNode,t=document.createDocumentFragment();t.appendChild(u(q,this)),u(q,this).classList.add(`radio-button-container`),u(q,this).setAttribute(`role`,`radio`),u(q,this).setAttribute(`aria-checked`,String(!!u(J,this).checked)),u(q,this).setAttribute(`aria-disabled`,String(!!u(J,this).disabled)),u(q,this).tabIndex=u(J,this).disabled?-1:0,u(ki,this).className=`radio-visual`,u(ki,this).setAttribute(`aria-hidden`,`true`),u(J,this).label&&(f(Ai,this,document.createElement(`label`)),u(Ai,this).className=`i18n radio-label`,u(Ai,this).htmlFor=String(u(J,this).id),u(Ai,this).textContent=u(J,this).label),u(J,this).disabled&&u(q,this).classList.add(`radio--disabled`),e&&e.insertBefore(t,u(Oi,this)),u(q,this).appendChild(u(Oi,this)),u(q,this).appendChild(u(ki,this)),u(Ai,this)&&u(q,this).appendChild(u(Ai,this)),a(Ni,this,Li).call(this)}function Li(){var e=this;if(u(J,this).checked)u(q,this).tabIndex=u(J,this).disabled?-1:0;else if(u(J,this).name&&Vi._.has(u(J,this).name)){var t=Vi._.get(u(J,this).name),n=!1;t&&t.forEach(function(t){u(J,t).checked&&t!==e&&(n=!0)}),!n&&!u(J,this).checked&&!u(J,this).disabled?u(q,this).tabIndex=0:u(q,this).tabIndex=-1}}function Ri(){var e=this,t=function(t){t.preventDefault(),!u(J,e).disabled&&!u(J,e).checked&&(e.check(),u(q,e).focus())},n=function(t){if(!u(J,e).disabled)switch(t.key){case` `:case`Spacebar`:case`Enter`:t.preventDefault(),u(J,e).checked||e.check();break}},r=function(){u(q,e).classList.add(`radio--focused`)},i=function(){u(q,e).classList.remove(`radio--focused`)};u(ji,this).set(`click`,t),u(ji,this).set(`keydown`,n),u(ji,this).set(`focus`,r),u(ji,this).set(`blur`,i),u(q,this).addEventListener(`click`,t),u(q,this).addEventListener(`keydown`,n),u(q,this).addEventListener(`focus`,r),u(q,this).addEventListener(`blur`,i)}function zi(){u(q,this).setAttribute(`aria-checked`,String(!!u(J,this).checked)),u(q,this).classList.toggle(`radio--checked`,u(J,this).checked),u(Oi,this).checked=!!u(J,this).checked,a(Ni,this,Li).call(this)}function Bi(e){var t={type:`radio:change`,detail:this.getState()};e&&(t.originalEvent=e),u(Mi,this).forEach(function(e){e(t)})}var Vi={_:new Map};function Hi(e,t){if(typeof e==`string`){var n=document.getElementById(e);n instanceof HTMLInputElement&&(e=n)}if(!(e instanceof HTMLInputElement))throw Error(`Invalid input element`);this._options=Object.assign({id:`checkbox_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,checked:!1,disabled:!1,indeterminate:!1,label:``,name:``,value:`on`},t),this._options.disabled=t.disabled||!1,this._handlers=new Map,this._createDOM(e),this._setupEventListeners(),this._updateVisualState(),this._subscribers=[]}Hi.prototype={constructor:Hi,_container:null,_input:null,_visualCheckbox:null,_labelElement:null,_createDOM:function(e){var t=e.parentNode,n=document.createDocumentFragment();this._container=document.createElement(`div`),n.appendChild(this._container),this._container.classList.add(`checkbox-container`),this._container.setAttribute(`role`,`checkbox`),this._container.setAttribute(`aria-checked`,this._options.checked?`true`:`false`),this._container.setAttribute(`aria-disabled`,this._options.disabled?`true`:`false`),this._container.tabIndex=this._options.disabled?-1:0,this._input=e;var r=this._input.getAttribute(`id`);r===null?this._options.id&&this._input.setAttribute(`id`,this._options.id):this._options.id=r,this._input.type=`checkbox`,this._options.name&&(this._input.name=this._options.name),this._options.value&&(this._input.value=this._options.value),this._input.checked=!!this._options.checked,this._options.disabled&&(this._input.disabled=!0),this._options.indeterminate&&(this._input.indeterminate=!0),this._visualCheckbox=document.createElement(`span`),this._visualCheckbox.className=`checkbox-visual`,this._visualCheckbox.setAttribute(`aria-hidden`,`true`);var i=`http://www.w3.org/2000/svg`,a=document.createElementNS(i,`svg`);a.setAttribute(`viewBox`,`0 0 10 8`),a.setAttribute(`class`,`checkbox-checkmark`);var o=document.createElementNS(i,`path`);o.setAttribute(`d`,`M0.682129 3.40702L3.68213 6.20702L9.18218 0.707116`),o.setAttribute(`fill`,`none`),o.setAttribute(`stroke`,`currentColor`),o.setAttribute(`stroke-width`,`2`),a.appendChild(o),this._visualCheckbox.appendChild(a);var s=document.createElement(`span`);if(s.className=`checkbox-indeterminate`,this._visualCheckbox.appendChild(s),this._options.label)this._labelElement=document.createElement(`label`),this._labelElement.className=`checkbox-label i18n`,this._options.id&&(this._labelElement.htmlFor=this._options.id),this._labelElement.textContent=this._options.label,this._options.title&&this._labelElement.setAttribute(`title`,this._options.label);else{var c=document.querySelector(`label[for='`+this._options.id+`']`);c instanceof HTMLLabelElement&&(this._labelElement=c)}this._options.disabled&&this._container.classList.add(`checkbox--disabled`),t&&t.insertBefore(n,e),this._container.appendChild(this._input),this._container.appendChild(this._visualCheckbox),this._labelElement&&this._container.appendChild(this._labelElement)},_setupEventListeners:function(){var e=this;if(this._container){var t=function(t){t.preventDefault(),!e._options.disabled&&e._container&&(e.toggle(),e._container.focus())},n=function(t){if(!e._options.disabled)switch(t.key){case` `:case`Spacebar`:case`Enter`:t.preventDefault(),e.toggle();break;case`ArrowRight`:case`ArrowDown`:t.preventDefault(),!e._options.checked&&!e._options.indeterminate&&(e._options.checked?e.setIndeterminate():e.check());break;case`ArrowLeft`:case`ArrowUp`:t.preventDefault(),(e._options.checked||e._options.indeterminate)&&(e._options.indeterminate?e.uncheck():e.setIndeterminate());break}},r=function(){e._container&&e._container.classList.add(`checkbox--focused`)},i=function(){e._container&&e._container.classList.remove(`checkbox--focused`)};this._handlers.set(`click`,t),this._handlers.set(`keydown`,n),this._handlers.set(`focus`,r),this._handlers.set(`blur`,i),this._container.addEventListener(`click`,t),this._container.addEventListener(`keydown`,n),this._container.addEventListener(`focus`,r),this._container.addEventListener(`blur`,i)}},_updateVisualState:function(){!this._container||!this._input||(this._container.setAttribute(`aria-checked`,this._options.indeterminate?`mixed`:String(this._options.checked)),this._container.classList.toggle(`checkbox--checked`,this._options.checked),this._container.classList.toggle(`checkbox--indeterminate`,this._options.indeterminate),this._input.checked=!!this._options.checked,this._input.indeterminate=!!this._options.indeterminate)},toggle:function(){return this._options.disabled?!!this._options.checked:(this._options.indeterminate?(this._options.indeterminate=!1,this._options.checked=!0):this._options.checked=!this._options.checked,this._updateVisualState(),this._triggerChange(),this._options.checked)},check:function(e){this._options.disabled||this._options.checked&&!this._options.indeterminate||(this._options.checked=!0,this._options.indeterminate=!1,this._updateVisualState(),e||this._triggerChange())},uncheck:function(e){this._options.disabled||!this._options.checked&&!this._options.indeterminate||(this._options.checked=!1,this._options.indeterminate=!1,this._updateVisualState(),e||this._triggerChange())},setIndeterminate:function(){this._options.disabled||this._options.indeterminate||(this._options.indeterminate=!0,this._updateVisualState(),this._triggerChange())},enable:function(){!this._options.disabled||!this._container||!this._input||(this._options.disabled=!1,this._input.disabled=!1,this._container.setAttribute(`aria-disabled`,`false`),this._container.tabIndex=0,this._container.classList.remove(`checkbox--disabled`))},disable:function(){this._options.disabled||!this._container||!this._input||(this._options.disabled=!0,this._input.disabled=!0,this._container.setAttribute(`aria-disabled`,`true`),this._container.tabIndex=-1,this._container.classList.add(`checkbox--disabled`))},setLabel:function(e){this._options.label=e,this._labelElement?this._labelElement.textContent=e:e&&this._container&&(this._labelElement=document.createElement(`label`),this._labelElement.className=`checkbox-label`,this._options.id&&(this._labelElement.htmlFor=this._options.id),this._labelElement.textContent=e,this._container.appendChild(this._labelElement)),this._options.title&&this._labelElement&&this._labelElement.setAttribute(`title`,e)},getState:function(){return this._input?{checked:this._input.checked,disabled:this._input.disabled,value:this._input.value}:{checked:!1,disabled:!1,value:``}},subscribe:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},_triggerChange:function(e){var t={type:`checkbox:change`,detail:this.getState()};e&&(t.originalEvent=e),this._subscribers.forEach(function(e){e(t)})},destroy:function(){var e=this;this._subscribers=[],this._handlers.forEach(function(t,n){e._container&&e._container.removeEventListener(n,t)}),this._handlers.clear(),this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=null,this._input=null,this._visualCheckbox=null,this._labelElement=null}};var Ui=e((e=>{e.f=G()})),Wi=e(((e,t)=>{var n=Rt(),r=xe(),i=Ui(),a=Ae().f;t.exports=function(e){var t=n.Symbol||={};r(t,e)||a(t,e,{value:i.f(e)})}})),Gi=e(((e,t)=>{var n=R(),r=W(),i=G(),a=ze();t.exports=function(){var e=r(`Symbol`),t=e&&e.prototype,o=t&&t.valueOf,s=i(`toPrimitive`);t&&!t[s]&&a(t,s,function(e){return n(o,this)},{arity:1})}})),Ki=e((()=>{var e=K(),t=P(),n=R(),r=z(),i=ge(),a=I(),o=le(),s=F(),c=xe(),l=oe(),u=ke(),d=ae(),f=we(),p=Vt(),m=ne(),h=pt(),g=ut(),_=Je(),v=zn(),y=Ye(),b=De(),x=Ae(),S=dt(),C=te(),w=ze(),T=It(),E=ye(),D=Fe(),O=Ie(),k=Se(),A=G(),j=Ui(),M=Wi(),ee=Gi(),N=xt(),L=Le(),re=st().forEach,B=D(`hidden`),ie=`Symbol`,V=`prototype`,H=L.set,U=L.getterFor(ie),W=Object[V],se=t.Symbol,ce=se&&se[V],ue=t.RangeError,de=t.TypeError,fe=t.QObject,pe=b.f,me=x.f,he=v.f,_e=C.f,ve=r([].push),be=E(`symbols`),Ce=E(`op-symbols`),Te=E(`wks`),Ee=!fe||!fe[V]||!fe[V].findChild,Oe=function(e,t,n){var r=pe(W,t);r&&delete W[t],me(e,t,n),r&&e!==W&&me(W,t,r)},je=a&&s(function(){return h(me({},`a`,{get:function(){return me(this,`a`,{value:7}).a}})).a!==7})?Oe:me,Me=function(e,t){var n=be[e]=h(ce);return H(n,{type:ie,tag:e,description:t}),a||(n.description=t),n},Ne=function(e,t,n){e===W&&Ne(Ce,t,n),u(e);var r=f(t);return u(n),c(be,r)?(n.enumerable?(c(e,B)&&e[B][r]&&(e[B][r]=!1),n=h(n,{enumerable:m(0,!1)})):(c(e,B)||me(e,B,m(1,h(null))),e[B][r]=!0),je(e,r,n)):me(e,r,n)},Pe=function(e,t){u(e);var r=d(t);return re(g(r).concat(Ue(r)),function(t){(!a||n(Be,r,t))&&Ne(e,t,r[t])}),e},Re=function(e,t){return t===void 0?h(e):Pe(h(e),t)},Be=function(e){var t=f(e),r=n(_e,this,t);return this===W&&c(be,t)&&!c(Ce,t)?!1:r||!c(this,t)||!c(be,t)||c(this,B)&&this[B][t]?r:!0},Ve=function(e,t){var n=d(e),r=f(t);if(!(n===W&&c(be,r)&&!c(Ce,r))){var i=pe(n,r);return i&&c(be,r)&&!(c(n,B)&&n[B][r])&&(i.enumerable=!0),i}},He=function(e){var t=he(d(e)),n=[];return re(t,function(e){!c(be,e)&&!c(O,e)&&ve(n,e)}),n},Ue=function(e){var t=e===W,n=he(t?Ce:d(e)),r=[];return re(n,function(e){c(be,e)&&(!t||c(W,e))&&ve(r,be[e])}),r};o||(se=function(){if(l(ce,this))throw new de(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:p(arguments[0]),r=k(e),i=function(e){var a=this===void 0?t:this;a===W&&n(i,Ce,e),c(a,B)&&c(a[B],r)&&(a[B][r]=!1);var o=m(1,e);try{je(a,r,o)}catch(e){if(!(e instanceof ue))throw e;Oe(a,r,o)}};return a&&Ee&&je(W,r,{configurable:!0,set:i}),Me(r,e)},ce=se[V],w(ce,`toString`,function(){return U(this).tag}),w(se,`withoutSetter`,function(e){return Me(k(e),e)}),C.f=Be,x.f=Ne,S.f=Pe,b.f=Ve,_.f=v.f=He,y.f=Ue,j.f=function(e){return Me(A(e),e)},a&&(T(ce,`description`,{configurable:!0,get:function(){return U(this).description}}),i||w(W,`propertyIsEnumerable`,Be,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!o,sham:!o},{Symbol:se}),re(g(Te),function(e){M(e)}),e({target:ie,stat:!0,forced:!o},{useSetter:function(){Ee=!0},useSimple:function(){Ee=!1}}),e({target:`Object`,stat:!0,forced:!o,sham:!a},{create:Re,defineProperty:Ne,defineProperties:Pe,getOwnPropertyDescriptor:Ve}),e({target:`Object`,stat:!0,forced:!o},{getOwnPropertyNames:He}),ee(),N(se,ie),O[B]=!0})),qi=e(((e,t)=>{t.exports=le()&&!!Symbol.for&&!!Symbol.keyFor})),Ji=e((()=>{var e=K(),t=W(),n=xe(),r=Vt(),i=ye(),a=qi(),o=i(`string-to-symbol-registry`),s=i(`symbol-to-string-registry`);e({target:`Symbol`,stat:!0,forced:!a},{for:function(e){var i=r(e);if(n(o,i))return o[i];var a=t(`Symbol`)(i);return o[i]=a,s[a]=i,a}})})),Yi=e((()=>{var e=K(),t=xe(),n=de(),r=fe(),i=ye(),a=qi(),o=i(`symbol-to-string-registry`);e({target:`Symbol`,stat:!0,forced:!a},{keyFor:function(e){if(!n(e))throw TypeError(r(e)+` is not a symbol`);if(t(o,e))return o[e]}})})),Xi=e(((e,t)=>{var n=U(),r=Le().get;t.exports=function(e){if(!n(e))return!1;var t=r(e);return!!t&&t.type===`RawJSON`}})),Zi=e(((e,t)=>{var n=z(),r=xe(),i=SyntaxError,a=parseInt,o=String.fromCharCode,s=n(``.charAt),c=n(``.slice),l=n(/./.exec),u={'\\"':`"`,"\\\\":`\\`,"\\/":`/`,"\\b":`\b`,"\\f":`\f`,"\\n":` +`,"\\r":`\r`,"\\t":` `},d=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;t.exports=function(e,t){for(var n=!0,p=``;t{t.exports=!F()(function(){var e=`9007199254740993`,t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e})})),$i=e((()=>{var e=K(),t=W(),n=nn(),r=R(),i=z(),a=F(),o=tt(),s=H(),c=Xi(),l=de(),u=re(),d=Vt(),f=Pt(),p=Zi(),m=Se(),h=le(),g=Qi(),_=String,v=t(`JSON`,`stringify`),y=i(/./.exec),b=i(``.charAt),x=i(``.charCodeAt),S=i(``.replace),C=i(``.slice),w=i([].push),T=i(1.1.toString),E=/[\uD800-\uDFFF]/g,D=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,k=m(),A=k.length,j=!h||a(function(){var e=t(`Symbol`)(`stringify detection`);return v([e])!==`[null]`||v({a:e})!==`{}`||v(Object(e))!==`{}`}),M=a(function(){return v(`\udf06\ud834`)!==`"\\udf06\\ud834"`||v(`\udead`)!==`"\\udead"`}),ee=j?function(e,t){var i=f(arguments),a=P(t);if(!(!s(a)&&(e===void 0||l(e))))return i[1]=function(e,t){if(s(a)&&(t=r(a,this,_(e),t)),!l(t))return t},n(v,null,i)}:v,N=function(e,t,n){var r=b(n,t-1),i=b(n,t+1);return y(D,e)&&!y(O,i)||y(O,e)&&!y(D,r)?`\\u`+T(x(e,0),16):e},P=function(e){if(s(e))return e;if(o(e)){for(var t=e.length,n=[],r=0;r{var e=K(),t=le(),n=F(),r=Ye(),i=be();e({target:`Object`,stat:!0,forced:!t||n(function(){r.f(1)})},{getOwnPropertySymbols:function(e){var t=r.f;return t?t(i(e)):[]}})})),ta=e((()=>{Ki(),Ji(),Yi(),$i(),ea()})),na=e((()=>{var e=K(),t=I(),n=P(),r=z(),i=xe(),a=H(),o=oe(),s=Vt(),c=It(),l=Ze(),u=n.Symbol,d=u&&u.prototype;if(t&&a(u)&&(!(`description`in d)||u().description!==void 0)){var f={},p=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:s(arguments[0]),t=o(d,this)?new u(e):e===void 0?u():u(e);return e===``&&(f[t]=!0),t};l(p,u),p.prototype=d,d.constructor=p;var m=String(u(`description detection`))===`Symbol(description detection)`,h=r(d.valueOf),g=r(d.toString),_=/^Symbol\((.*)\)[^)]+$/,v=r(``.replace),y=r(``.slice);c(d,`description`,{configurable:!0,get:function(){var e=h(this);if(i(f,e))return``;var t=g(e),n=m?y(t,7,-1):v(t,_,`$1`);return n===``?void 0:n}}),e({global:!0,constructor:!0,forced:!0},{Symbol:p})}})),ra=e((()=>{var e=K(),t=Ar();e({target:`Array`,stat:!0,forced:!Cn()(function(e){Array.from(e)})},{from:t})})),ia=e(((e,t)=>{var n=se().match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]})),aa=e(((e,t)=>{var n=se();t.exports=/MSIE|Trident/.test(n)})),oa=e(((e,t)=>{var n=se().match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]})),sa=e((()=>{var e=K(),t=z(),n=pe(),r=be(),i=We(),a=wi(),o=Vt(),s=F(),c=Nr(),l=At(),u=ia(),d=aa(),f=ce(),p=oa(),m=[],h=t(m.sort),g=t(m.push),_=s(function(){m.sort(void 0)}),v=s(function(){m.sort(null)}),y=l(`sort`),b=!s(function(){if(f)return f<70;if(!(u&&u>3)){if(d)return!0;if(p)return p<603;var e=``,t,n,r,i;for(t=65;t<76;t++){switch(n=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)m.push({k:n+i,v:r})}for(m.sort(function(e,t){return t.v-e.v}),i=0;io(n)?1:-1:+e(t,n)||0}};e({target:`Array`,proto:!0,forced:x},{sort:function(e){e!==void 0&&n(e);var t=r(this);if(b)return e===void 0?h(t):h(t,e);var o=[],s=i(t),l,u;for(u=0;u{var e=R(),t=z(),n=Zn(),r=ke(),i=U(),a=V(),o=tn(),s=Qn(),c=Ue(),l=Vt(),u=me(),d=nr(),f=Pn(),p=F(),m=f.UNSUPPORTED_Y,h=4294967295,g=Math.min,_=t([].push),v=t(``.slice),y=!p(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n=`ab`.split(e);return n.length!==2||n[0]!==`a`||n[1]!==`b`}),b=`abbc`.split(/(b)*/)[1]===`c`||`test`.split(/(?:)/,-1).length!==4||`ab`.split(/(?:ab)*/).length!==2||`.`.split(/(.?)(.?)/).length!==4||`.`.split(/()()/).length>1||``.split(/.?/).length;n(`split`,function(t,n,f){var p=`0`.split(void 0,0).length?function(t,r){return t===void 0&&r===0?[]:e(n,this,t,r)}:n;return[function(n,r){var o=a(this),s=i(n)?u(n,t):void 0;return s?e(s,n,o,r):e(p,l(o),n,r)},function(e,t){var i=r(this),a=l(e);if(!b){var u=f(p,i,a,t,p!==n);if(u.done)return u.value}var y=o(i,RegExp),x=i.unicode,S=(i.ignoreCase?`i`:``)+(i.multiline?`m`:``)+(i.unicode?`u`:``)+(m?`g`:`y`),C=new y(m?`^(?:`+i.source+`)`:i,S),w=t===void 0?h:t>>>0;if(w===0)return[];if(a.length===0)return d(C,a)===null?[a]:[];for(var T=0,E=0,D=[];E1&&a(Y,r,pa).call(r)}}},this._optionsContainer=null,this.searchInput=null,this._select=document.createElement(`div`),this._header=document.createElement(`div`),this._selectedText=document.createElement(`span`),this._arrow=document.createElement(`span`),this._dropdown=document.createElement(`div`),a(Y,this,ua).call(this),a(Y,this,da).call(this),a(Y,this,va).call(this),Ta._.add(this)}return h(e,[{key:`openDropdown`,value:function(){this.isOpen||document.addEventListener(`click`,this._boundHandles.close),this.isOpen=!0,this._dropdown.style.display=`block`,this._headerRectOnOpen=this._header.getBoundingClientRect(),document.addEventListener(`scroll`,this._boundHandles.scrollCheck,!0),this._arrow.className+=` selectbox-arrow-open`,this._header.className+=` selectbox-header-open`,this.searchInput&&setTimeout(function(e){return function(){e.searchInput&&e.searchInput.focus()}}(this),100),a(Y,this,va).call(this),a(Y,this,xa).call(this)}},{key:`subscribe`,value:function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}}},{key:`addItem`,value:function(e,t,n){if(n||=!1,this._items.some(function(t){return t&&t.value===e})){var r=this._items.find(function(t){return t&&t.value===e});r&&(r.selected=n)}else this._items.push({value:e,text:t,selected:n}),this._options.sortable&&this._items.sort(function(e,t){return e&&t?e.text.localeCompare(t.text):e?-1:+!!t});n&&(this._options.multiple||this._selectedValues.clear(),this._selectedValues.add(e)),a(Y,this,ba).call(this)}},{key:`addItems`,value:function(e,t){var n=this;e.forEach(function(e,r){if(!n._items.some(function(t){return t&&t.value===e[0]})){var i=t?e[0]===t:r===0;i&&(n._options.multiple||n._selectedValues.clear(),n._selectedValues.add(e[0])),n._items.push({value:e[0],text:e[1],selected:i})}},this),this.isOpen&&a(Y,this,va).call(this),a(Y,this,ba).call(this)}},{key:`addCustomItem`,value:function(e,t){this._customItems.push({value:e,text:t,selected:!1})}},{key:`addSeparator`,value:function(){this._items.push(null)}},{key:`removeItem`,value:function(e){this._items=this._items.filter(function(t){return t===null||t.value!==e}),this._customItems=this._customItems.filter(function(t){return t===null||t.value!==e}),this._selectedValues.delete(e),a(Y,this,ba).call(this)}},{key:`getSelectedValue`,value:function(){if(this._options.multiple)return console.error(`Method getSelectedValue is only available for single-select boxes.`),null;var e=Array.from(this._selectedValues);return e.length>0?e[0]:null}},{key:`getSelectedValues`,value:function(){if(this._options.multiple)return Array.from(this._selectedValues);var e=Array.from(this._selectedValues);return e.length>0?e[0]:null}},{key:`selectItems`,value:function(e,t){var n=this;if(!this._options.multiple&&Array.isArray(e)){console.error(`Method selectItem is only available for multi-select boxes.`);return}var r=``;if(this._options.multiple){var i=function(e){if(n._optionsContainer){var t=n._optionsContainer.querySelector(`[data-value="`+e+`"]`);if(t){var r=t.querySelector(`input[type="checkbox"]`);r&&r instanceof HTMLInputElement&&(r.checked=!0),t.classList.add(`selectbox-option-selected`),t.classList.add(`checkbox--checked`)}}};if(Array.isArray(e))for(var o=0;o0){var t=this._items[0];t&&this._selectedValues.add(t.value)}a(Y,this,ba).call(this),a(Y,this,va).call(this)}},{key:`destroy`,value:function(){this._subscribers=[],Ta._.delete(this);try{this._header&&this._boundHandles&&this._header.removeEventListener(`click`,this._boundHandles.toggle),this.searchInput&&this._boundHandles&&this.searchInput.removeEventListener(`input`,this._boundHandles.search),this._dropdown&&this._boundHandles&&this._dropdown.removeEventListener(`click`,this._boundHandles.dropdownClick),document&&this._boundHandles&&document.removeEventListener(`click`,this._boundHandles.close),this._header&&this._boundHandles&&this._header.removeEventListener(`keydown`,this._boundHandles.keydown),this._dropdown&&this._boundHandles&&this._dropdown.removeEventListener(`keydown`,this._boundHandles.keydown)}catch(e){console.error(e)}this._container.innerHTML=``;for(var e=this._container.className.split(` `),t=[],n=0;n`,this._header.appendChild(this._arrow),this._dropdown.className+=` selectbox-dropdown`,this._options.usePortal&&(this._dropdown.className+=` selectbox-fixed`),this._select.appendChild(this._dropdown),this._options.description){var t=document.createElement(`div`);t.className+=` i18n selectbox-description`,t.textContent=this._options.description,this._dropdown.appendChild(t)}if(this._options.searchable){var n=document.createElement(`div`);n.className+=` selectbox-search`,this._dropdown.appendChild(n),this.searchInput=document.createElement(`input`),this.searchInput.className+=` selectbox-search-input`,this.searchInput.type=`text`,this.searchInput.placeholder=`Search...`,n.appendChild(this.searchInput)}if(this._optionsContainer=document.createElement(`div`),this._optionsContainer.className+=` selectbox-options`,this._dropdown.appendChild(this._optionsContainer),this._container.appendChild(e),this._selectbox){var r=this._selectbox.parentNode;if(r){r.insertBefore(this._container,this._selectbox);var i=a(Y,this,wa).call(this,this._selectbox);this.addItems(i.values,i.selectedValue),this._selectbox.remove()}}}function da(){this._header.addEventListener(`click`,this._boundHandles.toggle),this.searchInput&&this.searchInput.addEventListener(`input`,this._boundHandles.search),this._dropdown.addEventListener(`click`,this._boundHandles.dropdownClick),this._dropdown.addEventListener(`wheel`,function(e){e.stopPropagation()}),this._header.addEventListener(`keydown`,this._boundHandles.keydown),this._dropdown.addEventListener(`keydown`,this._boundHandles.keydown)}function fa(e){if(e&&e.stopPropagation(),this.isOpen?a(Y,this,pa).call(this):this.openDropdown(),e&&e.type===`click`){var t=g(Ta._),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;r.isOpen&&r!==this&&a(Y,r,pa).call(r)}}catch(e){t.e(e)}finally{t.f()}}}function pa(){this.isOpen&&document&&this._boundHandles&&(document.removeEventListener(`click`,this._boundHandles.close),document.removeEventListener(`scroll`,this._boundHandles.scrollCheck,!0)),this.isOpen=!1,this._dropdown.style.display=`none`,this._options.usePortal?(this._dropdown.style.left=``,this._dropdown.style.width=``,this._dropdown.style.top=``):this._dropdown.classList.remove(`selectbox-dropdown-top`);for(var e=this._arrow.className.split(` `),t=[],n=0;n0)r=i[i.length-1],this._selectedValues.add(r.value);else{for(var o=Array.from(this._selectedValues),s=-1,c=0;c0)r=i[0],this._selectedValues.add(r.value);else{for(var o=Array.from(this._selectedValues),s=-1,c=0;cr?this._dropdown.style.top=t.top-n-2+`px`:this._dropdown.style.top=t.bottom+2+`px`}else this._dropdown.getBoundingClientRect().bottom>e&&this._dropdown.classList.add(`selectbox-dropdown-top`)}function Sa(e,t){for(var n=Array.from(this._selectedValues),r=[],i=0;i{var e=K(),t=$e(),n=De().f,r=Ue(),i=Vt(),a=Hr(),o=V(),s=Ur(),c=ge(),l=t(``.slice),u=Math.min,d=s(`endsWith`);e({target:`String`,proto:!0,forced:!(!c&&!d&&function(){var e=n(String.prototype,`endsWith`);return e&&!e.writable}())&&!d},{endsWith:function(e){var t=i(o(this));a(e);var n=arguments.length>1?arguments[1]:void 0,s=t.length,c=n===void 0?s:u(r(n),s),d=i(e);return l(t,c-d.length,c)===d}})})),za=e((()=>{var e=R(),t=z(),n=Zn(),r=ke(),i=U(),a=Ue(),o=Vt(),s=V(),c=me(),l=Qn(),u=tr(),d=nr(),f=t(``.indexOf);n(`match`,function(t,n,p){return[function(n){var r=s(this),a=i(n)?c(n,t):void 0;return a?e(a,n,r):new RegExp(n)[t](o(r))},function(e){var t=r(this),i=o(e),s=p(n,t,i);if(s.done)return s.value;var c=o(u(t));if(f(c,`g`)===-1)return d(t,i);var m=f(c,`u`)!==-1;t.lastIndex=0;for(var h=[],g=0,_;(_=d(t,i))!==null;){var v=o(_[0]);h[g]=v,v===``&&(t.lastIndex=l(i,a(t.lastIndex),m)),g++}return g===0?null:h}]})})),Ba=e((()=>{var e=K(),t=R(),n=z(),r=V(),i=H(),a=U(),o=Vr(),s=Vt(),c=me(),l=tr(),u=$n(),d=G(),f=ge(),p=d(`replace`),m=TypeError,h=n(``.indexOf),g=n(``.replace),_=n(``.slice),v=Math.max;e({target:`String`,proto:!0},{replaceAll:function(e,n){var d=r(this),y,b,x,S,C,w,T,E,D,O,k=0,A=``;if(a(e)){if(y=o(e),y&&(b=s(r(l(e))),!~h(b,`g`)))throw new m("`.replaceAll` does not allow non-global regexes");if(x=c(e,p),x)return t(x,e,d,n);if(f&&y)return g(s(d),e,n)}for(S=s(d),C=s(e),w=i(n),w||(n=s(n)),T=C.length,E=v(1,T),D=h(S,C);D!==-1;)O=w?s(n(C,D,S)):u(C,S,D,[],void 0,n),A+=_(S,k,D)+O,k=D+T,D=D+E>S.length?-1:h(S,C,D+E);return k{Ba()})),Ha=e((()=>{var e=K(),t=$e(),n=De().f,r=Ue(),i=Vt(),a=Hr(),o=V(),s=Ur(),c=ge(),l=t(``.slice),u=Math.min,d=s(`startsWith`);e({target:`String`,proto:!0,forced:!(!c&&!d&&function(){var e=n(String.prototype,`startsWith`);return e&&!e.writable}())&&!d},{startsWith:function(e){var t=i(o(this));a(e);var n=r(u(arguments.length>1?arguments[1]:void 0,t.length)),s=i(e);return l(t,n,n+s.length)===s}})}));Ra(),za(),Va(),Ha();var Ua=function(){function e(){l(this,e)}return h(e,null,[{key:`purifyHtml`,value:function(t){if(typeof t!=`string`||t.length===0)return``;var n=a(e,this,Ga)._,r=new DOMParser().parseFromString(`
`+t+`
`,`text/html`).getElementById(`__purify_root__`);if(!r)return``;for(var i=function(e){var t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}},o=Array.from(r.getElementsByTagName(`*`)),s=0,c=o;s`,o);if(c===-1){n.text+=t[o],o++;continue}var l=t.substring(s?o+2:o+1,c).trim(),u=l.split(` `);if(u.length===0){n.text+=t[o],o++;continue}var d=u[0].toLowerCase();if(d===`br`){n.text+=` +`,o=c+1;continue}var f=d;if(l.indexOf(`font-variant:small-caps`)===-1?l.indexOf(`text-decoration:underline`)!==-1&&(f=`u`):f=`sc`,a(e,this,Ga)._.has(d))if(s){for(var p=r.length-1;p>=0;p--)if(r[p].tag===d){var m=r.splice(p,1)[0],h=m.start,g=m.styleTag;n.formatting.push({type:g,start:h,end:i});break}}else r.push({tag:d,start:i,styleTag:f});o=c+1}else n.text+=t[o],i++,o++;return n.formatting.sort(function(e,t){return e.start===t.start?t.end-e.end:e.start-t.start}),n}}])}();function Wa(e){for(var t=/^\s*(javascript|vbscript|data)\s*:/i,n=0,r=Array.from(e.attributes);n=0;u--){var d=Asc.scope.formatting[u],f=n.GetRange(d.start,d.end);f&&t(f,d.type)}},i,r,n)})}},{key:`formatAfterUpdate`,value:function(e,t){var n=!0,r=!1;return Asc.scope.fieldId=e,Asc.scope.text=t.text,Asc.scope.formatting=t.formatting,new Promise(function(e){Asc.plugin.callCommand(function(){var e=Api.GetDocument(),t=e.GetRangeBySelect();if(!t)return;function n(e,t){t===`sup`?e.SetVertAlign(`superscript`):t===`sub`?e.SetVertAlign(`subscript`):t===`sc`?e.SetSmallCaps(!0):t===`u`?e.SetUnderline(!0):t===`b`?e.SetBold(!0):(t===`i`||t===`em`)&&e.SetItalic(!0)}if(Asc.scope.formatting.length===1){var r=Asc.scope.formatting[0];if(r.start===0&&r.end===t.GetText().length){n(t,r.type);return}}var i=null,a=t.GetAllParagraphs();if(a&&a.length)for(var o=0;o=0;d--){var f=Asc.scope.formatting[d],p=i.GetRange(f.start,f.end);p&&n(p,f.type)}},r,n,e)})}}])}(),Ja=new WeakMap,Ya=new WeakMap,Xa=new WeakMap,Za=new WeakMap,Qa=new WeakMap,$a=new WeakMap,Z=new WeakSet,eo=function(){function e(t,n,r,i){l(this,e),p(this,Z),d(this,Ja,void 0),d(this,Ya,void 0),d(this,Xa,void 0),d(this,Za,void 0),d(this,Qa,void 0),d(this,$a,void 0),f(Ja,this,`ZOTERO_CITATION`),f(Xa,this,`ZOTERO_BIBLIOGRAPHY`),f(Ya,this,t),f(Za,this,n),f(Qa,this,r),f($a,this,i)}return h(e,[{key:`addBibliography`,value:function(){var e=s(E().m(function e(t,n){var r=this,i,o,s,c,l;return E().w(function(e){for(;;)switch(e.n){case 0:if(i=window.Asc.scope.editorVersion,!(i&&i<9004e3)){e.n=1;break}return o=Ua.parseHtmlFormatting(t),s=``,c={FieldId:s,Value:u(Qa,this)+` `+n+` `+u($a,this),Content:o.text},e.a(2,a(Z,this,to).call(this,c).then(function(){return r.getCurrentField()}).then(function(e){if(s=e?.FieldId||``,o.formatting.length)return s?a(Z,r,co).call(r,s).then(function(){return qa.formatAfterUpdate(s,o)}):qa.formatAfterInsert(o.formatting,o.text)}).then(function(){return s}));case 1:return l={FieldId:``,Value:u(Qa,this)+` `+n+` `+u($a,this),Content:` `},e.n=2,a(Z,this,po).call(this,l,t);case 2:return e.a(2,e.v);case 3:return e.a(2)}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`addCitation`,value:function(){var e=s(E().m(function e(t,n,r){var i,o,s,c,l,d,f;return E().w(function(e){for(;;)switch(e.n){case 0:if(i=Ua.parseHtmlFormatting(t),o={FieldId:``,Value:u(Ya,this)+` `+u(Za,this)+` `+n,Content:i.text},s=!!(r&&[`footnotes`,`endnotes`].indexOf(r)!==-1),!s){e.n=2;break}return e.n=1,a(Z,this,oo).call(this);case 1:f=e.v,e.n=3;break;case 2:f=!1;case 3:if(c=f,l=s&&!c,!l){e.n=4;break}return e.n=4,a(Z,this,no).call(this,r);case 4:return e.n=5,a(Z,this,to).call(this,o);case 5:if(!i.formatting.length){e.n=10;break}return e.n=6,this.getCurrentField();case 6:if(d=e.v,!(d&&d.FieldId)){e.n=9;break}return e.n=7,a(Z,this,co).call(this,d.FieldId);case 7:return e.n=8,qa.formatAfterUpdate(d.FieldId,i);case 8:e.n=10;break;case 9:return e.n=10,qa.formatAfterInsert(i.formatting,i.text);case 10:if(!l){e.n=11;break}return e.n=11,a(Z,this,uo).call(this);case 11:return e.a(2,l)}},e,this)}));function t(t,n,r){return e.apply(this,arguments)}return t}()},{key:`getCurrentField`,value:function(){return new Promise(function(e,t){window.Asc.plugin.executeMethod(`GetCurrentAddinField`,void 0,e)})}},{key:`getAddinZoteroFields`,value:function(){var e=this;return new Promise(function(t,n){a(Z,e,ro).call(e).then(function(r){try{r.length&&(r=r.filter(function(t){return t.Value.indexOf(u(Ya,e))!==-1||t.Value.indexOf(u(Qa,e))!==-1||t.Value.indexOf(u(Ja,e))!==-1||t.Value.indexOf(u(Xa,e))!==-1}))}catch(e){n(e)}t(r)})})}},{key:`scanForBrokenFields`,value:function(){return new Promise(function(e){Asc.plugin.callCommand(function(){function e(e,t){for(var n=[],r=0;r=9004e3)){e.n=3;break}return t=t.filter(function(e){return e.Value.indexOf(u(Qa,n))!==0}),s=o[0],e.n=1,a(Z,this,co).call(this,s.FieldId);case 1:return c=s.Content||``,s.Content=` `,e.n=2,a(Z,this,so).call(this);case 2:return e.n=3,a(Z,this,po).call(this,s,c);case 3:return l=a(Z,this,io).call(this,t),e.n=4,new Promise(function(e){window.Asc.plugin.executeMethod(`UpdateAddinFields`,[t],e)});case 4:if(l.size){e.n=5;break}return e.a(2,r);case 5:d=g(l),e.p=6,d.s();case 7:if((f=d.n()).done){e.n=11;break}return p=O(f.value,2),m=p[0],h=p[1],e.n=8,a(Z,this,co).call(this,m);case 8:if(_=e.v,_){e.n=9;break}return e.a(3,10);case 9:return e.n=10,qa.formatAfterUpdate(m,h);case 10:e.n=7;break;case 11:e.n=13;break;case 12:e.p=12,v=e.v,d.e(v);case 13:return e.p=13,d.f(),e.f(13);case 14:return e.a(2,r)}},e,this,[[6,12,13,14]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`updateAddinFieldsInNotes`,value:function(){var e=s(E().m(function e(t){var n,r,i,o,s,c,l,u;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=t.map(function(e){return e.FieldId}),r=a(Z,this,io).call(this,t),e.n=1,new Promise(function(e){window.Asc.plugin.executeMethod(`UpdateAddinFields`,[t],e)});case 1:if(r.size){e.n=2;break}return e.a(2,n);case 2:i=g(r),e.p=3,i.s();case 4:if((o=i.n()).done){e.n=6;break}return s=O(o.value,2),c=s[0],l=s[1],e.n=5,qa.formatAfterUpdate(c,l);case 5:e.n=4;break;case 6:e.n=8;break;case 7:e.p=7,u=e.v,i.e(u);case 8:return e.p=8,i.f(),e.f(8);case 9:return e.a(2,n)}},e,this,[[3,7,8,9]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`convertNotesToText`,value:function(){var e=s(E().m(function e(t){var n,r,i,o,s,c,l;return E().w(function(e){for(;;)switch(e.n){case 0:n=a(Z,this,io).call(this,t),r=0;case 1:if(!(r{var e=K(),t=st().findIndex,n=mt(),r=`findIndex`,i=!0;r in[]&&[,][r](function(){i=!1}),e({target:`Array`,proto:!0,forced:i},{findIndex:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),n(r)}))();var ho=new WeakMap,go=new WeakMap,_o=new WeakMap,vo=new WeakSet,yo=function(){function e(){l(this,e),p(this,vo),d(this,ho,void 0),d(this,go,void 0),d(this,_o,void 0),f(ho,this,[]),f(go,this,[]),f(_o,this,[]),this.size=0}return h(e,[{key:`getItem`,value:function(e){e=e.toString();var t=u(go,this).indexOf(e);return t>=0?u(ho,this)[t]:null}},{key:`getItemIndex`,value:function(e){return e=e.toString(),u(go,this).indexOf(e)}},{key:`clear`,value:function(){return f(ho,this,[]),f(_o,this,[]),f(go,this,[]),this.size=0,this}},{key:`deleteItem`,value:function(e){e=e.toString();var t=u(go,this).indexOf(e);return t>=0&&(u(ho,this).splice(t,1),u(go,this).splice(t,1),this.size--),this}},{key:`forEachItem`,value:function(e){for(var t=0;t=0}},{key:`addCslCitation`,value:function(e){var t=this;return u(_o,this).push(e),e.setNoteIndex(u(_o,this).length),e.getCitationItems().forEach(function(e){a(vo,t,bo).call(t,e.id,e)}),this}},{key:`getAllCitationsInJson`,value:function(){return u(_o,this).map(function(e){return e.toJSON()})}},{key:`getCitation`,value:function(e){return u(_o,this).find(function(t){return t.citationID===e})}},{key:`getCitationIndex`,value:function(e){return u(_o,this).findIndex(function(t){return t.citationID===e})}},{key:`getCitationsPre`,value:function(e){var t=[];return u(_o,this).find(function(n,r){return n.citationID===e?!0:(t.push([n.citationID,r+1]),!1)}),t}},{key:`getCitationsPost`,value:function(e){for(var t=[],n=this.getCitationIndex(e)+1;n=0?(u(ho,this)[n]=t,this):(u(ho,this).push(t),u(go,this).push(e),this.size++,this)}var xo=[`userID`,`groupID`];function Q(e){if(typeof e!=`string`&&typeof e!=`number`)throw Error(`CitationItemData: id is required`);this._id=e,this._type=void 0,this._citationKey=void 0,this._categories=[],this._language=void 0,this._journalAbbreviation=void 0,this._shortTitle=void 0,this._author=[],this._chair=[],this._collectionEditor=[],this._compiler=[],this._composer=[],this._containerAuthor=[],this._contributor=[],this._curator=[],this._director=[],this._editor=[],this._editorialDirector=[],this._executiveProducer=[],this._guest=[],this._host=[],this._illustrator=[],this._narrator=[],this._organizer=[],this._originalAuthor=[],this._performer=[],this._producer=[],this._recipient=[],this._reviewedAuthor=[],this._scriptwriter=[],this._seriesCreator=[],this._translator=[],this._accessed={},this._container={},this._eventDate={},this._issued={},this._originalDate={},this._submitted={},this._abstract=void 0,this._annote=void 0,this._archive=void 0,this._archiveCollection=void 0,this._archiveLocation=void 0,this._archivePlace=void 0,this._authority=void 0,this._callNumber=void 0,this._chapterNumber=void 0,this._citationNumber=void 0,this._citationLabel=void 0,this._collectionNumber=void 0,this._collectionTitle=void 0,this._containerTitle=void 0,this._containerTitleShort=void 0,this._dimensions=void 0,this._DOI=void 0,this._edition=void 0,this._event=void 0,this._eventTitle=void 0,this._eventPlace=void 0,this._firstReferenceNoteNumber=void 0,this._genre=void 0,this._ISBN=void 0,this._ISSN=void 0,this._issue=void 0,this._jurisdiction=void 0,this._keyword=void 0,this._locator=void 0,this._medium=void 0,this._note=void 0,this._number=void 0,this._numberOfPages=void 0,this._numberOfVolumes=void 0,this._originalPublisher=void 0,this._originalPublisherPlace=void 0,this._originalTitle=void 0,this._page=void 0,this._part=void 0,this._partTitle=void 0,this._pageFirst=void 0,this._PMCID=void 0,this._PMID=void 0,this._printing=void 0,this._publisher=void 0,this._publisherPlace=void 0,this._references=void 0,this._reviewedGenre=void 0,this._reviewedTitle=void 0,this._scale=void 0,this._section=void 0,this._source=void 0,this._status=void 0,this._title=void 0,this._titleShort=void 0,this._URL=void 0,this._version=void 0,this._volume=void 0,this._volumeTitle=void 0,this._volumeTitleShort=void 0,this._yearSuffix=void 0,this._custom={},this.schema=`https://raw.githubusercontent.com/citation-style-language/schema/master/schemas/input/csl-data.json#/items`}Q.prototype._addCustomProperty=function(e,t){return this._custom[e]=t,this},Q.prototype.getCustomProperty=function(e){return Object.hasOwnProperty.call(this._custom,e)?this._custom[e]:null},Q.prototype.fillFromObject=function(e){if(Object.hasOwnProperty.call(e,`type`)&&(this._type=e.type),Object.hasOwnProperty.call(e,`categories`)&&(this._categories=e.categories),Object.hasOwnProperty.call(e,`citation-key`)&&(this._citationKey=e[`citation-key`]),Object.hasOwnProperty.call(e,`language`)&&(this._language=e.language),Object.hasOwnProperty.call(e,`journalAbbreviation`)&&(this._journalAbbreviation=e.journalAbbreviation),Object.hasOwnProperty.call(e,`shortTitle`)&&(this._shortTitle=e.shortTitle),Object.hasOwnProperty.call(e,`author`)&&(this._author=e.author),Object.hasOwnProperty.call(e,`chair`)&&(this._chair=e.chair),Object.hasOwnProperty.call(e,`collection-editor`)&&(this._collectionEditor=e[`collection-editor`]),Object.hasOwnProperty.call(e,`compiler`)&&(this._compiler=e.compiler),Object.hasOwnProperty.call(e,`composer`)&&(this._composer=e.composer),Object.hasOwnProperty.call(e,`container-author`)&&(this._containerAuthor=e[`container-author`]),Object.hasOwnProperty.call(e,`contributor`)&&(this._contributor=e.contributor),Object.hasOwnProperty.call(e,`curator`)&&(this._curator=e.curator),Object.hasOwnProperty.call(e,`director`)&&(this._director=e.director),Object.hasOwnProperty.call(e,`editorial-director`)&&(this._editorialDirector=e[`editorial-director`]),Object.hasOwnProperty.call(e,`editor`)&&(this._editor=e.editor),Object.hasOwnProperty.call(e,`executive-producer`)&&(this._executiveProducer=e[`executive-producer`]),Object.hasOwnProperty.call(e,`guest`)&&(this._guest=e.guest),Object.hasOwnProperty.call(e,`host`)&&(this._host=e.host),Object.hasOwnProperty.call(e,`illustrator`)&&(this._illustrator=e.illustrator),Object.hasOwnProperty.call(e,`narrator`)&&(this._narrator=e.narrator),Object.hasOwnProperty.call(e,`organizer`)&&(this._organizer=e.organizer),Object.hasOwnProperty.call(e,`original-author`)&&(this._originalAuthor=e[`original-author`]),Object.hasOwnProperty.call(e,`performer`)&&(this._performer=e.performer),Object.hasOwnProperty.call(e,`producer`)&&(this._producer=e.producer),Object.hasOwnProperty.call(e,`recipient`)&&(this._recipient=e.recipient),Object.hasOwnProperty.call(e,`reviewed-author`)&&(this._reviewedAuthor=e[`reviewed-author`]),Object.hasOwnProperty.call(e,`script-writer`)&&(this._scriptWriter=e[`script-writer`]),Object.hasOwnProperty.call(e,`series-creator`)&&(this._seriesCreator=e[`series-creator`]),Object.hasOwnProperty.call(e,`translator`)&&(this._translator=e.translator),Object.hasOwnProperty.call(e,`accessed`)&&(this._accessed=e.accessed),Object.hasOwnProperty.call(e,`container`)&&(this._container=e.container),Object.hasOwnProperty.call(e,`event-date`)&&(this._eventDate=e[`event-date`]),Object.hasOwnProperty.call(e,`issued`)&&(this._issued=e.issued),Object.hasOwnProperty.call(e,`original-date`)&&(this._originalDate=e[`original-date`]),Object.hasOwnProperty.call(e,`submitted`)&&(this._submitted=e.submitted),Object.hasOwnProperty.call(e,`abstract`)&&(this._abstract=e.abstract),Object.hasOwnProperty.call(e,`annote`)&&(this._annote=e.annote),Object.hasOwnProperty.call(e,`archive`)&&(this._archive=e.archive),Object.hasOwnProperty.call(e,`archive_collection`)&&(this._archiveCollection=e.archive_collection),Object.hasOwnProperty.call(e,`archive_location`)&&(this._archiveLocation=e.archive_location),Object.hasOwnProperty.call(e,`archive-place`)&&(this._archivePlace=e[`archive-place`]),Object.hasOwnProperty.call(e,`authority`)&&(this._authority=e.authority),Object.hasOwnProperty.call(e,`call-number`)&&(this._callNumber=e[`call-number`]),Object.hasOwnProperty.call(e,`chapter-number`)&&(this._chapterNumber=e[`chapter-number`]),Object.hasOwnProperty.call(e,`citation-number`)&&(this._citationNumber=e[`citation-number`]),Object.hasOwnProperty.call(e,`citation-label`)&&(this._citationLabel=e[`citation-label`]),Object.hasOwnProperty.call(e,`collection-number`)&&(this._collectionNumber=e[`collection-number`]),Object.hasOwnProperty.call(e,`collection-title`)&&(this._collectionTitle=e[`collection-title`]),Object.hasOwnProperty.call(e,`container-title`)&&(this._containerTitle=e[`container-title`]),Object.hasOwnProperty.call(e,`container-title-short`)&&(this._containerTitleShort=e[`container-title-short`]),Object.hasOwnProperty.call(e,`dimensions`)&&(this._dimensions=e.dimensions),Object.hasOwnProperty.call(e,`DOI`)&&(this._DOI=e.DOI),Object.hasOwnProperty.call(e,`edition`)&&(this._edition=e.edition),Object.hasOwnProperty.call(e,`event`)&&(this._event=e.event),Object.hasOwnProperty.call(e,`event-title`)&&(this._eventTitle=e[`event-title`]),Object.hasOwnProperty.call(e,`event-place`)&&(this._eventPlace=e[`event-place`]),Object.hasOwnProperty.call(e,`first-reference-note-number`)&&(this._firstReferenceNoteNumber=e[`first-reference-note-number`]),Object.hasOwnProperty.call(e,`genre`)&&(this._genre=e.genre),Object.hasOwnProperty.call(e,`ISBN`)&&(this._ISBN=e.ISBN),Object.hasOwnProperty.call(e,`ISSN`)&&(this._ISSN=e.ISSN),Object.hasOwnProperty.call(e,`issue`)&&(this._issue=e.issue),Object.hasOwnProperty.call(e,`jurisdiction`)&&(this._jurisdiction=e.jurisdiction),Object.hasOwnProperty.call(e,`keyword`)&&(this._keyword=e.keyword),Object.hasOwnProperty.call(e,`locator`)&&(this._locator=e.locator),Object.hasOwnProperty.call(e,`medium`)&&(this._medium=e.medium),Object.hasOwnProperty.call(e,`note`)&&(this._note=e.note),Object.hasOwnProperty.call(e,`number`)&&(this._number=e.number),Object.hasOwnProperty.call(e,`number-of-pages`)&&(this._numberOfPages=e[`number-of-pages`]),Object.hasOwnProperty.call(e,`number-of-volumes`)&&(this._numberOfVolumes=e[`number-of-volumes`]),Object.hasOwnProperty.call(e,`original-publisher`)&&(this._originalPublisher=e[`original-publisher`]),Object.hasOwnProperty.call(e,`original-publisher-place`)&&(this._originalPublisherPlace=e[`original-publisher-place`]),Object.hasOwnProperty.call(e,`original-title`)&&(this._originalTitle=e[`original-title`]),Object.hasOwnProperty.call(e,`page`)&&(this._page=e.page),Object.hasOwnProperty.call(e,`page-first`)&&(this._pageFirst=e[`page-first`]),Object.hasOwnProperty.call(e,`part`)&&(this._part=e.part),Object.hasOwnProperty.call(e,`part-title`)&&(this._partTitle=e[`part-title`]),Object.hasOwnProperty.call(e,`PMCID`)&&(this._PMCID=e.PMCID),Object.hasOwnProperty.call(e,`PMID`)&&(this._PMID=e.PMID),Object.hasOwnProperty.call(e,`printing`)&&(this._printing=e.printing),Object.hasOwnProperty.call(e,`publisher`)&&(this._publisher=e.publisher),Object.hasOwnProperty.call(e,`publisher-place`)&&(this._publisherPlace=e[`publisher-place`]),Object.hasOwnProperty.call(e,`references`)&&(this._references=e.references),Object.hasOwnProperty.call(e,`reviewed-genre`)&&(this._reviewedGenre=e[`reviewed-genre`]),Object.hasOwnProperty.call(e,`reviewed-title`)&&(this._reviewedTitle=e[`reviewed-title`]),Object.hasOwnProperty.call(e,`scale`)&&(this._scale=e.scale),Object.hasOwnProperty.call(e,`section`)&&(this._section=e.section),Object.hasOwnProperty.call(e,`source`)&&(this._source=e.source),Object.hasOwnProperty.call(e,`status`)&&(this._status=e.status),Object.hasOwnProperty.call(e,`title`)&&(this._title=e.title),Object.hasOwnProperty.call(e,`title-short`)&&(this._titleShort=e[`title-short`]),Object.hasOwnProperty.call(e,`URL`)&&(this._URL=e.URL),Object.hasOwnProperty.call(e,`version`)&&(this._version=e.version),Object.hasOwnProperty.call(e,`volume`)&&(this._volume=e.volume),Object.hasOwnProperty.call(e,`volume-title`)&&(this._volumeTitle=e[`volume-title`]),Object.hasOwnProperty.call(e,`volume-title-short`)&&(this._volumeTitleShort=e[`volume-title-short`]),Object.hasOwnProperty.call(e,`year-suffix`)&&(this._yearSuffix=e[`year-suffix`]),Object.hasOwnProperty.call(e,`custom`)&&(this._custom=e.custom),Object.hasOwnProperty.call(e,`userID`)&&this._addCustomProperty(`userID`,e.userID),Object.hasOwnProperty.call(e,`groupID`)&&this._addCustomProperty(`groupID`,e.groupID),Object.hasOwnProperty.call(e,`creators`)){var t=this,n={author:`_author`,editor:`_editor`,translator:`_translator`,contributor:`_contributor`,composer:`_composer`,director:`_director`,producer:`_producer`,performer:`_performer`,recipient:`_recipient`,narrator:`_narrator`,illustrator:`_illustrator`,interviewer:`_author`,interviewee:`_contributor`,seriesEditor:`_collectionEditor`,bookAuthor:`_containerAuthor`,reviewedAuthor:`_reviewedAuthor`,scriptwriter:`_scriptwriter`,guest:`_guest`,host:`_host`,organizer:`_organizer`,curator:`_curator`,compiler:`_compiler`};e.creators.forEach(function(e){var r={};e.firstName&&(r.given=e.firstName),e.lastName&&(r.family=e.lastName),e.name&&(r.literal=e.name);var i=t[n[e.creatorType||`author`]||`_author`];Array.isArray(i)||(i=t._author),!i.some(function(e){return!(e.family!==r.family&&(e.family||r.family)||e.given!==r.given&&(e.given||r.given)||e.literal!==r.literal&&(e.literal||r.literal))})&&i.push(r)},this)}if(Object.hasOwnProperty.call(e,`libraryCatalog`)&&(this._source=e.libraryCatalog),Object.hasOwnProperty.call(e,`place`)&&(this._eventPlace=e.place,this._publisherPlace=e.place),Object.hasOwnProperty.call(e,`numberOfVolumes`)&&(this._numberOfVolumes=e.numberOfVolumes),Object.hasOwnProperty.call(e,`callNumber`)&&(this._callNumber=e.callNumber),Object.hasOwnProperty.call(e,`seriesNumber`)&&(this._collectionNumber=e.seriesNumber),Object.hasOwnProperty.call(e,`series`)&&(this._collectionTitle=e.series),Object.hasOwnProperty.call(e,`bookTitle`)&&(this._containerTitle=e.bookTitle),Object.hasOwnProperty.call(e,`publicationTitle`)&&(this._containerTitle=e.publicationTitle),Object.hasOwnProperty.call(e,`proceedingsTitle`)&&(this._containerTitle=e.proceedingsTitle),Object.hasOwnProperty.call(e,`encyclopediaTitle`)&&(this._containerTitle=e.encyclopediaTitle),Object.hasOwnProperty.call(e,`dictionaryTitle`)&&(this._containerTitle=e.dictionaryTitle),Object.hasOwnProperty.call(e,`pages`)&&(this._page=e.pages),Object.hasOwnProperty.call(e,`date`)&&!Object.hasOwnProperty.call(e,`issued`)){var r=e.date;if(typeof r==`string`&&r){var i=r.replace(/\//g,`-`).split(`-`).map(Number).filter(function(e){return!isNaN(e)});i.length&&(this._issued={"date-parts":[i]})}}if(Object.hasOwnProperty.call(e,`url`)&&!Object.hasOwnProperty.call(e,`URL`)&&(this._URL=e.url),Object.hasOwnProperty.call(e,`numPages`)&&(this._numberOfPages=e.numPages),Object.hasOwnProperty.call(e,`itemType`)&&!Object.hasOwnProperty.call(e,`type`)){var a={artwork:`graphic`,audioRecording:`song`,bill:`bill`,blogPost:`post-weblog`,book:`book`,bookSection:`chapter`,case:`legal_case`,computerProgram:`software`,conferencePaper:`paper-conference`,dictionaryEntry:`entry-dictionary`,document:`document`,email:`personal_communication`,encyclopediaEntry:`entry-encyclopedia`,film:`motion_picture`,forumPost:`post`,hearing:`hearing`,instantMessage:`personal_communication`,interview:`interview`,journalArticle:`article-journal`,letter:`personal_communication`,magazineArticle:`article-magazine`,manuscript:`manuscript`,map:`map`,newspaperArticle:`article-newspaper`,patent:`patent`,podcast:`song`,presentation:`speech`,radioBroadcast:`broadcast`,report:`report`,statute:`legislation`,thesis:`thesis`,tvBroadcast:`broadcast`,videoRecording:`motion_picture`,webpage:`webpage`};this._type=a[e.itemType]||e.itemType}Object.hasOwnProperty.call(e,`extra`)&&(this._note=e.extra),Object.hasOwnProperty.call(e,`rights`)&&(this._license=e.rights),Object.hasOwnProperty.call(e,`archiveLocation`)&&(this._archiveLocation=e.archiveLocation),Object.hasOwnProperty.call(e,`abstractNote`)&&(this._abstract=e.abstractNote)},Q.prototype.getTitle=function(){return this._title},Q.prototype.getType=function(){return this._type},Q.prototype.setType=function(e){return this._type=e,this},Q.prototype.setCitationKey=function(e){return this._citationKey=e,this},Q.prototype.setCategories=function(e){return this._categories=e,this},Q.prototype.setLanguage=function(e){return this._language=e,this},Q.prototype.setJournalAbbreviation=function(e){return this._journalAbbreviation=e,this},Q.prototype.setShortTitle=function(e){return this._shortTitle=e,this},Q.prototype.setAuthor=function(e){return this._author=Array.isArray(e)?e:[e],this},Q.prototype.setChair=function(e){return this._chair=Array.isArray(e)?e:[e],this},Q.prototype.setCollectionEditor=function(e){return this._collectionEditor=Array.isArray(e)?e:[e],this},Q.prototype.setCompiler=function(e){return this._compiler=Array.isArray(e)?e:[e],this},Q.prototype.setComposer=function(e){return this._composer=Array.isArray(e)?e:[e],this},Q.prototype.setContainerAuthor=function(e){return this._containerAuthor=Array.isArray(e)?e:[e],this},Q.prototype.setContributor=function(e){return this._contributor=Array.isArray(e)?e:[e],this},Q.prototype.setCurator=function(e){return this._curator=Array.isArray(e)?e:[e],this},Q.prototype.setDirector=function(e){return this._director=Array.isArray(e)?e:[e],this},Q.prototype.setEditor=function(e){return this._editor=Array.isArray(e)?e:[e],this},Q.prototype.setEditorialDirector=function(e){return this._editorialDirector=Array.isArray(e)?e:[e],this},Q.prototype.setExecutiveProducer=function(e){return this._executiveProducer=Array.isArray(e)?e:[e],this},Q.prototype.setGuest=function(e){return this._guest=Array.isArray(e)?e:[e],this},Q.prototype.setHost=function(e){return this._host=Array.isArray(e)?e:[e],this},Q.prototype.setIllustrator=function(e){return this._illustrator=Array.isArray(e)?e:[e],this},Q.prototype.setNarrator=function(e){return this._narrator=Array.isArray(e)?e:[e],this},Q.prototype.setOrganizer=function(e){return this._organizer=Array.isArray(e)?e:[e],this},Q.prototype.setOriginalAuthor=function(e){return this._originalAuthor=Array.isArray(e)?e:[e],this},Q.prototype.setPerformer=function(e){return this._performer=Array.isArray(e)?e:[e],this},Q.prototype.setProducer=function(e){return this._producer=Array.isArray(e)?e:[e],this},Q.prototype.setRecipient=function(e){return this._recipient=Array.isArray(e)?e:[e],this},Q.prototype.setReviewedAuthor=function(e){return this._reviewedAuthor=Array.isArray(e)?e:[e],this},Q.prototype.setScriptwriter=function(e){return this._scriptwriter=Array.isArray(e)?e:[e],this},Q.prototype.setSeriesCreator=function(e){return this._seriesCreator=Array.isArray(e)?e:[e],this},Q.prototype.setTranslator=function(e){return this._translator=Array.isArray(e)?e:[e],this},Q.prototype.setAccessed=function(e){return this._accessed=e||{},this},Q.prototype.setContainer=function(e){return this._container=e||{},this},Q.prototype.setEventDate=function(e){return this._eventDate=e||{},this},Q.prototype.setIssued=function(e){return this._issued=e||{},this},Q.prototype.setOriginalDate=function(e){return this._originalDate=e||{},this},Q.prototype.setSubmitted=function(e){return this._submitted=e||{},this},Q.prototype.setAbstract=function(e){return this._abstract=e,this},Q.prototype.setAnnote=function(e){return this._annote=e,this},Q.prototype.setArchive=function(e){return this._archive=e,this},Q.prototype.setArchiveCollection=function(e){return this._archiveCollection=e,this},Q.prototype.setArchiveLocation=function(e){return this._archiveLocation=e,this},Q.prototype.setArchivePlace=function(e){return this._archivePlace=e,this},Q.prototype.setAuthority=function(e){return this._authority=e,this},Q.prototype.setCallNumber=function(e){return this._callNumber=e,this},Q.prototype.setChapterNumber=function(e){return this._chapterNumber=e,this},Q.prototype.setCitationNumber=function(e){return this._citationNumber=e,this},Q.prototype.setCitationLabel=function(e){return this._citationLabel=e,this},Q.prototype.setCollectionNumber=function(e){return this._collectionNumber=e,this},Q.prototype.setCollectionTitle=function(e){return this._collectionTitle=e,this},Q.prototype.setContainerTitle=function(e){return this._containerTitle=e,this},Q.prototype.setContainerTitleShort=function(e){return this._containerTitleShort=e,this},Q.prototype.setDimensions=function(e){return this._dimensions=e,this},Q.prototype.setDOI=function(e){return this._DOI=e,this},Q.prototype.setEdition=function(e){return this._edition=e,this},Q.prototype.setEvent=function(e){return this._event=e,this},Q.prototype.setEventTitle=function(e){return this._eventTitle=e,this},Q.prototype.setEventPlace=function(e){return this._eventPlace=e,this},Q.prototype.setFirstReferenceNoteNumber=function(e){return this._firstReferenceNoteNumber=e,this},Q.prototype.setGenre=function(e){return this._genre=e,this},Q.prototype.setISBN=function(e){return this._ISBN=e,this},Q.prototype.setISSN=function(e){return this._ISSN=e,this},Q.prototype.setIssue=function(e){return this._issue=e,this},Q.prototype.setJurisdiction=function(e){return this._jurisdiction=e,this},Q.prototype.setKeyword=function(e){return this._keyword=e,this},Q.prototype.setLocator=function(e){return this._locator=e,this},Q.prototype.setMedium=function(e){return this._medium=e,this},Q.prototype.setNote=function(e){return this._note=e,this},Q.prototype.setNumber=function(e){return this._number=e,this},Q.prototype.setNumberOfPages=function(e){return this._numberOfPages=e,this},Q.prototype.setNumberOfVolumes=function(e){return this._numberOfVolumes=e,this},Q.prototype.setOriginalPublisher=function(e){return this._originalPublisher=e,this},Q.prototype.setOriginalPublisherPlace=function(e){return this._originalPublisherPlace=e,this},Q.prototype.setOriginalTitle=function(e){return this._originalTitle=e,this},Q.prototype.setPage=function(e){return this._page=e,this},Q.prototype.setPageFirst=function(e){return this._pageFirst=e,this},Q.prototype.setPart=function(e){return this._part=e,this},Q.prototype.setPartTitle=function(e){return this._partTitle=e,this},Q.prototype.setPMCID=function(e){return this._PMCID=e,this},Q.prototype.setPMID=function(e){return this._PMID=e,this},Q.prototype.setPrinting=function(e){return this._printing=e,this},Q.prototype.setPublisher=function(e){return this._publisher=e,this},Q.prototype.setPublisherPlace=function(e){return this._publisherPlace=e,this},Q.prototype.setReferences=function(e){return this._references=e,this},Q.prototype.setReviewedGenre=function(e){return this._reviewedGenre=e,this},Q.prototype.setReviewedTitle=function(e){return this._reviewedTitle=e,this},Q.prototype.setScale=function(e){return this._scale=e,this},Q.prototype.setSection=function(e){return this._section=e,this},Q.prototype.setSource=function(e){return this._source=e,this},Q.prototype.setStatus=function(e){return this._status=e,this},Q.prototype.setTitle=function(e){return this._title=e,this},Q.prototype.setTitleShort=function(e){return this._titleShort=e,this},Q.prototype.setURL=function(e){return this._URL=e,this},Q.prototype.setVersion=function(e){return this._version=e,this},Q.prototype.setVolume=function(e){return this._volume=e,this},Q.prototype.setVolumeTitle=function(e){return this._volumeTitle=e,this},Q.prototype.setVolumeTitleShort=function(e){return this._volumeTitleShort=e,this},Q.prototype.setYearSuffix=function(e){return this._yearSuffix=e,this},Q.prototype.setCustom=function(e){return this._custom=Object.assign(this._custom,e),this},Q.prototype.toJSON=function(e){var t={};if(t.id=this._id,this._type!==void 0&&this._type!==``&&(t.type=this._type),this._citationKey!==void 0&&this._citationKey!==``&&(t[`citation-key`]=this._citationKey),this._categories.length>0&&(t.categories=this._categories),this._language!==void 0&&this._language!==``&&(t.language=this._language),this._journalAbbreviation!==void 0&&this._journalAbbreviation!==``&&(t.journalAbbreviation=this._journalAbbreviation),this._shortTitle!==void 0&&this._shortTitle!==``&&(t.shortTitle=this._shortTitle,this._titleShort===void 0&&(t[`title-short`]=this._shortTitle)),this._author.length>0&&(t.author=this._author),this._chair.length>0&&(t.chair=this._chair),this._collectionEditor.length>0&&(t[`collection-editor`]=this._collectionEditor),this._compiler.length>0&&(t.compiler=this._compiler),this._composer.length>0&&(t.composer=this._composer),this._containerAuthor.length>0&&(t[`container-author`]=this._containerAuthor),this._contributor.length>0&&(t.contributor=this._contributor),this._curator.length>0&&(t.curator=this._curator),this._director.length>0&&(t.director=this._director),this._editor.length>0&&(t.editor=this._editor),this._editorialDirector.length>0&&(t[`editorial-director`]=this._editorialDirector),this._executiveProducer.length>0&&(t[`executive-producer`]=this._executiveProducer),this._guest.length>0&&(t.guest=this._guest),this._host.length>0&&(t.host=this._host),this._illustrator.length>0&&(t.illustrator=this._illustrator),this._narrator.length>0&&(t.narrator=this._narrator),this._organizer.length>0&&(t.organizer=this._organizer),this._originalAuthor.length>0&&(t[`original-author`]=this._originalAuthor),this._performer.length>0&&(t.performer=this._performer),this._producer.length>0&&(t.producer=this._producer),this._recipient.length>0&&(t.recipient=this._recipient),this._reviewedAuthor.length>0&&(t[`reviewed-author`]=this._reviewedAuthor),this._scriptwriter.length>0&&(t[`script-writer`]=this._scriptwriter),this._seriesCreator.length>0&&(t[`series-creator`]=this._seriesCreator),this._translator.length>0&&(t.translator=this._translator),Object.keys(this._accessed).length>0&&(t.accessed=this._accessed),Object.keys(this._container).length>0&&(t.container=this._container),Object.keys(this._eventDate).length>0&&(t[`event-date`]=this._eventDate),Object.keys(this._issued).length>0&&(t.issued=this._issued),Object.keys(this._originalDate).length>0&&(t[`original-date`]=this._originalDate),Object.keys(this._submitted).length>0&&(t.submitted=this._submitted),this._abstract!==void 0&&this._abstract!==``&&(t.abstract=this._abstract),this._annote!==void 0&&this._annote!==``&&(t.annote=this._annote),this._archive!==void 0&&this._archive!==``&&(t.archive=this._archive),this._archiveCollection!==void 0&&this._archiveCollection!==``&&(t.archive_collection=this._archiveCollection),this._archiveLocation!==void 0&&this._archiveLocation!==``&&(t.archive_location=this._archiveLocation),this._archivePlace!==void 0&&this._archivePlace!==``&&(t[`archive-place`]=this._archivePlace),this._authority!==void 0&&this._authority!==``&&(t.authority=this._authority),this._callNumber!==void 0&&this._callNumber!==``&&(t[`call-number`]=this._callNumber),this._chapterNumber!==void 0&&this._chapterNumber!==``&&(t[`chapter-number`]=this._chapterNumber),this._citationNumber!==void 0&&this._citationNumber!==``&&(t[`citation-number`]=this._citationNumber),this._citationLabel!==void 0&&this._citationLabel!==``&&(t[`citation-label`]=this._citationLabel),this._collectionNumber!==void 0&&this._collectionNumber!==``&&(t[`collection-number`]=this._collectionNumber),this._collectionTitle!==void 0&&this._collectionTitle!==``&&(t[`collection-title`]=this._collectionTitle),this._containerTitle!==void 0&&this._containerTitle!==``&&(t[`container-title`]=this._containerTitle),this._containerTitleShort!==void 0&&this._containerTitleShort!==``&&(t[`container-title-short`]=this._containerTitleShort),this._dimensions!==void 0&&this._dimensions!==``&&(t.dimensions=this._dimensions),this._DOI!==void 0&&this._DOI!==``&&(t.DOI=this._DOI),this._edition!==void 0&&this._edition!==``&&(t.edition=this._edition),this._event!==void 0&&this._event!==``&&(t.event=this._event),this._eventTitle!==void 0&&this._eventTitle!==``&&(t[`event-title`]=this._eventTitle),this._eventPlace!==void 0&&this._eventPlace!==``&&(t[`event-place`]=this._eventPlace),this._firstReferenceNoteNumber!==void 0&&this._firstReferenceNoteNumber!==``&&(t[`first-reference-note-number`]=this._firstReferenceNoteNumber),this._genre!==void 0&&this._genre!==``&&(t.genre=this._genre),this._ISBN!==void 0&&this._ISBN!==``&&(t.ISBN=this._ISBN),this._ISSN!==void 0&&this._ISSN!==``&&(t.ISSN=this._ISSN),this._issue!==void 0&&this._issue!==``&&(t.issue=this._issue),this._jurisdiction!==void 0&&this._jurisdiction!==``&&(t.jurisdiction=this._jurisdiction),this._keyword!==void 0&&this._keyword!==``&&(t.keyword=this._keyword),this._locator!==void 0&&this._locator!==``&&(t.locator=this._locator),this._medium!==void 0&&this._medium!==``&&(t.medium=this._medium),this._note!==void 0&&this._note!==``&&(t.note=this._note),this._number!==void 0&&this._number!==``&&(t.number=this._number),this._numberOfPages!==void 0&&this._numberOfPages!==``&&(t[`number-of-pages`]=this._numberOfPages),this._numberOfVolumes!==void 0&&this._numberOfVolumes!==``&&(t[`number-of-volumes`]=this._numberOfVolumes),this._originalPublisher!==void 0&&this._originalPublisher!==``&&(t[`original-publisher`]=this._originalPublisher),this._originalPublisherPlace!==void 0&&this._originalPublisherPlace!==``&&(t[`original-publisher-place`]=this._originalPublisherPlace),this._originalTitle!==void 0&&this._originalTitle!==``&&(t[`original-title`]=this._originalTitle),this._page!==void 0&&this._page!==``&&(t.page=this._page),this._pageFirst!==void 0&&this._pageFirst!==``&&(t[`page-first`]=this._pageFirst),this._part!==void 0&&this._part!==``&&(t.part=this._part),this._partTitle!==void 0&&this._partTitle!==``&&(t[`part-title`]=this._partTitle),this._PMCID!==void 0&&this._PMCID!==``&&(t.PMCID=this._PMCID),this._PMID!==void 0&&this._PMID!==``&&(t.PMID=this._PMID),this._printing!==void 0&&this._printing!==``&&(t.printing=this._printing),this._publisher!==void 0&&this._publisher!==``&&(t.publisher=this._publisher),this._publisherPlace!==void 0&&this._publisherPlace!==``&&(t[`publisher-place`]=this._publisherPlace),this._references!==void 0&&this._references!==``&&(t.references=this._references),this._reviewedGenre!==void 0&&this._reviewedGenre!==``&&(t[`reviewed-genre`]=this._reviewedGenre),this._reviewedTitle!==void 0&&this._reviewedTitle!==``&&(t[`reviewed-title`]=this._reviewedTitle),this._scale!==void 0&&this._scale!==``&&(t.scale=this._scale),this._section!==void 0&&this._section!==``&&(t.section=this._section),this._source!==void 0&&this._source!==``&&(t.source=this._source),this._status!==void 0&&this._status!==``&&(t.status=this._status),this._title!==void 0&&this._title!==``&&(t.title=this._title),this._titleShort!==void 0&&this._titleShort!==``&&(t[`title-short`]=this._titleShort),this._URL!==void 0&&this._URL!==``&&(t.URL=this._URL),this._version!==void 0&&this._version!==``&&(t.version=this._version),this._volume!==void 0&&this._volume!==``&&(t.volume=this._volume),this._volumeTitle!==void 0&&this._volumeTitle!==``&&(t[`volume-title`]=this._volumeTitle),this._volumeTitleShort!==void 0&&this._volumeTitleShort!==``&&(t[`volume-title-short`]=this._volumeTitleShort),this._yearSuffix!==void 0&&this._yearSuffix!==``&&(t[`year-suffix`]=this._yearSuffix),Object.keys(this._custom).length!==0){var n=this._custom;n.userID,n.groupID;var r=w(n,xo);Object.keys(r).length>0&&(t.custom=r)}return this._license!==void 0&&this._license!==``&&(t.license=this._license),t};function So(e){if(typeof e!=`string`&&typeof e!=`number`)throw Error(`CitationItem: id is required`);this.id=e,this._itemData=new Q(e),this._prefix=void 0,this._suffix=void 0,this._locator=void 0,this._label=void 0,this._suppressAuthor=void 0,this._authorOnly=void 0,this._uris=[]}So.prototype.fillFromObject=function(e){var t=this;Object.hasOwnProperty.call(e,`version`)&&Object.hasOwnProperty.call(e,`library`)?(this._itemData.fillFromObject(e.data),Object.hasOwnProperty.call(e,`links`)&&(Object.hasOwnProperty.call(e.links,`self`)&&this.addUri(e.links.self.href),Object.hasOwnProperty.call(e.links,`alternate`)&&this.addUri(e.links.alternate.href))):Object.hasOwnProperty.call(e,`itemData`)?this._itemData.fillFromObject(e.itemData):this._itemData.fillFromObject(e),Object.hasOwnProperty.call(e,`prefix`)&&(this._prefix=e.prefix),Object.hasOwnProperty.call(e,`suffix`)&&(this._suffix=e.suffix),Object.hasOwnProperty.call(e,`locator`)&&(this._locator=e.locator),Object.hasOwnProperty.call(e,`label`)&&(this._label=e.label),Object.hasOwnProperty.call(e,`suppress-author`)&&(this._suppressAuthor=e[`suppress-author`]),Object.hasOwnProperty.call(e,`author-only`)&&(this._authorOnly=e[`author-only`]),Object.hasOwnProperty.call(e,`uris`)&&e.uris.forEach(function(e){t.addUri(e)},this)},So.prototype.replaceItemDataFromCsl=function(e){var t=this._itemData;this._itemData=new Q(this.id);var n=t.getCustomProperty(`userID`),r=t.getCustomProperty(`groupID`);n!==null&&this._itemData._addCustomProperty(`userID`,n),r!==null&&this._itemData._addCustomProperty(`groupID`,r),this._itemData.fillFromObject(e)},So.prototype.getInfoForCitationCluster=function(){var e={id:this.id,"suppress-author":this._suppressAuthor};return this._prefix&&(e.prefix=this._prefix),this._suffix&&(e.suffix=this._suffix),this._locator&&(e.locator=this._locator),this._label&&(e.label=this._label),e},So.prototype.getItemData=function(){return this._itemData},So.prototype.getProperty=function(e){return this._itemData.getCustomProperty(e)===null?null:this._itemData.getCustomProperty(e)},So.prototype.setPrefix=function(e){return this._prefix=e,this},So.prototype.setSuffix=function(e){return this._suffix=e,this},So.prototype.setLocator=function(e){return this._locator=e,this},So.prototype.setLabel=function(e){if(e){if(`act.appendix.article-locator.book.canon.chapter.column.elocation.equation.figure.folio.issue.line.note.opus.page.paragraph.part.rule.scene.section.sub-verbo.supplement.table.timestamp.title-locator.verse.version.volume`.split(`.`).indexOf(e)===-1)throw Error(`CitationItem.setLocator: Invalid label "`+e+`"`);this._label=e}return this},So.prototype.setSuppressAuthor=function(e){return this._suppressAuthor=e,this},So.prototype.setAuthorOnly=function(e){return this._authorOnly=e,this},So.prototype.addUri=function(e){return this._uris.indexOf(e)===-1&&this._uris.push(e),this},So.prototype.toJSON=function(e){var t={};t.id=this.id,this._itemData&&(t.itemData=this._itemData.toJSON?this._itemData.toJSON(e||!1):this._itemData),this._prefix!==void 0&&(t.prefix=this._prefix),this._suffix!==void 0&&(t.suffix=this._suffix),this._locator!==void 0&&(t.locator=this._locator),this._label!==void 0&&(t.label=this._label),this._suppressAuthor!==void 0&&(t[`suppress-author`]=this._suppressAuthor),this._authorOnly!==void 0&&(t[`author-only`]=this._authorOnly);var n=this._uris.filter(function(e){return e.indexOf(`localhost`)===-1&&e.indexOf(`api.zotero.org`)===-1});if(n.length)t.uris=n;else{var r=this._itemData&&this._itemData.getCustomProperty?this._itemData.getCustomProperty(`userID`):null,i=this._itemData&&this._itemData.getCustomProperty?this._itemData.getCustomProperty(`groupID`):null,a=typeof this.id==`string`?this.id:``;a&&r?t.uris=[`http://zotero.org/users/`+r+`/items/`+a]:a&&i?t.uris=[`http://zotero.org/groups/`+i+`/items/`+a]:t.uris=[]}return t},So.prototype.toFlatJSON=function(e){var t={id:this.id,index:e};this._suppressAuthor!==void 0&&(t[`suppress-author`]=this._suppressAuthor);var n=this._itemData.toJSON();return Object.assign(t,n),this._itemData.getCustomProperty(`userID`)!==void 0&&this._itemData.getCustomProperty(`userID`)!==null&&(t.userID=String(this._itemData.getCustomProperty(`userID`))),this._itemData.getCustomProperty(`groupID`)!==void 0&&this._itemData.getCustomProperty(`groupID`)!==null&&(t.groupID=String(this._itemData.getCustomProperty(`groupID`))),t};var Co=[`index`],wo=new WeakSet,To=function(){function e(t){l(this,e),p(this,wo),t||=a(wo,this,No).call(this),Po._.has(t)&&(console.warn(`Citation ID must be unique`),t=a(wo,this,No).call(this)),Po._.add(t),this.citationID=t,this._citationItems=[],this._properties={},this._manualOverride={},this._schema=`https://github.com/citation-style-language/schema/raw/master/csl-citation.json`}return h(e,[{key:`fillFromObject`,value:function(e){return Object.hasOwnProperty.call(e,`properties`)||Object.hasOwnProperty.call(e,`manualOverride`)||Object.hasOwnProperty.call(e,`schema`)?a(wo,this,Eo).call(this,e):Object.hasOwnProperty.call(e,`citationItems`)?a(wo,this,Do).call(this,e):Object.hasOwnProperty.call(e,`version`)&&Object.hasOwnProperty.call(e,`library`)?a(wo,this,ko).call(this,e):a(wo,this,Oo).call(this,e)}},{key:`getCitationItems`,value:function(){return this._citationItems}},{key:`getDoNotUpdate`,value:function(){return Object.hasOwnProperty.call(this._properties,`dontUpdate`)?!!this._properties.dontUpdate:Object.hasOwnProperty.call(this._manualOverride,`isManuallyOverridden`)?!!this._manualOverride.isManuallyOverridden:!1}},{key:`getInfoForCitationCluster`,value:function(){return this._citationItems.map(function(e){return e.getInfoForCitationCluster()},this)}},{key:`getPlainCitation`,value:function(){return Object.hasOwnProperty.call(this._properties,`plainCitation`)?String(this._properties.plainCitation):this._manualOverride&&Object.keys(this._manualOverride).length>0?String(this._manualOverride.citeprocText):``}},{key:`setDoNotUpdate`,value:function(){return a(wo,this,jo).call(this,{dontUpdate:!0}),this}},{key:`setNoteIndex`,value:function(e){return a(wo,this,jo).call(this,{noteIndex:e}),this}},{key:`setPlainCitation`,value:function(e){return a(wo,this,jo).call(this,{plainCitation:e}),this}},{key:`setFormattedCitation`,value:function(e){return a(wo,this,jo).call(this,{formattedCitation:e}),this}},{key:`setManualOverride`,value:function(e,t){var n={citeprocText:e,isManuallyOverridden:!!t,manualOverrideText:t||``};return this._manualOverride=n,this}},{key:`validate`,value:function(){var e=[];if(this._schema||e.push(`Schema is required`),this.citationID||e.push(`citationID is required`),this._citationItems&&Array.isArray(this._citationItems))for(var t=0;t0){var t=this._properties;t.index;var n=w(t,Co);Object.keys(n).length>0&&(e.properties=n)}return this._manualOverride&&Object.keys(this._manualOverride).length>0&&(e.manualOverride=this._manualOverride),this._citationItems&&this._citationItems.length>0&&(e.citationItems=this._citationItems.map(function(e){return e.toJSON()})),e}}],[{key:`resetUsedIDs`,value:function(){Po._=new Set}}])}();function Eo(e){var t=this;if(Object.hasOwnProperty.call(e,`schema`),Object.hasOwnProperty.call(e,`properties`)&&a(wo,this,jo).call(this,e.properties),Object.hasOwnProperty.call(e,`manualOverride`)&&(this._manualOverride=e.manualOverride),!Object.hasOwnProperty.call(e,`citationItems`))return console.error(`citationItems is empty`),0;var n=this._citationItems.map(function(e){return e.id});return e.citationItems.forEach(function(e){var r=e.id,i;n.indexOf(r)>=0?i=t._citationItems[n.indexOf(r)]:(i=new So(r),n.push(r)),typeof r==`number`&&(r=a(wo,t,Mo).call(t,e)),i.fillFromObject(e),a(wo,t,Ao).call(t,i)},this),n.length}function Do(e){var t=this;return e.citationItems.length===0?(console.error(`CSLCitation.citationItems: citationItems is empty`),0):(e.citationItems.length>1&&console.warn(`CSLCitation.citationItems: citationItems has more than one item`),e.citationItems.forEach(function(e){a(wo,t,Oo).call(t,e)},this),1)}function Oo(e){var t=e.id,n,r=this._citationItems.map(function(e){return e.id});return n=r.indexOf(t)>=0?this._citationItems[r.indexOf(t)]:new So(t),n.fillFromObject(e),a(wo,this,Ao).call(this,n),1}function ko(e){if(!Object.hasOwnProperty.call(e,`data`))return console.error(`Invalid citation object`),0;var t=this._citationItems.map(function(e){return e.id}),n=e.data.key,r=t.indexOf(n)>=0?this._citationItems[t.indexOf(n)]:new So(n);return r.fillFromObject(e),a(wo,this,Ao).call(this,r),1}function Ao(e){var t=this._citationItems.map(function(e){return e.id});return t.indexOf(e.id)>=0?(this._citationItems[t.indexOf(e.id)]=e,this):(this._citationItems.push(e),this)}function jo(e){var t=this;return Object.keys(e).forEach(function(n){Object.hasOwnProperty.call(e,n)&&(t._properties[n]=e[n])},this),this}function Mo(e){if(Object.hasOwnProperty.call(e,`uris`)&&e.uris.length){var t=e.uris[0].lastIndexOf(`/`);return e.uris[0].slice(t+1)}return e.id}function No(){return Math.random().toString(36).substring(2,15)}var Po={_:new Set},Fo=new WeakMap,Io=new WeakMap,Lo=new WeakMap,Ro=new WeakMap,zo=new WeakSet,Bo=function(){function e(){l(this,e),p(this,zo),d(this,Fo,void 0),d(this,Io,void 0),d(this,Lo,void 0),d(this,Ro,void 0),f(Fo,this,null),f(Io,this,window.Asc.plugin.button),f(Lo,this,Asc.plugin.onThemeChanged),f(Ro,this,Asc.plugin.onTranslate)}return h(e,[{key:`show`,value:function(e,t){var n=this;u(Fo,this)&&a(zo,this,Ho).call(this),f(Fo,this,new window.Asc.PluginWindow);var r={name:`Zotero`,url:`info-window.html`,description:window.Asc.plugin.tr(e),isVisual:!0,buttons:[{text:window.Asc.plugin.tr(`Yes`),primary:!0,isViewer:!1},{text:window.Asc.plugin.tr(`No`),primary:!1}],isModal:!1,EditorsSupport:[`word`],size:[380,240],isViewer:!0,isDisplayedInViewer:!1,isInsideMode:!1};return a(zo,this,Vo).call(this,r,t,`default`),u(Fo,this).show(r),new Promise(function(e,t){window.Asc.plugin.button=function(t,r){e(t===0),a(zo,n,Ho).call(n)}})}},{key:`showEditWindow`,value:function(e){var t=this;u(Fo,this)&&a(zo,this,Ho).call(this),f(Fo,this,new window.Asc.PluginWindow);var n={name:`Zotero`,url:`edit-window.html`,description:window.Asc.plugin.tr(`Edit citation`),isVisual:!0,buttons:[{text:window.Asc.plugin.tr(`Save`),primary:!0,isViewer:!1},{text:window.Asc.plugin.tr(`Cancel`),primary:!1}],isModal:!1,EditorsSupport:[`word`],size:[380,150],isViewer:!0,isDisplayedInViewer:!1,isInsideMode:!1};return a(zo,this,Vo).call(this,n,e,`default`),u(Fo,this).show(n),new Promise(function(e,n){window.Asc.plugin.button=function(){var n=s(E().m(function n(r,i){var o;return E().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,new Promise(function(e){if(!u(Fo,t)){e(null);return}u(Fo,t).attachEvent(`onSaveFields`,e),u(Fo,t).command(`onClickSave`)});case 1:o=n.v,e(r===0?o:null),a(zo,t,Ho).call(t);case 2:return n.a(2)}},n)}));return function(e,t){return n.apply(this,arguments)}}()})}},{key:`showInfoWindow`,value:function(e,t,n){var r=this;u(Fo,this)&&a(zo,this,Ho).call(this),typeof n!=`string`&&(n=`warning`),f(Fo,this,new window.Asc.PluginWindow);var i={name:`Zotero`,url:`info-window.html`,description:window.Asc.plugin.tr(e),isVisual:!0,buttons:[{text:window.Asc.plugin.tr(`OK`),primary:!0,isViewer:!1}],isModal:!1,EditorsSupport:[`word`],size:[350,76],isViewer:!0,isDisplayedInViewer:!1,isInsideMode:!1};return a(zo,this,Vo).call(this,i,window.Asc.plugin.tr(t),n),u(Fo,this).show(i),new Promise(function(e,t){window.Asc.plugin.button=function(t,n){e(t===0),a(zo,r,Ho).call(r)}})}}])}();function Vo(e,t,n){var r=this;u(Fo,this)&&(f(Io,this,window.Asc.plugin.button),f(Lo,this,Asc.plugin.onThemeChanged),f(Ro,this,Asc.plugin.onTranslate),window.Asc.plugin.onThemeChanged=function(e){var t;(t=u(Fo,r))==null||t.command(`onThemeChanged`,e),u(Lo,r).call(r,e)},window.Asc.plugin.onTranslate=function(){var e;(e=u(Fo,r))==null||e.command(`onTranslate`),u(Ro,r).call(r)},u(Fo,this).attachEvent(`onWindowReady`,function(){if(n===`warning`){var e;(e=u(Fo,r))==null||e.command(`onWarning`,t)}else if(n===`success`){var i;(i=u(Fo,r))==null||i.command(`onSuccess`,t)}else{var a;(a=u(Fo,r))==null||a.command(`onAttachedContent`,t)}}),u(Fo,this).attachEvent(`onUpdateHeight`,function(t){Asc.plugin.executeMethod(`ResizeWindow`,[u(Fo,r)?.id,[e.size[0]-2,t]],function(){})}))}function Ho(){u(Fo,this)&&(u(Fo,this).close(),f(Fo,this,null)),window.Asc.plugin.button=u(Io,this),window.Asc.plugin.onThemeChanged=u(Lo,this)}function Uo(e){if(e==null)return``;var t=String(e).trim(),n=t.search(/[?#]/);n!==-1&&(t=t.slice(0,n));var r=t.lastIndexOf(`/`);return r!==-1&&(t=t.slice(r+1)),t}function Wo(e){var t=[],n=function(e){var n=Uo(e);n&&t.indexOf(n)===-1&&t.push(n)};return e?(n(e.id),e.itemData&&n(e.itemData.id),Array.isArray(e.uris)&&e.uris.forEach(n),t):t}var Go=new WeakMap,Ko=new WeakMap,qo=new WeakMap,$=new WeakSet,Jo=function(){function e(t,n,r){l(this,e),p(this,$),d(this,Go,void 0),d(this,Ko,new Map),d(this,qo,null),this._bibPlaceholderIfEmpty=`Please insert some citation into the document.`,this._citPrefixNew=`ZOTERO_ITEM`,this._citSuffixNew=`CSL_CITATION`,this._citPrefix=`ZOTERO_CITATION`,this._bibPrefixNew=`ZOTERO_BIBL`,this._bibSuffixNew=`CSL_BIBLIOGRAPHY`,this._bibPrefix=`ZOTERO_BIBLIOGRAPHY`,this._sdk=r,this._localesManager=t,this._cslStylesManager=n,this._storage=new yo,this._formatter,this.citationDocService=new eo(this._citPrefixNew,this._citSuffixNew,this._bibPrefixNew,this._bibSuffixNew),f(Go,this,new Bo)}return h(e,[{key:`getUsedItemKeys`,value:function(){var e=s(E().m(function e(){var t,n,r;return E().w(function(e){for(;;)switch(e.n){case 0:return t=this,n=new Set,e.n=1,this.citationDocService.getAddinZoteroFields();case 1:return r=e.v,r.forEach(function(e){if(!(e.Value.indexOf(t._citPrefixNew)===-1&&e.Value.indexOf(t._citPrefix)===-1)){var r;try{r=a($,t,ps).call(t,e)}catch(e){console.error(e);return}!r||!Array.isArray(r.citationItems)||r.citationItems.forEach(function(e){Wo(e).forEach(function(e){n.add(e)})})}}),e.a(2,n)}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`getCurrentField`,value:function(){var e=s(E().m(function e(){return E().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.getCurrentField())}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`saveAsText`,value:function(){var e=s(E().m(function e(){var t;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.citationDocService.saveAsText();case 1:return t=e.v,t&&this.showSuccessMessage(`All active Zotero citations and Bibliography have been replaced.`),e.a(2,t)}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`insertSelectedCitations`,value:function(){var e=s(E().m(function e(t){var n=this,r,i,o,s,c;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=this,e.p=1,e.n=2,a($,this,ms).call(this);case 2:return e.n=3,a($,this,os).call(this);case 3:e.n=5;break;case 4:throw e.p=4,c=e.v,c;case 5:for(o in i=new To(``),t)s=t[o],i.fillFromObject(s);return e.a(2,a($,this,us).call(this,t).then(function(e){return e.forEach(function(e){i.fillFromObject(e)}),n._storage.addCslCitation(i),a($,r,cs).call(r,i)}))}},e,this,[[1,4]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`insertSelectedCitationsToCurrentField`,value:function(){var e=s(E().m(function e(t,n){var r=this,i,o,s,c,l,u,d,f,p;return E().w(function(e){for(;;)switch(e.n){case 0:for(c in i=a($,this,ps).call(this,n),o=i.citationID,s=new To(``),s.fillFromObject(i),t)l=t[c],s.fillFromObject(l);return e.n=1,a($,this,us).call(this,t);case 1:return u=e.v,u.forEach(function(e){s.fillFromObject(e)}),e.n=2,a($,this,ms).call(this,s.toJSON(),o);case 2:if(d=e.v,f=d.fieldsWithCitations,a($,this,bs).call(this),p=f.find(function(e){return e.cslCitation.citationID===o})?.cslCitation,p){e.n=3;break}throw Error(`Citation not found`);case 3:return e.a(2,a($,this,ls).call(this,p).then(function(e){return n.Content=e,n.Value=r._citPrefixNew+` `+r._citSuffixNew+JSON.stringify(p.toJSON()),n}))}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`insertBibliography`,value:function(){var e=s(E().m(function e(){var t,n,r,i,o,s,c,l;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,ms).call(this);case 1:return t=e.v,n=t.fieldsWithCitations,r=t.bibFieldValue,i=t.bibField,o=n.length===0,e.n=2,a($,this,os).call(this);case 2:if(!i){e.n=4;break}return e.n=3,a($,this,gs).call(this,o,i);case 3:return c=e.v,s=[c],e.a(2,this.citationDocService.updateAddinFields(s).then(function(e){return e?e[0]:``}));case 4:return e.a(2,a($,this,hs).call(this,o,r));case 5:e.n=7;break;case 6:throw e.p=6,l=e.v,l;case 7:return e.a(2)}},e,this,[[0,6]])}));function t(){return e.apply(this,arguments)}return t}()},{key:`moveCursorToField`,value:function(){var e=s(E().m(function e(t,n){return E().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.moveCursorToField(t,n))}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`moveCursorOutsideField`,value:function(){var e=s(E().m(function e(t,n){return E().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.moveCursorOutsideField(t,n))}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`moveCursorRight`,value:function(){var e=s(E().m(function e(){return E().w(function(e){for(;;)switch(e.n){case 0:return e.a(2,this.citationDocService.moveCursorRight())}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:`updateCslItems`,value:function(){var e=s(E().m(function e(t,n){var r,i,o,s,c,l,u,d,f,p;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,ms).call(this);case 1:return r=e.v,i=r.fieldsWithCitations,o=r.bibField,s=i.length===0,e.n=2,a($,this,os).call(this);case 2:if(c=[],t===void 0&&(l=this._cslStylesManager.getLastUsedFormat(),l===`numeric`&&(t=!0)),u=!!(n&&n.skipCitations),d=!!(n&&n.skipBibliography),!(!u&&typeof t==`boolean`)){e.n=4;break}return e.n=3,a($,this,_s).call(this,i,t);case 3:c=e.v;case 4:if(!(!d&&o)){e.n=6;break}return f=c,e.n=5,a($,this,gs).call(this,s,o);case 5:f.push.call(f,e.v);case 6:if(!(c&&c.length)){e.n=7;break}return e.a(2,this.citationDocService.updateAddinFields(c));case 7:e.n=9;break;case 8:throw e.p=8,p=e.v,p;case 9:return e.a(2)}},e,this,[[0,8]])}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`updateCslItemsInNotes`,value:function(){var e=s(E().m(function e(t){var n,r,i,o,s,c,l,u;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,ms).call(this);case 1:return n=e.v,r=n.fieldsWithCitations,i=n.bibField,o=r.length===0,e.n=2,a($,this,os).call(this);case 2:return e.n=3,a($,this,_s).call(this,r,!1);case 3:if(s=e.v,!(s&&s.length)){e.n=4;break}return e.n=4,this.citationDocService.convertNotesStyle(s,t);case 4:if(!i){e.n=6;break}return e.n=5,a($,this,gs).call(this,o,i);case 5:return l=e.v,c=[l],e.n=6,this.citationDocService.updateAddinFields(c);case 6:e.n=8;break;case 7:throw e.p=7,u=e.v,u;case 8:return e.a(2)}},e,this,[[0,7]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`prepareRefreshCslItems`,value:function(){var e=s(E().m(function e(t,n){var r,i,o,s,c,l,u,d;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a($,this,ms).call(this);case 1:return r=e.v,i=r.fieldsWithCitations,o=r.bibField,s=i.length===0,e.n=2,a($,this,os).call(this,{refreshItems:!0,onProgress:n});case 2:if(c=[],l=!!(t&&t.skipCitations),u=!!(t&&t.skipBibliography),l){e.n=4;break}return e.n=3,a($,this,_s).call(this,i,!1,!1,n);case 3:c=e.v;case 4:if(!(!u&&o)){e.n=6;break}return d=c,e.n=5,a($,this,gs).call(this,s,o);case 5:d.push.call(d,e.v);case 6:return e.a(2,c)}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`applyRefreshCslItems`,value:function(){var e=s(E().m(function e(t){return E().w(function(e){for(;;)switch(e.n){case 0:if(!(t&&t.length)){e.n=1;break}return e.a(2,this.citationDocService.updateAddinFields(t));case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`prepareRefreshCslItemsInNotes`,value:function(){var e=s(E().m(function e(t,n){var r,i,o,s,c,l,u,d;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a($,this,ms).call(this);case 1:return r=e.v,i=r.fieldsWithCitations,o=r.bibField,s=i.length===0,e.n=2,a($,this,os).call(this,{refreshItems:!0,onProgress:n});case 2:return e.n=3,a($,this,_s).call(this,i,!1,!1,n);case 3:if(c=e.v,!o){e.n=5;break}return e.n=4,a($,this,gs).call(this,s,o);case 4:d=e.v,u=[d],e.n=6;break;case 5:u=[];case 6:return l=u,e.a(2,{updatedFields:c,bibFields:l,notesStyle:t})}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`applyRefreshCslItemsInNotes`,value:function(){var e=s(E().m(function e(t){var n,r,i;return E().w(function(e){for(;;)switch(e.n){case 0:if(n=t.updatedFields,r=t.bibFields,i=t.notesStyle,!(n&&n.length)){e.n=1;break}return e.n=1,this.citationDocService.convertNotesStyle(n,i);case 1:if(!(r&&r.length)){e.n=2;break}return e.n=2,this.citationDocService.updateAddinFields(r);case 2:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`updateItem`,value:function(){var e=s(E().m(function e(t,n){var r,i,o,s;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,ms).call(this,t,t.citationID);case 1:return r=e.v,i=r.fieldsWithCitations,r.bibField,i.length,e.n=2,a($,this,os).call(this);case 2:return t&&(i=i.filter(function(e){return e.cslCitation.citationID===t.citationID})),e.n=3,a($,this,_s).call(this,i,!0);case 3:if(o=e.v,!(n&&o&&o.length)){e.n=4;break}return e.a(2,this.citationDocService.updateAddinFieldsInNotes(o));case 4:if(!(o&&o.length)){e.n=5;break}return e.a(2,this.citationDocService.updateAddinFields(o));case 5:e.n=7;break;case 6:throw e.p=6,s=e.v,s;case 7:return e.a(2)}},e,this,[[0,6]])}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`switchingBetweenNotesAndText`,value:function(){var e=s(E().m(function e(t){var n,r,i,o,s,c,l,u;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,ms).call(this);case 1:return n=e.v,r=n.fieldsWithCitations,i=n.bibField,o=r.length===0,e.n=2,a($,this,os).call(this);case 2:return e.n=3,a($,this,_s).call(this,r,!0);case 3:if(s=e.v,!(s&&s.length)){e.n=6;break}if(!t){e.n=5;break}return e.n=4,this.citationDocService.convertTextToNotes(s,t);case 4:e.n=6;break;case 5:return e.n=6,this.citationDocService.convertNotesToText(s);case 6:if(!i){e.n=8;break}return e.n=7,a($,this,gs).call(this,o,i);case 7:return l=e.v,c=[l],e.n=8,this.citationDocService.updateAddinFields(c);case 8:e.n=10;break;case 9:throw e.p=9,u=e.v,u;case 10:return e.a(2)}},e,this,[[0,9]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`convertNotesStyle`,value:function(){var e=s(E().m(function e(t){var n,r,i,o;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a($,this,ms).call(this);case 1:return n=e.v,r=n.fieldsWithCitations,e.n=2,a($,this,os).call(this);case 2:return e.n=3,a($,this,_s).call(this,r,!1,!0);case 3:if(i=e.v,!(!i||!i.length)){e.n=4;break}return e.a(2);case 4:return e.n=5,this.citationDocService.convertNotesStyle(i,t);case 5:e.n=7;break;case 6:throw e.p=6,o=e.v,o;case 7:return e.a(2)}},e,this,[[0,6]])}));function t(t){return e.apply(this,arguments)}return t}()},{key:`showEditCitationWindow`,value:function(){var e=s(E().m(function e(t){var n,r;return E().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2,null);case 1:return n=a($,this,ps).call(this,t),e.n=2,u(Go,this).showEditWindow(n);case 2:if(r=e.v,r){e.n=3;break}return e.a(2,null);case 3:return e.a(2,r)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`repairBrokenCitations`,value:function(){var e=s(E().m(function e(){var t,n,r,i,o,s,c,l,u,d,f,p,m,h;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,this.citationDocService.scanForBrokenFields();case 1:t=e.v,n=0,r=0,i=g(t),e.p=2,i.s();case 3:if((o=i.n()).done){e.n=7;break}s=o.value,c=void 0;try{c=a($,this,ps).call(this,{Value:s.rawValue,FieldId:``,Content:``})}catch(e){console.error(`Failed to parse broken field JSON:`,e)}if(!(!c||M(c)!==`object`)){e.n=4;break}return r++,e.a(3,6);case 4:return l=/ZOTERO_BIBL/i.test(s.rawValue),u=l?this._bibPrefixNew:this._citPrefixNew,d=l?this._bibSuffixNew:this._citSuffixNew,f=l?X(`Bibliography`):c.properties&&c.properties.plainCitation||X(`Citation`),p={FieldId:``,Value:u+` `+d+` `+JSON.stringify(c),Content:f},e.n=5,this.citationDocService.repairBrokenField(s,p);case 5:m=e.v,m?n++:r++;case 6:e.n=3;break;case 7:e.n=9;break;case 8:e.p=8,h=e.v,i.e(h);case 9:return e.p=9,i.f(),e.f(9);case 10:return e.a(2,{repaired:n,failed:r})}},e,this,[[2,8,9,10]])}));function t(){return e.apply(this,arguments)}return t}()},{key:`showWarningMessage`,value:function(){var e=s(E().m(function e(t){return E().w(function(e){for(;;)switch(e.n){case 0:u(Go,this).showInfoWindow(`Warning!`,t);case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:`showSuccessMessage`,value:function(){var e=s(E().m(function e(t){return E().w(function(e){for(;;)switch(e.n){case 0:u(Go,this).showInfoWindow(`Success!`,t,`success`);case 1:return e.a(2)}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}])}();function Yo(){var e=this._cslStylesManager.getLastUsedStyleIdOrDefault(),t=this._cslStylesManager.cached(e);return typeof t!=`string`||t===``?!0:/\bvariable\s*=\s*"[^"]*\babstract\b[^"]*"/.test(t)}function Xo(e){!e||!Array.isArray(e.citationItems)||e.citationItems.forEach(function(e){e&&e.itemData&&Object.hasOwnProperty.call(e.itemData,`abstract`)&&delete e.itemData.abstract})}function Zo(e){var t=e.toJSON();return a($,this,Yo).call(this)||a($,this,Xo).call(this,t),t}function Qo(e,t){var n=e.getProperty(`userID`),r=e.getProperty(`groupID`);if(n)return{id:t,fetchKey:t,userID:n};if(r)return{id:t,fetchKey:t,groupID:r};var i=e.toJSON();if(!Array.isArray(i.uris))return null;for(var a=null,o=0;o`,o=``;t[0][`second-field-align`]?r.indexOf(i)===0&&r.endsWith(o)&&(r=i+r.substring(i.length,r.length-o.length).trim()+o):(r=r.replace(/<\/?div[^>]*>/g,``),r=`

`+r+`

`),window.Asc.scope.editorVersion<9004e3&&(r+=` -`),e.push(r)}var s=e.join(``).trim();return Asc.scope.bibStyle=t[0],s}catch(e){if(!1===this._cslStylesManager.isLastUsedStyleContainBibliography())this.showWarningMessage(`Style does not describe the bibliography`);else throw console.error(e),`Failed to apply this style.`;return``}}function Ao(e){var t=document.createDocumentFragment(),n=document.createElement(`div`),r=this._storage.getCitationsPre(e.citationID),i=this._storage.getCitationsPost(e.citationID),o=this._storage.getAllCitationsInJson();this._formatter.rebuildProcessorState(o);var s=this._formatter.processCitationCluster(e.toJSON(),r,i),c=a($,this,Ro).call(this,s[1][0][1]);return t.appendChild(n),n.innerHTML=c,e.setPlainCitation(n.innerText),c}function jo(e){var t,n=e.Value.indexOf(`{`),r=e.Value.lastIndexOf(`}`);if(n!==-1){var i=e.Value.slice(n,r+1);t=JSON.parse(i)}return t}function Mo(e,t){var n=this;return this._storage.clear(),oo.resetUsedIDs(),this.citationDocService.getAddinZoteroFields().then(function(r){var i=0,o=` `,s=r.find(function(e){return e.Value.indexOf(n._bibPrefixNew)!==-1||e.Value.indexOf(n._bibPrefix)!==-1});if(s){var c=a($,n,jo).call(n,s);A(c)===`object`&&Object.keys(c).length>0&&(o=JSON.stringify(c))}var l=r.filter(function(e){return e.Value.indexOf(n._citPrefixNew)!==-1||e.Value.indexOf(n._citPrefix)!==-1}).map(function(r){var o=a($,n,jo).call(n,r),s=``;r.Value.indexOf(n._citPrefix)===-1&&(s=o.citationID);var c=new oo(s);return e&&t===s?i+=c.fillFromObject(e):i+=c.fillFromObject(o),n._storage.addCslCitation(c),{field:C({},r),cslCitation:c}});return{bibField:s,bibFieldValue:o,fieldsWithCitations:l}})}function No(e,t){var n=a($,this,ko).call(this);if(e&&(n=Y(this._bibPlaceholderIfEmpty)),this._cslStylesManager.isLastUsedStyleContainBibliography())return this.citationDocService.addBibliography(n,t);throw`The current bibliographic style does not describe the bibliography`}function Po(e,t){return e?t.Content=Y(this._bibPlaceholderIfEmpty):t.Content=a($,this,ko).call(this),t}function Fo(e,t,n){return Io.apply(this,arguments)}function Io(){return Io=s(w().m(function e(t,n,r){var i,o,s,c,l,d,f,p,m,h,g,_,v,y,b,x,S,C,T;return w().w(function(e){for(;;)switch(e.n){case 0:i=document.createDocumentFragment(),o=document.createElement(`div`),i.appendChild(o),s=[],c=t.length-1;case 1:if(!(c>=0)){e.n=7;break}if(l=!!r,d=t[c],f=d.field,p=d.cslCitation,m=this._storage.getCitationsPre(p.citationID),h=this._storage.getCitationsPost(p.citationID),g=this._storage.getAllCitationsInJson(),this._formatter.rebuildProcessorState(g),_=this._formatter.processCitationCluster(p.toJSON(),m,h),v=a($,this,Ro).call(this,_[1][0][1]),o.innerHTML=v,y=p.getPlainCitation(),b=f.Content,y===``&&(y=b),x=o.innerText,!p.getDoNotUpdate()){e.n=2;break}return e.a(3,6);case 2:if(!(y!==b&&!n)){e.n=4;break}return S=`

`+Y(`You have modified this citation since Zotero generated it. Do you want to keep your modifications and prevent future updates?`)+`

`+Y(`Clicking „Yes“ will prevent Zotero from updating this citation if you add additional citations, switch styles, or modify the item to which it refers. Clicking „No“ will erase your changes.`)+`

`+Y(`Original:`)+` `+x+`

`+Y(`Modified:`)+` `+b+`

`,e.n=3,u(wo,this).show(`Saving custom edits`,S);case 3:C=e.v,C?(p.setDoNotUpdate(),delete f.Content):(f.Content=v,p.setPlainCitation(x)),l=!0,e.n=5;break;case 4:(x!==b||y!==b||y!==x)&&(l=!0),f.Content=v,p.setPlainCitation(x);case 5:p&&(T=this._citPrefixNew+` `+this._citSuffixNew+JSON.stringify(p.toJSON()),f.Value!==T&&(l=!0),f.Value=T),l&&s.push(f);case 6:c--,e.n=1;break;case 7:return e.a(2,s)}},e,this)})),Io.apply(this,arguments)}function Lo(){var e=this,t=[];this._storage.forEachItem(function(e,n){t.push(n)}),this._formatter=new CSL.Engine({retrieveLocale:function(t){return e._localesManager.getLocale(t)?e._localesManager.getLocale(t):e._localesManager.getLocale()},retrieveItem:function(t){var n=e._storage.getItem(t),r=e._storage.getItemIndex(t);return n?n.toFlatJSON(r):null}},this._cslStylesManager.cached(this._cslStylesManager.getLastUsedStyleIdOrDefault()),this._localesManager.getLastUsedLanguage(),!0),t.length&&this._formatter.updateItems(t)}function Ro(e){return e.replace(/\u00A0/g,` `).replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`)}var zo=function(){function e(){l(this,e)}return h(e,null,[{key:`getCursorPosition`,value:function(){return new Promise(function(e){Asc.plugin.callCommand(function(){var e=Api.GetDocument(),t=0;if(!e)return t;var n=e.GetCurrentRun();if(!n)return t;var r=n.GetRange(0,0);return r?r.GetEndPos():t},!1,!1,e)})}},{key:`setCursorPosition`,value:function(e){return new Promise(function(t){var n=!1,r=!1;Asc.scope.pos=e,Asc.plugin.callCommand(function(){Api.GetDocument().MoveCursorToPos(Asc.scope.pos)},r,n,t)})}}])}(),Bo={getStyleInfo:function(e,t){var n=new DOMParser().parseFromString(t,`text/xml`),r={categories:{fields:[],format:``},dependent:0,href:``,name:e,title:``,updated:``},i=n.querySelector(`info title`);i&&(r.title=i.textContent);var a=n.querySelector(`info link[rel="self"]`);if(a){var o=a.getAttribute(`href`);o&&(r.href=o)}var s=n.querySelector(`info link[rel="independent-parent"]`);if(s){var c=s.getAttribute(`href`);c&&(r.parent=c),r.dependent=1}var l=n.querySelector(`info updated`);l&&(r.updated=l.textContent);var u=n.querySelector(`info category[citation-format]`);if(u){var d=u.getAttribute(`citation-format`);d&&(r.categories.format=d)}var f=n.querySelectorAll(`info category[field]`);return f&&f.forEach(function(e){var t=e.getAttribute(`field`);t&&r.categories.fields.push(t)}),r},getCitationFormat:function(e){var t=new DOMParser().parseFromString(e,`text/xml`).querySelector(`info category[citation-format]`);if(!t)throw Error(`Citation format not found`);var n=t.getAttribute(`citation-format`);if(!n)throw Error(`Citation format not found`);switch(n){case`note`:case`numeric`:case`author`:case`author-date`:case`label`:return n}throw Error(`Invalid citation format`)},isStyleContainBibliography:function(e){return e.indexOf(`-1}};function Vo(){this._customStyleNamesKey=`zoteroCustomStyleNames`,this._customStylesKey=`zoteroCustomStyles`}Vo.prototype.getStyleNames=function(){var e=localStorage.getItem(this._customStyleNamesKey);return e?JSON.parse(e):[]},Vo.prototype._getStyles=function(){var e=localStorage.getItem(this._customStylesKey);return e?JSON.parse(e):[]},Vo.prototype.getStyle=function(e){var t=this.getStyleNames().indexOf(e);return t===-1?null:this._getStyles()[t]},Vo.prototype.getStylesInfo=function(){for(var e=this.getStyleNames(),t=this._getStyles(),n=[],r=0;r1024*1024&&n(`Maximum file size is 1 MB.`),t(r)}).then(function(n){return t._readCSLFile(e).then(function(e){return t._defaultStyles.indexOf(n)===-1&&t._defaultStyles.push(n),t._customStylesStorage.setStyle(n,e)})})},Ho.prototype.getLastUsedFormat=function(){var e=localStorage.getItem(this._lastFormatKey);switch(e){case`note`:case`numeric`:case`author`:case`author-date`:case`label`:return e}return`numeric`},Ho.prototype.getLastUsedNotesStyle=function(){var e=localStorage.getItem(this._lastNotesStyleKey);return e===`footnotes`||e===`endnotes`?e:`footnotes`},Ho.prototype.getLastUsedStyleId=function(){return localStorage.getItem(this._lastStyleKey)||null},Ho.prototype.getLastUsedStyleIdOrDefault=function(){return localStorage.getItem(this._lastStyleKey)||`ieee`},Ho.prototype.getStyle=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this;return Promise.resolve(e).then(function(e){if(n._cache[e])return n._cache[e];if(n._customStylesStorage.getStyleNames().indexOf(e)!==-1)return n._customStylesStorage.getStyle(e);var t=n._STYLES_LOCAL+e+`.csl`;if(n._isOnlineAvailable)t=n._STYLES_URL+e;else if(n._defaultStyles.indexOf(e)===-1)throw`The style is not available in the local version of the plugin.`;return fetch(t).then(function(e){return e.text()})}).then(function(t){if(t&&!n._isValidCSL(t)&&n._isOnlineAvailable){var r=Bo.getStyleInfo(e,t);if(r&&r.dependent>0&&r.parent)return fetch(r.parent).then(function(e){return e.text()})}return t}).then(function(r){var i=r&&Bo.getCitationFormat(r)||`numeric`,a={content:r,styleFormat:i};return r&&t&&n._saveLastUsedStyle(e,r,i),a})},Ho.prototype.getStylesInfo=function(){var e=this;return Promise.all([this._getStylesJson(),this._customStylesStorage.getStylesInfo()]).then(function(t){var n=e.getLastUsedStyleId()||`ieee`,r=[],i=e._customStylesStorage.getStyleNames(),a=t[0],o=t[1];return e._isDesktopAvailable&&!e._isOnlineAvailable&&(a=a.filter(function(t){return e._defaultStyles.indexOf(t.name)>=0||t.name==n})),o.forEach(function(t){r.push(t),e._defaultStyles.indexOf(t.name)===-1&&e._defaultStyles.push(t.name)}),a.forEach(function(e){i.indexOf(e.name)===-1&&r.push(e)}),r.sort(function(e,t){return e.name.localeCompare(t.name)}),r})},Ho.prototype._getStylesJson=function(){var e=this._STYLES_JSON_LOCAL;return this._isOnlineAvailable&&(e=this._STYLES_JSON_URL),fetch(e).then(function(e){return e.json()})},Ho.prototype.cached=function(e){return Object.hasOwnProperty.call(this._cache,e)?this._cache[e]:null},Ho.prototype.isLastUsedStyleContainBibliography=function(){return localStorage.getItem(this._lastUsedStyleContainBibliographyKey)!==`false`},Ho.prototype.isStyleDefault=function(e){return this._defaultStyles.indexOf(e)>=0},Ho.prototype._isValidCSL=function(e){return e.indexOf(`-1&&e.indexOf(`-1&&e.indexOf(`-1&&e.indexOf(`citation`)>-1},Ho.prototype._readCSLFile=function(e){var t=this;return new Promise(function(n,r){var i=new FileReader;i.onload=function(e){var i=e.target?String(e.target.result):``;if(!t._isValidCSL(i)){r(`The file is not a valid CSL file`);return}n(i)},i.onerror=function(){r(`Failed to read file`)},i.readAsText(e)})},Ho.prototype._saveLastUsedStyle=function(e,t,n){this._cache[e]=t,localStorage.setItem(this._lastStyleKey,e),localStorage.setItem(this._lastFormatKey,n);var r=Bo.isStyleContainBibliography(t);localStorage.setItem(this._lastUsedStyleContainBibliographyKey,r.toString())},Ho.prototype.saveLastUsedNotesStyle=function(e){localStorage.setItem(this._lastNotesStyleKey,e)},Ho.prototype.setDesktopApiAvailable=function(e){this._isDesktopAvailable=e},Ho.prototype.setRestApiAvailable=function(e){this._isOnlineAvailable=e};function Uo(){this._isOnlineAvailable=!1,this._isDesktopAvailable=!1,this._LOCALES_URL=`https://raw.githubusercontent.com/citation-style-language/locales/master/`,this._LOCALES_PATH=`./resources/csl/locales/`,this._lastLanguageKey=`zoteroLang`,this._selectedLanguage=null,this._cache={}}Uo.prototype.loadLocale=function(e){var t=this;if(this._selectedLanguage=e,this._cache[e])return Promise.resolve(this._cache[e]);var n=this._getLocalesUrl()+`locales-`+e+`.xml`;return fetch(n).catch(function(n){return console.error(`Failed to load locale:`,n),fetch(t._LOCALES_PATH+`locales-`+e+`.xml`)}).then(function(e){return e.text()}).then(function(n){return t._cache[e]=n,n})},Uo.prototype.getLastUsedLanguage=function(){return this._selectedLanguage=this._selectedLanguage||localStorage.getItem(this._lastLanguageKey)||`en-US`,this._selectedLanguage},Uo.prototype.getLocale=function(e){return e?this._cache[e]?this._cache[e]:null:this._selectedLanguage&&this._cache[this._selectedLanguage]?this._cache[this._selectedLanguage]:null},Uo.prototype.saveLastUsedLanguage=function(e){this._selectedLanguage=e,localStorage.setItem(this._lastLanguageKey,e)},Uo.prototype._getLocalesUrl=function(){return this._isOnlineAvailable?this._LOCALES_URL:this._LOCALES_PATH},Uo.prototype.setDesktopApiAvailable=function(e){this._isDesktopAvailable=e},Uo.prototype.setRestApiAvailable=function(e){this._isOnlineAvailable=e};function Wo(e,t){if(this._router=e,this._displayNoneClass=t,this._saveBtn=new mi(`saveSettingsBtn`,{variant:`primary`}),this._cancelBtn=new mi(`cancelBtn`,{variant:`secondary`}),this._styleSelect=new ia(`styleSelectList`,{placeholder:`Enter style name`,sortable:!0}),this._styleSelectListOther=new ia(`styleSelectedListOther`,{placeholder:`Enter style name`,searchable:!0}),this._notesStyleWrapper=document.getElementById(`notesStyle`),!this._notesStyleWrapper)throw Error(`notesStyleWrapper not found`);if(this._footNotes=new Di(`footNotes`,{label:`Footnotes`}),this._endNotes=new Di(`endNotes`,{label:`Endnotes`}),this._cslFileInput=document.getElementById(`cslFileInput`),!this._cslFileInput)throw Error(`cslFileInput not found`);this._languageSelect=new ia(`styleLangList`,{placeholder:`Select language`}),this._cslStylesManager=new Ho(`zoteroStyleId`),this._localesManager=new Uo,this._selectLists=[],this._onChangeState=function(e,t){},this._styleMessage=new pi(`styleMessage`,{type:`error`}),this._langMessage=new pi(`langMessage`,{type:`error`}),this._LANGUAGES=[[`af-ZA`,`Afrikaans`],[`ar`,`Arabic`],[`bg-BG`,`Bulgarian`],[`ca-AD`,`Catalan`],[`cs-CZ`,`Czech`],[`cy-GB`,`Welsh`],[`da-DK`,`Danish`],[`de-AT`,`German (Austria)`],[`de-CH`,`German (Switzerland)`],[`de-DE`,`German (Germany)`],[`el-GR`,`Greek`],[`en-GB`,`English (UK)`],[`en-US`,`English (US)`],[`es-CL`,`Spanish (Chile)`],[`es-ES`,`Spanish (Spain)`],[`es-MX`,`Spanish (Mexico)`],[`et-EE`,`Estonian`],[`eu`,`Basque`],[`fa-IR`,`Persian`],[`fi-FI`,`Finnish`],[`fr-CA`,`French (Canada)`],[`fr-FR`,`French (France)`],[`he-IL`,`Hebrew`],[`hr-HR`,`Croatian`],[`hu-HU`,`Hungarian`],[`id-ID`,`Indonesian`],[`is-IS`,`Icelandic`],[`it-IT`,`Italian`],[`ja-JP`,`Japanese`],[`km-KH`,`Khmer`],[`ko-KR`,`Korean`],[`la`,`Latin`],[`lt-LT`,`Lithuanian`],[`lv-LV`,`Latvian`],[`mn-MN`,`Mongolian`],[`nb-NO`,`Norwegian (Bokmål)`],[`nl-NL`,`Dutch`],[`nn-NO`,`Norwegian (Nynorsk)`],[`pl-PL`,`Polish`],[`pt-BR`,`Portuguese (Brazil)`],[`pt-PT`,`Portuguese (Portugal)`],[`ro-RO`,`Romanian`],[`ru-RU`,`Russian`],[`sk-SK`,`Slovak`],[`sl-SI`,`Slovenian`],[`sr-RS`,`Serbian`],[`sv-SE`,`Swedish`],[`th-TH`,`Thai`],[`tr-TR`,`Turkish`],[`uk-UA`,`Ukrainian`],[`vi-VN`,`Vietnamese`],[`zh-CN`,`Chinese (PRC)`],[`zh-TW`,`Chinese (Taiwan)`]],this._bNumFormat=!1,this._stateSettings={style:``,notesStyle:`footnotes`,styleFormat:`numeric`}}Wo.prototype.getLocalesManager=function(){return this._localesManager},Wo.prototype.getStyleManager=function(){return this._cslStylesManager},Wo.prototype.getLocale=function(){return this._localesManager.getLocale()},Wo.prototype.getLastUsedStyleId=function(){return this._cslStylesManager.getLastUsedStyleId()},Wo.prototype.init=function(){var e=this._cslStylesManager.getLastUsedStyleId()||`ieee`,t=this._localesManager.getLastUsedLanguage();this._addEventListeners(),this._languageSelect.addItems(this._LANGUAGES,t);var n=[this._onStyleChange(e),this._localesManager.loadLocale(t),this._loadStyles()];return Promise.all(n)},Wo.prototype.onChangeState=function(e){this._onChangeState=e},Wo.prototype.setDesktopApiAvailable=function(e){this._localesManager.setDesktopApiAvailable(e),this._cslStylesManager.setDesktopApiAvailable(e)},Wo.prototype.setRestApiAvailable=function(e){this._localesManager.setRestApiAvailable(e),this._cslStylesManager.setRestApiAvailable(e)},Wo.prototype._addEventListeners=function(){var e=this;this._saveBtn.subscribe(function(t){if(t.type===`button:click`){var n=e._languageSelect.getSelectedValue();if(n===null){console.error(`No language selected`);return}var r=C({},e._stateSettings),i=[];e._stateSettings.language!==n&&(e._localesManager.saveLastUsedLanguage(n),i.push(e._localesManager.loadLocale(n).catch(function(t){throw console.error(t),e._langMessage.show(Y(`Failed to load language`)),t})));var a=`footnotes`;e._endNotes.getState().checked&&(a=`endnotes`),e._stateSettings.notesStyle!==a&&(e._cslStylesManager.saveLastUsedNotesStyle(a),e._cslStylesManager.getLastUsedFormat()===`note`&&i.push(Promise.resolve()));var o=e._styleSelect.getSelectedValue();e._stateSettings.style!==o&&o!==null&&i.push(e._onStyleChange(o)),i.length?(e._showLoader(),Promise.all(i).then(function(){e._hide(),e._hideLoader();var t={language:n,style:o||`ieee`,notesStyle:a,styleFormat:e._cslStylesManager.getLastUsedFormat()};e._onChangeState(t,r)}).catch(function(t){e._hideLoader()})):e._hide()}}),this._cancelBtn.subscribe(function(t){if(t.type===`button:click`){var n=e._languageSelect.getSelectedValue(),r=e._styleSelect.getSelectedValue();n!==null&&e._localesManager.getLastUsedLanguage()!==n&&e._languageSelect.selectItems(e._localesManager.getLastUsedLanguage(),!0),e._stateSettings.style!==r&&r!==null?(e._styleSelect.selectItems(e._stateSettings.style,!0),e._styleSelectListOther.selectItems(e._stateSettings.style,!0),e._onStyleChange(e._stateSettings.style,!0).then(function(){e._hide()})):e._hide()}}),this._cslFileInput.onchange=function(t){if(t.target instanceof HTMLInputElement){var n=t.target;if(n.files){var r=n.files[0];if(!r){console.error(`No file selected`);return}e._cslStylesManager.addCustomStyle(r).then(function(t){e._addStylesToList([t])}).catch(function(t){console.error(t),e._styleMessage.show(Y(`Invalid CSL style file`))}).finally(function(){e._hideLoader()})}}},this._styleSelect.subscribe(function(t){if(t.type===`selectbox:change`){e._styleSelectListOther.selectItems(t.detail.current.toString(),!0),e._somethingWasChanged(),e._onStyleChange(t.detail.current.toString(),!0);return}else if(t.type!==`selectbox:custom`)return;t.detail.current===`more_styles`&&e._styleSelectListOther.openDropdown()}),e._styleSelectListOther.subscribe(function(t){if(t.type===`selectbox:change`&&t.detail.items){var n=t.detail.items[0];e._styleSelect.addItem(n.value,n.text,!0),e._somethingWasChanged(),e._onStyleChange(n.value,!0)}}),this._languageSelect.subscribe(function(t){t.type===`selectbox:change`&&e._somethingWasChanged()}),this._footNotes.subscribe(function(t){e._somethingWasChanged()}),this._endNotes.subscribe(function(t){e._somethingWasChanged()})},Wo.prototype._hideAllMessages=function(){this._langMessage.close(),this._styleMessage.close()},Wo.prototype._hide=function(){this._router.openMain()},Wo.prototype.show=function(){this._stateSettings={language:this._localesManager.getLastUsedLanguage(),style:this._cslStylesManager.getLastUsedStyleIdOrDefault(),notesStyle:this._cslStylesManager.getLastUsedNotesStyle(),styleFormat:this._cslStylesManager.getLastUsedFormat()},this._saveBtn.disable(),this._router.openSettings(),this._stateSettings.notesStyle===this._endNotes.getState().value?this._endNotes.check():this._footNotes.check()},Wo.prototype._loadStyles=function(){var e=this;return this._cslStylesManager.getStylesInfo().then(function(t){e._addStylesToList(t),e._styleSelect.addCustomItem(`more_styles`,`More Styles...`),e._styleSelect.addCustomItem(`cslFileInput`,`Add custom style...`)}).catch(function(e){console.error(e)})},Wo.prototype._addStylesToList=function(e){var t=this,n=this._cslStylesManager.getLastUsedStyleIdOrDefault(),r=e.map(function(e){return[e.name,e.title]}),i=r.filter(function(e){return!!(e[0]==n||t._cslStylesManager.isStyleDefault(e[0]))});this._styleSelect.addItems(i,n),this._styleSelectListOther.addItems(r,n)},Wo.prototype._somethingWasChanged=function(){this._saveBtn.enable()},Wo.prototype._onStyleChange=function(e,t){var n=this;return t&&n._showLoader(),n._cslStylesManager.getStyle(e,!t).then(function(e){var r=e.styleFormat;n._bNumFormat=r==`numeric`,r===`note`?n._notesStyleWrapper.classList.remove(n._displayNoneClass):n._notesStyleWrapper.classList.add(n._displayNoneClass),t&&n._hideLoader()}).catch(function(e){throw console.error(e),typeof e==`string`&&n._styleMessage.show(Y(e)),t&&n._hideLoader(),e})},Wo.prototype._showLoader=function(){this._cancelBtn.disable(),this._saveBtn.disable(),this._styleSelect.disable(),this._languageSelect.disable()},Wo.prototype._hideLoader=function(){this._cancelBtn.enable(),this._saveBtn.enable(),this._styleSelect.enable(),this._languageSelect.enable()};function Go(e,t){if(this._router=e,this._sdk=t,this._apiKeyLoginField=new fi(`apiKeyField`,{autofocus:!0,autocomplete:`on`}),this._saveApiKeyBtn=new mi(`saveApiKeyBtn`,{disabled:!0}),this._apiKeyMessage=new pi(`apiKeyMessage`,{type:`error`}),this._useDesktopMessage=new pi(`useDesktopMessage`,{type:`error`}),this._connectToLocalZotero=new mi(`connectToLocalZotero`,{variant:`secondary`}),this._useDesktopApp=document.getElementById(`useDesktopApp`),!this._useDesktopApp)throw Error(`useDesktopApp not found`);if(this._logoutLink=document.getElementById(`logoutLink`),!this._logoutLink)throw Error(`logoutLink not found`);this._onAuthorized=function(e){},this._onChangeState=function(e){},this._onOpen=function(){}}Go.prototype.init=function(){var e=this;this._addEventListeners();var t=!1,n=document.querySelectorAll(`.for-zotero-online`);sr.runApisChecker(e._sdk).subscribe(function(r){if(e._onChangeState(r),t||(t=!0,!r.desktopVersion&&e._useDesktopApp&&e._useDesktopApp.classList.add(`hidden`),e._onOpen(),e._show()),r.online?n.forEach(function(e){e.classList.remove(`hidden`)}):n.forEach(function(e){e.classList.add(`hidden`)}),r.online&&r.hasKey){e._sdk.setIsOnlineAvailable(!0),e._hide(!0),e._onAuthorized(r);return}else if(r.desktop&&r.hasPermission){e._sdk.setIsOnlineAvailable(!1),e._hide(),e._hideAllMessages(),e._onAuthorized(r);return}});var r={onOpen:function(t){return e._onOpen=t,r},onChangeState:function(t){return e._onChangeState=t,r},onAuthorized:function(t){return e._onAuthorized=t,r}};return r},Go.prototype._addEventListeners=function(){var e=this;this._apiKeyLoginField.subscribe(function(t){t.type,t.type===`inputfield:input`&&(e._apiKeyLoginField.getValue()?e._saveApiKeyBtn.enable():e._saveApiKeyBtn.disable())}),this._saveApiKeyBtn.subscribe(function(t){t.type===`button:click`&&e._tryToApplyKey()}),this._connectToLocalZotero.subscribe(function(t){t.type===`button:click`&&(e._showLoader(),sr.checkStatus(e._sdk).then(function(t){t.desktop&&t.hasPermission?(e._sdk.setIsOnlineAvailable(!1),e._hide(),e._hideAllMessages()):t.desktop&&!t.hasPermission?e._useDesktopMessage.show(Y(`Connection to Zotero failed. Please enable external connections in Zotero: Edit → Settings → Advanced → Check "Allow other applications on this computer to communicate with Zotero"`)):t.desktop||e._useDesktopMessage.show(Y(`Connection to Zotero failed. Make sure Zotero is running.`))}).finally(function(){e._hideLoader()}))}),this._logoutLink.onclick=function(t){return e._sdk.clearSettings(),e._show(),!0}},Go.prototype._tryToApplyKey=function(){var e=this,t=e._apiKeyLoginField.getValue();t&&(e._showLoader(),e._sdk.setApiKey(t).then(function(){sr.successfullyLoggedInUsingApiKey(),e._hide(!0)}).catch(function(t){console.error(t),e._apiKeyMessage.show(Y(`Invalid API key`))}).finally(function(){e._hideLoader()}))},Go.prototype._hideAllMessages=function(){this._apiKeyMessage.close()},Go.prototype._hide=function(e){this._router.openMain(),e&&this._logoutLink.classList.remove(`hidden`)},Go.prototype._show=function(){this._router.openLogin(),this._logoutLink.classList.add(`hidden`)},Go.prototype._showLoader=function(){this._saveApiKeyBtn.disable(),this._connectToLocalZotero.disable(),this._apiKeyLoginField.disable()},Go.prototype._hideLoader=function(){this._saveApiKeyBtn.enable(),this._connectToLocalZotero.enable(),this._apiKeyLoginField.enable()};function Ko(){this._searchField=new fi(`searchField`,{type:`text`,autofocus:!0,showClear:!1}),this._filterButton=new mi(`filterButton`,{variant:`secondary-icon`,size:`small`}),this._librarySelectList=new ia(`librarySelectList`,{placeholder:Y(`No items selected`),multiple:!0,description:Y(`Search in:`)}),this._subscribers=[],this._addEventListeners()}Ko.prototype._addEventListeners=function(){var e=this;this._searchField.subscribe(function(t){if(t.type===`inputfield:blur`||t.type===`inputfield:submit`){var n=e._getSelectedGroups();e._subscribers.forEach(function(e){e(t.detail.value,n)})}}),this._filterButton.subscribe(function(t){t.type===`button:click`&&(e._librarySelectList.isOpen||(t.detail.originalEvent&&t.detail.originalEvent.stopPropagation(),e._librarySelectList.openDropdown()))})},Ko.prototype.addGroups=function(e){var t=this,n=localStorage.getItem(`selectedGroups`),r=n?JSON.parse(n).map(function(e){return e.toString()}):[`my_library`,`group_libraries`],i=!1;e.forEach(function(e){e.id=String(e.id)});var a=[{id:`my_library`,name:Y(`My Library`)},{id:`group_libraries`,name:Y(`Group Libraries`)}];!i&&a.forEach(function(e){r.indexOf(e.id)!==-1&&(i=!0)}),!i&&e.forEach(function(e){r.indexOf(e.id.toString())!==-1&&(i=!0)}),i||(r=[`my_library`,`group_libraries`]);for(var o=function(e,n,r){typeof e==`number`&&(e=e.toString()),t._librarySelectList instanceof ia&&t._librarySelectList.addItem(e,n,r)},s=0;s0){var c=document.createElement(`div`);a&&c.classList.add(`page`+a.children.length);for(var l=0;l0&&(a=e.author.map(function(e){return e.family&&e.given?e.family.trim()+`, `+e.given.trim():e.family?e.family.trim():e.given?e.given.trim():``}).join(`; `));var o=document.createElement(`div`);o.classList.add(`selectbox-arrow`),o.innerHTML=``;var s=document.createElement(`div`);if(s.textContent=e.title.trim(),s.classList.add(`truncate-text`),s.classList.add(`secondary-text`),(e.publisher||e[`publisher-place`])&&(s.textContent+=` · `+(e.publisher||e[`publisher-place`]||``)),e.issued&&e.issued[`date-parts`]){var c=e.issued[`date-parts`][0];a.length>20?s.textContent+=` (`+c.join(`-`)+`)`:(a.length>0&&a.slice(-1)!==`.`&&a.slice(-1)!==`,`&&(a+=`.`),a+=` `+c.join(`-`))}a.length===0&&(a=s.textContent),s.setAttribute(`title`,s.textContent),r.appendChild(s);var l=document.createElement(`input`);i.appendChild(l);var u=new Fi(l,{checked:!!this._items[e.id],label:a,title:!0,id:e.id});this._items[e.id]&&(this._checks[e.id]=u),i.appendChild(o),n.appendChild(i),n.appendChild(r);var d;function f(){n.classList.toggle(`doc-open`),d||(d=t._buildCitationParams(e),n.appendChild(d))}return o.onclick=f,u.subscribe(function(n){n.type===`checkbox:change`&&(n.detail.checked?t._addSelected(e,u):t._removeSelected(e.id))}),n},Jo.prototype._buildCitationParams=function(e){var t=localStorage.getItem(`selectedLocator`)||`page`;e.label=t;var n=document.createDocumentFragment(),r=document.createElement(`div`),i=document.createElement(`input`),a=document.createElement(`input`),o=document.createElement(`div`),s=document.createElement(`div`),c=document.createElement(`input`),l=document.createElement(`div`),u=document.createElement(`input`);n.appendChild(r),r.appendChild(i),r.appendChild(a),n.appendChild(o),o.appendChild(s),o.appendChild(c);var d=``;n.appendChild(l),l.appendChild(u);var f=new fi(i,{type:`text`,placeholder:Y(`Prefix`)}),p=new fi(a,{type:`text`,placeholder:Y(`Suffix`)}),m=new ia(s,{placeholder:Y(`Locator`),usePortal:!0,translate:Y});qo.forEach(function(e){var n=e[0]===t;m.addItem(e[0],e[1],n),n&&(d=e[1])});var h=new fi(c,{type:`text`,placeholder:Y(d)}),g=new Fi(u,{label:Y(`Omit Author`)});return f.subscribe(function(t){t.type===`inputfield:input`&&(e.prefix=t.detail.value)}),p.subscribe(function(t){t.type===`inputfield:input`&&(e.suffix=t.detail.value)}),h.subscribe(function(t){t.type===`inputfield:input`&&(e.locator=t.detail.value)}),m.subscribe(function(t){if(t.type===`selectbox:change`&&t.detail.items){var n=t.detail.items[0];h.setPlaceholder(n.text),e.label=t.detail.values[0].toString(),localStorage.setItem(`selectedLocator`,e.label)}}),g.subscribe(function(t){t.type===`checkbox:change`&&(e[`suppress-author`]=t.detail.checked)}),n},Jo.prototype._buildSelectedElement=function(e){var t=this,n=document.createElement(`div`);n.classList.add(`selDoc`);var r=document.createElement(`span`);e.author&&e.author.length>0?r.textContent=e.author.map(function(e){return e.family+`, `+e.given}).join(`; `):r.textContent=e.title,e.issued&&e.issued[`date-parts`]&&(r.textContent+=` `+e.issued[`date-parts`][0].join(`-`)),r.setAttribute(`title`,r.textContent),n.appendChild(r);var i=document.createElement(`span`);return i.onclick=function(){t._removeSelected(e.id)},i.innerHTML=``,n.appendChild(i),n},Jo.prototype._addSelected=function(e,t){var n=this._buildSelectedElement(e);this._items[e.id]=e,this._html[e.id]=n,this._checks[e.id]=t,this._selectedHolder&&this._selectedHolder.appendChild(n),this._docsScroller.onscroll(),this._selectedScroller.onscroll(),this._checkSelected()},Jo.prototype._checkDocsScroll=function(e,t){var n=this;if(this._fShouldLoadMore(e)){if(this._loadTimeout&&clearTimeout(this._loadTimeout),!this._lastSearch.obj&&!this._lastSearch.text.trim()&&!this._lastSearch.groups.length)return;this._loadTimeout=setTimeout(function(){n._fShouldLoadMore(e)&&n._fLoadMore()},500)}},Jo.prototype._initScrollBox=function(e,t,n,r){var i={};return i.onscroll=this._checkScroll(e,t,n,r),e.onwheel=function(t){e.scrollTop+=t.deltaY>10||t.deltaY<-10?t.deltaY:t.deltaY*20,i.onscroll()},t.onmousedown=function(n){t.classList.add(`scrolling`);var r=n.clientY,a=e.scrollTop;window.onmouseup=function(e){t.classList.remove(`scrolling`),window.onmouseup=null,window.onmousemove=null},window.onmousemove=function(t){var n=(t.clientY-r)/e.clientHeight;e.scrollTop=a+e.scrollHeight*n,i.onscroll()}},document.body.addEventListener(`resize`,function(){i.onscroll()}),i},Jo.prototype._checkScroll=function(e,t,n,r){var i=this._displayNoneClass;return function(){if(e.scrollHeight<=e.clientHeight)t.classList.add(i);else{t.classList.remove(i);var a=e.clientHeight/e.scrollHeight*e.clientHeight;a=a0?`started`:`empty`)}).catch(function(e){console.error(e)}).finally(function(){h.hide()})}function y(){return n.getUserGroups().then(function(e){return c.addGroups(e),e})}function b(){l.subscribe(P);function t(e,t,r){l.clearLibrary();var i=[];return n.getUserGroups().then(function(o){var s=t.filter(function(e){return e!==`my_library`&&e!==`group_libraries`});t.indexOf(`my_library`)!==-1&&i.push(j(n.getItems(e),!1));for(var c=0;c0&&(o=JSON.stringify(c))}var l=r.filter(function(e){return e.Value.indexOf(n._citPrefixNew)!==-1||e.Value.indexOf(n._citPrefix)!==-1}).map(function(r){var o=a($,n,ps).call(n,r),s=``;r.Value.indexOf(n._citPrefix)===-1&&(s=o.citationID);var c=new To(s);return e&&t===s?i+=c.fillFromObject(e):i+=c.fillFromObject(o),n._storage.addCslCitation(c),{field:C({},r),cslCitation:c}});return{bibField:s,bibFieldValue:o,fieldsWithCitations:l}})}function hs(e,t){var n=a($,this,ds).call(this);if(e&&(n=X(this._bibPlaceholderIfEmpty)),this._cslStylesManager.isLastUsedStyleContainBibliography())return this.citationDocService.addBibliography(n,t);throw`The current bibliographic style does not describe the bibliography`}function gs(e,t){return e?t.Content=X(this._bibPlaceholderIfEmpty):t.Content=a($,this,ds).call(this),t}function _s(e,t,n,r){return vs.apply(this,arguments)}function vs(){return vs=s(E().m(function e(t,n,r,i){var o,s,c,l,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,D;return E().w(function(e){for(;;)switch(e.n){case 0:o=document.createDocumentFragment(),s=document.createElement(`div`),o.appendChild(s),c=[],l=t.length,d=t.length-1;case 1:if(!(d>=0)){e.n=7;break}if(f=!!r,p=t[d],m=p.field,h=p.cslCitation,g=this._storage.getCitationsPre(h.citationID),_=this._storage.getCitationsPost(h.citationID),v=this._storage.getAllCitationsInJson(),this._formatter.rebuildProcessorState(v),y=this._formatter.processCitationCluster(h.toJSON(),g,_),b=a($,this,xs).call(this,y[1][0][1]),s.innerHTML=b,h.setFormattedCitation(b),x=h.getPlainCitation(),S=m.Content,x===``&&(x=S),C=s.innerText,!h.getDoNotUpdate()){e.n=2;break}return e.a(3,6);case 2:if(!(x!==S&&!n)){e.n=4;break}return w=`

`+X(`You have modified this citation since Zotero generated it. Do you want to keep your modifications and prevent future updates?`)+`

`+X(`Clicking „Yes“ will prevent Zotero from updating this citation if you add additional citations, switch styles, or modify the item to which it refers. Clicking „No“ will erase your changes.`)+`

`+X(`Original:`)+` `+C+`

`+X(`Modified:`)+` `+S+`

`,e.n=3,u(Go,this).show(`Saving custom edits`,w);case 3:T=e.v,T?(h.setDoNotUpdate(),delete m.Content):(m.Content=b,h.setPlainCitation(C)),f=!0,e.n=5;break;case 4:(C!==S||x!==S||x!==C)&&(f=!0),m.Content=b,h.setPlainCitation(C);case 5:h&&(D=this._citPrefixNew+` `+this._citSuffixNew+` `+JSON.stringify(a($,this,Zo).call(this,h)),m.Value!==D&&(f=!0),m.Value=D),f&&c.push(m),i&&i({phase:`apply`,completed:l-d,total:l});case 6:d--,e.n=1;break;case 7:return e.a(2,c)}},e,this)})),vs.apply(this,arguments)}function ys(e){var t=u(Ko,this).get(e);if(t)return t;var n=e;try{var r=new DOMParser().parseFromString(e,`application/xml`).documentElement;r&&r.nodeName!==`parsererror`&&(n=r)}catch(e){console.error(`Failed to pre-parse CSL/locale XML, falling back to citeproc's slower string parser:`,e)}return u(Ko,this).set(e,n),n}function bs(){var e=this,t=[];this._storage.forEachItem(function(e,n){t.push(n)});var n=this._cslStylesManager.getLastUsedStyleIdOrDefault(),r=this._localesManager.getLastUsedLanguage(),i=this._cslStylesManager.cached(n),o=n+` `+r+` `+(i?i.length:0);if(this._formatter&&u(qo,this)===o){t.length&&this._formatter.updateItems(t);return}this._formatter=new CSL.Engine({retrieveLocale:function(t){var n=e._localesManager.getLocale(t)||e._localesManager.getLocale();return n&&a($,e,ys).call(e,n)},retrieveItem:function(t){var n=e._storage.getItem(t),r=e._storage.getItemIndex(t);return n?n.toFlatJSON(r):null}},i&&a($,this,ys).call(this,i),r,!0),f(qo,this,o),t.length&&this._formatter.updateItems(t)}function xs(e){return e.replace(/\u00A0/g,` `).replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`)}var Ss=function(){function e(){l(this,e)}return h(e,null,[{key:`getCursorPosition`,value:function(){return new Promise(function(e){Asc.plugin.callCommand(function(){var e=Api.GetDocument(),t=0;if(!e)return t;var n=e.GetCurrentRun();if(!n)return t;var r=n.GetRange(0,0);return r?r.GetEndPos():t},!1,!1,e)})}},{key:`setCursorPosition`,value:function(e){return new Promise(function(t){var n=!1,r=!1;Asc.scope.pos=e,Asc.plugin.callCommand(function(){Api.GetDocument().MoveCursorToPos(Asc.scope.pos)},r,n,t)})}}])}(),Cs={getStyleInfo:function(e,t){var n=new DOMParser().parseFromString(t,`text/xml`),r={categories:{fields:[],format:``},dependent:0,href:``,name:e,title:``,updated:``},i=n.querySelector(`info title`);i&&(r.title=i.textContent);var a=n.querySelector(`info link[rel="self"]`);if(a){var o=a.getAttribute(`href`);o&&(r.href=o)}var s=n.querySelector(`info link[rel="independent-parent"]`);if(s){var c=s.getAttribute(`href`);c&&(r.parent=c),r.dependent=1}var l=n.querySelector(`info updated`);l&&(r.updated=l.textContent);var u=n.querySelector(`info category[citation-format]`);if(u){var d=u.getAttribute(`citation-format`);d&&(r.categories.format=d)}var f=n.querySelectorAll(`info category[field]`);return f&&f.forEach(function(e){var t=e.getAttribute(`field`);t&&r.categories.fields.push(t)}),r},getCitationFormat:function(e){var t=new DOMParser().parseFromString(e,`text/xml`).querySelector(`info category[citation-format]`);if(!t)throw Error(`Citation format not found`);var n=t.getAttribute(`citation-format`);if(!n)throw Error(`Citation format not found`);switch(n){case`note`:case`numeric`:case`author`:case`author-date`:case`label`:return n}throw Error(`Invalid citation format`)},isStyleContainBibliography:function(e){return e.indexOf(`-1}};function ws(){this._customStyleNamesKey=`zoteroCustomStyleNames`,this._customStylesKey=`zoteroCustomStyles`}ws.prototype.getStyleNames=function(){var e=localStorage.getItem(this._customStyleNamesKey);return e?JSON.parse(e):[]},ws.prototype._getStyles=function(){var e=localStorage.getItem(this._customStylesKey);return e?JSON.parse(e):[]},ws.prototype.getStyle=function(e){var t=this.getStyleNames().indexOf(e);return t===-1?null:this._getStyles()[t]},ws.prototype.getStylesInfo=function(){for(var e=this.getStyleNames(),t=this._getStyles(),n=[],r=0;r1024*1024&&n(`Maximum file size is 1 MB.`),t(r)}).then(function(n){return t._readCSLFile(e).then(function(e){return t._defaultStyles.indexOf(n)===-1&&t._defaultStyles.push(n),t._customStylesStorage.setStyle(n,e)})})},Ts.prototype.getLastUsedFormat=function(){var e=localStorage.getItem(this._lastFormatKey);switch(e){case`note`:case`numeric`:case`author`:case`author-date`:case`label`:return e}return`numeric`},Ts.prototype.getLastUsedNotesStyle=function(){var e=localStorage.getItem(this._lastNotesStyleKey);return e===`footnotes`||e===`endnotes`?e:`footnotes`},Ts.prototype.getLastUsedStyleId=function(){return localStorage.getItem(this._lastStyleKey)||null},Ts.prototype.getLastUsedStyleIdOrDefault=function(){return localStorage.getItem(this._lastStyleKey)||`ieee`},Ts.prototype.getStyle=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this;return Promise.resolve(e).then(function(e){if(n._cache[e])return n._cache[e];if(n._customStylesStorage.getStyleNames().indexOf(e)!==-1)return n._customStylesStorage.getStyle(e);var t=n._STYLES_LOCAL+e+`.csl`;if(n._isOnlineAvailable)t=n._STYLES_URL+e;else if(n._defaultStyles.indexOf(e)===-1){var r=n._getCachedStyle(e);if(!r)throw`The style is not available in the local version of the plugin.`;return r}return fetch(t).then(function(e){return e.text()})}).then(function(t){if(t&&!n._isValidCSL(t)&&n._isOnlineAvailable){var r=Cs.getStyleInfo(e,t);if(r&&r.dependent>0&&r.parent)return fetch(r.parent).then(function(e){return e.text()})}return t}).then(function(r){var i=r&&Cs.getCitationFormat(r)||`numeric`,a={content:r,styleFormat:i};return r&&t&&n._saveLastUsedStyle(e,r,i),r&&n._isOnlineAvailable&&n._defaultStyles.indexOf(e)===-1&&n._saveCachedStyle(e,r),a})},Ts.prototype.getStylesInfo=function(){var e=this;return Promise.all([this._getStylesJson(),this._customStylesStorage.getStylesInfo()]).then(function(t){var n=e.getLastUsedStyleId()||`ieee`,r=[],i=e._customStylesStorage.getStyleNames(),a=t[0],o=t[1];if(!e._isOnlineAvailable){var s=e._getCachedStyleNames();a=a.filter(function(t){return e._defaultStyles.indexOf(t.name)>=0||t.name==n||s.indexOf(t.name)>=0})}return o.forEach(function(t){r.push(t),e._defaultStyles.indexOf(t.name)===-1&&e._defaultStyles.push(t.name)}),a.forEach(function(e){i.indexOf(e.name)===-1&&r.push(e)}),r.sort(function(e,t){return e.name.localeCompare(t.name)}),r})},Ts.prototype._getStylesJson=function(){var e=this._STYLES_JSON_LOCAL;return this._isOnlineAvailable&&(e=this._STYLES_JSON_URL),fetch(e).then(function(e){return e.json()})},Ts.prototype.cached=function(e){return Object.hasOwnProperty.call(this._cache,e)?this._cache[e]:null},Ts.prototype.isLastUsedStyleContainBibliography=function(){return localStorage.getItem(this._lastUsedStyleContainBibliographyKey)!==`false`},Ts.prototype.isStyleDefault=function(e){return this._defaultStyles.indexOf(e)>=0},Ts.prototype._isValidCSL=function(e){return e.indexOf(`-1&&e.indexOf(`-1&&e.indexOf(`-1&&e.indexOf(`citation`)>-1},Ts.prototype._readCSLFile=function(e){var t=this;return new Promise(function(n,r){var i=new FileReader;i.onload=function(e){var i=e.target?String(e.target.result):``;if(!t._isValidCSL(i)){r(`The file is not a valid CSL file`);return}n(i)},i.onerror=function(){r(`Failed to read file`)},i.readAsText(e)})},Ts.prototype._saveCachedStyle=function(e,t){this._cache[e]=t;try{localStorage.setItem(this._cachedStylePrefix+e,t)}catch{}},Ts.prototype._getCachedStyle=function(e){if(this._cache[e])return this._cache[e];var t=localStorage.getItem(this._cachedStylePrefix+e);return t&&(this._cache[e]=t),t},Ts.prototype._getCachedStyleNames=function(){for(var e=[],t=0;t0){for(var c=document.createElement(`div`),l=[],u=0;u0){var n=e.author[0];t=[n.family,n.given].filter(function(e){return!!e}).join(` `).trim(),!t&&n.literal&&(t=String(n.literal).trim())}return t||=(e.title||``).trim(),t.toLowerCase()},js.prototype._addPriorityItems=function(e){var t=this,n=this._docsHolder;if(!(!e.length||!n)){this._priorityHolder||(this._priorityHolder=document.createElement(`div`),this._priorityHolder.classList.add(`docs-priority`));var r=this._priorityHolder;r.parentNode!==n&&n.insertBefore(r,n.firstChild),e.forEach(function(e){t._priorityEntries.push({key:t._getAlphabeticalKey(e),element:t._buildDocElement(e)})}),this._priorityEntries.sort(function(e,t){return e.key.localeCompare(t.key)}),this._priorityEntries.forEach(function(e){r.appendChild(e.element)})}},js.prototype.getSelectedItems=function(){return Object.assign({},this._items||{})},js.prototype.removeItems=function(e){var t=this;e.forEach(function(e){t._removeSelected(e)})},js.prototype.subscribe=function(e){var t=this;return this._subscribers.push(e),{unsubscribe:function(){t._subscribers=t._subscribers.filter(function(t){return t!==e})}}},js.prototype._buildDocElement=function(e){var t=this;this._items[e.id]&&(e=this._items[e.id]);var n=document.createElement(`div`);n.classList.add(`doc`);var r=document.createElement(`div`);r.classList.add(`docInfo`);var i=document.createElement(`div`),a=``;e.author&&e.author.length>0&&(a=e.author.map(function(e){return e.family&&e.given?e.family.trim()+`, `+e.given.trim():e.family?e.family.trim():e.given?e.given.trim():``}).join(`; `));var o=document.createElement(`div`);o.classList.add(`doc-expand-btn`),o.innerHTML=`•••`;var s=document.createElement(`div`);if(s.textContent=e.title.trim(),s.classList.add(`truncate-text`),(e.publisher||e[`publisher-place`])&&(s.textContent+=` · `+(e.publisher||e[`publisher-place`]||``)),e.issued&&e.issued[`date-parts`]){var c=e.issued[`date-parts`][0];a.length>20?s.textContent+=` (`+c.join(`-`)+`)`:(a.length>0&&a.slice(-1)!==`.`&&a.slice(-1)!==`,`&&(a+=`.`),a+=` `+c.join(`-`))}a.length===0&&(a=s.textContent),s.setAttribute(`title`,s.textContent),r.appendChild(s);var l=document.createElement(`input`);i.appendChild(l);var u=new Hi(l,{checked:!!this._items[e.id],label:a,title:!0,id:e.id});this._items[e.id]&&(this._checks[e.id]=u);var d=document.createElement(`div`);d.classList.add(`doc-reorder-btns`),d.style.display=this._items[e.id]?`flex`:`none`;var f=document.createElement(`span`);f.className=`doc-reorder-btn`,f.textContent=`▲`,f.title=X(`Move up`),f.onclick=function(n){n.stopPropagation(),t._moveItem(e.id,-1)};var p=document.createElement(`span`);p.className=`doc-reorder-btn`,p.textContent=`▼`,p.title=X(`Move down`),p.onclick=function(n){n.stopPropagation(),t._moveItem(e.id,1)},d.appendChild(f),d.appendChild(p),this._reorderBtns[e.id]=d,i.appendChild(d),i.appendChild(o),n.appendChild(i),n.appendChild(r),n.setAttribute(`data-id`,String(e.id)),this._docRoots[e.id]=n;var m;function h(){n.classList.toggle(`doc-open`),m||(m=t._buildCitationParams(e),n.appendChild(m))}o.onclick=function(e){e.stopPropagation(),h()};var g=i.querySelector(`.checkbox-container`);return g&&g.addEventListener(`click`,function(e){var t=e.target;t.classList.contains(`checkbox-visual`)||t.classList.contains(`checkbox-checkmark`)||t.closest(`.checkbox-visual`)||t===u._input||(e.stopImmediatePropagation(),e.preventDefault(),h())},!0),r.style.cursor=`pointer`,r.onclick=function(e){e.stopPropagation(),h()},u.subscribe(function(r){r.type===`checkbox:change`&&(r.detail.checked?t._addSelected(e,u,n):t._removeSelected(e.id))}),n},js.prototype._buildCitationParams=function(e){var t=e.label||localStorage.getItem(`selectedLocator`)||`page`;e.label=t;var n=document.createDocumentFragment(),r=document.createElement(`div`),i=document.createElement(`input`),a=document.createElement(`input`),o=document.createElement(`div`),s=document.createElement(`div`),c=document.createElement(`input`),l=document.createElement(`div`),u=document.createElement(`input`);n.appendChild(r),r.appendChild(i),r.appendChild(a),n.appendChild(o),o.appendChild(s),o.appendChild(c);var d=``;n.appendChild(l),l.appendChild(u);var f=new bi(i,{type:`text`,placeholder:X(`Prefix`),value:e.prefix||``}),p=new bi(a,{type:`text`,placeholder:X(`Suffix`),value:e.suffix||``}),m=new la(s,{placeholder:X(`Locator`),usePortal:!0,translate:X});As.forEach(function(e){var n=e[0]===t;m.addItem(e[0],e[1],n),n&&(d=e[1])});var h=new bi(c,{type:`text`,placeholder:X(d),value:e.locator||``}),g=new Hi(u,{label:X(`Omit Author`),checked:!!e[`suppress-author`]});return f.subscribe(function(t){t.type===`inputfield:input`&&(e.prefix=t.detail.value)}),p.subscribe(function(t){t.type===`inputfield:input`&&(e.suffix=t.detail.value)}),h.subscribe(function(t){t.type===`inputfield:input`&&(e.locator=t.detail.value)}),m.subscribe(function(t){if(t.type===`selectbox:change`&&t.detail.items){var n=t.detail.items[0];h.setPlaceholder(n.text),e.label=t.detail.values[0].toString(),localStorage.setItem(`selectedLocator`,e.label)}}),g.subscribe(function(t){t.type===`checkbox:change`&&(e[`suppress-author`]=t.detail.checked)}),n},js.prototype._buildSelectedElement=function(e){var t=this,n=document.createElement(`div`);n.classList.add(`selDoc`),n.setAttribute(`data-id`,String(e.id));var r=document.createElement(`span`);e.author&&e.author.length>0?r.textContent=e.author.map(function(e){return e.family+`, `+e.given}).join(`; `):r.textContent=e.title,e.issued&&e.issued[`date-parts`]&&(r.textContent+=` `+e.issued[`date-parts`][0].join(`-`)),r.setAttribute(`title`,r.textContent),n.appendChild(r);var i=document.createElement(`span`);i.className=`selDoc-move`,i.textContent=`▲`,i.title=X(`Move up`),i.onclick=function(){t._moveItem(e.id,-1)},n.appendChild(i);var a=document.createElement(`span`);a.className=`selDoc-move`,a.textContent=`▼`,a.title=X(`Move down`),a.onclick=function(){t._moveItem(e.id,1)},n.appendChild(a);var o=document.createElement(`span`);return o.onclick=function(){t._removeSelected(e.id)},o.innerHTML=``,n.appendChild(o),n},js.prototype._addSelected=function(e,t,n){this._items[e.id]=e,this._checks[e.id]=t,this._orderedIds.push(e.id),this._reorderBtns[e.id]&&(this._reorderBtns[e.id].style.display=``),this._docsScroller.onscroll(),this._checkSelected()},js.prototype._checkDocsScroll=function(e,t){var n=this;if(this._fShouldLoadMore(e)){if(this._loadTimeout&&clearTimeout(this._loadTimeout),!this._lastSearch.obj&&!this._lastSearch.text.trim()&&!this._lastSearch.groups.length)return;this._loadTimeout=setTimeout(function(){n._fShouldLoadMore(e)&&n._fLoadMore()},500)}},js.prototype._initScrollBox=function(e,t,n,r){var i={};return i.onscroll=this._checkScroll(e,t,n,r),e.onwheel=function(t){e.scrollTop+=t.deltaY>10||t.deltaY<-10?t.deltaY:t.deltaY*20,i.onscroll()},t.onmousedown=function(n){t.classList.add(`scrolling`);var r=n.clientY,a=e.scrollTop;window.onmouseup=function(e){t.classList.remove(`scrolling`),window.onmouseup=null,window.onmousemove=null},window.onmousemove=function(t){var n=(t.clientY-r)/e.clientHeight;e.scrollTop=a+e.scrollHeight*n,i.onscroll()}},document.body.addEventListener(`resize`,function(){i.onscroll()}),i},js.prototype._checkScroll=function(e,t,n,r){var i=this._displayNoneClass;return function(){if(e.scrollHeight<=e.clientHeight)t.classList.add(i);else{t.classList.remove(i);var a=e.clientHeight/e.scrollHeight*e.clientHeight;a=a=this._orderedIds.length)){var i=this._orderedIds[r];this._orderedIds[r]=this._orderedIds[n],this._orderedIds[n]=i;var a=this._docRoots[e],o=this._docRoots[i];if(a&&o&&a.parentNode){var s=document.createElement(`div`);a.parentNode.insertBefore(s,a),o.parentNode.insertBefore(a,o),s.parentNode.insertBefore(o,s),s.parentNode.removeChild(s)}this._docsScroller.onscroll()}}},js.prototype.getSelectedItemsOrdered=function(){for(var e=[],t=0;t0?`started`:`empty`)}).catch(function(e){console.error(e)}).finally(function(){x.hide()})}function O(){return n.getUserGroups().then(function(e){return l.addGroups(e),e})}function k(){u.subscribe(ae);function t(e,t,r){u.clearLibrary();var i=[];return n.getUserGroups().then(function(o){var s=t.filter(function(e){return e!==`my_library`&&e!==`group_libraries`});t.indexOf(`my_library`)!==-1&&i.push(re(n.getItems(e),!1));for(var c=0;c0?e.completed/e.total:1;e.phase===`fetch`?n=t:a=t,ja.setProgress(n*.4+a*.6);var r=e.phase===`fetch`?X(`Fetching updated references`):X(`Updating citations`);ja.setText(`Zotero (`+r+` `+e.completed+`/`+e.total+`)`)},t.type===`button:click`){e.n=1;break}return e.a(2);case 1:if(r.getLastUsedStyleId()){e.n=2;break}return j(X(`Style is not selected`)),e.a(2);case 2:if(r.getLocale()){e.n=3;break}return j(X(`Language is not selected`)),e.a(2);case 3:return y.disable(),b.disable(),g.disable(),v.disable(),n=0,a=0,ja.setText(`Zotero (`+X(`Updating citations`)+`)`),ja.setProgress(0),ja.show(),s=r.getStyleManager(),c=s.getLastUsedFormat()===`note`,e.p=4,e.n=5,M(!0);case 5:return e.p=5,e.n=6,i.repairBrokenCitations();case 6:l=e.v;case 7:return e.p=7,e.n=8,N(!1);case 8:return e.f(7);case 9:if(!c){e.n=15;break}return e.n=10,i.prepareRefreshCslItemsInNotes(s.getLastUsedNotesStyle(),o);case 10:return u=e.v,e.n=11,M(!0);case 11:return e.p=11,e.n=12,i.applyRefreshCslItemsInNotes(u);case 12:return e.p=12,e.n=13,N(!1);case 13:return e.f(12);case 14:e.n=20;break;case 15:return e.n=16,i.prepareRefreshCslItems(void 0,o);case 16:return d=e.v,e.n=17,M(!0);case 17:return e.p=17,e.n=18,i.applyRefreshCslItems(d);case 18:return e.p=18,e.n=19,N(!1);case 19:return e.f(18);case 20:l.repaired>0&&(f=X(`Repaired`)+` `+l.repaired+` `+X(`citation(s) that had lost their formatting.`),l.failed>0&&(f+=` `+l.failed+` `+X(`could not be repaired.`)),i.showSuccessMessage(f)),e.n=22;break;case 21:e.p=21,m=e.v,console.error(m),p=X(`Failed to refresh`),typeof m==`string`&&(p+=`. `+X(m)),j(p);case 22:return e.p=22,ja.setProgress(null),ja.hide(),y.enable(),b.enable(),v.enable(),ae(),e.f(22);case 23:return e.a(2)}},e,null,[[17,,18,20],[11,,12,14],[5,,7,9],[4,21,22,23]])}));return function(t){return e.apply(this,arguments)}}()),y.subscribe(function(){var e=s(E().m(function e(t){var n;return E().w(function(e){for(;;)switch(e.n){case 0:if(t.type===`button:click`){e.n=1;break}return e.a(2);case 1:if(r.getLastUsedStyleId()){e.n=2;break}return j(X(`Style is not selected`)),e.a(2);case 2:if(r.getLocale()){e.n=3;break}return j(X(`Language is not selected`)),e.a(2);case 3:return e.n=4,F(!1,`Zotero (`+X(`Inserting bibliography`)+`)`);case 4:n=``,i.insertBibliography().then(function(e){n=e}).catch(function(e){console.error(e),i.showWarningMessage(`Failed to insert bibliography`),typeof e==`string`&&j(X(e))}).finally(function(){L(!1,`Zotero (`+X(`Inserting bibliography`)+`)`),n&&i.moveCursorOutsideField(n)});case 5:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()),g.subscribe(function(){var e=s(E().m(function e(t){var n,a,o,c,l,d,h,g,_,v,y;return E().w(function(e){for(;;)switch(e.n){case 0:if(t.type===`button:click`){e.n=1;break}return e.a(2);case 1:if(r.getLastUsedStyleId()){e.n=2;break}return j(X(`Style is not selected`)),e.a(2);case 2:if(r.getLocale()){e.n=3;break}return j(X(`Language is not selected`)),e.a(2);case 3:if(!f){e.n=6;break}if(n=u.getSelectedItemsOrdered(),n.length!==0){e.n=4;break}return j(X(`No citations selected`)),e.a(2);case 4:return a=n.map(function(e){var t=m.citationItems.find(function(t){return t.id===e.id||t.itemData&&t.itemData.id===e.id});if(t)return t.prefix=e.prefix||``,t.suffix=e.suffix||``,t.locator=e.locator||``,t.label=e.label||`page`,t[`suppress-author`]=!!e[`suppress-author`],t;var n={id:e.id,itemData:Object.assign({},e),uris:e.uris||[]};return delete n.itemData.prefix,delete n.itemData.suffix,delete n.itemData.locator,delete n.itemData.label,delete n.itemData[`suppress-author`],delete n.itemData.uris,n.prefix=e.prefix||``,n.suffix=e.suffix||``,n.locator=e.locator||``,n.label=e.label||`page`,n[`suppress-author`]=!!e[`suppress-author`],n}),o=JSON.parse(JSON.stringify(m)),o.citationItems=a,c=p,W(),e.n=5,F(!0,`Zotero (`+X(`Updating citations`)+`)`);case 5:return l=i.updateItem.bind(i,o),d=r.getStyleManager(),d.getLastUsedFormat()===`note`&&(l=i.updateItem.bind(i,o,d.getLastUsedNotesStyle())),l().catch(function(e){console.error(e);var t=X(`Failed to update citation`);typeof e==`string`&&(t+=`. `+X(e)),j(t)}).finally(s(E().m(function e(){var t;return E().w(function(e){for(;;)switch(e.n){case 0:return ce(),t=d.getLastUsedFormat()===`note`,e.n=1,L(!1,`Zotero (`+X(`Updating citations`)+`)`,t);case 1:if(!c){e.n=4;break}if(!t){e.n=3;break}return e.n=2,i.moveCursorToField(c.FieldId,!1);case 2:e.n=4;break;case 3:return e.n=4,i.moveCursorOutsideField(c.FieldId);case 4:return e.a(2)}},e)}))),e.a(2);case 6:return e.n=7,F(!0,`Zotero (`+X(`Inserting citation`)+`)`);case 7:return h=u.getSelectedItems(),g=!1,_=r.getStyleManager().getLastUsedFormat()===`note`,e.n=8,i.getCurrentField();case 8:if(v=e.v,!v){e.n=9;break}return e.a(2,i.insertSelectedCitationsToCurrentField(h,v).then(function(e){return u.removeItems(Object.keys(h)),fe(e)}).then(function(e){e&&v&&i.showSuccessMessage(`Citation has been updated successfully`)}).finally(s(E().m(function e(){return E().w(function(e){for(;;)switch(e.n){case 0:L(!1,`Zotero (`+X(`Inserting citation`)+`)`);case 1:return e.a(2)}},e)}))));case 9:return y=null,e.a(2,i.insertSelectedCitations(h).then(function(e){return g=e,u.removeItems(Object.keys(h)),i.getCurrentField()}).then(function(e){if(y=e,!(_&&!g)){var t={skipCitations:!r.getAutoUpdateCitations(),skipBibliography:!r.getAutoUpdateBibliography()};return g?i.updateCslItems(!1,t):i.updateCslItems(void 0,t)}}).then(function(){if(g)return i.moveCursorRight();if(v)return i.moveCursorOutsideField(v.FieldId)}).catch(function(e){console.error(e);var t=X(`Failed to insert citation`);typeof e==`string`&&(t+=`. `+X(e)),j(t)}).finally(s(E().m(function e(){var t;return E().w(function(e){for(;;)switch(e.n){case 0:if(t=_&&!g,L(!1,`Zotero (`+X(`Inserting citation`)+`)`,t),ce(),!g){e.n=2;break}return e.n=1,i.moveCursorRight();case 1:e.n=3;break;case 2:if(!y){e.n=3;break}return e.n=3,i.moveCursorOutsideField(y.FieldId);case 3:return e.a(2)}},e)}))))}},e)}));return function(t){return e.apply(this,arguments)}}()),_.subscribe(function(e){e.type===`button:click`&&r.show()}),h.subscribe(function(){var e=s(E().m(function e(t){return E().w(function(e){for(;;)switch(e.n){case 0:if(t.type===`button:click`){e.n=1;break}return e.a(2);case 1:return e.n=2,F(!1,`Zotero (`+X(`Saving as text`)+`)`);case 2:i.saveAsText().then(function(){L(!1,`Zotero (`+X(`Saving as text`)+`)`)});case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()),r.onChangeState(function(){var e=s(E().m(function e(t,n){var r;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,F(!0,`Zotero (`+X(`Updating citations`)+`)`);case 1:r=i.updateCslItems.bind(i,!0),[t.styleFormat,n.styleFormat].includes(`note`)&&(r=t.styleFormat===n.styleFormat?t.notesStyle===n.notesStyle?i.updateCslItems.bind(i,!0):i.convertNotesStyle.bind(i,t.notesStyle):t.styleFormat===`note`?i.switchingBetweenNotesAndText.bind(i,t.notesStyle):i.switchingBetweenNotesAndText.bind(i)),r().catch(function(e){console.error(e);var t=X(`Failed to refresh`);typeof e==`string`&&(t+=`. `+X(e)),j(t)}).finally(function(){L(!1,`Zotero (`+X(`Updating citations`)+`)`),ce()});case 2:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}())}Asc.plugin.onThemeChanged=function(e){window.Asc.plugin.onThemeChangedBase(e),Cr.fixThemeForIE(e),Cr.addStylesForComponents(e);var t=``;t+=`.link, .link:visited, .link:hover { color : `+window.Asc.plugin.theme[`text-normal`]+` !important;} `,t+=`.doc { border-color: `+e[`border-regular-control`]+`; background-color: `+e[`background-normal`]+`; } `,t+=`.scrollThumb { box-shadow: 0 0 8px 8px `+e[`highlight-button-hover`]+` inset; } `,t+=`.scrollThumb:active, .scrollThumb.scrolling { box-shadow: 0 0 8px 8px `+e[`canvas-scroll-thumb-pressed`]+` inset; } `,t+=`.scrollThumb:hover { box-shadow: 0 0 8px 8px `+e[`canvas-scroll-thumb-hover`]+` inset; } `,([`theme-white`,`theme-night`].indexOf(e.name)!==-1||[`theme-white`,`theme-night`].indexOf(e.Name)!==-1)&&(t+=`.doc { border-radius: 4px; } -`);var n=document.getElementById(`pluginStyles`);n?n.innerHTML=t:(n=document.createElement(`style`),n.id=`pluginStyles`,n.innerHTML=t,document.getElementsByTagName(`head`)[0].appendChild(n));var r=e.type||`light`,i=document.body;i.classList.remove(`theme-dark`),i.classList.remove(`theme-light`),i.classList.add(`theme-`+r)};function x(){for(var e=document.getElementsByClassName(`i18n`),t=function(){var t=e[n];if(!(t instanceof HTMLElement))return 1;[`placeholder`,`title`].forEach(function(e){t.hasAttribute(e)&&t.setAttribute(e,Y(t.getAttribute(e)||``))});var r=Y(t.innerText.trim().replace(/\s+/g,` `));r&&(t.innerText=r)},n=0;n0&&(e.items=e.items.map(function(t){return t=N(t),t[n?`groupID`:`userID`]=e.id,i(t),t})),l.displaySearchItems(e,t,a)}function N(e){if(e.id||!e.key)return e;var t={id:e.key,title:e.data.title,type:e.data.itemType};return Object.hasOwnProperty.call(e,`url`)&&(t.URL=e.data.url),Object.hasOwnProperty.call(e,`volume`)&&(t.volume=e.data.volume),Object.hasOwnProperty.call(e,`language`)&&(t.language=e.data.language),Object.hasOwnProperty.call(e,`abstract`)&&(t.abstract=e.data.abstract),Object.hasOwnProperty.call(e,`note`)&&(t.note=e.data.note),Object.hasOwnProperty.call(e,`page`)&&(t.page=e.data.page),Object.hasOwnProperty.call(e,`shortTitle`)&&(t.shortTitle=e.data.shortTitle),Object.hasOwnProperty.call(e,`links`)&&(t.uris=[],Object.hasOwnProperty.call(e.links,`self`)&&t.uris.push(e.links.self.href),Object.hasOwnProperty.call(e.links,`alternate`)&&t.uris.push(e.links.alternate.href)),t}function P(e){e===void 0&&(e=l.count()),e<=0?(d.disable(),d.setText(Y(`Insert/Edit Citation`))):(!o&&d.enable(),e>1?d.setText(Y(`Insert `+e+` Citations`)):d.setText(Y(`Insert/Edit Citation`)))}function F(){return I.apply(this,arguments)}function I(){return I=s(w().m(function e(){var t,n,r;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,new Promise(function(e){Asc.plugin.executeMethod(`GetVersion`,[],e)});case 1:for(t=e.v,t==`develop`&&(t=`99.99.99`),n=t.split(`.`);3>n.length;)n.push(`0`);return e.a(2,1e6*parseInt(n[0])+1e3*parseInt(n[1])+parseInt(n[2]));case 2:return e.p=2,r=e.v,console.error(r),e.a(2,99999999)}},e,null,[[0,2]])})),I.apply(this,arguments)}function L(){var e=new Asc.ButtonContextMenu;e.text=`Edit citation`,e.addCheckers(`Target`,`Selection`),e.attachOnClick(s(w().m(function e(){var t;return w().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,new Promise(function(e){window.Asc.plugin.executeMethod(`GetCurrentAddinField`,void 0,e)});case 1:return t=e.v,e.n=2,C(!1,`Zotero (`+Y(`Updating citations`)+`)`);case 2:return e.n=3,ee(t);case 3:return e.n=4,E(!1,`Zotero (`+Y(`Updating citations`)+`)`);case 4:return e.a(2)}},e)}))),Asc.Buttons.registerContextMenu()}function ee(e){return te.apply(this,arguments)}function te(){return te=s(w().m(function e(t){var n,a,o;return w().w(function(e){for(;;)switch(e.n){case 0:if(!(!t||!t.Value||t.Value.toLowerCase().indexOf(`zotero_item`)===-1)){e.n=1;break}return i.showWarningMessage(`No Zotero citation found at the cursor. Please click directly on a citation to edit it.`),e.a(2,!1);case 1:return e.n=2,i.showEditCitationWindow(t);case 2:if(n=e.v,n){e.n=3;break}return e.a(2,!1);case 3:return a=i.updateItem.bind(i,n),o=r.getStyleManager(),o.getLastUsedFormat()===`note`&&(a=i.updateItem.bind(i,n,o.getLastUsedNotesStyle())),e.a(2,a().then(function(){return t&&i.moveCursorOutsideField(t.FieldId),!0}).catch(function(e){console.error(e);var t=Y(`Failed to insert citation`);return typeof e==`string`&&(t+=`. `+Y(e)),S(t),!1}))}},e)})),te.apply(this,arguments)}})()}); +`);var n=document.getElementById(`pluginStyles`);n?n.innerHTML=t:(n=document.createElement(`style`),n.id=`pluginStyles`,n.innerHTML=t,document.getElementsByTagName(`head`)[0].appendChild(n));var r=e.type||`light`,i=document.body;i.classList.remove(`theme-dark`),i.classList.remove(`theme-light`),i.classList.add(`theme-`+r)};function A(){for(var e=document.getElementsByClassName(`i18n`),t=function(){var t=e[n];if(!(t instanceof HTMLElement))return 1;[`placeholder`,`title`].forEach(function(e){t.hasAttribute(e)&&t.setAttribute(e,X(t.getAttribute(e)||``))});var r=X(t.innerText.trim().replace(/\s+/g,` `));r&&(t.innerText=r)},n=0;n0&&(e.items=e.items.map(function(t){return t=V(t),t[n?`groupID`:`userID`]=String(e.id),i(t),t})),T().then(function(n){return u.setUsedItemKeys(n),u.displaySearchItems(e,t,a)})}var ie={artwork:`graphic`,audioRecording:`song`,bill:`bill`,blogPost:`post-weblog`,book:`book`,bookSection:`chapter`,case:`legal_case`,computerProgram:`software`,conferencePaper:`paper-conference`,dictionaryEntry:`entry-dictionary`,document:`document`,email:`personal_communication`,encyclopediaEntry:`entry-encyclopedia`,film:`motion_picture`,forumPost:`post`,hearing:`hearing`,instantMessage:`personal_communication`,interview:`interview`,journalArticle:`article-journal`,letter:`personal_communication`,magazineArticle:`article-magazine`,manuscript:`manuscript`,map:`map`,newspaperArticle:`article-newspaper`,patent:`patent`,podcast:`song`,presentation:`speech`,radioBroadcast:`broadcast`,report:`report`,statute:`legislation`,thesis:`thesis`,tvBroadcast:`broadcast`,videoRecording:`motion_picture`,webpage:`webpage`};function V(e){if(e.id||!e.key)return e;var t=e.data||{},n={id:e.key,title:t.title||``,type:ie[t.itemType]||t.itemType||``};if(Array.isArray(t.creators)&&t.creators.forEach(function(e){var t={};e.firstName&&(t.given=e.firstName),e.lastName&&(t.family=e.lastName),e.name&&(t.literal=e.name);var r=e.creatorType||`author`;n[r]||(n[r]=[]),n[r].push(t)}),t.date){var r=t.date.replace(/\//g,`-`).split(`-`).map(Number).filter(function(e){return!isNaN(e)});r.length&&(n.issued={"date-parts":[r]})}return t.url&&(n.URL=t.url),t.volume&&(n.volume=t.volume),t.issue&&(n.issue=t.issue),t.pages&&(n.page=t.pages),t.edition&&(n.edition=t.edition),t.language&&(n.language=t.language),t.abstractNote&&(n.abstract=t.abstractNote),t.note&&(n.note=t.note),t.shortTitle&&(n.shortTitle=t.shortTitle),t.publisher&&(n.publisher=t.publisher),t.place&&(n[`publisher-place`]=t.place),t.DOI&&(n.DOI=t.DOI),t.ISBN&&(n.ISBN=t.ISBN),t.ISSN&&(n.ISSN=t.ISSN),t.publicationTitle&&(n[`container-title`]=t.publicationTitle),t.bookTitle&&(n[`container-title`]=t.bookTitle),t.series&&(n[`collection-title`]=t.series),t.seriesNumber&&(n[`collection-number`]=t.seriesNumber),t.numberOfVolumes&&(n[`number-of-volumes`]=t.numberOfVolumes),t.numPages&&(n[`number-of-pages`]=t.numPages),e.links&&(n.uris=[],e.links.self&&n.uris.push(e.links.self.href),e.links.alternate&&n.uris.push(e.links.alternate.href)),n}function ae(e){if(e===void 0&&(e=u.count()),f){e<=0?(g.disable(),g.setText(X(`Update Citation`))):(g.enable(),g.setText(X(`Update Citation`)));return}e<=0?(g.disable(),g.setText(X(`Insert/Edit Citation`))):(!o&&g.enable(),e>1?g.setText(X(`Insert `+e+` Citations`)):g.setText(X(`Insert/Edit Citation`)))}function H(){return U.apply(this,arguments)}function U(){return U=s(E().m(function e(){var t,n,r,a,o,s;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,new Promise(function(e){window.Asc.plugin.executeMethod(`GetCurrentAddinField`,void 0,e)});case 1:if(t=e.v,!(!t||!t.Value||t.Value.toLowerCase().indexOf(`zotero_item`)===-1)){e.n=2;break}return i.showWarningMessage(X(`No Zotero citation found at the cursor. Please click directly on a citation to edit it.`)),e.a(2);case 2:if(n=t.Value.indexOf(`{`),r=t.Value.lastIndexOf(`}`),!(n===-1||r===-1||r0){for(;i<=n;i++){var a=e.Get(`ZOTERO_PREF_`+i);if(a==null||a===``)break;r+=String(a)}return r}for(;;){var o=e.Get(`ZOTERO_PREF_`+i);if(o==null||o===``)break;r+=String(o),i++}return r},!1,!0,function(t){return e(t||``)})});case 1:if(t=e.v,t){e.n=2;break}return e.a(2);case 2:try{n=new DOMParser,r=n.parseFromString(t,`text/xml`),i=r.querySelector(`style`),i&&(a=i.getAttribute(`id`)||``,o=i.getAttribute(`locale`)||``,a&&(s=a.replace(/^.*\/styles\//,``),s&&localStorage.setItem(`zoteroStyleId`,s)),o&&localStorage.setItem(`zoteroLang`,o),c=i.getAttribute(`hasBibliography`),c!==null&&localStorage.setItem(`zoteroContainBibliography`,c===`1`||c===`true`?`true`:`false`)),l=r.querySelector(`pref[name="noteType"]`),l&&(u=l.getAttribute(`value`),u===`1`?(localStorage.setItem(`zoteroNotesStyleId`,`footnotes`),localStorage.setItem(`zoteroFormatId`,`note`)):u===`2`&&(localStorage.setItem(`zoteroNotesStyleId`,`endnotes`),localStorage.setItem(`zoteroFormatId`,`note`))),d=r.querySelector(`pref[name="hasBibliography"]`),d&&(f=d.getAttribute(`value`),f!==null&&localStorage.setItem(`zoteroContainBibliography`,f===`true`?`true`:`false`))}catch(e){console.error(`Failed to parse ZOTERO_PREF XML:`,e)}case 3:return e.a(2)}},e)})),se.apply(this,arguments)}function ce(){var e=r.getStyleManager(),t=e.getLastUsedStyleId();if(!t)return Promise.resolve();var n=r.getLocalesManager().getLastUsedLanguage()||`en-US`,i=e.getLastUsedFormat(),a=e.getLastUsedNotesStyle(),o=`0`;i===`note`&&(o=a===`endnotes`?`2`:`1`);for(var s=e.isLastUsedStyleContainBibliography()?`1`:`0`,c=`