@pie-element/select-text 12.0.0-next.43 → 12.1.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/module/demo.js DELETED
@@ -1,301 +0,0 @@
1
- import Configure from './configure.js';
2
- import Element from './element.js';
3
- import * as controller from './controller.js';
4
-
5
- var generate = {};
6
-
7
- const tokens = () => [
8
- {
9
- text: "If 'tweren't for sight and sound and smell,",
10
- start: 0,
11
- end: 43,
12
- },
13
- {
14
- text: "I'd like the city pretty well,",
15
- start: 44,
16
- end: 74,
17
- },
18
- {
19
- text: 'But when it comes to getting rest,',
20
- start: 75,
21
- end: 109,
22
- },
23
- {
24
- text: 'I like the country lots the best.',
25
- start: 110,
26
- end: 143,
27
- },
28
- {
29
- text: 'Sometimes it seems to me I must',
30
- start: 145,
31
- end: 176,
32
- },
33
- {
34
- text: "Just quit the city's din and dust,",
35
- start: 177,
36
- end: 211,
37
- },
38
- {
39
- text: 'And get out where the sky is blue,',
40
- start: 212,
41
- end: 246,
42
- },
43
- {
44
- text: 'And say, now, how does it seem to you?',
45
- start: 247,
46
- end: 285,
47
- },
48
- ];
49
-
50
- const mathSampleTokens = [
51
- {
52
- start: 583,
53
- end: 1465,
54
- text: '<span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mrow>\n <mo>[</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>+</mo>\n <mn>2</mn>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>]</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>)</mo>\n </mrow>\n </mstyle>\n</math></span>',
55
- correct: true,
56
- },
57
- { start: 1474, end: 2218 },
58
- { start: 2227, end: 2797 },
59
- { start: 2806, end: 3112 },
60
- ];
61
-
62
- const base = (extras) =>
63
- Object.assign(
64
- {},
65
- {
66
- // highlightChoices: true,
67
- feedback: {
68
- correct: {
69
- type: 'default',
70
- default: 'Correct',
71
- },
72
- incorrect: {
73
- type: 'default',
74
- default: 'Incorrect',
75
- },
76
- partial: {
77
- type: 'default',
78
- default: 'Nearly',
79
- },
80
- },
81
- partialScoring: false,
82
- maxSelections: 2,
83
- mode: 'sentence',
84
- rationale: 'Rationale goes here.',
85
- prompt: 'What sentences contain the character 6 in them?',
86
- promptEnabled: true,
87
- toolbarEditorPosition: 'bottom',
88
- // text: `<p>Warhol was born in 1928 in Pittsburgh, Pennsylvania. When he was eight years old, he became very sick and had to stay in bed for months. To help him pass the time his mother, who was an artist, taught him how to draw. He took to it like a fish to water. Art became the center of Andy's world. A year later he added picture-taking to his interests when his mother gave him a camera. He also became fascinated with movies.</p><p>Andy studied art in school and learned many ways to make art. He learned how to use different art materials, such as oil paints, metal, clay, and wood. In 1949 he moved to New York City, where he got a job drawing and painting pictures for magazines.</p>`,
89
- text: `<p>If 'tweren't for sight and sound and smell,<br />
90
- I'd like the city pretty well,<br />
91
- But when it comes to getting rest,<br />
92
- I like the country lots the best.</p>
93
-
94
- <p>Sometimes it seems to me I must<br />
95
- Just quit the city's din and dust,<br />
96
- And get out where the sky is blue,<br />
97
- And say, now, how does it seem to you?</p>`,
98
- tokens: tokens(),
99
- },
100
- extras,
101
- );
102
-
103
- const mathSample = (extras) => {
104
- return Object.assign(
105
- {},
106
- {
107
- highlightChoices: false,
108
- feedback: {
109
- correct: {
110
- type: 'default',
111
- default: 'Correct',
112
- },
113
- incorrect: {
114
- type: 'default',
115
- default: 'Incorrect',
116
- },
117
- partial: {
118
- type: 'default',
119
- default: 'Nearly',
120
- },
121
- },
122
- partialScoring: false,
123
- maxSelections: 2,
124
- prompt: 'What sentences contain the character 6 in them?',
125
- text: `<p>If 'tweren't for sight and sound and smell,<br />
126
- I'd like the city pretty well,<br />
127
- But when it comes to getting rest,<br />
128
- I like the country lots the best.</p>
129
-
130
- <p>Sometimes it seems to me I must<br />
131
- Just quit the city's din and dust,<br />
132
- And get out where the sky is blue,<br />
133
- And say, now, how does it seem to you?</p>`,
134
- tokens: mathSampleTokens,
135
- },
136
- extras,
137
- );
138
- };
139
-
140
- generate.mathSample = (id, element) => {
141
- return Object.assign({}, { id, element }, mathSample({}));
142
- };
143
-
144
- generate.htmlSample = (id, element) => {
145
- return Object.assign(
146
- {},
147
- { id, element },
148
- {
149
- highlightChoices: true,
150
- feedback: {
151
- correct: {
152
- type: 'default',
153
- default: 'Correct',
154
- },
155
- incorrect: {
156
- type: 'default',
157
- default: 'Incorrect',
158
- },
159
- partial: {
160
- type: 'default',
161
- default: 'Nearly',
162
- },
163
- },
164
- partialScoring: false,
165
- text: '<p style=\'padding: 20px\'>A flicker and then gone. In its wake, only <span class="lrn_token">the after-echo of a distant high-pitched ringing that vibrated through him even as it returned to silence once again</span>, as he stared into the smiling faces of the crew and told himself that yes he was meant to be here, that <span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>, the sense of panic already replaced by the pride of his accomplishment, replaced so completely that he would not remember that flicker, would not allow himself to remember, <span class="lrn_token">even after everything else had happened</span>. In his memory of that moment, <span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>. And in his memory he was smiling. Is this not what he was meant to do? Is the answer not as fixed and indisputable as any equation he might have been tasked to solve?</p>\n',
166
- prompt:
167
- '<p>Select the <span class="relative-emphasis">one</span> phrase below that suggests that in the future, Keith may interpret this moment differently.</p>',
168
- maxSelections: 2,
169
- mode: 'sentence',
170
- rationale: 'Rationale goes here.',
171
- tokens: [
172
- {
173
- correct: false,
174
- start: 67,
175
- end: 215,
176
- text: '<span class="lrn_token">the after-echo of a distant high-pitched ringing that vibrated through him even as it returned to silence once again</span>',
177
- },
178
- {
179
- correct: false,
180
- start: 321,
181
- end: 410,
182
- text: '<span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>',
183
- },
184
- {
185
- correct: true,
186
- start: 585,
187
- end: 655,
188
- text: '<span class="lrn_token">even after everything else had happened</span>',
189
- },
190
- {
191
- correct: false,
192
- start: 687,
193
- end: 790,
194
- text: '<span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>',
195
- },
196
- ],
197
- },
198
- );
199
- };
200
-
201
- generate.htmlAscii = (id, element) => ({
202
- id,
203
- element,
204
- highlightChoices: true,
205
- prompt: 'Select the parts that have references for Lucy',
206
- text: '<p>&#8220;Lucy? Are you using your time wisely to plan your project?&#8221; Mr. Wilson asked.</p><p>&nbsp;Lucy looked a little confused at first.</p>',
207
- tokens: [
208
- {
209
- start: 10,
210
- end: 68,
211
- text: 'Lucy? Are you using your time wisely to plan your project?',
212
- },
213
- {
214
- start: 106,
215
- end: 145,
216
- text: 'Lucy looked a little confused at first.',
217
- },
218
- ],
219
- });
220
-
221
- generate.model = (id, element) => {
222
- return Object.assign(
223
- {},
224
- { id, element },
225
- base({
226
- // "id": "8a808081701d693801703174fb900421",
227
- teacherInstructions: '',
228
- partialScoring: true,
229
- prompt:
230
- '<p>Select the sentence from&#160;&#34;The Gymnast&#34; that <span class="relative-emphasis">best</span> represents the theme.</p>',
231
- rationale:
232
- '<p>The final sentence of the passage best exemplifies the theme of the short story because Natasha&#39;s practice and determination finally pays off.</p>',
233
- tokens: [
234
- {
235
- text: 'She thought about what she had to do, struggling to rein in her wild, fearful thoughts.',
236
- end: 90,
237
- start: 3,
238
- correct: false,
239
- },
240
- {
241
- start: 449,
242
- end: 585,
243
- text: 'Just for a hair of a moment, Natasha wondered if she really wanted a perfect 10, so weary was she of trying for but never achieving one.',
244
- correct: false,
245
- },
246
- {
247
- end: 627,
248
- correct: false,
249
- text: "At last Natasha's moment arrived.",
250
- start: 594,
251
- },
252
- {
253
- end: 743,
254
- text: "The faces of past giants of gymnastics swam before her mind's eye, now razor&#8211;sharp with fierce determination.",
255
- correct: false,
256
- start: 628,
257
- },
258
- {
259
- text: 'Suddenly, the din of the gymnasium was silent to her.',
260
- end: 997,
261
- correct: false,
262
- start: 944,
263
- },
264
- {
265
- end: 1087,
266
- start: 998,
267
- correct: false,
268
- text: 'Forcing all sound out of her mind, she focused on the gleaming balance beam ahead of her.',
269
- },
270
- {
271
- correct: true,
272
- start: 1088,
273
- end: 1225,
274
- text: 'Taking a deep breath, Natasha made her graceful, yet powerful approach, mounted the beam flawlessly, and...executed her first perfect 10.',
275
- },
276
- ],
277
- // "element": "select-text",
278
- text: "<p>She thought about what she had to do, struggling to rein in her wild, fearful thoughts. Coach Cummings always said that an undisciplined mind never scored a perfect 10. Natasha wanted to please her Coach, yet sometimes his approval wasn't as exciting as his anger. The gymnasts were unanimous about one thing: Coach Cummings's fits of disapproving rage were much more humorous to witness than his infrequent, backslapping moments of high praise. Just for a hair of a moment, Natasha wondered if she really wanted a perfect 10, so weary was she of trying for but never achieving one.</p>\n\n<p>At last Natasha's moment arrived. The faces of past giants of gymnastics swam before her mind's eye, now razor&#8211;sharp with fierce determination. \"I am talented. I am not afraid. I will make a perfect 10,\" she spoke aloud to herself, as she approached the mat, dusted her hands with chalk to prevent slippage, and returned to her starting point. Suddenly, the din of the gymnasium was silent to her. Forcing all sound out of her mind, she focused on the gleaming balance beam ahead of her. Taking a deep breath, Natasha made her graceful, yet powerful approach, mounted the beam flawlessly, and...executed her first perfect 10.</p>\n",
279
- rubricEnabled: false,
280
- }),
281
- );
282
- };
283
-
284
- const { model } = generate;
285
-
286
- var config = {
287
- elements: {
288
- 'select-text': '../..',
289
- },
290
- models: [model('1', 'select-text')],
291
- };
292
-
293
- //Note: demo-el is a custom element loaded in the markup.
294
- customElements.whenDefined("demo-el").then(() => {
295
- config.models.forEach((m) => {
296
- const de = document.createElement("demo-el");
297
- document.body.appendChild(de);
298
- de.def = { tagName: m.element, Element, Configure, controller };
299
- de.model = m;
300
- });
301
- });
package/module/element.js DELETED
@@ -1 +0,0 @@
1
- import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as u,_dll_mui__material as o,_dll_mui__material_styles as n,_dll_pie_lib__render_ui as s,_dll_lodash as i,_dll_debug as r,_dll_classnames as a,_dll_mui__icons_material as l,_dll_pie_lib__correct_answer_toggle as c}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_rendering as D}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";var p,d=e;p=d.createRoot,d.hydrateRoot;var h={};Object.defineProperty(h,"__esModule",{value:!0});class g extends CustomEvent{constructor(e,t,u){super(g.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:u}}),this.component=e,this.complete=t}}g.TYPE="model-set";var C=h.ModelSetEvent=g;class F extends CustomEvent{constructor(e,t){super(F.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}F.TYPE="session-changed";var f=h.SessionChangedEvent=F;const E=t,A=u,{Button:m}=o,{Switch:y}=o,{FormControlLabel:B}=o,{styled:b}=n,{color:x}=s,S=b("div")(()=>({display:"flex",alignItems:"center",justifyContent:"space-between"})),v=b(m)(({theme:e})=>({marginRight:e.spacing(1)})),k=b(y)(()=>({"& .MuiSwitch-thumb":{"&.Mui-checked":{color:`${x.tertiary()} !important`}},"& .MuiSwitch-track":{"&.Mui-checked":{backgroundColor:`${x.tertiaryLight()} !important`}}}));class w extends E.Component{static __initStatic(){this.propTypes={onClear:A.func.isRequired,onWords:A.func.isRequired,onSentences:A.func.isRequired,onParagraphs:A.func.isRequired,setCorrectMode:A.bool.isRequired,onToggleCorrectMode:A.func.isRequired}}static __initStatic2(){this.defaultProps={}}render(){const{onClear:e,onWords:t,onSentences:u,onParagraphs:o,setCorrectMode:n,onToggleCorrectMode:s}=this.props;return E.createElement(S,null,E.createElement("div",null,E.createElement(v,{onClick:t,size:"small",color:"primary",disabled:n},"Words"),E.createElement(v,{onClick:u,size:"small",color:"primary",disabled:n},"Sentences"),E.createElement(v,{onClick:o,size:"small",color:"primary",disabled:n},"Paragraphs"),E.createElement(v,{size:"small",color:"secondary",onClick:e,disabled:n},"Clear")),E.createElement(B,{control:E.createElement(k,{checked:n,onChange:s}),label:"Set correct answers"}))}}w.__initStatic(),w.__initStatic2();var N=function e(t,u){var o,n,s,i=u||"";if(!t||!("length"in t)&&!t.type)throw new Error("Expected node, not `"+t+"`");if("string"==typeof t.value)return t.value;if(s="length"in t?t:t.children,1===(n=s.length)&&"value"in s[0])return s[0].value;o=[];for(;n--;)o[n]=e(s[n],i);return o.join(i)};var _=function(e){return function(t){var u=-1,o=t&&t.children;if(!o)throw new Error("Missing children in `parent` for `visitor`");for(;++u in o;)e(o[u],u,t)}};var L=function(e,t,u){var o,n=-1;if(!e)throw new Error("Iterate requires that |this| not be "+e);if(!O.call(e,"length"))throw new Error("Iterate requires that |this| has a `length`");if("function"!=typeof t)throw new Error("`callback` must be a function");for(;++n<e.length;)n in e&&"number"==typeof(o=t.call(u,e[n],n,e))&&(o<0&&(n=0),n=o-1)},O={}.hasOwnProperty;var R=L,P=function(e){return function(e){return t;function t(t){var u=t&&t.children;if(!u)throw new Error("Missing children in `parent` for `modifier`");return R(u,e,t)}}(function(e){return t;function t(t,u){return e(t,u,this)}}(e))};var T=N;var $=function(e,t){return function(u){var o,n,s,i=[],r=u.children,a=u.type,l=r.length,c=-1,D=l-1,p=0;for(;++c<l;)(c===D||r[c].type===e&&t.test(T(r[c])))&&(o=r[p],n=r[c],s={type:a,children:r.slice(p,c+1)},o.position&&n.position&&(s.position={start:o.position.start,end:n.position.end}),i.push(s),p=c+1);return i}},M=function(e){var t=e.type,u=e.tokenizer,o=e.delimiter,n=o&&$(e.delimiterType,o);return function(e){var o=this[u](e);return{type:t,children:n?n(o):o}}};var I={affixSymbol:/^([!"').?\u0F3B\u0F3D\u169C\u2019\u201D\u2026\u203A\u203D\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63\xBB\]}])\1*$/,newLine:/^[ \t]*((\r?\n|\r)[\t ]*)+$/,newLineMulti:/^[ \t]*((\r?\n|\r)[\t ]*){2,}$/,terminalMarker:/^([!.?\u2026\u203D]+)$/,wordSymbolInner:/^([&'\-.:=?@\xAD\xB7\u2010\u2011\u2019\u2027]|_+)$/,numerical:/^(?:[\d\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])+$/,digitStart:/^\d/,lowerInitial:/^(?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C3\uA7C8\uA7CA\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])/,surrogates:/[\uD800-\uDFFF]/,punctuation:/[!"'-),-/:;?[-\]_{}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u201F\u2022-\u2027\u2032-\u203A\u203C-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,word:/[\dA-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D63\u0D66-\u0D78\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u17F0-\u17F9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA830-\uA835\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE6\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC52-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]/,whiteSpace:/[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},j=L,z=function(e){return function(e){return t;function t(t){var u=t&&t.children;if(!u)throw new Error("Missing children in `parent` for `modifier`");j(u,e,t)}}(function(e){return t;function t(t,u){return e(t,u,this)}}(e))};var W=N,H=z(function(e,t,u){var o,n;if("SymbolNode"!==e.type&&"PunctuationNode"!==e.type||"&"!==W(e))return;if(o=u.children,n=o[t+1],0!==t&&"WordNode"===o[t-1].type||!(n&&"WordNode"===n.type))return;o.splice(t,1),n.children.unshift(e),n.position&&e.position&&(n.position.start=e.position.start);return t-1});var V=N,U=z(function(e,t,u){var o,n,s;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&"-"===V(e)&&(n=(o=u.children)[t-1],(!(s=o[t+1])||"WordNode"!==s.type)&&n&&"WordNode"===n.type))return o.splice(t,1),n.children.push(e),n.position&&e.position&&(n.position.end=e.position.end),t});var q=N,K=I,Y=z(function(e,t,u){var o,n,s,i,r,a,l;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&(s=(o=u.children)[t-1])&&"WordNode"===s.type){for(r=t-1,a=[],l=[];o[++r];)if("WordNode"===(n=o[r]).type)a=a.concat(l,n.children),l=[];else{if("SymbolNode"!==n.type&&"PunctuationNode"!==n.type||!G.test(q(n)))break;l.push(n)}if(0!==a.length)return 0!==l.length&&(r-=l.length),o.splice(t,r-t),s.children=s.children.concat(a),i=a[a.length-1],s.position&&i.position&&(s.position.end=i.position.end),t}}),G=K.wordSymbolInner;var J=N,Q=z(function(e,t,u){var o,n,s,i,r,a,l,c=u.children;if(o=c[t-1],n=c[t+1],o&&"WordNode"===o.type&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&J(e)===X&&(s=J(o),a=e,r=[e],l=1,n&&"WordNode"===n.type&&(i=J(n),a=n,r=r.concat(n.children),l++),s.length<3&&(!i||i.length<3)))return o.children=o.children.concat(r),c.splice(t,l),o.position&&a.position&&(o.position.end=a.position.end),t}),X="/";var Z=N,ee=I,te=z(function(e,t,u){var o,n,s,i,r,a,l,c;if(0!==t&&"."===Z(e)&&(i=(s=(n=(o=u.children)[t-1]).children)&&s.length,"WordNode"===n.type&&1!==i&&i%2!=0)){for(r=i,l=!0;s[--r];)if(a=s[r],c=Z(a),r%2==0){if(c.length>1)return;ue.test(c)||(l=!1)}else if("."!==c){if(r<i-2)break;return}if(!l)return o.splice(t,1),s.push(e),n.position&&e.position&&(n.position.end=e.position.end),t}}),ue=ee.numerical;var oe=z(function(e,t,u){var o,n=u.children;if("WordNode"===e.type&&(o=n[t+1])&&"WordNode"===o.type)return n.splice(t+1,1),e.children=e.children.concat(o.children),o.position&&e.position&&(e.position.end=o.position.end),t});var ne=_(function(e,t,u){var o=u.children;if(!e.position)return;0!==t||u.position&&u.position.start||(se(u),u.position.start=e.position.start);t!==o.length-1||u.position&&u.position.end||(se(u),u.position.end=e.position.end)});function se(e){e.position||(e.position={})}var ie=z(function(e,t,u){var o,n,s=e.children,i=-1;for(;s[++i];)if("WordNode"===s[i].type)return;if(o=u.children[t-1])return o.children=o.children.concat(s),u.children.splice(t,1),o.position&&e.position&&(o.position.end=e.position.end),t;(n=u.children[t+1])&&(n.children=s.concat(n.children),n.position&&e.position&&(n.position.start=e.position.start),u.children.splice(t,1))});var re=N,ae=I,le=z(function(e,t,u){var o,n,s,i=e.children;if(i&&0!==i.length&&0!==t&&(o=i[0],n=i[1],s=u.children[t-1],("SymbolNode"===o.type||"PunctuationNode"===o.type)&&ce.test(re(o))))return s.children.push(i.shift()),o.position&&s.position&&(s.position.end=o.position.end),n&&n.position&&e.position&&(e.position.start=n.position.start),t-1}),ce=ae.affixSymbol;var De=N,pe=I,de=z(function(e,t,u){var o,n,s,i,r=e.children;if(r&&0!==r.length&&0!==t)for(o=-1;r[++o];){if("WordNode"===(n=r[o]).type){if(!he.test(De(n)))return;return(i=(s=u.children)[t-1]).children=i.children.concat(r),s.splice(t,1),i.position&&e.position&&(i.position.end=e.position.end),t}if("SymbolNode"===n.type||"PunctuationNode"===n.type)return}}),he=pe.lowerInitial;var ge=N,Ce=I,Fe=z(function(e,t,u){var o=e.children,n=u.children,s=n[t-1],i=o[0];if(s&&i&&"WordNode"===i.type&&fe.test(ge(i)))return s.children=s.children.concat(o),n.splice(t,1),s.position&&e.position&&(s.position.end=e.position.end),t}),fe=Ce.digitStart;var Ee=N,Ae=z(function(e,t,u){var o,n,s,i=e.children;if(i&&i.length>1&&(o=i[i.length-1])&&"."===Ee(o)&&(n=i[i.length-2])&&"WordNode"===n.type&&me.test(Ee(n).toLowerCase())&&(n.children.push(o),i.pop(),o.position&&n.position&&(n.position.end=o.position.end),s=u.children[t+1]))return e.children=i.concat(s.children),u.children.splice(t+1,1),s.position&&e.position&&(e.position.end=s.position.end),t-1}),me=new RegExp("^([0-9]{1,3}|[a-z]|al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|viz)$");var ye=N,Be=z(function(e,t,u){var o,n,s,i,r=e.children;if(!r||0===r.length||0===t)return;n=-1;for(;r[++n];){if("WordNode"===(o=r[n]).type)return;if("SymbolNode"===o.type||"PunctuationNode"===o.type){if(","!==(s=ye(o))&&";"!==s)return;return(i=u.children[t-1]).children=i.children.concat(r),i.position&&e.position&&(i.position.end=e.position.end),u.children.splice(t,1),t}}});var be=N,xe=I,Se=_(function(e){var t,u,o,n,s=e.children,i=s.length,r=!1;for(;s[--i];)if("SymbolNode"===(t=s[i]).type||"PunctuationNode"===t.type){if(ve.test(be(t)))if(r){if("."===be(t))if(u=s[i-1],o=s[i+1],u&&"WordNode"===u.type){if(n=s[i+2],o&&n&&"WhiteSpaceNode"===o.type&&"."===be(n))continue;s.splice(i,1),u.children.push(t),t.position&&u.position&&(u.position.end=t.position.end),i--}else o&&"WordNode"===o.type&&(s.splice(i,1),o.children.unshift(t),t.position&&o.position&&(o.position.start=t.position.start))}else r=!0}else"WordNode"===t.type&&(r=!0)}),ve=xe.terminalMarker;var ke=_(function(e,t,u){var o,n=e.children;n&&0!==n.length&&"WhiteSpaceNode"===n[0].type&&(u.children.splice(t,0,n.shift()),(o=n[0])&&o.position&&e.position&&(e.position.start=o.position.start))});var we=z(function(e,t,u){var o,n=e.children;if(n&&0!==n.length&&"WhiteSpaceNode"===n[n.length-1].type)return u.children.splice(t+1,0,e.children.pop()),(o=n[n.length-1])&&o.position&&e.position&&(e.position.end=o.position.end),t});var Ne=N,_e=I,Le=z(function(e,t,u){var o,n,s,i,r,a,l,c;if("SentenceNode"!==e.type)return;o=e.children,s=o.length-1,n=0;for(;++n<s;)if("WhiteSpaceNode"===(c=o[n]).type&&Oe.test(Ne(c)))return e.children=o.slice(0,n),l={type:"SentenceNode",children:o.slice(n+1)},i=o[n-1],r=o[n+1],u.children.splice(t+1,0,c,l),e.position&&i.position&&r.position&&(a=e.position.end,e.position.end=i.position.end,l.position={start:r.position.start,end:a}),t+1}),Oe=_e.newLineMulti;var Re=z(function(e,t,u){if("children"in e&&0===e.children.length)return u.children.splice(t,1),t});var Pe=M,Te=I,$e=Me;function Me(e,t){var u=t||e;if(!(this instanceof Me))return new Me(e,t);this.doc=u?String(u):null}var Ie=Me.prototype;function je(e){return e+="Node",function(t,u,o){null==t&&(t="");return(u||Ye)(t)({type:e,value:String(t)},o)}}function ze(e,t,u){e.prototype[t]=function(){return this.run(t,u.apply(this,arguments))}}function We(e){return function(t,u){var o,n=this;if(!(t in n))throw new Error("Illegal Invocation: Unsupported `key` for `use(key, plugins)`. Make sure `key` is a supported function");if(!u)return;o=t+"Plugins",u="function"==typeof u?[u]:u.concat();n[o]||(n[o]=[]);e(n,o,u)}}Ie.position=!0,Ie.tokenizeSymbol=je("Symbol"),Ie.tokenizeWhiteSpace=je("WhiteSpace"),Ie.tokenizePunctuation=je("Punctuation"),Ie.tokenizeSource=je("Source"),Ie.tokenizeText=je("Text"),Ie.run=function(e,t){var u=this[e+"Plugins"],o=-1;if(u)for(;u[++o];)u[o](t);return t},Ie.use=We(function(e,t,u){e[t]=e[t].concat(u)}),Ie.useFirst=We(function(e,t,u){e[t]=u.concat(e[t])}),Ie.parse=function(e){return this.tokenizeRoot(e||this.doc)},Ie.tokenize=function(e){return function(e,t){var u,o,n,s,i,r,a,l,c,D,p,d;null==t?t="":t instanceof String&&(t=t.toString());if("string"!=typeof t){if("length"in t&&(!t[0]||t[0].type))return t;throw new Error("Illegal invocation: '"+t+"' is not a valid argument for 'ParseLatin'")}if(u=[],!t)return u;i=0,o=0,n=1,s=1,d=e.position?g:C,r=t.length,c="",l="";for(;i<r;)a=t.charAt(i),p=qe.test(a)?"WhiteSpace":Ue.test(a)?"Punctuation":He.test(a)?"Word":"Symbol",h(),c=a,a="",D=p,p=null,i++;return h(),u;function h(){D!==p||"Word"!==D&&"WhiteSpace"!==D&&a!==c&&!Ve.test(a)?(l&&e["tokenize"+D](l,d),l=a):l+=a}function g(e){var t=f();return E(e),u;function u(){return t(F.apply(null,arguments))}}function C(){return e;function e(){return F.apply(null,arguments)}}function F(e,t){return t?t.children.push(e):u.push(e),e}function f(){var e=m();function t(t){return t.position=new A(e),t}return t}function E(e){var t=e.length,u=-1,i=-1;for(o+=t;++u<t;)"\n"===e.charAt(u)&&(i=u,n++);-1===i?s+=t:s=t-i}function A(e){this.start=e,this.end=m()}function m(){return{line:n,column:s,offset:o}}}(this,e)},ze(Me,"tokenizeWord",function(e,t){var u=(t||Ye)(""),o={type:"WordNode",children:[]};return this.tokenizeText(e,t,o),u(o)}),ze(Me,"tokenizeSentence",Pe({type:"SentenceNode",tokenizer:"tokenize"})),ze(Me,"tokenizeParagraph",Pe({type:"ParagraphNode",delimiter:Te.terminalMarker,delimiterType:"PunctuationNode",tokenizer:"tokenizeSentence"})),ze(Me,"tokenizeRoot",Pe({type:"RootNode",delimiter:Te.newLine,delimiterType:"WhiteSpaceNode",tokenizer:"tokenizeParagraph"})),Ie.use("tokenizeSentence",[H,U,Y,Q,te,oe,ne]),Ie.use("tokenizeParagraph",[ie,le,de,Fe,Ae,Be,Se,ke,we,Le,Re,ne]),Ie.use("tokenizeRoot",[ke,we,Re,ne]);var He=Te.word,Ve=Te.surrogates,Ue=Te.punctuation,qe=Te.whiteSpace;function Ke(e,t){return t&&t.children.push(e),e}function Ye(){return Ke}var Ge=N,Je=_,Qe=P,Xe=$e,Ze=ie,et=le,tt=de,ut=Fe,ot=Be,nt=Se,st=ke,it=we,rt=Le,at=Re,lt=ne,ct=pt;dt.prototype=Xe.prototype;var Dt=new dt;function pt(e,t){if(!(this instanceof pt))return new pt(e,t);Xe.apply(this,arguments)}function dt(){}pt.prototype=Dt,Dt.tokenizeSentencePlugins=[Je(function(e,t,u){var o,n,s,i,r;if("PunctuationNode"!==e.type&&"SymbolNode"!==e.type)return;if(o=u.children,i=o.length,"/"===(r=Ge(e)))(n=o[t-1])&&"w"===Et(Ge(n))&&(o.splice(t,1),n.children.push(e),n.position&&e.position&&(n.position.end=e.position.end));else if(ft.test(r)){if(n=o[t-1],t>2&&t<i-1&&"WordNode"===n.type&&"WhiteSpaceNode"===o[t-2].type&&"WhiteSpaceNode"===o[t+1].type&&Ct.test(Et(Ge(n))))return o.splice(t,1),n.children.push(e),void(n.position&&e.position&&(n.position.end=e.position.end));t===i-1||"WordNode"!==o[t+1].type||0!==t&&"WordNode"===o[t-1].type||(n=o[t+1],r=Et(Ge(n)),Ft.test(r)?(o.splice(t,1),n.children=[e].concat(n.children),n.position&&e.position&&(n.position.start=e.position.start)):"n"===r&&t<i-2&&ft.test(Ge(o[t+2]))&&(s=o[t+2],o.splice(t,1),o.splice(t+1,1),n.children=[e].concat(n.children,s),n.position&&(e.position&&(n.position.start=e.position.start),s.position&&(n.position.end=s.position.end))))}})].concat(Dt.tokenizeSentencePlugins),Dt.tokenizeParagraphPlugins=[Qe(function(e,t,u){var o,n,s=e.children,i=s[s.length-1],r=s[s.length-2];if(i&&"."===Ge(i)&&r&&"WordNode"===r.type&&(o=Ge(r),(ht.test(Et(o))||gt.test(o))&&(r.children.push(i),s.pop(),i.position&&r.position&&(r.position.end=i.position.end),n=u.children[t+1])))return e.children=s.concat(n.children),u.children.splice(t+1,1),n.position&&e.position&&(e.position.end=n.position.end),t-1})].concat([Ze,et,tt,ut,ot,nt,st,it,rt,at,lt]);var ht=new RegExp("^(al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|vizinc|ltd|bbls?|cu|doz|fl|ft|gal|gr|gro|in|kt|lbs?|mi|oz|pt|qt|sq|tbsp|tsp|yds?|sec|min|hr|mon|tue|tues|wed|thu|thurs|fri|sat|sun|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)$"),gt=new RegExp("^(Mr|Mrs|Miss|Ms|Mss|Mses|Mlle|Mme|M|Messrs|Mmes|Jr|Sr|Snr|Dr|Mgr|Atty|Prof|Hon|Rev|Fr|Msgr|Sr|Br|St|Pres|Supt|Rep|Sen|Gov|Amb|Treas|Sec|Amd|Brig|Gen|Cdr|Col|Capt|Lt|Maj|Sgt|Po|Wo|Ph|Ave|Blvd|Mt|Rd|Bldgs?|Nat|Natl|Rt|Rte|Co|Pk|Sq|Dr|Pt|St|Ft|Pen|Terr|Hwy|Fwy|Pkwy|Ala|Ariz|Ark|Cal|Calif|Col|Colo|Conn|Del|Fla|Ga|Ida|Id|Ill|Ind|Ia|Kan|Kans|Ken|Ky|La|Me|Md|Mass|Mich|Minn|Miss|Mo|Mont|Neb|Nebr|Nev|Mex|Dak|Okla|Ok|Ore|Penna|Penn|Pa|Tenn|Tex|Ut|Vt|Va|Wash|Wis|Wisc|Wyo|Alta|Man|Ont|Qué|Que|Sask|Yuk|Beds|Berks|Bucks|Cambs|Ches|Corn|Cumb|Derbys|Derbs|Dev|Dor|Dur|Glos|Hants|Here|Heref|Herts|Hunts|Lancs|Leics|Lincs|Mx|Middx|Mddx|Norf|Northants|Northumb|Northd|Notts|Oxon|Rut|Shrops|Salop|Som|Staffs|Staf|Suff|Sy|Sx|Ssx|Warks|War|Warw|Westm|Wilts|Worcs|Yorks)$"),Ct=new RegExp("^(o|ol)$"),Ft=new RegExp("^(im|er|em|cause|twas|tis|twere|\\d\\ds?)$"),ft=/^['\u2019]$/;function Et(e){return e.toLowerCase()}const{compact:At}=i,{clone:mt}=i,yt=(e,t)=>t.children?t.children.reduce(yt,e):t.value?e+t.value:e,Bt=e=>yt("",e),bt=e=>(new ct).parse(e).children.reduce((e,t)=>{if("ParagraphNode"===t.type){const o={text:(u=t,yt("",u)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([o])}return e;var u},[]),xt=e=>(new ct).parse(e).children.reduce((e,t)=>"ParagraphNode"===t.type?t.children.reduce((e,t)=>{if("SentenceNode"===t.type){const u=((e,t)=>{const u=[];let o=e.children.reduce(function(e,t){if("WhiteSpaceNode"===t.type&&"\n"===t.value){if(u.length){const o=u[0],n={text:u.map(e=>Bt(e)).join(""),start:o.position.start.offset,end:t.position.start.offset};return u.splice(0,u.length),e.concat([n])}}else u.push(t);return e},t);if(u.length){const e=u[0],t=u[u.length-1],n={text:u.map(e=>Bt(e)).join(""),start:e.position.start.offset,end:t.position.end.offset};o=o.concat([n]),u.splice(0,u.length)}return o})(t,e);return u||e}return e},e):e,[]),St=e=>(new ct).parse(e).children.reduce((e,t)=>"ParagraphNode"===t.type?t.children.reduce((e,t)=>"SentenceNode"===t.type?t.children.reduce((e,t)=>{if("WordNode"===t.type){const o={text:(u=t,yt("",u)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([o])}return e;var u},e):e,e):e,[]);class vt{constructor(e){this.results=e}get hasOverlap(){return this.results.filter(e=>"overlap"===e.type).length>0}get surroundedTokens(){return this.results.filter(e=>"within-selection"===e.type).map(e=>e.token)}}const kt=(e,t)=>{const{start:u,end:o}=e,n=t.map(e=>u===e.start&&o===e.end?{token:e,type:"exact-fit"}:u<=e.start&&o>=e.end?{token:e,type:"within-selection"}:(e=>u>=e.start&&u<e.end)(e)||(e=>o>e.start&&o<=e.end)(e)?{token:e,type:"overlap"}:void 0);return new vt(At(n))},wt=(e,t)=>{const u=e||"";if(!Array.isArray(t)||0===t.length)return[{text:u,start:0,end:u.length}];const o=(e=>{if(Array.isArray(e)){const t=mt(e);return t.sort((e,t)=>{const u=e.start<t.start?-1:e.start>t.start?1:0,o=e.end<t.end?-1:e.end>t.end?1:0;if(-1===u&&-1!==o)throw new Error(`sort does not support intersecting tokens. a: ${e.start}-${e.end}, b: ${t.start}-${t.end}`);return u}),t}return e})(t).reduce((e,t,o,n)=>{let s=[];const i=e.lastIndex;if(t.start===i?s=[{text:u.substring(i,t.end),start:i,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]:i<t.start&&(s=[{text:u.substring(i,t.start),start:i,end:t.start},{text:u.substring(t.start,t.end),start:t.start,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]),o===n.length-1&&t.end<u.length){const e={text:u.substring(t.end),start:t.end,end:u.length};s.push(e)}return{lastIndex:s.length?s[s.length-1].end:i,result:e.result.concat(s)}},{result:[],lastIndex:0});return o.result},Nt=()=>{document.getSelection?(document.getSelection().removeAllRanges(),document.getSelection().addRange(document.createRange())):window.getSelection?window.getSelection().removeAllRanges?(window.getSelection().removeAllRanges(),window.getSelection().addRange(document.createRange())):window.getSelection().empty&&window.getSelection().empty():document.selection&&document.selection.empty()};var _t={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};var Lt={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};const Ot=t,Rt=u,{styled:Pt}=n,Tt=a,$t=r("@pie-lib:text-select:token-text"),Mt=Pt("span")(()=>({"&.predefined":{cursor:"pointer",backgroundColor:Lt[100],border:`dashed 0px ${Lt[700]}`,"& *":{cursor:"pointer",backgroundColor:Lt[100],border:`dashed 0px ${Lt[700]}`}},"&.correct":{backgroundColor:_t[500],"& *":{backgroundColor:_t[500]}}})),It=({text:e,predefined:t,onClick:u,correct:o})=>{const n=(e||"").replace(/\n/g,"<br>");if(t){const e=Tt("predefined",o&&"correct");return Ot.createElement(Mt,{onClick:u,className:e,dangerouslySetInnerHTML:{__html:n}})}return Ot.createElement("span",{dangerouslySetInnerHTML:{__html:n}})},jt=["\n"," ","\t"];class zt extends Ot.Component{constructor(...e){super(...e),zt.prototype.__init.call(this)}static __initStatic(){this.propTypes={text:Rt.string.isRequired,tokens:Rt.array.isRequired,onTokenClick:Rt.func.isRequired,onSelectToken:Rt.func.isRequired,className:Rt.string}}__init(){this.onClick=e=>{const{onSelectToken:t,text:u,tokens:o}=this.props;if(e.preventDefault(),"undefined"==typeof window)return;const n=window.getSelection().toString();if(n.length>0&&jt.indexOf(n)<0&&this.root){let e=(e=>{var t,u=0,o=e.ownerDocument||e.document,n=o.defaultView||o.parentWindow;if(void 0!==n.getSelection){if((t=n.getSelection()).rangeCount>0){var s=n.getSelection().getRangeAt(0),i=s.toString().length,r=s.cloneRange();r.selectNodeContents(e),r.setEnd(s.endContainer,s.endOffset),u=i?r.toString().length-i:r.toString().length}}else if((t=o.selection)&&"Control"!==t.type){var a=t.createRange(),l=o.body.createTextRange();l.moveToElementText(e),l.setEndPoint("EndToEnd",a),u=l.text.length}return u})(this.root);if(e+=u.slice(e).indexOf(n),void 0!==e){const s=e+n.length;if(s<=u.length){const u=kt({start:e,end:s},o);if(u.hasOverlap)$t("hasOverlap - do nothing"),Nt();else{t({text:n,start:e,end:s},u.surroundedTokens),Nt()}}}}}}render(){const{text:e,tokens:t,className:u,onTokenClick:o}=this.props,n=wt(e,t);return Ot.createElement("div",{className:u,ref:e=>this.root=e,onClick:this.onClick},n.map((e,t)=>Ot.createElement(It,{key:t,...e,onClick:()=>o(e)})))}}zt.__initStatic();const Wt=t,Ht=u,{styled:Vt}=n,{clone:Ut}=i,{isEqual:qt}=i,{differenceWith:Kt}=i,Yt=Vt("div")(({disabled:e})=>({whiteSpace:"pre-wrap",...e&&{cursor:"default",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}}));class Gt extends Wt.Component{static __initStatic(){this.propTypes={text:Ht.string.isRequired,tokens:Ht.arrayOf(Ht.shape({text:Ht.string,correct:Ht.bool,start:Ht.number,end:Ht.number})),onChange:Ht.func.isRequired}}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),Gt.prototype.__init.call(this),Gt.prototype.__init2.call(this),Gt.prototype.__init3.call(this),Gt.prototype.__init4.call(this),Gt.prototype.__init5.call(this),Gt.prototype.__init6.call(this),Gt.prototype.__init7.call(this),Gt.prototype.__init8.call(this),Gt.prototype.__init9.call(this),this.state={setCorrectMode:!1,mode:""}}__init(){this.onChangeHandler=(e,t)=>{this.props.onChange(e,t),this.setState({mode:t})}}__init2(){this.toggleCorrectMode=()=>this.setState({setCorrectMode:!this.state.setCorrectMode})}__init3(){this.clear=()=>{this.onChangeHandler([],"")}}__init4(){this.buildTokens=(e,t)=>{const{text:u}=this.props,o=t(u);this.onChangeHandler(o,e)}}__init5(){this.selectToken=(e,t)=>{const{tokens:u}=this.props,o=Kt(Ut(u),t,qt);o.push(e),this.onChangeHandler(o,this.state.mode)}}__init6(){this.tokenClick=e=>{const{setCorrectMode:t}=this.state;t?this.setCorrect(e):this.removeToken(e)}}__init7(){this.tokenIndex=e=>{const{tokens:t}=this.props;return t.findIndex(t=>t.text==e.text&&t.start==e.start&&t.end==e.end)}}__init8(){this.setCorrect=e=>{const{tokens:t}=this.props,u=this.tokenIndex(e);if(-1!==u){const e=t[u];e.correct=!e.correct;const o=Ut(t);o.splice(u,1,e),this.onChangeHandler(o,this.state.mode)}}}__init9(){this.removeToken=e=>{const{tokens:t}=this.props,u=this.tokenIndex(e);if(-1!==u){const e=Ut(t);e.splice(u,1),this.onChangeHandler(e,this.state.mode)}}}render(){const{text:e,tokens:t}=this.props,{setCorrectMode:u}=this.state;return Wt.createElement("div",null,Wt.createElement(w,{onClear:this.clear,onWords:()=>this.buildTokens("words",St),onSentences:()=>this.buildTokens("sentence",xt),onParagraphs:()=>this.buildTokens("paragraphs",bt),setCorrectMode:u,onToggleCorrectMode:this.toggleCorrectMode}),Wt.createElement(Yt,{disabled:u,as:zt,text:e,tokens:t,onTokenClick:this.tokenClick,onSelectToken:this.selectToken}))}}Gt.__initStatic(),Gt.__initStatic2();const Jt=t,Qt=u,{styled:Xt}=n,Zt=a,{Check:eu}=l,{Close:tu}=l,{color:uu}=s,ou=Xt("span")(({theme:e})=>({cursor:"pointer",textIndent:0,"&.disabled":{cursor:"inherit",color:uu.disabled()},"&.disabledBlack":{cursor:"inherit",pointerEvents:"none"},"&.disabledAndSelected":{backgroundColor:uu.blueGrey100()},[`@media (min-width: ${e.breakpoints.values.md}px)`]:{"&.selectable:hover":{backgroundColor:uu.blueGrey300(),color:e.palette.common.black,"& > *":{backgroundColor:uu.blueGrey300()}}},"&.selected":{backgroundColor:uu.blueGrey100(),color:e.palette.common.black,lineHeight:3.2*parseFloat(e.spacing(1))+"px",border:`solid 2px ${uu.blueGrey900()}`,borderRadius:"4px","& > *":{backgroundColor:uu.blueGrey100()}},"&.highlight":{border:`dashed 2px ${uu.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*parseFloat(e.spacing(1))+"px"},"&.print":{border:`dashed 2px ${uu.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*parseFloat(e.spacing(1))+"px",color:uu.text()},"&.custom":{display:"initial"}})),nu=Xt("span")(({theme:e})=>({position:"relative",borderRadius:"4px",color:e.palette.common.black,lineHeight:3.4*parseFloat(e.spacing(1))+2+"px",padding:"2px"})),su=Xt(nu)(()=>({border:`${uu.correctTertiary()} solid 2px`})),iu=Xt(nu)(()=>({border:`${uu.incorrectWithIcon()} solid 2px`})),ru=Xt(nu)(()=>({border:`${uu.incorrectWithIcon()} dashed 2px`})),au={color:uu.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px",display:"inline-block"},lu=Xt(eu)(()=>({...au,backgroundColor:uu.correctTertiary()})),cu=Xt(tu)(()=>({...au,backgroundColor:uu.incorrectWithIcon()})),Du=({useWrapper:e,children:t,Container:u,Icon:o})=>e?Jt.createElement(u,null,t,o?Jt.createElement(o,null):null):t;Du.propTypes={useWrapper:Qt.bool,Container:Qt.elementType,Icon:Qt.elementType,children:Qt.node};const pu={text:Qt.string,selectable:Qt.bool};class du extends Jt.Component{constructor(...e){super(...e),du.prototype.__init.call(this)}static __initStatic(){this.rootClassName="tokenRootClass"}static __initStatic2(){this.propTypes={...pu,text:Qt.string.isRequired,className:Qt.string,disabled:Qt.bool,highlight:Qt.bool,correct:Qt.bool}}static __initStatic3(){this.defaultProps={selectable:!1,text:""}}__init(){this.getClassAndIconConfig=()=>{const{selectable:e,selected:t,className:u,disabled:o,highlight:n,correct:s,animationsDisabled:i,isMissing:r}=this.props,a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,l=du.rootClassName;if(void 0===s&&t&&o)return{className:Zt(l,"selected","disabledBlack",u),Component:ou};if(void 0!==s){const e=!0===s;return{className:Zt(l,"custom",u),Component:ou,Container:e?su:iu,Icon:e?lu:cu}}return r?{className:Zt(l,"custom","missing",u),Component:ou,Container:ru,Icon:cu}:{className:Zt(l,o&&"disabled",e&&!o&&!a&&"selectable",t&&!o&&"selected",t&&o&&"disabledAndSelected",n&&e&&!o&&!t&&"highlight",i&&"print",u),Component:ou,Container:undefined,Icon:undefined}}}render(){const{text:e,index:t,correct:u,isMissing:o}=this.props,{className:n,Component:s,Container:i,Icon:r}=this.getClassAndIconConfig(),a=s||ou;return Jt.createElement(Du,{useWrapper:void 0!==u||o,Container:i,Icon:r},Jt.createElement(a,{className:n,dangerouslySetInnerHTML:{__html:(e||"").replace(/\n/g,"<br>")},"data-indexkey":t}))}}du.__initStatic(),du.__initStatic2(),du.__initStatic3();const hu=t,gu=u,{styled:Cu}=n,{clone:Fu}=i,{isEqual:fu}=i;function Eu(e){let t,u=e[0],o=1;for(;o<e.length;){const n=e[o],s=e[o+1];if(o+=2,("optionalAccess"===n||"optionalCall"===n)&&null==u)return;"access"===n||"optionalAccess"===n?(t=u,u=s(u)):"call"!==n&&"optionalCall"!==n||(u=s((...e)=>u.call(t,...e)),t=void 0)}return u}const Au=r("@pie-lib:text-select:token-select"),mu=Cu("div")(()=>({backgroundColor:"none",whiteSpace:"pre",cursor:"default",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none","& p":{whiteSpace:"break-spaces",margin:0}})),yu=e=>e?e.replace(/<[^>]+>/g,""):e;class Bu extends hu.Component{constructor(...e){super(...e),Bu.prototype.__init.call(this),Bu.prototype.__init2.call(this),Bu.prototype.__init3.call(this),Bu.prototype.__init4.call(this)}static __initStatic(){this.propTypes={tokens:gu.arrayOf(gu.shape(pu)).isRequired,className:gu.string,onChange:gu.func.isRequired,disabled:gu.bool,highlightChoices:gu.bool,animationsDisabled:gu.bool,maxNoOfSelections:gu.number}}static __initStatic2(){this.defaultProps={highlightChoices:!1,maxNoOfSelections:0,tokens:[]}}__init(){this.selectedCount=()=>this.props.tokens.filter(e=>e.selected).length}__init2(){this.canSelectMore=e=>{const{maxNoOfSelections:t}=this.props;return 1===t||(Au("[canSelectMore] maxNoOfSelections: ",t,"selectedCount: ",e),t<=0||isFinite(t)&&e<t)}}__init3(){this.toggleToken=e=>{const{target:t}=e,{tokens:u,animationsDisabled:o}=this.props,n=Fu(u),s=Eu([t,"access",e=>e.closest,"optionalCall",e=>e(`.${du.rootClassName}`)]),i=Eu([s,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.indexkey]),r=void 0!==i?n[i]:void 0;if(r&&void 0===r.correct&&!o&&!r.isMissing){const{onChange:e,maxNoOfSelections:t}=this.props,o=!r.selected;if(1===t&&1===this.selectedCount()){const t=(u||[]).filter(e=>e.selected),s=n.map(e=>fu(e,t[0])?{...e,selected:!1}:{...e,selectable:!0}),a={...r,selected:o};s.splice(i,1,a),e(s)}else{if(o&&t>0&&this.selectedCount()>=t)return void Au("skip toggle max reached");const u={...r,selected:o};n.splice(i,1,u),e(n)}}}}__init4(){this.generateTokensNodes=()=>{const{tokens:e,disabled:t,highlightChoices:u,animationsDisabled:o}=this.props,n=this.selectedCount(),s=[];let i=[];const r=()=>{s.push(hu.createElement("p",{key:`p-${s.length}`},i)),i=[]};return(e||[]).forEach((e,s)=>{const a=e.selected||e.selectable&&this.canSelectMore(n),l=void 0!==e.correct&&(e.selectable||e.selected);"\n\n"!==e.text?(e=>"\n"===e)(e.text)?i.push(hu.createElement("br",{key:`br-${s}`})):a&&!t||l||e.selected||e.isMissing||o&&e.predefined?i.push(hu.createElement(du,{key:s,disabled:t,index:s,...e,text:yu(e.text),selectable:a,highlight:u,animationsDisabled:o})):i.push(hu.createElement(hu.Fragment,{key:s},yu(e.text))):r()}),r(),s}}render(){const{className:e}=this.props,t=this.generateTokensNodes();return hu.createElement(mu,{className:e,onClick:this.toggleToken},t)}}Bu.__initStatic(),Bu.__initStatic2();const bu=t,xu=u,Su=r("@pie-lib:text-select");class vu extends bu.Component{constructor(...e){super(...e),vu.prototype.__init.call(this)}static __initStatic(){this.propTypes={onChange:xu.func,disabled:xu.bool,tokens:xu.arrayOf(xu.shape(pu)).isRequired,selectedTokens:xu.arrayOf(xu.shape(pu)).isRequired,text:xu.string.isRequired,className:xu.string,highlightChoices:xu.bool,animationsDisabled:xu.bool,maxNoOfSelections:xu.number}}__init(){this.change=e=>{const{onChange:t}=this.props;if(!t)return;t(e.filter(e=>e.selected).map(e=>({start:e.start,end:e.end})))}}render(){const{text:e,disabled:t,tokens:u,selectedTokens:o,className:n,highlightChoices:s,maxNoOfSelections:i,animationsDisabled:r}=this.props,a=wt(e,u);Su("normalized: ",a);const l=a.map(e=>{const u=-1!==o.findIndex(t=>t.start===e.start&&t.end===e.end),n=u?e.correct:void 0,s=e.isMissing;return{...e,selectable:!t&&e.predefined,selected:u,correct:n,isMissing:s}});return bu.createElement(Bu,{highlightChoices:!t&&s,className:n,tokens:l,disabled:t,onChange:this.change,maxNoOfSelections:i,animationsDisabled:r})}}function ku(e,t){return null!=e?e:t()}function wu(e){let t,u=e[0],o=1;for(;o<e.length;){const n=e[o],s=e[o+1];if(o+=2,("optionalAccess"===n||"optionalCall"===n)&&null==u)return;"access"===n||"optionalAccess"===n?(t=u,u=s(u)):"call"!==n&&"optionalCall"!==n||(u=s((...e)=>u.call(t,...e)),t=void 0)}return u}vu.__initStatic();const Nu=e=>"string"==typeof e,_u=()=>{let e,t;const u=new Promise((u,o)=>{e=u,t=o});return u.resolve=e,u.reject=t,u},Lu=e=>null==e?"":""+e,Ou=/###/g,Ru=e=>e&&e.indexOf("###")>-1?e.replace(Ou,"."):e,Pu=e=>!e||Nu(e),Tu=(e,t,u)=>{const o=Nu(t)?t.split("."):t;let n=0;for(;n<o.length-1;){if(Pu(e))return{};const t=Ru(o[n]);!e[t]&&u&&(e[t]=new u),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++n}return Pu(e)?{}:{obj:e,k:Ru(o[n])}},$u=(e,t,u)=>{const{obj:o,k:n}=Tu(e,t,Object);if(void 0!==o||1===t.length)return void(o[n]=u);let s=t[t.length-1],i=t.slice(0,t.length-1),r=Tu(e,i,Object);for(;void 0===r.obj&&i.length;)s=`${i[i.length-1]}.${s}`,i=i.slice(0,i.length-1),r=Tu(e,i,Object),wu([r,"optionalAccess",e=>e.obj])&&void 0!==r.obj[`${r.k}.${s}`]&&(r.obj=void 0);r.obj[`${r.k}.${s}`]=u},Mu=(e,t)=>{const{obj:u,k:o}=Tu(e,t);if(u&&Object.prototype.hasOwnProperty.call(u,o))return u[o]},Iu=(e,t,u)=>{for(const o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?Nu(e[o])||e[o]instanceof String||Nu(t[o])||t[o]instanceof String?u&&(e[o]=t[o]):Iu(e[o],t[o],u):e[o]=t[o]);return e},ju=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var zu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Wu=e=>Nu(e)?e.replace(/[&<>"'\/]/g,e=>zu[e]):e;const Hu=[" ",",","?","!",";"],Vu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const u=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,u),this.regExpQueue.push(e),u}}(20),Uu=(e,t,u=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const o=t.split(u);let n=e;for(let e=0;e<o.length;){if(!n||"object"!=typeof n)return;let t,s="";for(let i=e;i<o.length;++i)if(i!==e&&(s+=u),s+=o[i],t=n[s],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<o.length-1)continue;e+=i-e+1;break}n=t}return n},qu=e=>wu([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),Ku={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){wu([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Yu{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ku,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,u,o){return o&&!this.debug?null:(Nu(e[0])&&(e[0]=`${u}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Yu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Yu(this.logger,e)}}var Gu=new Yu;class Ju{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const u=this.observers[e].get(t)||0;this.observers[e].set(t,u+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,u])=>{for(let o=0;o<u;o++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([u,o])=>{for(let n=0;n<o;n++)u.apply(u,[e,...t])})}}}class Qu extends Ju{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,u,o={}){const n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],u&&(Array.isArray(u)?i.push(...u):Nu(u)&&n?i.push(...u.split(n)):i.push(u)));const r=Mu(this.data,i);return!r&&!t&&!u&&e.indexOf(".")>-1&&(e=i[0],t=i[1],u=i.slice(2).join(".")),!r&&s&&Nu(u)?Uu(wu([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),u,n):r}addResource(e,t,u,o,n={silent:!1}){const s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let i=[e,t];u&&(i=i.concat(s?u.split(s):u)),e.indexOf(".")>-1&&(i=e.split("."),o=t,t=i[1]),this.addNamespaces(t),$u(this.data,i,o),n.silent||this.emit("added",e,t,u,o)}addResources(e,t,u,o={silent:!1}){for(const o in u)(Nu(u[o])||Array.isArray(u[o]))&&this.addResource(e,t,o,u[o],{silent:!0});o.silent||this.emit("added",e,t,u)}addResourceBundle(e,t,u,o,n,s={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),o=u,u=t,t=i[1]),this.addNamespaces(t);let r=Mu(this.data,i)||{};s.skipCopy||(u=JSON.parse(JSON.stringify(u))),o?Iu(r,u,n):r={...r,...u},$u(this.data,i,r),s.silent||this.emit("added",e,t,u)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Xu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,u,o,n){return e.forEach(e=>{t=ku(wu([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,u,o,n)]),()=>t)}),t}};const Zu=Symbol("i18next/PATH_KEY");function eo(e,t){const{[Zu]:u}=e(function(){const e=[],t=Object.create(null);let u;return t.get=(o,n)=>(wu([u,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),n===Zu?e:(e.push(n),u=Proxy.revocable(o,t),u.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return u.join(ku(wu([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const to={},uo=e=>!Nu(e)&&"boolean"!=typeof e&&"number"!=typeof e;class oo extends Ju{constructor(e,t={}){var u,o;super(),u=e,o=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{u[e]&&(o[e]=u[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Gu.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const u={...t};if(null==e)return!1;const o=this.resolve(e,u);if(void 0===wu([o,"optionalAccess",e=>e.res]))return!1;const n=uo(o.res);return!1!==u.returnObjects||!n}extractFromKey(e,t){let u=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let n=t.ns||this.options.defaultNS||[];const s=u&&e.indexOf(u)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,u)=>{t=t||"",u=u||"";const o=Hu.filter(e=>t.indexOf(e)<0&&u.indexOf(e)<0);if(0===o.length)return!0;const n=Vu.getRegExp(`(${o.map(e=>"?"===e?"\\?":e).join("|")})`);let s=!n.test(e);if(!s){const t=e.indexOf(u);t>0&&!n.test(e.substring(0,t))&&(s=!0)}return s})(e,u,o));if(s&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Nu(n)?[n]:n};const s=e.split(u);(u!==o||u===o&&this.options.ns.indexOf(s[0])>-1)&&(n=s.shift()),e=s.join(o)}return{key:e,namespaces:Nu(n)?[n]:n}}translate(e,t,u){let o="object"==typeof t?{...t}:t;if("object"!=typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof o&&(o={...o}),o||(o={}),null==e)return"";"function"==typeof e&&(e=eo(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);const n=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,s=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:i,namespaces:r}=this.extractFromKey(e[e.length-1],o),a=r[r.length-1];let l=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const c=o.lng||this.language,D=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===wu([c,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return D?n?{res:`${a}${l}${i}`,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(o)}:`${a}${l}${i}`:n?{res:i,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(o)}:i;const p=this.resolve(e,o);let d=wu([p,"optionalAccess",e=>e.res]);const h=wu([p,"optionalAccess",e=>e.usedKey])||i,g=wu([p,"optionalAccess",e=>e.exactUsedKey])||i,C=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,F=!this.i18nFormat||this.i18nFormat.handleAsObject,f=void 0!==o.count&&!Nu(o.count),E=oo.hasDefaultValue(o),A=f?this.pluralResolver.getSuffix(c,o.count,o):"",m=o.ordinal&&f?this.pluralResolver.getSuffix(c,o.count,{ordinal:!1}):"",y=f&&!o.ordinal&&0===o.count,B=y&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${A}`]||o[`defaultValue${m}`]||o.defaultValue;let b=d;F&&!d&&E&&(b=B);const x=uo(b),S=Object.prototype.toString.apply(b);if(!(F&&b&&x&&["[object Number]","[object Function]","[object RegExp]"].indexOf(S)<0)||Nu(C)&&Array.isArray(b))if(F&&Nu(C)&&Array.isArray(d))d=d.join(C),d&&(d=this.extendTranslation(d,e,o,u));else{let t=!1,n=!1;!this.isValidLookup(d)&&E&&(t=!0,d=B),this.isValidLookup(d)||(n=!0,d=i);const r=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:d,D=E&&B!==d&&this.options.updateMissing;if(n||t||D){if(this.logger.log(D?"updateKey":"missingKey",c,a,i,D?B:d),s){const e=this.resolve(i,{...o,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let u=0;u<t.length;u++)e.push(t[u]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(o.lng||this.language):e.push(o.lng||this.language);const u=(e,t,u)=>{const n=E&&u!==d?u:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,t,n,D,o):wu([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,a,t,n,D,o),this.emit("missingKey",e,a,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&f?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,o);y&&o[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{u([e],i+t,o[`defaultValue${t}`]||B)})}):u(e,i,B))}d=this.extendTranslation(d,e,o,p,u),n&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${a}${l}${i}`),(n||t)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}${l}${i}`:i,t?d:void 0,o))}else{if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,b,{...o,ns:r}):`key '${i} (${this.language})' returned an object instead of string.`;return n?(p.res=e,p.usedParams=this.getUsedParamsDetails(o),p):e}if(s){const e=Array.isArray(b),t=e?[]:{},u=e?g:h;for(const e in b)if(Object.prototype.hasOwnProperty.call(b,e)){const n=`${u}${s}${e}`;t[e]=E&&!d?this.translate(n,{...o,defaultValue:uo(B)?B[e]:void 0,joinArrays:!1,ns:r}):this.translate(n,{...o,joinArrays:!1,ns:r}),t[e]===n&&(t[e]=b[e])}d=t}}return n?(p.res=d,p.usedParams=this.getUsedParamsDetails(o),p):d}extendTranslation(e,t,u,o,n){if(wu([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...u},u.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!u.skipInterpolation){u.interpolation&&this.interpolator.init({...u,interpolation:{...this.options.interpolation,...u.interpolation}});const s=Nu(e)&&(void 0!==wu([u,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let i;if(s){const t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let r=u.replace&&!Nu(u.replace)?u.replace:u;if(this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),e=this.interpolator.interpolate(e,r,u.lng||this.language||o.usedLng,u),s){const t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(u.nest=!1)}!u.lng&&o&&o.res&&(u.lng=this.language||o.usedLng),!1!==u.nest&&(e=this.interpolator.nest(e,(...e)=>wu([n,"optionalAccess",e=>e[0]])!==e[0]||u.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),u)),u.interpolation&&this.interpolator.reset()}const s=u.postProcess||this.options.postProcess,i=Nu(s)?[s]:s;return null!=e&&wu([i,"optionalAccess",e=>e.length])&&!1!==u.applyPostProcessor&&(e=Xu.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(u)},...u}:u,this)),e}resolve(e,t={}){let u,o,n,s,i;return Nu(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(u))return;const r=this.extractFromKey(e,t),a=r.key;o=a;let l=r.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==t.count&&!Nu(t.count),D=c&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(Nu(t.context)||"number"==typeof t.context)&&""!==t.context,d=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(u)||(i=e,to[`${d[0]}-${e}`]||!wu([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||wu([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(i)])||(to[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${d.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach(o=>{if(this.isValidLookup(u))return;s=o;const i=[a];if(wu([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(i,a,o,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(o,t.count,t));const u=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(n)&&i.push(a+e.replace(n,this.options.pluralSeparator)),i.push(a+e),D&&i.push(a+u)),p){const o=`${a}${this.options.contextSeparator||"_"}${t.context}`;i.push(o),c&&(t.ordinal&&0===e.indexOf(n)&&i.push(o+e.replace(n,this.options.pluralSeparator)),i.push(o+e),D&&i.push(o+u))}}let r;for(;r=i.pop();)this.isValidLookup(u)||(n=r,u=this.getResource(o,e,r,t))}))})}),{res:u,usedKey:o,exactUsedKey:n,usedLng:s,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,u,o={}){return wu([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,u,o):this.resourceStore.getResource(e,t,u,o)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],u=e.replace&&!Nu(e.replace);let o=u?e.replace:e;if(u&&void 0!==e.count&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!u){o={...o};for(const e of t)delete o[e]}return o}static hasDefaultValue(e){const t="defaultValue";for(const u in e)if(Object.prototype.hasOwnProperty.call(e,u)&&t===u.substring(0,12)&&void 0!==e[u])return!0;return!1}}class no{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Gu.create("languageUtils")}getScriptPartFromCode(e){if(!(e=qu(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=qu(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Nu(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const u=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(u)||(t=u)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const u=this.getScriptPartFromCode(e);if(this.isSupportedCode(u))return t=u;const o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find(e=>e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:e.indexOf("-")>0&&o.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Nu(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let u=e[t];return u||(u=e[this.getScriptPartFromCode(t)]),u||(u=e[this.formatLanguageCode(t)]),u||(u=e[this.getLanguagePartFromCode(t)]),u||(u=e.default),u||[]}toResolveHierarchy(e,t){const u=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),o=[],n=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Nu(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(e))):Nu(e)&&n(this.formatLanguageCode(e)),u.forEach(e=>{o.indexOf(e)<0&&n(this.formatLanguageCode(e))}),o}}const so={zero:0,one:1,two:2,few:3,many:4,other:5},io={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ro{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Gu.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const u=qu("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:u,type:o});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let s;try{s=new Intl.PluralRules(u,{type:o})}catch(u){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),io;if(!e.match(/-|_/))return io;const o=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(o,t)}return this.pluralRulesCache[n]=s,s}needsPlural(e,t={}){let u=this.getRule(e,t);return u||(u=this.getRule("dev",t)),wu([u,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,u={}){return this.getSuffixes(e,u).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let u=this.getRule(e,t);return u||(u=this.getRule("dev",t)),u?u.resolvedOptions().pluralCategories.sort((e,t)=>so[e]-so[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,u={}){const o=this.getRule(e,u);return o?`${this.options.prepend}${u.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,u))}}const ao=(e,t,u,o=".",n=!0)=>{let s=((e,t,u)=>{const o=Mu(e,u);return void 0!==o?o:Mu(t,u)})(e,t,u);return!s&&n&&Nu(u)&&(s=Uu(e,u,o),void 0===s&&(s=Uu(t,u,o))),s},lo=e=>e.replace(/\$/g,"$$$$");class co{constructor(e={}){this.logger=Gu.create("interpolator"),this.options=e,this.format=wu([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:u,useRawValueToEscape:o,prefix:n,prefixEscaped:s,suffix:i,suffixEscaped:r,formatSeparator:a,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:D,nestingPrefixEscaped:p,nestingSuffix:d,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:C,alwaysFormat:F}=e.interpolation;this.escape=void 0!==t?t:Wu,this.escapeValue=void 0===u||u,this.useRawValueToEscape=void 0!==o&&o,this.prefix=n?ju(n):s||"{{",this.suffix=i?ju(i):r||"}}",this.formatSeparator=a||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=D?ju(D):p||ju("$t("),this.nestingSuffix=d?ju(d):h||ju(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=C||1e3,this.alwaysFormat=void 0!==F&&F,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>wu([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,u,o){let n,s,i;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},a=e=>{if(e.indexOf(this.formatSeparator)<0){const n=ao(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,u,{...o,...t,interpolationkey:e}):n}const n=e.split(this.formatSeparator),s=n.shift().trim(),i=n.join(this.formatSeparator).trim();return this.format(ao(t,r,s,this.options.keySeparator,this.options.ignoreJSONStructure),i,u,{...o,...t,interpolationkey:s})};this.resetRegExp();const l=wu([o,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,c=void 0!==wu([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>lo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?lo(this.escape(e)):lo(e)}].forEach(t=>{for(i=0;n=t.regex.exec(e);){const u=n[1].trim();if(s=a(u),void 0===s)if("function"==typeof l){const t=l(e,n,o);s=Nu(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,u))s="";else{if(c){s=n[0];continue}this.logger.warn(`missed to pass in variable ${u} for interpolating ${e}`),s=""}else Nu(s)||this.useRawValueToEscape||(s=Lu(s));const r=t.safeValue(s);if(e=e.replace(n[0],r),c?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,u={}){let o,n,s;const i=(e,t)=>{const u=this.nestingOptionsSeparator;if(e.indexOf(u)<0)return e;const o=e.split(new RegExp(`${u}[ ]*{`));let n=`{${o[1]}`;e=o[0],n=this.interpolate(n,s);const i=n.match(/'/g),r=n.match(/"/g);(ku(wu([i,"optionalAccess",e=>e.length]),()=>0)%2==0&&!r||r.length%2!=0)&&(n=n.replace(/'/g,'"'));try{s=JSON.parse(n),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${u}${n}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let r=[];s={...u},s=s.replace&&!Nu(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const a=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==a&&(r=o[1].slice(a).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),o[1]=o[1].slice(0,a)),n=t(i.call(this,o[1].trim(),s),s),n&&o[0]===e&&!Nu(n))return n;Nu(n)||(n=Lu(n)),n||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),n=""),r.length&&(n=r.reduce((e,t)=>this.format(e,t,u.lng,{...u,interpolationkey:o[1].trim()}),n.trim())),e=e.replace(o[0],n),this.regexp.lastIndex=0}return e}}const Do=e=>{const t={};return(u,o,n)=>{let s=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(s={...s,[n.interpolationkey]:void 0});const i=o+JSON.stringify(s);let r=t[i];return r||(r=e(qu(o),n),t[i]=r),r(u)}},po=e=>(t,u,o)=>e(qu(u),o)(t);class ho{constructor(e={}){this.logger=Gu.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const u=t.cacheInBuiltFormats?Do:po;this.formats={number:u((e,t)=>{const u=new Intl.NumberFormat(e,{...t});return e=>u.format(e)}),currency:u((e,t)=>{const u=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>u.format(e)}),datetime:u((e,t)=>{const u=new Intl.DateTimeFormat(e,{...t});return e=>u.format(e)}),relativetime:u((e,t)=>{const u=new Intl.RelativeTimeFormat(e,{...t});return e=>u.format(e,t.range||"day")}),list:u((e,t)=>{const u=new Intl.ListFormat(e,{...t});return e=>u.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Do(t)}format(e,t,u,o={}){const n=t.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find(e=>e.indexOf(")")>-1)){const e=n.findIndex(e=>e.indexOf(")")>-1);n[0]=[n[0],...n.splice(1,e)].join(this.formatSeparator)}return n.reduce((e,t)=>{const{formatName:n,formatOptions:s}=(e=>{let t=e.toLowerCase().trim();const u={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const n=o[1].substring(0,o[1].length-1);"currency"===t&&n.indexOf(":")<0?u.currency||(u.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?u.range||(u.range=n.trim()):n.split(";").forEach(e=>{if(e){const[t,...o]=e.split(":"),n=o.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();u[s]||(u[s]=n),"false"===n&&(u[s]=!1),"true"===n&&(u[s]=!0),isNaN(n)||(u[s]=parseInt(n,10))}})}return{formatName:t,formatOptions:u}})(t);if(this.formats[n]){let t=e;try{const i=wu([o,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[o.interpolationkey]])||{},r=i.locale||i.lng||o.locale||o.lng||u;t=this.formats[n](e,r,{...s,...o,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${n}`),e},e)}}class go extends Ju{constructor(e,t,u,o={}){super(),this.backend=e,this.store=t,this.services=u,this.languageUtils=u.languageUtils,this.options=o,this.logger=Gu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],wu([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(u,o.backend,o)])}queueLoad(e,t,u,o){const n={},s={},i={},r={};return e.forEach(e=>{let o=!0;t.forEach(t=>{const i=`${e}|${t}`;!u.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===s[i]&&(s[i]=!0):(this.state[i]=1,o=!1,void 0===s[i]&&(s[i]=!0),void 0===n[i]&&(n[i]=!0),void 0===r[t]&&(r[t]=!0)))}),o||(i[e]=!0)}),(Object.keys(n).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(n),pending:Object.keys(s),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(r)}}loaded(e,t,u){const o=e.split("|"),n=o[0],s=o[1];t&&this.emit("failedLoading",n,s,t),!t&&u&&this.store.addResourceBundle(n,s,u,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&u&&(this.state[e]=0);const i={};this.queue.forEach(u=>{((e,t,u)=>{const{obj:o,k:n}=Tu(e,t,Object);o[n]=o[n]||[],o[n].push(u)})(u.loaded,[n],s),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(u,e),t&&u.errors.push(t),0!==u.pendingCount||u.done||(Object.keys(u.loaded).forEach(e=>{i[e]||(i[e]={});const t=u.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,u,o=0,n=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:u,tried:o,wait:n,callback:s});this.readingCalls++;const i=(i,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&r&&o<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,u,o+1,2*n,s)},n):s(i,r)},r=this.backend[u].bind(this.backend);if(2!==r.length)return r(e,t,i);try{const u=r(e,t);u&&"function"==typeof u.then?u.then(e=>i(null,e)).catch(i):i(null,u)}catch(e){i(e)}}prepareLoading(e,t,u={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Nu(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Nu(t)&&(t=[t]);const n=this.queueLoad(e,t,u,o);if(!n.toLoad.length)return n.pending.length||o(),null;n.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,u){this.prepareLoading(e,t,{},u)}reload(e,t,u){this.prepareLoading(e,t,{reload:!0},u)}loadOne(e,t=""){const u=e.split("|"),o=u[0],n=u[1];this.read(o,n,"read",void 0,void 0,(u,s)=>{u&&this.logger.warn(`${t}loading namespace ${n} for language ${o} failed`,u),!u&&s&&this.logger.log(`${t}loaded namespace ${n} for language ${o}`,s),this.loaded(e,u,s)})}saveMissing(e,t,u,o,n,s={},i=()=>{}){if(!wu([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||wu([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=u&&""!==u){if(wu([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const r={...s,isUpdate:n},a=this.backend.create.bind(this.backend);if(a.length<6)try{let n;n=5===a.length?a(e,t,u,o,r):a(e,t,u,o),n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}else a(e,t,u,o,i,r)}e&&e[0]&&this.store.addResource(e[0],t,u,o)}}else this.logger.warn(`did not save key "${u}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Co=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Nu(e[1])&&(t.defaultValue=e[1]),Nu(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const u=e[3]||e[2];Object.keys(u).forEach(e=>{t[e]=u[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Fo=e=>(Nu(e.ns)&&(e.ns=[e.ns]),Nu(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Nu(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),wu([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),fo=()=>{};class Eo extends Ju{constructor(e={},t){var u;if(super(),this.options=Fo(e),this.services={},this.logger=Gu,this.modules={external:[]},u=this,Object.getOwnPropertyNames(Object.getPrototypeOf(u)).forEach(e=>{"function"==typeof u[e]&&(u[e]=u[e].bind(u))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Nu(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const u=Co();var o;this.options={...u,...this.options,...Fo(e)},this.options.interpolation={...u.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=u.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(wu([o=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||wu([o,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||wu([o,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&o.options.backend.backends.some(e=>wu([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||wu([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Gu.init(n(this.modules.logger),this.options):Gu.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ho;const t=new no(this.options);this.store=new Qu(this.options.resources,this.options);const o=this.services;o.logger=Gu,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new ro(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==u.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==u.interpolation.format||(o.formatter=n(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new co(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new go(n(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(o.languageDetector=n(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=n(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new oo(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=fo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const s=_u(),i=()=>{const e=(e,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(u),t(e,u)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),s}loadResources(e,t=fo){let u=t;const o=Nu(e)?e:this.language;if("function"==typeof e&&(u=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===wu([o,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return u();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(o)t(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}wu([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),u(e)})}else u(null)}reloadResources(e,t,u){const o=_u();return"function"==typeof e&&(u=e,e=void 0),"function"==typeof t&&(u=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),u||(u=fo),this.services.backendConnector.reload(e,t,e=>{o.resolve(),u(e)}),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Xu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const u=_u();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(n,s)=>{s?this.isLanguageChangingTo===e&&(o(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,u.resolve((...e)=>this.t(...e)),t&&t(n,(...e)=>this.t(...e))},s=t=>{e||t||!this.services.languageDetector||(t=[]);const u=Nu(t)?t:t&&t[0],s=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(Nu(t)?[t]:t);s&&(this.language||o(s),this.translator.language||this.translator.changeLanguage(s),wu([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(s)])),this.loadResources(s,e=>{n(e,s)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),u}getFixedT(e,t,u){const o=(e,t,...n)=>{let s;s="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(n)):{...t},s.lng=s.lng||o.lng,s.lngs=s.lngs||o.lngs,s.ns=s.ns||o.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||u||o.keyPrefix);const i=this.options.keySeparator||".";let r;return s.keyPrefix&&Array.isArray(e)?r=e.map(e=>("function"==typeof e&&(e=eo(e,{...this.options,...t})),`${s.keyPrefix}${i}${e}`)):("function"==typeof e&&(e=eo(e,{...this.options,...t})),r=s.keyPrefix?`${s.keyPrefix}${i}${e}`:e),this.t(r,s)};return Nu(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=u,o}t(...e){return wu([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return wu([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const u=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===u.toLowerCase())return!0;const s=(e,t)=>{const u=this.services.backendConnector.state[`${e}|${t}`];return-1===u||0===u||2===u};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!!this.hasResourceBundle(u,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(u,e)||o&&!s(n,e)))}loadNamespaces(e,t){const u=_u();return this.options.ns?(Nu(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{u.resolve(),t&&t(e)}),u):(t&&t(),Promise.resolve())}loadLanguages(e,t){const u=_u();Nu(e)&&(e=[e]);const o=this.options.preload||[],n=e.filter(e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return n.length?(this.options.preload=o.concat(n),this.loadResources(e=>{u.resolve(),t&&t(e)}),u):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(wu([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=wu([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new no(Co());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const u=new Eo(e,t);return u.createInstance=Eo.createInstance,u}cloneInstance(e={},t=fo){const u=e.forkResourceStore;u&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},n=new Eo(o);void 0===e.debug&&void 0===e.prefix||(n.logger=n.logger.clone(e));if(["store","services","language"].forEach(e=>{n[e]=this[e]}),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},u){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((u,o)=>(u[o]={...e[t][o]},u),e[t]),e),{});n.store=new Qu(e,o),n.services.resourceStore=n.store}if(e.interpolation){const t={...Co().interpolation,...this.options.interpolation,...e.interpolation},u={...o,interpolation:t};n.services.interpolator=new co(u)}return n.translator=new oo(n.services,o),n.translator.on("*",(e,...t)=>{n.emit(e,...t)}),n.init(o,t),n.translator.options=o,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ao=Eo.createInstance();Ao.createInstance,Ao.dir,Ao.init,Ao.loadResources,Ao.reloadResources,Ao.use,Ao.changeLanguage,Ao.getFixedT,Ao.t,Ao.exists,Ao.setDefaultNamespace,Ao.hasLoadedNamespace,Ao.loadNamespaces,Ao.loadLanguages;Ao.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var mo={translator:{...Ao,t:(e,t)=>{const{lng:u}=t;switch(u){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return Ao.t(e,{lng:u,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const yo=t,{styled:Bo}=n,{Check:bo}=l,{Close:xo}=l,{color:So}=s,{translator:vo}=mo,ko=Bo("div")(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",gap:e.spacing(2),borderBottom:"1px solid lightgrey",borderTop:"1px solid lightgrey",paddingBottom:e.spacing(1),paddingTop:e.spacing(1),marginBottom:e.spacing(1)})),wo=Bo("span")(({theme:e})=>({fontSize:"14px",fontWeight:"bold",color:So.black(),marginLeft:e.spacing(1)})),No=Bo("div")(()=>({position:"relative",padding:"4px",fontSize:"14px",borderRadius:"4px"})),_o=Bo(No)(()=>({border:`${So.correctTertiary()} solid 2px`})),Lo=Bo(No)(()=>({border:`${So.incorrectWithIcon()} solid 2px`})),Oo=Bo(No)(()=>({border:`${So.incorrectWithIcon()} dashed 2px`})),Ro={color:So.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px"},Po=Bo(bo)(()=>({...Ro,backgroundColor:So.correctTertiary()})),To=Bo(xo)(()=>({...Ro,backgroundColor:So.incorrectWithIcon()})),$o=({language:e,showOnlyCorrect:t})=>{const u=[{Icon:Po,label:vo.t("selectText.correctAnswerSelected",{lng:e}),Container:_o},{Icon:To,label:vo.t("selectText.incorrectSelection",{lng:e}),Container:Lo},{Icon:To,label:vo.t("selectText.correctAnswerNotSelected",{lng:e}),Container:Oo}];return t&&u.splice(1,2),yo.createElement(ko,null,yo.createElement(wo,null,vo.t("selectText.key",{lng:e})),u.map(({Icon:e,label:t,Container:u},o)=>yo.createElement(u,{key:o},yo.createElement(e,null),yo.createElement("span",null,t))))};var Mo=function(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e.trim(),t}(e),u=document.createElement("div");return u.innerHTML="<div separator='true'>".concat(t.innerHTML,"</div>"),t=u,0===Array.from(t.querySelectorAll("*")).length?e:function(e){var t=e.querySelectorAll("div[separator=true]"),u="";return t.forEach(function(e,o){var n;u+=(n=e,o===t.length-1?n.innerHTML:"".concat(n.innerHTML,"\n\n"))}),u||null}(t)},Io=e=>{if(!e)return e;const t=Mo(e.text||""),u=(e.tokens||[]).reduce((u,o={})=>{const n=Mo((e.text||"").slice(o.start,o.end));if(!n)return[...u,o];const s=u[u.length-1],i=(e=>{let u=e;for(;u>=0;){let e=t.slice(u).indexOf(n);if(e>=0)return e+u;u--}return 0})(s?s.end:o.start),r=i+n.length;return[...u,{...o,text:n,start:i,end:r,oldStart:o.start,oldEnd:o.end}]},[]);return{...e,tokens:u,text:t}};const jo=t,zo=u,Wo=c,{color:Ho}=s,{Feedback:Vo}=s,{Collapsible:Uo}=s,{hasText:qo}=s,{hasMedia:Ko}=s,{PreviewPrompt:Yo}=s,{UiLayout:Go}=s,{styled:Jo}=n,Qo=r("@pie-ui:select-text"),Xo=Jo(Go)({color:Ho.text(),backgroundColor:Ho.background()}),Zo=Jo(vu)(({theme:e})=>({marginBottom:e.spacing(1),marginTop:e.spacing(2),whiteSpace:"normal"})),en=Jo("div")(({theme:e})=>({verticalAlign:"middle",marginBottom:e.spacing(1)})),tn=Jo(Uo)(({theme:e})=>({marginBottom:e.spacing(2)})),un={model:zo.object,session:zo.object,onSelectionChange:zo.func.isRequired};class on extends jo.Component{static __initStatic(){this.propTypes=un}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),on.prototype.__init.call(this),on.prototype.__init2.call(this),this.state={showCorrectAnswer:this.props.model.alwaysShowCorrect||!1,model:Io(e.model)}}UNSAFE_componentWillReceiveProps(e){this.setState({showCorrectAnswer:!!e.model.alwaysShowCorrect,model:Io(e.model)})}__init(){this.toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})}}__init2(){this.correctAnswer=()=>{const{model:e}=this.state;return e.tokens.filter(e=>e.correct)}}render(){const{session:e,onSelectionChange:t}=this.props,{showCorrectAnswer:u,model:o}=this.state,{env:n,extraCSSRules:s}=o,{mode:i}=n||{},r=u?this.correctAnswer():e.selectedTokens,a=o.rationale&&(qo(o.rationale)||Ko(o.rationale)),l=o.teacherInstructions&&(qo(o.teacherInstructions)||Ko(o.teacherInstructions));return Qo("[render] selectedTokens:",r),jo.createElement(Xo,{extraCSSRules:s},l&&(o.animationsDisabled?jo.createElement(en,null,jo.createElement(Yo,{prompt:o.teacherInstructions})):jo.createElement(tn,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},jo.createElement(Yo,{prompt:o.teacherInstructions}))),jo.createElement(en,null,jo.createElement(Yo,{prompt:o.prompt})),!o.alwaysShowCorrect&&jo.createElement(Wo,{show:o.disabled&&o.incorrect,toggled:u,onToggle:this.toggleShowCorrect,language:o.language}),jo.createElement(Zo,{disabled:o.disabled,text:o.text,tokens:o.tokens,selectedTokens:r,onChange:e=>{const u=e.map(e=>{const t=o.tokens.find(({start:t,end:u})=>e.start===t&&e.end===u);return t||e});t(u)},highlightChoices:o.highlightChoices,maxNoOfSelections:o.maxSelections,animationsDisabled:o.animationsDisabled}),"evaluate"===i&&jo.createElement($o,{language:o.language,showOnlyCorrect:u}),a&&(o.animationsDisabled?jo.createElement(en,null,jo.createElement(Yo,{prompt:o.rationale})):jo.createElement(tn,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},jo.createElement(Yo,{prompt:o.rationale}))),o.correctness&&o.feedback&&!u&&jo.createElement(Vo,{correctness:o.correctness,feedback:o.feedback}))}}on.__initStatic(),on.__initStatic2();class nn extends jo.Component{static __initStatic3(){this.propTypes=un}constructor(e){super(e),nn.prototype.__init3.call(this),this.state={model:e.model,session:e.session}}UNSAFE_componentWillReceiveProps(e){this.setState({model:e.model,session:e.session})}__init3(){this.change=e=>{const t={...this.state.session,selectedTokens:e};this.setState({session:t},()=>{this.props.onSelectionChange(this.state.session.selectedTokens)})}}render(){const{model:e,session:t}=this.state;return jo.createElement(on,{model:e,session:t,onSelectionChange:this.change})}}nn.__initStatic3();const sn=t,{renderMath:rn}=D;class an extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this.render(),this.dispatchEvent(new C(this.tagName.toLowerCase(),this.isSessionComplete(),void 0!==this._model))}set session(e){if(this._session=e,this._model){const t=Io(this._model)||{},{tokens:u}=t;let{selectedTokens:o}=e||{};o=o||[];const n=e=>u.find(({start:t,end:u})=>e.start===t&&e.end===u);if(!o.reduce((e,t)=>e&&n(t),!0)){const e=Io({...this._model,tokens:o})||{},{tokens:t}=e;t&&(this._session.selectedTokens=t)}}Array.isArray(this._session.selectedTokens)||(this._session.selectedTokens=[]),this.render()}get session(){return this._session}isSessionComplete(){const{selectedTokens:e}=this._session||{};return Array.isArray(e)&&e.length>0}selectionChanged(e){this._session.selectedTokens=e,this.dispatchEvent(new f(this.tagName.toLowerCase(),this.isSessionComplete()))}connectedCallback(){this.render()}render(){if(this._model&&this._session){const e=sn.createElement(nn,{model:this._model,session:this._session,onSelectionChange:this.selectionChanged.bind(this)});this._root||(this._root=p(this)),this._root.render(e),queueMicrotask(()=>{rn(this)})}}disconnectedCallback(){this._root&&this._root.unmount()}}export{an as default};
package/module/index.html DELETED
@@ -1,21 +0,0 @@
1
-
2
- <!doctype html>
3
- <html>
4
- <head>
5
- <title>@pie-element/select-text@12.0.0-beta.1</title>
6
- <script
7
- type="module"
8
- src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
9
-
10
- <link
11
- href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
12
- rel="stylesheet"
13
- />
14
- <style>
15
- html, body {
16
- font-family: 'Roboto', sans-serif;
17
- }
18
- </style>
19
- <script type="module" src="./demo.js"></script>
20
- </head>
21
- </html>
@@ -1,14 +0,0 @@
1
- {
2
- "name": "@pie-element/select-text",
3
- "version": "12.0.0-beta.1",
4
- "modules": [
5
- {
6
- "name": "@pie-lib/shared-module",
7
- "version": "^3.0.5"
8
- },
9
- {
10
- "name": "@pie-lib/math-rendering-module",
11
- "version": "^4.0.5"
12
- }
13
- ]
14
- }