textbrowser 0.42.5 → 0.42.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # textbrowser CHANGES
2
2
 
3
+ ## 0.42.6
4
+
5
+ - fix: remove logging
6
+
3
7
  ## 0.42.5
4
8
 
5
9
  - fix: try fixing cwd for `import`
@@ -4477,8 +4477,6 @@ const getWorkData = async function ({
4477
4477
  : process.cwd() + '/'
4478
4478
  );
4479
4479
 
4480
- console.log('cwd-textbrowser', cwd);
4481
-
4482
4480
  const [schemaObj, pluginObjects] = await Promise.all([
4483
4481
  getMetadata(schemaFile, schemaProperty, basePath),
4484
4482
  getPlugins
package/dist/index-es.js CHANGED
@@ -14592,7 +14592,6 @@ const getWorkData = async function ({
14592
14592
 
14593
14593
  const pluginFieldMappings = pluginFieldMappingForWork;
14594
14594
  const cwd = typeof process === 'undefined' ? location.href.slice(0, location.href.lastIndexOf('/') + 1) : process.cwd() + '/';
14595
- console.log('cwd-textbrowser', cwd);
14596
14595
  const [schemaObj, pluginObjects] = await Promise.all([getMetadata(schemaFile, schemaProperty, basePath), getPlugins ? Promise.all(pluginPaths.map(pluginPath => {
14597
14596
  // eslint-disable-next-line no-unsanitized/method
14598
14597
  return import(cwd + pluginPath);
@@ -16,4 +16,4 @@ PERFORMANCE OF THIS SOFTWARE.
16
16
  /*! Native Promise Only
17
17
  v0.8.1 (c) Kyle Simpson
18
18
  MIT License: http://getify.mit-license.org
19
- */u=function(){var e,t,n,r=Object.prototype.toString,o=void 0!==i?function(e){return i(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(t){e=function(e,t,n){return e[t]=n,e}}function a(e,r){n.add(e,r),t||(t=o(n.drain))}function s(e){var t,n=void 0===e?"undefined":l(e);return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function u(){for(var e=0;e<this.chain.length;e++)c(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(i=s(r))?i.call(r,n.resolve,n.reject):n.resolve(r)}catch(e){n.reject(e)}}function f(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(u,t))}function p(e,t,n,r){for(var i=0;i<t.length;i++)!function(i){e.resolve(t[i]).then((function(e){n(i,e)}),r)}(i)}function h(e){this.def=e,this.triggered=!1}function d(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function g(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new d(this);this.then=function(e,n){var r={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return r.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");r.resolve=e,r.reject=t})),t.chain.push(r),0!==t.state&&a(u,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){(function e(t){var n,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(n=s(t))?a((function(){var i=new h(r);try{n.call(t,(function(){e.apply(i,arguments)}),(function(){f.apply(i,arguments)}))}catch(e){f.call(i,e)}})):(r.msg=t,r.state=1,r.chain.length>0&&a(u,r))}catch(e){f.call(new h(r),e)}}}).call(t,e)}),(function(e){f.call(t,e)}))}catch(e){f.call(t,e)}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,o){r=new i(t,o),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();var m=e({},"constructor",g,!1);return g.prototype=m,e(m,"__NPO__",0,!1),e(g,"resolve",(function(e){return e&&"object"==(void 0===e?"undefined":l(e))&&1===e.__NPO__?e:new this((function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)}))})),e(g,"reject",(function(e){return new this((function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)}))})),e(g,"all",(function(e){var t=this;return"[object Array]"!=r.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");var i=e.length,o=Array(i),a=0;p(t,e,(function(e,t){o[e]=t,++a===i&&n(o)}),r)}))})),e(g,"race",(function(e){var t=this;return"[object Array]"!=r.call(e)?t.reject(TypeError("Not an array")):new t((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");p(t,e,(function(e,t){n(t)}),r)}))})),g},(s=void 0!==r?r:void 0)[a="Promise"]=s[a]||u(),e.exports?e.exports=s[a]:void 0===(o=function(){return s[a]}.call(t,n,t,e))||(e.exports=o)}).call(this,n(1),n(43).setImmediate)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.buildExps=i;var r=n(6);function i(e){var t=(0,r.merge)("[0-9]","[A-Fa-f]"),n=(0,r.subexp)((0,r.subexp)("%[EFef]"+t+"%"+t+t+"%"+t+t)+"|"+(0,r.subexp)("%[89A-Fa-f]"+t+"%"+t+t)+"|"+(0,r.subexp)("%"+t+t)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",o=(0,r.merge)("[\\:\\/\\?\\#\\[\\]\\@]",i),a=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",s=e?"[\\uE000-\\uF8FF]":"[]",u=(0,r.merge)("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",a),l=(0,r.subexp)("[A-Za-z]"+(0,r.merge)("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),c=(0,r.subexp)((0,r.subexp)(n+"|"+(0,r.merge)(u,i,"[\\:]"))+"*"),f=(0,r.subexp)((0,r.subexp)("25[0-5]")+"|"+(0,r.subexp)("2[0-4][0-9]")+"|"+(0,r.subexp)("1[0-9][0-9]")+"|"+(0,r.subexp)("[1-9][0-9]")+"|[0-9]"),p=(0,r.subexp)(f+"\\."+f+"\\."+f+"\\."+f),h=(0,r.subexp)(t+"{1,4}"),d=(0,r.subexp)((0,r.subexp)(h+"\\:"+h)+"|"+p),g=(0,r.subexp)((0,r.subexp)(h+"\\:")+"{6}"+d),m=(0,r.subexp)("\\:\\:"+(0,r.subexp)(h+"\\:")+"{5}"+d),y=(0,r.subexp)((0,r.subexp)(h)+"?\\:\\:"+(0,r.subexp)(h+"\\:")+"{4}"+d),v=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+(0,r.subexp)(h+"\\:")+"{3}"+d),b=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+(0,r.subexp)(h+"\\:")+"{2}"+d),_=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),w=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),E=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),x=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),S=(0,r.subexp)([g,m,y,v,b,_,w,E,x].join("|")),O=(0,r.subexp)("[vV]"+t+"+\\."+(0,r.merge)(u,i,"[\\:]")+"+"),P=(0,r.subexp)("\\["+(0,r.subexp)(S+"|"+O)+"\\]"),T=(0,r.subexp)((0,r.subexp)(n+"|"+(0,r.merge)(u,i))+"*"),A=(0,r.subexp)(P+"|"+p+"(?!"+T+")|"+T),k=(0,r.subexp)("[0-9]*"),C=(0,r.subexp)((0,r.subexp)(c+"@")+"?"+A+(0,r.subexp)("\\:"+k)+"?"),N=(0,r.subexp)(n+"|"+(0,r.merge)(u,i,"[\\:\\@]")),L=(0,r.subexp)(N+"*"),I=(0,r.subexp)(N+"+"),j=(0,r.subexp)((0,r.subexp)(n+"|"+(0,r.merge)(u,i,"[\\@]"))+"+"),D=(0,r.subexp)((0,r.subexp)("\\/"+L)+"*"),R=(0,r.subexp)("\\/"+(0,r.subexp)(I+D)+"?"),F=(0,r.subexp)(j+D),U=(0,r.subexp)(I+D),$="(?!"+N+")",M=((0,r.subexp)(D+"|"+R+"|"+F+"|"+U+"|"+$),(0,r.subexp)((0,r.subexp)(N+"|"+(0,r.merge)("[\\/\\?]",s))+"*")),z=(0,r.subexp)((0,r.subexp)(N+"|[\\/\\?]")+"*"),q=(0,r.subexp)((0,r.subexp)("\\/\\/"+C+D)+"|"+R+"|"+U+"|"+$),G=(0,r.subexp)(l+"\\:"+q+(0,r.subexp)("\\?"+M)+"?"+(0,r.subexp)("\\#"+z)+"?"),B=(0,r.subexp)((0,r.subexp)("\\/\\/"+C+D)+"|"+R+"|"+F+"|"+$),V=(0,r.subexp)(B+(0,r.subexp)("\\?"+M)+"?"+(0,r.subexp)("\\#"+z)+"?");return(0,r.subexp)(G+"|"+V),(0,r.subexp)(l+"\\:"+q+(0,r.subexp)("\\?"+M)+"?"),(0,r.subexp)((0,r.subexp)("\\/\\/("+(0,r.subexp)("("+c+")@")+"?("+A+")"+(0,r.subexp)("\\:("+k+")")+"?)")+"?("+D+"|"+R+"|"+U+"|"+$+")"),(0,r.subexp)("\\?("+M+")"),(0,r.subexp)("\\#("+z+")"),(0,r.subexp)((0,r.subexp)("\\/\\/("+(0,r.subexp)("("+c+")@")+"?("+A+")"+(0,r.subexp)("\\:("+k+")")+"?)")+"?("+D+"|"+R+"|"+F+"|"+$+")"),(0,r.subexp)("\\?("+M+")"),(0,r.subexp)("\\#("+z+")"),(0,r.subexp)((0,r.subexp)("\\/\\/("+(0,r.subexp)("("+c+")@")+"?("+A+")"+(0,r.subexp)("\\:("+k+")")+"?)")+"?("+D+"|"+R+"|"+U+"|"+$+")"),(0,r.subexp)("\\?("+M+")"),(0,r.subexp)("\\#("+z+")"),(0,r.subexp)("("+c+")@"),(0,r.subexp)("\\:("+k+")"),{NOT_SCHEME:new RegExp((0,r.merge)("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp((0,r.merge)("[^\\%\\:]",u,i),"g"),NOT_HOST:new RegExp((0,r.merge)("[^\\%\\[\\]\\:]",u,i),"g"),NOT_PATH:new RegExp((0,r.merge)("[^\\%\\/\\:\\@]",u,i),"g"),NOT_PATH_NOSCHEME:new RegExp((0,r.merge)("[^\\%\\/\\@]",u,i),"g"),NOT_QUERY:new RegExp((0,r.merge)("[^\\%]",u,i,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp((0,r.merge)("[^\\%]",u,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp((0,r.merge)("[^]",u,i),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp((0,r.merge)("[^\\%]",u,o),"g"),PCT_ENCODED:new RegExp(n,"g"),IPV6ADDRESS:new RegExp("\\[?("+S+")\\]?","g")}}t.default=i(!1)},function(e,t,n){(function(e,r){var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a){var s="object"==o(t)&&t&&!t.nodeType&&t,u="object"==o(e)&&e&&!e.nodeType&&e,l="object"==(void 0===r?"undefined":o(r))&&r;l.global!==l&&l.window!==l&&l.self!==l||(a=l);var c,f,p=2147483647,h=36,d=/^xn--/,g=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=Math.floor,b=String.fromCharCode;function _(e){throw new RangeError(y[e])}function w(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+w((e=e.replace(m,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function S(e){return w(e,(function(e){var t="";return e>65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+b(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?v(e/700):e>>1,e+=v(e/t);e>455;r+=h)e=v(e/35);return v(r+36*e/(e+38))}function T(e){var t,n,r,i,o,a,s,u,l,c,f,d=[],g=e.length,m=0,y=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&_("not-basic"),d.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=m,a=1,s=h;i>=g&&_("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||u>v((p-m)/a))&&_("overflow"),m+=u*a,!(u<(l=s<=b?1:s>=b+26?26:s-b));s+=h)a>v(p/(c=h-l))&&_("overflow"),a*=c;b=P(m-o,t=d.length+1,0==o),v(m/t)>p-y&&_("overflow"),y+=v(m/t),m%=t,d.splice(m++,0,y)}return S(d)}function A(e){var t,n,r,i,o,a,s,u,l,c,f,d,g,m,y,w=[];for(d=(e=x(e)).length,t=128,n=0,o=72,a=0;a<d;++a)(f=e[a])<128&&w.push(b(f));for(r=i=w.length,i&&w.push("-");r<d;){for(s=p,a=0;a<d;++a)(f=e[a])>=t&&f<s&&(s=f);for(s-t>v((p-n)/(g=r+1))&&_("overflow"),n+=(s-t)*g,t=s,a=0;a<d;++a)if((f=e[a])<t&&++n>p&&_("overflow"),f==t){for(u=n,l=h;!(u<(c=l<=o?1:l>=o+26?26:l-o));l+=h)y=u-c,m=h-c,w.push(b(O(c+y%m,0))),u=v(y/m);w.push(b(O(u,0))),o=P(n,g,r==i),n=0,++r}++n,++t}return w.join("")}if(c={version:"1.4.1",ucs2:{decode:x,encode:S},decode:T,encode:A,toASCII:function(e){return E(e,(function(e){return g.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return E(e,(function(e){return d.test(e)?T(e.slice(4).toLowerCase()):e}))}},"object"==o(n(3))&&n(3))void 0===(i=function(){return c}.call(t,n,t,e))||(e.exports=i);else if(s&&u)if(e.exports==s)u.exports=c;else for(f in c)c.hasOwnProperty(f)&&(s[f]=c[f]);else a.punycode=c}(void 0)}).call(this,n(8)(e),n(1))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}}},function(e,t,n){(function(t){var r=n(7),i=n(21),o=n(34),a=n(35),s=n(45),u=n(48),l=n(49),c=/~(?:[^01]|$)/g,f={},p=["relative","remote"],h=["absolute","uri"],d={};function g(e,t){r.isString(e)&&(e=u(e)),r.isString(t)&&(t=u(t));var n,i,a=O(r.isUndefined(t)?"":t);return h.indexOf(a.reference)>-1?i=a:(n=r.isUndefined(e)?void 0:O(e),r.isUndefined(n)?i=a:((i=n).path=u(o.join(n.path,a.path)),i.query=function(e,t){var n={};function i(e){r.forOwn(e,(function(e,t){n[t]=e}))}return i(s.parse(e||"")),i(s.parse(t||"")),0===Object.keys(n).length?void 0:s.stringify(n)}(n.query,a.query))),i.fragment=void 0,(-1===h.indexOf(i.reference)&&0===i.path.indexOf("../")?"../":"")+l.serialize(i)}function m(e){return p.indexOf(_(e))>-1}function y(e){return r.isUndefined(e.error)&&"invalid"!==e.type}function v(e,t){var n=e;return t.forEach((function(e){if(!(e in n))throw Error("JSON Pointer points to missing location: "+I(t));n=n[e]})),n}function b(e){return Object.keys(e).filter((function(e){return"$ref"!==e}))}function _(e){var t;switch(e.uriDetails.reference){case"absolute":case"uri":t="remote";break;case"same-document":t="local";break;default:t=e.uriDetails.reference}return t}function w(e,t){var n=f[e],i=Promise.resolve(),o=r.cloneDeep(t.loaderOptions||{});return r.isUndefined(n)?(r.isUndefined(o.processContent)&&(o.processContent=function(e,t){t(void 0,JSON.parse(e.text))}),i=(i=a.load(decodeURI(e),o)).then((function(t){return f[e]={value:t},t})).catch((function(t){throw f[e]={error:t},t}))):i=i.then((function(){if(r.isError(n.error))throw n.error;return n.value})),i.then((function(e){return r.cloneDeep(e)}))}function E(e,t){var n=!0;try{if(!r.isPlainObject(e))throw new Error("obj is not an Object");if(!r.isString(e.$ref))throw new Error("obj.$ref is not a String")}catch(e){if(t)throw e;n=!1}return n}function x(e){return-1!==e.indexOf("://")||o.isAbsolute(e)?e:o.resolve(t.cwd(),e)}function S(e,t){e.error=t.message,e.missing=!0}function O(e){return l.parse(e)}function P(e,t){var n,i;if(e=r.isUndefined(e)?{}:r.cloneDeep(e),!r.isObject(e))throw new TypeError("options must be an Object");if(!r.isUndefined(e.resolveCirculars)&&!r.isBoolean(e.resolveCirculars))throw new TypeError("options.resolveCirculars must be a Boolean");if(!(r.isUndefined(e.filter)||r.isArray(e.filter)||r.isFunction(e.filter)||r.isString(e.filter)))throw new TypeError("options.filter must be an Array, a Function of a String");if(!r.isUndefined(e.includeInvalid)&&!r.isBoolean(e.includeInvalid))throw new TypeError("options.includeInvalid must be a Boolean");if(!r.isUndefined(e.location)&&!r.isString(e.location))throw new TypeError("options.location must be a String");if(!r.isUndefined(e.refPreProcessor)&&!r.isFunction(e.refPreProcessor))throw new TypeError("options.refPreProcessor must be a Function");if(!r.isUndefined(e.refPostProcessor)&&!r.isFunction(e.refPostProcessor))throw new TypeError("options.refPostProcessor must be a Function");if(!r.isUndefined(e.subDocPath)&&!r.isArray(e.subDocPath)&&!N(e.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(r.isUndefined(e.resolveCirculars)&&(e.resolveCirculars=!1),e.filter=function(e){var t,n;return r.isArray(e.filter)||r.isString(e.filter)?(n=r.isString(e.filter)?[e.filter]:e.filter,t=function(e){return n.indexOf(e.type)>-1||n.indexOf(_(e))>-1}):r.isFunction(e.filter)?t=e.filter:r.isUndefined(e.filter)&&(t=function(){return!0}),function(n,r){return("invalid"!==n.type||!0===e.includeInvalid)&&t(n,r)}}(e),r.isUndefined(e.location)&&(e.location=x("./root.json")),(n=e.location.split("#")).length>1&&(e.subDocPath="#"+n[1]),i=decodeURI(e.location)===e.location,e.location=g(e.location,void 0),i&&(e.location=decodeURI(e.location)),e.subDocPath=function(e){var t;return r.isArray(e.subDocPath)?t=e.subDocPath:r.isString(e.subDocPath)?t=L(e.subDocPath):r.isUndefined(e.subDocPath)&&(t=[]),t}(e),!r.isUndefined(t))try{v(t,e.subDocPath)}catch(e){throw e.message=e.message.replace("JSON Pointer","options.subDocPath"),e}return e}function T(e){if(!r.isArray(e))throw new TypeError("path must be an array");return e.map((function(e){return r.isString(e)||(e=JSON.stringify(e)),e.replace(/~1/g,"/").replace(/~0/g,"~")}))}function A(e){if(!r.isArray(e))throw new TypeError("path must be an array");return e.map((function(e){return r.isString(e)||(e=JSON.stringify(e)),e.replace(/~/g,"~0").replace(/\//g,"~1")}))}function k(e,t){var n={};if(!r.isArray(e)&&!r.isObject(e))throw new TypeError("obj must be an Array or an Object");return function e(t,n,i,o){var a=!0;function s(n,r){i.push(r),e(t,n,i,o),i.pop()}r.isFunction(o)&&(a=o(t,n,i)),-1===t.indexOf(n)&&(t.push(n),!1!==a&&(r.isArray(n)?n.forEach((function(e,t){s(e,t.toString())})):r.isObject(n)&&r.forOwn(n,(function(e,t){s(e,t)}))),t.pop())}(function(e,t){var n,r=[];return t.length>0&&(n=e,t.slice(0,t.length-1).forEach((function(e){e in n&&(n=n[e],r.push(n))}))),r}(e,(t=P(t,e)).subDocPath),v(e,t.subDocPath),r.cloneDeep(t.subDocPath),(function(e,i,o){var a,s,u=!0;return E(i)&&(r.isUndefined(t.refPreProcessor)||(i=t.refPreProcessor(r.cloneDeep(i),o)),a=C(i),r.isUndefined(t.refPostProcessor)||(a=t.refPostProcessor(a,o)),t.filter(a,o)&&(s=I(o),n[s]=a),b(i).length>0&&(u=!1)),u})),n}function C(e){var t,n,i,o={def:e};try{if(E(e,!0)){if(t=e.$ref,i=d[t],r.isUndefined(i)&&(i=d[t]=O(t)),o.uri=t,o.uriDetails=i,r.isUndefined(i.error)){o.type=_(o);try{["#","/"].indexOf(t[0])>-1?N(t,!0):t.indexOf("#")>-1&&N(i.fragment,!0)}catch(e){o.error=e.message,o.type="invalid"}}else o.error=o.uriDetails.error,o.type="invalid";(n=b(e)).length>0&&(o.warning="Extra JSON Reference properties will be ignored: "+n.join(", "))}else o.type="invalid"}catch(e){o.error=e.message,o.type="invalid"}return o}function N(e,t){var n,i=!0;try{if(!r.isString(e))throw new Error("ptr is not a String");if(""!==e){if(n=e.charAt(0),-1===["#","/"].indexOf(n))throw new Error("ptr must start with a / or #/");if("#"===n&&"#"!==e&&"/"!==e.charAt(1))throw new Error("ptr must start with a / or #/");if(e.match(c))throw new Error("ptr has invalid token(s)")}}catch(e){if(!0===t)throw e;i=!1}return i}function L(e){try{N(e,!0)}catch(e){throw new Error("ptr must be a JSON Pointer: "+e.message)}var t=e.split("/");return t.shift(),T(t)}function I(e,t){if(!r.isArray(e))throw new Error("path must be an Array");return(!1!==t?"#":"")+(e.length>0?"/":"")+A(e).join("/")}function j(e,t){var n=Promise.resolve();return n.then((function(){if(!r.isArray(e)&&!r.isObject(e))throw new TypeError("obj must be an Array or an Object");t=P(t,e),e=r.cloneDeep(e)})).then((function(){var n={deps:{},docs:{},refs:{}};return function e(t,n,i){var a,s,u=Promise.resolve(),l=I(n.subDocPath),c=x(n.location),f=o.dirname(n.location),p=c+l;return r.isUndefined(i.docs[c])&&(i.docs[c]=t),r.isUndefined(i.deps[p])&&(i.deps[p]={},a=k(t,n),r.forOwn(a,(function(o,a){var c,h,d=x(n.location)+a,v=o.refdId=decodeURI(x(m(o)?g(f,o.uri):n.location)+"#"+(o.uri.indexOf("#")>-1?o.uri.split("#")[1]:""));i.refs[d]=o,y(o)&&(o.fqURI=v,i.deps[p][a===l?"#":a.replace(l+"/","#/")]=v,0!==d.indexOf(v+"/")?((s=r.cloneDeep(n)).subDocPath=r.isUndefined(o.uriDetails.fragment)?[]:L(decodeURI(o.uriDetails.fragment)),m(o)?(delete s.filter,s.location=v.split("#")[0],u=u.then((c=i,h=s,function(){var e=x(h.location),t=c.docs[e];return r.isUndefined(t)?w(e,h).catch((function(t){return c.docs[e]=t,t})):Promise.resolve().then((function(){return t}))}))):u=u.then((function(){return t})),u=u.then(function(t,n,i){return function(o){if(r.isError(o))S(i,o);else try{return e(o,n,t).catch((function(e){S(i,e)}))}catch(e){S(i,e)}}}(i,s,o))):o.circular=!0)}))),u}(e,t,n).then((function(){return n}))})).then((function(e){var n={},a=[],s=[],u=new i.Graph,l=x(t.location),c=l+I(t.subDocPath),f=o.dirname(l);return Object.keys(e.deps).forEach((function(e){u.setNode(e)})),r.forOwn(e.deps,(function(e,t){r.forOwn(e,(function(e){u.setEdge(t,e)}))})),(a=i.alg.findCycles(u)).forEach((function(e){e.forEach((function(e){-1===s.indexOf(e)&&s.push(e)}))})),r.forOwn(e.deps,(function(t,n){r.forOwn(t,(function(t,r){var i,o=!1,u=n+r.slice(1),l=e.refs[n+r.slice(1)],c=m(l);s.indexOf(t)>-1&&a.forEach((function(e){o||(i=e.indexOf(t))>-1&&e.forEach((function(n){o||0===u.indexOf(n+"/")&&(c&&i!==e.length-1&&"#"===t[t.length-1]||(o=!0))}))})),o&&(l.circular=!0)}))})),r.forOwn(Object.keys(e.deps).reverse(),(function(n){var i=e.deps[n],o=n.split("#"),a=e.docs[o[0]],s=L(o[1]);r.forOwn(i,(function(n,i){var u,l,c,f=n.split("#"),p=e.docs[f[0]],h=s.concat(L(i)),d=e.refs[o[0]+I(h)];if(r.isUndefined(d.error)&&r.isUndefined(d.missing))if(!t.resolveCirculars&&d.circular)d.value=d.def;else{try{d.value=v(p,L(f[1]))}catch(e){return void S(d,e)}""===o[1]&&"#"===i?e.docs[o[0]]=d.value:(u=a,l=h,c=d.value,v(u,l.slice(0,l.length-1))[l[l.length-1]]=c)}}))})),Object.keys(e.refs).forEach((function(i){var o,a,s=e.refs[i];"invalid"!==s.type&&("#"===s.fqURI[s.fqURI.length-1]&&"#"!==s.uri[s.uri.length-1]&&(s.fqURI=s.fqURI.substr(0,s.fqURI.length-1)),o=s.fqURI.split("/"),a=s.uri.split("/"),r.times(a.length-1,(function(e){var t=a[a.length-e-1],n=o.length-e-1,r=o[n];"."!==t&&".."!==t||(t=r),o[n]=t})),s.fqURI=o.join("/"),0===s.fqURI.indexOf(l)?s.fqURI=s.fqURI.replace(l,""):0===s.fqURI.indexOf(f)&&(s.fqURI=s.fqURI.replace(f,"")),"/"===s.fqURI[0]&&(s.fqURI="."+s.fqURI)),0===i.indexOf(c)&&function r(i,o,a){var s,u=o.split("#"),l=e.refs[o];n[u[0]===t.location?"#"+u[1]:I(t.subDocPath.concat(a))]=l,!l.circular&&y(l)?(s=e.deps[l.refdId],0!==l.refdId.indexOf(i)&&Object.keys(s).forEach((function(e){r(l.refdId,l.refdId+e.substr(1),a.concat(L(e)))}))):!l.circular&&l.error&&(l.error=l.error.replace("options.subDocPath","JSON Pointer"),l.error.indexOf("#")>-1&&(l.error=l.error.replace(l.uri.substr(l.uri.indexOf("#")),l.uri)),0!==l.error.indexOf("ENOENT:")&&0!==l.error.indexOf("Not Found")||(l.error="JSON Pointer points to missing location: "+l.uri))}(c,i,L(i.substr(c.length)))})),r.forOwn(e.refs,(function(e){delete e.refdId,e.missing&&(e.error=e.error.split(": ")[0]+": "+e.def.$ref)})),{refs:n,resolved:e.docs[l]}}))}"undefined"==typeof Promise&&n(16),e.exports.clearCache=function(){f={}},e.exports.decodePath=function(e){return T(e)},e.exports.encodePath=function(e){return A(e)},e.exports.findRefs=function(e,t){return k(e,t)},e.exports.findRefsAt=function(e,t){return function(e,t){var n=Promise.resolve();return n.then((function(){if(!r.isString(e))throw new TypeError("location must be a string");return r.isUndefined(t)&&(t={}),r.isObject(t)&&(t.location=e),w((t=P(t)).location,t)})).then((function(e){var n=r.cloneDeep(f[t.location]),i=r.cloneDeep(t),o=O(t.location);return r.isUndefined(n.refs)&&(delete i.filter,delete i.subDocPath,i.includeInvalid=!0,f[t.location].refs=k(e,i)),r.isUndefined(t.filter)||(i.filter=t.filter),r.isUndefined(o.fragment)?r.isUndefined(o.subDocPath)||(i.subDocPath=t.subDocPath):i.subDocPath=L(decodeURI(o.fragment)),{refs:k(e,i),value:e}}))}(e,t)},e.exports.getRefDetails=function(e){return C(e)},e.exports.isPtr=function(e,t){return N(e,t)},e.exports.isRef=function(e,t){return function(e,t){return E(e,t)&&"invalid"!==C(e).type}(e,t)},e.exports.pathFromPtr=function(e){return L(e)},e.exports.pathToPtr=function(e,t){return I(e,t)},e.exports.resolveRefs=function(e,t){return j(e,t)},e.exports.resolveRefsAt=function(e,t){return function(e,t){var n=Promise.resolve();return n.then((function(){if(!r.isString(e))throw new TypeError("location must be a string");return r.isUndefined(t)&&(t={}),r.isObject(t)&&(t.location=e),w((t=P(t)).location,t)})).then((function(e){var n=r.cloneDeep(t),i=O(t.location);return r.isUndefined(i.fragment)||(n.subDocPath=L(decodeURI(i.fragment))),j(e,n).then((function(t){return{refs:t.refs,resolved:t.resolved,value:e}}))}))}(e,t)}}).call(this,n(2))},function(e,t,n){var r=n(22);e.exports={Graph:r.Graph,json:n(24),alg:n(25),version:r.version}},function(e,t,n){e.exports={Graph:n(5),version:n(23)}},function(e,t,n){e.exports="2.1.5"},function(e,t,n){var r=n(0),i=n(5);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},function(e,t,n){e.exports={components:n(26),dijkstra:n(9),dijkstraAll:n(27),findCycles:n(28),floydWarshall:n(29),isAcyclic:n(30),postorder:n(31),preorder:n(32),prim:n(33),tarjan:n(11),topsort:n(12)}},function(e,t,n){var r=n(0);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},function(e,t,n){var r=n(9),i=n(0);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},function(e,t,n){var r=n(0),i=n(11);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},function(e,t,n){var r=n(0);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},function(e,t,n){var r=n(12);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},function(e,t,n){var r=n(13);e.exports=function(e,t){return r(e,t,"post")}},function(e,t,n){var r=n(13);e.exports=function(e,t){return r(e,t,"pre")}},function(e,t,n){var r=n(0),i=n(5),o=n(10);e.exports=function(e,t){var n,a=new i,s={},u=new o;function l(e){var r=e.v===n?e.w:e.v,i=u.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){u.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),u.decrease(e.nodes()[0],0);for(var c=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(l)}return a}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return r.exec(e).slice(1)};function o(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,r="/"===a.charAt(0))}return(r?"/":"")+(t=n(o(t.split("/"),(function(e){return!!e})),!r).join("/"))||"."},t.normalize=function(e){var r=t.isAbsolute(e),i="/"===a(e,-1);return(e=n(o(e.split("/"),(function(e){return!!e})),!r).join("/"))||r||(e="."),e&&i&&(e+="/"),(r?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}var l=[];for(u=s;u<i.length;u++)l.push("..");return(l=l.concat(o.slice(s))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return i(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(2))},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={file:n(36),http:n(14),https:n(14)},o="object"===("undefined"==typeof window?"undefined":r(window))||"function"==typeof importScripts?i.http:i.file;"undefined"==typeof Promise&&n(16),e.exports.load=function(e,t){var n=Promise.resolve();return void 0===t&&(t={}),(n=n.then((function(){if(void 0===e)throw new TypeError("location is required");if("string"!=typeof e)throw new TypeError("location must be a string");if(void 0!==t){if("object"!==(void 0===t?"undefined":r(t)))throw new TypeError("options must be an object");if(void 0!==t.processContent&&"function"!=typeof t.processContent)throw new TypeError("options.processContent must be a function")}}))).then((function(){return new Promise((function(n,r){(function(e){var t=function(e){return void 0!==e&&(e=-1===e.indexOf("://")?"":e.split("://")[0]),e}(e),n=i[t];if(void 0===n){if(""!==t)throw new Error("Unsupported scheme: "+t);n=o}return n})(e).load(e,t||{},(function(e,t){e?r(e):n(t)}))}))})).then((function(e){return t.processContent?new Promise((function(n,i){t.processContent("object"===(void 0===e?"undefined":r(e))?e:{text:e},(function(e,t){e?i(e):n(t)}))})):"object"===(void 0===e?"undefined":r(e))?e.text:e}))}},function(e,t,n){var r=new TypeError("The 'file' scheme is not supported in the browser");e.exports.getBase=function(){throw r},e.exports.load=function(){var e=arguments[arguments.length-1];if("function"!=typeof e)throw r;e(r)}},function(e,t,n){var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};"undefined"!=typeof window?r=window:"undefined"!=typeof self?r=self:(console.warn("Using browser-only version of superagent in non-browser environment"),r=void 0);var o=n(38),a=n(39),s=n(15),u=n(40),l=n(42);function c(){}var f=t=e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1==arguments.length?new t.Request("GET",e):new t.Request(e,n)};t.Request=v,f.getXHR=function(){if(!(!r.XMLHttpRequest||r.location&&"file:"==r.location.protocol&&r.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function h(e){if(!s(e))return e;var t=[];for(var n in e)d(t,n,e[n]);return t.join("&")}function d(e,t,n){if(null!=n)if(Array.isArray(n))n.forEach((function(n){d(e,t,n)}));else if(s(n))for(var r in n)d(e,t+"["+r+"]",n[r]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(n));else null===n&&e.push(encodeURIComponent(t))}function g(e){for(var t,n,r={},i=e.split("&"),o=0,a=i.length;o<a;++o)-1==(n=(t=i[o]).indexOf("="))?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function m(e){return/[\/+]json($|[^-\w])/.test(e)}function y(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=function(e){for(var t,n,r,i,o=e.split(/\r?\n/),a={},s=0,u=o.length;s<u;++s)-1!==(t=(n=o[s]).indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),i=p(n.slice(t+1)),a[r]=i);return a}(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function v(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,r=null;try{r=new y(n)}catch(e){return(t=new Error("Parser is unable to parse the response")).parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=r.status,n.callback(e,r)):n.callback(null,r)}))}function b(e,t,n){var r=f("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}f.serializeObject=h,f.parseString=g,f.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},f.serialize={"application/x-www-form-urlencoded":h,"application/json":JSON.stringify},f.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},u(y.prototype),y.prototype._parseBody=function(e){var t=f.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&m(this.type)&&(t=f.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},y.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},f.Response=y,o(v.prototype),a(v.prototype),v.prototype.type=function(e){return this.set("Content-Type",f.types[e]||e),this},v.prototype.accept=function(e){return this.set("Accept",f.types[e]||e),this},v.prototype.auth=function(e,t,n){return 1===arguments.length&&(t=""),"object"===(void 0===t?"undefined":i(t))&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"}),this._auth(e,t,n,(function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")}))},v.prototype.query=function(e){return"string"!=typeof e&&(e=h(e)),e&&this._query.push(e),this},v.prototype.attach=function(e,t,n){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},v.prototype._getFormData=function(){return this._formData||(this._formData=new r.FormData),this._formData},v.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},v.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},v.prototype.buffer=v.prototype.ca=v.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},v.prototype.pipe=v.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},v.prototype._isHost=function(e){return e&&"object"===(void 0===e?"undefined":i(e))&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},v.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||c,this._finalizeQueryString(),this._end()},v.prototype._end=function(){var e=this,t=this.xhr=f.getXHR(),n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.onprogress=r.bind(null,"download"),t.upload&&(t.upload.onprogress=r.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],o=this._serializer||f.serialize[i?i.split(";")[0]:""];!o&&m(i)&&(o=f.serialize["application/json"]),o&&(n=o(n))}for(var a in this.header)null!=this.header[a]&&this.header.hasOwnProperty(a)&&t.setRequestHeader(a,this.header[a]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==n?n:null),this},f.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){l.prototype[e.toLowerCase()]=function(t,n){var r=new f.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}})),l.prototype.del=l.prototype.delete,f.get=function(e,t,n){var r=f("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.head=function(e,t,n){var r=f("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.options=function(e,t,n){var r=f("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.del=b,f.delete=b,f.patch=function(e,t,n){var r=f("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.post=function(e,t,n){var r=f("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.put=function(e,t,n){var r=f("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(15);function o(e){if(e)return function(e){for(var t in o.prototype)e[t]=o.prototype[t];return e}(e)}e.exports=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},o.prototype.parse=function(e){return this._parser=e,this},o.prototype.responseType=function(e){return this._responseType=e,this},o.prototype.serialize=function(e){return this._serializer=e,this},o.prototype.timeout=function(e){if(!e||"object"!==(void 0===e?"undefined":r(e)))return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},o.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var a=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];o.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~a.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},o.prototype.then=function(e,t){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(e,t){n.end((function(n,r){n?t(n):e(r)}))}))}return this._fullfilledPromise.then(e,t)},o.prototype.catch=function(e){return this.then(void 0,e)},o.prototype.use=function(e){return e(this),this},o.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},o.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},o.prototype.get=function(e){return this._header[e.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(e,t){if(i(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},o.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},o.prototype.field=function(e,t){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),i(e)){for(var n in e)this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)this.field(e,t[r]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},o.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},o.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},o.prototype.withCredentials=function(e){return null==e&&(e=!0),this._withCredentials=e,this},o.prototype.redirects=function(e){return this._maxRedirects=e,this},o.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(e){var t=i(e),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&i(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},o.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},o.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.substring(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,t)+"?"+n.join("&")}}},o.prototype._appendQueryString=function(){console.trace("Unsupported")},o.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error(e+t+"ms exceeded");r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},o.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},function(e,t,n){var r=n(41);function i(e){if(e)return function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e)}e.exports=i,i.prototype.get=function(e){return this.header[e.toLowerCase()]},i.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=r.type(t);var n=r.params(t);for(var i in n)this[i]=n[i];this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},i.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.created=201==e,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e,this.unprocessableEntity=422==e}},function(e,t,n){t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce((function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e}),{})},t.parseLinks=function(e){return e.split(/ *, */).reduce((function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e}),{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t,n){function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach((function(e){r.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}})),r.prototype._setDefaults=function(e){this._defaults.forEach((function(t){e[t.fn].apply(e,t.arguments)}))},e.exports=r},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(44),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(d,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},p.clearImmediate=h}function h(e){delete l[e]}function d(e){if(c)setTimeout(d,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(undefined,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(1),n(2))},function(e,t,n){t.decode=t.parse=n(46),t.encode=t.stringify=n(47)},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var f,p,h,d,g=e[c].replace(s,"%20"),m=g.indexOf(n);m>=0?(f=g.substr(0,m),p=g.substr(m+1)):(f=g,p=""),h=decodeURIComponent(f),d=decodeURIComponent(p),r(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){switch(void 0===e?"undefined":r(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,u){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===(void 0===e?"undefined":r(e))?a(s(e),(function(r){var s=encodeURIComponent(i(r))+n;return o(e[r])?a(e[r],(function(e){return s+encodeURIComponent(i(e))})).join(t):s+encodeURIComponent(i(e[r]))})).join(t):u?encodeURIComponent(i(u))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){e.exports=function(e){var t=/^\\\\\?\\/.test(e),n=/[^\x00-\x80]+/.test(e);return t||n?e:e.replace(/\\/g,"/")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var i=l(n(19)),o=l(n(51)),a=l(n(52)),s=l(n(53)),u=l(n(54));function l(e){return e&&e.__esModule?e:{default:e}}r.SCHEMES.http=i.default,r.SCHEMES.https=o.default,r.SCHEMES.mailto=a.default,r.SCHEMES.urn=s.default,r.SCHEMES["urn:uuid"]=u.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(17);t.default=(0,r.buildExps)(!0)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=(r=n(19))&&r.__esModule?r:{default:r};t.default={scheme:"https",domainHost:i.default.domainHost,parse:i.default.parse,serialize:i.default.serialize}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(4),o=(r=n(18))&&r.__esModule?r:{default:r},a=n(6),s={},u="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",l="[0-9A-Fa-f]",c=(0,a.subexp)((0,a.subexp)("%[EFef][0-9A-Fa-f]%"+l+l+"%"+l+l)+"|"+(0,a.subexp)("%[89A-Fa-f][0-9A-Fa-f]%"+l+l)+"|"+(0,a.subexp)("%"+l+l)),f="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",p="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",h=(0,a.merge)(p,'[\\"\\\\]'),d=(0,a.subexp)(f+"+"+(0,a.subexp)("\\."+f+"+")+"*"),g=(0,a.subexp)("\\\\"+h),m=(0,a.subexp)(p+"|"+g),y=(0,a.subexp)('\\"'+m+'*\\"'),v=(0,a.subexp)(u+"|"+c+"|[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),b=(0,a.subexp)(d+"|\\[[\\x21-\\x5A\\x5E-\\x7E]*\\]"),_=(0,a.subexp)(d+"|"+y),w=(0,a.subexp)(_+"\\@"+b);(0,a.subexp)(w+(0,a.subexp)("\\,"+w)+"*");var E=(0,a.subexp)(v+"*"),x=E,S=(0,a.subexp)(E+"\\="+x),O=(0,a.subexp)(S+(0,a.subexp)("\\&"+S)+"*");(0,a.subexp)("\\?"+O);var P=new RegExp(u,"g"),T=new RegExp(c,"g"),A=new RegExp((0,a.merge)("[^]",f,"[\\.]",'[\\"]',h),"g"),k=(new RegExp((0,a.merge)("[^]",f,"[\\.]","[\\[]","[\\x21-\\x5A\\x5E-\\x7E]","[\\]]"),"g"),new RegExp((0,a.merge)("[^]",u,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g")),C=k;function N(e){var t=(0,i.pctDecChars)(e);return t.match(P)?t:e}t.default={scheme:"mailto",parse:function(e,t){var n=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var r=!1,a={},s=e.query.split("&"),u=0,l=s.length;u<l;++u){var c=s[u].split("=");switch(c[0]){case"to":for(var f=c[1].split(","),p=0,h=f.length;p<h;++p)n.push(f[p]);break;case"subject":e.subject=(0,i.unescapeComponent)(c[1],t);break;case"body":e.body=(0,i.unescapeComponent)(c[1],t);break;default:r=!0,a[(0,i.unescapeComponent)(c[0],t)]=(0,i.unescapeComponent)(c[1],t)}}r&&(e.headers=a)}e.query=void 0;for(var d=0,g=n.length;d<g;++d){var m=n[d].split("@");if(m[0]=(0,i.unescapeComponent)(m[0]),t.unicodeSupport)m[1]=(0,i.unescapeComponent)(m[1],t).toLowerCase();else try{m[1]=o.default.toASCII((0,i.unescapeComponent)(m[1],t).toLowerCase())}catch(t){e.error=e.error||"Email address's domain name can not be converted to ASCII via punycode: "+t}n[d]=m.join("@")}return e},serialize:function(e,t){var n=(0,a.toArray)(e.to);if(n){for(var r=0,u=n.length;r<u;++r){var l=String(n[r]),c=l.lastIndexOf("@"),f=l.slice(0,c).replace(T,N).replace(T,a.toUpperCase).replace(A,i.pctEncChar),p=l.slice(c+1);try{p=t.iri?o.default.toUnicode(p):o.default.toASCII((0,i.unescapeComponent)(p,t).toLowerCase())}catch(n){e.error=e.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}n[r]=f+"@"+p}e.path=n.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var g in h)h[g]!==s[g]&&d.push(g.replace(T,N).replace(T,a.toUpperCase).replace(k,i.pctEncChar)+"="+h[g].replace(T,N).replace(T,a.toUpperCase).replace(C,i.pctEncChar));return d.length&&(e.query=d.join("&")),e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=new RegExp("^urn\\:((?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31}))$"),o=/^([^\:]+)\:(.*)/,a=/[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;t.default={scheme:"urn",parse:function(e,t){var n=e.path&&e.path.match(o);if(n){var i="urn:"+n[1].toLowerCase(),a=r.SCHEMES[i];a||(a=r.SCHEMES[i]={scheme:i,parse:function(e,t){return e},serialize:r.SCHEMES.urn.serialize}),e.scheme=i,e.path=n[2],e=a.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){var n=e.scheme||t.scheme;if(n&&"urn"!==n){var o=n.match(i)||["urn:"+n,n];e.scheme="urn",e.path=o[1]+":"+(e.path?e.path.replace(a,r.pctEncChar):"")}return e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;t.default={scheme:"urn:uuid",parse:function(e,t){return t.tolerant||e.path&&e.path.match(i)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){return t.tolerant||e.path&&e.path.match(i)?e.path=(e.path||"").toLowerCase():e.scheme=void 0,r.SCHEMES.urn.serialize(e,t)}}}]);const yt=function(e,t,n,r){let i;return n="string"==typeof n?[n]:n,e.some((e=>{const o=[...n];let a=t["localization-strings"][e];for(;a&&o.length;)a=a[o.shift()];return i=r||"string"==typeof a?a:void 0,i})),i},vt=async(e,t,n)=>{const r=new URL(n||window.location.href.replace(/(index\.html)?#.*$/,""));return r.search="",r.pathname=e,r.hash=t?"#/"+t:"",(await mt.resolveRefsAt(r.toString(),{loaderOptions:{processContent(e,t){t(void 0,JSON.parse(e.text||e.body.toString()))}}})).resolved},bt=function({field:e,schemaItems:t,metadataObj:n,getFieldAliasOrName:r,lang:i}){const o=t.findIndex((t=>t.title===e)),a=t[o],s={fieldName:r(e)},u=n.fields[e];let l=u&&u["fieldvalue-aliases"];return l&&(l.localeKey&&(l=yt(i,n,l.localeKey.split("/"),!0)),s.rawFieldValueAliasMap=JSON.parse(JSON.stringify(l)),s.aliases=[],a.enum&&a.enum.length?a.enum.forEach((t=>{s.aliases.push(yt(i,n,["fieldvalue",e,t],!0)),t in l&&"string"==typeof l[t]&&s.aliases.push(...l[t])})):Object.entries(l).forEach((([e,t])=>{Array.isArray(t)||(t=Object.values(t)),s.aliases.push(...t.filter((e=>t.every((t=>t===e||!t.toLowerCase().startsWith(e.toLowerCase()))))).map((t=>t+" ("+e+")")))})),s.fieldValueAliasMap=JSON.parse(JSON.stringify(l))),s.fieldSchema=a,s.fieldSchemaIndex=o,s.preferAlias=u.prefer_alias,s.lang=u.lang,s},_t=function({metadataObj:e,schemaItems:t,getFieldAliasOrName:n,lang:r,callback:i}){e.table.browse_fields.forEach(((o,a)=>{"string"==typeof o&&(o={set:[o]}),o.name||(o.name=o.set.join(","));const s=o.name,u=o.set,{presort:l}=o,c=u.map((i=>bt({lang:r,field:i,schemaItems:t,metadataObj:e,getFieldAliasOrName:n})));i({setName:s,browseFields:c,i:a,presort:l})}))};class wt{constructor({metadataObj:e}){this.metadataObj=e}getFieldLang(e){const{metadataObj:t}=this,n=t&&t.fields;return n&&n[e]&&n[e].lang}getFieldMatchesLocale({namespace:e,preferredLocale:t,schemaItems:n,pluginsForWork:r}){const{metadataObj:i}=this;return o=>{const a=(({namespace:e,preferredLocale:t})=>{const n=localStorage.getItem(e+"-langCodes"),r=n&&JSON.parse(n)||[t],i=[];return r.forEach((e=>{const t=e.replace(/-.*$/,"");t===e?i.push(e):i.push(e,t)})),i})({namespace:e,preferredLocale:t});if(r.isPluginField({namespace:e,field:o})){let[,,n]=r.getPluginFieldParts({namespace:e,field:o});return"{locale}"===n&&(n=t),!n||a.includes(n)}const s=this.getFieldLang(o),u=i&&i["localization-strings"];return u&&Object.keys(u).some((e=>{const t=u[e]&&u[e].fieldvalue;return t&&t[o]}))||s&&a.includes(s)||n.some((e=>e.title===o&&"string"!==e.type))}}}const Et=e=>e.replace(/\^/g,"^^").replace(/-/g,"^0"),xt=e=>e?e.replace(/(\^+)0/g,((e,t)=>t.length%2?t.slice(1)+"-":e)).replace(/\^\^/g,"^"):e;class St{constructor({pluginsInWork:e,pluginFieldMappings:t,pluginObjects:n}){this.pluginsInWork=e,this.pluginFieldMappings=t,this.pluginObjects=n}getPluginObject(e){const t=this.pluginsInWork.findIndex((([t])=>t===e));return this.pluginObjects[t]}iterateMappings(e){this.pluginFieldMappings.forEach((({placement:t,"applicable-fields":n},r)=>{const[i,{onByDefault:o,lang:a,meta:s}]=this.pluginsInWork[r],u=this.getPluginObject(i);e({plugin:u,placement:t,applicableFields:n,pluginName:i,pluginLang:a,onByDefaultDefault:o,meta:s})}))}processTargetLanguages(e,t){return!!e&&(Object.entries(e).forEach((([e,{targetLanguage:n,onByDefault:r,meta:i}])=>{Array.isArray(n)?n.forEach((n=>{t({applicableField:e,targetLanguage:n,onByDefault:r,metaApplicableField:i})})):t({applicableField:e,targetLanguage:n,onByDefault:r,metaApplicableField:i})})),!0)}isPluginField({namespace:e,field:t}){return t.startsWith(`${e}-plugin-`)}getPluginFieldParts({namespace:e,field:t}){let n,r,i;return(t=t.replace(`${e}-plugin-`,"")).includes("-")?[n,r,i]=t.split("-"):n=t,[n,r,i].map(xt)}}const Ot=function(e,t,n){const r=(e.baseDirectory||"")+(t.baseDirectory||"")+"/",i=(e.schemaBaseDirectory||"")+(t.schemaBaseDirectory||"")+"/",o=(e.metadataBaseDirectory||"")+(t.metadataBaseDirectory||"")+"/";return{file:r+n.file.$ref,schemaFile:n.schemaFile?i+n.schemaFile:"",metadataFile:n.metadataFile?o+n.metadataFile:""}},Pt=async function({lang:e,fallbackLanguages:t,work:n,files:r,allowPlugins:i,basePath:o,languages:a,preferredLocale:s}){const u=await d(r),l=e=>u["localization-strings"][e],c=ve({locales:e.map(l),fallbackLocales:t.map(l)}).getFormatter();let f;const p=u.groups.find((e=>(f=e.files.find((t=>n===c(["workNames",e.id,t.name]))),Boolean(f)))),h=u.groups.map((e=>({name:c({key:e.name.localeKey,fallback:!0}),workNames:e.files.map((t=>c(["workNames",e.id,t.name]))),shortcuts:e.files.map((e=>e.shortcut))}))),g=Ot(u,p,f),{file:m}=g;let{schemaFile:y,metadataFile:v}=g,b="",_="";y||(y=m,b="schema"),v||(v=m,_="metadata");let w,E,x,S,O=[];if(i){const e=u["plugin-field-mapping"][p.id][f.name];e&&(x=Object.keys(e),E=Object.entries(u.plugins).filter((([e])=>x.includes(e))),O=E.map((([t])=>e[t])),S=E.map((([,e])=>e.path)),w=E)}const P=await vt(v,_,o),T=function(t){const n=P.fields&&P.fields[t];let r,i;return n&&(i=n.alias),i?"string"==typeof i?r=i:(i=i.localeKey,r=yt(e,P,i.split("/"))):(r=n.name,"object"==typeof r&&(r=r.localeKey,r=yt(e,P,r.split("/")))),r},A=O,k="undefined"==typeof process?location.href.slice(0,location.href.lastIndexOf("/")+1):process.cwd()+"/";console.log("cwd-textbrowser",k);const[C,N]=await Promise.all([vt(y,b,o),w?Promise.all(S.map((e=>import(k+e)))):null]),L=new St({pluginsInWork:E,pluginFieldMappings:A,pluginObjects:N}),I=C.items.items,j=I.map((({title:e})=>({field:e,fieldAliasOrName:T(e)||e}))),D=new wt({metadataObj:P});if(a&&L){console.log("pluginsForWork",L);const{lang:e,namespace:t}=this;L.iterateMappings((({plugin:n,pluginName:r,pluginLang:i,onByDefaultDefault:o,placement:u,applicableFields:l,meta:f})=>{const p=({applicableField:n,targetLanguage:l,onByDefault:p,metaApplicableField:h}={})=>{const d=L.getPluginObject(r)||{},g=D.getFieldLang(n);d.getTargetLanguage&&(l=d.getTargetLanguage({applicableField:n,targetLanguage:l,pluginLang:i,applicableFieldLang:g}));const m=(({pluginName:e,applicableField:t,targetLanguage:n})=>Et(e)+(t?"-"+Et(t):"-")+(n?"-"+Et(n):""))({pluginName:r,applicableField:n,targetLanguage:l||i||g});"{locale}"===l&&(l=s);const y=yt(e,P,["fieldnames",n]),v=d.getFieldAliasOrName?d.getFieldAliasOrName({locales:e,lf:c,targetLanguage:l,applicableField:n,applicableFieldI18N:y,meta:f,metaApplicableField:h,targetLanguageI18N:a.getLanguageFromCode(l)}):a.getFieldNameFromPluginNameAndLocales({pluginName:r,locales:e,lf:c,targetLanguage:l,applicableFieldI18N:y,meta:f,metaApplicableField:h});j.splice("end"===u?Number.POSITIVE_INFINITY:u,0,{field:`${t}-plugin-${m}`,fieldAliasOrName:v,onByDefault:"boolean"==typeof p?p:o||!1,applicableField:n,metaApplicableField:h,fieldLang:l})};L.processTargetLanguages(l,p)||p()}))}return{fileData:f,lf:c,getFieldAliasOrName:T,metadataObj:P,schemaObj:C,schemaItems:I,fieldInfo:j,pluginsForWork:L,groupsToWorks:h,metadata:D}},Tt=({r:e,logger:t})=>{e.addEventListener("updatefound",(t=>{console.log("update found",t);const n=e.installing;n.addEventListener("statechange",(async()=>{const{state:e}=n;switch(e){case"installing":console.log("Installing new worker");break;case"installed":console.log("Installation status",e),await dt.alert("\nA new version of this offlinable app has been downloaded.\n\nIf you have work to complete in this tab, you can dismiss\nthis dialog now and continue working with the old version.\n\nHowever, when you are finished, you should close this tab\nand any other old tabs for this site in order to be able to\nbegin using the new version.\n");break;case"redundant":console.log("Installation status",e),await dt.alert("\nThere was an error during installation (to allow offline/speeded\ncache use).\n\nIf you have work to complete in this tab, you can dismiss\nthis dialog now and continue working with the old version.\n\nHowever, when you are finished, you may wish to close this tab\nand any other old tabs for this site in order to try again\nfor offline installation.\n");break;case"activating":console.log("Activating new worker");break;case"activated":console.log("Activated new worker");break;default:throw new Error(`Unknown worker update state: ${e}`)}}))}))},At=async({r:e,logger:t})=>new Promise((async(n,r)=>{navigator.serviceWorker.addEventListener("message",(({data:n})=>{const{message:r,type:i,name:o,errorType:a}=n;switch(console.log("msg1",r,e),i){case"log":return void t.addLogEntry({text:r});case"beginInstall":return void t.addLogEntry({text:"Install: Begun..."});case"finishedInstall":return void t.addLogEntry({text:"Install: Finished..."});case"beginActivate":return t.addLogEntry({text:"Activate: Caching finished"}),void t.addLogEntry({text:"Activate: Begin database resources storage..."});case"finishedActivate":return t.addLogEntry({text:"Activate: Finished..."}),void location.reload();case"error":t.addLogEntry({text:r+("dbError"===a?`Database error ${o}`:"")+"; trying again..."});break;default:console.error("Unexpected type",i)}}));const i=e.installing||e.waiting||e.active;i&&"redundant"===i.state?(await dt.alert('\nThere was likely an error installing. Click "ok" to try again.\n(Error code: Service worker is redundant)\n'),location.reload()):e.installing?console.log("INSTALLING"):e.waiting&&await dt.alert("\nAn update is in progress. After finishing any work\nyou have in them, please close this and any other existing tabs\nrunning this web application and then open the site again.\nPlease note it may take some time to install and may not show\nany indication it is installing.\n",{ok:!1})})),kt=e=>e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):"";var Ct={main({langs:e,languages:t,followParams:n,$p:r}){it("form",{class:"focus",id:"languageSelectionContainer",$on:{submit(e){e.preventDefault()}}},[["select",{name:"lang",size:e.length,$on:{click({target:{parentNode:{selectedOptions:e}}}){n("#languageSelectionContainer",(()=>{r.set("lang",e[0].value,!0)}))}}},e.map((({code:e})=>["option",{value:e},[t.getLanguageFromCode(e)]]))]],qe("#main")),history.state&&"object"==typeof history.state&&Le(document.querySelector("#languageSelectionContainer"),history.state)}};const Nt=["aqua","black","blue","fuchsia","gray","green","lime","maroon","navy","olive","purple","red","silver","teal","white","yellow"],Lt=["Helvetica, sans-serif","Verdana, sans-serif","Gill Sans, sans-serif","Avantgarde, sans-serif","Helvetica Narrow, sans-serif","sans-serif","Times, serif","Times New Roman, serif","Palatino, serif","Bookman, serif","New Century Schoolbook, serif","serif","Andale Mono, monospace","Courier New, monospace","Courier, monospace","Lucidatypewriter, monospace","Fixed, monospace","monospace","Comic Sans, Comic Sans MS, cursive","Zapf Chancery, cursive","Coronetscript, cursive","Florence, cursive","Parkavenue, cursive","cursive","Impact, fantasy","Arnoldboecklin, fantasy","Oldtown, fantasy","Blippo, fantasy","Brushstroke, fantasy","fantasy"],It=ut.repeat(2),jt=ut.repeat(3),Dt=()=>({form:qe("form#browse"),random:qe("#rand")||{},checkboxes:Ge("input[type=checkbox]")});const Rt={languageSelect:Ct,workSelect:({groups:e,lf:t,getNextAlias:n,$p:r,followParams:i})=>{const o=it("form",{id:"workSelect",class:"focus",$on:{submit(e){e.preventDefault()}}},e.map(((e,o)=>["div",[o>0?["br","br","br"]:"",["div",[t({key:e.directions.localeKey,fallback:!0})]],["br"],["select",{class:"file",name:"work"+o,dataset:{name:e.name.localeKey},$on:{change({target:{value:e}}){i("#workSelect",(()=>{r.set("work",e)}))}}},[["option",{value:""},["--"]],...e.files.map((({name:r})=>["option",{value:t(["workNames",e.id,r])},[n()]]))]]]])),qe("#main"));return history.state&&"object"==typeof history.state&&Le(document.querySelector("#workSelect"),history.state),o},workDisplay:{bdo:({fallbackDirection:e,message:t})=>["div",{style:"display: inline; direction: "+e},[t]],columnsTable:({ld:e,fieldInfo:t,$p:n,le:r,iil:i,l:o,metadataObj:a,preferredLocale:s,schemaItems:u,fieldMatchesLocale:l})=>["table",{border:"1",cellpadding:"5",align:"center"},[["tr",[["th",[e("fieldno")]],["th",{align:"left",width:"20"},[e("field_enabled")]],["th",[e("field_title")]],["th",[e("fieldinterlin")]],["th",[e("fieldcss")]]]],...t.map(((e,a)=>{const s=a+1,u="checked"+s,l="field"+s,c=n.get(l);return["tr",[["td",[String(s)]],r("check-columns-to-browse","td","title",{},[r("yes","input","value",{class:"fieldSelector",id:u,name:i("checked")+s,checked:n.get(u)!==o("no")&&(n.has(u)||!1!==e.onByDefault),type:"checkbox"})]),r("check-sequence","td","title",{},[["select",{name:i("field")+s,id:l,size:"1"},t.map((({field:e,fieldAliasOrName:t},r)=>["option",{dataset:{name:e},value:t,selected:c&&c===t||r===a&&!n.has(l)},[t]]))]]),["td",[r("interlinear-tips","input","title",{name:i("interlin")+s,value:n.get("interlin"+s)})]],["td",[["input",{name:i("css")+s,value:n.get("css"+s)}]]]]]})),["tr",[["td",{colspan:3},[r("check_all","input","value",{type:"button",$on:{click(){Ge(".fieldSelector").forEach((e=>{e.checked=!0}))}}}),r("uncheck_all","input","value",{type:"button",$on:{click(){Ge(".fieldSelector").forEach((e=>{e.checked=!1}))}}}),r("checkmark_locale_fields_only","input","value",{type:"button",$on:{click(){t.forEach((({field:e},t)=>{const n=t+1,r=qe("#field"+n).selectedOptions[0].dataset.name;qe("#checked"+n).checked=l(r)}))}}})]]]]]],advancedFormatting:({ld:e,il:t,l:n,lo:r,le:i,$p:o,hideFormattingSection:a})=>["td",{id:"advancedformatting",style:{display:a?"none":"block"}},[["h3",[e("advancedformatting")]],["label",[e("textcolor"),It,["select",{name:t("colorName")},Nt.map(((e,t)=>{const i={value:n(["param_values","colors",e])};return(o.get("colorName")===n(["param_values","colors",e])||1===t&&!o.has("colorName"))&&(i.selected="selected"),r(["param_values","colors",e],i)}))]]],["label",[ut,e("or_entercolor"),It,["input",{name:t("color"),type:"text",value:o.get("color")||"#",size:"7",maxlength:"7"}]]],["br"],["br"],["label",[e("backgroundcolor"),It,["select",{name:t("bgcolorName")},Nt.map(((e,t)=>{const i={value:n(["param_values","colors",e])};return(o.get("bgcolorName")===n(["param_values","colors",e])||14===t&&!o.has("bgcolorName"))&&(i.selected="selected"),r(["param_values","colors",e],i)}))]]],["label",[ut,e("or_entercolor"),It,["input",{name:t("bgcolor"),type:"text",value:o.get("bgcolor")||"#",size:"7",maxlength:"7"}]]],["br"],["br"],["label",[e("text_font"),It,["select",{name:t("fontSeq"),dir:"ltr"},Lt.map(((e,t)=>{const n={value:e};return(o.get("fontSeq")===e||7===t&&!o.has("fontSeq"))&&(n.selected="selected"),["option",n,[e]]}))]]],["br"],["br"],["label",[e("font_style"),It,["select",{name:t("fontstyle")},["italic","normal","oblique"].map(((e,t)=>{const i={value:n(["param_values","fontstyle",e])};return(o.get("fontstyle")===n(["param_values","fontstyle",e])||1===t&&!o.has("fontstyle"))&&(i.selected="selected"),r(["param_values","fontstyle",e],i)}))]]],["br"],["div",[e("font_variant"),jt,["label",[["input",{name:t("fontvariant"),type:"radio",value:n(["param_values","fontvariant","normal"]),checked:o.get("fontvariant")!==e(["param_values","fontvariant","small-caps"])}],e(["param_values","fontvariant","normal"]),ut]],["label",[["input",{name:t("fontvariant"),type:"radio",value:n(["param_values","fontvariant","small-caps"]),checked:o.get("fontvariant")===e(["param_values","fontvariant","small-caps"])}],e(["param_values","fontvariant","small-caps"]),ut]]]],["br"],["label",[e("font_weight")," (normal, bold, 100-900, etc.):",It,["input",{name:t("fontweight"),type:"text",value:o.has("fontweight")?o.get("fontweight"):"normal",size:"7",maxlength:"12"}]]],["br"],["label",[e("font_size")," (14pt, 14px, small, 75%, etc.):",It,["input",{name:t("fontsize"),type:"text",value:o.get("fontsize"),size:"7",maxlength:"12"}]]],["br"],["label",{dir:"ltr"},[e("font_stretch"),ut,["select",{name:t("fontstretch")},["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"].map((t=>{const n={value:e(["param_values","font-stretch",t])};return(o.get("fontstretch")===t||!o.has("fontstretch")&&"normal"===t)&&(n.selected="selected"),["option",n,[e(["param_values","font-stretch",t])]]}))]]],["br"],["br"],["label",[e("letter_spacing")," (normal, .9em, -.05cm): ",["input",{name:t("letterspacing"),type:"text",value:o.has("letterspacing")?o.get("letterspacing"):"normal",size:"7",maxlength:"12"}]]],["br"],["label",[e("line_height")," (normal, 1.5, 22px, 150%): ",["input",{name:t("lineheight"),type:"text",value:o.has("lineheight")?o.get("lineheight"):"normal",size:"7",maxlength:"12"}]]],["br"],["br"],i("tableformatting_tips","h3","title",{},[e("tableformatting")]),["div",[e("header_wstyles"),It,...[["yes",e(["param_values","y"])],["no",e(["param_values","n"])],["none",e(["param_values","0"])]].map((([n,r],i,a)=>["label",[["input",{name:t("header"),type:"radio",value:r,checked:o.get("header")===r||!o.has("header")&&1===i}],e(n),i===a.length-1?"":jt]]))]],["div",[e("footer_wstyles"),It,...[["yes",e(["param_values","y"])],["no",e(["param_values","n"])],["none",e(["param_values","0"])]].map((([n,r],i,a)=>["label",[["input",{name:t("footer"),type:"radio",value:r,checked:o.get("footer")===r||!o.has("footer")&&2===i}],e(n),i===a.length-1?"":jt]]))]],["label",[["input",{name:t("headerfooterfixed"),type:"checkbox",value:n("yes"),checked:o.get("headerfooterfixed")===n("yes")}],It,e("headerfooterfixed-wishtoscroll")]],["br"],["div",[e("caption_wstyles"),It,...[["yes",e(["param_values","y"])],["no",e(["param_values","n"])],["none",e(["param_values","0"])]].map((([n,r],i,a)=>["label",[["input",{name:t("caption"),type:"radio",value:r,checked:o.get("caption")===r||!o.has("caption")&&2===i}],e(n),i===a.length-1?"":jt]]))]],["br"],["div",[e("table_wborder"),It,["label",[["input",{name:t("border"),type:"radio",value:"1",checked:"0"!==o.get("border")}],e("yes"),jt]],["label",[["input",{name:t("border"),type:"radio",value:"0",checked:"0"===o.get("border")}],e("no")]]]],["div",[e("interlin_repeat_field_names"),It,["label",[["input",{name:t("interlintitle"),type:"radio",value:"1",checked:"0"!==o.get("interlintitle")}],e("yes"),jt]],["label",[["input",{name:t("interlintitle"),type:"radio",value:"0",checked:"0"===o.get("interlintitle")}],e("no")]]]],["label",[e("interlintitle_css"),It,["input",{name:t("interlintitle_css"),type:"text",value:o.get("interlintitle_css")||"",size:"12"}]]],["br"],["br"],i("pageformatting_tips","h3","title",{},[e("pageformatting")]),["label",[e("page_css"),It,["textarea",{name:t("pagecss"),title:n("page_css_tips"),value:o.get("pagecss")}]]],["br"],i("outputmode_tips","label","title",{},[e("outputmode"),It,["select",{name:t("outputmode")},["table","div"].map((e=>{const t={value:e};return o.get("outputmode")===e&&(t.selected="selected"),r(["param_values","outputmode",e],t)}))]])]],addRandomFormFields({il:e,ld:n,l:r,le:i,$p:o,serializeParamsAsURL:a,content:s}){[[["td",{colspan:12,align:"center"},[["br"],n("or"),["br"],["br"]]]],[["td",{colspan:12,align:"center"},[["label",[n("rnd"),jt,["input",{id:"rand",name:e("rand"),type:"checkbox",value:r("yes"),checked:o.get("rand")===r("yes")}]]],jt,["label",[n("verses-context"),ut,["input",{name:e("context"),type:"number",min:1,size:4,value:o.get("context")}]]],jt,i("view-random-URL","input","value",{type:"button",$on:{click(){const e=a(t(t({},Dt()),{},{type:"randomResult"}));qe("#randomURL").value=e}}}),["input",{id:"randomURL",type:"text"}]]]]].forEach((e=>{e&&e.length&&s.push(["tr",e])}))},getPreferences:({languageParam:e,lf:t,paramsSetter:n,replaceHash:r,getFieldAliasOrNames:i,work:o,langs:a,imfl:s,l:u,localizeParamNames:l,namespace:c,hideFormattingSection:f,groups:p,preferencesPlugin:h})=>["div",{style:{textAlign:"left"},id:"preferences",hidden:"true"},[["div",{style:"margin-top: 10px;"},[["label",[u("localizeParamNames"),["input",{id:"localizeParamNames",type:"checkbox",checked:l,$on:{change({target:{checked:e}}){localStorage.setItem(c+"-localizeParamNames",e)}}}]]]]],["div",[["label",[u("Hide formatting section"),["input",{id:"hideFormattingSection",type:"checkbox",checked:f,$on:{change({target:{checked:e}}){qe("#advancedformatting").style.display=e?"none":"block",localStorage.setItem(c+"-hideFormattingSection",e)}}}]]]]],["div",[["label",{for:"prefLangs"},[u("Preferred language(s)")]],["br"],["select",{id:"prefLangs",multiple:"multiple",size:a.length,$on:{change({target:{selectedOptions:e}}){localStorage.setItem(c+"-langCodes",JSON.stringify([...e].map((e=>e.value))))}}},a.map((e=>{let t=localStorage.getItem(c+"-langCodes");t=t&&JSON.parse(t);const n={value:e.code};return t&&t.includes(e.code)&&(n.selected="selected"),["option",n,[s(["languages",e.code])]]}))]]],h?h({$:qe,l:u,jml:it,paramsSetter:n,getDataForSerializingParamsAsURL:Dt,work:o,replaceHash:r,getFieldAliasOrNames:i}):""]],addBrowseFields({browseFields:e,fieldInfo:t,ld:n,i:r,iil:i,$p:o,content:a}){const s=o.get("work");[r>0?[["td",{colspan:12,align:"center"},[["br"],n("or"),["br"],["br"]]]]:"",[...(()=>{const t=t=>e.reduce(((e,{fieldName:n,aliases:a,fieldSchema:{minimum:u,maximum:l}},c)=>{const f=s+"-"+i(t)+(r+1)+"-"+(c+1),p=f;return e["#"].push(["td",[["label",{for:f},[n]]]],["td",[a?["datalist",{id:"dl-"+p},a.map((e=>["option",[e]]))]:"",a?["input",{name:f,id:p,class:"browseField",list:"dl-"+p,value:o.get(f,!0),$on:"start"===t?{change(e){Ge("input.browseField").forEach((t=>{t.id.includes(r+1+"-"+(c+1))&&(t.value=e.target.value)}))}}:void 0}]:["input",{name:f,id:p,type:"number",min:u,max:l,value:o.get(f,!0)}],jt]]),e}),{"#":[]});return[t("start"),["td",[["b",[n("to")]],jt]],t("end")]})(),["td",[e.length>1?n("versesendingdataoptional"):""]]],[["td",{colspan:4*e.length+2+1,align:"center"},[["table",[["tr",[e.reduce(((e,{fieldName:t,aliases:n,fieldSchema:{minimum:a,maximum:u}},l)=>{const c=s+"-"+i("anchor")+(r+1)+"-"+(l+1),f=c;return e["#"].push(["td",[["label",{for:c},[t]]]],["td",[n?["datalist",{id:"dl-"+f},n.map((e=>["option",[e]]))]:"",n?["input",{name:c,id:f,class:"browseField",list:"dl-"+f,value:o.get(c,!0)}]:["input",{name:c,id:f,type:"number",min:a,max:u,value:o.get(c,!0)}],It]]),e}),{"#":[["td",{style:"font-weight: bold; vertical-align: bottom;"},[n("anchored-at")+jt]]]}),["td",[["label",[n("field")+It,["select",{name:i("anchorfield")+(r+1),size:"1"},t.map((({fieldAliasOrName:e})=>o.get(i("anchorfield")+(r+1),!0)===e?["option",{selected:!0},[e]]:["option",[e]]))]]]]]]]]]]]]].forEach((e=>{e&&e.length&&a.push(["tr",e])}))},main({lf:e,languageParam:n,l:r,namespace:i,heading:o,fallbackDirection:a,imfl:s,langs:u,fieldInfo:l,localizeParamNames:c,serializeParamsAsURL:f,paramsSetter:p,replaceHash:h,getFieldAliasOrNames:d,hideFormattingSection:g,$p:m,metadataObj:y,il:v,le:b,ld:_,iil:w,fieldMatchesLocale:E,preferredLocale:x,schemaItems:S,content:O,groups:P,preferencesPlugin:T}){const A=m.get("work"),k=({type:e})=>f(t(t({},Dt()),{},{type:e}));it("div",{class:"focus"},[["div",{style:"float: left;"},[["button",{$on:{click(){const e=qe("#preferences");e.hidden=!e.hidden}}},[r("Preferences")]],Rt.workDisplay.getPreferences({languageParam:n,lf:e,paramsSetter:p,replaceHash:h,getFieldAliasOrNames:d,work:A,langs:u,imfl:s,l:r,localizeParamNames:c,namespace:i,groups:P,hideFormattingSection:g,preferencesPlugin:T})]],["h2",[o]],["br"],["form",{id:"browse",$custom:{$submit(){const e=k({type:"saveSettings"}).replace(/^[^#]*#/,"");console.log("history thisParams",e),history.replaceState(e,document.title,location.href);const t=k({type:"result"});location.href=t}},$on:{keydown({key:e,target:t}){"Enter"===e&&"textarea"!==t.localName.toLowerCase()&&this.$submit()},submit(e){e.preventDefault(),this.$submit()}},name:v("browse")},[["table",{align:"center"},O],["br"],["div",{style:"margin-left: 20px"},[["br"],["br"],["table",{border:"1",align:"center",cellpadding:"5"},[["tr",{valign:"top"},[["td",[Rt.workDisplay.columnsTable({ld:_,fieldInfo:l,$p:m,le:b,iil:w,l:r,metadataObj:y,preferredLocale:x,schemaItems:S,fieldMatchesLocale:E}),b("save-settings-URL","input","value",{type:"button",$on:{click(){const e=k({type:"saveSettings"});qe("#settings-URL").value=e}}}),["input",{id:"settings-URL"}],["br"],["button",{$on:{async click(e){e.preventDefault();const n=p(t(t({},Dt()),{},{workName:A,type:"startEndResult"})),r=h(n)+`&work=${A}&${A}-startEnd1=%s`;try{await navigator.clipboard.writeText(r)}catch(e){}}}},[r("Copy_shortcut_URL")]]]],Rt.workDisplay.advancedFormatting({ld:_,il:v,l:r,lo:(e,t)=>["option",t,[r({key:e,fallback:({message:e})=>(t.dir=a,e)})]],le:b,$p:m,hideFormattingSection:g})]]]]]],["p",{align:"center"},[b("submitgo","input","value",{type:"submit"})]]]]],qe("#main"))}},resultsDisplayServerOrClient:{caption:({heading:e,ranges:t})=>e+" "+t,startSeparator:({l:e})=>e("colon"),innerBrowseFieldSeparator:({l:e})=>e("comma-space"),ranges:({l:e,startRange:t,endVals:n,rangeNames:r})=>t+"-"+n.join(Rt.resultsDisplayServerOrClient.startSeparator({l:e}))+" ("+r+")",fieldValueAlias:({key:e,value:t})=>t+" ("+e+")",interlinearSegment:({lang:e,dir:t,html:n})=>`<span${e?` lang="${e}"`:""}${t?` dir="${t}"`:""}>${n}</span>`,interlinearTitle:({l:e,val:t})=>`<span class="interlintitle">${t}</span>${e("colon-space")}`,styles({$p:e,$pRaw:t,$pRawEsc:n,$pEscArbitrary:r,escapeQuotedCSS:i,escapeCSS:o,tableWithFixedHeaderAndFooter:a,checkedFieldIndexes:s,hasCaption:u}){const l=e.has("color",!0)&&"#"!==e.get("color",!0)?r("color"):n("colorName"),c=e.has("bgcolor",!0)&&"#"!==e.get("bgcolor",!0)?r("bgcolor"):n("bgcolorName"),f=1+(0+(u?2:0)),p=f+1+"em",h=`100% - ${p} - 2em - 0.5em`;return["style",[(a?`\nhtml, body, #main, #main > div {\n height: 100%; /* Needed to ensure descendent heights retain 100%; could be avoided if didn't want percent on table height */\n overflow-y: hidden; /* Not sure why we're getting extra here, but... */\n}\n.anchor-table-header {\n background-color: ${c||"white"}; /* Header background (not just for div text inside header, but for whole header area) */\n overflow-x: hidden; /* Not sure why we're getting extra here, but... */\n position: relative; /* Ensures we are still flowing, but provides anchor for absolutely positioned thead below (absolute positioning positions relative to nearest non-static ancestor; clear demo at https://www.w3schools.com/cssref/playit.asp?filename=playcss_position&preval=fixed ) */\n padding-top: ${p}; /* Provides space for the header (and caption) (the one that is absolutely positioned below relative to here) */\n height: 100%; /* Percent of the whole screen taken by the table */\n}\n.anchor-table-body {\n overflow-y: auto; /* Provides scrollbars when text fills up beyond the height */\n height: ${`calc(${h})`}; /* If < 100%, the header anchor background color will seep below table */\n}\n\n.caption, .thead .th, .tfoot .th {\n line-height: 0; /* th div will have own line-height; reducing here avoids fattening it by an inner div */\n color: transparent; /* Hides the non-div duplicated header text */\n white-space: nowrap; /* Ensures column header text uses up full width without overlap (esp. wrap no longer seems to work); this must be applied outside of the div */\n border: none; /* We don't want a border for this invisible section */\n}\ndiv.inner-caption, .thead .th div.th-inner, .tfoot .th div.th-inner { /* divs are used as th is supposedly problematic */\n position: absolute; /* Puts relative to nearest non-static ancestor (our relative header anchor) */\n color: initial; /* Header must have an explicit color or it will get transparent container color */\n line-height: normal; /* Revert ancestor line height of 0 */\n}\n.thead .th div.th-inner {\n top: ${f}em; /* Ensures our header stays fixed at top outside of normal flow of table */\n}\ndiv.inner-caption {\n top: 1em;\n}\n.tfoot .th div.th-inner { /* divs are used as th is supposedly problematic */\n top: ${`calc(${h} + 0.5em)`}; /* Ensures our header stays fixed at top outside of normal flow of table */\n}\n.zupa div.zupa1 {\n margin: 0 auto !important;\n width: 0 !important;\n}\n.zupa div.th-inner, .zupa div.inner-caption {\n width: 100%;\n margin-left: -50%;\n text-align: center;\n}\n`:"")+("y"===t("caption")?a?".caption div.inner-caption, ":".caption, ":"")+("y"===t("header")?a?"":".thead .th, ":"")+("y"===t("footer")?a?"":".tfoot .th, ":"")+".tbody td"+` {\n vertical-align: top;\n font-style: ${n("fontstyle")};\n font-variant: ${n("fontvariant")};\n font-weight: ${r("fontweight")};\n ${r("fontsize")?`font-size: ${r("fontsize")};`:""}\n font-family: ${r("fontSeq")};\n\n font-stretch: ${n("fontstretch")};\n letter-spacing: ${r("letterspacing")};\n line-height: ${r("lineheight")};\n ${l?`color: ${o(l)};`:""}\n ${c?`background-color: ${o(c)};`:""}\n}\n${o(r("pagecss")||"")}\n`+s.map(((e,n)=>("y"===t("header")?a?`.thead .th:nth-child(${n+1}) div.th-inner, `:`.thead .th:nth-child(${n+1}), `:"")+("y"===t("footer")?a?`.tfoot .th:nth-child(${n+1}) div.th-inner, `:`.tfoot .th:nth-child(${n+1}), `:"")+`.tbody td:nth-child(${n+1}) `+`{\n ${r("css"+(e+1))}\n}\n`)).join("")+(r("interlintitle_css")?`\n/* http://salzerdesign.com/test/fixedTable.html */\n.interlintitle {\n ${o(r("interlintitle_css"))}\n}\n`:"")+(c?`\nbody {\n background-color: ${c};\n}\n`:"")]]},main({tableData:e,$p:n,$pRaw:r,$pRawEsc:i,$pEscArbitrary:o,escapeQuotedCSS:a,escapeCSS:s,escapeHTML:u,l:l,localizedFieldNames:c,fieldLangs:f,fieldDirs:p,caption:h,hasCaption:d,showInterlinTitles:g,determineEnd:m,getCanonicalID:y,canonicalBrowseFieldSetName:v,getCellValue:b,checkedAndInterlinearFieldInfo:_,interlinearSeparator:w="<br /><br />"}){const E={table:[["table",{class:"table",border:r("border")||"0"}],["tr",{class:"tr"}],["td"],["th",{class:"th"}],["caption",{class:"caption"}],["thead",{class:"thead"}],["tbody",{class:"tbody"}],["tfoot",{class:"tfoot"}]],div:[["div",{class:"table",style:"display: table;"}],["div",{class:"tr",style:"display: table-row;"}],["div",{class:"td",style:"display: table-cell;"}],["div",{class:"th",style:"display: table-cell;"}],["div",{class:"caption",style:"display: table-caption;"}],["div",{class:"thead",style:"display: table-header-group;"}],["div",{class:"tbody",style:"display: table-row-group;"}],["div",{class:"tfoot",style:"display: table-footer-group;"}]],"json-array":"json","json-object":"json"},x=n.get("outputmode",!0);switch(x){case"json-object":case"json-array":throw new Error("JSON object support is currently not available")}const S=E[Object.prototype.hasOwnProperty.call(E,x)?x:"table"],[O,P,T,A,k,C,N,L]=S,[I,j,D]=_,R="yes"===r("headerfooterfixed"),F=(e,t)=>((e=JSON.parse(JSON.stringify(e))).push(t),e),U=([e,n],r)=>[e,t(t({},n),r)],$={start:!1,end:!1},M=[],{showEmptyInterlinear:z,showTitleOnSingleInterlinear:q}=this,G=(e,t)=>{if(!z&&(t||([...(e=(new DOMParser).parseFromString(e,"text/html").body).querySelectorAll("br")].forEach((e=>{e.remove()})),e=e.innerHTML),!e.trim()))return!0};return e.some(((e,t)=>{const n=m({tr:e,foundState:$});if("boolean"==typeof n)return n;const r=y({tr:e});return M.push(F(U(P,{dataset:{row:n,"canonical-type":v,"canonical-id":r}}),j.map(((n,r)=>{const i=D[r],o=i,{tdVal:a,htmlEscaped:s}=b({tr:e,idx:n}),u=o&&i.map((t=>{const{tdVal:n,htmlEscaped:r}=b({tr:e,idx:t});console.log("showEmptyInterlinear",z,r);return G(n,r)?"":o?Rt.resultsDisplayServerOrClient.interlinearSegment({lang:f[t],dir:p[t],html:(g?Rt.resultsDisplayServerOrClient.interlinearTitle({l:l,val:c[t]}):"")+n}):n})).filter((e=>""!==e));return U(T,{id:"row"+(t+1)+"col"+(r+1),lang:f[n],dir:p[n],dataset:{col:c[n]},innerHTML:(o&&!G(a,s)&&(q||u.length)?Rt.resultsDisplayServerOrClient.interlinearSegment({lang:f[n],html:(g?Rt.resultsDisplayServerOrClient.interlinearTitle({l:l,val:c[n]}):"")+a}):a)+(i&&u.length?w+u.join(w):"")})})))),!1})),["div",[Rt.resultsDisplayServerOrClient.styles({$p:n,$pRaw:r,$pRawEsc:i,$pEscArbitrary:o,escapeQuotedCSS:a,escapeCSS:s,tableWithFixedHeaderAndFooter:R,checkedFieldIndexes:j,hasCaption:d}),(B=[F(O,[h?F(k,[h,R?["div",{class:"zupa1"},[["div",{class:"inner-caption"},[["span",[h]]]]]]:""]):"","0"!==r("header")?F(C,[F(P,I.map(((e,t)=>{const n=D[t];return e=u(e)+(n?l("comma-space")+n.map((e=>c[e])).join(l("comma-space")):""),F(A,[e,R?["div",{class:"zupa1"},[["div",{class:"th-inner"},[["span",[e]]]]]]:""])})))]):"",r("footer")&&"0"!==r("footer")?F(L,[F(P,I.map(((e,t)=>{const n=D[t];return e=u(e)+(n?l("comma-space")+n.map((e=>c[e])).join(l("comma-space")):""),F(A,[e,R?["div",{class:"zupa1"},[["div",{class:"th-inner"},[["span",[e]]]]]]:""])})))]):"",F(N,M)])],R?["div",{class:"table-responsive anchor-table-header zupa"},[["div",{class:"table-responsive anchor-table-body"},B]]]:["div",{class:"table-responsive"},B])]];var B}},resultsDisplayClient:{anchorRowCol:({anchorRowCol:e})=>qe("#"+e),anchors:({escapedRow:e,escapedCol:t})=>qe('tr[data-row="'+e+'"]'+(t?'> td[data-col="'+t+'"]':"")),main(...e){let t;try{t=Rt.resultsDisplayServerOrClient.main(...e)}catch(e){"JSON support is currently not available"===e.message&&dt.alert(e.message)}it(...t,qe("#main"))}},defaultBody(){for(;st.hasChildNodes();)st.firstChild.remove();return it("div",{id:"main",role:"main"},st)}};function Ft(e,t){if(t||!this.localizeParamNames)return e;const n=/\d+(-\d+)?$/,r=e.match(n);return r?this.l10n(["params","indexed",e.replace(n,"")])+r[0]:this.l10n(["params",e])}Rt.permissions={versionChange(){qe("#versionChange").showModal()},addLogEntry({text:e}){const t=qe("#installationLogContainer");try{t.showModal();qe("#dialogContainer").hidden=!1}catch(e){}qe("#installationLog").append(e+"\n")},exitDialogs(){const e=qe("#dialogContainer");e&&(e.hidden=!0)},dbError({type:e,escapedErrorMessage:t}){e&&it("span",[e," ",t],qe("#dbError")),qe("#dbError").showModal()},errorRegistering(e){e&&it("span",[e],qe("#errorRegistering")),qe("#errorRegistering").showModal()},browserNotGrantingPersistence(){qe("#browserNotGrantingPersistence").showModal()},main({l:e,ok:t,refuse:n,close:r,closeBrowserNotGranting:i}){const o=it("dialog",{style:"text-align: center; height: 100%",id:"installationLogContainer",class:"focus"},[["p",[e("wait-installing")]],["div",{style:"height: 80%; overflow: auto;"},[["pre",{id:"installationLog"},[]]]]]);let a="";t&&(a=it("dialog",{id:"willRequestStoragePermissions",$on:{close:r}},[["section",[e("will-request-storage-permissions")]],["br"],["div",{class:"focus"},[["button",{$on:{click:t}},[e("OK")]],["br"],["br"],["button",{$on:{click:n}},[e("refuse-request-storage-permissions")]]]]]));const s=it("dialog",{id:"errorRegistering"},[["section",[e("errorRegistering")]]]);let u="";i&&(u=it("dialog",{id:"browserNotGrantingPersistence"},[["section",[e("browser-not-granting-persistence")]],["br"],["div",{class:"focus"},[["button",{$on:{click:i}},[e("OK")]]]]]));const l=it("dialog",{id:"versionChange"},[["section",[e("versionChange")]]]),c=it("dialog",{id:"dbError"},[["section",[e("dbError")]]]);return it("div",{id:"dialogContainer",style:"height: 100%"},[o,a,u,s,l,c],qe("#main")),[o,a,u,s,l,c]}};class Ut{constructor({l10n:e,params:t}={}){this.l10n=e,t||(t=location.hash.slice(1)),"string"==typeof t&&(t=new URLSearchParams(t)),this.params=t}get(e,t){return this.params.get(Ft.call(this,e,t))}getAll(e,t){return this.params.getAll(Ft.call(this,e,t))}has(e,t){return this.params.has(Ft.call(this,e,t))}delete(e,t){return this.params.delete(Ft.call(this,e,t))}set(e,t,n){return this.params.set(Ft.call(this,e,n),t)}append(e,t,n){return this.params.append(Ft.call(this,e,n),t)}toString(){return this.params.toString()}}const $t=e=>location.href.replace(/#.*$/,"")+"#"+e.toString(),Mt=function({l:e,il:t,$p:n}){return function({form:r,random:i={},checkboxes:o,type:a,fieldAliasOrNames:s=[],workName:u}){const l=new URLSearchParams(n.params),c=Ae(r,{hash:!0,empty:!0});function f(){let e=1,t=1;for(;l.has(`${u}-start${e}-${t}`,!0);){for(;l.has(`${u}-start${e}-${t}`,!0);)l.delete(`${u}-start${e}-${t}`,!0),l.delete(`${u}-end${e}-${t}`,!0),l.delete(`${u}-anchor${e}-${t}`,!0),t++;t=1,e++}}switch(Object.keys(c).forEach((e=>{l.set(e,c[e])})),l.delete(t("rand")),l.set(t("rand"),i.checked?e("yes"):e("no")),o.forEach((t=>{l.delete(t.name),t.name&&l.set(t.name,t.checked?e("yes"):e("no"))})),a){case"saveSettings":l.delete(t("rand"));break;case"shortcutResult":{l.delete(t("rand"));let n=1;for(;l.has(`anchorfield${n}`,!0);)l.delete(`anchorfield${n}`,!0),n++;for(f(),n=1;l.has(`field${n}`,!0);)l.delete(`field${n}`,!0),l.delete(`checked${n}`,!0),l.delete(`interlin${n}`,!0),l.delete(`css${n}`,!0),n++;s.forEach(((t,n)=>{l.set(`field${n+1}`,t,!0),l.set(`checked${n+1}`,e("yes"),!0),l.set(`interlin${n+1}`,""),l.set(`css${n+1}`,"")})),l.delete("work",!0)}case"startEndResult":case"randomResult":case"result":"startEndResult"===a&&f(),("randomResult"===a||i.checked)&&(l.delete(t("rand")),l.set(t("rand"),e("yes"))),l.set(t("result"),e("yes"));break;default:console.error("Unexpected type",a)}return l}},zt=["lf","fileData","metadataObj"];var qt,Gt=qt={_regexEscape:/([\.\*\+\^\$\[\]\\\(\)\|\{\}\,\-\:\?])/g,_regexParseLocale:/^([a-zA-Z]*)([_\-a-zA-Z]*)$/,_escapeRegExpPattern:function(e){return"string"!=typeof e?e:e.replace(qt._regexEscape,"\\$1")},_toLowerCase:function(e,t){return"string"!=typeof e?t&&e:e.toLowerCase()},_toUpperCase:function(e,t){return"string"!=typeof e?t&&e:e.toUpperCase()},_trim:function(e,t,n){var r,i=[],o=function(e){i.push("^"+e+"+|"+e+"+$")};if("boolean"==typeof t&&(n=t,t=null),"string"!=typeof e)return n&&e;if(Array.isArray(t)&&t.map((function(e){var t=qt._escapeRegExpPattern(e);o(t)})),"string"==typeof t){var a=qt._escapeRegExpPattern(t);o(a)}t||o("\\s");var s="("+i.join("|")+")";for(r=new RegExp(s,"g");e.match(r);)e=e.replace(r,"");return e},_parseLocale:function(e){var t,n=qt._regexParseLocale.exec(e);if(e&&n)return n[2]=qt._trim(n[2],["-","_"]),{lang:qt._toLowerCase(n[1]),countryCode:t=qt._toUpperCase(n[2])||t}},isRtlLang:function(e){var t=qt._parseLocale(e);if(t)return qt._BIDI_RTL_LANGS.indexOf(t.lang)>=0},getLangDir:function(e){return qt.isRtlLang(e)?"rtl":"ltr"}};Object.defineProperty(qt,"_BIDI_RTL_LANGS",{value:["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"],writable:!1,enumerable:!0,configurable:!1});var Bt={isRtlLang:Gt.isRtlLang,getLangDir:Gt.getLangDir};const{getLangDir:Vt}=Bt,Wt=/^.* \((.*?)\)$/,Ht=e=>"string"==typeof e?e.replace(Wt,"$1"):e,Kt=async function({l:e,lang:t,fallbackLanguages:n,imfLocales:r,$p:i,skipIndexedDB:o,noIndexedDB:a,prefI18n:s,files:u,allowPlugins:l,langData:c,basePath:f="",dynamicBasePath:p=""}){const h=new gt({langData:c}),d=({schemaItems:e,fieldInfo:n,metadataObj:r,getFieldAliasOrName:i,usePreferAlias:o})=>n.map((({field:n,plugin:a})=>{if(a)return;const{preferAlias:s,fieldValueAliasMap:u}=bt({field:n,schemaItems:e,metadataObj:r,getFieldAliasOrName:i,lang:t});return o?u?(Object.entries(u).forEach((([e,t])=>{Array.isArray(t)?u[e]=t.map((t=>Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:t}))):t&&"object"==typeof t?"string"==typeof s?u[e]=Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:t[s]}):Object.entries(t).forEach((([t,n])=>{u[e][t]=Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:n})})):u[e]=Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:t})})),!1!==s?u:void 0):void 0:!1!==s?u:void 0})),g=(e,t)=>{let n;const o=i.get(e,!0);return function e(t){return Array.isArray(t)?t.some(e):Object.values(t).some(((r,i)=>"string"!=typeof r?e(r):r===o&&(n=Object.keys(t)[i],!0)))}(r),n||t||console.log("Bad param/value",e,"::",o),n},m=kt,{fileData:y,lf:v,getFieldAliasOrName:b,schemaObj:_,metadataObj:w,pluginsForWork:E}=await Pt({files:u||this.files,allowPlugins:"boolean"==typeof l?l:this.allowPlugins,lang:t,fallbackLanguages:n,work:i.get("work"),basePath:f});console.log("pluginsForWork",E);const x=yt(t,w,"heading"),S=_.items.items,O=[],P=[],T=[];_t({metadataObj:w,schemaItems:S,getFieldAliasOrName:b,lang:t,callback({setName:e,browseFields:t,presort:n}){O.push(e),P.push(n),T.push(t)}});const A=S.map((({title:e,format:t})=>({field:e,fieldAliasOrName:b(e)||e,escapeColumn:"html"!==t,fieldLang:w.fields[e].lang}))),[k]=t,C=new wt({metadataObj:w});if(E){console.log("pluginsForWork",E);const{lang:e}=this;E.iterateMappings((({plugin:t,pluginName:n,pluginLang:r,onByDefaultDefault:i,placement:o,applicableFields:a,meta:s})=>{o="end"===o?Number.POSITIVE_INFINITY:o;const u=({applicableField:t,targetLanguage:a,onByDefault:u,metaApplicableField:l}={})=>{const c=E.getPluginObject(n)||{},f=C.getFieldLang(t);c.getTargetLanguage&&(a=c.getTargetLanguage({applicableField:t,targetLanguage:a,pluginLang:r,applicableFieldLang:f})),"{locale}"===a&&(a=k);const p=yt(e,w,["fieldnames",t]),d=c.getFieldAliasOrName?c.getFieldAliasOrName({locales:e,lf:v,targetLanguage:a,applicableField:t,applicableFieldI18N:p,meta:s,metaApplicableField:l,targetLanguageI18N:h.getLanguageFromCode(a)}):h.getFieldNameFromPluginNameAndLocales({pluginName:n,locales:e,lf:v,targetLanguage:a,applicableFieldI18N:p,meta:s,metaApplicableField:l});A.splice(o,0,{plugin:c,meta:s,placement:o,fieldAliasOrName:d,escapeColumn:!1!==c.escapeColumn,onByDefault:"boolean"==typeof u?u:i||!1,applicableField:t,metaApplicableField:l,fieldLang:a})};E.processTargetLanguages(a,u)||u()}))}const N=A.map((e=>e.fieldAliasOrName)),L=A.map((e=>e.escapeColumn)),I=A.map((({fieldLang:e})=>e!==k?e:null)),j=d({schemaItems:S,fieldInfo:A,metadataObj:w,getFieldAliasOrName:b,usePreferAlias:!1}),D=d({schemaItems:S,fieldInfo:A,metadataObj:w,getFieldAliasOrName:b,usePreferAlias:!0}),R=i.localizeParamNames=i.has("i18n",!0)?"1"===i.get("i18n",!0):"true"===s||"false"!==s&&this.localizeParamNames,F=R?t=>e(["params",t]):e=>e,U=R?t=>e(["params","indexed",t]):e=>e,$=R?(e,t="")=>i.get(F(e)+t,!0):(e,t="")=>i.get(e+t,!0),M=R?(e,t="")=>i.get(i.get("work")+"-"+U(e)+t,!0):(e,t="")=>i.get(i.get("work")+"-"+e+t,!0),z=T.findIndex(((e,t)=>M("startEnd",t+1)));if(-1!==z){const e="-",t=":",n=(M("startEnd",z+1)||"").trim(),[r,o]=n.split(e);if(void 0!==o){const e=r.split(t),n=o.split(t),a=e.length-n.length;a>0?n.unshift(...e.slice(0,a)):a<0&&e.push(...Array.from({length:-a}).fill("1")),console.log("startPartVals",e),console.log("endPartVals",n),e.forEach(((e,t)=>{const r=n[t];i.set(`${i.get("work")}-start${z+1}-${t+1}`,e,!0),i.set(`${i.get("work")}-end${z+1}-${t+1}`,r,!0)}))}}const q=T.findIndex(((e,t)=>M("start",t+1+"-1"))),G=T[q],B=O[q],V=G.map((e=>e.fieldName)),W=T[0],H=O[0],K=W.map((e=>e.fieldName)),X=G.map((e=>e.fieldSchema.type)),Y=e=>V.map(((t,n)=>i.get(i.get("work")+"-"+e+(q+1)+"-"+(n+1),!0))),J=Y("start"),Z=Y("end"),[Q,ee]=(({starts:t,ends:n,applicableBrowseFieldNames:r,heading:i})=>{let o;const a="0"!==g("caption");if(a){const a=Rt.resultsDisplayServerOrClient.startSeparator({l:e}),s=Rt.resultsDisplayServerOrClient.innerBrowseFieldSeparator({l:e}),u=(()=>{const i=[],o=t.reduce(((e,t,r)=>{const o=e+t;return t===n[r]?o+(r>0?s:" "):(i.push(n[r]),o+a)}),"").slice(0,-a.length),u=r.join(s);return kt(Rt.resultsDisplayServerOrClient.ranges({l:e,startRange:o,endVals:i,rangeNames:u}))})();o=Rt.resultsDisplayServerOrClient.caption({heading:i,ranges:u})}return[a,o]})({starts:J,ends:Z,applicableBrowseFieldNames:V,heading:x}),te="1"===g("interlintitle");console.log("rand","yes"===$("rand"));const ne=(e,t)=>{let n;if(/^\d+$/.test(e)||Wt.test(e))n=Ht(e);else{const{rawFieldValueAliasMap:r}=G[t];let i;if(r){const t=Object.entries(r);Array.isArray(t[0][1])?t.some((([t,n])=>!!n.includes(e)&&(i=t,!0))):t.some((([t,n])=>!!Object.values(n).includes(e)&&(i=t,!0)))}n=void 0===i?e:i}return"integer"===X[t]?Number.parseInt(n):n},re=y.name,ie=J.map(ne),oe=Z.map(ne);let ae,se=!1;if(o||a){const e=P[q];if(this.noDynamic)({resolved:{data:ae}}=await mt.resolveRefs(y.file)),(({presort:e,tableData:t,applicableBrowseFieldNames:n,localizedFieldNames:r})=>{e&&t.sort(((e,t)=>{let i;return n.some((n=>{const o=r.indexOf(n),a=e[o]<t[o],s=e[o]>t[o];return i=s?1:-1,a||s})),i}))})({presort:e,tableData:ae,applicableBrowseFieldNames:V,localizedFieldNames:N});else{const e=`${p}textbrowser?${i.toString()}`;ae=await(await fetch(e)).json(),se=!0}}else ae=await new Promise(((e,t)=>{const n=this.namespace+"-textbrowser-cache-data";indexedDB.open(n).onsuccess=({target:{result:t}})=>{const n="files-to-cache-"+re;t.transaction(n).objectStore(n).index("browseFields-"+B).getAll(IDBKeyRange.bound(ie,oe)).onsuccess=({target:{result:t}})=>{const n=t.map((e=>e.value));e(n)}}}));!se&&E&&(A.forEach((({plugin:e,placement:t},n)=>{e&&ae.forEach(((e,n)=>{e.splice(t,0,null)}))})),A.forEach((({plugin:e,applicableField:t,fieldLang:n,meta:r,metaApplicableField:o},a)=>{if(!e)return;const s=A.findIndex((({field:e})=>e===t));ae.forEach(((u,l)=>{const c=u[s];u[a]=e.getCellData&&e.getCellData({tr:u,tableData:ae,i:l,j:a,applicableField:t,fieldInfo:A,applicableFieldIdx:s,applicableFieldText:c,fieldLang:n,getLangDir:Vt,meta:r,metaApplicableField:o,$p:i,thisObj:this})||c})),console.log("applicableFieldIdx",s)})));const ue=Vt(k),le=I.map((e=>{if(!e)return null;const t=Vt(e);return t!==ue?t:null})),ce={tableData:ae,$p:i,$pRaw:g,$pRawEsc:e=>kt(g(e)),$pEscArbitrary:e=>kt(i.get(e,!0)),escapeQuotedCSS:e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),escapeCSS:m,escapeHTML:kt,l:e,localizedFieldNames:N,fieldLangs:I,fieldDirs:le,caption:ee,hasCaption:Q,showInterlinTitles:te,determineEnd:(({fieldValueAliasMap:e,fieldValueAliasMapPreferred:t,localizedFieldNames:n,applicableBrowseFieldNames:r,startsRaw:i,endsRaw:o})=>({tr:a,foundState:s})=>{const u=[],l=r.map((r=>{const i=n.indexOf(r);return void 0!==e[i]?u.push(t[i][a[i]]):u.push(a[i]),a[i]}));if(!s.start){if(i.some(((e,t)=>e!==l[t])))return!1;s.start=!0}if(o.every(((e,t)=>e===l[t])))s.end=!0;else if(s.end)return!0;return u.join("-")})({applicableBrowseFieldNames:V,fieldValueAliasMap:j,fieldValueAliasMapPreferred:D,localizedFieldNames:N,startsRaw:ie,endsRaw:oe}),canonicalBrowseFieldSetName:H,getCanonicalID:(({fieldValueAliasMap:e,fieldValueAliasMapPreferred:t,localizedFieldNames:n,canonicalBrowseFieldNames:r})=>({tr:i,foundState:o})=>r.map((r=>{const o=n.indexOf(r);return void 0!==e[o]?t[o][i[o]]:i[o]})).join("-"))({canonicalBrowseFieldNames:K,fieldValueAliasMap:j,fieldValueAliasMapPreferred:D,localizedFieldNames:N}),getCellValue:(({fieldValueAliasMapPreferred:t,escapeColumnIndexes:n})=>({tr:r,idx:i})=>{let o=void 0!==t[i]?t[i][r[i]]:r[i];return o&&"object"==typeof o&&(o=Object.values(o)),Array.isArray(o)&&(o=o.join(e("comma-space"))),!n[i]&&this.trustFormatHTML||"string"!=typeof o?{tdVal:o}:{tdVal:kt(o),htmlEscaped:!0}})({fieldValueAliasMapPreferred:D,escapeColumnIndexes:L,escapeHTML:kt}),checkedAndInterlinearFieldInfo:(({localizedFieldNames:t})=>{let n,r,o=1,a=[];do{n=i.get("field"+o,!0),r=i.get("checked"+o,!0),o++,!n||r!==e("yes")&&null!==r||a.push(n)}while(n);a=a.filter((e=>t.includes(e)));const s=a.map((e=>t.indexOf(e))),u=s.map(((e,t)=>{const n=i.get("interlin"+(e+1),!0);return n&&n.split(/\s*,\s*/).map((e=>Number.parseInt(e)-1)).filter((e=>!Number.isNaN(e)))}));return[a,s,u]})({localizedFieldNames:N}),interlinearSeparator:this.interlinearSeparator};return{fieldInfo:A,$p:i,applicableBrowseFieldSet:G,fieldValueAliasMapPreferred:D,lf:v,iil:U,ilRaw:$,browseFieldSets:T,lang:t,metadataObj:w,fileData:y,templateArgs:ce}};async function Xt(){try{Rt.permissions.addLogEntry({text:"Worker registration: Beginning..."});if(!await navigator.storage.persist())return void Rt.permissions.browserNotGrantingPersistence();await(async({serviceWorkerPath:e,logger:t})=>{let n;console.log("--ready to register service worker",e);try{n=await navigator.serviceWorker.register(e,{type:"module"})}catch(t){return console.log("serviceWorkerPath",e),void await dt.alert("\nThere was an error during registration (for offline ability).\nPlease refresh the page if you wish to reattempt.\n")}return t.addLogEntry({text:"Worker registration: Complete"}),At({r:n,logger:t})})({serviceWorkerPath:this.serviceWorkerPath,logger:Rt.permissions})}catch(e){if(console.log("err",e),e&&"object"==typeof e){const{errorType:t}=e;if("versionChange"===t)return void Rt.permissions.versionChange()}Rt.permissions.errorRegistering(kt(e&&e.message))}}async function Yt(e,t){await new Promise(((e,n)=>{const[,r,i]=Rt.permissions.main({l:t,ok:async()=>{const e=await Notification.requestPermission();r.close(e)},refuse:()=>{r.close()},close:async()=>{try{if(!r.returnValue)return void function(){localStorage.setItem(this.namespace+"-refused","true")}()}catch(e){console.log("err",e),Rt.permissions.errorRegistering(kt(e&&e.message))}switch(r.returnValue){case"denied":case"default":return void e();case"granted":if(navigator.serviceWorker.controller)return void e();await Xt.call(this);break;default:console.error("Unexpected returnValue",r.returnValue)}},closeBrowserNotGranting:e=>{i.close()}});r.showModal()}))}class Jt{constructor(e){const t=new URL("node_modules/textbrowser/resources/index.js",location);this.site=e.site||"site.json";const n=e.stylesheets||["@builtin"],r=n.indexOf("@builtin");var i,o;-1!==r&&n.splice(r,1,new URL("index.css",t).href),this.stylesheets=n,o=e,(i=this).userJSON=o.userJSON||"resources/user.json",i.languages=o.languages||new URL("../appdata/languages.json",new URL("node_modules/textbrowser/resources/index.js",location)).href,i.serviceWorkerPath=o.serviceWorkerPath||`sw.js?pathToUserJSON=${encodeURIComponent(i.userJSON)}&stylesheets=${encodeURIComponent(JSON.stringify(i.stylesheets||[]))}`,i.files=o.files||"files.json",i.namespace=o.namespace||"textbrowser",this.allowPlugins=e.allowPlugins,this.dynamicBasePath=e.dynamicBasePath,this.trustFormatHTML=e.trustFormatHTML,this.requestPersistentStorage=e.requestPersistentStorage,this.localizeParamNames=void 0===e.localizeParamNames||e.localizeParamNames,this.hideFormattingSection=Boolean(e.hideFormattingSection),this.preferencesPlugin=e.preferencesPlugin,this.interlinearSeparator=e.interlinearSeparator,this.showEmptyInterlinear=e.showEmptyInterlinear,this.showTitleOnSingleInterlinear=e.showTitleOnSingleInterlinear,this.noDynamic=e.noDynamic,this.skipIndexedDB=e.skipIndexedDB}async init(){return this._stylesheetElements=await be(this.stylesheets),this.displayLanguages()}async displayLanguages(){try{const[e,t]=await d([this.languages,this.site]);this.langData=e,this.siteData=t;const n=this.paramChange();return window.addEventListener("hashchange",(()=>this.paramChange())),n}catch(e){console.log("err",e),dt.alert(e)}}getWorkData(e){try{return Pt.call(this,t(t({},e),{},{files:this.files,allowPlugins:this.allowPlugins}))}catch(e){console.log("err",e),dt.alert("catch:"+e)}}getDirectionForLanguageCode(e){const t=this.langData.languages,n=t.find((t=>t.code===e));return n&&n.direction||t.find((t=>t.code.startsWith(e+"-")))}getFieldNameAndValueAliases(e){return bt(t(t({},e),{},{lang:this.lang}))}getBrowseFieldData(e){return _t(t(t({},e),{},{lang:this.lang}))}async paramChange(){Rt.defaultBody();const e=this.$p="string"==typeof history.state?new Ut({params:history.state}):new Ut,n=(t,n)=>{const r=document.querySelector(t),i=location.href.replace(/#.*$/,"")+"#"+e.toString();history.replaceState(Ae(r,{hash:!0,empty:!0}),document.title,i),n(),location.hash="#"+e.toString()},r=new gt({langData:this.langData}),{lang:i,langs:o,languageParam:a,fallbackLanguages:s}=r.getLanguageInfo({$p:e});this.lang=i;const[u]=i,l=this.getDirectionForLanguageCode(u);document.documentElement.lang=u,document.dir=l;const c=(()=>{const e=e=>this.siteData["localization-strings"][e];return ve({locales:i.map(e),fallbackLocales:s.map(e)}).getFormatter()})();document.title=c("browser-title");const f=localStorage.getItem(this.namespace+"-refused"),p=await navigator.storage.persisted(),h=await navigator.serviceWorker.getRegistration(this.serviceWorkerPath),g=e.get("result"),m=async()=>{if(g)return;!(f||navigator.serviceWorker.controller&&p)&&(p?(Rt.permissions.main({l:c}),await Xt.call(this)):await Yt.call(this,o,c),Rt.permissions.exitDialogs())};if(h){const e=h.installing||h.waiting||h.active;if(!e)return console.error("Unexpected error: worker registration received without a worker."),void await m();Rt.permissions.main({l:c});setInterval((()=>{h.update()}),36e5),console.log("worker.state",e.state);const t=async()=>{try{return At({r:h,langs:o,languages:this.languages,logger:Rt.permissions})}catch(e){return console.log("err",e),dt.alert("\n There was an unexpected error activating the new version;\n please save any unfinished work, close this tab, and try\n opening this site again.\n\n Please contact a service administrator if the problem\n persists (Error type: worker activation).\n ")}};switch(e.state){case"installing":t(),Tt({r:h,logger:{addLogEntry(e){console.log(e)}}});break;case"installed":await t();break;case"activating":return await dt.alert("\n Please wait for a short while as we work to update to a new version.\n "),t(),void navigator.serviceWorker.onmessage({data:"finishActivate"});case"activated":Tt({r:h,logger:{addLogEntry(e){console.log(e)}}});break;case"redundant":return void await t();default:console.log("Unexpected worker.state",e.state)}}else await m();if(Rt.permissions.exitDialogs(),!a)return e.l10n=c,document.title=c("languages-title"),void Rt.languageSelect.main({langs:o,languages:r,followParams:n,$p:e});return Ie({$p:e,lang:i,langs:o,langData:this.langData,fallbackLanguages:s,resultsDisplay:e=>{const n=f||!navigator.serviceWorker.controller;return this.resultsDisplayClient(t(t({langData:this.langData},e),{},{noIndexedDB:n,dynamicBasePath:this.dynamicBasePath,files:this.files,allowPlugins:this.allowPlugins}))},localeCallback:t=>{this.l10n=t,e.l10n=t;return e.get("work")?!g&&(this.workDisplay({l:t,lang:i,preferredLocale:u,fallbackLanguages:s,languageParam:a,$p:e,languages:r,preferencesPlugin:this.preferencesPlugin}),!0):(async function({files:e,lang:t,fallbackLanguages:n,$p:r,followParams:i}){try{const o=await d(e),a=e=>o["localization-strings"][e],s=await d(o.groups.reduce(((e,t)=>{const n=(o.metadataBaseDirectory||"")+(t.metadataBaseDirectory||"")+"/";return t.files.reduce(((e,t)=>[...e,n+t.metadataFile]),e)}),[])),u=ve({locales:t.map(a),fallbackLocales:n.map(a)}).getFormatter();document.title=u({key:"browserfile-workselect",fallback:!0});const l=s[Symbol.iterator](),c=()=>{const e=l.next().value;return yt(t,e,"alias")};Rt.workSelect({groups:o.groups,lf:u,getNextAlias:c,$p:r,followParams:i})}catch(e){console.log("Error",e),dt.alert(e)}}({files:this.files,lang:i,fallbackLanguages:s,$p:e,followParams:n}),!0)}})}}Jt.prototype.workDisplay=async function({l:e,languageParam:n,lang:i,preferredLocale:o,languages:a,fallbackLanguages:s,$p:u}){const{preferencesPlugin:l}=this,c=this.langData.languages,f=this.getDirectionForLanguageCode(s[0]),p=localStorage.getItem(this.namespace+"-localizeParamNames"),h=u.localizeParamNames=u.has("i18n",!0)?"1"===u.get("i18n",!0):"true"===p||"false"!==p&&this.localizeParamNames,g=localStorage.getItem(this.namespace+"-hideFormattingSection"),m=u.has("formatting",!0)?"0"===u.get("formatting",!0):"true"===g||"false"!==g&&this.hideFormattingSection;try{const p=await this.getWorkData({lang:i,fallbackLanguages:s,preferredLocale:o,languages:a,work:u.get("work")}),{lf:g,fileData:y,metadataObj:v}=p,b=r(p,zt);document.title=g({key:"browserfile-workdisplay",values:{work:y?yt(i,v,"alias"):""},fallback:!0}),await async function({lf:t,metadataObj:r,getFieldAliasOrName:p,schemaObj:g,schemaItems:y,fieldInfo:v,metadata:b,pluginsForWork:_,groupsToWorks:w}){const E=h?t=>e(["params",t]):e=>e,x=h?t=>e(["params","indexed",t]):e=>e,S=a.localeFromLangData.bind(a),O=ve({locales:i.map(S),fallbackLocales:s.map(S)}).getFormatter(),P=(t,n,r)=>e({key:t,values:n,formats:r,fallback:({message:e})=>Rt.workDisplay.bdo({fallbackDirection:f,message:e})}),T=b.getFieldMatchesLocale({namespace:this.namespace,preferredLocale:o,schemaItems:y,pluginsForWork:_}),A=[];this.getBrowseFieldData({metadataObj:r,schemaItems:y,getFieldAliasOrName:p,callback({browseFields:e,i:t}){Rt.workDisplay.addBrowseFields({browseFields:e,fieldInfo:v,ld:P,i:t,iil:x,$p:u,content:A})}});const k=function(...e){const t=Mt(...e);return function(...e){const n=t(...e);return $t(n)}}({l:e,il:E,$p:u}),C=Mt({l:e,il:E,$p:u}),{groups:N}=await d(this.files),L=yt(i,r,"heading"),I=(()=>{const e=Promise.all(w.map((async({name:e,workNames:t,shortcuts:n})=>({groupName:e,worksToFields:await Promise.all(t.map((async(e,t)=>({workName:e,shortcut:n[t],fieldAliasOrNames:(await this.getWorkData({lang:i,fallbackLanguages:s,preferredLocale:o,languages:a,work:e})).fieldInfo.map((({fieldAliasOrName:e})=>e))}))))}))));return async()=>e})();Rt.workDisplay.main({languageParam:n,lang:i,lf:t,l:e,namespace:this.namespace,groups:N,heading:L,imfl:O,fallbackDirection:f,langs:c,fieldInfo:v,localizeParamNames:h,serializeParamsAsURL:k,paramsSetter:C,replaceHash:$t,getFieldAliasOrNames:I,hideFormattingSection:m,$p:u,metadataObj:r,il:E,le:(t,n,r,i,o=[])=>(i[r]=e({key:t,fallback:({message:e})=>(i.dir=f,e)}),[n,i,o]),ld:P,iil:x,fieldMatchesLocale:T,preferredLocale:o,schemaItems:y,content:A,preferencesPlugin:l})}.call(this,t({lf:g,metadataObj:v},b))}catch(e){console.log("err",e),dt.alert(e)}},Jt.prototype.resultsDisplayClient=async function(e){const n=await navigator.storage.persisted(),r=this.skipIndexedDB||!n||!navigator.serviceWorker.controller,i=localStorage.getItem(this.namespace+"-localizeParamNames"),{fieldInfo:o,$p:a,browseFieldSets:s,applicableBrowseFieldSet:u,lang:l,metadataObj:c,fileData:f,fieldValueAliasMapPreferred:p,lf:h,iil:d,ilRaw:g,templateArgs:m}=await Kt.call(this,t(t({},e),{},{skipIndexedDB:r,prefI18n:i}));document.title=h({key:"browserfile-resultsdisplay",values:{work:f?yt(l,c,"alias"):""},fallback:!0}),Rt.resultsDisplayClient.main(m),(({applicableBrowseFieldSet:e,fieldValueAliasMapPreferred:t,ilRaw:n,iil:r,max:i,$p:o})=>{const a=e.map((e=>e.fieldSchemaIndex)),s=o.get("work");let u;const l=n("anchorrowcol");if(l&&(u=Rt.resultsDisplayClient.anchorRowCol({anchorRowCol:l})),!u){const e=[];let n="";for(let u,l=1;!u&&!e.length;l++)for(let c=1;;c++){const f=s+"-anchor"+l+"-"+c,p=o.get(f,!0);if(!p){(l===i||e.length)&&(u=!0);break}n=o.get(r("anchorfield")+l,!0);const h=a[c-1],d=Ht(p),g=t[h]&&t[h][d];e.push(g||p)}if(e.length){const t=e=>(e||"").replace(/["\\]/g,"\\$&"),r=t(e.join("-")),i=n?t(n):void 0;u=Rt.resultsDisplayClient.anchors({escapedRow:r,escapedCol:i})}}u&&u.scrollIntoView()})({applicableBrowseFieldSet:u,fieldValueAliasMapPreferred:p,iil:d,ilRaw:g,$p:e.$p,max:s.length}),o.forEach((({plugin:e,applicableField:t,meta:n,j:r})=>{e&&e.done&&e.done({$p:a,applicableField:t,meta:n,j:r,thisObj:this})}))},Jt.prototype.getWorkFiles=async function(e=this.files){const t=await d(e),n=[];return t.groups.forEach((e=>{e.files.forEach((r=>{const{file:i,schemaFile:o,metadataFile:a}=Ot(t,e,r);n.push(i,o,a)}))})),n.push(...Object.values(t.plugins).map((e=>e.path))),n};export{Jt as default};
19
+ */u=function(){var e,t,n,r=Object.prototype.toString,o=void 0!==i?function(e){return i(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(t){e=function(e,t,n){return e[t]=n,e}}function a(e,r){n.add(e,r),t||(t=o(n.drain))}function s(e){var t,n=void 0===e?"undefined":l(e);return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function u(){for(var e=0;e<this.chain.length;e++)c(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(i=s(r))?i.call(r,n.resolve,n.reject):n.resolve(r)}catch(e){n.reject(e)}}function f(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(u,t))}function p(e,t,n,r){for(var i=0;i<t.length;i++)!function(i){e.resolve(t[i]).then((function(e){n(i,e)}),r)}(i)}function h(e){this.def=e,this.triggered=!1}function d(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function g(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new d(this);this.then=function(e,n){var r={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return r.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");r.resolve=e,r.reject=t})),t.chain.push(r),0!==t.state&&a(u,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){(function e(t){var n,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(n=s(t))?a((function(){var i=new h(r);try{n.call(t,(function(){e.apply(i,arguments)}),(function(){f.apply(i,arguments)}))}catch(e){f.call(i,e)}})):(r.msg=t,r.state=1,r.chain.length>0&&a(u,r))}catch(e){f.call(new h(r),e)}}}).call(t,e)}),(function(e){f.call(t,e)}))}catch(e){f.call(t,e)}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,o){r=new i(t,o),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();var m=e({},"constructor",g,!1);return g.prototype=m,e(m,"__NPO__",0,!1),e(g,"resolve",(function(e){return e&&"object"==(void 0===e?"undefined":l(e))&&1===e.__NPO__?e:new this((function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)}))})),e(g,"reject",(function(e){return new this((function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)}))})),e(g,"all",(function(e){var t=this;return"[object Array]"!=r.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");var i=e.length,o=Array(i),a=0;p(t,e,(function(e,t){o[e]=t,++a===i&&n(o)}),r)}))})),e(g,"race",(function(e){var t=this;return"[object Array]"!=r.call(e)?t.reject(TypeError("Not an array")):new t((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");p(t,e,(function(e,t){n(t)}),r)}))})),g},(s=void 0!==r?r:void 0)[a="Promise"]=s[a]||u(),e.exports?e.exports=s[a]:void 0===(o=function(){return s[a]}.call(t,n,t,e))||(e.exports=o)}).call(this,n(1),n(43).setImmediate)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.buildExps=i;var r=n(6);function i(e){var t=(0,r.merge)("[0-9]","[A-Fa-f]"),n=(0,r.subexp)((0,r.subexp)("%[EFef]"+t+"%"+t+t+"%"+t+t)+"|"+(0,r.subexp)("%[89A-Fa-f]"+t+"%"+t+t)+"|"+(0,r.subexp)("%"+t+t)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",o=(0,r.merge)("[\\:\\/\\?\\#\\[\\]\\@]",i),a=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",s=e?"[\\uE000-\\uF8FF]":"[]",u=(0,r.merge)("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",a),l=(0,r.subexp)("[A-Za-z]"+(0,r.merge)("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),c=(0,r.subexp)((0,r.subexp)(n+"|"+(0,r.merge)(u,i,"[\\:]"))+"*"),f=(0,r.subexp)((0,r.subexp)("25[0-5]")+"|"+(0,r.subexp)("2[0-4][0-9]")+"|"+(0,r.subexp)("1[0-9][0-9]")+"|"+(0,r.subexp)("[1-9][0-9]")+"|[0-9]"),p=(0,r.subexp)(f+"\\."+f+"\\."+f+"\\."+f),h=(0,r.subexp)(t+"{1,4}"),d=(0,r.subexp)((0,r.subexp)(h+"\\:"+h)+"|"+p),g=(0,r.subexp)((0,r.subexp)(h+"\\:")+"{6}"+d),m=(0,r.subexp)("\\:\\:"+(0,r.subexp)(h+"\\:")+"{5}"+d),y=(0,r.subexp)((0,r.subexp)(h)+"?\\:\\:"+(0,r.subexp)(h+"\\:")+"{4}"+d),v=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+(0,r.subexp)(h+"\\:")+"{3}"+d),b=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+(0,r.subexp)(h+"\\:")+"{2}"+d),_=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),w=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),E=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),x=(0,r.subexp)((0,r.subexp)((0,r.subexp)(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),S=(0,r.subexp)([g,m,y,v,b,_,w,E,x].join("|")),O=(0,r.subexp)("[vV]"+t+"+\\."+(0,r.merge)(u,i,"[\\:]")+"+"),P=(0,r.subexp)("\\["+(0,r.subexp)(S+"|"+O)+"\\]"),T=(0,r.subexp)((0,r.subexp)(n+"|"+(0,r.merge)(u,i))+"*"),A=(0,r.subexp)(P+"|"+p+"(?!"+T+")|"+T),k=(0,r.subexp)("[0-9]*"),C=(0,r.subexp)((0,r.subexp)(c+"@")+"?"+A+(0,r.subexp)("\\:"+k)+"?"),N=(0,r.subexp)(n+"|"+(0,r.merge)(u,i,"[\\:\\@]")),L=(0,r.subexp)(N+"*"),I=(0,r.subexp)(N+"+"),j=(0,r.subexp)((0,r.subexp)(n+"|"+(0,r.merge)(u,i,"[\\@]"))+"+"),D=(0,r.subexp)((0,r.subexp)("\\/"+L)+"*"),R=(0,r.subexp)("\\/"+(0,r.subexp)(I+D)+"?"),F=(0,r.subexp)(j+D),U=(0,r.subexp)(I+D),$="(?!"+N+")",M=((0,r.subexp)(D+"|"+R+"|"+F+"|"+U+"|"+$),(0,r.subexp)((0,r.subexp)(N+"|"+(0,r.merge)("[\\/\\?]",s))+"*")),z=(0,r.subexp)((0,r.subexp)(N+"|[\\/\\?]")+"*"),q=(0,r.subexp)((0,r.subexp)("\\/\\/"+C+D)+"|"+R+"|"+U+"|"+$),G=(0,r.subexp)(l+"\\:"+q+(0,r.subexp)("\\?"+M)+"?"+(0,r.subexp)("\\#"+z)+"?"),B=(0,r.subexp)((0,r.subexp)("\\/\\/"+C+D)+"|"+R+"|"+F+"|"+$),V=(0,r.subexp)(B+(0,r.subexp)("\\?"+M)+"?"+(0,r.subexp)("\\#"+z)+"?");return(0,r.subexp)(G+"|"+V),(0,r.subexp)(l+"\\:"+q+(0,r.subexp)("\\?"+M)+"?"),(0,r.subexp)((0,r.subexp)("\\/\\/("+(0,r.subexp)("("+c+")@")+"?("+A+")"+(0,r.subexp)("\\:("+k+")")+"?)")+"?("+D+"|"+R+"|"+U+"|"+$+")"),(0,r.subexp)("\\?("+M+")"),(0,r.subexp)("\\#("+z+")"),(0,r.subexp)((0,r.subexp)("\\/\\/("+(0,r.subexp)("("+c+")@")+"?("+A+")"+(0,r.subexp)("\\:("+k+")")+"?)")+"?("+D+"|"+R+"|"+F+"|"+$+")"),(0,r.subexp)("\\?("+M+")"),(0,r.subexp)("\\#("+z+")"),(0,r.subexp)((0,r.subexp)("\\/\\/("+(0,r.subexp)("("+c+")@")+"?("+A+")"+(0,r.subexp)("\\:("+k+")")+"?)")+"?("+D+"|"+R+"|"+U+"|"+$+")"),(0,r.subexp)("\\?("+M+")"),(0,r.subexp)("\\#("+z+")"),(0,r.subexp)("("+c+")@"),(0,r.subexp)("\\:("+k+")"),{NOT_SCHEME:new RegExp((0,r.merge)("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp((0,r.merge)("[^\\%\\:]",u,i),"g"),NOT_HOST:new RegExp((0,r.merge)("[^\\%\\[\\]\\:]",u,i),"g"),NOT_PATH:new RegExp((0,r.merge)("[^\\%\\/\\:\\@]",u,i),"g"),NOT_PATH_NOSCHEME:new RegExp((0,r.merge)("[^\\%\\/\\@]",u,i),"g"),NOT_QUERY:new RegExp((0,r.merge)("[^\\%]",u,i,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp((0,r.merge)("[^\\%]",u,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp((0,r.merge)("[^]",u,i),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp((0,r.merge)("[^\\%]",u,o),"g"),PCT_ENCODED:new RegExp(n,"g"),IPV6ADDRESS:new RegExp("\\[?("+S+")\\]?","g")}}t.default=i(!1)},function(e,t,n){(function(e,r){var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a){var s="object"==o(t)&&t&&!t.nodeType&&t,u="object"==o(e)&&e&&!e.nodeType&&e,l="object"==(void 0===r?"undefined":o(r))&&r;l.global!==l&&l.window!==l&&l.self!==l||(a=l);var c,f,p=2147483647,h=36,d=/^xn--/,g=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=Math.floor,b=String.fromCharCode;function _(e){throw new RangeError(y[e])}function w(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+w((e=e.replace(m,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function S(e){return w(e,(function(e){var t="";return e>65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+b(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?v(e/700):e>>1,e+=v(e/t);e>455;r+=h)e=v(e/35);return v(r+36*e/(e+38))}function T(e){var t,n,r,i,o,a,s,u,l,c,f,d=[],g=e.length,m=0,y=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&_("not-basic"),d.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=m,a=1,s=h;i>=g&&_("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||u>v((p-m)/a))&&_("overflow"),m+=u*a,!(u<(l=s<=b?1:s>=b+26?26:s-b));s+=h)a>v(p/(c=h-l))&&_("overflow"),a*=c;b=P(m-o,t=d.length+1,0==o),v(m/t)>p-y&&_("overflow"),y+=v(m/t),m%=t,d.splice(m++,0,y)}return S(d)}function A(e){var t,n,r,i,o,a,s,u,l,c,f,d,g,m,y,w=[];for(d=(e=x(e)).length,t=128,n=0,o=72,a=0;a<d;++a)(f=e[a])<128&&w.push(b(f));for(r=i=w.length,i&&w.push("-");r<d;){for(s=p,a=0;a<d;++a)(f=e[a])>=t&&f<s&&(s=f);for(s-t>v((p-n)/(g=r+1))&&_("overflow"),n+=(s-t)*g,t=s,a=0;a<d;++a)if((f=e[a])<t&&++n>p&&_("overflow"),f==t){for(u=n,l=h;!(u<(c=l<=o?1:l>=o+26?26:l-o));l+=h)y=u-c,m=h-c,w.push(b(O(c+y%m,0))),u=v(y/m);w.push(b(O(u,0))),o=P(n,g,r==i),n=0,++r}++n,++t}return w.join("")}if(c={version:"1.4.1",ucs2:{decode:x,encode:S},decode:T,encode:A,toASCII:function(e){return E(e,(function(e){return g.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return E(e,(function(e){return d.test(e)?T(e.slice(4).toLowerCase()):e}))}},"object"==o(n(3))&&n(3))void 0===(i=function(){return c}.call(t,n,t,e))||(e.exports=i);else if(s&&u)if(e.exports==s)u.exports=c;else for(f in c)c.hasOwnProperty(f)&&(s[f]=c[f]);else a.punycode=c}(void 0)}).call(this,n(8)(e),n(1))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}}},function(e,t,n){(function(t){var r=n(7),i=n(21),o=n(34),a=n(35),s=n(45),u=n(48),l=n(49),c=/~(?:[^01]|$)/g,f={},p=["relative","remote"],h=["absolute","uri"],d={};function g(e,t){r.isString(e)&&(e=u(e)),r.isString(t)&&(t=u(t));var n,i,a=O(r.isUndefined(t)?"":t);return h.indexOf(a.reference)>-1?i=a:(n=r.isUndefined(e)?void 0:O(e),r.isUndefined(n)?i=a:((i=n).path=u(o.join(n.path,a.path)),i.query=function(e,t){var n={};function i(e){r.forOwn(e,(function(e,t){n[t]=e}))}return i(s.parse(e||"")),i(s.parse(t||"")),0===Object.keys(n).length?void 0:s.stringify(n)}(n.query,a.query))),i.fragment=void 0,(-1===h.indexOf(i.reference)&&0===i.path.indexOf("../")?"../":"")+l.serialize(i)}function m(e){return p.indexOf(_(e))>-1}function y(e){return r.isUndefined(e.error)&&"invalid"!==e.type}function v(e,t){var n=e;return t.forEach((function(e){if(!(e in n))throw Error("JSON Pointer points to missing location: "+I(t));n=n[e]})),n}function b(e){return Object.keys(e).filter((function(e){return"$ref"!==e}))}function _(e){var t;switch(e.uriDetails.reference){case"absolute":case"uri":t="remote";break;case"same-document":t="local";break;default:t=e.uriDetails.reference}return t}function w(e,t){var n=f[e],i=Promise.resolve(),o=r.cloneDeep(t.loaderOptions||{});return r.isUndefined(n)?(r.isUndefined(o.processContent)&&(o.processContent=function(e,t){t(void 0,JSON.parse(e.text))}),i=(i=a.load(decodeURI(e),o)).then((function(t){return f[e]={value:t},t})).catch((function(t){throw f[e]={error:t},t}))):i=i.then((function(){if(r.isError(n.error))throw n.error;return n.value})),i.then((function(e){return r.cloneDeep(e)}))}function E(e,t){var n=!0;try{if(!r.isPlainObject(e))throw new Error("obj is not an Object");if(!r.isString(e.$ref))throw new Error("obj.$ref is not a String")}catch(e){if(t)throw e;n=!1}return n}function x(e){return-1!==e.indexOf("://")||o.isAbsolute(e)?e:o.resolve(t.cwd(),e)}function S(e,t){e.error=t.message,e.missing=!0}function O(e){return l.parse(e)}function P(e,t){var n,i;if(e=r.isUndefined(e)?{}:r.cloneDeep(e),!r.isObject(e))throw new TypeError("options must be an Object");if(!r.isUndefined(e.resolveCirculars)&&!r.isBoolean(e.resolveCirculars))throw new TypeError("options.resolveCirculars must be a Boolean");if(!(r.isUndefined(e.filter)||r.isArray(e.filter)||r.isFunction(e.filter)||r.isString(e.filter)))throw new TypeError("options.filter must be an Array, a Function of a String");if(!r.isUndefined(e.includeInvalid)&&!r.isBoolean(e.includeInvalid))throw new TypeError("options.includeInvalid must be a Boolean");if(!r.isUndefined(e.location)&&!r.isString(e.location))throw new TypeError("options.location must be a String");if(!r.isUndefined(e.refPreProcessor)&&!r.isFunction(e.refPreProcessor))throw new TypeError("options.refPreProcessor must be a Function");if(!r.isUndefined(e.refPostProcessor)&&!r.isFunction(e.refPostProcessor))throw new TypeError("options.refPostProcessor must be a Function");if(!r.isUndefined(e.subDocPath)&&!r.isArray(e.subDocPath)&&!N(e.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(r.isUndefined(e.resolveCirculars)&&(e.resolveCirculars=!1),e.filter=function(e){var t,n;return r.isArray(e.filter)||r.isString(e.filter)?(n=r.isString(e.filter)?[e.filter]:e.filter,t=function(e){return n.indexOf(e.type)>-1||n.indexOf(_(e))>-1}):r.isFunction(e.filter)?t=e.filter:r.isUndefined(e.filter)&&(t=function(){return!0}),function(n,r){return("invalid"!==n.type||!0===e.includeInvalid)&&t(n,r)}}(e),r.isUndefined(e.location)&&(e.location=x("./root.json")),(n=e.location.split("#")).length>1&&(e.subDocPath="#"+n[1]),i=decodeURI(e.location)===e.location,e.location=g(e.location,void 0),i&&(e.location=decodeURI(e.location)),e.subDocPath=function(e){var t;return r.isArray(e.subDocPath)?t=e.subDocPath:r.isString(e.subDocPath)?t=L(e.subDocPath):r.isUndefined(e.subDocPath)&&(t=[]),t}(e),!r.isUndefined(t))try{v(t,e.subDocPath)}catch(e){throw e.message=e.message.replace("JSON Pointer","options.subDocPath"),e}return e}function T(e){if(!r.isArray(e))throw new TypeError("path must be an array");return e.map((function(e){return r.isString(e)||(e=JSON.stringify(e)),e.replace(/~1/g,"/").replace(/~0/g,"~")}))}function A(e){if(!r.isArray(e))throw new TypeError("path must be an array");return e.map((function(e){return r.isString(e)||(e=JSON.stringify(e)),e.replace(/~/g,"~0").replace(/\//g,"~1")}))}function k(e,t){var n={};if(!r.isArray(e)&&!r.isObject(e))throw new TypeError("obj must be an Array or an Object");return function e(t,n,i,o){var a=!0;function s(n,r){i.push(r),e(t,n,i,o),i.pop()}r.isFunction(o)&&(a=o(t,n,i)),-1===t.indexOf(n)&&(t.push(n),!1!==a&&(r.isArray(n)?n.forEach((function(e,t){s(e,t.toString())})):r.isObject(n)&&r.forOwn(n,(function(e,t){s(e,t)}))),t.pop())}(function(e,t){var n,r=[];return t.length>0&&(n=e,t.slice(0,t.length-1).forEach((function(e){e in n&&(n=n[e],r.push(n))}))),r}(e,(t=P(t,e)).subDocPath),v(e,t.subDocPath),r.cloneDeep(t.subDocPath),(function(e,i,o){var a,s,u=!0;return E(i)&&(r.isUndefined(t.refPreProcessor)||(i=t.refPreProcessor(r.cloneDeep(i),o)),a=C(i),r.isUndefined(t.refPostProcessor)||(a=t.refPostProcessor(a,o)),t.filter(a,o)&&(s=I(o),n[s]=a),b(i).length>0&&(u=!1)),u})),n}function C(e){var t,n,i,o={def:e};try{if(E(e,!0)){if(t=e.$ref,i=d[t],r.isUndefined(i)&&(i=d[t]=O(t)),o.uri=t,o.uriDetails=i,r.isUndefined(i.error)){o.type=_(o);try{["#","/"].indexOf(t[0])>-1?N(t,!0):t.indexOf("#")>-1&&N(i.fragment,!0)}catch(e){o.error=e.message,o.type="invalid"}}else o.error=o.uriDetails.error,o.type="invalid";(n=b(e)).length>0&&(o.warning="Extra JSON Reference properties will be ignored: "+n.join(", "))}else o.type="invalid"}catch(e){o.error=e.message,o.type="invalid"}return o}function N(e,t){var n,i=!0;try{if(!r.isString(e))throw new Error("ptr is not a String");if(""!==e){if(n=e.charAt(0),-1===["#","/"].indexOf(n))throw new Error("ptr must start with a / or #/");if("#"===n&&"#"!==e&&"/"!==e.charAt(1))throw new Error("ptr must start with a / or #/");if(e.match(c))throw new Error("ptr has invalid token(s)")}}catch(e){if(!0===t)throw e;i=!1}return i}function L(e){try{N(e,!0)}catch(e){throw new Error("ptr must be a JSON Pointer: "+e.message)}var t=e.split("/");return t.shift(),T(t)}function I(e,t){if(!r.isArray(e))throw new Error("path must be an Array");return(!1!==t?"#":"")+(e.length>0?"/":"")+A(e).join("/")}function j(e,t){var n=Promise.resolve();return n.then((function(){if(!r.isArray(e)&&!r.isObject(e))throw new TypeError("obj must be an Array or an Object");t=P(t,e),e=r.cloneDeep(e)})).then((function(){var n={deps:{},docs:{},refs:{}};return function e(t,n,i){var a,s,u=Promise.resolve(),l=I(n.subDocPath),c=x(n.location),f=o.dirname(n.location),p=c+l;return r.isUndefined(i.docs[c])&&(i.docs[c]=t),r.isUndefined(i.deps[p])&&(i.deps[p]={},a=k(t,n),r.forOwn(a,(function(o,a){var c,h,d=x(n.location)+a,v=o.refdId=decodeURI(x(m(o)?g(f,o.uri):n.location)+"#"+(o.uri.indexOf("#")>-1?o.uri.split("#")[1]:""));i.refs[d]=o,y(o)&&(o.fqURI=v,i.deps[p][a===l?"#":a.replace(l+"/","#/")]=v,0!==d.indexOf(v+"/")?((s=r.cloneDeep(n)).subDocPath=r.isUndefined(o.uriDetails.fragment)?[]:L(decodeURI(o.uriDetails.fragment)),m(o)?(delete s.filter,s.location=v.split("#")[0],u=u.then((c=i,h=s,function(){var e=x(h.location),t=c.docs[e];return r.isUndefined(t)?w(e,h).catch((function(t){return c.docs[e]=t,t})):Promise.resolve().then((function(){return t}))}))):u=u.then((function(){return t})),u=u.then(function(t,n,i){return function(o){if(r.isError(o))S(i,o);else try{return e(o,n,t).catch((function(e){S(i,e)}))}catch(e){S(i,e)}}}(i,s,o))):o.circular=!0)}))),u}(e,t,n).then((function(){return n}))})).then((function(e){var n={},a=[],s=[],u=new i.Graph,l=x(t.location),c=l+I(t.subDocPath),f=o.dirname(l);return Object.keys(e.deps).forEach((function(e){u.setNode(e)})),r.forOwn(e.deps,(function(e,t){r.forOwn(e,(function(e){u.setEdge(t,e)}))})),(a=i.alg.findCycles(u)).forEach((function(e){e.forEach((function(e){-1===s.indexOf(e)&&s.push(e)}))})),r.forOwn(e.deps,(function(t,n){r.forOwn(t,(function(t,r){var i,o=!1,u=n+r.slice(1),l=e.refs[n+r.slice(1)],c=m(l);s.indexOf(t)>-1&&a.forEach((function(e){o||(i=e.indexOf(t))>-1&&e.forEach((function(n){o||0===u.indexOf(n+"/")&&(c&&i!==e.length-1&&"#"===t[t.length-1]||(o=!0))}))})),o&&(l.circular=!0)}))})),r.forOwn(Object.keys(e.deps).reverse(),(function(n){var i=e.deps[n],o=n.split("#"),a=e.docs[o[0]],s=L(o[1]);r.forOwn(i,(function(n,i){var u,l,c,f=n.split("#"),p=e.docs[f[0]],h=s.concat(L(i)),d=e.refs[o[0]+I(h)];if(r.isUndefined(d.error)&&r.isUndefined(d.missing))if(!t.resolveCirculars&&d.circular)d.value=d.def;else{try{d.value=v(p,L(f[1]))}catch(e){return void S(d,e)}""===o[1]&&"#"===i?e.docs[o[0]]=d.value:(u=a,l=h,c=d.value,v(u,l.slice(0,l.length-1))[l[l.length-1]]=c)}}))})),Object.keys(e.refs).forEach((function(i){var o,a,s=e.refs[i];"invalid"!==s.type&&("#"===s.fqURI[s.fqURI.length-1]&&"#"!==s.uri[s.uri.length-1]&&(s.fqURI=s.fqURI.substr(0,s.fqURI.length-1)),o=s.fqURI.split("/"),a=s.uri.split("/"),r.times(a.length-1,(function(e){var t=a[a.length-e-1],n=o.length-e-1,r=o[n];"."!==t&&".."!==t||(t=r),o[n]=t})),s.fqURI=o.join("/"),0===s.fqURI.indexOf(l)?s.fqURI=s.fqURI.replace(l,""):0===s.fqURI.indexOf(f)&&(s.fqURI=s.fqURI.replace(f,"")),"/"===s.fqURI[0]&&(s.fqURI="."+s.fqURI)),0===i.indexOf(c)&&function r(i,o,a){var s,u=o.split("#"),l=e.refs[o];n[u[0]===t.location?"#"+u[1]:I(t.subDocPath.concat(a))]=l,!l.circular&&y(l)?(s=e.deps[l.refdId],0!==l.refdId.indexOf(i)&&Object.keys(s).forEach((function(e){r(l.refdId,l.refdId+e.substr(1),a.concat(L(e)))}))):!l.circular&&l.error&&(l.error=l.error.replace("options.subDocPath","JSON Pointer"),l.error.indexOf("#")>-1&&(l.error=l.error.replace(l.uri.substr(l.uri.indexOf("#")),l.uri)),0!==l.error.indexOf("ENOENT:")&&0!==l.error.indexOf("Not Found")||(l.error="JSON Pointer points to missing location: "+l.uri))}(c,i,L(i.substr(c.length)))})),r.forOwn(e.refs,(function(e){delete e.refdId,e.missing&&(e.error=e.error.split(": ")[0]+": "+e.def.$ref)})),{refs:n,resolved:e.docs[l]}}))}"undefined"==typeof Promise&&n(16),e.exports.clearCache=function(){f={}},e.exports.decodePath=function(e){return T(e)},e.exports.encodePath=function(e){return A(e)},e.exports.findRefs=function(e,t){return k(e,t)},e.exports.findRefsAt=function(e,t){return function(e,t){var n=Promise.resolve();return n.then((function(){if(!r.isString(e))throw new TypeError("location must be a string");return r.isUndefined(t)&&(t={}),r.isObject(t)&&(t.location=e),w((t=P(t)).location,t)})).then((function(e){var n=r.cloneDeep(f[t.location]),i=r.cloneDeep(t),o=O(t.location);return r.isUndefined(n.refs)&&(delete i.filter,delete i.subDocPath,i.includeInvalid=!0,f[t.location].refs=k(e,i)),r.isUndefined(t.filter)||(i.filter=t.filter),r.isUndefined(o.fragment)?r.isUndefined(o.subDocPath)||(i.subDocPath=t.subDocPath):i.subDocPath=L(decodeURI(o.fragment)),{refs:k(e,i),value:e}}))}(e,t)},e.exports.getRefDetails=function(e){return C(e)},e.exports.isPtr=function(e,t){return N(e,t)},e.exports.isRef=function(e,t){return function(e,t){return E(e,t)&&"invalid"!==C(e).type}(e,t)},e.exports.pathFromPtr=function(e){return L(e)},e.exports.pathToPtr=function(e,t){return I(e,t)},e.exports.resolveRefs=function(e,t){return j(e,t)},e.exports.resolveRefsAt=function(e,t){return function(e,t){var n=Promise.resolve();return n.then((function(){if(!r.isString(e))throw new TypeError("location must be a string");return r.isUndefined(t)&&(t={}),r.isObject(t)&&(t.location=e),w((t=P(t)).location,t)})).then((function(e){var n=r.cloneDeep(t),i=O(t.location);return r.isUndefined(i.fragment)||(n.subDocPath=L(decodeURI(i.fragment))),j(e,n).then((function(t){return{refs:t.refs,resolved:t.resolved,value:e}}))}))}(e,t)}}).call(this,n(2))},function(e,t,n){var r=n(22);e.exports={Graph:r.Graph,json:n(24),alg:n(25),version:r.version}},function(e,t,n){e.exports={Graph:n(5),version:n(23)}},function(e,t,n){e.exports="2.1.5"},function(e,t,n){var r=n(0),i=n(5);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},function(e,t,n){e.exports={components:n(26),dijkstra:n(9),dijkstraAll:n(27),findCycles:n(28),floydWarshall:n(29),isAcyclic:n(30),postorder:n(31),preorder:n(32),prim:n(33),tarjan:n(11),topsort:n(12)}},function(e,t,n){var r=n(0);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},function(e,t,n){var r=n(9),i=n(0);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},function(e,t,n){var r=n(0),i=n(11);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},function(e,t,n){var r=n(0);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},function(e,t,n){var r=n(12);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},function(e,t,n){var r=n(13);e.exports=function(e,t){return r(e,t,"post")}},function(e,t,n){var r=n(13);e.exports=function(e,t){return r(e,t,"pre")}},function(e,t,n){var r=n(0),i=n(5),o=n(10);e.exports=function(e,t){var n,a=new i,s={},u=new o;function l(e){var r=e.v===n?e.w:e.v,i=u.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){u.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),u.decrease(e.nodes()[0],0);for(var c=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(l)}return a}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return r.exec(e).slice(1)};function o(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,r="/"===a.charAt(0))}return(r?"/":"")+(t=n(o(t.split("/"),(function(e){return!!e})),!r).join("/"))||"."},t.normalize=function(e){var r=t.isAbsolute(e),i="/"===a(e,-1);return(e=n(o(e.split("/"),(function(e){return!!e})),!r).join("/"))||r||(e="."),e&&i&&(e+="/"),(r?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}var l=[];for(u=s;u<i.length;u++)l.push("..");return(l=l.concat(o.slice(s))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return i(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(2))},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={file:n(36),http:n(14),https:n(14)},o="object"===("undefined"==typeof window?"undefined":r(window))||"function"==typeof importScripts?i.http:i.file;"undefined"==typeof Promise&&n(16),e.exports.load=function(e,t){var n=Promise.resolve();return void 0===t&&(t={}),(n=n.then((function(){if(void 0===e)throw new TypeError("location is required");if("string"!=typeof e)throw new TypeError("location must be a string");if(void 0!==t){if("object"!==(void 0===t?"undefined":r(t)))throw new TypeError("options must be an object");if(void 0!==t.processContent&&"function"!=typeof t.processContent)throw new TypeError("options.processContent must be a function")}}))).then((function(){return new Promise((function(n,r){(function(e){var t=function(e){return void 0!==e&&(e=-1===e.indexOf("://")?"":e.split("://")[0]),e}(e),n=i[t];if(void 0===n){if(""!==t)throw new Error("Unsupported scheme: "+t);n=o}return n})(e).load(e,t||{},(function(e,t){e?r(e):n(t)}))}))})).then((function(e){return t.processContent?new Promise((function(n,i){t.processContent("object"===(void 0===e?"undefined":r(e))?e:{text:e},(function(e,t){e?i(e):n(t)}))})):"object"===(void 0===e?"undefined":r(e))?e.text:e}))}},function(e,t,n){var r=new TypeError("The 'file' scheme is not supported in the browser");e.exports.getBase=function(){throw r},e.exports.load=function(){var e=arguments[arguments.length-1];if("function"!=typeof e)throw r;e(r)}},function(e,t,n){var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};"undefined"!=typeof window?r=window:"undefined"!=typeof self?r=self:(console.warn("Using browser-only version of superagent in non-browser environment"),r=void 0);var o=n(38),a=n(39),s=n(15),u=n(40),l=n(42);function c(){}var f=t=e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1==arguments.length?new t.Request("GET",e):new t.Request(e,n)};t.Request=v,f.getXHR=function(){if(!(!r.XMLHttpRequest||r.location&&"file:"==r.location.protocol&&r.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function h(e){if(!s(e))return e;var t=[];for(var n in e)d(t,n,e[n]);return t.join("&")}function d(e,t,n){if(null!=n)if(Array.isArray(n))n.forEach((function(n){d(e,t,n)}));else if(s(n))for(var r in n)d(e,t+"["+r+"]",n[r]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(n));else null===n&&e.push(encodeURIComponent(t))}function g(e){for(var t,n,r={},i=e.split("&"),o=0,a=i.length;o<a;++o)-1==(n=(t=i[o]).indexOf("="))?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function m(e){return/[\/+]json($|[^-\w])/.test(e)}function y(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=function(e){for(var t,n,r,i,o=e.split(/\r?\n/),a={},s=0,u=o.length;s<u;++s)-1!==(t=(n=o[s]).indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),i=p(n.slice(t+1)),a[r]=i);return a}(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function v(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,r=null;try{r=new y(n)}catch(e){return(t=new Error("Parser is unable to parse the response")).parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=r.status,n.callback(e,r)):n.callback(null,r)}))}function b(e,t,n){var r=f("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}f.serializeObject=h,f.parseString=g,f.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},f.serialize={"application/x-www-form-urlencoded":h,"application/json":JSON.stringify},f.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},u(y.prototype),y.prototype._parseBody=function(e){var t=f.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&m(this.type)&&(t=f.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},y.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},f.Response=y,o(v.prototype),a(v.prototype),v.prototype.type=function(e){return this.set("Content-Type",f.types[e]||e),this},v.prototype.accept=function(e){return this.set("Accept",f.types[e]||e),this},v.prototype.auth=function(e,t,n){return 1===arguments.length&&(t=""),"object"===(void 0===t?"undefined":i(t))&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"}),this._auth(e,t,n,(function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")}))},v.prototype.query=function(e){return"string"!=typeof e&&(e=h(e)),e&&this._query.push(e),this},v.prototype.attach=function(e,t,n){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},v.prototype._getFormData=function(){return this._formData||(this._formData=new r.FormData),this._formData},v.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},v.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},v.prototype.buffer=v.prototype.ca=v.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},v.prototype.pipe=v.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},v.prototype._isHost=function(e){return e&&"object"===(void 0===e?"undefined":i(e))&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},v.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||c,this._finalizeQueryString(),this._end()},v.prototype._end=function(){var e=this,t=this.xhr=f.getXHR(),n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.onprogress=r.bind(null,"download"),t.upload&&(t.upload.onprogress=r.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],o=this._serializer||f.serialize[i?i.split(";")[0]:""];!o&&m(i)&&(o=f.serialize["application/json"]),o&&(n=o(n))}for(var a in this.header)null!=this.header[a]&&this.header.hasOwnProperty(a)&&t.setRequestHeader(a,this.header[a]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==n?n:null),this},f.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){l.prototype[e.toLowerCase()]=function(t,n){var r=new f.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}})),l.prototype.del=l.prototype.delete,f.get=function(e,t,n){var r=f("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.head=function(e,t,n){var r=f("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},f.options=function(e,t,n){var r=f("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.del=b,f.delete=b,f.patch=function(e,t,n){var r=f("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.post=function(e,t,n){var r=f("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},f.put=function(e,t,n){var r=f("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(15);function o(e){if(e)return function(e){for(var t in o.prototype)e[t]=o.prototype[t];return e}(e)}e.exports=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},o.prototype.parse=function(e){return this._parser=e,this},o.prototype.responseType=function(e){return this._responseType=e,this},o.prototype.serialize=function(e){return this._serializer=e,this},o.prototype.timeout=function(e){if(!e||"object"!==(void 0===e?"undefined":r(e)))return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},o.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var a=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];o.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~a.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},o.prototype.then=function(e,t){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(e,t){n.end((function(n,r){n?t(n):e(r)}))}))}return this._fullfilledPromise.then(e,t)},o.prototype.catch=function(e){return this.then(void 0,e)},o.prototype.use=function(e){return e(this),this},o.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},o.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},o.prototype.get=function(e){return this._header[e.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(e,t){if(i(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},o.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},o.prototype.field=function(e,t){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),i(e)){for(var n in e)this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)this.field(e,t[r]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},o.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},o.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},o.prototype.withCredentials=function(e){return null==e&&(e=!0),this._withCredentials=e,this},o.prototype.redirects=function(e){return this._maxRedirects=e,this},o.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(e){var t=i(e),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&i(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},o.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},o.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.substring(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,t)+"?"+n.join("&")}}},o.prototype._appendQueryString=function(){console.trace("Unsupported")},o.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error(e+t+"ms exceeded");r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},o.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},function(e,t,n){var r=n(41);function i(e){if(e)return function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e)}e.exports=i,i.prototype.get=function(e){return this.header[e.toLowerCase()]},i.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=r.type(t);var n=r.params(t);for(var i in n)this[i]=n[i];this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},i.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.created=201==e,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e,this.unprocessableEntity=422==e}},function(e,t,n){t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce((function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e}),{})},t.parseLinks=function(e){return e.split(/ *, */).reduce((function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e}),{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t,n){function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach((function(e){r.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}})),r.prototype._setDefaults=function(e){this._defaults.forEach((function(t){e[t.fn].apply(e,t.arguments)}))},e.exports=r},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(44),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(d,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},p.clearImmediate=h}function h(e){delete l[e]}function d(e){if(c)setTimeout(d,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(undefined,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(1),n(2))},function(e,t,n){t.decode=t.parse=n(46),t.encode=t.stringify=n(47)},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var f,p,h,d,g=e[c].replace(s,"%20"),m=g.indexOf(n);m>=0?(f=g.substr(0,m),p=g.substr(m+1)):(f=g,p=""),h=decodeURIComponent(f),d=decodeURIComponent(p),r(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){switch(void 0===e?"undefined":r(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,u){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===(void 0===e?"undefined":r(e))?a(s(e),(function(r){var s=encodeURIComponent(i(r))+n;return o(e[r])?a(e[r],(function(e){return s+encodeURIComponent(i(e))})).join(t):s+encodeURIComponent(i(e[r]))})).join(t):u?encodeURIComponent(i(u))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){e.exports=function(e){var t=/^\\\\\?\\/.test(e),n=/[^\x00-\x80]+/.test(e);return t||n?e:e.replace(/\\/g,"/")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var i=l(n(19)),o=l(n(51)),a=l(n(52)),s=l(n(53)),u=l(n(54));function l(e){return e&&e.__esModule?e:{default:e}}r.SCHEMES.http=i.default,r.SCHEMES.https=o.default,r.SCHEMES.mailto=a.default,r.SCHEMES.urn=s.default,r.SCHEMES["urn:uuid"]=u.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(17);t.default=(0,r.buildExps)(!0)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=(r=n(19))&&r.__esModule?r:{default:r};t.default={scheme:"https",domainHost:i.default.domainHost,parse:i.default.parse,serialize:i.default.serialize}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(4),o=(r=n(18))&&r.__esModule?r:{default:r},a=n(6),s={},u="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",l="[0-9A-Fa-f]",c=(0,a.subexp)((0,a.subexp)("%[EFef][0-9A-Fa-f]%"+l+l+"%"+l+l)+"|"+(0,a.subexp)("%[89A-Fa-f][0-9A-Fa-f]%"+l+l)+"|"+(0,a.subexp)("%"+l+l)),f="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",p="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",h=(0,a.merge)(p,'[\\"\\\\]'),d=(0,a.subexp)(f+"+"+(0,a.subexp)("\\."+f+"+")+"*"),g=(0,a.subexp)("\\\\"+h),m=(0,a.subexp)(p+"|"+g),y=(0,a.subexp)('\\"'+m+'*\\"'),v=(0,a.subexp)(u+"|"+c+"|[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),b=(0,a.subexp)(d+"|\\[[\\x21-\\x5A\\x5E-\\x7E]*\\]"),_=(0,a.subexp)(d+"|"+y),w=(0,a.subexp)(_+"\\@"+b);(0,a.subexp)(w+(0,a.subexp)("\\,"+w)+"*");var E=(0,a.subexp)(v+"*"),x=E,S=(0,a.subexp)(E+"\\="+x),O=(0,a.subexp)(S+(0,a.subexp)("\\&"+S)+"*");(0,a.subexp)("\\?"+O);var P=new RegExp(u,"g"),T=new RegExp(c,"g"),A=new RegExp((0,a.merge)("[^]",f,"[\\.]",'[\\"]',h),"g"),k=(new RegExp((0,a.merge)("[^]",f,"[\\.]","[\\[]","[\\x21-\\x5A\\x5E-\\x7E]","[\\]]"),"g"),new RegExp((0,a.merge)("[^]",u,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g")),C=k;function N(e){var t=(0,i.pctDecChars)(e);return t.match(P)?t:e}t.default={scheme:"mailto",parse:function(e,t){var n=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var r=!1,a={},s=e.query.split("&"),u=0,l=s.length;u<l;++u){var c=s[u].split("=");switch(c[0]){case"to":for(var f=c[1].split(","),p=0,h=f.length;p<h;++p)n.push(f[p]);break;case"subject":e.subject=(0,i.unescapeComponent)(c[1],t);break;case"body":e.body=(0,i.unescapeComponent)(c[1],t);break;default:r=!0,a[(0,i.unescapeComponent)(c[0],t)]=(0,i.unescapeComponent)(c[1],t)}}r&&(e.headers=a)}e.query=void 0;for(var d=0,g=n.length;d<g;++d){var m=n[d].split("@");if(m[0]=(0,i.unescapeComponent)(m[0]),t.unicodeSupport)m[1]=(0,i.unescapeComponent)(m[1],t).toLowerCase();else try{m[1]=o.default.toASCII((0,i.unescapeComponent)(m[1],t).toLowerCase())}catch(t){e.error=e.error||"Email address's domain name can not be converted to ASCII via punycode: "+t}n[d]=m.join("@")}return e},serialize:function(e,t){var n=(0,a.toArray)(e.to);if(n){for(var r=0,u=n.length;r<u;++r){var l=String(n[r]),c=l.lastIndexOf("@"),f=l.slice(0,c).replace(T,N).replace(T,a.toUpperCase).replace(A,i.pctEncChar),p=l.slice(c+1);try{p=t.iri?o.default.toUnicode(p):o.default.toASCII((0,i.unescapeComponent)(p,t).toLowerCase())}catch(n){e.error=e.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}n[r]=f+"@"+p}e.path=n.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var g in h)h[g]!==s[g]&&d.push(g.replace(T,N).replace(T,a.toUpperCase).replace(k,i.pctEncChar)+"="+h[g].replace(T,N).replace(T,a.toUpperCase).replace(C,i.pctEncChar));return d.length&&(e.query=d.join("&")),e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=new RegExp("^urn\\:((?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31}))$"),o=/^([^\:]+)\:(.*)/,a=/[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;t.default={scheme:"urn",parse:function(e,t){var n=e.path&&e.path.match(o);if(n){var i="urn:"+n[1].toLowerCase(),a=r.SCHEMES[i];a||(a=r.SCHEMES[i]={scheme:i,parse:function(e,t){return e},serialize:r.SCHEMES.urn.serialize}),e.scheme=i,e.path=n[2],e=a.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){var n=e.scheme||t.scheme;if(n&&"urn"!==n){var o=n.match(i)||["urn:"+n,n];e.scheme="urn",e.path=o[1]+":"+(e.path?e.path.replace(a,r.pctEncChar):"")}return e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;t.default={scheme:"urn:uuid",parse:function(e,t){return t.tolerant||e.path&&e.path.match(i)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){return t.tolerant||e.path&&e.path.match(i)?e.path=(e.path||"").toLowerCase():e.scheme=void 0,r.SCHEMES.urn.serialize(e,t)}}}]);const yt=function(e,t,n,r){let i;return n="string"==typeof n?[n]:n,e.some((e=>{const o=[...n];let a=t["localization-strings"][e];for(;a&&o.length;)a=a[o.shift()];return i=r||"string"==typeof a?a:void 0,i})),i},vt=async(e,t,n)=>{const r=new URL(n||window.location.href.replace(/(index\.html)?#.*$/,""));return r.search="",r.pathname=e,r.hash=t?"#/"+t:"",(await mt.resolveRefsAt(r.toString(),{loaderOptions:{processContent(e,t){t(void 0,JSON.parse(e.text||e.body.toString()))}}})).resolved},bt=function({field:e,schemaItems:t,metadataObj:n,getFieldAliasOrName:r,lang:i}){const o=t.findIndex((t=>t.title===e)),a=t[o],s={fieldName:r(e)},u=n.fields[e];let l=u&&u["fieldvalue-aliases"];return l&&(l.localeKey&&(l=yt(i,n,l.localeKey.split("/"),!0)),s.rawFieldValueAliasMap=JSON.parse(JSON.stringify(l)),s.aliases=[],a.enum&&a.enum.length?a.enum.forEach((t=>{s.aliases.push(yt(i,n,["fieldvalue",e,t],!0)),t in l&&"string"==typeof l[t]&&s.aliases.push(...l[t])})):Object.entries(l).forEach((([e,t])=>{Array.isArray(t)||(t=Object.values(t)),s.aliases.push(...t.filter((e=>t.every((t=>t===e||!t.toLowerCase().startsWith(e.toLowerCase()))))).map((t=>t+" ("+e+")")))})),s.fieldValueAliasMap=JSON.parse(JSON.stringify(l))),s.fieldSchema=a,s.fieldSchemaIndex=o,s.preferAlias=u.prefer_alias,s.lang=u.lang,s},_t=function({metadataObj:e,schemaItems:t,getFieldAliasOrName:n,lang:r,callback:i}){e.table.browse_fields.forEach(((o,a)=>{"string"==typeof o&&(o={set:[o]}),o.name||(o.name=o.set.join(","));const s=o.name,u=o.set,{presort:l}=o,c=u.map((i=>bt({lang:r,field:i,schemaItems:t,metadataObj:e,getFieldAliasOrName:n})));i({setName:s,browseFields:c,i:a,presort:l})}))};class wt{constructor({metadataObj:e}){this.metadataObj=e}getFieldLang(e){const{metadataObj:t}=this,n=t&&t.fields;return n&&n[e]&&n[e].lang}getFieldMatchesLocale({namespace:e,preferredLocale:t,schemaItems:n,pluginsForWork:r}){const{metadataObj:i}=this;return o=>{const a=(({namespace:e,preferredLocale:t})=>{const n=localStorage.getItem(e+"-langCodes"),r=n&&JSON.parse(n)||[t],i=[];return r.forEach((e=>{const t=e.replace(/-.*$/,"");t===e?i.push(e):i.push(e,t)})),i})({namespace:e,preferredLocale:t});if(r.isPluginField({namespace:e,field:o})){let[,,n]=r.getPluginFieldParts({namespace:e,field:o});return"{locale}"===n&&(n=t),!n||a.includes(n)}const s=this.getFieldLang(o),u=i&&i["localization-strings"];return u&&Object.keys(u).some((e=>{const t=u[e]&&u[e].fieldvalue;return t&&t[o]}))||s&&a.includes(s)||n.some((e=>e.title===o&&"string"!==e.type))}}}const Et=e=>e.replace(/\^/g,"^^").replace(/-/g,"^0"),xt=e=>e?e.replace(/(\^+)0/g,((e,t)=>t.length%2?t.slice(1)+"-":e)).replace(/\^\^/g,"^"):e;class St{constructor({pluginsInWork:e,pluginFieldMappings:t,pluginObjects:n}){this.pluginsInWork=e,this.pluginFieldMappings=t,this.pluginObjects=n}getPluginObject(e){const t=this.pluginsInWork.findIndex((([t])=>t===e));return this.pluginObjects[t]}iterateMappings(e){this.pluginFieldMappings.forEach((({placement:t,"applicable-fields":n},r)=>{const[i,{onByDefault:o,lang:a,meta:s}]=this.pluginsInWork[r],u=this.getPluginObject(i);e({plugin:u,placement:t,applicableFields:n,pluginName:i,pluginLang:a,onByDefaultDefault:o,meta:s})}))}processTargetLanguages(e,t){return!!e&&(Object.entries(e).forEach((([e,{targetLanguage:n,onByDefault:r,meta:i}])=>{Array.isArray(n)?n.forEach((n=>{t({applicableField:e,targetLanguage:n,onByDefault:r,metaApplicableField:i})})):t({applicableField:e,targetLanguage:n,onByDefault:r,metaApplicableField:i})})),!0)}isPluginField({namespace:e,field:t}){return t.startsWith(`${e}-plugin-`)}getPluginFieldParts({namespace:e,field:t}){let n,r,i;return(t=t.replace(`${e}-plugin-`,"")).includes("-")?[n,r,i]=t.split("-"):n=t,[n,r,i].map(xt)}}const Ot=function(e,t,n){const r=(e.baseDirectory||"")+(t.baseDirectory||"")+"/",i=(e.schemaBaseDirectory||"")+(t.schemaBaseDirectory||"")+"/",o=(e.metadataBaseDirectory||"")+(t.metadataBaseDirectory||"")+"/";return{file:r+n.file.$ref,schemaFile:n.schemaFile?i+n.schemaFile:"",metadataFile:n.metadataFile?o+n.metadataFile:""}},Pt=async function({lang:e,fallbackLanguages:t,work:n,files:r,allowPlugins:i,basePath:o,languages:a,preferredLocale:s}){const u=await d(r),l=e=>u["localization-strings"][e],c=ve({locales:e.map(l),fallbackLocales:t.map(l)}).getFormatter();let f;const p=u.groups.find((e=>(f=e.files.find((t=>n===c(["workNames",e.id,t.name]))),Boolean(f)))),h=u.groups.map((e=>({name:c({key:e.name.localeKey,fallback:!0}),workNames:e.files.map((t=>c(["workNames",e.id,t.name]))),shortcuts:e.files.map((e=>e.shortcut))}))),g=Ot(u,p,f),{file:m}=g;let{schemaFile:y,metadataFile:v}=g,b="",_="";y||(y=m,b="schema"),v||(v=m,_="metadata");let w,E,x,S,O=[];if(i){const e=u["plugin-field-mapping"][p.id][f.name];e&&(x=Object.keys(e),E=Object.entries(u.plugins).filter((([e])=>x.includes(e))),O=E.map((([t])=>e[t])),S=E.map((([,e])=>e.path)),w=E)}const P=await vt(v,_,o),T=function(t){const n=P.fields&&P.fields[t];let r,i;return n&&(i=n.alias),i?"string"==typeof i?r=i:(i=i.localeKey,r=yt(e,P,i.split("/"))):(r=n.name,"object"==typeof r&&(r=r.localeKey,r=yt(e,P,r.split("/")))),r},A=O,k="undefined"==typeof process?location.href.slice(0,location.href.lastIndexOf("/")+1):process.cwd()+"/",[C,N]=await Promise.all([vt(y,b,o),w?Promise.all(S.map((e=>import(k+e)))):null]),L=new St({pluginsInWork:E,pluginFieldMappings:A,pluginObjects:N}),I=C.items.items,j=I.map((({title:e})=>({field:e,fieldAliasOrName:T(e)||e}))),D=new wt({metadataObj:P});if(a&&L){console.log("pluginsForWork",L);const{lang:e,namespace:t}=this;L.iterateMappings((({plugin:n,pluginName:r,pluginLang:i,onByDefaultDefault:o,placement:u,applicableFields:l,meta:f})=>{const p=({applicableField:n,targetLanguage:l,onByDefault:p,metaApplicableField:h}={})=>{const d=L.getPluginObject(r)||{},g=D.getFieldLang(n);d.getTargetLanguage&&(l=d.getTargetLanguage({applicableField:n,targetLanguage:l,pluginLang:i,applicableFieldLang:g}));const m=(({pluginName:e,applicableField:t,targetLanguage:n})=>Et(e)+(t?"-"+Et(t):"-")+(n?"-"+Et(n):""))({pluginName:r,applicableField:n,targetLanguage:l||i||g});"{locale}"===l&&(l=s);const y=yt(e,P,["fieldnames",n]),v=d.getFieldAliasOrName?d.getFieldAliasOrName({locales:e,lf:c,targetLanguage:l,applicableField:n,applicableFieldI18N:y,meta:f,metaApplicableField:h,targetLanguageI18N:a.getLanguageFromCode(l)}):a.getFieldNameFromPluginNameAndLocales({pluginName:r,locales:e,lf:c,targetLanguage:l,applicableFieldI18N:y,meta:f,metaApplicableField:h});j.splice("end"===u?Number.POSITIVE_INFINITY:u,0,{field:`${t}-plugin-${m}`,fieldAliasOrName:v,onByDefault:"boolean"==typeof p?p:o||!1,applicableField:n,metaApplicableField:h,fieldLang:l})};L.processTargetLanguages(l,p)||p()}))}return{fileData:f,lf:c,getFieldAliasOrName:T,metadataObj:P,schemaObj:C,schemaItems:I,fieldInfo:j,pluginsForWork:L,groupsToWorks:h,metadata:D}},Tt=({r:e,logger:t})=>{e.addEventListener("updatefound",(t=>{console.log("update found",t);const n=e.installing;n.addEventListener("statechange",(async()=>{const{state:e}=n;switch(e){case"installing":console.log("Installing new worker");break;case"installed":console.log("Installation status",e),await dt.alert("\nA new version of this offlinable app has been downloaded.\n\nIf you have work to complete in this tab, you can dismiss\nthis dialog now and continue working with the old version.\n\nHowever, when you are finished, you should close this tab\nand any other old tabs for this site in order to be able to\nbegin using the new version.\n");break;case"redundant":console.log("Installation status",e),await dt.alert("\nThere was an error during installation (to allow offline/speeded\ncache use).\n\nIf you have work to complete in this tab, you can dismiss\nthis dialog now and continue working with the old version.\n\nHowever, when you are finished, you may wish to close this tab\nand any other old tabs for this site in order to try again\nfor offline installation.\n");break;case"activating":console.log("Activating new worker");break;case"activated":console.log("Activated new worker");break;default:throw new Error(`Unknown worker update state: ${e}`)}}))}))},At=async({r:e,logger:t})=>new Promise((async(n,r)=>{navigator.serviceWorker.addEventListener("message",(({data:n})=>{const{message:r,type:i,name:o,errorType:a}=n;switch(console.log("msg1",r,e),i){case"log":return void t.addLogEntry({text:r});case"beginInstall":return void t.addLogEntry({text:"Install: Begun..."});case"finishedInstall":return void t.addLogEntry({text:"Install: Finished..."});case"beginActivate":return t.addLogEntry({text:"Activate: Caching finished"}),void t.addLogEntry({text:"Activate: Begin database resources storage..."});case"finishedActivate":return t.addLogEntry({text:"Activate: Finished..."}),void location.reload();case"error":t.addLogEntry({text:r+("dbError"===a?`Database error ${o}`:"")+"; trying again..."});break;default:console.error("Unexpected type",i)}}));const i=e.installing||e.waiting||e.active;i&&"redundant"===i.state?(await dt.alert('\nThere was likely an error installing. Click "ok" to try again.\n(Error code: Service worker is redundant)\n'),location.reload()):e.installing?console.log("INSTALLING"):e.waiting&&await dt.alert("\nAn update is in progress. After finishing any work\nyou have in them, please close this and any other existing tabs\nrunning this web application and then open the site again.\nPlease note it may take some time to install and may not show\nany indication it is installing.\n",{ok:!1})})),kt=e=>e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):"";var Ct={main({langs:e,languages:t,followParams:n,$p:r}){it("form",{class:"focus",id:"languageSelectionContainer",$on:{submit(e){e.preventDefault()}}},[["select",{name:"lang",size:e.length,$on:{click({target:{parentNode:{selectedOptions:e}}}){n("#languageSelectionContainer",(()=>{r.set("lang",e[0].value,!0)}))}}},e.map((({code:e})=>["option",{value:e},[t.getLanguageFromCode(e)]]))]],qe("#main")),history.state&&"object"==typeof history.state&&Le(document.querySelector("#languageSelectionContainer"),history.state)}};const Nt=["aqua","black","blue","fuchsia","gray","green","lime","maroon","navy","olive","purple","red","silver","teal","white","yellow"],Lt=["Helvetica, sans-serif","Verdana, sans-serif","Gill Sans, sans-serif","Avantgarde, sans-serif","Helvetica Narrow, sans-serif","sans-serif","Times, serif","Times New Roman, serif","Palatino, serif","Bookman, serif","New Century Schoolbook, serif","serif","Andale Mono, monospace","Courier New, monospace","Courier, monospace","Lucidatypewriter, monospace","Fixed, monospace","monospace","Comic Sans, Comic Sans MS, cursive","Zapf Chancery, cursive","Coronetscript, cursive","Florence, cursive","Parkavenue, cursive","cursive","Impact, fantasy","Arnoldboecklin, fantasy","Oldtown, fantasy","Blippo, fantasy","Brushstroke, fantasy","fantasy"],It=ut.repeat(2),jt=ut.repeat(3),Dt=()=>({form:qe("form#browse"),random:qe("#rand")||{},checkboxes:Ge("input[type=checkbox]")});const Rt={languageSelect:Ct,workSelect:({groups:e,lf:t,getNextAlias:n,$p:r,followParams:i})=>{const o=it("form",{id:"workSelect",class:"focus",$on:{submit(e){e.preventDefault()}}},e.map(((e,o)=>["div",[o>0?["br","br","br"]:"",["div",[t({key:e.directions.localeKey,fallback:!0})]],["br"],["select",{class:"file",name:"work"+o,dataset:{name:e.name.localeKey},$on:{change({target:{value:e}}){i("#workSelect",(()=>{r.set("work",e)}))}}},[["option",{value:""},["--"]],...e.files.map((({name:r})=>["option",{value:t(["workNames",e.id,r])},[n()]]))]]]])),qe("#main"));return history.state&&"object"==typeof history.state&&Le(document.querySelector("#workSelect"),history.state),o},workDisplay:{bdo:({fallbackDirection:e,message:t})=>["div",{style:"display: inline; direction: "+e},[t]],columnsTable:({ld:e,fieldInfo:t,$p:n,le:r,iil:i,l:o,metadataObj:a,preferredLocale:s,schemaItems:u,fieldMatchesLocale:l})=>["table",{border:"1",cellpadding:"5",align:"center"},[["tr",[["th",[e("fieldno")]],["th",{align:"left",width:"20"},[e("field_enabled")]],["th",[e("field_title")]],["th",[e("fieldinterlin")]],["th",[e("fieldcss")]]]],...t.map(((e,a)=>{const s=a+1,u="checked"+s,l="field"+s,c=n.get(l);return["tr",[["td",[String(s)]],r("check-columns-to-browse","td","title",{},[r("yes","input","value",{class:"fieldSelector",id:u,name:i("checked")+s,checked:n.get(u)!==o("no")&&(n.has(u)||!1!==e.onByDefault),type:"checkbox"})]),r("check-sequence","td","title",{},[["select",{name:i("field")+s,id:l,size:"1"},t.map((({field:e,fieldAliasOrName:t},r)=>["option",{dataset:{name:e},value:t,selected:c&&c===t||r===a&&!n.has(l)},[t]]))]]),["td",[r("interlinear-tips","input","title",{name:i("interlin")+s,value:n.get("interlin"+s)})]],["td",[["input",{name:i("css")+s,value:n.get("css"+s)}]]]]]})),["tr",[["td",{colspan:3},[r("check_all","input","value",{type:"button",$on:{click(){Ge(".fieldSelector").forEach((e=>{e.checked=!0}))}}}),r("uncheck_all","input","value",{type:"button",$on:{click(){Ge(".fieldSelector").forEach((e=>{e.checked=!1}))}}}),r("checkmark_locale_fields_only","input","value",{type:"button",$on:{click(){t.forEach((({field:e},t)=>{const n=t+1,r=qe("#field"+n).selectedOptions[0].dataset.name;qe("#checked"+n).checked=l(r)}))}}})]]]]]],advancedFormatting:({ld:e,il:t,l:n,lo:r,le:i,$p:o,hideFormattingSection:a})=>["td",{id:"advancedformatting",style:{display:a?"none":"block"}},[["h3",[e("advancedformatting")]],["label",[e("textcolor"),It,["select",{name:t("colorName")},Nt.map(((e,t)=>{const i={value:n(["param_values","colors",e])};return(o.get("colorName")===n(["param_values","colors",e])||1===t&&!o.has("colorName"))&&(i.selected="selected"),r(["param_values","colors",e],i)}))]]],["label",[ut,e("or_entercolor"),It,["input",{name:t("color"),type:"text",value:o.get("color")||"#",size:"7",maxlength:"7"}]]],["br"],["br"],["label",[e("backgroundcolor"),It,["select",{name:t("bgcolorName")},Nt.map(((e,t)=>{const i={value:n(["param_values","colors",e])};return(o.get("bgcolorName")===n(["param_values","colors",e])||14===t&&!o.has("bgcolorName"))&&(i.selected="selected"),r(["param_values","colors",e],i)}))]]],["label",[ut,e("or_entercolor"),It,["input",{name:t("bgcolor"),type:"text",value:o.get("bgcolor")||"#",size:"7",maxlength:"7"}]]],["br"],["br"],["label",[e("text_font"),It,["select",{name:t("fontSeq"),dir:"ltr"},Lt.map(((e,t)=>{const n={value:e};return(o.get("fontSeq")===e||7===t&&!o.has("fontSeq"))&&(n.selected="selected"),["option",n,[e]]}))]]],["br"],["br"],["label",[e("font_style"),It,["select",{name:t("fontstyle")},["italic","normal","oblique"].map(((e,t)=>{const i={value:n(["param_values","fontstyle",e])};return(o.get("fontstyle")===n(["param_values","fontstyle",e])||1===t&&!o.has("fontstyle"))&&(i.selected="selected"),r(["param_values","fontstyle",e],i)}))]]],["br"],["div",[e("font_variant"),jt,["label",[["input",{name:t("fontvariant"),type:"radio",value:n(["param_values","fontvariant","normal"]),checked:o.get("fontvariant")!==e(["param_values","fontvariant","small-caps"])}],e(["param_values","fontvariant","normal"]),ut]],["label",[["input",{name:t("fontvariant"),type:"radio",value:n(["param_values","fontvariant","small-caps"]),checked:o.get("fontvariant")===e(["param_values","fontvariant","small-caps"])}],e(["param_values","fontvariant","small-caps"]),ut]]]],["br"],["label",[e("font_weight")," (normal, bold, 100-900, etc.):",It,["input",{name:t("fontweight"),type:"text",value:o.has("fontweight")?o.get("fontweight"):"normal",size:"7",maxlength:"12"}]]],["br"],["label",[e("font_size")," (14pt, 14px, small, 75%, etc.):",It,["input",{name:t("fontsize"),type:"text",value:o.get("fontsize"),size:"7",maxlength:"12"}]]],["br"],["label",{dir:"ltr"},[e("font_stretch"),ut,["select",{name:t("fontstretch")},["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"].map((t=>{const n={value:e(["param_values","font-stretch",t])};return(o.get("fontstretch")===t||!o.has("fontstretch")&&"normal"===t)&&(n.selected="selected"),["option",n,[e(["param_values","font-stretch",t])]]}))]]],["br"],["br"],["label",[e("letter_spacing")," (normal, .9em, -.05cm): ",["input",{name:t("letterspacing"),type:"text",value:o.has("letterspacing")?o.get("letterspacing"):"normal",size:"7",maxlength:"12"}]]],["br"],["label",[e("line_height")," (normal, 1.5, 22px, 150%): ",["input",{name:t("lineheight"),type:"text",value:o.has("lineheight")?o.get("lineheight"):"normal",size:"7",maxlength:"12"}]]],["br"],["br"],i("tableformatting_tips","h3","title",{},[e("tableformatting")]),["div",[e("header_wstyles"),It,...[["yes",e(["param_values","y"])],["no",e(["param_values","n"])],["none",e(["param_values","0"])]].map((([n,r],i,a)=>["label",[["input",{name:t("header"),type:"radio",value:r,checked:o.get("header")===r||!o.has("header")&&1===i}],e(n),i===a.length-1?"":jt]]))]],["div",[e("footer_wstyles"),It,...[["yes",e(["param_values","y"])],["no",e(["param_values","n"])],["none",e(["param_values","0"])]].map((([n,r],i,a)=>["label",[["input",{name:t("footer"),type:"radio",value:r,checked:o.get("footer")===r||!o.has("footer")&&2===i}],e(n),i===a.length-1?"":jt]]))]],["label",[["input",{name:t("headerfooterfixed"),type:"checkbox",value:n("yes"),checked:o.get("headerfooterfixed")===n("yes")}],It,e("headerfooterfixed-wishtoscroll")]],["br"],["div",[e("caption_wstyles"),It,...[["yes",e(["param_values","y"])],["no",e(["param_values","n"])],["none",e(["param_values","0"])]].map((([n,r],i,a)=>["label",[["input",{name:t("caption"),type:"radio",value:r,checked:o.get("caption")===r||!o.has("caption")&&2===i}],e(n),i===a.length-1?"":jt]]))]],["br"],["div",[e("table_wborder"),It,["label",[["input",{name:t("border"),type:"radio",value:"1",checked:"0"!==o.get("border")}],e("yes"),jt]],["label",[["input",{name:t("border"),type:"radio",value:"0",checked:"0"===o.get("border")}],e("no")]]]],["div",[e("interlin_repeat_field_names"),It,["label",[["input",{name:t("interlintitle"),type:"radio",value:"1",checked:"0"!==o.get("interlintitle")}],e("yes"),jt]],["label",[["input",{name:t("interlintitle"),type:"radio",value:"0",checked:"0"===o.get("interlintitle")}],e("no")]]]],["label",[e("interlintitle_css"),It,["input",{name:t("interlintitle_css"),type:"text",value:o.get("interlintitle_css")||"",size:"12"}]]],["br"],["br"],i("pageformatting_tips","h3","title",{},[e("pageformatting")]),["label",[e("page_css"),It,["textarea",{name:t("pagecss"),title:n("page_css_tips"),value:o.get("pagecss")}]]],["br"],i("outputmode_tips","label","title",{},[e("outputmode"),It,["select",{name:t("outputmode")},["table","div"].map((e=>{const t={value:e};return o.get("outputmode")===e&&(t.selected="selected"),r(["param_values","outputmode",e],t)}))]])]],addRandomFormFields({il:e,ld:n,l:r,le:i,$p:o,serializeParamsAsURL:a,content:s}){[[["td",{colspan:12,align:"center"},[["br"],n("or"),["br"],["br"]]]],[["td",{colspan:12,align:"center"},[["label",[n("rnd"),jt,["input",{id:"rand",name:e("rand"),type:"checkbox",value:r("yes"),checked:o.get("rand")===r("yes")}]]],jt,["label",[n("verses-context"),ut,["input",{name:e("context"),type:"number",min:1,size:4,value:o.get("context")}]]],jt,i("view-random-URL","input","value",{type:"button",$on:{click(){const e=a(t(t({},Dt()),{},{type:"randomResult"}));qe("#randomURL").value=e}}}),["input",{id:"randomURL",type:"text"}]]]]].forEach((e=>{e&&e.length&&s.push(["tr",e])}))},getPreferences:({languageParam:e,lf:t,paramsSetter:n,replaceHash:r,getFieldAliasOrNames:i,work:o,langs:a,imfl:s,l:u,localizeParamNames:l,namespace:c,hideFormattingSection:f,groups:p,preferencesPlugin:h})=>["div",{style:{textAlign:"left"},id:"preferences",hidden:"true"},[["div",{style:"margin-top: 10px;"},[["label",[u("localizeParamNames"),["input",{id:"localizeParamNames",type:"checkbox",checked:l,$on:{change({target:{checked:e}}){localStorage.setItem(c+"-localizeParamNames",e)}}}]]]]],["div",[["label",[u("Hide formatting section"),["input",{id:"hideFormattingSection",type:"checkbox",checked:f,$on:{change({target:{checked:e}}){qe("#advancedformatting").style.display=e?"none":"block",localStorage.setItem(c+"-hideFormattingSection",e)}}}]]]]],["div",[["label",{for:"prefLangs"},[u("Preferred language(s)")]],["br"],["select",{id:"prefLangs",multiple:"multiple",size:a.length,$on:{change({target:{selectedOptions:e}}){localStorage.setItem(c+"-langCodes",JSON.stringify([...e].map((e=>e.value))))}}},a.map((e=>{let t=localStorage.getItem(c+"-langCodes");t=t&&JSON.parse(t);const n={value:e.code};return t&&t.includes(e.code)&&(n.selected="selected"),["option",n,[s(["languages",e.code])]]}))]]],h?h({$:qe,l:u,jml:it,paramsSetter:n,getDataForSerializingParamsAsURL:Dt,work:o,replaceHash:r,getFieldAliasOrNames:i}):""]],addBrowseFields({browseFields:e,fieldInfo:t,ld:n,i:r,iil:i,$p:o,content:a}){const s=o.get("work");[r>0?[["td",{colspan:12,align:"center"},[["br"],n("or"),["br"],["br"]]]]:"",[...(()=>{const t=t=>e.reduce(((e,{fieldName:n,aliases:a,fieldSchema:{minimum:u,maximum:l}},c)=>{const f=s+"-"+i(t)+(r+1)+"-"+(c+1),p=f;return e["#"].push(["td",[["label",{for:f},[n]]]],["td",[a?["datalist",{id:"dl-"+p},a.map((e=>["option",[e]]))]:"",a?["input",{name:f,id:p,class:"browseField",list:"dl-"+p,value:o.get(f,!0),$on:"start"===t?{change(e){Ge("input.browseField").forEach((t=>{t.id.includes(r+1+"-"+(c+1))&&(t.value=e.target.value)}))}}:void 0}]:["input",{name:f,id:p,type:"number",min:u,max:l,value:o.get(f,!0)}],jt]]),e}),{"#":[]});return[t("start"),["td",[["b",[n("to")]],jt]],t("end")]})(),["td",[e.length>1?n("versesendingdataoptional"):""]]],[["td",{colspan:4*e.length+2+1,align:"center"},[["table",[["tr",[e.reduce(((e,{fieldName:t,aliases:n,fieldSchema:{minimum:a,maximum:u}},l)=>{const c=s+"-"+i("anchor")+(r+1)+"-"+(l+1),f=c;return e["#"].push(["td",[["label",{for:c},[t]]]],["td",[n?["datalist",{id:"dl-"+f},n.map((e=>["option",[e]]))]:"",n?["input",{name:c,id:f,class:"browseField",list:"dl-"+f,value:o.get(c,!0)}]:["input",{name:c,id:f,type:"number",min:a,max:u,value:o.get(c,!0)}],It]]),e}),{"#":[["td",{style:"font-weight: bold; vertical-align: bottom;"},[n("anchored-at")+jt]]]}),["td",[["label",[n("field")+It,["select",{name:i("anchorfield")+(r+1),size:"1"},t.map((({fieldAliasOrName:e})=>o.get(i("anchorfield")+(r+1),!0)===e?["option",{selected:!0},[e]]:["option",[e]]))]]]]]]]]]]]]].forEach((e=>{e&&e.length&&a.push(["tr",e])}))},main({lf:e,languageParam:n,l:r,namespace:i,heading:o,fallbackDirection:a,imfl:s,langs:u,fieldInfo:l,localizeParamNames:c,serializeParamsAsURL:f,paramsSetter:p,replaceHash:h,getFieldAliasOrNames:d,hideFormattingSection:g,$p:m,metadataObj:y,il:v,le:b,ld:_,iil:w,fieldMatchesLocale:E,preferredLocale:x,schemaItems:S,content:O,groups:P,preferencesPlugin:T}){const A=m.get("work"),k=({type:e})=>f(t(t({},Dt()),{},{type:e}));it("div",{class:"focus"},[["div",{style:"float: left;"},[["button",{$on:{click(){const e=qe("#preferences");e.hidden=!e.hidden}}},[r("Preferences")]],Rt.workDisplay.getPreferences({languageParam:n,lf:e,paramsSetter:p,replaceHash:h,getFieldAliasOrNames:d,work:A,langs:u,imfl:s,l:r,localizeParamNames:c,namespace:i,groups:P,hideFormattingSection:g,preferencesPlugin:T})]],["h2",[o]],["br"],["form",{id:"browse",$custom:{$submit(){const e=k({type:"saveSettings"}).replace(/^[^#]*#/,"");console.log("history thisParams",e),history.replaceState(e,document.title,location.href);const t=k({type:"result"});location.href=t}},$on:{keydown({key:e,target:t}){"Enter"===e&&"textarea"!==t.localName.toLowerCase()&&this.$submit()},submit(e){e.preventDefault(),this.$submit()}},name:v("browse")},[["table",{align:"center"},O],["br"],["div",{style:"margin-left: 20px"},[["br"],["br"],["table",{border:"1",align:"center",cellpadding:"5"},[["tr",{valign:"top"},[["td",[Rt.workDisplay.columnsTable({ld:_,fieldInfo:l,$p:m,le:b,iil:w,l:r,metadataObj:y,preferredLocale:x,schemaItems:S,fieldMatchesLocale:E}),b("save-settings-URL","input","value",{type:"button",$on:{click(){const e=k({type:"saveSettings"});qe("#settings-URL").value=e}}}),["input",{id:"settings-URL"}],["br"],["button",{$on:{async click(e){e.preventDefault();const n=p(t(t({},Dt()),{},{workName:A,type:"startEndResult"})),r=h(n)+`&work=${A}&${A}-startEnd1=%s`;try{await navigator.clipboard.writeText(r)}catch(e){}}}},[r("Copy_shortcut_URL")]]]],Rt.workDisplay.advancedFormatting({ld:_,il:v,l:r,lo:(e,t)=>["option",t,[r({key:e,fallback:({message:e})=>(t.dir=a,e)})]],le:b,$p:m,hideFormattingSection:g})]]]]]],["p",{align:"center"},[b("submitgo","input","value",{type:"submit"})]]]]],qe("#main"))}},resultsDisplayServerOrClient:{caption:({heading:e,ranges:t})=>e+" "+t,startSeparator:({l:e})=>e("colon"),innerBrowseFieldSeparator:({l:e})=>e("comma-space"),ranges:({l:e,startRange:t,endVals:n,rangeNames:r})=>t+"-"+n.join(Rt.resultsDisplayServerOrClient.startSeparator({l:e}))+" ("+r+")",fieldValueAlias:({key:e,value:t})=>t+" ("+e+")",interlinearSegment:({lang:e,dir:t,html:n})=>`<span${e?` lang="${e}"`:""}${t?` dir="${t}"`:""}>${n}</span>`,interlinearTitle:({l:e,val:t})=>`<span class="interlintitle">${t}</span>${e("colon-space")}`,styles({$p:e,$pRaw:t,$pRawEsc:n,$pEscArbitrary:r,escapeQuotedCSS:i,escapeCSS:o,tableWithFixedHeaderAndFooter:a,checkedFieldIndexes:s,hasCaption:u}){const l=e.has("color",!0)&&"#"!==e.get("color",!0)?r("color"):n("colorName"),c=e.has("bgcolor",!0)&&"#"!==e.get("bgcolor",!0)?r("bgcolor"):n("bgcolorName"),f=1+(0+(u?2:0)),p=f+1+"em",h=`100% - ${p} - 2em - 0.5em`;return["style",[(a?`\nhtml, body, #main, #main > div {\n height: 100%; /* Needed to ensure descendent heights retain 100%; could be avoided if didn't want percent on table height */\n overflow-y: hidden; /* Not sure why we're getting extra here, but... */\n}\n.anchor-table-header {\n background-color: ${c||"white"}; /* Header background (not just for div text inside header, but for whole header area) */\n overflow-x: hidden; /* Not sure why we're getting extra here, but... */\n position: relative; /* Ensures we are still flowing, but provides anchor for absolutely positioned thead below (absolute positioning positions relative to nearest non-static ancestor; clear demo at https://www.w3schools.com/cssref/playit.asp?filename=playcss_position&preval=fixed ) */\n padding-top: ${p}; /* Provides space for the header (and caption) (the one that is absolutely positioned below relative to here) */\n height: 100%; /* Percent of the whole screen taken by the table */\n}\n.anchor-table-body {\n overflow-y: auto; /* Provides scrollbars when text fills up beyond the height */\n height: ${`calc(${h})`}; /* If < 100%, the header anchor background color will seep below table */\n}\n\n.caption, .thead .th, .tfoot .th {\n line-height: 0; /* th div will have own line-height; reducing here avoids fattening it by an inner div */\n color: transparent; /* Hides the non-div duplicated header text */\n white-space: nowrap; /* Ensures column header text uses up full width without overlap (esp. wrap no longer seems to work); this must be applied outside of the div */\n border: none; /* We don't want a border for this invisible section */\n}\ndiv.inner-caption, .thead .th div.th-inner, .tfoot .th div.th-inner { /* divs are used as th is supposedly problematic */\n position: absolute; /* Puts relative to nearest non-static ancestor (our relative header anchor) */\n color: initial; /* Header must have an explicit color or it will get transparent container color */\n line-height: normal; /* Revert ancestor line height of 0 */\n}\n.thead .th div.th-inner {\n top: ${f}em; /* Ensures our header stays fixed at top outside of normal flow of table */\n}\ndiv.inner-caption {\n top: 1em;\n}\n.tfoot .th div.th-inner { /* divs are used as th is supposedly problematic */\n top: ${`calc(${h} + 0.5em)`}; /* Ensures our header stays fixed at top outside of normal flow of table */\n}\n.zupa div.zupa1 {\n margin: 0 auto !important;\n width: 0 !important;\n}\n.zupa div.th-inner, .zupa div.inner-caption {\n width: 100%;\n margin-left: -50%;\n text-align: center;\n}\n`:"")+("y"===t("caption")?a?".caption div.inner-caption, ":".caption, ":"")+("y"===t("header")?a?"":".thead .th, ":"")+("y"===t("footer")?a?"":".tfoot .th, ":"")+".tbody td"+` {\n vertical-align: top;\n font-style: ${n("fontstyle")};\n font-variant: ${n("fontvariant")};\n font-weight: ${r("fontweight")};\n ${r("fontsize")?`font-size: ${r("fontsize")};`:""}\n font-family: ${r("fontSeq")};\n\n font-stretch: ${n("fontstretch")};\n letter-spacing: ${r("letterspacing")};\n line-height: ${r("lineheight")};\n ${l?`color: ${o(l)};`:""}\n ${c?`background-color: ${o(c)};`:""}\n}\n${o(r("pagecss")||"")}\n`+s.map(((e,n)=>("y"===t("header")?a?`.thead .th:nth-child(${n+1}) div.th-inner, `:`.thead .th:nth-child(${n+1}), `:"")+("y"===t("footer")?a?`.tfoot .th:nth-child(${n+1}) div.th-inner, `:`.tfoot .th:nth-child(${n+1}), `:"")+`.tbody td:nth-child(${n+1}) `+`{\n ${r("css"+(e+1))}\n}\n`)).join("")+(r("interlintitle_css")?`\n/* http://salzerdesign.com/test/fixedTable.html */\n.interlintitle {\n ${o(r("interlintitle_css"))}\n}\n`:"")+(c?`\nbody {\n background-color: ${c};\n}\n`:"")]]},main({tableData:e,$p:n,$pRaw:r,$pRawEsc:i,$pEscArbitrary:o,escapeQuotedCSS:a,escapeCSS:s,escapeHTML:u,l:l,localizedFieldNames:c,fieldLangs:f,fieldDirs:p,caption:h,hasCaption:d,showInterlinTitles:g,determineEnd:m,getCanonicalID:y,canonicalBrowseFieldSetName:v,getCellValue:b,checkedAndInterlinearFieldInfo:_,interlinearSeparator:w="<br /><br />"}){const E={table:[["table",{class:"table",border:r("border")||"0"}],["tr",{class:"tr"}],["td"],["th",{class:"th"}],["caption",{class:"caption"}],["thead",{class:"thead"}],["tbody",{class:"tbody"}],["tfoot",{class:"tfoot"}]],div:[["div",{class:"table",style:"display: table;"}],["div",{class:"tr",style:"display: table-row;"}],["div",{class:"td",style:"display: table-cell;"}],["div",{class:"th",style:"display: table-cell;"}],["div",{class:"caption",style:"display: table-caption;"}],["div",{class:"thead",style:"display: table-header-group;"}],["div",{class:"tbody",style:"display: table-row-group;"}],["div",{class:"tfoot",style:"display: table-footer-group;"}]],"json-array":"json","json-object":"json"},x=n.get("outputmode",!0);switch(x){case"json-object":case"json-array":throw new Error("JSON object support is currently not available")}const S=E[Object.prototype.hasOwnProperty.call(E,x)?x:"table"],[O,P,T,A,k,C,N,L]=S,[I,j,D]=_,R="yes"===r("headerfooterfixed"),F=(e,t)=>((e=JSON.parse(JSON.stringify(e))).push(t),e),U=([e,n],r)=>[e,t(t({},n),r)],$={start:!1,end:!1},M=[],{showEmptyInterlinear:z,showTitleOnSingleInterlinear:q}=this,G=(e,t)=>{if(!z&&(t||([...(e=(new DOMParser).parseFromString(e,"text/html").body).querySelectorAll("br")].forEach((e=>{e.remove()})),e=e.innerHTML),!e.trim()))return!0};return e.some(((e,t)=>{const n=m({tr:e,foundState:$});if("boolean"==typeof n)return n;const r=y({tr:e});return M.push(F(U(P,{dataset:{row:n,"canonical-type":v,"canonical-id":r}}),j.map(((n,r)=>{const i=D[r],o=i,{tdVal:a,htmlEscaped:s}=b({tr:e,idx:n}),u=o&&i.map((t=>{const{tdVal:n,htmlEscaped:r}=b({tr:e,idx:t});console.log("showEmptyInterlinear",z,r);return G(n,r)?"":o?Rt.resultsDisplayServerOrClient.interlinearSegment({lang:f[t],dir:p[t],html:(g?Rt.resultsDisplayServerOrClient.interlinearTitle({l:l,val:c[t]}):"")+n}):n})).filter((e=>""!==e));return U(T,{id:"row"+(t+1)+"col"+(r+1),lang:f[n],dir:p[n],dataset:{col:c[n]},innerHTML:(o&&!G(a,s)&&(q||u.length)?Rt.resultsDisplayServerOrClient.interlinearSegment({lang:f[n],html:(g?Rt.resultsDisplayServerOrClient.interlinearTitle({l:l,val:c[n]}):"")+a}):a)+(i&&u.length?w+u.join(w):"")})})))),!1})),["div",[Rt.resultsDisplayServerOrClient.styles({$p:n,$pRaw:r,$pRawEsc:i,$pEscArbitrary:o,escapeQuotedCSS:a,escapeCSS:s,tableWithFixedHeaderAndFooter:R,checkedFieldIndexes:j,hasCaption:d}),(B=[F(O,[h?F(k,[h,R?["div",{class:"zupa1"},[["div",{class:"inner-caption"},[["span",[h]]]]]]:""]):"","0"!==r("header")?F(C,[F(P,I.map(((e,t)=>{const n=D[t];return e=u(e)+(n?l("comma-space")+n.map((e=>c[e])).join(l("comma-space")):""),F(A,[e,R?["div",{class:"zupa1"},[["div",{class:"th-inner"},[["span",[e]]]]]]:""])})))]):"",r("footer")&&"0"!==r("footer")?F(L,[F(P,I.map(((e,t)=>{const n=D[t];return e=u(e)+(n?l("comma-space")+n.map((e=>c[e])).join(l("comma-space")):""),F(A,[e,R?["div",{class:"zupa1"},[["div",{class:"th-inner"},[["span",[e]]]]]]:""])})))]):"",F(N,M)])],R?["div",{class:"table-responsive anchor-table-header zupa"},[["div",{class:"table-responsive anchor-table-body"},B]]]:["div",{class:"table-responsive"},B])]];var B}},resultsDisplayClient:{anchorRowCol:({anchorRowCol:e})=>qe("#"+e),anchors:({escapedRow:e,escapedCol:t})=>qe('tr[data-row="'+e+'"]'+(t?'> td[data-col="'+t+'"]':"")),main(...e){let t;try{t=Rt.resultsDisplayServerOrClient.main(...e)}catch(e){"JSON support is currently not available"===e.message&&dt.alert(e.message)}it(...t,qe("#main"))}},defaultBody(){for(;st.hasChildNodes();)st.firstChild.remove();return it("div",{id:"main",role:"main"},st)}};function Ft(e,t){if(t||!this.localizeParamNames)return e;const n=/\d+(-\d+)?$/,r=e.match(n);return r?this.l10n(["params","indexed",e.replace(n,"")])+r[0]:this.l10n(["params",e])}Rt.permissions={versionChange(){qe("#versionChange").showModal()},addLogEntry({text:e}){const t=qe("#installationLogContainer");try{t.showModal();qe("#dialogContainer").hidden=!1}catch(e){}qe("#installationLog").append(e+"\n")},exitDialogs(){const e=qe("#dialogContainer");e&&(e.hidden=!0)},dbError({type:e,escapedErrorMessage:t}){e&&it("span",[e," ",t],qe("#dbError")),qe("#dbError").showModal()},errorRegistering(e){e&&it("span",[e],qe("#errorRegistering")),qe("#errorRegistering").showModal()},browserNotGrantingPersistence(){qe("#browserNotGrantingPersistence").showModal()},main({l:e,ok:t,refuse:n,close:r,closeBrowserNotGranting:i}){const o=it("dialog",{style:"text-align: center; height: 100%",id:"installationLogContainer",class:"focus"},[["p",[e("wait-installing")]],["div",{style:"height: 80%; overflow: auto;"},[["pre",{id:"installationLog"},[]]]]]);let a="";t&&(a=it("dialog",{id:"willRequestStoragePermissions",$on:{close:r}},[["section",[e("will-request-storage-permissions")]],["br"],["div",{class:"focus"},[["button",{$on:{click:t}},[e("OK")]],["br"],["br"],["button",{$on:{click:n}},[e("refuse-request-storage-permissions")]]]]]));const s=it("dialog",{id:"errorRegistering"},[["section",[e("errorRegistering")]]]);let u="";i&&(u=it("dialog",{id:"browserNotGrantingPersistence"},[["section",[e("browser-not-granting-persistence")]],["br"],["div",{class:"focus"},[["button",{$on:{click:i}},[e("OK")]]]]]));const l=it("dialog",{id:"versionChange"},[["section",[e("versionChange")]]]),c=it("dialog",{id:"dbError"},[["section",[e("dbError")]]]);return it("div",{id:"dialogContainer",style:"height: 100%"},[o,a,u,s,l,c],qe("#main")),[o,a,u,s,l,c]}};class Ut{constructor({l10n:e,params:t}={}){this.l10n=e,t||(t=location.hash.slice(1)),"string"==typeof t&&(t=new URLSearchParams(t)),this.params=t}get(e,t){return this.params.get(Ft.call(this,e,t))}getAll(e,t){return this.params.getAll(Ft.call(this,e,t))}has(e,t){return this.params.has(Ft.call(this,e,t))}delete(e,t){return this.params.delete(Ft.call(this,e,t))}set(e,t,n){return this.params.set(Ft.call(this,e,n),t)}append(e,t,n){return this.params.append(Ft.call(this,e,n),t)}toString(){return this.params.toString()}}const $t=e=>location.href.replace(/#.*$/,"")+"#"+e.toString(),Mt=function({l:e,il:t,$p:n}){return function({form:r,random:i={},checkboxes:o,type:a,fieldAliasOrNames:s=[],workName:u}){const l=new URLSearchParams(n.params),c=Ae(r,{hash:!0,empty:!0});function f(){let e=1,t=1;for(;l.has(`${u}-start${e}-${t}`,!0);){for(;l.has(`${u}-start${e}-${t}`,!0);)l.delete(`${u}-start${e}-${t}`,!0),l.delete(`${u}-end${e}-${t}`,!0),l.delete(`${u}-anchor${e}-${t}`,!0),t++;t=1,e++}}switch(Object.keys(c).forEach((e=>{l.set(e,c[e])})),l.delete(t("rand")),l.set(t("rand"),i.checked?e("yes"):e("no")),o.forEach((t=>{l.delete(t.name),t.name&&l.set(t.name,t.checked?e("yes"):e("no"))})),a){case"saveSettings":l.delete(t("rand"));break;case"shortcutResult":{l.delete(t("rand"));let n=1;for(;l.has(`anchorfield${n}`,!0);)l.delete(`anchorfield${n}`,!0),n++;for(f(),n=1;l.has(`field${n}`,!0);)l.delete(`field${n}`,!0),l.delete(`checked${n}`,!0),l.delete(`interlin${n}`,!0),l.delete(`css${n}`,!0),n++;s.forEach(((t,n)=>{l.set(`field${n+1}`,t,!0),l.set(`checked${n+1}`,e("yes"),!0),l.set(`interlin${n+1}`,""),l.set(`css${n+1}`,"")})),l.delete("work",!0)}case"startEndResult":case"randomResult":case"result":"startEndResult"===a&&f(),("randomResult"===a||i.checked)&&(l.delete(t("rand")),l.set(t("rand"),e("yes"))),l.set(t("result"),e("yes"));break;default:console.error("Unexpected type",a)}return l}},zt=["lf","fileData","metadataObj"];var qt,Gt=qt={_regexEscape:/([\.\*\+\^\$\[\]\\\(\)\|\{\}\,\-\:\?])/g,_regexParseLocale:/^([a-zA-Z]*)([_\-a-zA-Z]*)$/,_escapeRegExpPattern:function(e){return"string"!=typeof e?e:e.replace(qt._regexEscape,"\\$1")},_toLowerCase:function(e,t){return"string"!=typeof e?t&&e:e.toLowerCase()},_toUpperCase:function(e,t){return"string"!=typeof e?t&&e:e.toUpperCase()},_trim:function(e,t,n){var r,i=[],o=function(e){i.push("^"+e+"+|"+e+"+$")};if("boolean"==typeof t&&(n=t,t=null),"string"!=typeof e)return n&&e;if(Array.isArray(t)&&t.map((function(e){var t=qt._escapeRegExpPattern(e);o(t)})),"string"==typeof t){var a=qt._escapeRegExpPattern(t);o(a)}t||o("\\s");var s="("+i.join("|")+")";for(r=new RegExp(s,"g");e.match(r);)e=e.replace(r,"");return e},_parseLocale:function(e){var t,n=qt._regexParseLocale.exec(e);if(e&&n)return n[2]=qt._trim(n[2],["-","_"]),{lang:qt._toLowerCase(n[1]),countryCode:t=qt._toUpperCase(n[2])||t}},isRtlLang:function(e){var t=qt._parseLocale(e);if(t)return qt._BIDI_RTL_LANGS.indexOf(t.lang)>=0},getLangDir:function(e){return qt.isRtlLang(e)?"rtl":"ltr"}};Object.defineProperty(qt,"_BIDI_RTL_LANGS",{value:["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"],writable:!1,enumerable:!0,configurable:!1});var Bt={isRtlLang:Gt.isRtlLang,getLangDir:Gt.getLangDir};const{getLangDir:Vt}=Bt,Wt=/^.* \((.*?)\)$/,Ht=e=>"string"==typeof e?e.replace(Wt,"$1"):e,Kt=async function({l:e,lang:t,fallbackLanguages:n,imfLocales:r,$p:i,skipIndexedDB:o,noIndexedDB:a,prefI18n:s,files:u,allowPlugins:l,langData:c,basePath:f="",dynamicBasePath:p=""}){const h=new gt({langData:c}),d=({schemaItems:e,fieldInfo:n,metadataObj:r,getFieldAliasOrName:i,usePreferAlias:o})=>n.map((({field:n,plugin:a})=>{if(a)return;const{preferAlias:s,fieldValueAliasMap:u}=bt({field:n,schemaItems:e,metadataObj:r,getFieldAliasOrName:i,lang:t});return o?u?(Object.entries(u).forEach((([e,t])=>{Array.isArray(t)?u[e]=t.map((t=>Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:t}))):t&&"object"==typeof t?"string"==typeof s?u[e]=Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:t[s]}):Object.entries(t).forEach((([t,n])=>{u[e][t]=Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:n})})):u[e]=Rt.resultsDisplayServerOrClient.fieldValueAlias({key:e,value:t})})),!1!==s?u:void 0):void 0:!1!==s?u:void 0})),g=(e,t)=>{let n;const o=i.get(e,!0);return function e(t){return Array.isArray(t)?t.some(e):Object.values(t).some(((r,i)=>"string"!=typeof r?e(r):r===o&&(n=Object.keys(t)[i],!0)))}(r),n||t||console.log("Bad param/value",e,"::",o),n},m=kt,{fileData:y,lf:v,getFieldAliasOrName:b,schemaObj:_,metadataObj:w,pluginsForWork:E}=await Pt({files:u||this.files,allowPlugins:"boolean"==typeof l?l:this.allowPlugins,lang:t,fallbackLanguages:n,work:i.get("work"),basePath:f});console.log("pluginsForWork",E);const x=yt(t,w,"heading"),S=_.items.items,O=[],P=[],T=[];_t({metadataObj:w,schemaItems:S,getFieldAliasOrName:b,lang:t,callback({setName:e,browseFields:t,presort:n}){O.push(e),P.push(n),T.push(t)}});const A=S.map((({title:e,format:t})=>({field:e,fieldAliasOrName:b(e)||e,escapeColumn:"html"!==t,fieldLang:w.fields[e].lang}))),[k]=t,C=new wt({metadataObj:w});if(E){console.log("pluginsForWork",E);const{lang:e}=this;E.iterateMappings((({plugin:t,pluginName:n,pluginLang:r,onByDefaultDefault:i,placement:o,applicableFields:a,meta:s})=>{o="end"===o?Number.POSITIVE_INFINITY:o;const u=({applicableField:t,targetLanguage:a,onByDefault:u,metaApplicableField:l}={})=>{const c=E.getPluginObject(n)||{},f=C.getFieldLang(t);c.getTargetLanguage&&(a=c.getTargetLanguage({applicableField:t,targetLanguage:a,pluginLang:r,applicableFieldLang:f})),"{locale}"===a&&(a=k);const p=yt(e,w,["fieldnames",t]),d=c.getFieldAliasOrName?c.getFieldAliasOrName({locales:e,lf:v,targetLanguage:a,applicableField:t,applicableFieldI18N:p,meta:s,metaApplicableField:l,targetLanguageI18N:h.getLanguageFromCode(a)}):h.getFieldNameFromPluginNameAndLocales({pluginName:n,locales:e,lf:v,targetLanguage:a,applicableFieldI18N:p,meta:s,metaApplicableField:l});A.splice(o,0,{plugin:c,meta:s,placement:o,fieldAliasOrName:d,escapeColumn:!1!==c.escapeColumn,onByDefault:"boolean"==typeof u?u:i||!1,applicableField:t,metaApplicableField:l,fieldLang:a})};E.processTargetLanguages(a,u)||u()}))}const N=A.map((e=>e.fieldAliasOrName)),L=A.map((e=>e.escapeColumn)),I=A.map((({fieldLang:e})=>e!==k?e:null)),j=d({schemaItems:S,fieldInfo:A,metadataObj:w,getFieldAliasOrName:b,usePreferAlias:!1}),D=d({schemaItems:S,fieldInfo:A,metadataObj:w,getFieldAliasOrName:b,usePreferAlias:!0}),R=i.localizeParamNames=i.has("i18n",!0)?"1"===i.get("i18n",!0):"true"===s||"false"!==s&&this.localizeParamNames,F=R?t=>e(["params",t]):e=>e,U=R?t=>e(["params","indexed",t]):e=>e,$=R?(e,t="")=>i.get(F(e)+t,!0):(e,t="")=>i.get(e+t,!0),M=R?(e,t="")=>i.get(i.get("work")+"-"+U(e)+t,!0):(e,t="")=>i.get(i.get("work")+"-"+e+t,!0),z=T.findIndex(((e,t)=>M("startEnd",t+1)));if(-1!==z){const e="-",t=":",n=(M("startEnd",z+1)||"").trim(),[r,o]=n.split(e);if(void 0!==o){const e=r.split(t),n=o.split(t),a=e.length-n.length;a>0?n.unshift(...e.slice(0,a)):a<0&&e.push(...Array.from({length:-a}).fill("1")),console.log("startPartVals",e),console.log("endPartVals",n),e.forEach(((e,t)=>{const r=n[t];i.set(`${i.get("work")}-start${z+1}-${t+1}`,e,!0),i.set(`${i.get("work")}-end${z+1}-${t+1}`,r,!0)}))}}const q=T.findIndex(((e,t)=>M("start",t+1+"-1"))),G=T[q],B=O[q],V=G.map((e=>e.fieldName)),W=T[0],H=O[0],K=W.map((e=>e.fieldName)),X=G.map((e=>e.fieldSchema.type)),Y=e=>V.map(((t,n)=>i.get(i.get("work")+"-"+e+(q+1)+"-"+(n+1),!0))),J=Y("start"),Z=Y("end"),[Q,ee]=(({starts:t,ends:n,applicableBrowseFieldNames:r,heading:i})=>{let o;const a="0"!==g("caption");if(a){const a=Rt.resultsDisplayServerOrClient.startSeparator({l:e}),s=Rt.resultsDisplayServerOrClient.innerBrowseFieldSeparator({l:e}),u=(()=>{const i=[],o=t.reduce(((e,t,r)=>{const o=e+t;return t===n[r]?o+(r>0?s:" "):(i.push(n[r]),o+a)}),"").slice(0,-a.length),u=r.join(s);return kt(Rt.resultsDisplayServerOrClient.ranges({l:e,startRange:o,endVals:i,rangeNames:u}))})();o=Rt.resultsDisplayServerOrClient.caption({heading:i,ranges:u})}return[a,o]})({starts:J,ends:Z,applicableBrowseFieldNames:V,heading:x}),te="1"===g("interlintitle");console.log("rand","yes"===$("rand"));const ne=(e,t)=>{let n;if(/^\d+$/.test(e)||Wt.test(e))n=Ht(e);else{const{rawFieldValueAliasMap:r}=G[t];let i;if(r){const t=Object.entries(r);Array.isArray(t[0][1])?t.some((([t,n])=>!!n.includes(e)&&(i=t,!0))):t.some((([t,n])=>!!Object.values(n).includes(e)&&(i=t,!0)))}n=void 0===i?e:i}return"integer"===X[t]?Number.parseInt(n):n},re=y.name,ie=J.map(ne),oe=Z.map(ne);let ae,se=!1;if(o||a){const e=P[q];if(this.noDynamic)({resolved:{data:ae}}=await mt.resolveRefs(y.file)),(({presort:e,tableData:t,applicableBrowseFieldNames:n,localizedFieldNames:r})=>{e&&t.sort(((e,t)=>{let i;return n.some((n=>{const o=r.indexOf(n),a=e[o]<t[o],s=e[o]>t[o];return i=s?1:-1,a||s})),i}))})({presort:e,tableData:ae,applicableBrowseFieldNames:V,localizedFieldNames:N});else{const e=`${p}textbrowser?${i.toString()}`;ae=await(await fetch(e)).json(),se=!0}}else ae=await new Promise(((e,t)=>{const n=this.namespace+"-textbrowser-cache-data";indexedDB.open(n).onsuccess=({target:{result:t}})=>{const n="files-to-cache-"+re;t.transaction(n).objectStore(n).index("browseFields-"+B).getAll(IDBKeyRange.bound(ie,oe)).onsuccess=({target:{result:t}})=>{const n=t.map((e=>e.value));e(n)}}}));!se&&E&&(A.forEach((({plugin:e,placement:t},n)=>{e&&ae.forEach(((e,n)=>{e.splice(t,0,null)}))})),A.forEach((({plugin:e,applicableField:t,fieldLang:n,meta:r,metaApplicableField:o},a)=>{if(!e)return;const s=A.findIndex((({field:e})=>e===t));ae.forEach(((u,l)=>{const c=u[s];u[a]=e.getCellData&&e.getCellData({tr:u,tableData:ae,i:l,j:a,applicableField:t,fieldInfo:A,applicableFieldIdx:s,applicableFieldText:c,fieldLang:n,getLangDir:Vt,meta:r,metaApplicableField:o,$p:i,thisObj:this})||c})),console.log("applicableFieldIdx",s)})));const ue=Vt(k),le=I.map((e=>{if(!e)return null;const t=Vt(e);return t!==ue?t:null})),ce={tableData:ae,$p:i,$pRaw:g,$pRawEsc:e=>kt(g(e)),$pEscArbitrary:e=>kt(i.get(e,!0)),escapeQuotedCSS:e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),escapeCSS:m,escapeHTML:kt,l:e,localizedFieldNames:N,fieldLangs:I,fieldDirs:le,caption:ee,hasCaption:Q,showInterlinTitles:te,determineEnd:(({fieldValueAliasMap:e,fieldValueAliasMapPreferred:t,localizedFieldNames:n,applicableBrowseFieldNames:r,startsRaw:i,endsRaw:o})=>({tr:a,foundState:s})=>{const u=[],l=r.map((r=>{const i=n.indexOf(r);return void 0!==e[i]?u.push(t[i][a[i]]):u.push(a[i]),a[i]}));if(!s.start){if(i.some(((e,t)=>e!==l[t])))return!1;s.start=!0}if(o.every(((e,t)=>e===l[t])))s.end=!0;else if(s.end)return!0;return u.join("-")})({applicableBrowseFieldNames:V,fieldValueAliasMap:j,fieldValueAliasMapPreferred:D,localizedFieldNames:N,startsRaw:ie,endsRaw:oe}),canonicalBrowseFieldSetName:H,getCanonicalID:(({fieldValueAliasMap:e,fieldValueAliasMapPreferred:t,localizedFieldNames:n,canonicalBrowseFieldNames:r})=>({tr:i,foundState:o})=>r.map((r=>{const o=n.indexOf(r);return void 0!==e[o]?t[o][i[o]]:i[o]})).join("-"))({canonicalBrowseFieldNames:K,fieldValueAliasMap:j,fieldValueAliasMapPreferred:D,localizedFieldNames:N}),getCellValue:(({fieldValueAliasMapPreferred:t,escapeColumnIndexes:n})=>({tr:r,idx:i})=>{let o=void 0!==t[i]?t[i][r[i]]:r[i];return o&&"object"==typeof o&&(o=Object.values(o)),Array.isArray(o)&&(o=o.join(e("comma-space"))),!n[i]&&this.trustFormatHTML||"string"!=typeof o?{tdVal:o}:{tdVal:kt(o),htmlEscaped:!0}})({fieldValueAliasMapPreferred:D,escapeColumnIndexes:L,escapeHTML:kt}),checkedAndInterlinearFieldInfo:(({localizedFieldNames:t})=>{let n,r,o=1,a=[];do{n=i.get("field"+o,!0),r=i.get("checked"+o,!0),o++,!n||r!==e("yes")&&null!==r||a.push(n)}while(n);a=a.filter((e=>t.includes(e)));const s=a.map((e=>t.indexOf(e))),u=s.map(((e,t)=>{const n=i.get("interlin"+(e+1),!0);return n&&n.split(/\s*,\s*/).map((e=>Number.parseInt(e)-1)).filter((e=>!Number.isNaN(e)))}));return[a,s,u]})({localizedFieldNames:N}),interlinearSeparator:this.interlinearSeparator};return{fieldInfo:A,$p:i,applicableBrowseFieldSet:G,fieldValueAliasMapPreferred:D,lf:v,iil:U,ilRaw:$,browseFieldSets:T,lang:t,metadataObj:w,fileData:y,templateArgs:ce}};async function Xt(){try{Rt.permissions.addLogEntry({text:"Worker registration: Beginning..."});if(!await navigator.storage.persist())return void Rt.permissions.browserNotGrantingPersistence();await(async({serviceWorkerPath:e,logger:t})=>{let n;console.log("--ready to register service worker",e);try{n=await navigator.serviceWorker.register(e,{type:"module"})}catch(t){return console.log("serviceWorkerPath",e),void await dt.alert("\nThere was an error during registration (for offline ability).\nPlease refresh the page if you wish to reattempt.\n")}return t.addLogEntry({text:"Worker registration: Complete"}),At({r:n,logger:t})})({serviceWorkerPath:this.serviceWorkerPath,logger:Rt.permissions})}catch(e){if(console.log("err",e),e&&"object"==typeof e){const{errorType:t}=e;if("versionChange"===t)return void Rt.permissions.versionChange()}Rt.permissions.errorRegistering(kt(e&&e.message))}}async function Yt(e,t){await new Promise(((e,n)=>{const[,r,i]=Rt.permissions.main({l:t,ok:async()=>{const e=await Notification.requestPermission();r.close(e)},refuse:()=>{r.close()},close:async()=>{try{if(!r.returnValue)return void function(){localStorage.setItem(this.namespace+"-refused","true")}()}catch(e){console.log("err",e),Rt.permissions.errorRegistering(kt(e&&e.message))}switch(r.returnValue){case"denied":case"default":return void e();case"granted":if(navigator.serviceWorker.controller)return void e();await Xt.call(this);break;default:console.error("Unexpected returnValue",r.returnValue)}},closeBrowserNotGranting:e=>{i.close()}});r.showModal()}))}class Jt{constructor(e){const t=new URL("node_modules/textbrowser/resources/index.js",location);this.site=e.site||"site.json";const n=e.stylesheets||["@builtin"],r=n.indexOf("@builtin");var i,o;-1!==r&&n.splice(r,1,new URL("index.css",t).href),this.stylesheets=n,o=e,(i=this).userJSON=o.userJSON||"resources/user.json",i.languages=o.languages||new URL("../appdata/languages.json",new URL("node_modules/textbrowser/resources/index.js",location)).href,i.serviceWorkerPath=o.serviceWorkerPath||`sw.js?pathToUserJSON=${encodeURIComponent(i.userJSON)}&stylesheets=${encodeURIComponent(JSON.stringify(i.stylesheets||[]))}`,i.files=o.files||"files.json",i.namespace=o.namespace||"textbrowser",this.allowPlugins=e.allowPlugins,this.dynamicBasePath=e.dynamicBasePath,this.trustFormatHTML=e.trustFormatHTML,this.requestPersistentStorage=e.requestPersistentStorage,this.localizeParamNames=void 0===e.localizeParamNames||e.localizeParamNames,this.hideFormattingSection=Boolean(e.hideFormattingSection),this.preferencesPlugin=e.preferencesPlugin,this.interlinearSeparator=e.interlinearSeparator,this.showEmptyInterlinear=e.showEmptyInterlinear,this.showTitleOnSingleInterlinear=e.showTitleOnSingleInterlinear,this.noDynamic=e.noDynamic,this.skipIndexedDB=e.skipIndexedDB}async init(){return this._stylesheetElements=await be(this.stylesheets),this.displayLanguages()}async displayLanguages(){try{const[e,t]=await d([this.languages,this.site]);this.langData=e,this.siteData=t;const n=this.paramChange();return window.addEventListener("hashchange",(()=>this.paramChange())),n}catch(e){console.log("err",e),dt.alert(e)}}getWorkData(e){try{return Pt.call(this,t(t({},e),{},{files:this.files,allowPlugins:this.allowPlugins}))}catch(e){console.log("err",e),dt.alert("catch:"+e)}}getDirectionForLanguageCode(e){const t=this.langData.languages,n=t.find((t=>t.code===e));return n&&n.direction||t.find((t=>t.code.startsWith(e+"-")))}getFieldNameAndValueAliases(e){return bt(t(t({},e),{},{lang:this.lang}))}getBrowseFieldData(e){return _t(t(t({},e),{},{lang:this.lang}))}async paramChange(){Rt.defaultBody();const e=this.$p="string"==typeof history.state?new Ut({params:history.state}):new Ut,n=(t,n)=>{const r=document.querySelector(t),i=location.href.replace(/#.*$/,"")+"#"+e.toString();history.replaceState(Ae(r,{hash:!0,empty:!0}),document.title,i),n(),location.hash="#"+e.toString()},r=new gt({langData:this.langData}),{lang:i,langs:o,languageParam:a,fallbackLanguages:s}=r.getLanguageInfo({$p:e});this.lang=i;const[u]=i,l=this.getDirectionForLanguageCode(u);document.documentElement.lang=u,document.dir=l;const c=(()=>{const e=e=>this.siteData["localization-strings"][e];return ve({locales:i.map(e),fallbackLocales:s.map(e)}).getFormatter()})();document.title=c("browser-title");const f=localStorage.getItem(this.namespace+"-refused"),p=await navigator.storage.persisted(),h=await navigator.serviceWorker.getRegistration(this.serviceWorkerPath),g=e.get("result"),m=async()=>{if(g)return;!(f||navigator.serviceWorker.controller&&p)&&(p?(Rt.permissions.main({l:c}),await Xt.call(this)):await Yt.call(this,o,c),Rt.permissions.exitDialogs())};if(h){const e=h.installing||h.waiting||h.active;if(!e)return console.error("Unexpected error: worker registration received without a worker."),void await m();Rt.permissions.main({l:c});setInterval((()=>{h.update()}),36e5),console.log("worker.state",e.state);const t=async()=>{try{return At({r:h,langs:o,languages:this.languages,logger:Rt.permissions})}catch(e){return console.log("err",e),dt.alert("\n There was an unexpected error activating the new version;\n please save any unfinished work, close this tab, and try\n opening this site again.\n\n Please contact a service administrator if the problem\n persists (Error type: worker activation).\n ")}};switch(e.state){case"installing":t(),Tt({r:h,logger:{addLogEntry(e){console.log(e)}}});break;case"installed":await t();break;case"activating":return await dt.alert("\n Please wait for a short while as we work to update to a new version.\n "),t(),void navigator.serviceWorker.onmessage({data:"finishActivate"});case"activated":Tt({r:h,logger:{addLogEntry(e){console.log(e)}}});break;case"redundant":return void await t();default:console.log("Unexpected worker.state",e.state)}}else await m();if(Rt.permissions.exitDialogs(),!a)return e.l10n=c,document.title=c("languages-title"),void Rt.languageSelect.main({langs:o,languages:r,followParams:n,$p:e});return Ie({$p:e,lang:i,langs:o,langData:this.langData,fallbackLanguages:s,resultsDisplay:e=>{const n=f||!navigator.serviceWorker.controller;return this.resultsDisplayClient(t(t({langData:this.langData},e),{},{noIndexedDB:n,dynamicBasePath:this.dynamicBasePath,files:this.files,allowPlugins:this.allowPlugins}))},localeCallback:t=>{this.l10n=t,e.l10n=t;return e.get("work")?!g&&(this.workDisplay({l:t,lang:i,preferredLocale:u,fallbackLanguages:s,languageParam:a,$p:e,languages:r,preferencesPlugin:this.preferencesPlugin}),!0):(async function({files:e,lang:t,fallbackLanguages:n,$p:r,followParams:i}){try{const o=await d(e),a=e=>o["localization-strings"][e],s=await d(o.groups.reduce(((e,t)=>{const n=(o.metadataBaseDirectory||"")+(t.metadataBaseDirectory||"")+"/";return t.files.reduce(((e,t)=>[...e,n+t.metadataFile]),e)}),[])),u=ve({locales:t.map(a),fallbackLocales:n.map(a)}).getFormatter();document.title=u({key:"browserfile-workselect",fallback:!0});const l=s[Symbol.iterator](),c=()=>{const e=l.next().value;return yt(t,e,"alias")};Rt.workSelect({groups:o.groups,lf:u,getNextAlias:c,$p:r,followParams:i})}catch(e){console.log("Error",e),dt.alert(e)}}({files:this.files,lang:i,fallbackLanguages:s,$p:e,followParams:n}),!0)}})}}Jt.prototype.workDisplay=async function({l:e,languageParam:n,lang:i,preferredLocale:o,languages:a,fallbackLanguages:s,$p:u}){const{preferencesPlugin:l}=this,c=this.langData.languages,f=this.getDirectionForLanguageCode(s[0]),p=localStorage.getItem(this.namespace+"-localizeParamNames"),h=u.localizeParamNames=u.has("i18n",!0)?"1"===u.get("i18n",!0):"true"===p||"false"!==p&&this.localizeParamNames,g=localStorage.getItem(this.namespace+"-hideFormattingSection"),m=u.has("formatting",!0)?"0"===u.get("formatting",!0):"true"===g||"false"!==g&&this.hideFormattingSection;try{const p=await this.getWorkData({lang:i,fallbackLanguages:s,preferredLocale:o,languages:a,work:u.get("work")}),{lf:g,fileData:y,metadataObj:v}=p,b=r(p,zt);document.title=g({key:"browserfile-workdisplay",values:{work:y?yt(i,v,"alias"):""},fallback:!0}),await async function({lf:t,metadataObj:r,getFieldAliasOrName:p,schemaObj:g,schemaItems:y,fieldInfo:v,metadata:b,pluginsForWork:_,groupsToWorks:w}){const E=h?t=>e(["params",t]):e=>e,x=h?t=>e(["params","indexed",t]):e=>e,S=a.localeFromLangData.bind(a),O=ve({locales:i.map(S),fallbackLocales:s.map(S)}).getFormatter(),P=(t,n,r)=>e({key:t,values:n,formats:r,fallback:({message:e})=>Rt.workDisplay.bdo({fallbackDirection:f,message:e})}),T=b.getFieldMatchesLocale({namespace:this.namespace,preferredLocale:o,schemaItems:y,pluginsForWork:_}),A=[];this.getBrowseFieldData({metadataObj:r,schemaItems:y,getFieldAliasOrName:p,callback({browseFields:e,i:t}){Rt.workDisplay.addBrowseFields({browseFields:e,fieldInfo:v,ld:P,i:t,iil:x,$p:u,content:A})}});const k=function(...e){const t=Mt(...e);return function(...e){const n=t(...e);return $t(n)}}({l:e,il:E,$p:u}),C=Mt({l:e,il:E,$p:u}),{groups:N}=await d(this.files),L=yt(i,r,"heading"),I=(()=>{const e=Promise.all(w.map((async({name:e,workNames:t,shortcuts:n})=>({groupName:e,worksToFields:await Promise.all(t.map((async(e,t)=>({workName:e,shortcut:n[t],fieldAliasOrNames:(await this.getWorkData({lang:i,fallbackLanguages:s,preferredLocale:o,languages:a,work:e})).fieldInfo.map((({fieldAliasOrName:e})=>e))}))))}))));return async()=>e})();Rt.workDisplay.main({languageParam:n,lang:i,lf:t,l:e,namespace:this.namespace,groups:N,heading:L,imfl:O,fallbackDirection:f,langs:c,fieldInfo:v,localizeParamNames:h,serializeParamsAsURL:k,paramsSetter:C,replaceHash:$t,getFieldAliasOrNames:I,hideFormattingSection:m,$p:u,metadataObj:r,il:E,le:(t,n,r,i,o=[])=>(i[r]=e({key:t,fallback:({message:e})=>(i.dir=f,e)}),[n,i,o]),ld:P,iil:x,fieldMatchesLocale:T,preferredLocale:o,schemaItems:y,content:A,preferencesPlugin:l})}.call(this,t({lf:g,metadataObj:v},b))}catch(e){console.log("err",e),dt.alert(e)}},Jt.prototype.resultsDisplayClient=async function(e){const n=await navigator.storage.persisted(),r=this.skipIndexedDB||!n||!navigator.serviceWorker.controller,i=localStorage.getItem(this.namespace+"-localizeParamNames"),{fieldInfo:o,$p:a,browseFieldSets:s,applicableBrowseFieldSet:u,lang:l,metadataObj:c,fileData:f,fieldValueAliasMapPreferred:p,lf:h,iil:d,ilRaw:g,templateArgs:m}=await Kt.call(this,t(t({},e),{},{skipIndexedDB:r,prefI18n:i}));document.title=h({key:"browserfile-resultsdisplay",values:{work:f?yt(l,c,"alias"):""},fallback:!0}),Rt.resultsDisplayClient.main(m),(({applicableBrowseFieldSet:e,fieldValueAliasMapPreferred:t,ilRaw:n,iil:r,max:i,$p:o})=>{const a=e.map((e=>e.fieldSchemaIndex)),s=o.get("work");let u;const l=n("anchorrowcol");if(l&&(u=Rt.resultsDisplayClient.anchorRowCol({anchorRowCol:l})),!u){const e=[];let n="";for(let u,l=1;!u&&!e.length;l++)for(let c=1;;c++){const f=s+"-anchor"+l+"-"+c,p=o.get(f,!0);if(!p){(l===i||e.length)&&(u=!0);break}n=o.get(r("anchorfield")+l,!0);const h=a[c-1],d=Ht(p),g=t[h]&&t[h][d];e.push(g||p)}if(e.length){const t=e=>(e||"").replace(/["\\]/g,"\\$&"),r=t(e.join("-")),i=n?t(n):void 0;u=Rt.resultsDisplayClient.anchors({escapedRow:r,escapedCol:i})}}u&&u.scrollIntoView()})({applicableBrowseFieldSet:u,fieldValueAliasMapPreferred:p,iil:d,ilRaw:g,$p:e.$p,max:s.length}),o.forEach((({plugin:e,applicableField:t,meta:n,j:r})=>{e&&e.done&&e.done({$p:a,applicableField:t,meta:n,j:r,thisObj:this})}))},Jt.prototype.getWorkFiles=async function(e=this.files){const t=await d(e),n=[];return t.groups.forEach((e=>{e.files.forEach((r=>{const{file:i,schemaFile:o,metadataFile:a}=Ot(t,e,r);n.push(i,o,a)}))})),n.push(...Object.values(t.plugins).map((e=>e.path))),n};export{Jt as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "textbrowser",
3
- "version": "0.42.5",
3
+ "version": "0.42.6",
4
4
  "description": "Multilinear text browser",
5
5
  "type": "module",
6
6
  "main": "dist/index-es.min.js",
@@ -127,8 +127,6 @@ export const getWorkData = async function ({
127
127
  : process.cwd() + '/'
128
128
  );
129
129
 
130
- console.log('cwd-textbrowser', cwd);
131
-
132
130
  const [schemaObj, pluginObjects] = await Promise.all([
133
131
  getMetadata(schemaFile, schemaProperty, basePath),
134
132
  getPlugins