Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tolgee/web

Package Overview
Dependencies
Maintainers
2
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tolgee/web - npm Package Compare versions

Comparing version 5.19.3 to 5.19.4

2

dist/tolgee-web.production.cjs.min.js

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

"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function t(e){return Boolean(e&&"function"==typeof e.then)}function n(e,n){return t(e)?Promise.resolve(e).then(n):n(e)}function a(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function o(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function r(e){return o(e)||[]}function i(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?r(t):r(null==t?void 0:t[e]);var n}function s(e){return Array.from(new Set(e))}function l(e){return e?e.replace(/\/+$/,""):e}Object.defineProperty(exports,"__esModule",{value:!0});const c=(e,t)=>fetch(e,t),u=(e=c)=>(t,n)=>e(t,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.19.3"},null==n?void 0:n.headers)}));function g(e){let t=[];return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(n){e()&&t.forEach((e=>e({value:n})))}})}function d(e,t,n){const a=new Set,o=new Set;let i=[];function s(){if(0===i.length)return;const e=i;i=[],a.forEach((e=>{e({value:void 0})}));let n=new Set;e.forEach((e=>{void 0===e?n=void 0:void 0!==n&&e.forEach((e=>n.add(e)))}));!function(e){const n=new Set(t());o.forEach((t=>{(void 0===e||-1!==(null==e?void 0:e.findIndex((e=>n.has(e)||t.namespaces.has(e)))))&&t.fn({value:void 0})}))}(n?Array.from(n.keys()):void 0)}return Object.freeze({emit(t,n){e()&&(i.push(t),n?setTimeout(s,0):s())},listen(e){a.add(e);return{unsubscribe:()=>{a.delete(e)}}},listenSome(e){const t={fn:t=>{e(t)},namespaces:new Set};o.add(t);const a={unsubscribe:()=>{o.delete(t)},subscribeNs:e=>(r(e).forEach((e=>t.namespaces.add(e))),void 0===e&&t.namespaces.add(n()),a)};return a}})}const f=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):f(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},p=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},h=({language:e,namespace:t})=>t?`${e}:${t}`:e;function v(e,t,n,a,o,i,l){const c=new Map,u=new Map;let g={},d=0;function v(t,n,a){const o=h(t);u.set(o,{data:f(n),version:a}),e.emit(t)}function m(e){let n;if(!n){const t=g[h(e)];"function"==typeof t&&(n=t())}return n||(n=t(e)),n}const y=Object.freeze({addStaticData(e){e&&(g=Object.assign(Object.assign({},g),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=p(e),a=u.get(e);a&&0!==a.version||v(n,t,0)}})))},invalidate(){c.clear(),d+=1},addRecord(e,t){v(e,t,d)},exists(e,t=!1){const n=u.get(h(e));return n&&t?n.version===d:Boolean(n)},getRecord(e){var t;return null===(t=u.get(h(a(e))))||void 0===t?void 0:t.data},getTranslation(e,t){var n;return null===(n=u.get(h(e)))||void 0===n?void 0:n.data.get(t)},getTranslationNs(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return[o]}return s(e)},getTranslationFallback(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return t}},changeTranslation(t,n,a){var o;const r=null===(o=u.get(h(t)))||void 0===o?void 0:o.data;null==r||r.set(n,a),e.emit(Object.assign(Object.assign({},t),{key:n}))},isFetching(e){if(o())return!0;if(void 0===e)return c.size>0;const t=r(e);return Boolean(Array.from(c.keys()).find((e=>t.includes(p(e).namespace))))},isLoading(e,t){const n=r(t);return Boolean(o()||Array.from(c.keys()).find((t=>{const a=p(t);return(!n.length||n.includes(a.namespace))&&!y.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const o=e.map((e=>{const o=a(e),r=h(o),i=c.get(r);if(i)return{new:!1,promise:i,keyObject:o,cacheKey:r};const s=function(e,t){var a;let o;return t&&(o=null===(a=n(e))||void 0===a?void 0:a.catch((()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),m(e))))),o||(o=m(e)),o}(o,t)||Promise.resolve(void 0);return c.set(r,s),{new:!0,promise:s,keyObject:o,cacheKey:r}}));i.notify(),l.notify();const r=await Promise.all(o.map((e=>e.promise)));return o.forEach(((e,t)=>{const n=c.get(e.cacheKey)!==e.promise;if(e.new&&!n){c.delete(e.cacheKey);const n=r[t];n?y.addRecord(e.keyObject,n):y.getRecord(e.keyObject)||y.addRecord(e.keyObject,{})}})),i.notify(),l.notify(),o.map((e=>y.getRecord(e.keyObject)))},getAllRecords:()=>Array.from(u.entries()).map((([e,t])=>Object.assign(Object.assign({},p(e)),{data:t.data})))});return y}function m(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}const y="invalid",b={defaultNs:"",observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:y,apiUrl:"https://app.tolgee.io",fetch:u(),onTranslationMissing:({key:e})=>e},E=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function O(e,t){const n=E(b,null==t?void 0:t.initialOptions,e);return n.apiUrl=l(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=u(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function L(e,a,o,r,i,s,l,c){const u={ui:void 0},g={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},d=async({keysAndDefaults:e,event:t})=>{var n;const a=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:r(t),namespace:i({key:e,ns:t})[0],translation:s({key:e,ns:t})})));null===(n=g.ui)||void 0===n||n.handleElementClick(a,t)},f=(e,t)=>{var n;return(null===(n=g.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function p(e){const t=s({key:e.key,ns:e.ns});return N.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:a().fetch}}function v(e){g.observer=null==e?void 0:e()}function b(){return Boolean(g.observer)}function E(e){e&&g.formatters.push(e)}function O(e){g.finalFormatter=e}function L(e){u.ui=e}function w(){return Boolean(u.ui)}function A(e){g.languageStorage=e}function k(e){g.languageDetector=e}function T(e){e&&g.backends.push(e)}function j(e){g.devBackend=e}const N=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:O,addFormatter:E,setObserver:v,hasObserver:b,setUi:L,hasUi:w,setDevBackend:j,addBackend:T,setLanguageDetector:k,setLanguageStorage:A}))},run(){var e,t;const{apiKey:n,apiUrl:o,projectId:r,observerOptions:i}=a();g.ui=null===(e=u.ui)||void 0===e?void 0:e.call(u,{apiKey:n,apiUrl:o,projectId:r,highlight:N.highlight,changeTranslation:l,findPositions:f,onPermanentChange:c}),null===(t=g.observer)||void 0===t||t.run({mouseHighlight:!0,options:i,translate:p,onClick:d})},stop(){var e;g.ui=void 0,null===(e=g.observer)||void 0===e||e.stop()},getLanguageStorage:()=>g.languageStorage,getInitialLanguage(){var e;const t=o();return n(null===(e=g.languageStorage)||void 0===e?void 0:e.getLanguage(h()),(e=>t&&!t.includes(e)||!e?function(){if(!g.languageDetector)return;const e=o();return g.languageDetector.getLanguage(Object.assign({availableLanguages:e},h()))}():e))},setStoredLanguage(e){var t;null===(t=g.languageStorage)||void 0===t||t.setLanguage(e,h())},getDevBackend:()=>g.devBackend,getBackendRecord:({language:e,namespace:n})=>{for(const a of g.backends){const o=a.getRecord(Object.assign({language:e,namespace:n},h()));if(t(o))return null==o?void 0:o.catch((e=>(console.error(e),{})));if(void 0!==o)return o}},getBackendDevRecord:({language:e,namespace:t})=>{var n;const{apiKey:o,apiUrl:r,projectId:i}=a();return null===(n=g.devBackend)||void 0===n?void 0:n.getRecord(Object.assign({apiKey:o,apiUrl:r,projectId:i,language:e,namespace:t},h()))},getLanguageDetector:()=>g.languageDetector,retranslate(){var e;null===(e=g.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=g.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(N.getDevBackend()),formatTranslation(t){var n,{formatEnabled:o}=t,r=m(t,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:c,params:u,ns:d,orEmpty:f}=r,p=null!=s?s:l;let h="";null==s&&(h=a().onTranslationMissing(r));let v=null!=p?p:f?"":h;const b=e(),E=o||!(null===(n=g.observer)||void 0===n?void 0:n.outputNotFormattable),O=e=>g.observer&&!c?g.observer.wrap({key:i,translation:e,defaultValue:l,params:u,ns:d}):e;v=O(v);try{if(p&&b&&E)for(const e of g.formatters)v=e.format({translation:v,language:b,params:u});g.finalFormatter&&p&&b&&E&&(v=g.finalFormatter.format({translation:v,language:b,params:u}))}catch(e){console.error(e);const t=("string"==typeof(L=e)?L:"string"==typeof(null==L?void 0:L.message)?L.message:void 0)||y,n=a().onFormatError,o=typeof n;v="string"===o?n:"function"===o?n(t,r):y,v=O(v)}var L;return v}});return N}const w=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const A=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:o,language:r}=e,i=m(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:r};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function k({options:e}){const o=function(e,t){let n=!0;function a(){return n}const o=Object.freeze({onPendingLanguageChange:g(a),onLanguageChange:g(a),onLoadingChange:g(a),onFetchingChange:g(a),onInitialLoaded:g(a),onRunningChange:g(a),onCacheChange:g(a),onUpdate:d(a,e,t),onPermanentChange:g(a),setEmitterActive(e){n=e},on:(e,t)=>{switch(e){case"pendingLanguage":return o.onPendingLanguageChange.listen(t);case"language":return o.onLanguageChange.listen(t);case"loading":return o.onLoadingChange.listen(t);case"fetching":return o.onFetchingChange.listen(t);case"initialLoad":return o.onInitialLoaded.listen(t);case"running":return o.onRunningChange.listen(t);case"cache":return o.onCacheChange.listen(t);case"update":return o.onUpdate.listen(t);case"permanentChange":return o.onPermanentChange.listen(t)}}});return o.onInitialLoaded.listen((()=>o.onUpdate.emit())),o.onLanguageChange.listen((()=>o.onUpdate.emit())),o.onCacheChange.listen((({value:e})=>o.onUpdate.emit([e.namespace],!0))),o}(b,E),c=w(!1,(()=>m.isFetching()),o.onFetchingChange.emit),u=w(!1,(()=>S.isLoading()),o.onLoadingChange.emit),f=function(e,t,n){let a,o=O();const c=Object.freeze({init(e){o=O(e,o)},isRunning:()=>o.isRunning,setRunning(e){o.isRunning!==e&&(o.isRunning=e,n.emit(e))},isInitialLoading:()=>o.isInitialLoading,setInitialLoading(e){o.isInitialLoading=e},getLanguage:()=>o.language||o.initialOptions.language,setLanguage(t){o.language!==t&&(o.language=t,e.emit(t))},getPendingLanguage:()=>o.pendingLanguage||c.getLanguage(),setPendingLanguage(e){o.pendingLanguage!==e&&(o.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},o.initialOptions),a),addActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t?o.activeNamespaces.set(e,t+1):o.activeNamespaces.set(e,1)}))},removeActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t&&t>1?o.activeNamespaces.set(e,t-1):o.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>s([...o.initialOptions.ns||[o.initialOptions.defaultNs],...r(o.initialOptions.fallbackNs),...o.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||c.getLanguage();return t?s([t,...i(t,o.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>r(o.initialOptions.fallbackNs),getDefaultNs:e=>void 0===e?o.initialOptions.defaultNs:e,getAvailableLanguages(){if(o.initialOptions.availableLanguages)return o.initialOptions.availableLanguages;if(o.initialOptions.staticData){const e=Object.keys(o.initialOptions.staticData).map((e=>p(e).language));return Array.from(new Set(e))}},withDefaultNs:e=>({namespace:void 0===e.namespace?c.getInitialOptions().defaultNs:e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:l(e.apiUrl)}):void 0}});return c}(o.onLanguageChange,o.onPendingLanguageChange,o.onRunningChange),h=L(f.getLanguage,f.getInitialOptions,f.getAvailableLanguages,k,C,R,j,(function(e){o.onPermanentChange.emit({key:e.key,namespace:e.namespace})})),m=v(o.onCacheChange,h.getBackendRecord,h.getBackendDevRecord,f.withDefaultNs,f.isInitialLoading,c,u);let y;function b(){return f.getFallbackNs()}function E(e){return f.getDefaultNs(e)}function k(e){return[...r(E(e)),...b()]}function T(e){return[...r(null!=e?e:E()),...f.getRequiredNamespaces()]}function j(e,t,n){const a=f.withDefaultNs(e),o=m.getTranslation(a,t);return m.changeTranslation(a,t,n),{revert(){m.changeTranslation(a,t,o)}}}function N(e){f.init(e),m.addStaticData(f.getInitialOptions().staticData)}function x(e,t){const a=function(e,t){const n=f.getFallbackLangs(e),a=T(t),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t},!0)||o.push({language:e,namespace:t})}))})),o}(e,t);if(a.length)return n(S.loadRecords(a),(()=>{}))}function C({key:e,ns:t}){const n=f.getFallbackLangs(),a=k(null!=t?t:void 0);return m.getTranslationNs(a,n,e)}function R({key:e,ns:t,language:n}){const a=k(null!=t?t:void 0),o=f.getFallbackLangs(n);return m.getTranslationFallback(a,o,e)}function P(){const e=n(function(){if(f.getLanguage())return;return n(h.getInitialLanguage(),(e=>{const t=e||f.getInitialOptions().defaultLanguage;t&&f.setLanguage(t)}))}(),(()=>x()));if(t(e))return f.setInitialLoading(!0),c.notify(),u.notify(),Promise.resolve(e).then((()=>{f.setInitialLoading(!1),c.notify(),u.notify(),o.onInitialLoaded.emit()}));o.onInitialLoaded.emit()}e&&N(e),o.onUpdate.listen((()=>{f.isRunning()&&h.retranslate()}));const S=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),f),h),m),{init:N,getTranslation:R,changeTranslation:j,getTranslationNs:C,getDefaultAndFallbackNs:k,async changeLanguage(e){f.getPendingLanguage()===e&&f.getLanguage()===e||(f.setPendingLanguage(e),f.isRunning()&&await x(e),e===f.getPendingLanguage()&&(f.setLanguage(e),h.setStoredLanguage(e)))},async addActiveNs(e,t){t||f.addActiveNs(e),f.isRunning()&&await x(void 0,e)},loadRecords:e=>m.loadRecords(e,S.isDev()),loadRecord:async e=>(await S.loadRecords([e]))[0],isLoading:e=>m.isLoading(f.getLanguage(),e),isLoaded(e){const t=f.getLanguage();if(!t)return!1;const n=f.getFallbackLangs(t),a=T(e),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=A(...e),n=R(t);return h.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(f.getInitialOptions().apiKey&&f.getInitialOptions().apiUrl),run:()=>(function(){if((h.getLanguageDetector()||h.getLanguageStorage())&&!f.getAvailableLanguages())throw new Error(a("availableLanguages"));if(!f.getLanguage()&&!f.getInitialOptions().defaultLanguage)throw new Error(a(["defaultLanguage","language"]))}(),f.isRunning()||(f.setRunning(!0),h.run(),y=P()),Promise.resolve(y)),stop(){f.isRunning()&&(h.stop(),f.setRunning(!1))}}));return S}const T=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=E(e.options,n),t),init(t){const n=function(e){const t=k({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,onNsUpdate:t.onUpdate.listenSome,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(E(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},j=0,N=1,x=2;class C extends Error{constructor(e,t,n){let a;a=e===j?"Empty parameter":e===N?"Unexpected character":"Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`),this.code=e,this.index=t}}function R(e){return/\s/.test(e)}const P=0,S=1,D=2,_=3,I=4,U=new Set([D,S,P]),F="'",$=new Set(["{","}",F]),M=e=>/[0-9a-zA-Z_]/.test(e);function B(e,t){const[n,a]=function(e){let t=P,n="",a="",o="";const r=[],i=[];let s=0;function l(t){throw new C(t,s,e)}const c=()=>{r.push(n),n=""},u=()=>{""===a&&l(j),i.push(a),a=""};for(s=0;s<e.length;s++)switch(o=e[s],t){case P:o===F?(n+=o,t=S):"{"===o?(c(),t=_):(n+=o,t=P);break;case S:$.has(o)?(n=n.slice(0,-1)+o,t=D):(n+=o,t=P);break;case D:o===F?t=P:(n+=o,t=D);break;case _:"}"===o?(u(),t=P):R(o)?""!==a&&(u(),t=I):(M(o)||l(N),a+=o,t=_);break;case I:"}"==o?t=P:R(o)?t=I:l(N)}return U.has(t)||l(x),c(),[r,i]}(e),o=[n[0]];for(let r=1;r<n.length;r++){const i=null==t?void 0:t[a[r-1]];if(void 0===i)throw new Error(`Missing parameter "${a[r-1]}" in "${e}"`);o.push(String(i)),o.push(n[r])}return o.join("")}const K="__tolgee_dev_tools",V="data-tolgee-key-only",z="data-tolgee-restricted",W="_tolgee",G="_tolgee-highlighter";function Y(){var e,t;return void 0===(null===(t=null===(e=globalThis.window)||void 0===e?void 0:e.document)||void 0===t?void 0:t.createElement)}function H(e){if(Y())throw new Error(`${e}: Can't run on the server`)}function X(e,t){return{oldTextContent:e,keys:t}}const J={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function q({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(G),Object.entries(J).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const r=n.getBoundingClientRect();o.style.borderWidth=t+"px",o.style.top=r.top-t+"px",o.style.left=r.left-t+"px",o.style.width=r.width+"px",o.style.height=r.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null===(e=t.highlightEl)||void 0===e||e.remove(),t.highlightEl=void 0}}(0,a)}})}function Z(e){return e.textContent}function Q(e,t){e.textContent=t}function ee(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,o=void 0===e.ns||void 0===t.ns||-1!==(null===(n=e.ns)||void 0===n?void 0:n.findIndex((e=>{var n;return null===(n=t.ns)||void 0===n?void 0:n.includes(e)})));return a&&o}const te={capture:!0},ne={capture:!0,passive:!0},ae=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function oe({highlightKeys:e,elementStore:t,onClick:n,options:a}){var o,r;const i=new Set;let s,l,c=[];const u=(null===(o=a.targetElement)||void 0===o?void 0:o.getRootNode())||document,g=(null===(r=a.targetElement)||void 0===r?void 0:r.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null===(e=n.unhighlight)||void 0===e||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=w(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null===(n=a.highlight)||void 0===n||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of ae.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(w(t,(e=>e.id===K))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null===(e=null==n?void 0:n.highlight)||void 0===e||e.call(n)}function O(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(e,s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function w(e,t){return e.id===K?null:t(e)?e:(null==e?void 0:e.parentElement)?w(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,te),L("keyup",b,te),L("mousemove",m,ne),L("scroll",E,ne),L("click",O,te),L("mouseenter",v,te),L("mouseover",v,te),L("mouseout",v,te),L("mouseleave",v,te),L("mousedown",v,te),L("mouseup",v,te)}})}function re(e,t,n){const a=q({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=oe({highlightKeys:e.highlightKeys,elementStore:t,onClick(e,a){const o=t.get(a);n({event:e,keysAndDefaults:s(o)})},options:e});function i(e,n){var a;n.highlightEl&&(null===(a=n.unhighlight)||void 0===a||a.call(n)),e.removeAttribute(W),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({register(n,o,r){if(function(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${z}]`)}(n))return;const i=n;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(W,"true")),s.nodes.set(o,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===V&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>ee({key:e,ns:o(n)},{key:t.key,ns:o(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null===(n=t.unhighlight)||void 0===n||n.call(t))}))}})}function ie(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:o,onClick:r}){if(Y())return{stop(){t=!1},wrapper:o};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var o,r;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!==(o=s[e.tagName.toUpperCase()])&&void 0!==o?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null===(t=s[e.tagName.toUpperCase()])||void 0===t?void 0:t.some((t=>e.hasAttribute(t))))||(null===(n=s["*"])||void 0===n?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!==(r=s[n.tagName.toUpperCase()])&&void 0!==r?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,o),l=re(a,n,r);function c(e){for(const t of e){const e=Z(t),n=e?o.unwrap(e):null;if(n){const{text:a,keys:o}=n;Q(t,a);const r=X(e,o),s=i.getSuitableParent(t);l.register(s,t,r)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:Z(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===V)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(V);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(V)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(V))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===V))&&l.cleanupLingeringKeyAttributes();const o=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>o.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>o.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>o.delete(e)));break;case"attributes":t.attributeName===V&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>o.add(e)))}c([...o])})),f=a.targetElement||document.body;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(V),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:o}}const r=Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null===(a=null===(n=null==e?void 0:e.elementRegistry)||void 0===n?void 0:n.forEachElement)||void 0===a||a.call(n,t)},highlight(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[];return o.forEach((e=>{var t;return null===(t=e.highlight)||void 0===t?void 0:t.call(e)})),{unhighlight(){o.forEach((e=>{var t;return null===(t=e.unhighlight)||void 0===t?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[],i=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{ee({key:t,ns:o(n)},{key:e.key,ns:o(e.ns)})&&i.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),i},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""});return r}var se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},le={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),o=[],r=0;;){var i=t<e.length;if(!i||r>=n-1){var s=a.subarray(0,r);if(o.push(String.fromCharCode.apply(null,s)),!i)return o.join("");e=e.subarray(t),t=0,r=0}var l=e[t++];if(0==(128&l))a[r++]=l;else if(192==(224&l)){var c=63&e[t++];a[r++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[r++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[r++]=g>>>10&1023|55296,g=56320|1023&g),a[r++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,r=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,o=Math.max(32,n+(n>>>1)+7),r=new Uint8Array(o>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>r.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(o);l.set(r),r=l}if(0!=(4294967168&i)){if(0==(4294965248&i))r[a++]=i>>>6&31|192;else if(0==(4294901760&i))r[a++]=i>>>12&15|224,r[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;r[a++]=i>>>18&7|240,r[a++]=i>>>12&63|128,r[a++]=i>>>6&63|128}r[a++]=63&i|128}else r[a++]=i}return r.slice?r.slice(0,a):r.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),r(e)};var s=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;o?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:se);var ce,ue=e({__proto__:null,default:le},[le]);null===(ce=console.assert)||void 0===ce||ce.call(console,ue);const ge=["‌","‍"],de=RegExp(`([${ge.join("")}]{9})+`,"gu");function fe(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>ge[Number(e)])).join("")}function pe(e){const t=Array.from(e).map((e=>ge.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function he({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null===(t=e.match(de))||void 0===t?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(pe))||[]}(e);a.forEach((e=>{const a=function(e){if(e.length<=4){const[n]=function(e){const t=[];for(const n of e)t.push(n.codePointAt(0));return t}(e);return t.numberToValue(n)}return e}(e),o=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(a);if(o){const{k:e,d:t,n:a}=o;n.push({key:e,defaultValue:t,ns:a})}}));const o=function(e){return e.replace(de,"")}(e);return{text:o,keys:n}},wrap({key:a,defaultValue:o,translation:r,ns:i}){let s;if(e){s=fe(n({key:a,ns:i}))}else{const e=n({key:a,ns:i,defaultValue:o}),r=t.valueToNumber(e);s=fe(String.fromCodePoint(r))}const l=r||"";return"string"==typeof l?l+s:l},testTextNode(e){var t,n,a;return null!==(a=(null===(t=e.textContent)||void 0===t?void 0:t.includes(`${ge[0]}${ge[0]}`))||(null===(n=e.textContent)||void 0===n?void 0:n.includes(`${ge[1]}${ge[0]}`)))&&void 0!==a&&a},testAttribute:e=>e.value.includes(`${ge[0]}${ge[0]}`)||e.value.includes(`${ge[1]}${ge[0]}`)})}function ve(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function me({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:o,ns:r}=function(e){let t=!1,n="",a="",o="KEY";const r={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{r.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==o||","!==s?"KEY"!==o||"|"!==s?"NAMESPACE"!==o||","!==s?"KEY"!==o||":"!==s?"DEFAULT_VALUE"!==o||":"!==s?"PARAM_NAME"!==o||":"!==s?"PARAM_VALUE"!==o||","!==s?n+=s:(o="PARAM_NAME",r.params[a]=n,n=""):(o="PARAM_VALUE",a=n,n=""):(o="PARAM_NAME",r.defaultValue=n,n=""):(o="PARAM_NAME",r.key=n,n=""):(o="DEFAULT_VALUE",i(n),n=""):(o="NAMESPACE",r.key=n,n=""):(o="DEFAULT_VALUE",r.key=n,n=""):t=!0;return"KEY"===o&&(r.key=n),"DEFAULT_VALUE"===o&&(r.defaultValue=n),"PARAM_VALUE"===o&&(r.params[a]=n),"NAMESPACE"===o&&i(n),r}(e);return{translated:n({key:t,params:a,defaultValue:o,ns:r,noWrap:!0}),key:t,params:a,defaultValue:o,ns:r}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){return"string"==typeof e?e.replace(/[,:|\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:o,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${r(e)}:${r(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==o?`,${r(o)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>r(e))).join("|")}`:"";return`${e}${r(n)}${u}${l}${s}${t}`},unwrap(n){const r=new RegExp(`(\\\\?)(${o(e)}(.*?)${o(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=r.exec(n));){let e=s[1];const[t,o,r,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!ve(d,n)){u+=r;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,o,r;return null!==(r=(null===(a=n.textContent)||void 0===a?void 0:a.includes(e))&&(null===(o=n.textContent)||void 0===o?void 0:o.includes(t)))&&void 0!==r&&r},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const ye="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function be(e){const t=ye.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function Ee(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,o=0;const r=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|be(e[i]),n+=5,n>=8&&(r[o++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",o=Math.pow(2,16)-1;for(let e=0;e<n;e+=o)e+o>n&&(o=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+o));return a}(r.buffer)}function Oe(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=Ee(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function Le({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:o=300}){let r=!1;const i=()=>new Promise(((a,r)=>{const i=function(e,t){const n=n=>{var a,o;e.includes(null===(a=n.data)||void 0===a?void 0:a.type)&&t(null===(o=n.data)||void 0===o?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),r()}),o);function l(){i.unsubscribe()}}));return{cancel(){r=!0},promise:(async()=>{for(let e=0;e<a;e++){if(r)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!r)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}const we="tolgee-in-context-tools.umd.min.js",Ae="@tolgee/in-context-tools",ke="InContextTools",Te="https://cdn.jsdelivr.net/npm";let je=null;function Ne(e){var t;return je||(je=(t=`${Te}/@tolgee/web@${e}/dist/${we}`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.body.appendChild(a)}))).then((()=>window[Ae][ke]))),je}const xe="__tolgee_apiKey",Ce="__tolgee_apiUrl";function Re(){const e=sessionStorage.getItem(xe)||void 0,t=sessionStorage.getItem(Ce)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Pe(){sessionStorage.removeItem(xe),sessionStorage.removeItem(Ce)}exports.BrowserExtensionPlugin=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(exports.BrowserExtensionPlugin=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=Le({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Pe)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return Re()&&(async()=>{const e=await Ne("5.19.3");return t=>{const n=Re();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Se="__tolgee_currentLanguage";function De(e){return e.endsWith("/")?e.slice(0,-1):e}const _e={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${De(n)}/${e}/${t}.json`:`${De(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"}};function Ie(e){const t=Object.assign(Object.assign(Object.assign({},_e),e),{headers:Object.assign(Object.assign({},_e.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:o,headers:r}=t,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(t,["prefix","getPath","getData","headers"]);return{getRecord:({namespace:e,language:t,fetch:s})=>s(a({namespace:e,language:t,prefix:n}),Object.assign({headers:r},i)).then((e=>{if(!e.ok)throw new Error(`${e.url} ${e.status}`);return o(e)}))}}exports.BackendFetch=e=>(t,n)=>(n.addBackend(Ie(e)),t),exports.DEVTOOLS_ID=K,exports.DevBackend=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:o,fetch:r}){var i;const s=null!==(i=Oe(t))&&void 0!==i?i:o;let l=void 0!==s?`${e}/v2/projects/${s}/translations/${n}`:`${e}/v2/projects/translations/${n}`;if(a&&(l+=`?ns=${a}`),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===o)throw new Error("You need to specify 'projectId' when using PAT key");return r(l,{headers:{"X-API-Key":t||"","Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e),exports.DevTools=()=>e=>e,exports.FormatSimple=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>B(e,t)}),e),exports.LanguageDetector=()=>(e,t)=>(t.setLanguageDetector({getLanguage({availableLanguages:e}){H("LanguageDetector");const t=window.navigator.language,n=e.find((e=>e===t));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),o=a(window.navigator.language);return e.find((e=>a(e)===o))||void 0}}),e),exports.LanguageStorage=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(H("LanguageStorage"),localStorage.getItem(Se)||void 0),setLanguage(e){H("LanguageStorage"),localStorage.setItem(Se,e)}}),e),exports.ObserverPlugin=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=ie();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=me({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&Q(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=ie();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=he({fullKeyEncode:t.options.fullKeyEncode});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),exports.PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY="__tolgee_preferredLanguages",exports.TOLGEE_ATTRIBUTE_NAME=W,exports.TOLGEE_RESTRICT_ATTRIBUTE=z,exports.TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE=V,exports.Tolgee=function(){return T().use(exports.BrowserExtensionPlugin())},exports.TolgeeCore=T,exports.createFetchFunction=u,exports.getFallback=o,exports.getFallbackArray=r,exports.getProjectIdFromApiKey=Oe,exports.getTranslateProps=A;
"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function t(e){return Boolean(e&&"function"==typeof e.then)}function n(e,n){return t(e)?Promise.resolve(e).then(n):n(e)}function a(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function o(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function r(e){return o(e)||[]}function i(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?r(t):r(null==t?void 0:t[e]);var n}function s(e){return Array.from(new Set(e))}function l(e){return e?e.replace(/\/+$/,""):e}Object.defineProperty(exports,"__esModule",{value:!0});const c=(e,t)=>fetch(e,t),u=(e=c)=>(t,n)=>e(t,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.19.4"},null==n?void 0:n.headers)}));function g(e){let t=[];return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(n){e()&&t.forEach((e=>e({value:n})))}})}function d(e,t,n){const a=new Set,o=new Set;let i=[];function s(){if(0===i.length)return;const e=i;i=[],a.forEach((e=>{e({value:void 0})}));let n=new Set;e.forEach((e=>{void 0===e?n=void 0:void 0!==n&&e.forEach((e=>n.add(e)))}));!function(e){const n=new Set(t());o.forEach((t=>{(void 0===e||-1!==(null==e?void 0:e.findIndex((e=>n.has(e)||t.namespaces.has(e)))))&&t.fn({value:void 0})}))}(n?Array.from(n.keys()):void 0)}return Object.freeze({emit(t,n){e()&&(i.push(t),n?setTimeout(s,0):s())},listen(e){a.add(e);return{unsubscribe:()=>{a.delete(e)}}},listenSome(e){const t={fn:t=>{e(t)},namespaces:new Set};o.add(t);const a={unsubscribe:()=>{o.delete(t)},subscribeNs:e=>(r(e).forEach((e=>t.namespaces.add(e))),void 0===e&&t.namespaces.add(n()),a)};return a}})}const f=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):f(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},p=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},h=({language:e,namespace:t})=>t?`${e}:${t}`:e;function v(e,t,n,a,o,i,l){const c=new Map,u=new Map;let g={},d=0;function v(t,n,a){const o=h(t);u.set(o,{data:f(n),version:a}),e.emit(t)}function m(e){let n;if(!n){const t=g[h(e)];"function"==typeof t&&(n=t())}return n||(n=t(e)),n}const y=Object.freeze({addStaticData(e){e&&(g=Object.assign(Object.assign({},g),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=p(e),a=u.get(e);a&&0!==a.version||v(n,t,0)}})))},invalidate(){c.clear(),d+=1},addRecord(e,t){v(e,t,d)},exists(e,t=!1){const n=u.get(h(e));return n&&t?n.version===d:Boolean(n)},getRecord(e){var t;return null===(t=u.get(h(a(e))))||void 0===t?void 0:t.data},getTranslation(e,t){var n;return null===(n=u.get(h(e)))||void 0===n?void 0:n.data.get(t)},getTranslationNs(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return[o]}return s(e)},getTranslationFallback(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return t}},changeTranslation(t,n,a){var o;const r=null===(o=u.get(h(t)))||void 0===o?void 0:o.data;null==r||r.set(n,a),e.emit(Object.assign(Object.assign({},t),{key:n}))},isFetching(e){if(o())return!0;if(void 0===e)return c.size>0;const t=r(e);return Boolean(Array.from(c.keys()).find((e=>t.includes(p(e).namespace))))},isLoading(e,t){const n=r(t);return Boolean(o()||Array.from(c.keys()).find((t=>{const a=p(t);return(!n.length||n.includes(a.namespace))&&!y.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const o=e.map((e=>{const o=a(e),r=h(o),i=c.get(r);if(i)return{new:!1,promise:i,keyObject:o,cacheKey:r};const s=function(e,t){var a;let o;return t&&(o=null===(a=n(e))||void 0===a?void 0:a.catch((()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),m(e))))),o||(o=m(e)),o}(o,t)||Promise.resolve(void 0);return c.set(r,s),{new:!0,promise:s,keyObject:o,cacheKey:r}}));i.notify(),l.notify();const r=await Promise.all(o.map((e=>e.promise)));return o.forEach(((e,t)=>{const n=c.get(e.cacheKey)!==e.promise;if(e.new&&!n){c.delete(e.cacheKey);const n=r[t];n?y.addRecord(e.keyObject,n):y.getRecord(e.keyObject)||y.addRecord(e.keyObject,{})}})),i.notify(),l.notify(),o.map((e=>y.getRecord(e.keyObject)))},getAllRecords:()=>Array.from(u.entries()).map((([e,t])=>Object.assign(Object.assign({},p(e)),{data:t.data})))});return y}function m(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}const y="invalid",b={defaultNs:"",observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:y,apiUrl:"https://app.tolgee.io",fetch:u(),onTranslationMissing:({key:e})=>e},E=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function O(e,t){const n=E(b,null==t?void 0:t.initialOptions,e);return n.apiUrl=l(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=u(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function L(e,a,o,r,i,s,l,c){const u={ui:void 0},g={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},d=async({keysAndDefaults:e,event:t})=>{var n;const a=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:r(t),namespace:i({key:e,ns:t})[0],translation:s({key:e,ns:t})})));null===(n=g.ui)||void 0===n||n.handleElementClick(a,t)},f=(e,t)=>{var n;return(null===(n=g.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function p(e){const t=s({key:e.key,ns:e.ns});return N.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:a().fetch}}function v(e){g.observer=null==e?void 0:e()}function b(){return Boolean(g.observer)}function E(e){e&&g.formatters.push(e)}function O(e){g.finalFormatter=e}function L(e){u.ui=e}function w(){return Boolean(u.ui)}function A(e){g.languageStorage=e}function k(e){g.languageDetector=e}function T(e){e&&g.backends.push(e)}function j(e){g.devBackend=e}const N=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:O,addFormatter:E,setObserver:v,hasObserver:b,setUi:L,hasUi:w,setDevBackend:j,addBackend:T,setLanguageDetector:k,setLanguageStorage:A}))},run(){var e,t;const{apiKey:n,apiUrl:o,projectId:r,observerOptions:i}=a();g.ui=null===(e=u.ui)||void 0===e?void 0:e.call(u,{apiKey:n,apiUrl:o,projectId:r,highlight:N.highlight,changeTranslation:l,findPositions:f,onPermanentChange:c}),null===(t=g.observer)||void 0===t||t.run({mouseHighlight:!0,options:i,translate:p,onClick:d})},stop(){var e;g.ui=void 0,null===(e=g.observer)||void 0===e||e.stop()},getLanguageStorage:()=>g.languageStorage,getInitialLanguage(){var e;const t=o();return n(null===(e=g.languageStorage)||void 0===e?void 0:e.getLanguage(h()),(e=>t&&!t.includes(e)||!e?function(){if(!g.languageDetector)return;const e=o();return g.languageDetector.getLanguage(Object.assign({availableLanguages:e},h()))}():e))},setStoredLanguage(e){var t;null===(t=g.languageStorage)||void 0===t||t.setLanguage(e,h())},getDevBackend:()=>g.devBackend,getBackendRecord:({language:e,namespace:n})=>{for(const a of g.backends){const o=a.getRecord(Object.assign({language:e,namespace:n},h()));if(t(o))return null==o?void 0:o.catch((e=>(console.error(e),{})));if(void 0!==o)return o}},getBackendDevRecord:({language:e,namespace:t})=>{var n;const{apiKey:o,apiUrl:r,projectId:i}=a();return null===(n=g.devBackend)||void 0===n?void 0:n.getRecord(Object.assign({apiKey:o,apiUrl:r,projectId:i,language:e,namespace:t},h()))},getLanguageDetector:()=>g.languageDetector,retranslate(){var e;null===(e=g.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=g.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(N.getDevBackend()),formatTranslation(t){var n,{formatEnabled:o}=t,r=m(t,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:c,params:u,ns:d,orEmpty:f}=r,p=null!=s?s:l;let h="";null==s&&(h=a().onTranslationMissing(r));let v=null!=p?p:f?"":h;const b=e(),E=o||!(null===(n=g.observer)||void 0===n?void 0:n.outputNotFormattable),O=e=>g.observer&&!c?g.observer.wrap({key:i,translation:e,defaultValue:l,params:u,ns:d}):e;v=O(v);try{if(p&&b&&E)for(const e of g.formatters)v=e.format({translation:v,language:b,params:u});g.finalFormatter&&p&&b&&E&&(v=g.finalFormatter.format({translation:v,language:b,params:u}))}catch(e){console.error(e);const t=("string"==typeof(L=e)?L:"string"==typeof(null==L?void 0:L.message)?L.message:void 0)||y,n=a().onFormatError,o=typeof n;v="string"===o?n:"function"===o?n(t,r):y,v=O(v)}var L;return v}});return N}const w=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const A=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:o,language:r}=e,i=m(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:r};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function k({options:e}){const o=function(e,t){let n=!0;function a(){return n}const o=Object.freeze({onPendingLanguageChange:g(a),onLanguageChange:g(a),onLoadingChange:g(a),onFetchingChange:g(a),onInitialLoaded:g(a),onRunningChange:g(a),onCacheChange:g(a),onUpdate:d(a,e,t),onPermanentChange:g(a),setEmitterActive(e){n=e},on:(e,t)=>{switch(e){case"pendingLanguage":return o.onPendingLanguageChange.listen(t);case"language":return o.onLanguageChange.listen(t);case"loading":return o.onLoadingChange.listen(t);case"fetching":return o.onFetchingChange.listen(t);case"initialLoad":return o.onInitialLoaded.listen(t);case"running":return o.onRunningChange.listen(t);case"cache":return o.onCacheChange.listen(t);case"update":return o.onUpdate.listen(t);case"permanentChange":return o.onPermanentChange.listen(t)}}});return o.onInitialLoaded.listen((()=>o.onUpdate.emit())),o.onLanguageChange.listen((()=>o.onUpdate.emit())),o.onCacheChange.listen((({value:e})=>o.onUpdate.emit([e.namespace],!0))),o}(b,E),c=w(!1,(()=>m.isFetching()),o.onFetchingChange.emit),u=w(!1,(()=>S.isLoading()),o.onLoadingChange.emit),f=function(e,t,n){let a,o=O();const c=Object.freeze({init(e){o=O(e,o)},isRunning:()=>o.isRunning,setRunning(e){o.isRunning!==e&&(o.isRunning=e,n.emit(e))},isInitialLoading:()=>o.isInitialLoading,setInitialLoading(e){o.isInitialLoading=e},getLanguage:()=>o.language||o.initialOptions.language,setLanguage(t){o.language!==t&&(o.language=t,e.emit(t))},getPendingLanguage:()=>o.pendingLanguage||c.getLanguage(),setPendingLanguage(e){o.pendingLanguage!==e&&(o.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},o.initialOptions),a),addActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t?o.activeNamespaces.set(e,t+1):o.activeNamespaces.set(e,1)}))},removeActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t&&t>1?o.activeNamespaces.set(e,t-1):o.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>s([...o.initialOptions.ns||[o.initialOptions.defaultNs],...r(o.initialOptions.fallbackNs),...o.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||c.getLanguage();return t?s([t,...i(t,o.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>r(o.initialOptions.fallbackNs),getDefaultNs:e=>void 0===e?o.initialOptions.defaultNs:e,getAvailableLanguages(){if(o.initialOptions.availableLanguages)return o.initialOptions.availableLanguages;if(o.initialOptions.staticData){const e=Object.keys(o.initialOptions.staticData).map((e=>p(e).language));return Array.from(new Set(e))}},withDefaultNs:e=>({namespace:void 0===e.namespace?c.getInitialOptions().defaultNs:e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:l(e.apiUrl)}):void 0}});return c}(o.onLanguageChange,o.onPendingLanguageChange,o.onRunningChange),h=L(f.getLanguage,f.getInitialOptions,f.getAvailableLanguages,k,C,R,j,(function(e){o.onPermanentChange.emit({key:e.key,namespace:e.namespace})})),m=v(o.onCacheChange,h.getBackendRecord,h.getBackendDevRecord,f.withDefaultNs,f.isInitialLoading,c,u);let y;function b(){return f.getFallbackNs()}function E(e){return f.getDefaultNs(e)}function k(e){return[...r(E(e)),...b()]}function T(e){return[...r(null!=e?e:E()),...f.getRequiredNamespaces()]}function j(e,t,n){const a=f.withDefaultNs(e),o=m.getTranslation(a,t);return m.changeTranslation(a,t,n),{revert(){m.changeTranslation(a,t,o)}}}function N(e){f.init(e),m.addStaticData(f.getInitialOptions().staticData)}function x(e,t){const a=function(e,t){const n=f.getFallbackLangs(e),a=T(t),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t},!0)||o.push({language:e,namespace:t})}))})),o}(e,t);if(a.length)return n(S.loadRecords(a),(()=>{}))}function C({key:e,ns:t}){const n=f.getFallbackLangs(),a=k(null!=t?t:void 0);return m.getTranslationNs(a,n,e)}function R({key:e,ns:t,language:n}){const a=k(null!=t?t:void 0),o=f.getFallbackLangs(n);return m.getTranslationFallback(a,o,e)}function P(){const e=n(function(){if(f.getLanguage())return;return n(h.getInitialLanguage(),(e=>{const t=e||f.getInitialOptions().defaultLanguage;t&&f.setLanguage(t)}))}(),(()=>x()));if(t(e))return f.setInitialLoading(!0),c.notify(),u.notify(),Promise.resolve(e).then((()=>{f.setInitialLoading(!1),c.notify(),u.notify(),o.onInitialLoaded.emit()}));o.onInitialLoaded.emit()}e&&N(e),o.onUpdate.listen((()=>{f.isRunning()&&h.retranslate()}));const S=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),f),h),m),{init:N,getTranslation:R,changeTranslation:j,getTranslationNs:C,getDefaultAndFallbackNs:k,async changeLanguage(e){f.getPendingLanguage()===e&&f.getLanguage()===e||(f.setPendingLanguage(e),f.isRunning()&&await x(e),e===f.getPendingLanguage()&&(f.setLanguage(e),h.setStoredLanguage(e)))},async addActiveNs(e,t){t||f.addActiveNs(e),f.isRunning()&&await x(void 0,e)},loadRecords:e=>m.loadRecords(e,S.isDev()),loadRecord:async e=>(await S.loadRecords([e]))[0],isLoading:e=>m.isLoading(f.getLanguage(),e),isLoaded(e){const t=f.getLanguage();if(!t)return!1;const n=f.getFallbackLangs(t),a=T(e),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=A(...e),n=R(t);return h.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(f.getInitialOptions().apiKey&&f.getInitialOptions().apiUrl),run:()=>(function(){if((h.getLanguageDetector()||h.getLanguageStorage())&&!f.getAvailableLanguages())throw new Error(a("availableLanguages"));if(!f.getLanguage()&&!f.getInitialOptions().defaultLanguage)throw new Error(a(["defaultLanguage","language"]))}(),f.isRunning()||(f.setRunning(!0),h.run(),y=P()),Promise.resolve(y)),stop(){f.isRunning()&&(h.stop(),f.setRunning(!1))}}));return S}const T=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=E(e.options,n),t),init(t){const n=function(e){const t=k({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,onNsUpdate:t.onUpdate.listenSome,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(E(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},j=0,N=1,x=2;class C extends Error{constructor(e,t,n){let a;a=e===j?"Empty parameter":e===N?"Unexpected character":"Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`),this.code=e,this.index=t}}function R(e){return/\s/.test(e)}const P=0,S=1,D=2,_=3,I=4,U=new Set([D,S,P]),F="'",$=new Set(["{","}",F]),M=e=>/[0-9a-zA-Z_]/.test(e);function B(e,t){const[n,a]=function(e){let t=P,n="",a="",o="";const r=[],i=[];let s=0;function l(t){throw new C(t,s,e)}const c=()=>{r.push(n),n=""},u=()=>{""===a&&l(j),i.push(a),a=""};for(s=0;s<e.length;s++)switch(o=e[s],t){case P:o===F?(n+=o,t=S):"{"===o?(c(),t=_):(n+=o,t=P);break;case S:$.has(o)?(n=n.slice(0,-1)+o,t=D):(n+=o,t=P);break;case D:o===F?t=P:(n+=o,t=D);break;case _:"}"===o?(u(),t=P):R(o)?""!==a&&(u(),t=I):(M(o)||l(N),a+=o,t=_);break;case I:"}"==o?t=P:R(o)?t=I:l(N)}return U.has(t)||l(x),c(),[r,i]}(e),o=[n[0]];for(let r=1;r<n.length;r++){const i=null==t?void 0:t[a[r-1]];if(void 0===i)throw new Error(`Missing parameter "${a[r-1]}" in "${e}"`);o.push(String(i)),o.push(n[r])}return o.join("")}const K="__tolgee_dev_tools",V="data-tolgee-key-only",z="data-tolgee-restricted",W="_tolgee",G="_tolgee-highlighter";function Y(){var e,t;return void 0===(null===(t=null===(e=globalThis.window)||void 0===e?void 0:e.document)||void 0===t?void 0:t.createElement)}function H(e){if(Y())throw new Error(`${e}: Can't run on the server`)}function X(e,t){return{oldTextContent:e,keys:t}}const J={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function q({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(G),Object.entries(J).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const r=n.getBoundingClientRect();o.style.borderWidth=t+"px",o.style.top=r.top-t+"px",o.style.left=r.left-t+"px",o.style.width=r.width+"px",o.style.height=r.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null===(e=t.highlightEl)||void 0===e||e.remove(),t.highlightEl=void 0}}(0,a)}})}function Z(e){return e.textContent}function Q(e,t){e.textContent=t}function ee(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,o=void 0===e.ns||void 0===t.ns||-1!==(null===(n=e.ns)||void 0===n?void 0:n.findIndex((e=>{var n;return null===(n=t.ns)||void 0===n?void 0:n.includes(e)})));return a&&o}const te={capture:!0},ne={capture:!0,passive:!0},ae=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function oe({highlightKeys:e,elementStore:t,onClick:n,options:a}){var o,r;const i=new Set;let s,l,c=[];const u=(null===(o=a.targetElement)||void 0===o?void 0:o.getRootNode())||document,g=(null===(r=a.targetElement)||void 0===r?void 0:r.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null===(e=n.unhighlight)||void 0===e||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=w(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null===(n=a.highlight)||void 0===n||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of ae.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(w(t,(e=>e.id===K))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null===(e=null==n?void 0:n.highlight)||void 0===e||e.call(n)}function O(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(e,s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function w(e,t){return e.id===K?null:t(e)?e:(null==e?void 0:e.parentElement)?w(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,te),L("keyup",b,te),L("mousemove",m,ne),L("scroll",E,ne),L("click",O,te),L("mouseenter",v,te),L("mouseover",v,te),L("mouseout",v,te),L("mouseleave",v,te),L("mousedown",v,te),L("mouseup",v,te)}})}function re(e,t,n){const a=q({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=oe({highlightKeys:e.highlightKeys,elementStore:t,onClick(e,a){const o=t.get(a);n({event:e,keysAndDefaults:s(o)})},options:e});function i(e,n){var a;n.highlightEl&&(null===(a=n.unhighlight)||void 0===a||a.call(n)),e.removeAttribute(W),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({register(n,o,r){if(function(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${z}]`)}(n))return;const i=n;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(W,"true")),s.nodes.set(o,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===V&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>ee({key:e,ns:o(n)},{key:t.key,ns:o(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null===(n=t.unhighlight)||void 0===n||n.call(t))}))}})}function ie(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:o,onClick:r}){if(Y())return{stop(){t=!1},wrapper:o};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var o,r;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!==(o=s[e.tagName.toUpperCase()])&&void 0!==o?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null===(t=s[e.tagName.toUpperCase()])||void 0===t?void 0:t.some((t=>e.hasAttribute(t))))||(null===(n=s["*"])||void 0===n?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!==(r=s[n.tagName.toUpperCase()])&&void 0!==r?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,o),l=re(a,n,r);function c(e){for(const t of e){const e=Z(t),n=e?o.unwrap(e):null;if(n){const{text:a,keys:o}=n;Q(t,a);const r=X(e,o),s=i.getSuitableParent(t);l.register(s,t,r)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:Z(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===V)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(V);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(V)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(V))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===V))&&l.cleanupLingeringKeyAttributes();const o=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>o.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>o.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>o.delete(e)));break;case"attributes":t.attributeName===V&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>o.add(e)))}c([...o])})),f=a.targetElement||document.body;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(V),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:o}}const r=Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null===(a=null===(n=null==e?void 0:e.elementRegistry)||void 0===n?void 0:n.forEachElement)||void 0===a||a.call(n,t)},highlight(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[];return o.forEach((e=>{var t;return null===(t=e.highlight)||void 0===t?void 0:t.call(e)})),{unhighlight(){o.forEach((e=>{var t;return null===(t=e.unhighlight)||void 0===t?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[],i=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{ee({key:t,ns:o(n)},{key:e.key,ns:o(e.ns)})&&i.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),i},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""});return r}var se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},le={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),o=[],r=0;;){var i=t<e.length;if(!i||r>=n-1){var s=a.subarray(0,r);if(o.push(String.fromCharCode.apply(null,s)),!i)return o.join("");e=e.subarray(t),t=0,r=0}var l=e[t++];if(0==(128&l))a[r++]=l;else if(192==(224&l)){var c=63&e[t++];a[r++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[r++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[r++]=g>>>10&1023|55296,g=56320|1023&g),a[r++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,r=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,o=Math.max(32,n+(n>>>1)+7),r=new Uint8Array(o>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>r.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(o);l.set(r),r=l}if(0!=(4294967168&i)){if(0==(4294965248&i))r[a++]=i>>>6&31|192;else if(0==(4294901760&i))r[a++]=i>>>12&15|224,r[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;r[a++]=i>>>18&7|240,r[a++]=i>>>12&63|128,r[a++]=i>>>6&63|128}r[a++]=63&i|128}else r[a++]=i}return r.slice?r.slice(0,a):r.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),r(e)};var s=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;o?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:se);var ce,ue=e({__proto__:null,default:le},[le]);null===(ce=console.assert)||void 0===ce||ce.call(console,ue);const ge=["‌","‍"],de=RegExp(`([${ge.join("")}]{9})+`,"gu");function fe(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>ge[Number(e)])).join("")}function pe(e){const t=Array.from(e).map((e=>ge.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function he({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null===(t=e.match(de))||void 0===t?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(pe))||[]}(e);a.forEach((e=>{const a=function(e){if(e.length<=4){const[n]=function(e){const t=[];for(const n of e)t.push(n.codePointAt(0));return t}(e);return t.numberToValue(n)}return e}(e),o=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(a);if(o){const{k:e,d:t,n:a}=o;n.push({key:e,defaultValue:t,ns:a})}}));const o=function(e){return e.replace(de,"")}(e);return{text:o,keys:n}},wrap({key:a,defaultValue:o,translation:r,ns:i}){let s;if(e){s=fe(n({key:a,ns:i}))}else{const e=n({key:a,ns:i,defaultValue:o}),r=t.valueToNumber(e);s=fe(String.fromCodePoint(r))}const l=r||"";return"string"==typeof l?l+s:l},testTextNode(e){var t,n,a;return null!==(a=(null===(t=e.textContent)||void 0===t?void 0:t.includes(`${ge[0]}${ge[0]}`))||(null===(n=e.textContent)||void 0===n?void 0:n.includes(`${ge[1]}${ge[0]}`)))&&void 0!==a&&a},testAttribute:e=>e.value.includes(`${ge[0]}${ge[0]}`)||e.value.includes(`${ge[1]}${ge[0]}`)})}function ve(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function me({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:o,ns:r}=function(e){let t=!1,n="",a="",o="KEY";const r={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{r.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==o||","!==s?"KEY"!==o||"|"!==s?"NAMESPACE"!==o||","!==s?"KEY"!==o||":"!==s?"DEFAULT_VALUE"!==o||":"!==s?"PARAM_NAME"!==o||":"!==s?"PARAM_VALUE"!==o||","!==s?n+=s:(o="PARAM_NAME",r.params[a]=n,n=""):(o="PARAM_VALUE",a=n,n=""):(o="PARAM_NAME",r.defaultValue=n,n=""):(o="PARAM_NAME",r.key=n,n=""):(o="DEFAULT_VALUE",i(n),n=""):(o="NAMESPACE",r.key=n,n=""):(o="DEFAULT_VALUE",r.key=n,n=""):t=!0;return"KEY"===o&&(r.key=n),"DEFAULT_VALUE"===o&&(r.defaultValue=n),"PARAM_VALUE"===o&&(r.params[a]=n),"NAMESPACE"===o&&i(n),r}(e);return{translated:n({key:t,params:a,defaultValue:o,ns:r,noWrap:!0}),key:t,params:a,defaultValue:o,ns:r}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){return"string"==typeof e?e.replace(/[,:|\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:o,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${r(e)}:${r(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==o?`,${r(o)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>r(e))).join("|")}`:"";return`${e}${r(n)}${u}${l}${s}${t}`},unwrap(n){const r=new RegExp(`(\\\\?)(${o(e)}(.*?)${o(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=r.exec(n));){let e=s[1];const[t,o,r,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!ve(d,n)){u+=r;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,o,r;return null!==(r=(null===(a=n.textContent)||void 0===a?void 0:a.includes(e))&&(null===(o=n.textContent)||void 0===o?void 0:o.includes(t)))&&void 0!==r&&r},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const ye="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function be(e){const t=ye.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function Ee(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,o=0;const r=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|be(e[i]),n+=5,n>=8&&(r[o++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",o=Math.pow(2,16)-1;for(let e=0;e<n;e+=o)e+o>n&&(o=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+o));return a}(r.buffer)}function Oe(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=Ee(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function Le({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:o=300}){let r=!1;const i=()=>new Promise(((a,r)=>{const i=function(e,t){const n=n=>{var a,o;e.includes(null===(a=n.data)||void 0===a?void 0:a.type)&&t(null===(o=n.data)||void 0===o?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),r()}),o);function l(){i.unsubscribe()}}));return{cancel(){r=!0},promise:(async()=>{for(let e=0;e<a;e++){if(r)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!r)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}const we="tolgee-in-context-tools.umd.min.js",Ae="@tolgee/in-context-tools",ke="InContextTools",Te="https://cdn.jsdelivr.net/npm";let je=null;function Ne(e){var t;return je||(je=(t=`${Te}/@tolgee/web@${e}/dist/${we}`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window[Ae][ke]))),je}const xe="__tolgee_apiKey",Ce="__tolgee_apiUrl";function Re(){const e=sessionStorage.getItem(xe)||void 0,t=sessionStorage.getItem(Ce)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Pe(){sessionStorage.removeItem(xe),sessionStorage.removeItem(Ce)}exports.BrowserExtensionPlugin=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(exports.BrowserExtensionPlugin=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=Le({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Pe)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return Re()&&(async()=>{const e=await Ne("5.19.4");return t=>{const n=Re();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Se="__tolgee_currentLanguage";function De(e){return e.endsWith("/")?e.slice(0,-1):e}const _e={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${De(n)}/${e}/${t}.json`:`${De(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"}};function Ie(e){const t=Object.assign(Object.assign(Object.assign({},_e),e),{headers:Object.assign(Object.assign({},_e.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:o,headers:r}=t,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(t,["prefix","getPath","getData","headers"]);return{getRecord:({namespace:e,language:t,fetch:s})=>s(a({namespace:e,language:t,prefix:n}),Object.assign({headers:r},i)).then((e=>{if(!e.ok)throw new Error(`${e.url} ${e.status}`);return o(e)}))}}exports.BackendFetch=e=>(t,n)=>(n.addBackend(Ie(e)),t),exports.DEVTOOLS_ID=K,exports.DevBackend=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:o,fetch:r}){var i;const s=null!==(i=Oe(t))&&void 0!==i?i:o;let l=void 0!==s?`${e}/v2/projects/${s}/translations/${n}`:`${e}/v2/projects/translations/${n}`;if(a&&(l+=`?ns=${a}`),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===o)throw new Error("You need to specify 'projectId' when using PAT key");return r(l,{headers:{"X-API-Key":t||"","Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e),exports.DevTools=()=>e=>e,exports.FormatSimple=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>B(e,t)}),e),exports.LanguageDetector=()=>(e,t)=>(t.setLanguageDetector({getLanguage({availableLanguages:e}){H("LanguageDetector");const t=window.navigator.language,n=e.find((e=>e===t));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),o=a(window.navigator.language);return e.find((e=>a(e)===o))||void 0}}),e),exports.LanguageStorage=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(H("LanguageStorage"),localStorage.getItem(Se)||void 0),setLanguage(e){H("LanguageStorage"),localStorage.setItem(Se,e)}}),e),exports.ObserverPlugin=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=ie();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=me({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&Q(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=ie();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=he({fullKeyEncode:t.options.fullKeyEncode});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),exports.PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY="__tolgee_preferredLanguages",exports.TOLGEE_ATTRIBUTE_NAME=W,exports.TOLGEE_RESTRICT_ATTRIBUTE=z,exports.TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE=V,exports.Tolgee=function(){return T().use(exports.BrowserExtensionPlugin())},exports.TolgeeCore=T,exports.createFetchFunction=u,exports.getFallback=o,exports.getFallbackArray=r,exports.getProjectIdFromApiKey=Oe,exports.getTranslateProps=A;
//# sourceMappingURL=tolgee-web.production.cjs.min.js.map

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

function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function t(e){return Boolean(e&&"function"==typeof e.then)}function n(e,n){return t(e)?Promise.resolve(e).then(n):n(e)}function a(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function o(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function r(e){return o(e)||[]}function i(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?r(t):r(null==t?void 0:t[e]);var n}function s(e){return Array.from(new Set(e))}function l(e){return e?e.replace(/\/+$/,""):e}const c=(e,t)=>fetch(e,t),u=(e=c)=>(t,n)=>e(t,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.19.3"},null==n?void 0:n.headers)}));function g(e){let t=[];return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(n){e()&&t.forEach((e=>e({value:n})))}})}function d(e,t,n){const a=new Set,o=new Set;let i=[];function s(){if(0===i.length)return;const e=i;i=[],a.forEach((e=>{e({value:void 0})}));let n=new Set;e.forEach((e=>{void 0===e?n=void 0:void 0!==n&&e.forEach((e=>n.add(e)))}));!function(e){const n=new Set(t());o.forEach((t=>{(void 0===e||-1!==(null==e?void 0:e.findIndex((e=>n.has(e)||t.namespaces.has(e)))))&&t.fn({value:void 0})}))}(n?Array.from(n.keys()):void 0)}return Object.freeze({emit(t,n){e()&&(i.push(t),n?setTimeout(s,0):s())},listen(e){a.add(e);return{unsubscribe:()=>{a.delete(e)}}},listenSome(e){const t={fn:t=>{e(t)},namespaces:new Set};o.add(t);const a={unsubscribe:()=>{o.delete(t)},subscribeNs:e=>(r(e).forEach((e=>t.namespaces.add(e))),void 0===e&&t.namespaces.add(n()),a)};return a}})}const f=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):f(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},p=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},h=({language:e,namespace:t})=>t?`${e}:${t}`:e;function v(e,t,n,a,o,i,l){const c=new Map,u=new Map;let g={},d=0;function v(t,n,a){const o=h(t);u.set(o,{data:f(n),version:a}),e.emit(t)}function m(e){let n;if(!n){const t=g[h(e)];"function"==typeof t&&(n=t())}return n||(n=t(e)),n}const y=Object.freeze({addStaticData(e){e&&(g=Object.assign(Object.assign({},g),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=p(e),a=u.get(e);a&&0!==a.version||v(n,t,0)}})))},invalidate(){c.clear(),d+=1},addRecord(e,t){v(e,t,d)},exists(e,t=!1){const n=u.get(h(e));return n&&t?n.version===d:Boolean(n)},getRecord(e){var t;return null===(t=u.get(h(a(e))))||void 0===t?void 0:t.data},getTranslation(e,t){var n;return null===(n=u.get(h(e)))||void 0===n?void 0:n.data.get(t)},getTranslationNs(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return[o]}return s(e)},getTranslationFallback(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return t}},changeTranslation(t,n,a){var o;const r=null===(o=u.get(h(t)))||void 0===o?void 0:o.data;null==r||r.set(n,a),e.emit(Object.assign(Object.assign({},t),{key:n}))},isFetching(e){if(o())return!0;if(void 0===e)return c.size>0;const t=r(e);return Boolean(Array.from(c.keys()).find((e=>t.includes(p(e).namespace))))},isLoading(e,t){const n=r(t);return Boolean(o()||Array.from(c.keys()).find((t=>{const a=p(t);return(!n.length||n.includes(a.namespace))&&!y.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const o=e.map((e=>{const o=a(e),r=h(o),i=c.get(r);if(i)return{new:!1,promise:i,keyObject:o,cacheKey:r};const s=function(e,t){var a;let o;return t&&(o=null===(a=n(e))||void 0===a?void 0:a.catch((()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),m(e))))),o||(o=m(e)),o}(o,t)||Promise.resolve(void 0);return c.set(r,s),{new:!0,promise:s,keyObject:o,cacheKey:r}}));i.notify(),l.notify();const r=await Promise.all(o.map((e=>e.promise)));return o.forEach(((e,t)=>{const n=c.get(e.cacheKey)!==e.promise;if(e.new&&!n){c.delete(e.cacheKey);const n=r[t];n?y.addRecord(e.keyObject,n):y.getRecord(e.keyObject)||y.addRecord(e.keyObject,{})}})),i.notify(),l.notify(),o.map((e=>y.getRecord(e.keyObject)))},getAllRecords:()=>Array.from(u.entries()).map((([e,t])=>Object.assign(Object.assign({},p(e)),{data:t.data})))});return y}function m(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}const y="invalid",b={defaultNs:"",observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:y,apiUrl:"https://app.tolgee.io",fetch:u(),onTranslationMissing:({key:e})=>e},E=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function O(e,t){const n=E(b,null==t?void 0:t.initialOptions,e);return n.apiUrl=l(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=u(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function L(e,a,o,r,i,s,l,c){const u={ui:void 0},g={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},d=async({keysAndDefaults:e,event:t})=>{var n;const a=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:r(t),namespace:i({key:e,ns:t})[0],translation:s({key:e,ns:t})})));null===(n=g.ui)||void 0===n||n.handleElementClick(a,t)},f=(e,t)=>{var n;return(null===(n=g.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function p(e){const t=s({key:e.key,ns:e.ns});return T.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:a().fetch}}function v(e){g.observer=null==e?void 0:e()}function b(){return Boolean(g.observer)}function E(e){e&&g.formatters.push(e)}function O(e){g.finalFormatter=e}function L(e){u.ui=e}function w(){return Boolean(u.ui)}function k(e){g.languageStorage=e}function A(e){g.languageDetector=e}function j(e){e&&g.backends.push(e)}function N(e){g.devBackend=e}const T=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:O,addFormatter:E,setObserver:v,hasObserver:b,setUi:L,hasUi:w,setDevBackend:N,addBackend:j,setLanguageDetector:A,setLanguageStorage:k}))},run(){var e,t;const{apiKey:n,apiUrl:o,projectId:r,observerOptions:i}=a();g.ui=null===(e=u.ui)||void 0===e?void 0:e.call(u,{apiKey:n,apiUrl:o,projectId:r,highlight:T.highlight,changeTranslation:l,findPositions:f,onPermanentChange:c}),null===(t=g.observer)||void 0===t||t.run({mouseHighlight:!0,options:i,translate:p,onClick:d})},stop(){var e;g.ui=void 0,null===(e=g.observer)||void 0===e||e.stop()},getLanguageStorage:()=>g.languageStorage,getInitialLanguage(){var e;const t=o();return n(null===(e=g.languageStorage)||void 0===e?void 0:e.getLanguage(h()),(e=>t&&!t.includes(e)||!e?function(){if(!g.languageDetector)return;const e=o();return g.languageDetector.getLanguage(Object.assign({availableLanguages:e},h()))}():e))},setStoredLanguage(e){var t;null===(t=g.languageStorage)||void 0===t||t.setLanguage(e,h())},getDevBackend:()=>g.devBackend,getBackendRecord:({language:e,namespace:n})=>{for(const a of g.backends){const o=a.getRecord(Object.assign({language:e,namespace:n},h()));if(t(o))return null==o?void 0:o.catch((e=>(console.error(e),{})));if(void 0!==o)return o}},getBackendDevRecord:({language:e,namespace:t})=>{var n;const{apiKey:o,apiUrl:r,projectId:i}=a();return null===(n=g.devBackend)||void 0===n?void 0:n.getRecord(Object.assign({apiKey:o,apiUrl:r,projectId:i,language:e,namespace:t},h()))},getLanguageDetector:()=>g.languageDetector,retranslate(){var e;null===(e=g.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=g.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(T.getDevBackend()),formatTranslation(t){var n,{formatEnabled:o}=t,r=m(t,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:c,params:u,ns:d,orEmpty:f}=r,p=null!=s?s:l;let h="";null==s&&(h=a().onTranslationMissing(r));let v=null!=p?p:f?"":h;const b=e(),E=o||!(null===(n=g.observer)||void 0===n?void 0:n.outputNotFormattable),O=e=>g.observer&&!c?g.observer.wrap({key:i,translation:e,defaultValue:l,params:u,ns:d}):e;v=O(v);try{if(p&&b&&E)for(const e of g.formatters)v=e.format({translation:v,language:b,params:u});g.finalFormatter&&p&&b&&E&&(v=g.finalFormatter.format({translation:v,language:b,params:u}))}catch(e){console.error(e);const t=("string"==typeof(L=e)?L:"string"==typeof(null==L?void 0:L.message)?L.message:void 0)||y,n=a().onFormatError,o=typeof n;v="string"===o?n:"function"===o?n(t,r):y,v=O(v)}var L;return v}});return T}const w=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const k=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:o,language:r}=e,i=m(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:r};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function A({options:e}){const o=function(e,t){let n=!0;function a(){return n}const o=Object.freeze({onPendingLanguageChange:g(a),onLanguageChange:g(a),onLoadingChange:g(a),onFetchingChange:g(a),onInitialLoaded:g(a),onRunningChange:g(a),onCacheChange:g(a),onUpdate:d(a,e,t),onPermanentChange:g(a),setEmitterActive(e){n=e},on:(e,t)=>{switch(e){case"pendingLanguage":return o.onPendingLanguageChange.listen(t);case"language":return o.onLanguageChange.listen(t);case"loading":return o.onLoadingChange.listen(t);case"fetching":return o.onFetchingChange.listen(t);case"initialLoad":return o.onInitialLoaded.listen(t);case"running":return o.onRunningChange.listen(t);case"cache":return o.onCacheChange.listen(t);case"update":return o.onUpdate.listen(t);case"permanentChange":return o.onPermanentChange.listen(t)}}});return o.onInitialLoaded.listen((()=>o.onUpdate.emit())),o.onLanguageChange.listen((()=>o.onUpdate.emit())),o.onCacheChange.listen((({value:e})=>o.onUpdate.emit([e.namespace],!0))),o}(b,E),c=w(!1,(()=>m.isFetching()),o.onFetchingChange.emit),u=w(!1,(()=>S.isLoading()),o.onLoadingChange.emit),f=function(e,t,n){let a,o=O();const c=Object.freeze({init(e){o=O(e,o)},isRunning:()=>o.isRunning,setRunning(e){o.isRunning!==e&&(o.isRunning=e,n.emit(e))},isInitialLoading:()=>o.isInitialLoading,setInitialLoading(e){o.isInitialLoading=e},getLanguage:()=>o.language||o.initialOptions.language,setLanguage(t){o.language!==t&&(o.language=t,e.emit(t))},getPendingLanguage:()=>o.pendingLanguage||c.getLanguage(),setPendingLanguage(e){o.pendingLanguage!==e&&(o.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},o.initialOptions),a),addActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t?o.activeNamespaces.set(e,t+1):o.activeNamespaces.set(e,1)}))},removeActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t&&t>1?o.activeNamespaces.set(e,t-1):o.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>s([...o.initialOptions.ns||[o.initialOptions.defaultNs],...r(o.initialOptions.fallbackNs),...o.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||c.getLanguage();return t?s([t,...i(t,o.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>r(o.initialOptions.fallbackNs),getDefaultNs:e=>void 0===e?o.initialOptions.defaultNs:e,getAvailableLanguages(){if(o.initialOptions.availableLanguages)return o.initialOptions.availableLanguages;if(o.initialOptions.staticData){const e=Object.keys(o.initialOptions.staticData).map((e=>p(e).language));return Array.from(new Set(e))}},withDefaultNs:e=>({namespace:void 0===e.namespace?c.getInitialOptions().defaultNs:e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:l(e.apiUrl)}):void 0}});return c}(o.onLanguageChange,o.onPendingLanguageChange,o.onRunningChange),h=L(f.getLanguage,f.getInitialOptions,f.getAvailableLanguages,A,C,R,N,(function(e){o.onPermanentChange.emit({key:e.key,namespace:e.namespace})})),m=v(o.onCacheChange,h.getBackendRecord,h.getBackendDevRecord,f.withDefaultNs,f.isInitialLoading,c,u);let y;function b(){return f.getFallbackNs()}function E(e){return f.getDefaultNs(e)}function A(e){return[...r(E(e)),...b()]}function j(e){return[...r(null!=e?e:E()),...f.getRequiredNamespaces()]}function N(e,t,n){const a=f.withDefaultNs(e),o=m.getTranslation(a,t);return m.changeTranslation(a,t,n),{revert(){m.changeTranslation(a,t,o)}}}function T(e){f.init(e),m.addStaticData(f.getInitialOptions().staticData)}function x(e,t){const a=function(e,t){const n=f.getFallbackLangs(e),a=j(t),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t},!0)||o.push({language:e,namespace:t})}))})),o}(e,t);if(a.length)return n(S.loadRecords(a),(()=>{}))}function C({key:e,ns:t}){const n=f.getFallbackLangs(),a=A(null!=t?t:void 0);return m.getTranslationNs(a,n,e)}function R({key:e,ns:t,language:n}){const a=A(null!=t?t:void 0),o=f.getFallbackLangs(n);return m.getTranslationFallback(a,o,e)}function P(){const e=n(function(){if(f.getLanguage())return;return n(h.getInitialLanguage(),(e=>{const t=e||f.getInitialOptions().defaultLanguage;t&&f.setLanguage(t)}))}(),(()=>x()));if(t(e))return f.setInitialLoading(!0),c.notify(),u.notify(),Promise.resolve(e).then((()=>{f.setInitialLoading(!1),c.notify(),u.notify(),o.onInitialLoaded.emit()}));o.onInitialLoaded.emit()}e&&T(e),o.onUpdate.listen((()=>{f.isRunning()&&h.retranslate()}));const S=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),f),h),m),{init:T,getTranslation:R,changeTranslation:N,getTranslationNs:C,getDefaultAndFallbackNs:A,async changeLanguage(e){f.getPendingLanguage()===e&&f.getLanguage()===e||(f.setPendingLanguage(e),f.isRunning()&&await x(e),e===f.getPendingLanguage()&&(f.setLanguage(e),h.setStoredLanguage(e)))},async addActiveNs(e,t){t||f.addActiveNs(e),f.isRunning()&&await x(void 0,e)},loadRecords:e=>m.loadRecords(e,S.isDev()),loadRecord:async e=>(await S.loadRecords([e]))[0],isLoading:e=>m.isLoading(f.getLanguage(),e),isLoaded(e){const t=f.getLanguage();if(!t)return!1;const n=f.getFallbackLangs(t),a=j(e),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=k(...e),n=R(t);return h.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(f.getInitialOptions().apiKey&&f.getInitialOptions().apiUrl),run:()=>(function(){if((h.getLanguageDetector()||h.getLanguageStorage())&&!f.getAvailableLanguages())throw new Error(a("availableLanguages"));if(!f.getLanguage()&&!f.getInitialOptions().defaultLanguage)throw new Error(a(["defaultLanguage","language"]))}(),f.isRunning()||(f.setRunning(!0),h.run(),y=P()),Promise.resolve(y)),stop(){f.isRunning()&&(h.stop(),f.setRunning(!1))}}));return S}const j=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=E(e.options,n),t),init(t){const n=function(e){const t=A({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,onNsUpdate:t.onUpdate.listenSome,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(E(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},N=0,T=1,x=2;class C extends Error{constructor(e,t,n){let a;a=e===N?"Empty parameter":e===T?"Unexpected character":"Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`),this.code=e,this.index=t}}function R(e){return/\s/.test(e)}const P=0,S=1,D=2,I=3,U=4,_=new Set([D,S,P]),F="'",$=new Set(["{","}",F]),M=e=>/[0-9a-zA-Z_]/.test(e);function K(e,t){const[n,a]=function(e){let t=P,n="",a="",o="";const r=[],i=[];let s=0;function l(t){throw new C(t,s,e)}const c=()=>{r.push(n),n=""},u=()=>{""===a&&l(N),i.push(a),a=""};for(s=0;s<e.length;s++)switch(o=e[s],t){case P:o===F?(n+=o,t=S):"{"===o?(c(),t=I):(n+=o,t=P);break;case S:$.has(o)?(n=n.slice(0,-1)+o,t=D):(n+=o,t=P);break;case D:o===F?t=P:(n+=o,t=D);break;case I:"}"===o?(u(),t=P):R(o)?""!==a&&(u(),t=U):(M(o)||l(T),a+=o,t=I);break;case U:"}"==o?t=P:R(o)?t=U:l(T)}return _.has(t)||l(x),c(),[r,i]}(e),o=[n[0]];for(let r=1;r<n.length;r++){const i=null==t?void 0:t[a[r-1]];if(void 0===i)throw new Error(`Missing parameter "${a[r-1]}" in "${e}"`);o.push(String(i)),o.push(n[r])}return o.join("")}const B=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>K(e,t)}),e),V="__tolgee_dev_tools",z="__tolgee_preferredLanguages",W="data-tolgee-key-only",Y="data-tolgee-restricted",H="_tolgee",X="_tolgee-highlighter";function G(){var e,t;return void 0===(null===(t=null===(e=globalThis.window)||void 0===e?void 0:e.document)||void 0===t?void 0:t.createElement)}function J(e){if(G())throw new Error(`${e}: Can't run on the server`)}function q(e,t){return{oldTextContent:e,keys:t}}const Z={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function Q({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(X),Object.entries(Z).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const r=n.getBoundingClientRect();o.style.borderWidth=t+"px",o.style.top=r.top-t+"px",o.style.left=r.left-t+"px",o.style.width=r.width+"px",o.style.height=r.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null===(e=t.highlightEl)||void 0===e||e.remove(),t.highlightEl=void 0}}(0,a)}})}function ee(e){return e.textContent}function te(e,t){e.textContent=t}function ne(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,o=void 0===e.ns||void 0===t.ns||-1!==(null===(n=e.ns)||void 0===n?void 0:n.findIndex((e=>{var n;return null===(n=t.ns)||void 0===n?void 0:n.includes(e)})));return a&&o}const ae={capture:!0},oe={capture:!0,passive:!0},re=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function ie({highlightKeys:e,elementStore:t,onClick:n,options:a}){var o,r;const i=new Set;let s,l,c=[];const u=(null===(o=a.targetElement)||void 0===o?void 0:o.getRootNode())||document,g=(null===(r=a.targetElement)||void 0===r?void 0:r.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null===(e=n.unhighlight)||void 0===e||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&k()){n=function(e){for(const n of e){const e=w(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null===(n=a.highlight)||void 0===n||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of re.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),k()&&(t=e.target,!Boolean(w(t,(e=>e.id===V))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null===(e=null==n?void 0:n.highlight)||void 0===e||e.call(n)}function O(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),k()&&s&&(n(e,s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function w(e,t){return e.id===V?null:t(e)?e:(null==e?void 0:e.parentElement)?w(e.parentElement,t):void 0}function k(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,ae),L("keyup",b,ae),L("mousemove",m,oe),L("scroll",E,oe),L("click",O,ae),L("mouseenter",v,ae),L("mouseover",v,ae),L("mouseout",v,ae),L("mouseleave",v,ae),L("mousedown",v,ae),L("mouseup",v,ae)}})}function se(e,t,n){const a=Q({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=ie({highlightKeys:e.highlightKeys,elementStore:t,onClick(e,a){const o=t.get(a);n({event:e,keysAndDefaults:s(o)})},options:e});function i(e,n){var a;n.highlightEl&&(null===(a=n.unhighlight)||void 0===a||a.call(n)),e.removeAttribute(H),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({register(n,o,r){if(function(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${Y}]`)}(n))return;const i=n;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(H,"true")),s.nodes.set(o,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===W&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>ne({key:e,ns:o(n)},{key:t.key,ns:o(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null===(n=t.unhighlight)||void 0===n||n.call(t))}))}})}function le(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:o,onClick:r}){if(G())return{stop(){t=!1},wrapper:o};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var o,r;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!==(o=s[e.tagName.toUpperCase()])&&void 0!==o?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null===(t=s[e.tagName.toUpperCase()])||void 0===t?void 0:t.some((t=>e.hasAttribute(t))))||(null===(n=s["*"])||void 0===n?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!==(r=s[n.tagName.toUpperCase()])&&void 0!==r?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,o),l=se(a,n,r);function c(e){for(const t of e){const e=ee(t),n=e?o.unwrap(e):null;if(n){const{text:a,keys:o}=n;te(t,a);const r=q(e,o),s=i.getSuitableParent(t);l.register(s,t,r)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:ee(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===W)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(W);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(W)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(W))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===W))&&l.cleanupLingeringKeyAttributes();const o=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>o.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>o.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>o.delete(e)));break;case"attributes":t.attributeName===W&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>o.add(e)))}c([...o])})),f=a.targetElement||document.body;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(W),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:o}}const r=Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null===(a=null===(n=null==e?void 0:e.elementRegistry)||void 0===n?void 0:n.forEachElement)||void 0===a||a.call(n,t)},highlight(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[];return o.forEach((e=>{var t;return null===(t=e.highlight)||void 0===t?void 0:t.call(e)})),{unhighlight(){o.forEach((e=>{var t;return null===(t=e.unhighlight)||void 0===t?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[],i=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{ne({key:t,ns:o(n)},{key:e.key,ns:o(e.ns)})&&i.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),i},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""});return r}var ce="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ue={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),o=[],r=0;;){var i=t<e.length;if(!i||r>=n-1){var s=a.subarray(0,r);if(o.push(String.fromCharCode.apply(null,s)),!i)return o.join("");e=e.subarray(t),t=0,r=0}var l=e[t++];if(0==(128&l))a[r++]=l;else if(192==(224&l)){var c=63&e[t++];a[r++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[r++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[r++]=g>>>10&1023|55296,g=56320|1023&g),a[r++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,r=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,o=Math.max(32,n+(n>>>1)+7),r=new Uint8Array(o>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>r.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(o);l.set(r),r=l}if(0!=(4294967168&i)){if(0==(4294965248&i))r[a++]=i>>>6&31|192;else if(0==(4294901760&i))r[a++]=i>>>12&15|224,r[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;r[a++]=i>>>18&7|240,r[a++]=i>>>12&63|128,r[a++]=i>>>6&63|128}r[a++]=63&i|128}else r[a++]=i}return r.slice?r.slice(0,a):r.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),r(e)};var s=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;o?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:ce);var ge,de=e({__proto__:null,default:ue},[ue]);null===(ge=console.assert)||void 0===ge||ge.call(console,de);const fe=["‌","‍"],pe=RegExp(`([${fe.join("")}]{9})+`,"gu");function he(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>fe[Number(e)])).join("")}function ve(e){const t=Array.from(e).map((e=>fe.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function me({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null===(t=e.match(pe))||void 0===t?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(ve))||[]}(e);a.forEach((e=>{const a=function(e){if(e.length<=4){const[n]=function(e){const t=[];for(const n of e)t.push(n.codePointAt(0));return t}(e);return t.numberToValue(n)}return e}(e),o=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(a);if(o){const{k:e,d:t,n:a}=o;n.push({key:e,defaultValue:t,ns:a})}}));const o=function(e){return e.replace(pe,"")}(e);return{text:o,keys:n}},wrap({key:a,defaultValue:o,translation:r,ns:i}){let s;if(e){s=he(n({key:a,ns:i}))}else{const e=n({key:a,ns:i,defaultValue:o}),r=t.valueToNumber(e);s=he(String.fromCodePoint(r))}const l=r||"";return"string"==typeof l?l+s:l},testTextNode(e){var t,n,a;return null!==(a=(null===(t=e.textContent)||void 0===t?void 0:t.includes(`${fe[0]}${fe[0]}`))||(null===(n=e.textContent)||void 0===n?void 0:n.includes(`${fe[1]}${fe[0]}`)))&&void 0!==a&&a},testAttribute:e=>e.value.includes(`${fe[0]}${fe[0]}`)||e.value.includes(`${fe[1]}${fe[0]}`)})}function ye(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function be({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:o,ns:r}=function(e){let t=!1,n="",a="",o="KEY";const r={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{r.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==o||","!==s?"KEY"!==o||"|"!==s?"NAMESPACE"!==o||","!==s?"KEY"!==o||":"!==s?"DEFAULT_VALUE"!==o||":"!==s?"PARAM_NAME"!==o||":"!==s?"PARAM_VALUE"!==o||","!==s?n+=s:(o="PARAM_NAME",r.params[a]=n,n=""):(o="PARAM_VALUE",a=n,n=""):(o="PARAM_NAME",r.defaultValue=n,n=""):(o="PARAM_NAME",r.key=n,n=""):(o="DEFAULT_VALUE",i(n),n=""):(o="NAMESPACE",r.key=n,n=""):(o="DEFAULT_VALUE",r.key=n,n=""):t=!0;return"KEY"===o&&(r.key=n),"DEFAULT_VALUE"===o&&(r.defaultValue=n),"PARAM_VALUE"===o&&(r.params[a]=n),"NAMESPACE"===o&&i(n),r}(e);return{translated:n({key:t,params:a,defaultValue:o,ns:r,noWrap:!0}),key:t,params:a,defaultValue:o,ns:r}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){return"string"==typeof e?e.replace(/[,:|\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:o,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${r(e)}:${r(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==o?`,${r(o)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>r(e))).join("|")}`:"";return`${e}${r(n)}${u}${l}${s}${t}`},unwrap(n){const r=new RegExp(`(\\\\?)(${o(e)}(.*?)${o(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=r.exec(n));){let e=s[1];const[t,o,r,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!ye(d,n)){u+=r;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,o,r;return null!==(r=(null===(a=n.textContent)||void 0===a?void 0:a.includes(e))&&(null===(o=n.textContent)||void 0===o?void 0:o.includes(t)))&&void 0!==r&&r},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const Ee=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=le();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=be({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&te(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=le();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=me({fullKeyEncode:t.options.fullKeyEncode});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Le(e){const t=Oe.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function we(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,o=0;const r=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Le(e[i]),n+=5,n>=8&&(r[o++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",o=Math.pow(2,16)-1;for(let e=0;e<n;e+=o)e+o>n&&(o=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+o));return a}(r.buffer)}function ke(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=we(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}const Ae=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:o,fetch:r}){var i;const s=null!==(i=ke(t))&&void 0!==i?i:o;let l=void 0!==s?`${e}/v2/projects/${s}/translations/${n}`:`${e}/v2/projects/translations/${n}`;if(a&&(l+=`?ns=${a}`),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===o)throw new Error("You need to specify 'projectId' when using PAT key");return r(l,{headers:{"X-API-Key":t||"","Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e);function je({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:o=300}){let r=!1;const i=()=>new Promise(((a,r)=>{const i=function(e,t){const n=n=>{var a,o;e.includes(null===(a=n.data)||void 0===a?void 0:a.type)&&t(null===(o=n.data)||void 0===o?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),r()}),o);function l(){i.unsubscribe()}}));return{cancel(){r=!0},promise:(async()=>{for(let e=0;e<a;e++){if(r)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!r)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}const Ne="tolgee-in-context-tools.umd.min.js",Te="@tolgee/in-context-tools",xe="InContextTools",Ce="https://cdn.jsdelivr.net/npm";let Re=null;function Pe(e){var t;return Re||(Re=(t=`${Ce}/@tolgee/web@${e}/dist/${Ne}`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.body.appendChild(a)}))).then((()=>window[Te][xe]))),Re}const Se="__tolgee_apiKey",De="__tolgee_apiUrl";function Ie(){const e=sessionStorage.getItem(Se)||void 0,t=sessionStorage.getItem(De)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Ue(){sessionStorage.removeItem(Se),sessionStorage.removeItem(De)}let _e=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(_e=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=je({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Ue)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return Ie()&&(async()=>{const e=await Pe("5.19.3");return t=>{const n=Ie();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Fe="__tolgee_currentLanguage";const $e=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(J("LanguageStorage"),localStorage.getItem(Fe)||void 0),setLanguage(e){J("LanguageStorage"),localStorage.setItem(Fe,e)}}),e);const Me=()=>(e,t)=>(t.setLanguageDetector({getLanguage({availableLanguages:e}){J("LanguageDetector");const t=window.navigator.language,n=e.find((e=>e===t));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),o=a(window.navigator.language);return e.find((e=>a(e)===o))||void 0}}),e);function Ke(e){return e.endsWith("/")?e.slice(0,-1):e}const Be={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${Ke(n)}/${e}/${t}.json`:`${Ke(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"}};function Ve(e){const t=Object.assign(Object.assign(Object.assign({},Be),e),{headers:Object.assign(Object.assign({},Be.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:o,headers:r}=t,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(t,["prefix","getPath","getData","headers"]);return{getRecord:({namespace:e,language:t,fetch:s})=>s(a({namespace:e,language:t,prefix:n}),Object.assign({headers:r},i)).then((e=>{if(!e.ok)throw new Error(`${e.url} ${e.status}`);return o(e)}))}}const ze=e=>(t,n)=>(n.addBackend(Ve(e)),t);function We(){return j().use(_e())}const Ye=()=>e=>e;export{ze as BackendFetch,_e as BrowserExtensionPlugin,V as DEVTOOLS_ID,Ae as DevBackend,Ye as DevTools,B as FormatSimple,Me as LanguageDetector,$e as LanguageStorage,Ee as ObserverPlugin,z as PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY,H as TOLGEE_ATTRIBUTE_NAME,Y as TOLGEE_RESTRICT_ATTRIBUTE,W as TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE,We as Tolgee,j as TolgeeCore,u as createFetchFunction,o as getFallback,r as getFallbackArray,ke as getProjectIdFromApiKey,k as getTranslateProps};
function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function t(e){return Boolean(e&&"function"==typeof e.then)}function n(e,n){return t(e)?Promise.resolve(e).then(n):n(e)}function a(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function o(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function r(e){return o(e)||[]}function i(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?r(t):r(null==t?void 0:t[e]);var n}function s(e){return Array.from(new Set(e))}function l(e){return e?e.replace(/\/+$/,""):e}const c=(e,t)=>fetch(e,t),u=(e=c)=>(t,n)=>e(t,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.19.4"},null==n?void 0:n.headers)}));function g(e){let t=[];return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(n){e()&&t.forEach((e=>e({value:n})))}})}function d(e,t,n){const a=new Set,o=new Set;let i=[];function s(){if(0===i.length)return;const e=i;i=[],a.forEach((e=>{e({value:void 0})}));let n=new Set;e.forEach((e=>{void 0===e?n=void 0:void 0!==n&&e.forEach((e=>n.add(e)))}));!function(e){const n=new Set(t());o.forEach((t=>{(void 0===e||-1!==(null==e?void 0:e.findIndex((e=>n.has(e)||t.namespaces.has(e)))))&&t.fn({value:void 0})}))}(n?Array.from(n.keys()):void 0)}return Object.freeze({emit(t,n){e()&&(i.push(t),n?setTimeout(s,0):s())},listen(e){a.add(e);return{unsubscribe:()=>{a.delete(e)}}},listenSome(e){const t={fn:t=>{e(t)},namespaces:new Set};o.add(t);const a={unsubscribe:()=>{o.delete(t)},subscribeNs:e=>(r(e).forEach((e=>t.namespaces.add(e))),void 0===e&&t.namespaces.add(n()),a)};return a}})}const f=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):f(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},p=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},h=({language:e,namespace:t})=>t?`${e}:${t}`:e;function v(e,t,n,a,o,i,l){const c=new Map,u=new Map;let g={},d=0;function v(t,n,a){const o=h(t);u.set(o,{data:f(n),version:a}),e.emit(t)}function m(e){let n;if(!n){const t=g[h(e)];"function"==typeof t&&(n=t())}return n||(n=t(e)),n}const y=Object.freeze({addStaticData(e){e&&(g=Object.assign(Object.assign({},g),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=p(e),a=u.get(e);a&&0!==a.version||v(n,t,0)}})))},invalidate(){c.clear(),d+=1},addRecord(e,t){v(e,t,d)},exists(e,t=!1){const n=u.get(h(e));return n&&t?n.version===d:Boolean(n)},getRecord(e){var t;return null===(t=u.get(h(a(e))))||void 0===t?void 0:t.data},getTranslation(e,t){var n;return null===(n=u.get(h(e)))||void 0===n?void 0:n.data.get(t)},getTranslationNs(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return[o]}return s(e)},getTranslationFallback(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(h({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return t}},changeTranslation(t,n,a){var o;const r=null===(o=u.get(h(t)))||void 0===o?void 0:o.data;null==r||r.set(n,a),e.emit(Object.assign(Object.assign({},t),{key:n}))},isFetching(e){if(o())return!0;if(void 0===e)return c.size>0;const t=r(e);return Boolean(Array.from(c.keys()).find((e=>t.includes(p(e).namespace))))},isLoading(e,t){const n=r(t);return Boolean(o()||Array.from(c.keys()).find((t=>{const a=p(t);return(!n.length||n.includes(a.namespace))&&!y.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const o=e.map((e=>{const o=a(e),r=h(o),i=c.get(r);if(i)return{new:!1,promise:i,keyObject:o,cacheKey:r};const s=function(e,t){var a;let o;return t&&(o=null===(a=n(e))||void 0===a?void 0:a.catch((()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),m(e))))),o||(o=m(e)),o}(o,t)||Promise.resolve(void 0);return c.set(r,s),{new:!0,promise:s,keyObject:o,cacheKey:r}}));i.notify(),l.notify();const r=await Promise.all(o.map((e=>e.promise)));return o.forEach(((e,t)=>{const n=c.get(e.cacheKey)!==e.promise;if(e.new&&!n){c.delete(e.cacheKey);const n=r[t];n?y.addRecord(e.keyObject,n):y.getRecord(e.keyObject)||y.addRecord(e.keyObject,{})}})),i.notify(),l.notify(),o.map((e=>y.getRecord(e.keyObject)))},getAllRecords:()=>Array.from(u.entries()).map((([e,t])=>Object.assign(Object.assign({},p(e)),{data:t.data})))});return y}function m(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}const y="invalid",b={defaultNs:"",observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:y,apiUrl:"https://app.tolgee.io",fetch:u(),onTranslationMissing:({key:e})=>e},E=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function O(e,t){const n=E(b,null==t?void 0:t.initialOptions,e);return n.apiUrl=l(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=u(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function L(e,a,o,r,i,s,l,c){const u={ui:void 0},g={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},d=async({keysAndDefaults:e,event:t})=>{var n;const a=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:r(t),namespace:i({key:e,ns:t})[0],translation:s({key:e,ns:t})})));null===(n=g.ui)||void 0===n||n.handleElementClick(a,t)},f=(e,t)=>{var n;return(null===(n=g.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function p(e){const t=s({key:e.key,ns:e.ns});return T.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:a().fetch}}function v(e){g.observer=null==e?void 0:e()}function b(){return Boolean(g.observer)}function E(e){e&&g.formatters.push(e)}function O(e){g.finalFormatter=e}function L(e){u.ui=e}function w(){return Boolean(u.ui)}function k(e){g.languageStorage=e}function A(e){g.languageDetector=e}function j(e){e&&g.backends.push(e)}function N(e){g.devBackend=e}const T=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:O,addFormatter:E,setObserver:v,hasObserver:b,setUi:L,hasUi:w,setDevBackend:N,addBackend:j,setLanguageDetector:A,setLanguageStorage:k}))},run(){var e,t;const{apiKey:n,apiUrl:o,projectId:r,observerOptions:i}=a();g.ui=null===(e=u.ui)||void 0===e?void 0:e.call(u,{apiKey:n,apiUrl:o,projectId:r,highlight:T.highlight,changeTranslation:l,findPositions:f,onPermanentChange:c}),null===(t=g.observer)||void 0===t||t.run({mouseHighlight:!0,options:i,translate:p,onClick:d})},stop(){var e;g.ui=void 0,null===(e=g.observer)||void 0===e||e.stop()},getLanguageStorage:()=>g.languageStorage,getInitialLanguage(){var e;const t=o();return n(null===(e=g.languageStorage)||void 0===e?void 0:e.getLanguage(h()),(e=>t&&!t.includes(e)||!e?function(){if(!g.languageDetector)return;const e=o();return g.languageDetector.getLanguage(Object.assign({availableLanguages:e},h()))}():e))},setStoredLanguage(e){var t;null===(t=g.languageStorage)||void 0===t||t.setLanguage(e,h())},getDevBackend:()=>g.devBackend,getBackendRecord:({language:e,namespace:n})=>{for(const a of g.backends){const o=a.getRecord(Object.assign({language:e,namespace:n},h()));if(t(o))return null==o?void 0:o.catch((e=>(console.error(e),{})));if(void 0!==o)return o}},getBackendDevRecord:({language:e,namespace:t})=>{var n;const{apiKey:o,apiUrl:r,projectId:i}=a();return null===(n=g.devBackend)||void 0===n?void 0:n.getRecord(Object.assign({apiKey:o,apiUrl:r,projectId:i,language:e,namespace:t},h()))},getLanguageDetector:()=>g.languageDetector,retranslate(){var e;null===(e=g.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=g.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(T.getDevBackend()),formatTranslation(t){var n,{formatEnabled:o}=t,r=m(t,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:c,params:u,ns:d,orEmpty:f}=r,p=null!=s?s:l;let h="";null==s&&(h=a().onTranslationMissing(r));let v=null!=p?p:f?"":h;const b=e(),E=o||!(null===(n=g.observer)||void 0===n?void 0:n.outputNotFormattable),O=e=>g.observer&&!c?g.observer.wrap({key:i,translation:e,defaultValue:l,params:u,ns:d}):e;v=O(v);try{if(p&&b&&E)for(const e of g.formatters)v=e.format({translation:v,language:b,params:u});g.finalFormatter&&p&&b&&E&&(v=g.finalFormatter.format({translation:v,language:b,params:u}))}catch(e){console.error(e);const t=("string"==typeof(L=e)?L:"string"==typeof(null==L?void 0:L.message)?L.message:void 0)||y,n=a().onFormatError,o=typeof n;v="string"===o?n:"function"===o?n(t,r):y,v=O(v)}var L;return v}});return T}const w=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const k=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:o,language:r}=e,i=m(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:r};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function A({options:e}){const o=function(e,t){let n=!0;function a(){return n}const o=Object.freeze({onPendingLanguageChange:g(a),onLanguageChange:g(a),onLoadingChange:g(a),onFetchingChange:g(a),onInitialLoaded:g(a),onRunningChange:g(a),onCacheChange:g(a),onUpdate:d(a,e,t),onPermanentChange:g(a),setEmitterActive(e){n=e},on:(e,t)=>{switch(e){case"pendingLanguage":return o.onPendingLanguageChange.listen(t);case"language":return o.onLanguageChange.listen(t);case"loading":return o.onLoadingChange.listen(t);case"fetching":return o.onFetchingChange.listen(t);case"initialLoad":return o.onInitialLoaded.listen(t);case"running":return o.onRunningChange.listen(t);case"cache":return o.onCacheChange.listen(t);case"update":return o.onUpdate.listen(t);case"permanentChange":return o.onPermanentChange.listen(t)}}});return o.onInitialLoaded.listen((()=>o.onUpdate.emit())),o.onLanguageChange.listen((()=>o.onUpdate.emit())),o.onCacheChange.listen((({value:e})=>o.onUpdate.emit([e.namespace],!0))),o}(b,E),c=w(!1,(()=>m.isFetching()),o.onFetchingChange.emit),u=w(!1,(()=>S.isLoading()),o.onLoadingChange.emit),f=function(e,t,n){let a,o=O();const c=Object.freeze({init(e){o=O(e,o)},isRunning:()=>o.isRunning,setRunning(e){o.isRunning!==e&&(o.isRunning=e,n.emit(e))},isInitialLoading:()=>o.isInitialLoading,setInitialLoading(e){o.isInitialLoading=e},getLanguage:()=>o.language||o.initialOptions.language,setLanguage(t){o.language!==t&&(o.language=t,e.emit(t))},getPendingLanguage:()=>o.pendingLanguage||c.getLanguage(),setPendingLanguage(e){o.pendingLanguage!==e&&(o.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},o.initialOptions),a),addActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t?o.activeNamespaces.set(e,t+1):o.activeNamespaces.set(e,1)}))},removeActiveNs(e){r(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t&&t>1?o.activeNamespaces.set(e,t-1):o.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>s([...o.initialOptions.ns||[o.initialOptions.defaultNs],...r(o.initialOptions.fallbackNs),...o.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||c.getLanguage();return t?s([t,...i(t,o.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>r(o.initialOptions.fallbackNs),getDefaultNs:e=>void 0===e?o.initialOptions.defaultNs:e,getAvailableLanguages(){if(o.initialOptions.availableLanguages)return o.initialOptions.availableLanguages;if(o.initialOptions.staticData){const e=Object.keys(o.initialOptions.staticData).map((e=>p(e).language));return Array.from(new Set(e))}},withDefaultNs:e=>({namespace:void 0===e.namespace?c.getInitialOptions().defaultNs:e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:l(e.apiUrl)}):void 0}});return c}(o.onLanguageChange,o.onPendingLanguageChange,o.onRunningChange),h=L(f.getLanguage,f.getInitialOptions,f.getAvailableLanguages,A,C,R,N,(function(e){o.onPermanentChange.emit({key:e.key,namespace:e.namespace})})),m=v(o.onCacheChange,h.getBackendRecord,h.getBackendDevRecord,f.withDefaultNs,f.isInitialLoading,c,u);let y;function b(){return f.getFallbackNs()}function E(e){return f.getDefaultNs(e)}function A(e){return[...r(E(e)),...b()]}function j(e){return[...r(null!=e?e:E()),...f.getRequiredNamespaces()]}function N(e,t,n){const a=f.withDefaultNs(e),o=m.getTranslation(a,t);return m.changeTranslation(a,t,n),{revert(){m.changeTranslation(a,t,o)}}}function T(e){f.init(e),m.addStaticData(f.getInitialOptions().staticData)}function x(e,t){const a=function(e,t){const n=f.getFallbackLangs(e),a=j(t),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t},!0)||o.push({language:e,namespace:t})}))})),o}(e,t);if(a.length)return n(S.loadRecords(a),(()=>{}))}function C({key:e,ns:t}){const n=f.getFallbackLangs(),a=A(null!=t?t:void 0);return m.getTranslationNs(a,n,e)}function R({key:e,ns:t,language:n}){const a=A(null!=t?t:void 0),o=f.getFallbackLangs(n);return m.getTranslationFallback(a,o,e)}function P(){const e=n(function(){if(f.getLanguage())return;return n(h.getInitialLanguage(),(e=>{const t=e||f.getInitialOptions().defaultLanguage;t&&f.setLanguage(t)}))}(),(()=>x()));if(t(e))return f.setInitialLoading(!0),c.notify(),u.notify(),Promise.resolve(e).then((()=>{f.setInitialLoading(!1),c.notify(),u.notify(),o.onInitialLoaded.emit()}));o.onInitialLoaded.emit()}e&&T(e),o.onUpdate.listen((()=>{f.isRunning()&&h.retranslate()}));const S=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),f),h),m),{init:T,getTranslation:R,changeTranslation:N,getTranslationNs:C,getDefaultAndFallbackNs:A,async changeLanguage(e){f.getPendingLanguage()===e&&f.getLanguage()===e||(f.setPendingLanguage(e),f.isRunning()&&await x(e),e===f.getPendingLanguage()&&(f.setLanguage(e),h.setStoredLanguage(e)))},async addActiveNs(e,t){t||f.addActiveNs(e),f.isRunning()&&await x(void 0,e)},loadRecords:e=>m.loadRecords(e,S.isDev()),loadRecord:async e=>(await S.loadRecords([e]))[0],isLoading:e=>m.isLoading(f.getLanguage(),e),isLoaded(e){const t=f.getLanguage();if(!t)return!1;const n=f.getFallbackLangs(t),a=j(e),o=[];return n.forEach((e=>{a.forEach((t=>{m.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=k(...e),n=R(t);return h.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(f.getInitialOptions().apiKey&&f.getInitialOptions().apiUrl),run:()=>(function(){if((h.getLanguageDetector()||h.getLanguageStorage())&&!f.getAvailableLanguages())throw new Error(a("availableLanguages"));if(!f.getLanguage()&&!f.getInitialOptions().defaultLanguage)throw new Error(a(["defaultLanguage","language"]))}(),f.isRunning()||(f.setRunning(!0),h.run(),y=P()),Promise.resolve(y)),stop(){f.isRunning()&&(h.stop(),f.setRunning(!1))}}));return S}const j=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=E(e.options,n),t),init(t){const n=function(e){const t=A({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,onNsUpdate:t.onUpdate.listenSome,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(E(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},N=0,T=1,x=2;class C extends Error{constructor(e,t,n){let a;a=e===N?"Empty parameter":e===T?"Unexpected character":"Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`),this.code=e,this.index=t}}function R(e){return/\s/.test(e)}const P=0,S=1,D=2,I=3,U=4,_=new Set([D,S,P]),F="'",$=new Set(["{","}",F]),M=e=>/[0-9a-zA-Z_]/.test(e);function K(e,t){const[n,a]=function(e){let t=P,n="",a="",o="";const r=[],i=[];let s=0;function l(t){throw new C(t,s,e)}const c=()=>{r.push(n),n=""},u=()=>{""===a&&l(N),i.push(a),a=""};for(s=0;s<e.length;s++)switch(o=e[s],t){case P:o===F?(n+=o,t=S):"{"===o?(c(),t=I):(n+=o,t=P);break;case S:$.has(o)?(n=n.slice(0,-1)+o,t=D):(n+=o,t=P);break;case D:o===F?t=P:(n+=o,t=D);break;case I:"}"===o?(u(),t=P):R(o)?""!==a&&(u(),t=U):(M(o)||l(T),a+=o,t=I);break;case U:"}"==o?t=P:R(o)?t=U:l(T)}return _.has(t)||l(x),c(),[r,i]}(e),o=[n[0]];for(let r=1;r<n.length;r++){const i=null==t?void 0:t[a[r-1]];if(void 0===i)throw new Error(`Missing parameter "${a[r-1]}" in "${e}"`);o.push(String(i)),o.push(n[r])}return o.join("")}const B=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>K(e,t)}),e),V="__tolgee_dev_tools",z="__tolgee_preferredLanguages",W="data-tolgee-key-only",Y="data-tolgee-restricted",H="_tolgee",X="_tolgee-highlighter";function G(){var e,t;return void 0===(null===(t=null===(e=globalThis.window)||void 0===e?void 0:e.document)||void 0===t?void 0:t.createElement)}function J(e){if(G())throw new Error(`${e}: Can't run on the server`)}function q(e,t){return{oldTextContent:e,keys:t}}const Z={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function Q({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(X),Object.entries(Z).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const r=n.getBoundingClientRect();o.style.borderWidth=t+"px",o.style.top=r.top-t+"px",o.style.left=r.left-t+"px",o.style.width=r.width+"px",o.style.height=r.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null===(e=t.highlightEl)||void 0===e||e.remove(),t.highlightEl=void 0}}(0,a)}})}function ee(e){return e.textContent}function te(e,t){e.textContent=t}function ne(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,o=void 0===e.ns||void 0===t.ns||-1!==(null===(n=e.ns)||void 0===n?void 0:n.findIndex((e=>{var n;return null===(n=t.ns)||void 0===n?void 0:n.includes(e)})));return a&&o}const ae={capture:!0},oe={capture:!0,passive:!0},re=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function ie({highlightKeys:e,elementStore:t,onClick:n,options:a}){var o,r;const i=new Set;let s,l,c=[];const u=(null===(o=a.targetElement)||void 0===o?void 0:o.getRootNode())||document,g=(null===(r=a.targetElement)||void 0===r?void 0:r.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null===(e=n.unhighlight)||void 0===e||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&k()){n=function(e){for(const n of e){const e=w(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null===(n=a.highlight)||void 0===n||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of re.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),k()&&(t=e.target,!Boolean(w(t,(e=>e.id===V))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null===(e=null==n?void 0:n.highlight)||void 0===e||e.call(n)}function O(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),k()&&s&&(n(e,s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function w(e,t){return e.id===V?null:t(e)?e:(null==e?void 0:e.parentElement)?w(e.parentElement,t):void 0}function k(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,ae),L("keyup",b,ae),L("mousemove",m,oe),L("scroll",E,oe),L("click",O,ae),L("mouseenter",v,ae),L("mouseover",v,ae),L("mouseout",v,ae),L("mouseleave",v,ae),L("mousedown",v,ae),L("mouseup",v,ae)}})}function se(e,t,n){const a=Q({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=ie({highlightKeys:e.highlightKeys,elementStore:t,onClick(e,a){const o=t.get(a);n({event:e,keysAndDefaults:s(o)})},options:e});function i(e,n){var a;n.highlightEl&&(null===(a=n.unhighlight)||void 0===a||a.call(n)),e.removeAttribute(H),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({register(n,o,r){if(function(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${Y}]`)}(n))return;const i=n;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(H,"true")),s.nodes.set(o,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===W&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>ne({key:e,ns:o(n)},{key:t.key,ns:o(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null===(n=t.unhighlight)||void 0===n||n.call(t))}))}})}function le(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:o,onClick:r}){if(G())return{stop(){t=!1},wrapper:o};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var o,r;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!==(o=s[e.tagName.toUpperCase()])&&void 0!==o?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null===(t=s[e.tagName.toUpperCase()])||void 0===t?void 0:t.some((t=>e.hasAttribute(t))))||(null===(n=s["*"])||void 0===n?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!==(r=s[n.tagName.toUpperCase()])&&void 0!==r?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,o),l=se(a,n,r);function c(e){for(const t of e){const e=ee(t),n=e?o.unwrap(e):null;if(n){const{text:a,keys:o}=n;te(t,a);const r=q(e,o),s=i.getSuitableParent(t);l.register(s,t,r)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:ee(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===W)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(W);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(W)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(W))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===W))&&l.cleanupLingeringKeyAttributes();const o=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>o.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>o.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>o.delete(e)));break;case"attributes":t.attributeName===W&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>o.add(e)))}c([...o])})),f=a.targetElement||document.body;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(W),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:o}}const r=Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null===(a=null===(n=null==e?void 0:e.elementRegistry)||void 0===n?void 0:n.forEachElement)||void 0===a||a.call(n,t)},highlight(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[];return o.forEach((e=>{var t;return null===(t=e.highlight)||void 0===t?void 0:t.call(e)})),{unhighlight(){o.forEach((e=>{var t;return null===(t=e.unhighlight)||void 0===t?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[],i=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{ne({key:t,ns:o(n)},{key:e.key,ns:o(e.ns)})&&i.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),i},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""});return r}var ce="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ue={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),o=[],r=0;;){var i=t<e.length;if(!i||r>=n-1){var s=a.subarray(0,r);if(o.push(String.fromCharCode.apply(null,s)),!i)return o.join("");e=e.subarray(t),t=0,r=0}var l=e[t++];if(0==(128&l))a[r++]=l;else if(192==(224&l)){var c=63&e[t++];a[r++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[r++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[r++]=g>>>10&1023|55296,g=56320|1023&g),a[r++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,r=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,o=Math.max(32,n+(n>>>1)+7),r=new Uint8Array(o>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>r.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(o);l.set(r),r=l}if(0!=(4294967168&i)){if(0==(4294965248&i))r[a++]=i>>>6&31|192;else if(0==(4294901760&i))r[a++]=i>>>12&15|224,r[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;r[a++]=i>>>18&7|240,r[a++]=i>>>12&63|128,r[a++]=i>>>6&63|128}r[a++]=63&i|128}else r[a++]=i}return r.slice?r.slice(0,a):r.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),r(e)};var s=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;o?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:ce);var ge,de=e({__proto__:null,default:ue},[ue]);null===(ge=console.assert)||void 0===ge||ge.call(console,de);const fe=["‌","‍"],pe=RegExp(`([${fe.join("")}]{9})+`,"gu");function he(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>fe[Number(e)])).join("")}function ve(e){const t=Array.from(e).map((e=>fe.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function me({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null===(t=e.match(pe))||void 0===t?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(ve))||[]}(e);a.forEach((e=>{const a=function(e){if(e.length<=4){const[n]=function(e){const t=[];for(const n of e)t.push(n.codePointAt(0));return t}(e);return t.numberToValue(n)}return e}(e),o=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(a);if(o){const{k:e,d:t,n:a}=o;n.push({key:e,defaultValue:t,ns:a})}}));const o=function(e){return e.replace(pe,"")}(e);return{text:o,keys:n}},wrap({key:a,defaultValue:o,translation:r,ns:i}){let s;if(e){s=he(n({key:a,ns:i}))}else{const e=n({key:a,ns:i,defaultValue:o}),r=t.valueToNumber(e);s=he(String.fromCodePoint(r))}const l=r||"";return"string"==typeof l?l+s:l},testTextNode(e){var t,n,a;return null!==(a=(null===(t=e.textContent)||void 0===t?void 0:t.includes(`${fe[0]}${fe[0]}`))||(null===(n=e.textContent)||void 0===n?void 0:n.includes(`${fe[1]}${fe[0]}`)))&&void 0!==a&&a},testAttribute:e=>e.value.includes(`${fe[0]}${fe[0]}`)||e.value.includes(`${fe[1]}${fe[0]}`)})}function ye(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function be({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:o,ns:r}=function(e){let t=!1,n="",a="",o="KEY";const r={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{r.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==o||","!==s?"KEY"!==o||"|"!==s?"NAMESPACE"!==o||","!==s?"KEY"!==o||":"!==s?"DEFAULT_VALUE"!==o||":"!==s?"PARAM_NAME"!==o||":"!==s?"PARAM_VALUE"!==o||","!==s?n+=s:(o="PARAM_NAME",r.params[a]=n,n=""):(o="PARAM_VALUE",a=n,n=""):(o="PARAM_NAME",r.defaultValue=n,n=""):(o="PARAM_NAME",r.key=n,n=""):(o="DEFAULT_VALUE",i(n),n=""):(o="NAMESPACE",r.key=n,n=""):(o="DEFAULT_VALUE",r.key=n,n=""):t=!0;return"KEY"===o&&(r.key=n),"DEFAULT_VALUE"===o&&(r.defaultValue=n),"PARAM_VALUE"===o&&(r.params[a]=n),"NAMESPACE"===o&&i(n),r}(e);return{translated:n({key:t,params:a,defaultValue:o,ns:r,noWrap:!0}),key:t,params:a,defaultValue:o,ns:r}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){return"string"==typeof e?e.replace(/[,:|\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:o,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${r(e)}:${r(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==o?`,${r(o)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>r(e))).join("|")}`:"";return`${e}${r(n)}${u}${l}${s}${t}`},unwrap(n){const r=new RegExp(`(\\\\?)(${o(e)}(.*?)${o(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=r.exec(n));){let e=s[1];const[t,o,r,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!ye(d,n)){u+=r;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,o,r;return null!==(r=(null===(a=n.textContent)||void 0===a?void 0:a.includes(e))&&(null===(o=n.textContent)||void 0===o?void 0:o.includes(t)))&&void 0!==r&&r},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const Ee=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=le();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=be({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&te(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=le();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=me({fullKeyEncode:t.options.fullKeyEncode});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Le(e){const t=Oe.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function we(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,o=0;const r=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Le(e[i]),n+=5,n>=8&&(r[o++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",o=Math.pow(2,16)-1;for(let e=0;e<n;e+=o)e+o>n&&(o=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+o));return a}(r.buffer)}function ke(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=we(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}const Ae=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:o,fetch:r}){var i;const s=null!==(i=ke(t))&&void 0!==i?i:o;let l=void 0!==s?`${e}/v2/projects/${s}/translations/${n}`:`${e}/v2/projects/translations/${n}`;if(a&&(l+=`?ns=${a}`),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===o)throw new Error("You need to specify 'projectId' when using PAT key");return r(l,{headers:{"X-API-Key":t||"","Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e);function je({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:o=300}){let r=!1;const i=()=>new Promise(((a,r)=>{const i=function(e,t){const n=n=>{var a,o;e.includes(null===(a=n.data)||void 0===a?void 0:a.type)&&t(null===(o=n.data)||void 0===o?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),r()}),o);function l(){i.unsubscribe()}}));return{cancel(){r=!0},promise:(async()=>{for(let e=0;e<a;e++){if(r)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!r)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}const Ne="tolgee-in-context-tools.umd.min.js",Te="@tolgee/in-context-tools",xe="InContextTools",Ce="https://cdn.jsdelivr.net/npm";let Re=null;function Pe(e){var t;return Re||(Re=(t=`${Ce}/@tolgee/web@${e}/dist/${Ne}`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window[Te][xe]))),Re}const Se="__tolgee_apiKey",De="__tolgee_apiUrl";function Ie(){const e=sessionStorage.getItem(Se)||void 0,t=sessionStorage.getItem(De)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Ue(){sessionStorage.removeItem(Se),sessionStorage.removeItem(De)}let _e=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(_e=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=je({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Ue)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return Ie()&&(async()=>{const e=await Pe("5.19.4");return t=>{const n=Ie();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Fe="__tolgee_currentLanguage";const $e=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(J("LanguageStorage"),localStorage.getItem(Fe)||void 0),setLanguage(e){J("LanguageStorage"),localStorage.setItem(Fe,e)}}),e);const Me=()=>(e,t)=>(t.setLanguageDetector({getLanguage({availableLanguages:e}){J("LanguageDetector");const t=window.navigator.language,n=e.find((e=>e===t));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),o=a(window.navigator.language);return e.find((e=>a(e)===o))||void 0}}),e);function Ke(e){return e.endsWith("/")?e.slice(0,-1):e}const Be={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${Ke(n)}/${e}/${t}.json`:`${Ke(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"}};function Ve(e){const t=Object.assign(Object.assign(Object.assign({},Be),e),{headers:Object.assign(Object.assign({},Be.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:o,headers:r}=t,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(t,["prefix","getPath","getData","headers"]);return{getRecord:({namespace:e,language:t,fetch:s})=>s(a({namespace:e,language:t,prefix:n}),Object.assign({headers:r},i)).then((e=>{if(!e.ok)throw new Error(`${e.url} ${e.status}`);return o(e)}))}}const ze=e=>(t,n)=>(n.addBackend(Ve(e)),t);function We(){return j().use(_e())}const Ye=()=>e=>e;export{ze as BackendFetch,_e as BrowserExtensionPlugin,V as DEVTOOLS_ID,Ae as DevBackend,Ye as DevTools,B as FormatSimple,Me as LanguageDetector,$e as LanguageStorage,Ee as ObserverPlugin,z as PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY,H as TOLGEE_ATTRIBUTE_NAME,Y as TOLGEE_RESTRICT_ATTRIBUTE,W as TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE,We as Tolgee,j as TolgeeCore,u as createFetchFunction,o as getFallback,r as getFallbackArray,ke as getProjectIdFromApiKey,k as getTranslateProps};
//# sourceMappingURL=tolgee-web.production.esm.min.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@tolgee/web"]={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function n(e){return Boolean(e&&"function"==typeof e.then)}function a(e,t){return n(e)?Promise.resolve(e).then(t):t(e)}function o(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function r(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function i(e){return r(e)||[]}function s(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?i(t):i(null==t?void 0:t[e]);var n}function l(e){return Array.from(new Set(e))}function c(e){return e?e.replace(/\/+$/,""):e}const u=(e,t)=>fetch(e,t),g=(e=u)=>(t,n)=>e(t,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.19.3"},null==n?void 0:n.headers)}));function d(e){let t=[];return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(n){e()&&t.forEach((e=>e({value:n})))}})}function f(e,t,n){const a=new Set,o=new Set;let r=[];function s(){if(0===r.length)return;const e=r;r=[],a.forEach((e=>{e({value:void 0})}));let n=new Set;e.forEach((e=>{void 0===e?n=void 0:void 0!==n&&e.forEach((e=>n.add(e)))}));!function(e){const n=new Set(t());o.forEach((t=>{(void 0===e||-1!==(null==e?void 0:e.findIndex((e=>n.has(e)||t.namespaces.has(e)))))&&t.fn({value:void 0})}))}(n?Array.from(n.keys()):void 0)}return Object.freeze({emit(t,n){e()&&(r.push(t),n?setTimeout(s,0):s())},listen(e){a.add(e);return{unsubscribe:()=>{a.delete(e)}}},listenSome(e){const t={fn:t=>{e(t)},namespaces:new Set};o.add(t);const a={unsubscribe:()=>{o.delete(t)},subscribeNs:e=>(i(e).forEach((e=>t.namespaces.add(e))),void 0===e&&t.namespaces.add(n()),a)};return a}})}const p=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):p(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},h=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},v=({language:e,namespace:t})=>t?`${e}:${t}`:e;function m(e,t,n,a,o,r,s){const c=new Map,u=new Map;let g={},d=0;function f(t,n,a){const o=v(t);u.set(o,{data:p(n),version:a}),e.emit(t)}function m(e){let n;if(!n){const t=g[v(e)];"function"==typeof t&&(n=t())}return n||(n=t(e)),n}const y=Object.freeze({addStaticData(e){e&&(g=Object.assign(Object.assign({},g),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=h(e),a=u.get(e);a&&0!==a.version||f(n,t,0)}})))},invalidate(){c.clear(),d+=1},addRecord(e,t){f(e,t,d)},exists(e,t=!1){const n=u.get(v(e));return n&&t?n.version===d:Boolean(n)},getRecord(e){var t;return null===(t=u.get(v(a(e))))||void 0===t?void 0:t.data},getTranslation(e,t){var n;return null===(n=u.get(v(e)))||void 0===n?void 0:n.data.get(t)},getTranslationNs(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(v({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return[o]}return l(e)},getTranslationFallback(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(v({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return t}},changeTranslation(t,n,a){var o;const r=null===(o=u.get(v(t)))||void 0===o?void 0:o.data;null==r||r.set(n,a),e.emit(Object.assign(Object.assign({},t),{key:n}))},isFetching(e){if(o())return!0;if(void 0===e)return c.size>0;const t=i(e);return Boolean(Array.from(c.keys()).find((e=>t.includes(h(e).namespace))))},isLoading(e,t){const n=i(t);return Boolean(o()||Array.from(c.keys()).find((t=>{const a=h(t);return(!n.length||n.includes(a.namespace))&&!y.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const o=e.map((e=>{const o=a(e),r=v(o),i=c.get(r);if(i)return{new:!1,promise:i,keyObject:o,cacheKey:r};const s=function(e,t){var a;let o;return t&&(o=null===(a=n(e))||void 0===a?void 0:a.catch((()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),m(e))))),o||(o=m(e)),o}(o,t)||Promise.resolve(void 0);return c.set(r,s),{new:!0,promise:s,keyObject:o,cacheKey:r}}));r.notify(),s.notify();const i=await Promise.all(o.map((e=>e.promise)));return o.forEach(((e,t)=>{const n=c.get(e.cacheKey)!==e.promise;if(e.new&&!n){c.delete(e.cacheKey);const n=i[t];n?y.addRecord(e.keyObject,n):y.getRecord(e.keyObject)||y.addRecord(e.keyObject,{})}})),r.notify(),s.notify(),o.map((e=>y.getRecord(e.keyObject)))},getAllRecords:()=>Array.from(u.entries()).map((([e,t])=>Object.assign(Object.assign({},h(e)),{data:t.data})))});return y}function y(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}const b="invalid",E={defaultNs:"",observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:b,apiUrl:"https://app.tolgee.io",fetch:g(),onTranslationMissing:({key:e})=>e},O=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function L(e,t){const n=O(E,null==t?void 0:t.initialOptions,e);return n.apiUrl=c(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=g(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function w(e,t,o,r,i,s,l,c){const u={ui:void 0},g={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},d=async({keysAndDefaults:e,event:t})=>{var n;const a=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:r(t),namespace:i({key:e,ns:t})[0],translation:s({key:e,ns:t})})));null===(n=g.ui)||void 0===n||n.handleElementClick(a,t)},f=(e,t)=>{var n;return(null===(n=g.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function p(e){const t=s({key:e.key,ns:e.ns});return N.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:t().fetch}}function v(e){g.observer=null==e?void 0:e()}function m(){return Boolean(g.observer)}function E(e){e&&g.formatters.push(e)}function O(e){g.finalFormatter=e}function L(e){u.ui=e}function w(){return Boolean(u.ui)}function A(e){g.languageStorage=e}function T(e){g.languageDetector=e}function k(e){e&&g.backends.push(e)}function j(e){g.devBackend=e}const N=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:O,addFormatter:E,setObserver:v,hasObserver:m,setUi:L,hasUi:w,setDevBackend:j,addBackend:k,setLanguageDetector:T,setLanguageStorage:A}))},run(){var e,n;const{apiKey:a,apiUrl:o,projectId:r,observerOptions:i}=t();g.ui=null===(e=u.ui)||void 0===e?void 0:e.call(u,{apiKey:a,apiUrl:o,projectId:r,highlight:N.highlight,changeTranslation:l,findPositions:f,onPermanentChange:c}),null===(n=g.observer)||void 0===n||n.run({mouseHighlight:!0,options:i,translate:p,onClick:d})},stop(){var e;g.ui=void 0,null===(e=g.observer)||void 0===e||e.stop()},getLanguageStorage:()=>g.languageStorage,getInitialLanguage(){var e;const t=o();return a(null===(e=g.languageStorage)||void 0===e?void 0:e.getLanguage(h()),(e=>t&&!t.includes(e)||!e?function(){if(!g.languageDetector)return;const e=o();return g.languageDetector.getLanguage(Object.assign({availableLanguages:e},h()))}():e))},setStoredLanguage(e){var t;null===(t=g.languageStorage)||void 0===t||t.setLanguage(e,h())},getDevBackend:()=>g.devBackend,getBackendRecord:({language:e,namespace:t})=>{for(const a of g.backends){const o=a.getRecord(Object.assign({language:e,namespace:t},h()));if(n(o))return null==o?void 0:o.catch((e=>(console.error(e),{})));if(void 0!==o)return o}},getBackendDevRecord:({language:e,namespace:n})=>{var a;const{apiKey:o,apiUrl:r,projectId:i}=t();return null===(a=g.devBackend)||void 0===a?void 0:a.getRecord(Object.assign({apiKey:o,apiUrl:r,projectId:i,language:e,namespace:n},h()))},getLanguageDetector:()=>g.languageDetector,retranslate(){var e;null===(e=g.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=g.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(N.getDevBackend()),formatTranslation(n){var a,{formatEnabled:o}=n,r=y(n,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:c,params:u,ns:d,orEmpty:f}=r,p=null!=s?s:l;let h="";null==s&&(h=t().onTranslationMissing(r));let v=null!=p?p:f?"":h;const m=e(),E=o||!(null===(a=g.observer)||void 0===a?void 0:a.outputNotFormattable),O=e=>g.observer&&!c?g.observer.wrap({key:i,translation:e,defaultValue:l,params:u,ns:d}):e;v=O(v);try{if(p&&m&&E)for(const e of g.formatters)v=e.format({translation:v,language:m,params:u});g.finalFormatter&&p&&m&&E&&(v=g.finalFormatter.format({translation:v,language:m,params:u}))}catch(e){console.error(e);const n=("string"==typeof(L=e)?L:"string"==typeof(null==L?void 0:L.message)?L.message:void 0)||b,a=t().onFormatError,o=typeof a;v="string"===o?a:"function"===o?a(n,r):b,v=O(v)}var L;return v}});return N}const A=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const T=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:o,language:r}=e,i=y(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:r};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function k({options:e}){const t=function(e,t){let n=!0;function a(){return n}const o=Object.freeze({onPendingLanguageChange:d(a),onLanguageChange:d(a),onLoadingChange:d(a),onFetchingChange:d(a),onInitialLoaded:d(a),onRunningChange:d(a),onCacheChange:d(a),onUpdate:f(a,e,t),onPermanentChange:d(a),setEmitterActive(e){n=e},on:(e,t)=>{switch(e){case"pendingLanguage":return o.onPendingLanguageChange.listen(t);case"language":return o.onLanguageChange.listen(t);case"loading":return o.onLoadingChange.listen(t);case"fetching":return o.onFetchingChange.listen(t);case"initialLoad":return o.onInitialLoaded.listen(t);case"running":return o.onRunningChange.listen(t);case"cache":return o.onCacheChange.listen(t);case"update":return o.onUpdate.listen(t);case"permanentChange":return o.onPermanentChange.listen(t)}}});return o.onInitialLoaded.listen((()=>o.onUpdate.emit())),o.onLanguageChange.listen((()=>o.onUpdate.emit())),o.onCacheChange.listen((({value:e})=>o.onUpdate.emit([e.namespace],!0))),o}(b,E),r=A(!1,(()=>v.isFetching()),t.onFetchingChange.emit),u=A(!1,(()=>S.isLoading()),t.onLoadingChange.emit),g=function(e,t,n){let a,o=L();const r=Object.freeze({init(e){o=L(e,o)},isRunning:()=>o.isRunning,setRunning(e){o.isRunning!==e&&(o.isRunning=e,n.emit(e))},isInitialLoading:()=>o.isInitialLoading,setInitialLoading(e){o.isInitialLoading=e},getLanguage:()=>o.language||o.initialOptions.language,setLanguage(t){o.language!==t&&(o.language=t,e.emit(t))},getPendingLanguage:()=>o.pendingLanguage||r.getLanguage(),setPendingLanguage(e){o.pendingLanguage!==e&&(o.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},o.initialOptions),a),addActiveNs(e){i(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t?o.activeNamespaces.set(e,t+1):o.activeNamespaces.set(e,1)}))},removeActiveNs(e){i(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t&&t>1?o.activeNamespaces.set(e,t-1):o.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>l([...o.initialOptions.ns||[o.initialOptions.defaultNs],...i(o.initialOptions.fallbackNs),...o.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||r.getLanguage();return t?l([t,...s(t,o.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>i(o.initialOptions.fallbackNs),getDefaultNs:e=>void 0===e?o.initialOptions.defaultNs:e,getAvailableLanguages(){if(o.initialOptions.availableLanguages)return o.initialOptions.availableLanguages;if(o.initialOptions.staticData){const e=Object.keys(o.initialOptions.staticData).map((e=>h(e).language));return Array.from(new Set(e))}},withDefaultNs:e=>({namespace:void 0===e.namespace?r.getInitialOptions().defaultNs:e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:c(e.apiUrl)}):void 0}});return r}(t.onLanguageChange,t.onPendingLanguageChange,t.onRunningChange),p=w(g.getLanguage,g.getInitialOptions,g.getAvailableLanguages,O,C,R,j,(function(e){t.onPermanentChange.emit({key:e.key,namespace:e.namespace})})),v=m(t.onCacheChange,p.getBackendRecord,p.getBackendDevRecord,g.withDefaultNs,g.isInitialLoading,r,u);let y;function b(){return g.getFallbackNs()}function E(e){return g.getDefaultNs(e)}function O(e){return[...i(E(e)),...b()]}function k(e){return[...i(null!=e?e:E()),...g.getRequiredNamespaces()]}function j(e,t,n){const a=g.withDefaultNs(e),o=v.getTranslation(a,t);return v.changeTranslation(a,t,n),{revert(){v.changeTranslation(a,t,o)}}}function N(e){g.init(e),v.addStaticData(g.getInitialOptions().staticData)}function x(e,t){const n=function(e,t){const n=g.getFallbackLangs(e),a=k(t),o=[];return n.forEach((e=>{a.forEach((t=>{v.exists({language:e,namespace:t},!0)||o.push({language:e,namespace:t})}))})),o}(e,t);if(n.length)return a(S.loadRecords(n),(()=>{}))}function C({key:e,ns:t}){const n=g.getFallbackLangs(),a=O(null!=t?t:void 0);return v.getTranslationNs(a,n,e)}function R({key:e,ns:t,language:n}){const a=O(null!=t?t:void 0),o=g.getFallbackLangs(n);return v.getTranslationFallback(a,o,e)}function P(){const e=a(function(){if(g.getLanguage())return;return a(p.getInitialLanguage(),(e=>{const t=e||g.getInitialOptions().defaultLanguage;t&&g.setLanguage(t)}))}(),(()=>x()));if(n(e))return g.setInitialLoading(!0),r.notify(),u.notify(),Promise.resolve(e).then((()=>{g.setInitialLoading(!1),r.notify(),u.notify(),t.onInitialLoaded.emit()}));t.onInitialLoaded.emit()}e&&N(e),t.onUpdate.listen((()=>{g.isRunning()&&p.retranslate()}));const S=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),g),p),v),{init:N,getTranslation:R,changeTranslation:j,getTranslationNs:C,getDefaultAndFallbackNs:O,async changeLanguage(e){g.getPendingLanguage()===e&&g.getLanguage()===e||(g.setPendingLanguage(e),g.isRunning()&&await x(e),e===g.getPendingLanguage()&&(g.setLanguage(e),p.setStoredLanguage(e)))},async addActiveNs(e,t){t||g.addActiveNs(e),g.isRunning()&&await x(void 0,e)},loadRecords:e=>v.loadRecords(e,S.isDev()),loadRecord:async e=>(await S.loadRecords([e]))[0],isLoading:e=>v.isLoading(g.getLanguage(),e),isLoaded(e){const t=g.getLanguage();if(!t)return!1;const n=g.getFallbackLangs(t),a=k(e),o=[];return n.forEach((e=>{a.forEach((t=>{v.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=T(...e),n=R(t);return p.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(g.getInitialOptions().apiKey&&g.getInitialOptions().apiUrl),run:()=>(function(){if((p.getLanguageDetector()||p.getLanguageStorage())&&!g.getAvailableLanguages())throw new Error(o("availableLanguages"));if(!g.getLanguage()&&!g.getInitialOptions().defaultLanguage)throw new Error(o(["defaultLanguage","language"]))}(),g.isRunning()||(g.setRunning(!0),p.run(),y=P()),Promise.resolve(y)),stop(){g.isRunning()&&(p.stop(),g.setRunning(!1))}}));return S}const j=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=O(e.options,n),t),init(t){const n=function(e){const t=k({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,onNsUpdate:t.onUpdate.listenSome,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(O(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},N=0,x=1,C=2;class R extends Error{constructor(e,t,n){let a;a=e===N?"Empty parameter":e===x?"Unexpected character":"Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`),this.code=e,this.index=t}}function P(e){return/\s/.test(e)}const S=0,D=1,_=2,I=3,U=4,F=new Set([_,D,S]),$="'",M=new Set(["{","}",$]),B=e=>/[0-9a-zA-Z_]/.test(e);function K(e,t){const[n,a]=function(e){let t=S,n="",a="",o="";const r=[],i=[];let s=0;function l(t){throw new R(t,s,e)}const c=()=>{r.push(n),n=""},u=()=>{""===a&&l(N),i.push(a),a=""};for(s=0;s<e.length;s++)switch(o=e[s],t){case S:o===$?(n+=o,t=D):"{"===o?(c(),t=I):(n+=o,t=S);break;case D:M.has(o)?(n=n.slice(0,-1)+o,t=_):(n+=o,t=S);break;case _:o===$?t=S:(n+=o,t=_);break;case I:"}"===o?(u(),t=S):P(o)?""!==a&&(u(),t=U):(B(o)||l(x),a+=o,t=I);break;case U:"}"==o?t=S:P(o)?t=U:l(x)}return F.has(t)||l(C),c(),[r,i]}(e),o=[n[0]];for(let r=1;r<n.length;r++){const i=null==t?void 0:t[a[r-1]];if(void 0===i)throw new Error(`Missing parameter "${a[r-1]}" in "${e}"`);o.push(String(i)),o.push(n[r])}return o.join("")}const V="__tolgee_dev_tools",z="data-tolgee-key-only",W="data-tolgee-restricted",G="_tolgee",Y="_tolgee-highlighter";function H(){var e,t;return void 0===(null===(t=null===(e=globalThis.window)||void 0===e?void 0:e.document)||void 0===t?void 0:t.createElement)}function X(e){if(H())throw new Error(`${e}: Can't run on the server`)}function J(e,t){return{oldTextContent:e,keys:t}}const q={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function Z({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(Y),Object.entries(q).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const r=n.getBoundingClientRect();o.style.borderWidth=t+"px",o.style.top=r.top-t+"px",o.style.left=r.left-t+"px",o.style.width=r.width+"px",o.style.height=r.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null===(e=t.highlightEl)||void 0===e||e.remove(),t.highlightEl=void 0}}(0,a)}})}function Q(e){return e.textContent}function ee(e,t){e.textContent=t}function te(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,o=void 0===e.ns||void 0===t.ns||-1!==(null===(n=e.ns)||void 0===n?void 0:n.findIndex((e=>{var n;return null===(n=t.ns)||void 0===n?void 0:n.includes(e)})));return a&&o}const ne={capture:!0},ae={capture:!0,passive:!0},oe=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function re({highlightKeys:e,elementStore:t,onClick:n,options:a}){var o,r;const i=new Set;let s,l,c=[];const u=(null===(o=a.targetElement)||void 0===o?void 0:o.getRootNode())||document,g=(null===(r=a.targetElement)||void 0===r?void 0:r.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null===(e=n.unhighlight)||void 0===e||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=w(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null===(n=a.highlight)||void 0===n||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of oe.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(w(t,(e=>e.id===V))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null===(e=null==n?void 0:n.highlight)||void 0===e||e.call(n)}function O(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(e,s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function w(e,t){return e.id===V?null:t(e)?e:(null==e?void 0:e.parentElement)?w(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,ne),L("keyup",b,ne),L("mousemove",m,ae),L("scroll",E,ae),L("click",O,ne),L("mouseenter",v,ne),L("mouseover",v,ne),L("mouseout",v,ne),L("mouseleave",v,ne),L("mousedown",v,ne),L("mouseup",v,ne)}})}function ie(e,t,n){const a=Z({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),o=re({highlightKeys:e.highlightKeys,elementStore:t,onClick(e,a){const o=t.get(a);n({event:e,keysAndDefaults:s(o)})},options:e});function i(e,n){var a;n.highlightEl&&(null===(a=n.unhighlight)||void 0===a||a.call(n)),e.removeAttribute(G),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({register(n,o,r){if(function(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${W}]`)}(n))return;const i=n;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(G,"true")),s.nodes.set(o,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===z&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,o)=>{for(const t of o.nodes.values()){if(t.keys.find((t=>te({key:e,ns:r(n)},{key:t.key,ns:r(t.ns)})))){a.push(o);break}}})),a},run(e){e&&o.run()},stop(){o.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null===(n=t.unhighlight)||void 0===n||n.call(t))}))}})}function se(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:o,onClick:r}){if(H())return{stop(){t=!1},wrapper:o};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var o,r;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!==(o=s[e.tagName.toUpperCase()])&&void 0!==o?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null===(t=s[e.tagName.toUpperCase()])||void 0===t?void 0:t.some((t=>e.hasAttribute(t))))||(null===(n=s["*"])||void 0===n?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!==(r=s[n.tagName.toUpperCase()])&&void 0!==r?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,o),l=ie(a,n,r);function c(e){for(const t of e){const e=Q(t),n=e?o.unwrap(e):null;if(n){const{text:a,keys:o}=n;ee(t,a);const r=J(e,o),s=i.getSuitableParent(t);l.register(s,t,r)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:Q(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===z)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(z);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(z)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(z))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===z))&&l.cleanupLingeringKeyAttributes();const o=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>o.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>o.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>o.delete(e)));break;case"attributes":t.attributeName===z&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>o.add(e)))}c([...o])})),f=a.targetElement||document.body;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(z),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:o}}const o=Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null===(a=null===(n=null==e?void 0:e.elementRegistry)||void 0===n?void 0:n.forEachElement)||void 0===a||a.call(n,t)},highlight(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[];return o.forEach((e=>{var t;return null===(t=e.highlight)||void 0===t?void 0:t.call(e)})),{unhighlight(){o.forEach((e=>{var t;return null===(t=e.unhighlight)||void 0===t?void 0:t.call(e)}))}}},findPositions(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[],i=[];return o.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),o.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{te({key:t,ns:r(n)},{key:e.key,ns:r(e.ns)})&&i.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),i},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""});return o}var le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ce={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),o=[],r=0;;){var i=t<e.length;if(!i||r>=n-1){var s=a.subarray(0,r);if(o.push(String.fromCharCode.apply(null,s)),!i)return o.join("");e=e.subarray(t),t=0,r=0}var l=e[t++];if(0==(128&l))a[r++]=l;else if(192==(224&l)){var c=63&e[t++];a[r++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[r++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[r++]=g>>>10&1023|55296,g=56320|1023&g),a[r++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,r=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,o=Math.max(32,n+(n>>>1)+7),r=new Uint8Array(o>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>r.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(o);l.set(r),r=l}if(0!=(4294967168&i)){if(0==(4294965248&i))r[a++]=i>>>6&31|192;else if(0==(4294901760&i))r[a++]=i>>>12&15|224,r[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;r[a++]=i>>>18&7|240,r[a++]=i>>>12&63|128,r[a++]=i>>>6&63|128}r[a++]=63&i|128}else r[a++]=i}return r.slice?r.slice(0,a):r.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),r(e)};var s=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;o?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:le);var ue,ge=t({__proto__:null,default:ce},[ce]);null===(ue=console.assert)||void 0===ue||ue.call(console,ge);const de=["‌","‍"],fe=RegExp(`([${de.join("")}]{9})+`,"gu");function pe(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>de[Number(e)])).join("")}function he(e){const t=Array.from(e).map((e=>de.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function ve({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null===(t=e.match(fe))||void 0===t?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(he))||[]}(e);a.forEach((e=>{const a=function(e){if(e.length<=4){const[n]=function(e){const t=[];for(const n of e)t.push(n.codePointAt(0));return t}(e);return t.numberToValue(n)}return e}(e),o=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(a);if(o){const{k:e,d:t,n:a}=o;n.push({key:e,defaultValue:t,ns:a})}}));const o=function(e){return e.replace(fe,"")}(e);return{text:o,keys:n}},wrap({key:a,defaultValue:o,translation:r,ns:i}){let s;if(e){s=pe(n({key:a,ns:i}))}else{const e=n({key:a,ns:i,defaultValue:o}),r=t.valueToNumber(e);s=pe(String.fromCodePoint(r))}const l=r||"";return"string"==typeof l?l+s:l},testTextNode(e){var t,n,a;return null!==(a=(null===(t=e.textContent)||void 0===t?void 0:t.includes(`${de[0]}${de[0]}`))||(null===(n=e.textContent)||void 0===n?void 0:n.includes(`${de[1]}${de[0]}`)))&&void 0!==a&&a},testAttribute:e=>e.value.includes(`${de[0]}${de[0]}`)||e.value.includes(`${de[1]}${de[0]}`)})}function me(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function ye({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:o,ns:r}=function(e){let t=!1,n="",a="",o="KEY";const r={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{r.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==o||","!==s?"KEY"!==o||"|"!==s?"NAMESPACE"!==o||","!==s?"KEY"!==o||":"!==s?"DEFAULT_VALUE"!==o||":"!==s?"PARAM_NAME"!==o||":"!==s?"PARAM_VALUE"!==o||","!==s?n+=s:(o="PARAM_NAME",r.params[a]=n,n=""):(o="PARAM_VALUE",a=n,n=""):(o="PARAM_NAME",r.defaultValue=n,n=""):(o="PARAM_NAME",r.key=n,n=""):(o="DEFAULT_VALUE",i(n),n=""):(o="NAMESPACE",r.key=n,n=""):(o="DEFAULT_VALUE",r.key=n,n=""):t=!0;return"KEY"===o&&(r.key=n),"DEFAULT_VALUE"===o&&(r.defaultValue=n),"PARAM_VALUE"===o&&(r.params[a]=n),"NAMESPACE"===o&&i(n),r}(e);return{translated:n({key:t,params:a,defaultValue:o,ns:r,noWrap:!0}),key:t,params:a,defaultValue:o,ns:r}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){return"string"==typeof e?e.replace(/[,:|\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:o,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${r(e)}:${r(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==o?`,${r(o)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>r(e))).join("|")}`:"";return`${e}${r(n)}${u}${l}${s}${t}`},unwrap(n){const r=new RegExp(`(\\\\?)(${o(e)}(.*?)${o(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=r.exec(n));){let e=s[1];const[t,o,r,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!me(d,n)){u+=r;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,o,r;return null!==(r=(null===(a=n.textContent)||void 0===a?void 0:a.includes(e))&&(null===(o=n.textContent)||void 0===o?void 0:o.includes(t)))&&void 0!==r&&r},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const be="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Ee(e){const t=be.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function Oe(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,o=0;const r=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Ee(e[i]),n+=5,n>=8&&(r[o++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",o=Math.pow(2,16)-1;for(let e=0;e<n;e+=o)e+o>n&&(o=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+o));return a}(r.buffer)}function Le(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=Oe(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function we({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:o=300}){let r=!1;const i=()=>new Promise(((a,r)=>{const i=function(e,t){const n=n=>{var a,o;e.includes(null===(a=n.data)||void 0===a?void 0:a.type)&&t(null===(o=n.data)||void 0===o?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),r()}),o);function l(){i.unsubscribe()}}));return{cancel(){r=!0},promise:(async()=>{for(let e=0;e<a;e++){if(r)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!r)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}const Ae="tolgee-in-context-tools.umd.min.js",Te="@tolgee/in-context-tools",ke="InContextTools",je="https://cdn.jsdelivr.net/npm";let Ne=null;function xe(e){var t;return Ne||(Ne=(t=`${je}/@tolgee/web@${e}/dist/${Ae}`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.body.appendChild(a)}))).then((()=>window[Te][ke]))),Ne}const Ce="__tolgee_apiKey",Re="__tolgee_apiUrl";function Pe(){const e=sessionStorage.getItem(Ce)||void 0,t=sessionStorage.getItem(Re)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Se(){sessionStorage.removeItem(Ce),sessionStorage.removeItem(Re)}e.BrowserExtensionPlugin=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(e.BrowserExtensionPlugin=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=we({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Se)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return Pe()&&(async()=>{const e=await xe("5.19.3");return t=>{const n=Pe();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const De="__tolgee_currentLanguage";function _e(e){return e.endsWith("/")?e.slice(0,-1):e}const Ie={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${_e(n)}/${e}/${t}.json`:`${_e(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"}};function Ue(e){const t=Object.assign(Object.assign(Object.assign({},Ie),e),{headers:Object.assign(Object.assign({},Ie.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:o,headers:r}=t,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(t,["prefix","getPath","getData","headers"]);return{getRecord:({namespace:e,language:t,fetch:s})=>s(a({namespace:e,language:t,prefix:n}),Object.assign({headers:r},i)).then((e=>{if(!e.ok)throw new Error(`${e.url} ${e.status}`);return o(e)}))}}e.BackendFetch=e=>(t,n)=>(n.addBackend(Ue(e)),t),e.DEVTOOLS_ID=V,e.DevBackend=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:o,fetch:r}){var i;const s=null!==(i=Le(t))&&void 0!==i?i:o;let l=void 0!==s?`${e}/v2/projects/${s}/translations/${n}`:`${e}/v2/projects/translations/${n}`;if(a&&(l+=`?ns=${a}`),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===o)throw new Error("You need to specify 'projectId' when using PAT key");return r(l,{headers:{"X-API-Key":t||"","Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e),e.DevTools=()=>e=>e,e.FormatSimple=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>K(e,t)}),e),e.LanguageDetector=()=>(e,t)=>(t.setLanguageDetector({getLanguage({availableLanguages:e}){X("LanguageDetector");const t=window.navigator.language,n=e.find((e=>e===t));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),o=a(window.navigator.language);return e.find((e=>a(e)===o))||void 0}}),e),e.LanguageStorage=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(X("LanguageStorage"),localStorage.getItem(De)||void 0),setLanguage(e){X("LanguageStorage"),localStorage.setItem(De,e)}}),e),e.ObserverPlugin=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=se();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=ye({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&ee(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=se();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=ve({fullKeyEncode:t.options.fullKeyEncode});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),e.PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY="__tolgee_preferredLanguages",e.TOLGEE_ATTRIBUTE_NAME=G,e.TOLGEE_RESTRICT_ATTRIBUTE=W,e.TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE=z,e.Tolgee=function(){return j().use(e.BrowserExtensionPlugin())},e.TolgeeCore=j,e.createFetchFunction=g,e.getFallback=r,e.getFallbackArray=i,e.getProjectIdFromApiKey=Le,e.getTranslateProps=T,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@tolgee/web"]={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function n(e){return Boolean(e&&"function"==typeof e.then)}function a(e,t){return n(e)?Promise.resolve(e).then(t):t(e)}function o(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function r(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function i(e){return r(e)||[]}function s(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?i(t):i(null==t?void 0:t[e]);var n}function l(e){return Array.from(new Set(e))}function c(e){return e?e.replace(/\/+$/,""):e}const u=(e,t)=>fetch(e,t),g=(e=u)=>(t,n)=>e(t,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.19.4"},null==n?void 0:n.headers)}));function d(e){let t=[];return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(n){e()&&t.forEach((e=>e({value:n})))}})}function f(e,t,n){const a=new Set,o=new Set;let r=[];function s(){if(0===r.length)return;const e=r;r=[],a.forEach((e=>{e({value:void 0})}));let n=new Set;e.forEach((e=>{void 0===e?n=void 0:void 0!==n&&e.forEach((e=>n.add(e)))}));!function(e){const n=new Set(t());o.forEach((t=>{(void 0===e||-1!==(null==e?void 0:e.findIndex((e=>n.has(e)||t.namespaces.has(e)))))&&t.fn({value:void 0})}))}(n?Array.from(n.keys()):void 0)}return Object.freeze({emit(t,n){e()&&(r.push(t),n?setTimeout(s,0):s())},listen(e){a.add(e);return{unsubscribe:()=>{a.delete(e)}}},listenSome(e){const t={fn:t=>{e(t)},namespaces:new Set};o.add(t);const a={unsubscribe:()=>{o.delete(t)},subscribeNs:e=>(i(e).forEach((e=>t.namespaces.add(e))),void 0===e&&t.namespaces.add(n()),a)};return a}})}const p=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):p(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},h=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},v=({language:e,namespace:t})=>t?`${e}:${t}`:e;function m(e,t,n,a,o,r,s){const c=new Map,u=new Map;let g={},d=0;function f(t,n,a){const o=v(t);u.set(o,{data:p(n),version:a}),e.emit(t)}function m(e){let n;if(!n){const t=g[v(e)];"function"==typeof t&&(n=t())}return n||(n=t(e)),n}const y=Object.freeze({addStaticData(e){e&&(g=Object.assign(Object.assign({},g),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=h(e),a=u.get(e);a&&0!==a.version||f(n,t,0)}})))},invalidate(){c.clear(),d+=1},addRecord(e,t){f(e,t,d)},exists(e,t=!1){const n=u.get(v(e));return n&&t?n.version===d:Boolean(n)},getRecord(e){var t;return null===(t=u.get(v(a(e))))||void 0===t?void 0:t.data},getTranslation(e,t){var n;return null===(n=u.get(v(e)))||void 0===n?void 0:n.data.get(t)},getTranslationNs(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(v({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return[o]}return l(e)},getTranslationFallback(e,t,n){var a;for(const o of e)for(const e of t){const t=null===(a=u.get(v({language:e,namespace:o})))||void 0===a?void 0:a.data.get(n);if(null!=t)return t}},changeTranslation(t,n,a){var o;const r=null===(o=u.get(v(t)))||void 0===o?void 0:o.data;null==r||r.set(n,a),e.emit(Object.assign(Object.assign({},t),{key:n}))},isFetching(e){if(o())return!0;if(void 0===e)return c.size>0;const t=i(e);return Boolean(Array.from(c.keys()).find((e=>t.includes(h(e).namespace))))},isLoading(e,t){const n=i(t);return Boolean(o()||Array.from(c.keys()).find((t=>{const a=h(t);return(!n.length||n.includes(a.namespace))&&!y.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const o=e.map((e=>{const o=a(e),r=v(o),i=c.get(r);if(i)return{new:!1,promise:i,keyObject:o,cacheKey:r};const s=function(e,t){var a;let o;return t&&(o=null===(a=n(e))||void 0===a?void 0:a.catch((()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),m(e))))),o||(o=m(e)),o}(o,t)||Promise.resolve(void 0);return c.set(r,s),{new:!0,promise:s,keyObject:o,cacheKey:r}}));r.notify(),s.notify();const i=await Promise.all(o.map((e=>e.promise)));return o.forEach(((e,t)=>{const n=c.get(e.cacheKey)!==e.promise;if(e.new&&!n){c.delete(e.cacheKey);const n=i[t];n?y.addRecord(e.keyObject,n):y.getRecord(e.keyObject)||y.addRecord(e.keyObject,{})}})),r.notify(),s.notify(),o.map((e=>y.getRecord(e.keyObject)))},getAllRecords:()=>Array.from(u.entries()).map((([e,t])=>Object.assign(Object.assign({},h(e)),{data:t.data})))});return y}function y(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}const b="invalid",E={defaultNs:"",observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:b,apiUrl:"https://app.tolgee.io",fetch:g(),onTranslationMissing:({key:e})=>e},O=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function L(e,t){const n=O(E,null==t?void 0:t.initialOptions,e);return n.apiUrl=c(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=g(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function w(e,t,o,r,i,s,l,c){const u={ui:void 0},g={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},d=async({keysAndDefaults:e,event:t})=>{var n;const a=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:r(t),namespace:i({key:e,ns:t})[0],translation:s({key:e,ns:t})})));null===(n=g.ui)||void 0===n||n.handleElementClick(a,t)},f=(e,t)=>{var n;return(null===(n=g.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function p(e){const t=s({key:e.key,ns:e.ns});return N.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:t().fetch}}function v(e){g.observer=null==e?void 0:e()}function m(){return Boolean(g.observer)}function E(e){e&&g.formatters.push(e)}function O(e){g.finalFormatter=e}function L(e){u.ui=e}function w(){return Boolean(u.ui)}function A(e){g.languageStorage=e}function T(e){g.languageDetector=e}function k(e){e&&g.backends.push(e)}function j(e){g.devBackend=e}const N=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:O,addFormatter:E,setObserver:v,hasObserver:m,setUi:L,hasUi:w,setDevBackend:j,addBackend:k,setLanguageDetector:T,setLanguageStorage:A}))},run(){var e,n;const{apiKey:a,apiUrl:o,projectId:r,observerOptions:i}=t();g.ui=null===(e=u.ui)||void 0===e?void 0:e.call(u,{apiKey:a,apiUrl:o,projectId:r,highlight:N.highlight,changeTranslation:l,findPositions:f,onPermanentChange:c}),null===(n=g.observer)||void 0===n||n.run({mouseHighlight:!0,options:i,translate:p,onClick:d})},stop(){var e;g.ui=void 0,null===(e=g.observer)||void 0===e||e.stop()},getLanguageStorage:()=>g.languageStorage,getInitialLanguage(){var e;const t=o();return a(null===(e=g.languageStorage)||void 0===e?void 0:e.getLanguage(h()),(e=>t&&!t.includes(e)||!e?function(){if(!g.languageDetector)return;const e=o();return g.languageDetector.getLanguage(Object.assign({availableLanguages:e},h()))}():e))},setStoredLanguage(e){var t;null===(t=g.languageStorage)||void 0===t||t.setLanguage(e,h())},getDevBackend:()=>g.devBackend,getBackendRecord:({language:e,namespace:t})=>{for(const a of g.backends){const o=a.getRecord(Object.assign({language:e,namespace:t},h()));if(n(o))return null==o?void 0:o.catch((e=>(console.error(e),{})));if(void 0!==o)return o}},getBackendDevRecord:({language:e,namespace:n})=>{var a;const{apiKey:o,apiUrl:r,projectId:i}=t();return null===(a=g.devBackend)||void 0===a?void 0:a.getRecord(Object.assign({apiKey:o,apiUrl:r,projectId:i,language:e,namespace:n},h()))},getLanguageDetector:()=>g.languageDetector,retranslate(){var e;null===(e=g.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=g.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return g.observer?null===(t=g.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(N.getDevBackend()),formatTranslation(n){var a,{formatEnabled:o}=n,r=y(n,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:c,params:u,ns:d,orEmpty:f}=r,p=null!=s?s:l;let h="";null==s&&(h=t().onTranslationMissing(r));let v=null!=p?p:f?"":h;const m=e(),E=o||!(null===(a=g.observer)||void 0===a?void 0:a.outputNotFormattable),O=e=>g.observer&&!c?g.observer.wrap({key:i,translation:e,defaultValue:l,params:u,ns:d}):e;v=O(v);try{if(p&&m&&E)for(const e of g.formatters)v=e.format({translation:v,language:m,params:u});g.finalFormatter&&p&&m&&E&&(v=g.finalFormatter.format({translation:v,language:m,params:u}))}catch(e){console.error(e);const n=("string"==typeof(L=e)?L:"string"==typeof(null==L?void 0:L.message)?L.message:void 0)||b,a=t().onFormatError,o=typeof a;v="string"===o?a:"function"===o?a(n,r):b,v=O(v)}var L;return v}});return N}const A=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const T=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:o,language:r}=e,i=y(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:r};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function k({options:e}){const t=function(e,t){let n=!0;function a(){return n}const o=Object.freeze({onPendingLanguageChange:d(a),onLanguageChange:d(a),onLoadingChange:d(a),onFetchingChange:d(a),onInitialLoaded:d(a),onRunningChange:d(a),onCacheChange:d(a),onUpdate:f(a,e,t),onPermanentChange:d(a),setEmitterActive(e){n=e},on:(e,t)=>{switch(e){case"pendingLanguage":return o.onPendingLanguageChange.listen(t);case"language":return o.onLanguageChange.listen(t);case"loading":return o.onLoadingChange.listen(t);case"fetching":return o.onFetchingChange.listen(t);case"initialLoad":return o.onInitialLoaded.listen(t);case"running":return o.onRunningChange.listen(t);case"cache":return o.onCacheChange.listen(t);case"update":return o.onUpdate.listen(t);case"permanentChange":return o.onPermanentChange.listen(t)}}});return o.onInitialLoaded.listen((()=>o.onUpdate.emit())),o.onLanguageChange.listen((()=>o.onUpdate.emit())),o.onCacheChange.listen((({value:e})=>o.onUpdate.emit([e.namespace],!0))),o}(b,E),r=A(!1,(()=>v.isFetching()),t.onFetchingChange.emit),u=A(!1,(()=>S.isLoading()),t.onLoadingChange.emit),g=function(e,t,n){let a,o=L();const r=Object.freeze({init(e){o=L(e,o)},isRunning:()=>o.isRunning,setRunning(e){o.isRunning!==e&&(o.isRunning=e,n.emit(e))},isInitialLoading:()=>o.isInitialLoading,setInitialLoading(e){o.isInitialLoading=e},getLanguage:()=>o.language||o.initialOptions.language,setLanguage(t){o.language!==t&&(o.language=t,e.emit(t))},getPendingLanguage:()=>o.pendingLanguage||r.getLanguage(),setPendingLanguage(e){o.pendingLanguage!==e&&(o.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},o.initialOptions),a),addActiveNs(e){i(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t?o.activeNamespaces.set(e,t+1):o.activeNamespaces.set(e,1)}))},removeActiveNs(e){i(e).forEach((e=>{const t=o.activeNamespaces.get(e);void 0!==t&&t>1?o.activeNamespaces.set(e,t-1):o.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>l([...o.initialOptions.ns||[o.initialOptions.defaultNs],...i(o.initialOptions.fallbackNs),...o.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||r.getLanguage();return t?l([t,...s(t,o.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>i(o.initialOptions.fallbackNs),getDefaultNs:e=>void 0===e?o.initialOptions.defaultNs:e,getAvailableLanguages(){if(o.initialOptions.availableLanguages)return o.initialOptions.availableLanguages;if(o.initialOptions.staticData){const e=Object.keys(o.initialOptions.staticData).map((e=>h(e).language));return Array.from(new Set(e))}},withDefaultNs:e=>({namespace:void 0===e.namespace?r.getInitialOptions().defaultNs:e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:c(e.apiUrl)}):void 0}});return r}(t.onLanguageChange,t.onPendingLanguageChange,t.onRunningChange),p=w(g.getLanguage,g.getInitialOptions,g.getAvailableLanguages,O,C,R,j,(function(e){t.onPermanentChange.emit({key:e.key,namespace:e.namespace})})),v=m(t.onCacheChange,p.getBackendRecord,p.getBackendDevRecord,g.withDefaultNs,g.isInitialLoading,r,u);let y;function b(){return g.getFallbackNs()}function E(e){return g.getDefaultNs(e)}function O(e){return[...i(E(e)),...b()]}function k(e){return[...i(null!=e?e:E()),...g.getRequiredNamespaces()]}function j(e,t,n){const a=g.withDefaultNs(e),o=v.getTranslation(a,t);return v.changeTranslation(a,t,n),{revert(){v.changeTranslation(a,t,o)}}}function N(e){g.init(e),v.addStaticData(g.getInitialOptions().staticData)}function x(e,t){const n=function(e,t){const n=g.getFallbackLangs(e),a=k(t),o=[];return n.forEach((e=>{a.forEach((t=>{v.exists({language:e,namespace:t},!0)||o.push({language:e,namespace:t})}))})),o}(e,t);if(n.length)return a(S.loadRecords(n),(()=>{}))}function C({key:e,ns:t}){const n=g.getFallbackLangs(),a=O(null!=t?t:void 0);return v.getTranslationNs(a,n,e)}function R({key:e,ns:t,language:n}){const a=O(null!=t?t:void 0),o=g.getFallbackLangs(n);return v.getTranslationFallback(a,o,e)}function P(){const e=a(function(){if(g.getLanguage())return;return a(p.getInitialLanguage(),(e=>{const t=e||g.getInitialOptions().defaultLanguage;t&&g.setLanguage(t)}))}(),(()=>x()));if(n(e))return g.setInitialLoading(!0),r.notify(),u.notify(),Promise.resolve(e).then((()=>{g.setInitialLoading(!1),r.notify(),u.notify(),t.onInitialLoaded.emit()}));t.onInitialLoaded.emit()}e&&N(e),t.onUpdate.listen((()=>{g.isRunning()&&p.retranslate()}));const S=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),g),p),v),{init:N,getTranslation:R,changeTranslation:j,getTranslationNs:C,getDefaultAndFallbackNs:O,async changeLanguage(e){g.getPendingLanguage()===e&&g.getLanguage()===e||(g.setPendingLanguage(e),g.isRunning()&&await x(e),e===g.getPendingLanguage()&&(g.setLanguage(e),p.setStoredLanguage(e)))},async addActiveNs(e,t){t||g.addActiveNs(e),g.isRunning()&&await x(void 0,e)},loadRecords:e=>v.loadRecords(e,S.isDev()),loadRecord:async e=>(await S.loadRecords([e]))[0],isLoading:e=>v.isLoading(g.getLanguage(),e),isLoaded(e){const t=g.getLanguage();if(!t)return!1;const n=g.getFallbackLangs(t),a=k(e),o=[];return n.forEach((e=>{a.forEach((t=>{v.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=T(...e),n=R(t);return p.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(g.getInitialOptions().apiKey&&g.getInitialOptions().apiUrl),run:()=>(function(){if((p.getLanguageDetector()||p.getLanguageStorage())&&!g.getAvailableLanguages())throw new Error(o("availableLanguages"));if(!g.getLanguage()&&!g.getInitialOptions().defaultLanguage)throw new Error(o(["defaultLanguage","language"]))}(),g.isRunning()||(g.setRunning(!0),p.run(),y=P()),Promise.resolve(y)),stop(){g.isRunning()&&(p.stop(),g.setRunning(!1))}}));return S}const j=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=O(e.options,n),t),init(t){const n=function(e){const t=k({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,onNsUpdate:t.onUpdate.listenSome,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(O(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},N=0,x=1,C=2;class R extends Error{constructor(e,t,n){let a;a=e===N?"Empty parameter":e===x?"Unexpected character":"Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`),this.code=e,this.index=t}}function P(e){return/\s/.test(e)}const S=0,D=1,_=2,I=3,U=4,F=new Set([_,D,S]),$="'",M=new Set(["{","}",$]),B=e=>/[0-9a-zA-Z_]/.test(e);function K(e,t){const[n,a]=function(e){let t=S,n="",a="",o="";const r=[],i=[];let s=0;function l(t){throw new R(t,s,e)}const c=()=>{r.push(n),n=""},u=()=>{""===a&&l(N),i.push(a),a=""};for(s=0;s<e.length;s++)switch(o=e[s],t){case S:o===$?(n+=o,t=D):"{"===o?(c(),t=I):(n+=o,t=S);break;case D:M.has(o)?(n=n.slice(0,-1)+o,t=_):(n+=o,t=S);break;case _:o===$?t=S:(n+=o,t=_);break;case I:"}"===o?(u(),t=S):P(o)?""!==a&&(u(),t=U):(B(o)||l(x),a+=o,t=I);break;case U:"}"==o?t=S:P(o)?t=U:l(x)}return F.has(t)||l(C),c(),[r,i]}(e),o=[n[0]];for(let r=1;r<n.length;r++){const i=null==t?void 0:t[a[r-1]];if(void 0===i)throw new Error(`Missing parameter "${a[r-1]}" in "${e}"`);o.push(String(i)),o.push(n[r])}return o.join("")}const V="__tolgee_dev_tools",z="data-tolgee-key-only",W="data-tolgee-restricted",G="_tolgee",Y="_tolgee-highlighter";function H(){var e,t;return void 0===(null===(t=null===(e=globalThis.window)||void 0===e?void 0:e.document)||void 0===t?void 0:t.createElement)}function X(e){if(H())throw new Error(`${e}: Can't run on the server`)}function J(e,t){return{oldTextContent:e,keys:t}}const q={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function Z({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(Y),Object.entries(q).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const r=n.getBoundingClientRect();o.style.borderWidth=t+"px",o.style.top=r.top-t+"px",o.style.left=r.left-t+"px",o.style.width=r.width+"px",o.style.height=r.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null===(e=t.highlightEl)||void 0===e||e.remove(),t.highlightEl=void 0}}(0,a)}})}function Q(e){return e.textContent}function ee(e,t){e.textContent=t}function te(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,o=void 0===e.ns||void 0===t.ns||-1!==(null===(n=e.ns)||void 0===n?void 0:n.findIndex((e=>{var n;return null===(n=t.ns)||void 0===n?void 0:n.includes(e)})));return a&&o}const ne={capture:!0},ae={capture:!0,passive:!0},oe=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function re({highlightKeys:e,elementStore:t,onClick:n,options:a}){var o,r;const i=new Set;let s,l,c=[];const u=(null===(o=a.targetElement)||void 0===o?void 0:o.getRootNode())||document,g=(null===(r=a.targetElement)||void 0===r?void 0:r.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null===(e=n.unhighlight)||void 0===e||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=w(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null===(n=a.highlight)||void 0===n||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of oe.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(w(t,(e=>e.id===V))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null===(e=null==n?void 0:n.highlight)||void 0===e||e.call(n)}function O(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(e,s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function w(e,t){return e.id===V?null:t(e)?e:(null==e?void 0:e.parentElement)?w(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,ne),L("keyup",b,ne),L("mousemove",m,ae),L("scroll",E,ae),L("click",O,ne),L("mouseenter",v,ne),L("mouseover",v,ne),L("mouseout",v,ne),L("mouseleave",v,ne),L("mousedown",v,ne),L("mouseup",v,ne)}})}function ie(e,t,n){const a=Z({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),o=re({highlightKeys:e.highlightKeys,elementStore:t,onClick(e,a){const o=t.get(a);n({event:e,keysAndDefaults:s(o)})},options:e});function i(e,n){var a;n.highlightEl&&(null===(a=n.unhighlight)||void 0===a||a.call(n)),e.removeAttribute(G),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({register(n,o,r){if(function(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${W}]`)}(n))return;const i=n;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(G,"true")),s.nodes.set(o,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===z&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,o)=>{for(const t of o.nodes.values()){if(t.keys.find((t=>te({key:e,ns:r(n)},{key:t.key,ns:r(t.ns)})))){a.push(o);break}}})),a},run(e){e&&o.run()},stop(){o.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null===(n=t.unhighlight)||void 0===n||n.call(t))}))}})}function se(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:o,onClick:r}){if(H())return{stop(){t=!1},wrapper:o};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var o,r;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!==(o=s[e.tagName.toUpperCase()])&&void 0!==o?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null===(t=s[e.tagName.toUpperCase()])||void 0===t?void 0:t.some((t=>e.hasAttribute(t))))||(null===(n=s["*"])||void 0===n?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!==(r=s[n.tagName.toUpperCase()])&&void 0!==r?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,o),l=ie(a,n,r);function c(e){for(const t of e){const e=Q(t),n=e?o.unwrap(e):null;if(n){const{text:a,keys:o}=n;ee(t,a);const r=J(e,o),s=i.getSuitableParent(t);l.register(s,t,r)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:Q(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===z)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(z);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(z)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(z))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===z))&&l.cleanupLingeringKeyAttributes();const o=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>o.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>o.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>o.delete(e)));break;case"attributes":t.attributeName===z&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>o.add(e)))}c([...o])})),f=a.targetElement||document.body;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(z),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:o}}const o=Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null===(a=null===(n=null==e?void 0:e.elementRegistry)||void 0===n?void 0:n.forEachElement)||void 0===a||a.call(n,t)},highlight(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[];return o.forEach((e=>{var t;return null===(t=e.highlight)||void 0===t?void 0:t.call(e)})),{unhighlight(){o.forEach((e=>{var t;return null===(t=e.unhighlight)||void 0===t?void 0:t.call(e)}))}}},findPositions(t,n){var a;const o=(null===(a=null==e?void 0:e.elementRegistry)||void 0===a?void 0:a.findAll(t,n))||[],i=[];return o.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),o.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{te({key:t,ns:r(n)},{key:e.key,ns:r(e.ns)})&&i.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),i},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""});return o}var le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ce={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),o=[],r=0;;){var i=t<e.length;if(!i||r>=n-1){var s=a.subarray(0,r);if(o.push(String.fromCharCode.apply(null,s)),!i)return o.join("");e=e.subarray(t),t=0,r=0}var l=e[t++];if(0==(128&l))a[r++]=l;else if(192==(224&l)){var c=63&e[t++];a[r++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[r++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[r++]=g>>>10&1023|55296,g=56320|1023&g),a[r++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,r=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,o=Math.max(32,n+(n>>>1)+7),r=new Uint8Array(o>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>r.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(o);l.set(r),r=l}if(0!=(4294967168&i)){if(0==(4294965248&i))r[a++]=i>>>6&31|192;else if(0==(4294901760&i))r[a++]=i>>>12&15|224,r[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;r[a++]=i>>>18&7|240,r[a++]=i>>>12&63|128,r[a++]=i>>>6&63|128}r[a++]=63&i|128}else r[a++]=i}return r.slice?r.slice(0,a):r.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),r(e)};var s=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;o?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:le);var ue,ge=t({__proto__:null,default:ce},[ce]);null===(ue=console.assert)||void 0===ue||ue.call(console,ge);const de=["‌","‍"],fe=RegExp(`([${de.join("")}]{9})+`,"gu");function pe(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>de[Number(e)])).join("")}function he(e){const t=Array.from(e).map((e=>de.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function ve({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null===(t=e.match(fe))||void 0===t?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(he))||[]}(e);a.forEach((e=>{const a=function(e){if(e.length<=4){const[n]=function(e){const t=[];for(const n of e)t.push(n.codePointAt(0));return t}(e);return t.numberToValue(n)}return e}(e),o=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(a);if(o){const{k:e,d:t,n:a}=o;n.push({key:e,defaultValue:t,ns:a})}}));const o=function(e){return e.replace(fe,"")}(e);return{text:o,keys:n}},wrap({key:a,defaultValue:o,translation:r,ns:i}){let s;if(e){s=pe(n({key:a,ns:i}))}else{const e=n({key:a,ns:i,defaultValue:o}),r=t.valueToNumber(e);s=pe(String.fromCodePoint(r))}const l=r||"";return"string"==typeof l?l+s:l},testTextNode(e){var t,n,a;return null!==(a=(null===(t=e.textContent)||void 0===t?void 0:t.includes(`${de[0]}${de[0]}`))||(null===(n=e.textContent)||void 0===n?void 0:n.includes(`${de[1]}${de[0]}`)))&&void 0!==a&&a},testAttribute:e=>e.value.includes(`${de[0]}${de[0]}`)||e.value.includes(`${de[1]}${de[0]}`)})}function me(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function ye({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:o,ns:r}=function(e){let t=!1,n="",a="",o="KEY";const r={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{r.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==o||","!==s?"KEY"!==o||"|"!==s?"NAMESPACE"!==o||","!==s?"KEY"!==o||":"!==s?"DEFAULT_VALUE"!==o||":"!==s?"PARAM_NAME"!==o||":"!==s?"PARAM_VALUE"!==o||","!==s?n+=s:(o="PARAM_NAME",r.params[a]=n,n=""):(o="PARAM_VALUE",a=n,n=""):(o="PARAM_NAME",r.defaultValue=n,n=""):(o="PARAM_NAME",r.key=n,n=""):(o="DEFAULT_VALUE",i(n),n=""):(o="NAMESPACE",r.key=n,n=""):(o="DEFAULT_VALUE",r.key=n,n=""):t=!0;return"KEY"===o&&(r.key=n),"DEFAULT_VALUE"===o&&(r.defaultValue=n),"PARAM_VALUE"===o&&(r.params[a]=n),"NAMESPACE"===o&&i(n),r}(e);return{translated:n({key:t,params:a,defaultValue:o,ns:r,noWrap:!0}),key:t,params:a,defaultValue:o,ns:r}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){return"string"==typeof e?e.replace(/[,:|\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:o,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${r(e)}:${r(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==o?`,${r(o)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>r(e))).join("|")}`:"";return`${e}${r(n)}${u}${l}${s}${t}`},unwrap(n){const r=new RegExp(`(\\\\?)(${o(e)}(.*?)${o(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=r.exec(n));){let e=s[1];const[t,o,r,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!me(d,n)){u+=r;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,o,r;return null!==(r=(null===(a=n.textContent)||void 0===a?void 0:a.includes(e))&&(null===(o=n.textContent)||void 0===o?void 0:o.includes(t)))&&void 0!==r&&r},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const be="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Ee(e){const t=be.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function Oe(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,o=0;const r=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Ee(e[i]),n+=5,n>=8&&(r[o++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",o=Math.pow(2,16)-1;for(let e=0;e<n;e+=o)e+o>n&&(o=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+o));return a}(r.buffer)}function Le(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=Oe(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function we({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:o=300}){let r=!1;const i=()=>new Promise(((a,r)=>{const i=function(e,t){const n=n=>{var a,o;e.includes(null===(a=n.data)||void 0===a?void 0:a.type)&&t(null===(o=n.data)||void 0===o?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),r()}),o);function l(){i.unsubscribe()}}));return{cancel(){r=!0},promise:(async()=>{for(let e=0;e<a;e++){if(r)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!r)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}const Ae="tolgee-in-context-tools.umd.min.js",Te="@tolgee/in-context-tools",ke="InContextTools",je="https://cdn.jsdelivr.net/npm";let Ne=null;function xe(e){var t;return Ne||(Ne=(t=`${je}/@tolgee/web@${e}/dist/${Ae}`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window[Te][ke]))),Ne}const Ce="__tolgee_apiKey",Re="__tolgee_apiUrl";function Pe(){const e=sessionStorage.getItem(Ce)||void 0,t=sessionStorage.getItem(Re)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Se(){sessionStorage.removeItem(Ce),sessionStorage.removeItem(Re)}e.BrowserExtensionPlugin=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(e.BrowserExtensionPlugin=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=we({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Se)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return Pe()&&(async()=>{const e=await xe("5.19.4");return t=>{const n=Pe();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const De="__tolgee_currentLanguage";function _e(e){return e.endsWith("/")?e.slice(0,-1):e}const Ie={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${_e(n)}/${e}/${t}.json`:`${_e(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"}};function Ue(e){const t=Object.assign(Object.assign(Object.assign({},Ie),e),{headers:Object.assign(Object.assign({},Ie.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:o,headers:r}=t,i=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(t,["prefix","getPath","getData","headers"]);return{getRecord:({namespace:e,language:t,fetch:s})=>s(a({namespace:e,language:t,prefix:n}),Object.assign({headers:r},i)).then((e=>{if(!e.ok)throw new Error(`${e.url} ${e.status}`);return o(e)}))}}e.BackendFetch=e=>(t,n)=>(n.addBackend(Ue(e)),t),e.DEVTOOLS_ID=V,e.DevBackend=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:o,fetch:r}){var i;const s=null!==(i=Le(t))&&void 0!==i?i:o;let l=void 0!==s?`${e}/v2/projects/${s}/translations/${n}`:`${e}/v2/projects/translations/${n}`;if(a&&(l+=`?ns=${a}`),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===o)throw new Error("You need to specify 'projectId' when using PAT key");return r(l,{headers:{"X-API-Key":t||"","Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e),e.DevTools=()=>e=>e,e.FormatSimple=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>K(e,t)}),e),e.LanguageDetector=()=>(e,t)=>(t.setLanguageDetector({getLanguage({availableLanguages:e}){X("LanguageDetector");const t=window.navigator.language,n=e.find((e=>e===t));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),o=a(window.navigator.language);return e.find((e=>a(e)===o))||void 0}}),e),e.LanguageStorage=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(X("LanguageStorage"),localStorage.getItem(De)||void 0),setLanguage(e){X("LanguageStorage"),localStorage.setItem(De,e)}}),e),e.ObserverPlugin=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=se();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=ye({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&ee(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=se();return Object.freeze(Object.assign(Object.assign({},e),{run(t){const n=ve({fullKeyEncode:t.options.fullKeyEncode});e.run(Object.assign(Object.assign({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),e.PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY="__tolgee_preferredLanguages",e.TOLGEE_ATTRIBUTE_NAME=G,e.TOLGEE_RESTRICT_ATTRIBUTE=W,e.TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE=z,e.Tolgee=function(){return j().use(e.BrowserExtensionPlugin())},e.TolgeeCore=j,e.createFetchFunction=g,e.getFallback=r,e.getFallbackArray=i,e.getProjectIdFromApiKey=Le,e.getTranslateProps=T,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=tolgee-web.production.umd.min.js.map
{
"name": "@tolgee/web",
"version": "5.19.3",
"version": "5.19.4",
"description": "Tolgee for web",

@@ -50,3 +50,3 @@ "declaration": true,

"dependencies": {
"@tolgee/core": "5.19.3"
"@tolgee/core": "5.19.4"
},

@@ -107,3 +107,3 @@ "devDependencies": {

"homepage": "https://github.com/tolgee/tolgee-js#readme",
"gitHead": "615694ba8c8229b6a4ae10af2f748edd08e62a0b",
"gitHead": "2eb0dfed272e13d4886effe8e925434c98b59218",
"publishConfig": {

@@ -110,0 +110,0 @@ "access": "public"

@@ -16,3 +16,3 @@ import type { InContextTools } from '../InContextTools';

script.addEventListener('error', (e) => reject(e.error));
document.body.appendChild(script);
document.head.appendChild(script);
});

@@ -19,0 +19,0 @@ }

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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 not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc