🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@esgettext/runtime

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esgettext/runtime - npm Package Compare versions

Comparing version
1.3.6
to
1.3.7
+1
-1
dist/esgettext.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).esgettext={})}(this,(function(t){"use strict";let e=!1;function r(t){return void 0!==t&&(e=t),e}let n=["C"];function o(t){return void 0!==t&&(n=t),n}function a(t,e,r,n){return new(r||(r=Promise))((function(o,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function i(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,i)}c((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class s{loadFile(t){return new Promise(((e,r)=>{const n=new XMLHttpRequest;n.responseType="arraybuffer",n.open("GET",t,!0),n.onload=()=>{4===n.readyState&&200===n.status?e(n.response):r(new Error("get failed with status "+n.status))},n.onerror=t=>r(t),n.send()}))}}function i(t){return 1===t?0:1}class c{constructor(t,e="utf-8"){this.array=t,this.decoder=new TextDecoder(e),this._encoding=e}get encoding(){return this._encoding}set encoding(t){this.decoder=new TextDecoder(t),this._encoding=t}readUInt32BE(t=0){if(t+4>this.array.byteLength+this.array.byteOffset)throw new Error("read past array end");return(this.array[t]<<24>>>0|this.array[t+1]<<16|this.array[t+2]<<8|this.array[t+3])>>>0}readUInt32LE(t=0){if(t+4>this.array.byteLength+this.array.byteOffset)throw new Error("read past array end");return(this.array[t+3]<<24>>>0|this.array[t+2]<<16|this.array[t+1]<<8|this.array[t])>>>0}readString(t=0,e){if(t+e>this.array.byteLength+this.array.byteOffset)throw new Error("read past array end");return void 0===e&&(e=this.array.byteLength-t),this.decoder.decode(this.array.slice(t,t+e))}}function l(t){const e={major:0,minor:0,entries:{},pluralFunction:i};let r=0;const n=new c(new Uint8Array(t),"ascii"),o=n.readUInt32LE(r);let a;if(2500072158===o)a=(t,e)=>t.readUInt32LE(e);else{if(3725722773!==o)throw new Error(`invalid MO magic 0x${o.toString(16)}`);a=(t,e)=>t.readUInt32BE(e)}r+=4;const s=a(n,r)>>16;if(r+=4,s>0)throw new Error(`unsupported major revision ${s}`);const l=a(n,r);r+=4;const u=a(n,r);r+=4;const g=a(n,r);r=u;const d=[];for(let t=0;t<l;++t){const t=a(n,r);r+=4;const e=a(n,r);r+=4,d.push([t,e])}r=g;const p=[];for(let t=0;t<l;++t){const t=a(n,r);r+=4;const e=a(n,r);r+=4,p.push([t,e])}const h={};for(let t=0;t<l;++t){const o=d[t];let a=o[0];r=o[1];const s=n.readString(r,a).split("\0")[0],i=p[t];a=i[0],r=i[1];const c=n.readString(r,a).split("\0");let l,u;if(0===t&&""===s){l=c[0].split("\n");for(let t=0;t<l.length;++t)""!==l[t]&&(u=l[t].split(/[ \t]*:[ \t]*/),h[u[0].toLowerCase()]=u[1]);if(void 0!==h["content-type"]){const t=h["content-type"].replace(/.*=/,"");t!==h["content-type"]&&(n.encoding=t)}}e.entries[s]=c}return e}function u(t){if(null==t)throw new Error("catalog is either null or undefined");const e=t;if(e.constructor!==Object)throw new Error("catalog must be a dictionary");if(!Object.prototype.hasOwnProperty.call(e,"entries"))throw new Error("catalog.entries does not exist");const r=e.entries;if(null==r)throw new Error("catalog.entries are not defined or null");if(r.constructor!==Object)throw new Error("catalog.entries must be a dictionary");for(const[t,e]of Object.entries(r))if(!Array.isArray(e))throw new Error(`catalog entry for key '${t}' is not an array`);return e}function g(t){const e=(new TextDecoder).decode(t);return u(JSON.parse(e))}function d(t){const e=(new TextDecoder).decode(t);return function(t){if(null==t)throw new Error("catalog is either null or undefined");const e=t;e.constructor;const r={major:0,minor:1,pluralFunction:()=>0,entries:{}};for(const[t,n]of Object.entries(e))r.entries[t]=[n.toString()];return r}(JSON.parse(e))}const p=new RegExp("^[a-z0-9]+(?:-[a-z0-9]+)*$","i"),h=new RegExp("^[a-z0-9]+(?:_[a-z0-9]+)*$","i");function f(t){let e="",r="";const n=t.includes("_");if(t=(t=t.replace(/@([a-z]+)$/i,((t,e)=>(r=e,"")))).replace(/\.([-0-9a-z]+)$/i,((t,r)=>(e=r,""))),n){if(!h.exec(t))return null}else if(!p.exec(t))return null;const o=n?"_":"-",a={tags:t.split(o),underscoreSeparator:n};return e.length&&(a.charset=e),r.length&&(a.modifier=r),a}class m{constructor(){}static getInstance(){return m.instance||(m.instance=new m),m.instance}static clear(){m.cache={}}static lookup(t,e){if(m.cache[t]){const r=m.cache[t];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null}static store(t,e,r){Promise.resolve(r)!==r&&(r=u(r)),m.cache[t]||(m.cache[t]={}),m.cache[t][e]=r}}function w(t,e){return a(this,void 0,void 0,(function*(){let r,n;r=new s,n="mo.json"===e?g:".json"===e?d:l;try{return n(yield r.loadFile(t))}catch(t){return null}}))}function y(t,e,r,n){return`${t}/${e}/LC_MESSAGES/${r}.${n}`}function x(t,e,r,n){return a(this,void 0,void 0,(function*(){if("object"==typeof e&&null!==e)return function(t,e,r){return a(this,void 0,void 0,(function*(){for(let n=0;n<t.length;++n){const o=t[n];if(Object.prototype.hasOwnProperty.call(e,o)&&Object.prototype.hasOwnProperty.call(e[o],"LC_MESSAGES")&&Object.prototype.hasOwnProperty.call(e[o].LC_MESSAGES,r))return e[o].LC_MESSAGES[r]}return null}))}(t,e,r);for(const o of t){const t=yield w(y(e,o,r,n),n);if(t)return t}return null}))}function v(t){if(!Object.prototype.hasOwnProperty.call(t.entries,""))return t;return t.entries[""][0].split("\n").forEach((e=>{const r=e.split(":");if("plural-forms"===r.shift().toLowerCase()){const e=r.join(":");try{t.pluralFunction=function(t){const e=t.replace(/[ \t\r\x0b\x0c]/g,"").replace(/;$/,"").split(/[<>!=]=|&&|\|\||[-!*/%+<>=?:;]/);for(let t=0;t<e.length;++t){const r=e[t].replace(/^\(+/,"").replace(/\)+$/,"");if("nplurals"!==r&&"plural"!==r&&"n"!==r&&null===/^[0-9]+$/.exec(r))throw new Error("invalid plural function")}return new Function("n","var nplurals = 1, plural = 0;"+t+"; return 0 + plural")}(e)}catch(e){t.pluralFunction=i}}})),t}function _(t,e,r,n){return a(this,void 0,void 0,(function*(){if("C"===n||"POSIX"===n)return{major:0,minor:0,pluralFunction:i,entries:{}};const o=function(t){const e=[],r=t.underscoreSeparator?"_":"-";let n=0;const o=void 0!==t.charset,a=void 0!==t.modifier,s=o?[t.charset]:[""];if(o){const e=t.charset,r=e.toUpperCase();r!==e&&s.push(r),s.push("")}for(;n<t.tags.length;++n){const o=t.tags.slice(0,n+1).join(r),i=new Array;s.forEach((e=>{let r=e.length?o+"."+e:o;a&&(r+="@"+t.modifier),i.push(r)})),e.push(i)}return e}(f(n)),s=yield function(t,e,r,n,o){return a(this,void 0,void 0,(function*(){const a={major:0,minor:0,pluralFunction:i,entries:{}},s=yield m.lookup(e,n);if(null!==s)return s;for(const e of t){const t=yield x(e,r,n,o);t&&(a.major=t.major,a.minor=t.minor,a.entries=Object.assign(Object.assign({},a.entries),t.entries))}return a}))}(o,n,e,t,r);return v(s),m.store(n,t,s),s}))}function b(t){var e;const r=void 0===t.msgctxt?t.msgid:t.msgctxt+""+t.msgid,n=t.catalog.entries[r],o=null!==(e=t.numItems)&&void 0!==e?e:1;if(n&&n.length){if(void 0===t.msgidPlural)return n[0];{let e=t.catalog.pluralFunction(o);if(e>=n.length){if(1===n.length)return n[0];e=i(o)}return n[e]}}if(void 0!==t.msgidPlural){if(1===t.catalog.pluralFunction(o))return t.msgidPlural}return t.msgid}m.cache={};const O="undefined"!=typeof process&&null!==process.versions&&null!==process.versions.node&&"win32"===process.platform?"\\":"/";function j(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r].toLowerCase()!==e[r].toLowerCase())return!1;return!0}class E{_(t){return b({msgid:t,catalog:this.catalog})}_n(t,e,r){return b({msgid:t,msgidPlural:e,numItems:r,catalog:this.catalog})}_p(t,e){return b({msgctxt:t,msgid:e,catalog:this.catalog})}_np(t,e,r,n){return b({msgctxt:t,msgid:e,msgidPlural:r,numItems:n,catalog:this.catalog})}_x(t,e){return E.expand(b({msgid:t,catalog:this.catalog}),e||{})}_nx(t,e,r,n){return E.expand(b({msgid:t,msgidPlural:e,numItems:r,catalog:this.catalog}),n||{})}_px(t,e,r){return E.expand(b({msgctxt:t,msgid:e,catalog:this.catalog}),r||{})}_npx(t,e,r,n,o){return E.expand(b({msgctxt:t,msgid:e,msgidPlural:r,numItems:n,catalog:this.catalog}),o||{})}static getCatalog(t,e){const r=m.lookup(t,e);return r&&Promise.resolve(r)!==r?r:{major:0,minor:0,pluralFunction:i,entries:{}}}_l(t,e){return b({msgid:e,catalog:E.getCatalog(t,this.textdomain())})}_ln(t,e,r,n){return b({msgid:e,msgidPlural:r,numItems:n,catalog:E.getCatalog(t,this.textdomain())})}_lp(t,e,r){return b({msgctxt:e,msgid:r,catalog:E.getCatalog(t,this.textdomain())})}_lnp(t,e,r,n,o){return b({msgctxt:e,msgid:r,msgidPlural:n,numItems:o,catalog:E.getCatalog(t,this.textdomain())})}_lx(t,e,r){const n=E.getCatalog(t,this.textdomain());return E.expand(b({msgid:e,catalog:n}),r||{})}_lnx(t,e,r,n,o){const a=E.getCatalog(t,this.textdomain());return E.expand(b({msgid:e,msgidPlural:r,numItems:n,catalog:a}),o||{})}_lpx(t,e,r,n){const o=E.getCatalog(t,this.textdomain());return E.expand(b({msgctxt:e,msgid:r,catalog:o}),n||{})}_lnpx(t,e,r,n,o,a){const s=E.getCatalog(t,this.textdomain());return E.expand(b({msgctxt:e,msgid:r,msgidPlural:n,numItems:o,catalog:s}),a||{})}static expand(t,e){return t.replace(/\{([a-zA-Z][0-9a-zA-Z]*)\}/g,((t,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:`{${r}}`))}static getInstance(t){if(null==t||""===t)throw new Error("Cannot instantiate TextDomain without a textdomain");if(Object.prototype.hasOwnProperty.call(E.domains,t))return E.domains[t];{const e=new E(t);return E.domains[t]=e,e.catalog={major:0,minor:0,pluralFunction:i,entries:{}},e}}static clearInstances(){E.boundDomains={}}static forgetInstances(){E.clearInstances(),E.domains={}}static get locale(){return E._locale}static set locale(t){const e=t.toUpperCase();if("POSIX"===e||"C"===e)return void(this._locale="POSIX");const n=f(t);if(!n)throw new Error("invalid locale identifier");if(r())return void(this._locale=t);n.tags[0]=n.tags[0].toLowerCase(),n.tags.length>1&&(n.tags[1]=n.tags[1].toUpperCase());const o=n.underscoreSeparator?"_":"-";this._locale=n.tags.join(o),void 0!==n.charset&&(this._locale+="."+n.charset),void 0!==n.modifier&&(this._locale+="@"+n.modifier)}constructor(t){this._catalogFormat="mo.json",this.catalog=void 0,this.domain=t;const e="The property 'locale' is not an instance property but static. Use 'Textdomain.locale' instead!";Object.defineProperty(this,"locale",{get:()=>{throw new Error(e)},set:()=>{throw new Error(e)},enumerable:!0,configurable:!0})}textdomain(){return this.domain}bindtextdomain(t){return void 0!==t&&(E.boundDomains[this.domain]=t),E.boundDomains[this.domain]}resolve(t){return a(this,void 0,void 0,(function*(){const e=[this.resolve1(t)];for(const r in E.domains)Object.prototype.hasOwnProperty.call(E.domains,r)&&E.domains[r]!==this&&e.push(E.domains[r].resolve1(t));return Promise.all(e).then((t=>new Promise((e=>e(t[0])))))}))}resolve1(t){return a(this,void 0,void 0,(function*(){let e=this.bindtextdomain();if(null==e){e=(r()?["","assets","locale"]:[".","locale"]).join(O)}const n=t||E.locale;return _(this.domain,e,this.catalogFormat,n).then((e=>(t||(this.catalog=e),new Promise((t=>t(e))))))}))}get catalogFormat(){return this._catalogFormat}set catalogFormat(t){if("mo.json"===(t=t.toLowerCase()))this._catalogFormat="mo.json";else{if("mo"!==t)throw new Error(`unsupported format ${t}`);this._catalogFormat="mo"}}static userLocales(){return o()}static selectLocale(t,e){return function(t,e){let r="";for(let n=0;n<e.length;++n){const o=f(e[n]);if(o)for(let e=0;e<t.length;++e){const n=f(t[e]);if(n){if(j(o.tags,n.tags))return t[e];r.length||o.tags[0].toLowerCase()!==n.tags[0].toLowerCase()||(r=t[e])}}}return r.length?r:"C"}(t,null!=e?e:E.userLocales())}static N_(t){return t}N_(t){return t}N_x(t,e){return E.expand(t,null!=e?e:{})}static N_x(t,e){return E.expand(t,null!=e?e:{})}N_p(t,e){return e}static N_p(t,e){return e}N_px(t,e,r){return E.expand(e,null!=r?r:{})}static N_px(t,e,r){return E.expand(e,null!=r?r:{})}}E.domains={},E.boundDomains={},E._locale="C",r(!0);const C=new Array;window.navigator.languages&&C.push(...window.navigator.languages),void 0!==window.navigator.language&&C.push(window.navigator.language);const P=window.navigator;Object.prototype.hasOwnProperty.call(P,"userLanguage")&&P.userLanguage&&C.push(P.userLanguage),Object.prototype.hasOwnProperty.call(P,"browserLanguage")&&P.browserLanguage&&C.push(P.browserLanguage),Object.prototype.hasOwnProperty.call(P,"systemLanguage")&&P.systemLanguage&&C.push(P.systemLanguage),o(C),t.CatalogCache=m,t.Textdomain=E,t.parseJsonCatalog=d,t.parseMoCatalog=l,t.parseMoJsonCatalog=g}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).esgettext={})}(this,function(t){"use strict";let e=!1;function r(t){return void 0!==t&&(e=t),e}let n=["C"];function o(t){return void 0!==t&&(n=t),n}function a(t,e,r,n){return new(r||(r=Promise))(function(o,a){function s(t){try{c(n.next(t))}catch(t){a(t)}}function i(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,i)}c((n=n.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class s{loadFile(t){return new Promise((e,r)=>{const n=new XMLHttpRequest;n.responseType="arraybuffer",n.open("GET",t,!0),n.onload=()=>{4===n.readyState&&200===n.status?e(n.response):r(new Error("get failed with status "+n.status))},n.onerror=t=>r(t),n.send()})}}function i(t){return 1===t?0:1}class c{constructor(t,e="utf-8"){this.array=t,this.decoder=new TextDecoder(e),this._encoding=e}get encoding(){return this._encoding}set encoding(t){this.decoder=new TextDecoder(t),this._encoding=t}readUInt32BE(t=0){if(t+4>this.array.byteLength+this.array.byteOffset)throw new Error("read past array end");return(this.array[t]<<24>>>0|this.array[t+1]<<16|this.array[t+2]<<8|this.array[t+3])>>>0}readUInt32LE(t=0){if(t+4>this.array.byteLength+this.array.byteOffset)throw new Error("read past array end");return(this.array[t+3]<<24>>>0|this.array[t+2]<<16|this.array[t+1]<<8|this.array[t])>>>0}readString(t=0,e){if(t+e>this.array.byteLength+this.array.byteOffset)throw new Error("read past array end");return void 0===e&&(e=this.array.byteLength-t),this.decoder.decode(this.array.slice(t,t+e))}}function l(t){const e={major:0,minor:0,entries:{},pluralFunction:i};let r=0;const n=new c(new Uint8Array(t),"ascii"),o=n.readUInt32LE(r);let a;if(2500072158===o)a=(t,e)=>t.readUInt32LE(e);else{if(3725722773!==o)throw new Error(`invalid MO magic 0x${o.toString(16)}`);a=(t,e)=>t.readUInt32BE(e)}r+=4;const s=a(n,r)>>16;if(r+=4,s>0)throw new Error(`unsupported major revision ${s}`);const l=a(n,r);r+=4;const u=a(n,r);r+=4;const g=a(n,r);r=u;const d=[];for(let t=0;t<l;++t){const t=a(n,r);r+=4;const e=a(n,r);r+=4,d.push([t,e])}r=g;const p=[];for(let t=0;t<l;++t){const t=a(n,r);r+=4;const e=a(n,r);r+=4,p.push([t,e])}const h={};for(let t=0;t<l;++t){const o=d[t];let a=o[0];r=o[1];const s=n.readString(r,a).split("\0")[0],i=p[t];a=i[0],r=i[1];const c=n.readString(r,a).split("\0");let l,u;if(0===t&&""===s){l=c[0].split("\n");for(let t=0;t<l.length;++t)""!==l[t]&&(u=l[t].split(/[ \t]*:[ \t]*/),h[u[0].toLowerCase()]=u[1]);if(void 0!==h["content-type"]){const t=h["content-type"].replace(/.*=/,"");t!==h["content-type"]&&(n.encoding=t)}}e.entries[s]=c}return e}function u(t){if(null==t)throw new Error("catalog is either null or undefined");const e=t;if(e.constructor!==Object)throw new Error("catalog must be a dictionary");if(!Object.prototype.hasOwnProperty.call(e,"entries"))throw new Error("catalog.entries does not exist");const r=e.entries;if(null==r)throw new Error("catalog.entries are not defined or null");if(r.constructor!==Object)throw new Error("catalog.entries must be a dictionary");for(const[t,e]of Object.entries(r))if(!Array.isArray(e))throw new Error(`catalog entry for key '${t}' is not an array`);return e}function g(t){const e=(new TextDecoder).decode(t);return u(JSON.parse(e))}function d(t){const e=(new TextDecoder).decode(t);return function(t){if(null==t)throw new Error("catalog is either null or undefined");const e=t;e.constructor;const r={major:0,minor:1,pluralFunction:()=>0,entries:{}};for(const[t,n]of Object.entries(e))r.entries[t]=[n.toString()];return r}(JSON.parse(e))}const p=new RegExp("^[a-z0-9]+(?:-[a-z0-9]+)*$","i"),h=new RegExp("^[a-z0-9]+(?:_[a-z0-9]+)*$","i");function f(t){let e="",r="";const n=t.includes("_");if(t=(t=t.replace(/@([a-z]+)$/i,(t,e)=>(r=e,""))).replace(/\.([-0-9a-z]+)$/i,(t,r)=>(e=r,"")),n){if(!h.exec(t))return null}else if(!p.exec(t))return null;const o=n?"_":"-",a={tags:t.split(o),underscoreSeparator:n};return e.length&&(a.charset=e),r.length&&(a.modifier=r),a}class m{constructor(){}static getInstance(){return m.instance||(m.instance=new m),m.instance}static clear(){m.cache={}}static lookup(t,e){if(m.cache[t]){const r=m.cache[t];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null}static store(t,e,r){Promise.resolve(r)!==r&&(r=u(r)),m.cache[t]||(m.cache[t]={}),m.cache[t][e]=r}}function w(t,e){return a(this,void 0,void 0,function*(){let r,n;r=new s,n="mo.json"===e?g:".json"===e?d:l;try{return n(yield r.loadFile(t))}catch(t){return null}})}function y(t,e,r,n){return`${t}/${e}/LC_MESSAGES/${r}.${n}`}function x(t,e,r,n){return a(this,void 0,void 0,function*(){if("object"==typeof e&&null!==e)return function(t,e,r){return a(this,void 0,void 0,function*(){for(let n=0;n<t.length;++n){const o=t[n];if(Object.prototype.hasOwnProperty.call(e,o)&&Object.prototype.hasOwnProperty.call(e[o],"LC_MESSAGES")&&Object.prototype.hasOwnProperty.call(e[o].LC_MESSAGES,r))return e[o].LC_MESSAGES[r]}return null})}(t,e,r);for(const o of t){const t=yield w(y(e,o,r,n),n);if(t)return t}return null})}function v(t){if(!Object.prototype.hasOwnProperty.call(t.entries,""))return t;return t.entries[""][0].split("\n").forEach(e=>{const r=e.split(":");if("plural-forms"===r.shift().toLowerCase()){const e=r.join(":");try{t.pluralFunction=function(t){const e=t.replace(/[ \t\r\x0b\x0c]/g,"").replace(/;$/,"").split(/[<>!=]=|&&|\|\||[-!*/%+<>=?:;]/);for(let t=0;t<e.length;++t){const r=e[t].replace(/^\(+/,"").replace(/\)+$/,"");if("nplurals"!==r&&"plural"!==r&&"n"!==r&&null===/^[0-9]+$/.exec(r))throw new Error("invalid plural function")}return new Function("n","var nplurals = 1, plural = 0;"+t+"; return 0 + plural")}(e)}catch(e){t.pluralFunction=i}}}),t}function _(t,e,r,n){return a(this,void 0,void 0,function*(){if("C"===n||"POSIX"===n)return{major:0,minor:0,pluralFunction:i,entries:{}};const o=function(t){const e=[],r=t.underscoreSeparator?"_":"-";let n=0;const o=void 0!==t.charset,a=void 0!==t.modifier,s=o?[t.charset]:[""];if(o){const e=t.charset,r=e.toUpperCase();r!==e&&s.push(r),s.push("")}for(;n<t.tags.length;++n){const o=t.tags.slice(0,n+1).join(r),i=new Array;s.forEach(e=>{let r=e.length?o+"."+e:o;a&&(r+="@"+t.modifier),i.push(r)}),e.push(i)}return e}(f(n)),s=yield function(t,e,r,n,o){return a(this,void 0,void 0,function*(){const a={major:0,minor:0,pluralFunction:i,entries:{}},s=yield m.lookup(e,n);if(null!==s)return s;for(const e of t){const t=yield x(e,r,n,o);t&&(a.major=t.major,a.minor=t.minor,a.entries=Object.assign(Object.assign({},a.entries),t.entries))}return a})}(o,n,e,t,r);return v(s),m.store(n,t,s),s})}function b(t){var e;const r=void 0===t.msgctxt?t.msgid:t.msgctxt+""+t.msgid,n=t.catalog.entries[r],o=null!==(e=t.numItems)&&void 0!==e?e:1;if(n&&n.length){if(void 0===t.msgidPlural)return n[0];{let e=t.catalog.pluralFunction(o);if(e>=n.length){if(1===n.length)return n[0];e=i(o)}return n[e]}}if(void 0!==t.msgidPlural){if(1===t.catalog.pluralFunction(o))return t.msgidPlural}return t.msgid}m.cache={};const O="undefined"!=typeof process&&null!==process.versions&&null!==process.versions.node&&"win32"===process.platform?"\\":"/";function j(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r].toLowerCase()!==e[r].toLowerCase())return!1;return!0}class E{_(t){return b({msgid:t,catalog:this.catalog})}_n(t,e,r){return b({msgid:t,msgidPlural:e,numItems:r,catalog:this.catalog})}_p(t,e){return b({msgctxt:t,msgid:e,catalog:this.catalog})}_np(t,e,r,n){return b({msgctxt:t,msgid:e,msgidPlural:r,numItems:n,catalog:this.catalog})}_x(t,e){return E.expand(b({msgid:t,catalog:this.catalog}),e||{})}_nx(t,e,r,n){return E.expand(b({msgid:t,msgidPlural:e,numItems:r,catalog:this.catalog}),n||{})}_px(t,e,r){return E.expand(b({msgctxt:t,msgid:e,catalog:this.catalog}),r||{})}_npx(t,e,r,n,o){return E.expand(b({msgctxt:t,msgid:e,msgidPlural:r,numItems:n,catalog:this.catalog}),o||{})}static getCatalog(t,e){const r=m.lookup(t,e);return r&&Promise.resolve(r)!==r?r:{major:0,minor:0,pluralFunction:i,entries:{}}}_l(t,e){return b({msgid:e,catalog:E.getCatalog(t,this.textdomain())})}_ln(t,e,r,n){return b({msgid:e,msgidPlural:r,numItems:n,catalog:E.getCatalog(t,this.textdomain())})}_lp(t,e,r){return b({msgctxt:e,msgid:r,catalog:E.getCatalog(t,this.textdomain())})}_lnp(t,e,r,n,o){return b({msgctxt:e,msgid:r,msgidPlural:n,numItems:o,catalog:E.getCatalog(t,this.textdomain())})}_lx(t,e,r){const n=E.getCatalog(t,this.textdomain());return E.expand(b({msgid:e,catalog:n}),r||{})}_lnx(t,e,r,n,o){const a=E.getCatalog(t,this.textdomain());return E.expand(b({msgid:e,msgidPlural:r,numItems:n,catalog:a}),o||{})}_lpx(t,e,r,n){const o=E.getCatalog(t,this.textdomain());return E.expand(b({msgctxt:e,msgid:r,catalog:o}),n||{})}_lnpx(t,e,r,n,o,a){const s=E.getCatalog(t,this.textdomain());return E.expand(b({msgctxt:e,msgid:r,msgidPlural:n,numItems:o,catalog:s}),a||{})}static expand(t,e){return t.replace(/\{([a-zA-Z][0-9a-zA-Z]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:`{${r}}`)}static getInstance(t){if(null==t||""===t)throw new Error("Cannot instantiate TextDomain without a textdomain");if(Object.prototype.hasOwnProperty.call(E.domains,t))return E.domains[t];{const e=new E(t);return E.domains[t]=e,e.catalog={major:0,minor:0,pluralFunction:i,entries:{}},e}}static clearInstances(){E.boundDomains={}}static forgetInstances(){E.clearInstances(),E.domains={}}static get locale(){return E._locale}static set locale(t){const e=t.toUpperCase();if("POSIX"===e||"C"===e)return void(this._locale="POSIX");const n=f(t);if(!n)throw new Error("invalid locale identifier");if(r())return void(this._locale=t);n.tags[0]=n.tags[0].toLowerCase(),n.tags.length>1&&(n.tags[1]=n.tags[1].toUpperCase());const o=n.underscoreSeparator?"_":"-";this._locale=n.tags.join(o),void 0!==n.charset&&(this._locale+="."+n.charset),void 0!==n.modifier&&(this._locale+="@"+n.modifier)}constructor(t){this._catalogFormat="mo.json",this.catalog=void 0,this.domain=t;const e="The property 'locale' is not an instance property but static. Use 'Textdomain.locale' instead!";Object.defineProperty(this,"locale",{get:()=>{throw new Error(e)},set:()=>{throw new Error(e)},enumerable:!0,configurable:!0})}textdomain(){return this.domain}bindtextdomain(t){return void 0!==t&&(E.boundDomains[this.domain]=t),E.boundDomains[this.domain]}resolve(t){return a(this,void 0,void 0,function*(){const e=[this.resolve1(t)];for(const r in E.domains)Object.prototype.hasOwnProperty.call(E.domains,r)&&E.domains[r]!==this&&e.push(E.domains[r].resolve1(t));return Promise.all(e).then(t=>new Promise(e=>e(t[0])))})}resolve1(t){return a(this,void 0,void 0,function*(){let e=this.bindtextdomain();if(null==e){e=(r()?["","assets","locale"]:[".","locale"]).join(O)}const n=t||E.locale;return _(this.domain,e,this.catalogFormat,n).then(e=>(t||(this.catalog=e),new Promise(t=>t(e))))})}get catalogFormat(){return this._catalogFormat}set catalogFormat(t){if("mo.json"===(t=t.toLowerCase()))this._catalogFormat="mo.json";else{if("mo"!==t)throw new Error(`unsupported format ${t}`);this._catalogFormat="mo"}}static userLocales(){return o()}static selectLocale(t,e){return function(t,e){let r="";for(let n=0;n<e.length;++n){const o=f(e[n]);if(o)for(let e=0;e<t.length;++e){const n=f(t[e]);if(n){if(j(o.tags,n.tags))return t[e];r.length||o.tags[0].toLowerCase()!==n.tags[0].toLowerCase()||(r=t[e])}}}return r.length?r:"C"}(t,null!=e?e:E.userLocales())}static N_(t){return t}N_(t){return t}N_x(t,e){return E.expand(t,null!=e?e:{})}static N_x(t,e){return E.expand(t,null!=e?e:{})}N_p(t,e){return e}static N_p(t,e){return e}N_px(t,e,r){return E.expand(e,null!=r?r:{})}static N_px(t,e,r){return E.expand(e,null!=r?r:{})}}E.domains={},E.boundDomains={},E._locale="C",r(!0);const C=new Array;window.navigator.languages&&C.push(...window.navigator.languages),void 0!==window.navigator.language&&C.push(window.navigator.language);const P=window.navigator;Object.prototype.hasOwnProperty.call(P,"userLanguage")&&P.userLanguage&&C.push(P.userLanguage),Object.prototype.hasOwnProperty.call(P,"browserLanguage")&&P.browserLanguage&&C.push(P.browserLanguage),Object.prototype.hasOwnProperty.call(P,"systemLanguage")&&P.systemLanguage&&C.push(P.systemLanguage),o(C),t.CatalogCache=m,t.Textdomain=E,t.parseJsonCatalog=d,t.parseMoCatalog=l,t.parseMoJsonCatalog=g});
//# sourceMappingURL=esgettext.min.js.map
{
"name": "@esgettext/runtime",
"version": "1.3.6",
"version": "1.3.7",
"description": "A gettext-like translation runtime for JavaScript aka EcmaScript",

@@ -76,22 +76,22 @@ "keywords": [

"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-replace": "^6.0.1",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@tsconfig/recommended": "^1.0.8",
"eslint": "^9.16.0",
"jest": "^29.7.0",
"lint-staged": "^15.2.10",
"rimraf": "^6.0.1",
"rollup": "^4.28.0",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"@rollup/plugin-typescript": "^12.3.0",
"@tsconfig/recommended": "^1.0.13",
"eslint": "^9.39.2",
"jest": "^30.2.0",
"lint-staged": "^16.2.7",
"rimraf": "^6.1.2",
"rollup": "^4.57.1",
"ts-jest": "^29.4.6",
"ts-loader": "^9.5.4",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0",
"webpack-cli": "^5.1.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.54.0",
"webpack-cli": "^6.0.1",
"xhr-mock": "^2.5.1"
},
"gitHead": "5eab231f046e32d4a6484aa396520feeadb2cdd5"
"gitHead": "d0b5fd5b3741acd6ba6ee4cc9bca6767f92279d1"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display