generaltranslation 6.1.9 โ†’ 6.1.11-alpha.1

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/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ declare class GT {
27
27
  * @param {string} [params.projectId=''] - The project ID for the translation service.
28
28
  * @param {string} [params.baseUrl='https://api.gtx.dev'] - The base URL for the translation service.
29
29
  */
30
- constructor({ apiKey, devApiKey, sourceLocale, projectId, baseUrl }?: GTConstructorParams);
30
+ constructor({ apiKey, devApiKey, sourceLocale, projectId, baseUrl, }?: GTConstructorParams);
31
31
  /**
32
32
  * Translates a string or an array of strings/variables into a target locale.
33
33
  * If `metadata.save` is provided, the translation is cached for use in a public project.
@@ -48,15 +48,15 @@ declare class GT {
48
48
  [key: string]: any;
49
49
  }): Promise<ContentTranslationResult | TranslationError>;
50
50
  /**
51
- * Translates JSX elements into a given locale.
52
- *
53
- * @param {Object} params - The parameters for the translation.
54
- * @param {JsxChildren} params.source - The JSX children content to be translated.
55
- * @param {string} params.locale - The target locale for the translation.
56
- * @param {Object} params.metadata - Additional metadata for the translation process.
57
- *
58
- * @returns {Promise<JsxTranslationResult | TranslationError>} - A promise that resolves to the translated content.
59
- */
51
+ * Translates JSX elements into a given locale.
52
+ *
53
+ * @param {Object} params - The parameters for the translation.
54
+ * @param {JsxChildren} params.source - The JSX children content to be translated.
55
+ * @param {string} params.locale - The target locale for the translation.
56
+ * @param {Object} params.metadata - Additional metadata for the translation process.
57
+ *
58
+ * @returns {Promise<JsxTranslationResult | TranslationError>} - A promise that resolves to the translated content.
59
+ */
60
60
  translateJsx(source: JsxChildren, locale: string, metadata?: {
61
61
  context?: string;
62
62
  id?: string;
@@ -113,7 +113,7 @@ export declare function getLocaleName(locale: string, defaultLocale?: string): s
113
113
  * @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
114
114
  * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "ร–sterreichisches Deutsch".
115
115
  * @property {string} emoji - The emoji associated with the locale's region, if applicable.
116
- */
116
+ */
117
117
  export declare function getLocaleProperties(locale: string, defaultLocale?: string): {
118
118
  code: string;
119
119
  name: string;
@@ -144,7 +144,7 @@ export declare function getLocaleProperties(locale: string, defaultLocale?: stri
144
144
  * @param code - A string representing the locale code (e.g., 'en-US', 'fr-CA').
145
145
  * @param custom - An optional custom mapping of locale codes to emojis.
146
146
  * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.
147
- */
147
+ */
148
148
  export declare function getLocaleEmoji(locale: string, custom?: Record<string, string>): string;
149
149
  /**
150
150
  * Checks if a given BCP 47 locale code is valid.
@@ -182,7 +182,7 @@ export declare function isSameDialect(...locales: (string | string[])[]): boolea
182
182
  *
183
183
  * @param {string[]} locales - The BCP 47 locale codes to compare.
184
184
  * @returns {boolean} True if all BCP 47 codes represent the same locale, false otherwise.
185
- */
185
+ */
186
186
  export declare function isSameLanguage(...locales: (string | string[])[]): boolean;
187
187
  /**
188
188
  * Formats a number according to the specified locales and options.
@@ -1,2 +1,2 @@
1
- var e=function(){return e=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},e.apply(this,arguments)};function n(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var r="en-US",o=6e4,i=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],a=function(e){try{var n=new Intl.Locale(e),t=n.language,o=n.region,a=n.script;if(e.split("-").length!==(u=1,o&&(u+=1),a&&(u+=1),u))return!1;if(new Intl.DisplayNames([r],{type:"language"}).of(t)===t)return!1;if(o)if(new Intl.DisplayNames([r],{type:"region"}).of(o)===o)return!1;if(a)if(new Intl.DisplayNames([r],{type:"script"}).of(a)===a&&!i.includes(a))return!1;return!0}catch(e){return!1}var u},u=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(n){return e}};function c(){for(var e,n,t,r,o,i,a,c,l,s,f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];try{for(var p=f.flat().map(u),d=0;d<p.length;d++)for(var y=d+1;y<p.length;y++)if(e=p[d],n=p[y],t=void 0,r=void 0,o=void 0,i=void 0,a=void 0,c=void 0,l=void 0,s=void 0,t=new Intl.Locale(e),r=t.language,o=t.region,i=t.script,a=new Intl.Locale(n),c=a.language,l=a.region,s=a.script,r!==c||o&&l&&o!==l||i&&s&&i!==s)return!1;return!0}catch(e){return console.error(e),!1}}function l(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=e.flat().map((function(e){return new Intl.Locale(e).language}));return t.every((function(e){return e===t[0]}))}catch(e){return console.error(e),!1}}function s(r,i,a,u){return n(this,void 0,void 0,(function(){var n,c,l,s,f,v,p,d;return t(this,(function(t){switch(t.label){case 0:n=new AbortController,c=n.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return n.abort()}),l),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/content"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:i,targetLocale:a,metadata:u}),signal:c})];case 2:return s=t.sent(),[3,4];case 3:if("AbortError"===(null==(f=t.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(v=Error.bind,d=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(v.apply(Error,[void 0,d.apply(p,[t.sent()])]));case 6:return[4,s.json()];case 7:return[2,t.sent()]}}))}))}function f(r,i,a,u){return n(this,void 0,void 0,(function(){var n,c,l,s,f,v,p,d;return t(this,(function(t){switch(t.label){case 0:n=new AbortController,c=n.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return n.abort()}),l),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/react"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:i,targetLocale:a,metadata:u}),signal:c})];case 2:return s=t.sent(),[3,4];case 3:if("AbortError"===(null==(f=t.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(v=Error.bind,d=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(v.apply(Error,[void 0,d.apply(p,[t.sent()])]));case 6:return[4,s.json()];case 7:return[2,t.sent()]}}))}))}function v(e,n){if(void 0===n&&(n={}),!a(e))return d;if(n[e=u(e)])return n[e];var t=new Intl.Locale(e),r=t.region;if(r&&m[r])return m[r];var o=t.maximize(),i=o.region||"";return y[o.language]||m[i]||d}var p="๐ŸŒ",d=p,y={ca:p,eu:p,ku:p,bo:"๐ŸŒ",ug:"๐ŸŒ",gd:"๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ",cy:"๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ",gv:"๐Ÿ‡ฎ๐Ÿ‡ฒ",grc:"๐Ÿบ"},m={AF:"๐Ÿ‡ฆ๐Ÿ‡ซ",AX:"๐Ÿ‡ฆ๐Ÿ‡ฝ",AL:"๐Ÿ‡ฆ๐Ÿ‡ฑ",DZ:"๐Ÿ‡ฉ๐Ÿ‡ฟ",AS:"๐Ÿ‡ฆ๐Ÿ‡ธ",AD:"๐Ÿ‡ฆ๐Ÿ‡ฉ",AO:"๐Ÿ‡ฆ๐Ÿ‡ด",AI:"๐Ÿ‡ฆ๐Ÿ‡ฎ",AQ:"๐Ÿ‡ฆ๐Ÿ‡ถ",AG:"๐Ÿ‡ฆ๐Ÿ‡ฌ",AR:"๐Ÿ‡ฆ๐Ÿ‡ท",AM:"๐Ÿ‡ฆ๐Ÿ‡ฒ",AW:"๐Ÿ‡ฆ๐Ÿ‡ผ",AU:"๐Ÿ‡ฆ๐Ÿ‡บ",AT:"๐Ÿ‡ฆ๐Ÿ‡น",AZ:"๐Ÿ‡ฆ๐Ÿ‡ฟ",BS:"๐Ÿ‡ง๐Ÿ‡ธ",BH:"๐Ÿ‡ง๐Ÿ‡ญ",BD:"๐Ÿ‡ง๐Ÿ‡ฉ",BB:"๐Ÿ‡ง๐Ÿ‡ง",BY:"๐Ÿ‡ง๐Ÿ‡พ",BE:"๐Ÿ‡ง๐Ÿ‡ช",BZ:"๐Ÿ‡ง๐Ÿ‡ฟ",BJ:"๐Ÿ‡ง๐Ÿ‡ฏ",BM:"๐Ÿ‡ง๐Ÿ‡ฒ",BT:"๐Ÿ‡ง๐Ÿ‡น",BO:"๐Ÿ‡ง๐Ÿ‡ด",BQ:"๐Ÿ‡ง๐Ÿ‡ถ",BA:"๐Ÿ‡ง๐Ÿ‡ฆ",BW:"๐Ÿ‡ง๐Ÿ‡ผ",BV:"๐Ÿ‡ง๐Ÿ‡ป",BR:"๐Ÿ‡ง๐Ÿ‡ท",IO:"๐Ÿ‡ฎ๐Ÿ‡ด",BN:"๐Ÿ‡ง๐Ÿ‡ณ",BG:"๐Ÿ‡ง๐Ÿ‡ฌ",BF:"๐Ÿ‡ง๐Ÿ‡ซ",BI:"๐Ÿ‡ง๐Ÿ‡ฎ",CV:"๐Ÿ‡จ๐Ÿ‡ป",KH:"๐Ÿ‡ฐ๐Ÿ‡ญ",CM:"๐Ÿ‡จ๐Ÿ‡ฒ",CA:"๐Ÿ‡จ๐Ÿ‡ฆ",KY:"๐Ÿ‡ฐ๐Ÿ‡พ",CF:"๐Ÿ‡จ๐Ÿ‡ซ",TD:"๐Ÿ‡น๐Ÿ‡ฉ",CL:"๐Ÿ‡จ๐Ÿ‡ฑ",CN:"๐Ÿ‡จ๐Ÿ‡ณ",CX:"๐Ÿ‡จ๐Ÿ‡ฝ",CC:"๐Ÿ‡จ๐Ÿ‡จ",CO:"๐Ÿ‡จ๐Ÿ‡ด",KM:"๐Ÿ‡ฐ๐Ÿ‡ฒ",CD:"๐Ÿ‡จ๐Ÿ‡ฉ",CG:"๐Ÿ‡จ๐Ÿ‡ฌ",CK:"๐Ÿ‡จ๐Ÿ‡ฐ",CR:"๐Ÿ‡จ๐Ÿ‡ท",CI:"๐Ÿ‡จ๐Ÿ‡ฎ",HR:"๐Ÿ‡ญ๐Ÿ‡ท",CU:"๐Ÿ‡จ๐Ÿ‡บ",CW:"๐Ÿ‡จ๐Ÿ‡ผ",CY:"๐Ÿ‡จ๐Ÿ‡พ",CZ:"๐Ÿ‡จ๐Ÿ‡ฟ",DK:"๐Ÿ‡ฉ๐Ÿ‡ฐ",DJ:"๐Ÿ‡ฉ๐Ÿ‡ฏ",DM:"๐Ÿ‡ฉ๐Ÿ‡ฒ",DO:"๐Ÿ‡ฉ๐Ÿ‡ด",EC:"๐Ÿ‡ช๐Ÿ‡จ",EG:"๐Ÿ‡ช๐Ÿ‡ฌ",SV:"๐Ÿ‡ธ๐Ÿ‡ป",GQ:"๐Ÿ‡ฌ๐Ÿ‡ถ",ER:"๐Ÿ‡ช๐Ÿ‡ท",EE:"๐Ÿ‡ช๐Ÿ‡ช",SZ:"๐Ÿ‡ธ๐Ÿ‡ฟ",ET:"๐Ÿ‡ช๐Ÿ‡น",FK:"๐Ÿ‡ซ๐Ÿ‡ฐ",FO:"๐Ÿ‡ซ๐Ÿ‡ด",FJ:"๐Ÿ‡ซ๐Ÿ‡ฏ",FI:"๐Ÿ‡ซ๐Ÿ‡ฎ",FR:"๐Ÿ‡ซ๐Ÿ‡ท",GF:"๐Ÿ‡ฌ๐Ÿ‡ซ",PF:"๐Ÿ‡ต๐Ÿ‡ซ",TF:"๐Ÿ‡น๐Ÿ‡ซ",GA:"๐Ÿ‡ฌ๐Ÿ‡ฆ",GM:"๐Ÿ‡ฌ๐Ÿ‡ฒ",GE:"๐Ÿ‡ฌ๐Ÿ‡ช",DE:"๐Ÿ‡ฉ๐Ÿ‡ช",GH:"๐Ÿ‡ฌ๐Ÿ‡ญ",GI:"๐Ÿ‡ฌ๐Ÿ‡ฎ",GR:"๐Ÿ‡ฌ๐Ÿ‡ท",GL:"๐Ÿ‡ฌ๐Ÿ‡ฑ",GD:"๐Ÿ‡ฌ๐Ÿ‡ฉ",GP:"๐Ÿ‡ฌ๐Ÿ‡ต",GU:"๐Ÿ‡ฌ๐Ÿ‡บ",GT:"๐Ÿ‡ฌ๐Ÿ‡น",GG:"๐Ÿ‡ฌ๐Ÿ‡ฌ",GN:"๐Ÿ‡ฌ๐Ÿ‡ณ",GW:"๐Ÿ‡ฌ๐Ÿ‡ผ",GY:"๐Ÿ‡ฌ๐Ÿ‡พ",HT:"๐Ÿ‡ญ๐Ÿ‡น",HM:"๐Ÿ‡ญ๐Ÿ‡ฒ",VA:"๐Ÿ‡ป๐Ÿ‡ฆ",HN:"๐Ÿ‡ญ๐Ÿ‡ณ",HK:"๐Ÿ‡ญ๐Ÿ‡ฐ",HU:"๐Ÿ‡ญ๐Ÿ‡บ",IS:"๐Ÿ‡ฎ๐Ÿ‡ธ",IN:"๐Ÿ‡ฎ๐Ÿ‡ณ",ID:"๐Ÿ‡ฎ๐Ÿ‡ฉ",IR:"๐Ÿ‡ฎ๐Ÿ‡ท",IQ:"๐Ÿ‡ฎ๐Ÿ‡ถ",IE:"๐Ÿ‡ฎ๐Ÿ‡ช",IM:"๐Ÿ‡ฎ๐Ÿ‡ฒ",IL:"๐Ÿ‡ฎ๐Ÿ‡ฑ",IT:"๐Ÿ‡ฎ๐Ÿ‡น",JM:"๐Ÿ‡ฏ๐Ÿ‡ฒ",JP:"๐Ÿ‡ฏ๐Ÿ‡ต",JE:"๐Ÿ‡ฏ๐Ÿ‡ช",JO:"๐Ÿ‡ฏ๐Ÿ‡ด",KZ:"๐Ÿ‡ฐ๐Ÿ‡ฟ",KE:"๐Ÿ‡ฐ๐Ÿ‡ช",KI:"๐Ÿ‡ฐ๐Ÿ‡ฎ",KP:"๐Ÿ‡ฐ๐Ÿ‡ต",KR:"๐Ÿ‡ฐ๐Ÿ‡ท",KW:"๐Ÿ‡ฐ๐Ÿ‡ผ",KG:"๐Ÿ‡ฐ๐Ÿ‡ฌ",LA:"๐Ÿ‡ฑ๐Ÿ‡ฆ",LV:"๐Ÿ‡ฑ๐Ÿ‡ป",LB:"๐Ÿ‡ฑ๐Ÿ‡ง",LS:"๐Ÿ‡ฑ๐Ÿ‡ธ",LR:"๐Ÿ‡ฑ๐Ÿ‡ท",LY:"๐Ÿ‡ฑ๐Ÿ‡พ",LI:"๐Ÿ‡ฑ๐Ÿ‡ฎ",LT:"๐Ÿ‡ฑ๐Ÿ‡น",LU:"๐Ÿ‡ฑ๐Ÿ‡บ",MO:"๐Ÿ‡ฒ๐Ÿ‡ด",MG:"๐Ÿ‡ฒ๐Ÿ‡ฌ",MW:"๐Ÿ‡ฒ๐Ÿ‡ผ",MY:"๐Ÿ‡ฒ๐Ÿ‡พ",MV:"๐Ÿ‡ฒ๐Ÿ‡ป",ML:"๐Ÿ‡ฒ๐Ÿ‡ฑ",MT:"๐Ÿ‡ฒ๐Ÿ‡น",MH:"๐Ÿ‡ฒ๐Ÿ‡ญ",MQ:"๐Ÿ‡ฒ๐Ÿ‡ถ",MR:"๐Ÿ‡ฒ๐Ÿ‡ท",MU:"๐Ÿ‡ฒ๐Ÿ‡บ",YT:"๐Ÿ‡พ๐Ÿ‡น",MX:"๐Ÿ‡ฒ๐Ÿ‡ฝ",FM:"๐Ÿ‡ซ๐Ÿ‡ฒ",MD:"๐Ÿ‡ฒ๐Ÿ‡ฉ",MC:"๐Ÿ‡ฒ๐Ÿ‡จ",MN:"๐Ÿ‡ฒ๐Ÿ‡ณ",ME:"๐Ÿ‡ฒ๐Ÿ‡ช",MS:"๐Ÿ‡ฒ๐Ÿ‡ธ",MA:"๐Ÿ‡ฒ๐Ÿ‡ฆ",MZ:"๐Ÿ‡ฒ๐Ÿ‡ฟ",MM:"๐Ÿ‡ฒ๐Ÿ‡ฒ",NA:"๐Ÿ‡ณ๐Ÿ‡ฆ",NR:"๐Ÿ‡ณ๐Ÿ‡ท",NP:"๐Ÿ‡ณ๐Ÿ‡ต",NL:"๐Ÿ‡ณ๐Ÿ‡ฑ",NC:"๐Ÿ‡ณ๐Ÿ‡จ",NZ:"๐Ÿ‡ณ๐Ÿ‡ฟ",NI:"๐Ÿ‡ณ๐Ÿ‡ฎ",NE:"๐Ÿ‡ณ๐Ÿ‡ช",NG:"๐Ÿ‡ณ๐Ÿ‡ฌ",NU:"๐Ÿ‡ณ๐Ÿ‡บ",NF:"๐Ÿ‡ณ๐Ÿ‡ซ",MK:"๐Ÿ‡ฒ๐Ÿ‡ฐ",MP:"๐Ÿ‡ฒ๐Ÿ‡ต",NO:"๐Ÿ‡ณ๐Ÿ‡ด",OM:"๐Ÿ‡ด๐Ÿ‡ฒ",PK:"๐Ÿ‡ต๐Ÿ‡ฐ",PW:"๐Ÿ‡ต๐Ÿ‡ผ",PS:"๐Ÿ‡ต๐Ÿ‡ธ",PA:"๐Ÿ‡ต๐Ÿ‡ฆ",PG:"๐Ÿ‡ต๐Ÿ‡ฌ",PY:"๐Ÿ‡ต๐Ÿ‡พ",PE:"๐Ÿ‡ต๐Ÿ‡ช",PH:"๐Ÿ‡ต๐Ÿ‡ญ",PN:"๐Ÿ‡ต๐Ÿ‡ณ",PL:"๐Ÿ‡ต๐Ÿ‡ฑ",PT:"๐Ÿ‡ต๐Ÿ‡น",PR:"๐Ÿ‡ต๐Ÿ‡ท",QA:"๐Ÿ‡ถ๐Ÿ‡ฆ",RE:"๐Ÿ‡ท๐Ÿ‡ช",RO:"๐Ÿ‡ท๐Ÿ‡ด",RU:"๐Ÿ‡ท๐Ÿ‡บ",RW:"๐Ÿ‡ท๐Ÿ‡ผ",BL:"๐Ÿ‡ง๐Ÿ‡ฑ",SH:"๐Ÿ‡ธ๐Ÿ‡ญ",KN:"๐Ÿ‡ฐ๐Ÿ‡ณ",LC:"๐Ÿ‡ฑ๐Ÿ‡จ",MF:"๐Ÿ‡ฒ๐Ÿ‡ซ",PM:"๐Ÿ‡ต๐Ÿ‡ฒ",VC:"๐Ÿ‡ป๐Ÿ‡จ",WS:"๐Ÿ‡ผ๐Ÿ‡ธ",SM:"๐Ÿ‡ธ๐Ÿ‡ฒ",ST:"๐Ÿ‡ธ๐Ÿ‡น",SA:"๐Ÿ‡ธ๐Ÿ‡ฆ",SN:"๐Ÿ‡ธ๐Ÿ‡ณ",RS:"๐Ÿ‡ท๐Ÿ‡ธ",SC:"๐Ÿ‡ธ๐Ÿ‡จ",SL:"๐Ÿ‡ธ๐Ÿ‡ฑ",SG:"๐Ÿ‡ธ๐Ÿ‡ฌ",SX:"๐Ÿ‡ธ๐Ÿ‡ฝ",SK:"๐Ÿ‡ธ๐Ÿ‡ฐ",SI:"๐Ÿ‡ธ๐Ÿ‡ฎ",SB:"๐Ÿ‡ธ๐Ÿ‡ง",SO:"๐Ÿ‡ธ๐Ÿ‡ด",ZA:"๐Ÿ‡ฟ๐Ÿ‡ฆ",GS:"๐Ÿ‡ฌ๐Ÿ‡ธ",SS:"๐Ÿ‡ธ๐Ÿ‡ธ",ES:"๐Ÿ‡ช๐Ÿ‡ธ",LK:"๐Ÿ‡ฑ๐Ÿ‡ฐ",SD:"๐Ÿ‡ธ๐Ÿ‡ฉ",SR:"๐Ÿ‡ธ๐Ÿ‡ท",SJ:"๐Ÿ‡ธ๐Ÿ‡ฏ",SE:"๐Ÿ‡ธ๐Ÿ‡ช",CH:"๐Ÿ‡จ๐Ÿ‡ญ",SY:"๐Ÿ‡ธ๐Ÿ‡พ",TW:"๐Ÿ‡น๐Ÿ‡ผ",TJ:"๐Ÿ‡น๐Ÿ‡ฏ",TZ:"๐Ÿ‡น๐Ÿ‡ฟ",TH:"๐Ÿ‡น๐Ÿ‡ญ",TL:"๐Ÿ‡น๐Ÿ‡ฑ",TG:"๐Ÿ‡น๐Ÿ‡ฌ",TK:"๐Ÿ‡น๐Ÿ‡ฐ",TO:"๐Ÿ‡น๐Ÿ‡ด",TT:"๐Ÿ‡น๐Ÿ‡น",TN:"๐Ÿ‡น๐Ÿ‡ณ",TR:"๐Ÿ‡น๐Ÿ‡ท",TM:"๐Ÿ‡น๐Ÿ‡ฒ",TC:"๐Ÿ‡น๐Ÿ‡จ",TV:"๐Ÿ‡น๐Ÿ‡ป",UG:"๐Ÿ‡บ๐Ÿ‡ฌ",UA:"๐Ÿ‡บ๐Ÿ‡ฆ",AE:"๐Ÿ‡ฆ๐Ÿ‡ช",GB:"๐Ÿ‡ฌ๐Ÿ‡ง",US:"๐Ÿ‡บ๐Ÿ‡ธ",UM:"๐Ÿ‡บ๐Ÿ‡ฒ",UY:"๐Ÿ‡บ๐Ÿ‡พ",UZ:"๐Ÿ‡บ๐Ÿ‡ฟ",VU:"๐Ÿ‡ป๐Ÿ‡บ",VE:"๐Ÿ‡ป๐Ÿ‡ช",VN:"๐Ÿ‡ป๐Ÿ‡ณ",VG:"๐Ÿ‡ป๐Ÿ‡ฌ",VI:"๐Ÿ‡ป๐Ÿ‡ฎ",WF:"๐Ÿ‡ผ๐Ÿ‡ซ",EH:"๐Ÿ‡ช๐Ÿ‡ญ",YE:"๐Ÿ‡พ๐Ÿ‡ช",ZM:"๐Ÿ‡ฟ๐Ÿ‡ฒ",ZW:"๐Ÿ‡ฟ๐Ÿ‡ผ",EU:"๐Ÿ‡ช๐Ÿ‡บ"};function g(e,n){void 0===n&&(n=r);try{e=u(e);var t=new Intl.Locale(e),o=t.language,i=t.region,a=new Intl.Locale(e).maximize(),c=a.toString(),l=a.region||"",s=a.script||"",f=new Intl.Locale(e).minimize().toString(),p=new Intl.DisplayNames([n,e,r],{type:"language"}),d=new Intl.DisplayNames([e,n,r],{type:"language"}),y=p.of(e)||e,m=d.of(e)||e,g=p.of(c)||e,h=d.of(c)||e,b=p.of(f)||e,N=d.of(f)||e,w=p.of(o)||e,C=d.of(o)||e,I=i?"".concat(w," (").concat(i,")"):w,S=i?"".concat(C," (").concat(i,")"):C,T=new Intl.DisplayNames([n,e,r],{type:"region"}),M=new Intl.DisplayNames([e,n,r],{type:"region"}),A=T.of(l)||"",L=M.of(l)||"",E=new Intl.DisplayNames([n,e,r],{type:"script"}),G=new Intl.DisplayNames([e,n,r],{type:"script"});return{code:e,name:y,nativeName:m,maximizedCode:c,maximizedName:g,nativeMaximizedName:h,minimizedCode:f,minimizedName:b,nativeMinimizedName:N,languageCode:o,languageName:w,nativeLanguageName:C,nameWithRegionCode:I,nativeNameWithRegionCode:S,regionCode:l,regionName:A,nativeRegionName:L,scriptCode:s,scriptName:E.of(s)||"",nativeScriptName:G.of(s)||"",emoji:v(e)}}catch(n){var K=e||"",O=null==K?void 0:K.split("-");return{code:K,name:K,nativeName:K,maximizedCode:K,maximizedName:K,nativeMaximizedName:K,minimizedCode:K,minimizedName:K,nativeMinimizedName:K,languageCode:o=(null==O?void 0:O[0])||K||"",languageName:o,nativeLanguageName:o,regionCode:l=O.length>2?null==O?void 0:O[2]:(null==O?void 0:O[1])||"",regionName:l,nativeRegionName:l,scriptCode:s=(null==O?void 0:O[3])||"",scriptName:s,nativeScriptName:s,nameWithRegionCode:I=o?l?"".concat(o," (").concat(l,")"):o:"",nativeNameWithRegionCode:K,emoji:v(K)}}}function h(n,t){"string"==typeof n&&(n=[n]),n=n.filter(a),t=t.filter(a);for(var r=function(n){var r=t.filter((function(e){return l(e)})),o=function(e){for(var n=e.locale,t=e.languageCode,o=e.minimizedCode,i=e.regionCode,a=e.scriptCode,u=0,c=[n,"".concat(t,"-").concat(i),"".concat(t,"-").concat(a),o];u<c.length;u++){var l=c[u];if(r.includes(l))return l}return null},i=g(n),a=i.languageCode,u=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(i,["languageCode"]),c=o(e({locale:n,languageCode:a},u))||o(e({locale:a},g(a)));if(c)return{value:c}},o=0,i=n;o<i.length;o++){var u=r(i[o]);if("object"==typeof u)return u.value}}function b(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.options,u=void 0===a?{}:a;return new Intl.NumberFormat(i,e({numberingSystem:"latn"},u)).format(t)}function N(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.options,u=void 0===a?{}:a;return new Intl.DateTimeFormat(i,e({calendar:"gregory",numberingSystem:"latn"},u)).format(t)}function w(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.currency,u=void 0===a?"USD":a,c=n.options,l=void 0===c?{}:c;return new Intl.NumberFormat(i,e({style:"currency",currency:u,numberingSystem:"latn"},l)).format(t)}function C(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.options,u=void 0===a?{}:a;return new Intl.ListFormat(i,e({type:"conjunction",style:"long"},u)).format(t)}var I={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function S(n){if("string"!=typeof n)throw new Error("splitStringToContent: ".concat(n," is not a string!"));for(var t,r=[],o=/{([^}]+)}/g,i=0;null!==(t=o.exec(n));){var a=t[0],u=t[1],c=t.index;if("^"!==n[c-1]){c>i&&r.push(n.slice(i,c));var l=u.split(",").map((function(e){return e.trim()})),s=l[0],f=l[1]?I[l[1]]:void 0,v=e({key:s},f&&{variable:f});r.push(v),i=c+a.length}else c-1>i&&r.push(n.slice(i,c-1)),r.push(a),i=c+a.length}return i<n.length&&r.push(n.slice(i)),r}var T=function(e){return"undefined"!=typeof process&&process.env&&process.env[e]||""},M=function(){function r(e){var n=void 0===e?{}:e,t=n.apiKey,r=void 0===t?"":t,o=n.devApiKey,i=void 0===o?"":o,a=n.sourceLocale,c=void 0===a?"":a,l=n.projectId,s=void 0===l?"":l,f=n.baseUrl,v=void 0===f?"https://api.gtx.dev":f;this.apiKey=r||T("GT_API_KEY"),this.devApiKey=i||T("GT_DEV_API_KEY"),this.projectId=s||T("GT_PROJECT_ID"),this.sourceLocale=u(c)||"",this.baseUrl=v}return r.prototype.translate=function(r,o,i){return n(this,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,s(this,r,o,e({sourceLocale:this.sourceLocale},i))];case 1:return[2,n.sent()]}}))}))},r.prototype.translateJsx=function(r,o,i){return n(this,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,f(this,r,o,e({sourceLocale:this.sourceLocale},i))];case 1:return[2,n.sent()]}}))}))},r}();function A(e){return function(e){var n;try{var t=new Intl.Locale(e);return"rtl"===(null===(n=null==t?void 0:t.textInfo)||void 0===n?void 0:n.direction)?"rtl":"ltr"}catch(e){return"ltr"}}(e)}function L(e,n){return void 0===n&&(n=r),function(e,n){void 0===n&&(n=r);try{return new Intl.DisplayNames([n,r],{type:"language"}).of(e)||""}catch(e){return""}}(e,n)}function E(e,n){return g(e,n)}function G(e,n){return v(e,n)}function K(e){return a(e)}function O(e){return u(e)}function P(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return c.apply(void 0,e)}function D(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return l.apply(void 0,e)}function R(e){return b(e)}function x(e){return N(e)}function B(e){return w(e)}function k(e){return C(e)}function U(n){return o=(t=n).value,i=t.unit,a=t.locales,u=void 0===a?[r]:a,c=t.options,l=void 0===c?{}:c,new Intl.RelativeTimeFormat(u,e({style:"long",numeric:"auto"},l)).format(o,i);var t,o,i,a,u,c,l}function j(e){return S(e)}function F(n,t,o,i){return function(n,t,o,i){if(void 0===t&&(t=r),void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof n&&(n=S(n)),"string"==typeof n)return n;if(!Array.isArray(n))throw new Error("renderContentToString: content ".concat(n," is invalid"));return n.map((function(n){var r;if("string"==typeof n)return n;if("object"==typeof n){var a=o[n.key];return n.variable?"number"===n.variable?b({value:a,locales:t,options:i[n.key]}):"currency"===n.variable?w(e(e({value:a,locales:t},i[n.key]&&{options:i[n.key]}),(null===(r=i[n.key])||void 0===r?void 0:r.currency)&&{currency:i[n.key].currency})):"datetime"===n.variable?N(e({value:a,locales:t},i[n.key]&&{options:i[n.key]})):"list"===n.variable?C(e({value:a,locales:t},i[n.key]&&{options:i[n.key]})):a:a}})).join("")}(n,t,o,i)}function z(e,n){return h(e,n)}function W(e,n,t){return function(e,n,t){return!(!a(e)||!a(n)||t&&t.some((function(e){return!a(e)}))||c(e,n)||t&&!t.some((function(e){return l(n,e)})))}(e,n,t)}export{M as default,z as determineLocale,B as formatCurrency,x as formatDateTime,k as formatList,R as formatNum,U as formatRelativeTime,A as getLocaleDirection,G as getLocaleEmoji,L as getLocaleName,E as getLocaleProperties,P as isSameDialect,D as isSameLanguage,K as isValidLocale,F as renderContentToString,W as requiresTranslation,j as splitStringToContent,O as standardizeLocale};
1
+ var e=function(){return e=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},e.apply(this,arguments)};function n(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var r="en-US",o=6e4,i=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],a=function(e){try{var n=new Intl.Locale(e),t=n.language,o=n.region,a=n.script;if(e.split("-").length!==(u=1,o&&(u+=1),a&&(u+=1),u))return!1;if(new Intl.DisplayNames([r],{type:"language"}).of(t)===t)return!1;if(o)if(new Intl.DisplayNames([r],{type:"region"}).of(o)===o)return!1;if(a)if(new Intl.DisplayNames([r],{type:"script"}).of(a)===a&&!i.includes(a))return!1;return!0}catch(e){return!1}var u},u=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(n){return e}};function c(){for(var e,n,t,r,o,i,a,c,l,s,f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];try{for(var p=f.flat().map(u),d=0;d<p.length;d++)for(var y=d+1;y<p.length;y++)if(e=p[d],n=p[y],t=void 0,r=void 0,o=void 0,i=void 0,a=void 0,c=void 0,l=void 0,s=void 0,t=new Intl.Locale(e),r=t.language,o=t.region,i=t.script,a=new Intl.Locale(n),c=a.language,l=a.region,s=a.script,r!==c||o&&l&&o!==l||i&&s&&i!==s)return!1;return!0}catch(e){return console.error(e),!1}}function l(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=e.flat().map((function(e){return new Intl.Locale(e).language}));return t.every((function(e){return e===t[0]}))}catch(e){return console.error(e),!1}}function s(r,i,a,u){return n(this,void 0,void 0,(function(){var n,c,l,s,f,v,p,d;return t(this,(function(t){switch(t.label){case 0:n=new AbortController,c=n.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return n.abort()}),l),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/content"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:i,targetLocale:a,metadata:u}),signal:c})];case 2:return s=t.sent(),[3,4];case 3:if("AbortError"===(null==(f=t.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(v=Error.bind,d=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(v.apply(Error,[void 0,d.apply(p,[t.sent()])]));case 6:return[4,s.json()];case 7:return[2,t.sent()]}}))}))}function f(r,i,a,u){return n(this,void 0,void 0,(function(){var n,c,l,s,f,v,p,d;return t(this,(function(t){switch(t.label){case 0:n=new AbortController,c=n.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return n.abort()}),l),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/react"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:i,targetLocale:a,metadata:u}),signal:c})];case 2:return s=t.sent(),[3,4];case 3:if("AbortError"===(null==(f=t.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(v=Error.bind,d=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(v.apply(Error,[void 0,d.apply(p,[t.sent()])]));case 6:return[4,s.json()];case 7:return[2,t.sent()]}}))}))}function v(e,n){if(void 0===n&&(n={}),!a(e))return d;if(n[e=u(e)])return n[e];var t=new Intl.Locale(e),r=t.region;if(r&&m[r])return m[r];var o=t.maximize(),i=o.region||"";return y[o.language]||m[i]||d}var p="๐ŸŒ",d=p,y={ca:p,eu:p,ku:p,bo:"๐ŸŒ",ug:"๐ŸŒ",gd:"๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ",cy:"๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ",gv:"๐Ÿ‡ฎ๐Ÿ‡ฒ",grc:"๐Ÿบ"},m={AF:"๐Ÿ‡ฆ๐Ÿ‡ซ",AX:"๐Ÿ‡ฆ๐Ÿ‡ฝ",AL:"๐Ÿ‡ฆ๐Ÿ‡ฑ",DZ:"๐Ÿ‡ฉ๐Ÿ‡ฟ",AS:"๐Ÿ‡ฆ๐Ÿ‡ธ",AD:"๐Ÿ‡ฆ๐Ÿ‡ฉ",AO:"๐Ÿ‡ฆ๐Ÿ‡ด",AI:"๐Ÿ‡ฆ๐Ÿ‡ฎ",AQ:"๐Ÿ‡ฆ๐Ÿ‡ถ",AG:"๐Ÿ‡ฆ๐Ÿ‡ฌ",AR:"๐Ÿ‡ฆ๐Ÿ‡ท",AM:"๐Ÿ‡ฆ๐Ÿ‡ฒ",AW:"๐Ÿ‡ฆ๐Ÿ‡ผ",AU:"๐Ÿ‡ฆ๐Ÿ‡บ",AT:"๐Ÿ‡ฆ๐Ÿ‡น",AZ:"๐Ÿ‡ฆ๐Ÿ‡ฟ",BS:"๐Ÿ‡ง๐Ÿ‡ธ",BH:"๐Ÿ‡ง๐Ÿ‡ญ",BD:"๐Ÿ‡ง๐Ÿ‡ฉ",BB:"๐Ÿ‡ง๐Ÿ‡ง",BY:"๐Ÿ‡ง๐Ÿ‡พ",BE:"๐Ÿ‡ง๐Ÿ‡ช",BZ:"๐Ÿ‡ง๐Ÿ‡ฟ",BJ:"๐Ÿ‡ง๐Ÿ‡ฏ",BM:"๐Ÿ‡ง๐Ÿ‡ฒ",BT:"๐Ÿ‡ง๐Ÿ‡น",BO:"๐Ÿ‡ง๐Ÿ‡ด",BQ:"๐Ÿ‡ง๐Ÿ‡ถ",BA:"๐Ÿ‡ง๐Ÿ‡ฆ",BW:"๐Ÿ‡ง๐Ÿ‡ผ",BV:"๐Ÿ‡ง๐Ÿ‡ป",BR:"๐Ÿ‡ง๐Ÿ‡ท",IO:"๐Ÿ‡ฎ๐Ÿ‡ด",BN:"๐Ÿ‡ง๐Ÿ‡ณ",BG:"๐Ÿ‡ง๐Ÿ‡ฌ",BF:"๐Ÿ‡ง๐Ÿ‡ซ",BI:"๐Ÿ‡ง๐Ÿ‡ฎ",CV:"๐Ÿ‡จ๐Ÿ‡ป",KH:"๐Ÿ‡ฐ๐Ÿ‡ญ",CM:"๐Ÿ‡จ๐Ÿ‡ฒ",CA:"๐Ÿ‡จ๐Ÿ‡ฆ",KY:"๐Ÿ‡ฐ๐Ÿ‡พ",CF:"๐Ÿ‡จ๐Ÿ‡ซ",TD:"๐Ÿ‡น๐Ÿ‡ฉ",CL:"๐Ÿ‡จ๐Ÿ‡ฑ",CN:"๐Ÿ‡จ๐Ÿ‡ณ",CX:"๐Ÿ‡จ๐Ÿ‡ฝ",CC:"๐Ÿ‡จ๐Ÿ‡จ",CO:"๐Ÿ‡จ๐Ÿ‡ด",KM:"๐Ÿ‡ฐ๐Ÿ‡ฒ",CD:"๐Ÿ‡จ๐Ÿ‡ฉ",CG:"๐Ÿ‡จ๐Ÿ‡ฌ",CK:"๐Ÿ‡จ๐Ÿ‡ฐ",CR:"๐Ÿ‡จ๐Ÿ‡ท",CI:"๐Ÿ‡จ๐Ÿ‡ฎ",HR:"๐Ÿ‡ญ๐Ÿ‡ท",CU:"๐Ÿ‡จ๐Ÿ‡บ",CW:"๐Ÿ‡จ๐Ÿ‡ผ",CY:"๐Ÿ‡จ๐Ÿ‡พ",CZ:"๐Ÿ‡จ๐Ÿ‡ฟ",DK:"๐Ÿ‡ฉ๐Ÿ‡ฐ",DJ:"๐Ÿ‡ฉ๐Ÿ‡ฏ",DM:"๐Ÿ‡ฉ๐Ÿ‡ฒ",DO:"๐Ÿ‡ฉ๐Ÿ‡ด",EC:"๐Ÿ‡ช๐Ÿ‡จ",EG:"๐Ÿ‡ช๐Ÿ‡ฌ",SV:"๐Ÿ‡ธ๐Ÿ‡ป",GQ:"๐Ÿ‡ฌ๐Ÿ‡ถ",ER:"๐Ÿ‡ช๐Ÿ‡ท",EE:"๐Ÿ‡ช๐Ÿ‡ช",SZ:"๐Ÿ‡ธ๐Ÿ‡ฟ",ET:"๐Ÿ‡ช๐Ÿ‡น",FK:"๐Ÿ‡ซ๐Ÿ‡ฐ",FO:"๐Ÿ‡ซ๐Ÿ‡ด",FJ:"๐Ÿ‡ซ๐Ÿ‡ฏ",FI:"๐Ÿ‡ซ๐Ÿ‡ฎ",FR:"๐Ÿ‡ซ๐Ÿ‡ท",GF:"๐Ÿ‡ฌ๐Ÿ‡ซ",PF:"๐Ÿ‡ต๐Ÿ‡ซ",TF:"๐Ÿ‡น๐Ÿ‡ซ",GA:"๐Ÿ‡ฌ๐Ÿ‡ฆ",GM:"๐Ÿ‡ฌ๐Ÿ‡ฒ",GE:"๐Ÿ‡ฌ๐Ÿ‡ช",DE:"๐Ÿ‡ฉ๐Ÿ‡ช",GH:"๐Ÿ‡ฌ๐Ÿ‡ญ",GI:"๐Ÿ‡ฌ๐Ÿ‡ฎ",GR:"๐Ÿ‡ฌ๐Ÿ‡ท",GL:"๐Ÿ‡ฌ๐Ÿ‡ฑ",GD:"๐Ÿ‡ฌ๐Ÿ‡ฉ",GP:"๐Ÿ‡ฌ๐Ÿ‡ต",GU:"๐Ÿ‡ฌ๐Ÿ‡บ",GT:"๐Ÿ‡ฌ๐Ÿ‡น",GG:"๐Ÿ‡ฌ๐Ÿ‡ฌ",GN:"๐Ÿ‡ฌ๐Ÿ‡ณ",GW:"๐Ÿ‡ฌ๐Ÿ‡ผ",GY:"๐Ÿ‡ฌ๐Ÿ‡พ",HT:"๐Ÿ‡ญ๐Ÿ‡น",HM:"๐Ÿ‡ญ๐Ÿ‡ฒ",VA:"๐Ÿ‡ป๐Ÿ‡ฆ",HN:"๐Ÿ‡ญ๐Ÿ‡ณ",HK:"๐Ÿ‡ญ๐Ÿ‡ฐ",HU:"๐Ÿ‡ญ๐Ÿ‡บ",IS:"๐Ÿ‡ฎ๐Ÿ‡ธ",IN:"๐Ÿ‡ฎ๐Ÿ‡ณ",ID:"๐Ÿ‡ฎ๐Ÿ‡ฉ",IR:"๐Ÿ‡ฎ๐Ÿ‡ท",IQ:"๐Ÿ‡ฎ๐Ÿ‡ถ",IE:"๐Ÿ‡ฎ๐Ÿ‡ช",IM:"๐Ÿ‡ฎ๐Ÿ‡ฒ",IL:"๐Ÿ‡ฎ๐Ÿ‡ฑ",IT:"๐Ÿ‡ฎ๐Ÿ‡น",JM:"๐Ÿ‡ฏ๐Ÿ‡ฒ",JP:"๐Ÿ‡ฏ๐Ÿ‡ต",JE:"๐Ÿ‡ฏ๐Ÿ‡ช",JO:"๐Ÿ‡ฏ๐Ÿ‡ด",KZ:"๐Ÿ‡ฐ๐Ÿ‡ฟ",KE:"๐Ÿ‡ฐ๐Ÿ‡ช",KI:"๐Ÿ‡ฐ๐Ÿ‡ฎ",KP:"๐Ÿ‡ฐ๐Ÿ‡ต",KR:"๐Ÿ‡ฐ๐Ÿ‡ท",KW:"๐Ÿ‡ฐ๐Ÿ‡ผ",KG:"๐Ÿ‡ฐ๐Ÿ‡ฌ",LA:"๐Ÿ‡ฑ๐Ÿ‡ฆ",LV:"๐Ÿ‡ฑ๐Ÿ‡ป",LB:"๐Ÿ‡ฑ๐Ÿ‡ง",LS:"๐Ÿ‡ฑ๐Ÿ‡ธ",LR:"๐Ÿ‡ฑ๐Ÿ‡ท",LY:"๐Ÿ‡ฑ๐Ÿ‡พ",LI:"๐Ÿ‡ฑ๐Ÿ‡ฎ",LT:"๐Ÿ‡ฑ๐Ÿ‡น",LU:"๐Ÿ‡ฑ๐Ÿ‡บ",MO:"๐Ÿ‡ฒ๐Ÿ‡ด",MG:"๐Ÿ‡ฒ๐Ÿ‡ฌ",MW:"๐Ÿ‡ฒ๐Ÿ‡ผ",MY:"๐Ÿ‡ฒ๐Ÿ‡พ",MV:"๐Ÿ‡ฒ๐Ÿ‡ป",ML:"๐Ÿ‡ฒ๐Ÿ‡ฑ",MT:"๐Ÿ‡ฒ๐Ÿ‡น",MH:"๐Ÿ‡ฒ๐Ÿ‡ญ",MQ:"๐Ÿ‡ฒ๐Ÿ‡ถ",MR:"๐Ÿ‡ฒ๐Ÿ‡ท",MU:"๐Ÿ‡ฒ๐Ÿ‡บ",YT:"๐Ÿ‡พ๐Ÿ‡น",MX:"๐Ÿ‡ฒ๐Ÿ‡ฝ",FM:"๐Ÿ‡ซ๐Ÿ‡ฒ",MD:"๐Ÿ‡ฒ๐Ÿ‡ฉ",MC:"๐Ÿ‡ฒ๐Ÿ‡จ",MN:"๐Ÿ‡ฒ๐Ÿ‡ณ",ME:"๐Ÿ‡ฒ๐Ÿ‡ช",MS:"๐Ÿ‡ฒ๐Ÿ‡ธ",MA:"๐Ÿ‡ฒ๐Ÿ‡ฆ",MZ:"๐Ÿ‡ฒ๐Ÿ‡ฟ",MM:"๐Ÿ‡ฒ๐Ÿ‡ฒ",NA:"๐Ÿ‡ณ๐Ÿ‡ฆ",NR:"๐Ÿ‡ณ๐Ÿ‡ท",NP:"๐Ÿ‡ณ๐Ÿ‡ต",NL:"๐Ÿ‡ณ๐Ÿ‡ฑ",NC:"๐Ÿ‡ณ๐Ÿ‡จ",NZ:"๐Ÿ‡ณ๐Ÿ‡ฟ",NI:"๐Ÿ‡ณ๐Ÿ‡ฎ",NE:"๐Ÿ‡ณ๐Ÿ‡ช",NG:"๐Ÿ‡ณ๐Ÿ‡ฌ",NU:"๐Ÿ‡ณ๐Ÿ‡บ",NF:"๐Ÿ‡ณ๐Ÿ‡ซ",MK:"๐Ÿ‡ฒ๐Ÿ‡ฐ",MP:"๐Ÿ‡ฒ๐Ÿ‡ต",NO:"๐Ÿ‡ณ๐Ÿ‡ด",OM:"๐Ÿ‡ด๐Ÿ‡ฒ",PK:"๐Ÿ‡ต๐Ÿ‡ฐ",PW:"๐Ÿ‡ต๐Ÿ‡ผ",PS:"๐Ÿ‡ต๐Ÿ‡ธ",PA:"๐Ÿ‡ต๐Ÿ‡ฆ",PG:"๐Ÿ‡ต๐Ÿ‡ฌ",PY:"๐Ÿ‡ต๐Ÿ‡พ",PE:"๐Ÿ‡ต๐Ÿ‡ช",PH:"๐Ÿ‡ต๐Ÿ‡ญ",PN:"๐Ÿ‡ต๐Ÿ‡ณ",PL:"๐Ÿ‡ต๐Ÿ‡ฑ",PT:"๐Ÿ‡ต๐Ÿ‡น",PR:"๐Ÿ‡ต๐Ÿ‡ท",QA:"๐Ÿ‡ถ๐Ÿ‡ฆ",RE:"๐Ÿ‡ท๐Ÿ‡ช",RO:"๐Ÿ‡ท๐Ÿ‡ด",RU:"๐Ÿ‡ท๐Ÿ‡บ",RW:"๐Ÿ‡ท๐Ÿ‡ผ",BL:"๐Ÿ‡ง๐Ÿ‡ฑ",SH:"๐Ÿ‡ธ๐Ÿ‡ญ",KN:"๐Ÿ‡ฐ๐Ÿ‡ณ",LC:"๐Ÿ‡ฑ๐Ÿ‡จ",MF:"๐Ÿ‡ฒ๐Ÿ‡ซ",PM:"๐Ÿ‡ต๐Ÿ‡ฒ",VC:"๐Ÿ‡ป๐Ÿ‡จ",WS:"๐Ÿ‡ผ๐Ÿ‡ธ",SM:"๐Ÿ‡ธ๐Ÿ‡ฒ",ST:"๐Ÿ‡ธ๐Ÿ‡น",SA:"๐Ÿ‡ธ๐Ÿ‡ฆ",SN:"๐Ÿ‡ธ๐Ÿ‡ณ",RS:"๐Ÿ‡ท๐Ÿ‡ธ",SC:"๐Ÿ‡ธ๐Ÿ‡จ",SL:"๐Ÿ‡ธ๐Ÿ‡ฑ",SG:"๐Ÿ‡ธ๐Ÿ‡ฌ",SX:"๐Ÿ‡ธ๐Ÿ‡ฝ",SK:"๐Ÿ‡ธ๐Ÿ‡ฐ",SI:"๐Ÿ‡ธ๐Ÿ‡ฎ",SB:"๐Ÿ‡ธ๐Ÿ‡ง",SO:"๐Ÿ‡ธ๐Ÿ‡ด",ZA:"๐Ÿ‡ฟ๐Ÿ‡ฆ",GS:"๐Ÿ‡ฌ๐Ÿ‡ธ",SS:"๐Ÿ‡ธ๐Ÿ‡ธ",ES:"๐Ÿ‡ช๐Ÿ‡ธ",LK:"๐Ÿ‡ฑ๐Ÿ‡ฐ",SD:"๐Ÿ‡ธ๐Ÿ‡ฉ",SR:"๐Ÿ‡ธ๐Ÿ‡ท",SJ:"๐Ÿ‡ธ๐Ÿ‡ฏ",SE:"๐Ÿ‡ธ๐Ÿ‡ช",CH:"๐Ÿ‡จ๐Ÿ‡ญ",SY:"๐Ÿ‡ธ๐Ÿ‡พ",TW:"๐Ÿ‡น๐Ÿ‡ผ",TJ:"๐Ÿ‡น๐Ÿ‡ฏ",TZ:"๐Ÿ‡น๐Ÿ‡ฟ",TH:"๐Ÿ‡น๐Ÿ‡ญ",TL:"๐Ÿ‡น๐Ÿ‡ฑ",TG:"๐Ÿ‡น๐Ÿ‡ฌ",TK:"๐Ÿ‡น๐Ÿ‡ฐ",TO:"๐Ÿ‡น๐Ÿ‡ด",TT:"๐Ÿ‡น๐Ÿ‡น",TN:"๐Ÿ‡น๐Ÿ‡ณ",TR:"๐Ÿ‡น๐Ÿ‡ท",TM:"๐Ÿ‡น๐Ÿ‡ฒ",TC:"๐Ÿ‡น๐Ÿ‡จ",TV:"๐Ÿ‡น๐Ÿ‡ป",UG:"๐Ÿ‡บ๐Ÿ‡ฌ",UA:"๐Ÿ‡บ๐Ÿ‡ฆ",AE:"๐Ÿ‡ฆ๐Ÿ‡ช",GB:"๐Ÿ‡ฌ๐Ÿ‡ง",US:"๐Ÿ‡บ๐Ÿ‡ธ",UM:"๐Ÿ‡บ๐Ÿ‡ฒ",UY:"๐Ÿ‡บ๐Ÿ‡พ",UZ:"๐Ÿ‡บ๐Ÿ‡ฟ",VU:"๐Ÿ‡ป๐Ÿ‡บ",VE:"๐Ÿ‡ป๐Ÿ‡ช",VN:"๐Ÿ‡ป๐Ÿ‡ณ",VG:"๐Ÿ‡ป๐Ÿ‡ฌ",VI:"๐Ÿ‡ป๐Ÿ‡ฎ",WF:"๐Ÿ‡ผ๐Ÿ‡ซ",EH:"๐Ÿ‡ช๐Ÿ‡ญ",YE:"๐Ÿ‡พ๐Ÿ‡ช",ZM:"๐Ÿ‡ฟ๐Ÿ‡ฒ",ZW:"๐Ÿ‡ฟ๐Ÿ‡ผ",EU:"๐Ÿ‡ช๐Ÿ‡บ"};function g(e,n){void 0===n&&(n=r);try{e=u(e);var t=new Intl.Locale(e),o=t.language,i=t.region,a=new Intl.Locale(e).maximize(),c=a.toString(),l=a.region||"",s=a.script||"",f=new Intl.Locale(e).minimize().toString(),p=new Intl.DisplayNames([n,e,r],{type:"language"}),d=new Intl.DisplayNames([e,n,r],{type:"language"}),y=p.of(e)||e,m=d.of(e)||e,g=p.of(c)||e,h=d.of(c)||e,b=p.of(f)||e,N=d.of(f)||e,w=p.of(o)||e,C=d.of(o)||e,I=i?"".concat(w," (").concat(i,")"):w,S=i?"".concat(C," (").concat(i,")"):C,T=new Intl.DisplayNames([n,e,r],{type:"region"}),M=new Intl.DisplayNames([e,n,r],{type:"region"}),A=T.of(l)||"",L=M.of(l)||"",E=new Intl.DisplayNames([n,e,r],{type:"script"}),G=new Intl.DisplayNames([e,n,r],{type:"script"});return{code:e,name:y,nativeName:m,maximizedCode:c,maximizedName:g,nativeMaximizedName:h,minimizedCode:f,minimizedName:b,nativeMinimizedName:N,languageCode:o,languageName:w,nativeLanguageName:C,nameWithRegionCode:I,nativeNameWithRegionCode:S,regionCode:l,regionName:A,nativeRegionName:L,scriptCode:s,scriptName:E.of(s)||"",nativeScriptName:G.of(s)||"",emoji:v(e)}}catch(n){var K=e||"",O=null==K?void 0:K.split("-");return{code:K,name:K,nativeName:K,maximizedCode:K,maximizedName:K,nativeMaximizedName:K,minimizedCode:K,minimizedName:K,nativeMinimizedName:K,languageCode:o=(null==O?void 0:O[0])||K||"",languageName:o,nativeLanguageName:o,regionCode:l=O.length>2?null==O?void 0:O[2]:(null==O?void 0:O[1])||"",regionName:l,nativeRegionName:l,scriptCode:s=(null==O?void 0:O[3])||"",scriptName:s,nativeScriptName:s,nameWithRegionCode:I=o?l?"".concat(o," (").concat(l,")"):o:"",nativeNameWithRegionCode:K,emoji:v(K)}}}function h(n,t){"string"==typeof n&&(n=[n]),n=n.filter(a),t=t.filter(a);for(var r=function(n){var r=t.filter((function(e){return l(n,e)})),o=function(e){for(var n=e.locale,t=e.languageCode,o=e.minimizedCode,i=e.regionCode,a=e.scriptCode,u=0,c=[n,"".concat(t,"-").concat(i),"".concat(t,"-").concat(a),o];u<c.length;u++){var l=c[u];if(r.includes(l))return l}return null},i=g(n),a=i.languageCode,u=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(i,["languageCode"]),c=o(e({locale:n,languageCode:a},u))||o(e({locale:a},g(a)));if(c)return{value:c}},o=0,i=n;o<i.length;o++){var u=r(i[o]);if("object"==typeof u)return u.value}}function b(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.options,u=void 0===a?{}:a;return new Intl.NumberFormat(i,e({numberingSystem:"latn"},u)).format(t)}function N(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.options,u=void 0===a?{}:a;return new Intl.DateTimeFormat(i,e({calendar:"gregory",numberingSystem:"latn"},u)).format(t)}function w(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.currency,u=void 0===a?"USD":a,c=n.options,l=void 0===c?{}:c;return new Intl.NumberFormat(i,e({style:"currency",currency:u,numberingSystem:"latn"},l)).format(t)}function C(n){var t=n.value,o=n.locales,i=void 0===o?[r]:o,a=n.options,u=void 0===a?{}:a;return new Intl.ListFormat(i,e({type:"conjunction",style:"long"},u)).format(t)}var I={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function S(n){if("string"!=typeof n)throw new Error("splitStringToContent: ".concat(n," is not a string!"));for(var t,r=[],o=/{([^}]+)}/g,i=0;null!==(t=o.exec(n));){var a=t[0],u=t[1],c=t.index;if("^"!==n[c-1]){c>i&&r.push(n.slice(i,c));var l=u.split(",").map((function(e){return e.trim()})),s=l[0],f=l[1]?I[l[1]]:void 0,v=e({key:s},f&&{variable:f});r.push(v),i=c+a.length}else c-1>i&&r.push(n.slice(i,c-1)),r.push(a),i=c+a.length}return i<n.length&&r.push(n.slice(i)),r}var T=function(e){return"undefined"!=typeof process&&process.env&&process.env[e]||""},M=function(){function r(e){var n=void 0===e?{}:e,t=n.apiKey,r=void 0===t?"":t,o=n.devApiKey,i=void 0===o?"":o,a=n.sourceLocale,c=void 0===a?"":a,l=n.projectId,s=void 0===l?"":l,f=n.baseUrl,v=void 0===f?"https://api.gtx.dev":f;this.apiKey=r||T("GT_API_KEY"),this.devApiKey=i||T("GT_DEV_API_KEY"),this.projectId=s||T("GT_PROJECT_ID"),this.sourceLocale=u(c)||"",this.baseUrl=v}return r.prototype.translate=function(r,o,i){return n(this,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,s(this,r,o,e({sourceLocale:this.sourceLocale},i))];case 1:return[2,n.sent()]}}))}))},r.prototype.translateJsx=function(r,o,i){return n(this,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,f(this,r,o,e({sourceLocale:this.sourceLocale},i))];case 1:return[2,n.sent()]}}))}))},r}();function A(e){return function(e){var n;try{var t=new Intl.Locale(e);return"rtl"===(null===(n=null==t?void 0:t.textInfo)||void 0===n?void 0:n.direction)?"rtl":"ltr"}catch(e){return"ltr"}}(e)}function L(e,n){return void 0===n&&(n=r),function(e,n){void 0===n&&(n=r);try{return new Intl.DisplayNames([n,r],{type:"language"}).of(e)||""}catch(e){return""}}(e,n)}function E(e,n){return g(e,n)}function G(e,n){return v(e,n)}function K(e){return a(e)}function O(e){return u(e)}function P(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return c.apply(void 0,e)}function D(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return l.apply(void 0,e)}function R(e){return b(e)}function x(e){return N(e)}function B(e){return w(e)}function k(e){return C(e)}function U(n){return o=(t=n).value,i=t.unit,a=t.locales,u=void 0===a?[r]:a,c=t.options,l=void 0===c?{}:c,new Intl.RelativeTimeFormat(u,e({style:"long",numeric:"auto"},l)).format(o,i);var t,o,i,a,u,c,l}function j(e){return S(e)}function F(n,t,o,i){return function(n,t,o,i){if(void 0===t&&(t=r),void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof n&&(n=S(n)),"string"==typeof n)return n;if(!Array.isArray(n))throw new Error("renderContentToString: content ".concat(n," is invalid"));return n.map((function(n){var r;if("string"==typeof n)return n;if("object"==typeof n){var a=o[n.key];return n.variable?"number"===n.variable?b({value:a,locales:t,options:i[n.key]}):"currency"===n.variable?w(e(e({value:a,locales:t},i[n.key]&&{options:i[n.key]}),(null===(r=i[n.key])||void 0===r?void 0:r.currency)&&{currency:i[n.key].currency})):"datetime"===n.variable?N(e({value:a,locales:t},i[n.key]&&{options:i[n.key]})):"list"===n.variable?C(e({value:a,locales:t},i[n.key]&&{options:i[n.key]})):a:a}})).join("")}(n,t,o,i)}function z(e,n){return h(e,n)}function W(e,n,t){return function(e,n,t){return!(!a(e)||!a(n)||t&&t.some((function(e){return!a(e)}))||c(e,n)||t&&!t.some((function(e){return l(n,e)})))}(e,n,t)}export{M as default,z as determineLocale,B as formatCurrency,x as formatDateTime,k as formatList,R as formatNum,U as formatRelativeTime,A as getLocaleDirection,G as getLocaleEmoji,L as getLocaleName,E as getLocaleProperties,P as isSameDialect,D as isSameLanguage,K as isValidLocale,F as renderContentToString,W as requiresTranslation,j as splitStringToContent,O as standardizeLocale};
2
2
  //# sourceMappingURL=index.esm.min.mjs.map