lit-intlayer 9.9.3 → 9.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client/IntlayerBinding.cjs +93 -1
- package/dist/cjs/client/index.cjs +28 -1
- package/dist/cjs/client/installIntlayer.cjs +6 -1
- package/dist/cjs/client/useDictionary.cjs +24 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +47 -1
- package/dist/cjs/client/useIntlayer.cjs +30 -1
- package/dist/cjs/client/useLocale.cjs +90 -1
- package/dist/cjs/client/useLocaleStorage.cjs +56 -1
- package/dist/cjs/client/useRewriteURL.cjs +48 -1
- package/dist/cjs/editor/useEditor.cjs +3 -1
- package/dist/cjs/format/index.cjs +19 -1
- package/dist/cjs/format/useCompact.cjs +34 -1
- package/dist/cjs/format/useCurrency.cjs +34 -1
- package/dist/cjs/format/useDate.cjs +52 -1
- package/dist/cjs/format/useIntl.cjs +66 -1
- package/dist/cjs/format/useList.cjs +34 -1
- package/dist/cjs/format/useNumber.cjs +40 -1
- package/dist/cjs/format/usePercentage.cjs +34 -1
- package/dist/cjs/format/useRelativeTime.cjs +34 -1
- package/dist/cjs/format/useUnit.cjs +34 -1
- package/dist/cjs/getDictionary.cjs +14 -1
- package/dist/cjs/getIntlayer.cjs +14 -1
- package/dist/cjs/html/HTMLRenderer.cjs +53 -1
- package/dist/cjs/html/index.cjs +8 -1
- package/dist/cjs/html/installIntlayerHTML.cjs +90 -1
- package/dist/cjs/html/types.cjs +1 -1
- package/dist/cjs/index.cjs +41 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +97 -1
- package/dist/cjs/markdown/compiler.cjs +72 -1
- package/dist/cjs/markdown/index.cjs +12 -1
- package/dist/cjs/markdown/installIntlayerMarkdown.cjs +98 -1
- package/dist/cjs/markdown/runtime.cjs +86 -1
- package/dist/cjs/plugins.cjs +217 -3
- package/dist/cjs/renderIntlayerNode.cjs +29 -1
- package/dist/esm/client/IntlayerBinding.mjs +75 -33
- package/dist/esm/client/index.mjs +9 -9
- package/dist/esm/client/installIntlayer.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +22 -10
- package/dist/esm/client/useDictionaryDynamic.mjs +44 -11
- package/dist/esm/client/useIntlayer.mjs +28 -10
- package/dist/esm/client/useLocale.mjs +71 -19
- package/dist/esm/client/useLocaleStorage.mjs +45 -12
- package/dist/esm/client/useRewriteURL.mjs +36 -18
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/format/index.mjs +10 -10
- package/dist/esm/format/useCompact.mjs +23 -19
- package/dist/esm/format/useCurrency.mjs +23 -19
- package/dist/esm/format/useDate.mjs +37 -27
- package/dist/esm/format/useIntl.mjs +54 -13
- package/dist/esm/format/useList.mjs +23 -19
- package/dist/esm/format/useNumber.mjs +29 -19
- package/dist/esm/format/usePercentage.mjs +23 -19
- package/dist/esm/format/useRelativeTime.mjs +23 -19
- package/dist/esm/format/useUnit.mjs +23 -19
- package/dist/esm/getDictionary.mjs +11 -6
- package/dist/esm/getIntlayer.mjs +11 -6
- package/dist/esm/html/HTMLRenderer.mjs +38 -13
- package/dist/esm/html/index.mjs +3 -3
- package/dist/esm/html/installIntlayerHTML.mjs +82 -13
- package/dist/esm/index.mjs +12 -12
- package/dist/esm/markdown/MarkdownRenderer.mjs +66 -26
- package/dist/esm/markdown/compiler.mjs +68 -22
- package/dist/esm/markdown/index.mjs +4 -4
- package/dist/esm/markdown/installIntlayerMarkdown.mjs +87 -23
- package/dist/esm/markdown/runtime.mjs +58 -28
- package/dist/esm/plugins.mjs +156 -106
- package/dist/esm/renderIntlayerNode.mjs +17 -17
- package/dist/installIntlayer-CCMOc1XT.mjs +174 -0
- package/dist/installIntlayer-HB8aIQ-i.js +203 -0
- package/package.json +7 -7
- package/dist/installIntlayer-CFvvijL7.js +0 -1
- package/dist/installIntlayer-CTpPd7yz.mjs +0 -82
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
2
|
+
let _intlayer_config_client = require("@intlayer/config/client");
|
|
3
|
+
let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
|
|
4
|
+
const require_client_useLocaleStorage = require("./cjs/client/useLocaleStorage.cjs");
|
|
5
|
+
// src/editor/useEditor.ts
|
|
6
|
+
/**
|
|
7
|
+
* Syncs the client locale into the editor manager and applies the locales
|
|
8
|
+
* requested by the editor. Returns a function stopping both subscriptions.
|
|
9
|
+
*/
|
|
10
|
+
var syncEditorLocale = (manager) => {
|
|
11
|
+
const client = getIntlayerClient();
|
|
12
|
+
manager.currentLocale.set(client.locale);
|
|
13
|
+
const unsubscribeLocale = client.subscribe((newLocale) => {
|
|
14
|
+
manager.currentLocale.set(newLocale);
|
|
15
|
+
});
|
|
16
|
+
const unsubscribeLocaleRequest = manager.onLocaleChangeRequested((requestedLocale) => {
|
|
17
|
+
client.setLocale(requestedLocale);
|
|
18
|
+
require_client_useLocaleStorage.setLocaleInStorage(requestedLocale, client.isCookieEnabled);
|
|
19
|
+
});
|
|
20
|
+
return () => {
|
|
21
|
+
unsubscribeLocale();
|
|
22
|
+
unsubscribeLocaleRequest();
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* ReactiveController that initialises the Intlayer visual editor when enabled.
|
|
27
|
+
* Syncs the current locale into the editor manager so it always reflects the
|
|
28
|
+
* locale the app is displaying.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
var EditorController = class {
|
|
33
|
+
host;
|
|
34
|
+
_stopped = false;
|
|
35
|
+
_unsubscribeLocale = null;
|
|
36
|
+
constructor(host) {
|
|
37
|
+
this.host = host;
|
|
38
|
+
host.addController(this);
|
|
39
|
+
}
|
|
40
|
+
hostConnected() {
|
|
41
|
+
this._stopped = false;
|
|
42
|
+
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !_intlayer_editor_isEnabled.isEnabled) return;
|
|
43
|
+
import("@intlayer/editor").then(({ initEditorClient }) => {
|
|
44
|
+
if (this._stopped) return;
|
|
45
|
+
this._unsubscribeLocale = syncEditorLocale(initEditorClient());
|
|
46
|
+
}).catch(() => {});
|
|
47
|
+
}
|
|
48
|
+
hostDisconnected() {
|
|
49
|
+
this._stopped = true;
|
|
50
|
+
this._unsubscribeLocale?.();
|
|
51
|
+
this._unsubscribeLocale = null;
|
|
52
|
+
import("@intlayer/editor").then(({ stopEditorClient }) => {
|
|
53
|
+
stopEditorClient();
|
|
54
|
+
}).catch(() => {});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function useEditor(host) {
|
|
58
|
+
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !_intlayer_editor_isEnabled.isEnabled) return host ? void 0 : () => {};
|
|
59
|
+
if (!host) {
|
|
60
|
+
let stopped = false;
|
|
61
|
+
let unsubscribeLocale = null;
|
|
62
|
+
import("@intlayer/editor").then(({ initEditorClient }) => {
|
|
63
|
+
if (stopped) return;
|
|
64
|
+
unsubscribeLocale = syncEditorLocale(initEditorClient());
|
|
65
|
+
}).catch(() => {});
|
|
66
|
+
return () => {
|
|
67
|
+
stopped = true;
|
|
68
|
+
unsubscribeLocale?.();
|
|
69
|
+
import("@intlayer/editor").then(({ stopEditorClient }) => {
|
|
70
|
+
stopEditorClient();
|
|
71
|
+
}).catch(() => {});
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
new EditorController(host);
|
|
75
|
+
}
|
|
76
|
+
// src/client/installIntlayer.ts
|
|
77
|
+
var IntlayerClient = class {
|
|
78
|
+
_locale;
|
|
79
|
+
_variant;
|
|
80
|
+
_listeners = /* @__PURE__ */ new Set();
|
|
81
|
+
isCookieEnabled;
|
|
82
|
+
constructor(locale, isCookieEnabled = true, variant) {
|
|
83
|
+
const { defaultLocale } = _intlayer_config_built.internationalization ?? {};
|
|
84
|
+
(0, _intlayer_config_client.setIntlayerIdentifier)();
|
|
85
|
+
this._locale = locale ?? require_client_useLocaleStorage.getLocaleInStorage() ?? defaultLocale;
|
|
86
|
+
this._variant = variant;
|
|
87
|
+
this.isCookieEnabled = isCookieEnabled;
|
|
88
|
+
}
|
|
89
|
+
get locale() {
|
|
90
|
+
return this._locale;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Ambient variant applied to every dictionary read, the same way `locale` is.
|
|
94
|
+
* Overridden per call by an explicit selector.
|
|
95
|
+
*/
|
|
96
|
+
get variant() {
|
|
97
|
+
return this._variant;
|
|
98
|
+
}
|
|
99
|
+
setLocale(newLocale) {
|
|
100
|
+
this._locale = newLocale;
|
|
101
|
+
for (const listener of this._listeners) listener(newLocale);
|
|
102
|
+
}
|
|
103
|
+
setVariant(newVariant) {
|
|
104
|
+
this._variant = newVariant;
|
|
105
|
+
for (const listener of this._listeners) listener(this._locale);
|
|
106
|
+
}
|
|
107
|
+
subscribe(listener) {
|
|
108
|
+
this._listeners.add(listener);
|
|
109
|
+
return () => {
|
|
110
|
+
this._listeners.delete(listener);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Singleton instance
|
|
116
|
+
*/
|
|
117
|
+
var instance = null;
|
|
118
|
+
/**
|
|
119
|
+
* Create and return a single IntlayerClient instance.
|
|
120
|
+
*/
|
|
121
|
+
var createIntlayerClient = (locale, isCookieEnabled = true, variant) => {
|
|
122
|
+
if (instance) return instance;
|
|
123
|
+
instance = new IntlayerClient(locale, isCookieEnabled, variant);
|
|
124
|
+
return instance;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Get the current IntlayerClient instance, creating one with defaults if needed.
|
|
128
|
+
*/
|
|
129
|
+
var getIntlayerClient = () => {
|
|
130
|
+
if (!instance) instance = new IntlayerClient();
|
|
131
|
+
return instance;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Install Intlayer into your Lit application.
|
|
135
|
+
*
|
|
136
|
+
* Call this once at application startup before any Lit elements are rendered.
|
|
137
|
+
*
|
|
138
|
+
* When called with a `config` argument, `window.INTLAYER_CONFIG` is set so
|
|
139
|
+
* that `@intlayer/config/built` resolves the correct values in the browser
|
|
140
|
+
* without requiring module aliasing in the bundler configuration.
|
|
141
|
+
*
|
|
142
|
+
* @param locale - Initial locale (defaults to config defaultLocale).
|
|
143
|
+
* @param isCookieEnabled - Whether to persist locale in cookies/localStorage.
|
|
144
|
+
* @param variant - Ambient variant applied to every dictionary read — for a
|
|
145
|
+
* dimension fixed for the whole session (tenant, school type, plan tier…)
|
|
146
|
+
* that no call site should have to pass by hand. Accepts a name
|
|
147
|
+
* (`'school1'`), an ordered preference chain (`['school1', 'default']`), or a
|
|
148
|
+
* per-key map (`{ key1: 'school1', default: 'base' }`). A plain object is
|
|
149
|
+
* always the per-key map; nest a structured variant as
|
|
150
|
+
* `{ default: { id: 'prod_abc' } }`. A call-site selector always wins.
|
|
151
|
+
* @param config - Optional Intlayer configuration. When provided, sets
|
|
152
|
+
* `window.INTLAYER_CONFIG` with the browser-safe subset of the config so
|
|
153
|
+
* the application works without a Vite/webpack plugin alias.
|
|
154
|
+
* @returns The IntlayerClient singleton.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* import { installIntlayer } from 'lit-intlayer';
|
|
159
|
+
*
|
|
160
|
+
* // With explicit config (no build plugin alias needed):
|
|
161
|
+
* installIntlayer('en', true, {
|
|
162
|
+
* internationalization: { locales: ['en', 'fr'], defaultLocale: 'en' },
|
|
163
|
+
* });
|
|
164
|
+
*
|
|
165
|
+
* // With build plugin (alias handles config automatically):
|
|
166
|
+
* installIntlayer('en');
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
var installIntlayer = ({ locale, isCookieEnabled, variant } = {}) => {
|
|
170
|
+
const client = createIntlayerClient(locale, isCookieEnabled, variant);
|
|
171
|
+
useEditor();
|
|
172
|
+
return client;
|
|
173
|
+
};
|
|
174
|
+
Object.defineProperty(exports, "IntlayerClient", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function() {
|
|
177
|
+
return IntlayerClient;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "createIntlayerClient", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function() {
|
|
183
|
+
return createIntlayerClient;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "getIntlayerClient", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function() {
|
|
189
|
+
return getIntlayerClient;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "installIntlayer", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function() {
|
|
195
|
+
return installIntlayer;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "useEditor", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function() {
|
|
201
|
+
return useEditor;
|
|
202
|
+
}
|
|
203
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lit-intlayer",
|
|
3
|
-
"version": "9.9.
|
|
3
|
+
"version": "9.9.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Lit applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@intlayer/api": "9.9.
|
|
108
|
-
"@intlayer/config": "9.9.
|
|
109
|
-
"@intlayer/core": "9.9.
|
|
110
|
-
"@intlayer/editor": "9.9.
|
|
111
|
-
"@intlayer/types": "9.9.
|
|
107
|
+
"@intlayer/api": "9.9.4",
|
|
108
|
+
"@intlayer/config": "9.9.4",
|
|
109
|
+
"@intlayer/core": "9.9.4",
|
|
110
|
+
"@intlayer/editor": "9.9.4",
|
|
111
|
+
"@intlayer/types": "9.9.4"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@types/node": "^26",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"vitest": "5.1.2"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"intlayer": "9.9.
|
|
128
|
+
"intlayer": "9.9.4",
|
|
129
129
|
"lit": ">=3.0.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependenciesMeta": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("@intlayer/config/built"),t=require("@intlayer/config/client"),n=require("@intlayer/editor/isEnabled");const r=require("./cjs/client/useLocaleStorage.cjs");var i=e=>{let t=u();e.currentLocale.set(t.locale);let n=t.subscribe(t=>{e.currentLocale.set(t)}),i=e.onLocaleChangeRequested(e=>{t.setLocale(e),r.setLocaleInStorage(e,t.isCookieEnabled)});return()=>{n(),i()}},a=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,process.env.INTLAYER_EDITOR_ENABLED!==`false`&&n.isEnabled&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{this._stopped||(this._unsubscribeLocale=i(e()))}).catch(()=>{})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()}).catch(()=>{})}};function o(e){if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)return e?void 0:()=>{};if(!e){let e=!1,t=null;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{e||(t=i(n()))}).catch(()=>{}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()}).catch(()=>{})}}new a(e)}var s=class{_locale;_variant;_listeners=new Set;isCookieEnabled;constructor(n,i=!0,a){let{defaultLocale:o}=e.internationalization??{};(0,t.setIntlayerIdentifier)(),this._locale=n??r.getLocaleInStorage()??o,this._variant=a,this.isCookieEnabled=i}get locale(){return this._locale}get variant(){return this._variant}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}setVariant(e){this._variant=e;for(let e of this._listeners)e(this._locale)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},c=null,l=(e,t=!0,n)=>c||(c=new s(e,t,n),c),u=()=>(c||=new s,c),d=({locale:e,isCookieEnabled:t,variant:n}={})=>{let r=l(e,t,n);return o(),r};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { internationalization as e } from "@intlayer/config/built";
|
|
2
|
-
import { setIntlayerIdentifier as t } from "@intlayer/config/client";
|
|
3
|
-
import { isEnabled as n } from "@intlayer/editor/isEnabled";
|
|
4
|
-
import { getLocaleInStorage as r, setLocaleInStorage as i } from "./esm/client/useLocaleStorage.mjs";
|
|
5
|
-
// src/editor/useEditor.ts
|
|
6
|
-
var a = (e) => {
|
|
7
|
-
let t = d();
|
|
8
|
-
e.currentLocale.set(t.locale);
|
|
9
|
-
let n = t.subscribe((t) => {
|
|
10
|
-
e.currentLocale.set(t);
|
|
11
|
-
}), r = e.onLocaleChangeRequested((e) => {
|
|
12
|
-
t.setLocale(e), i(e, t.isCookieEnabled);
|
|
13
|
-
});
|
|
14
|
-
return () => {
|
|
15
|
-
n(), r();
|
|
16
|
-
};
|
|
17
|
-
}, o = class {
|
|
18
|
-
host;
|
|
19
|
-
_stopped = !1;
|
|
20
|
-
_unsubscribeLocale = null;
|
|
21
|
-
constructor(e) {
|
|
22
|
-
this.host = e, e.addController(this);
|
|
23
|
-
}
|
|
24
|
-
hostConnected() {
|
|
25
|
-
this._stopped = !1, process.env.INTLAYER_EDITOR_ENABLED !== "false" && n && import("@intlayer/editor").then(({ initEditorClient: e }) => {
|
|
26
|
-
this._stopped || (this._unsubscribeLocale = a(e()));
|
|
27
|
-
}).catch(() => {});
|
|
28
|
-
}
|
|
29
|
-
hostDisconnected() {
|
|
30
|
-
this._stopped = !0, this._unsubscribeLocale?.(), this._unsubscribeLocale = null, import("@intlayer/editor").then(({ stopEditorClient: e }) => {
|
|
31
|
-
e();
|
|
32
|
-
}).catch(() => {});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
function s(e) {
|
|
36
|
-
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !n) return e ? void 0 : () => {};
|
|
37
|
-
if (!e) {
|
|
38
|
-
let e = !1, t = null;
|
|
39
|
-
return import("@intlayer/editor").then(({ initEditorClient: n }) => {
|
|
40
|
-
e || (t = a(n()));
|
|
41
|
-
}).catch(() => {}), () => {
|
|
42
|
-
e = !0, t?.(), import("@intlayer/editor").then(({ stopEditorClient: e }) => {
|
|
43
|
-
e();
|
|
44
|
-
}).catch(() => {});
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
new o(e);
|
|
48
|
-
}
|
|
49
|
-
// src/client/installIntlayer.ts
|
|
50
|
-
var c = class {
|
|
51
|
-
_locale;
|
|
52
|
-
_variant;
|
|
53
|
-
_listeners = /* @__PURE__ */ new Set();
|
|
54
|
-
isCookieEnabled;
|
|
55
|
-
constructor(n, i = !0, a) {
|
|
56
|
-
let { defaultLocale: o } = e ?? {};
|
|
57
|
-
t(), this._locale = n ?? r() ?? o, this._variant = a, this.isCookieEnabled = i;
|
|
58
|
-
}
|
|
59
|
-
get locale() {
|
|
60
|
-
return this._locale;
|
|
61
|
-
}
|
|
62
|
-
get variant() {
|
|
63
|
-
return this._variant;
|
|
64
|
-
}
|
|
65
|
-
setLocale(e) {
|
|
66
|
-
this._locale = e;
|
|
67
|
-
for (let t of this._listeners) t(e);
|
|
68
|
-
}
|
|
69
|
-
setVariant(e) {
|
|
70
|
-
this._variant = e;
|
|
71
|
-
for (let e of this._listeners) e(this._locale);
|
|
72
|
-
}
|
|
73
|
-
subscribe(e) {
|
|
74
|
-
return this._listeners.add(e), () => {
|
|
75
|
-
this._listeners.delete(e);
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}, l = null, u = (e, t = !0, n) => l || (l = new c(e, t, n), l), d = () => (l ||= new c(), l), f = ({ locale: e, isCookieEnabled: t, variant: n } = {}) => {
|
|
79
|
-
let r = u(e, t, n);
|
|
80
|
-
return s(), r;
|
|
81
|
-
};
|
|
82
|
-
export { s as a, f as i, u as n, d as r, c as t };
|