@airporting/integrations-app 0.4.29 → 0.4.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mf/286.js +10 -0
- package/dist/mf/286.js.LICENSE.txt +9 -0
- package/dist/mf/600.js +1 -0
- package/dist/mf/741.js +1 -1
- package/dist/mf/756.js +1 -1
- package/dist/mf/@mf-types.zip +0 -0
- package/dist/mf/__federation_expose_connectors.js +1 -1
- package/dist/mf/__federation_expose_single_connector.js +1 -1
- package/dist/mf/index.js +3 -3
- package/dist/mf/integrations_app.js +3 -3
- package/dist/mf/mf-manifest.json +27 -8
- package/dist/mf/mf-stats.json +35 -12
- package/package.json +8 -7
- package/dist/mf/49.js +0 -1
package/dist/mf/mf-manifest.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "integrations_app",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.4.
|
|
8
|
+
"buildVersion": "0.4.31",
|
|
9
9
|
"buildName": "@airporting/integrations-app"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
{
|
|
29
29
|
"id": "integrations_app:@airporting/app-front",
|
|
30
30
|
"name": "@airporting/app-front",
|
|
31
|
-
"version": "1.1.
|
|
31
|
+
"version": "1.1.22",
|
|
32
32
|
"singleton": true,
|
|
33
|
-
"requiredVersion": "1.1.
|
|
33
|
+
"requiredVersion": "1.1.22",
|
|
34
34
|
"assets": {
|
|
35
35
|
"js": {
|
|
36
36
|
"async": [],
|
|
@@ -200,9 +200,9 @@
|
|
|
200
200
|
{
|
|
201
201
|
"id": "integrations_app:@tanstack/react-router",
|
|
202
202
|
"name": "@tanstack/react-router",
|
|
203
|
-
"version": "1.133.
|
|
203
|
+
"version": "1.133.27",
|
|
204
204
|
"singleton": true,
|
|
205
|
-
"requiredVersion": "1.133.
|
|
205
|
+
"requiredVersion": "1.133.27",
|
|
206
206
|
"assets": {
|
|
207
207
|
"js": {
|
|
208
208
|
"async": [],
|
|
@@ -235,6 +235,25 @@
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
|
+
{
|
|
239
|
+
"id": "integrations_app:i18next",
|
|
240
|
+
"name": "i18next",
|
|
241
|
+
"version": "25.6.0",
|
|
242
|
+
"singleton": true,
|
|
243
|
+
"requiredVersion": "25.6.0",
|
|
244
|
+
"assets": {
|
|
245
|
+
"js": {
|
|
246
|
+
"async": [],
|
|
247
|
+
"sync": [
|
|
248
|
+
"600.js"
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
"css": {
|
|
252
|
+
"async": [],
|
|
253
|
+
"sync": []
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
238
257
|
{
|
|
239
258
|
"id": "integrations_app:lodash-es",
|
|
240
259
|
"name": "lodash-es",
|
|
@@ -296,14 +315,14 @@
|
|
|
296
315
|
{
|
|
297
316
|
"id": "integrations_app:react-i18next",
|
|
298
317
|
"name": "react-i18next",
|
|
299
|
-
"version": "
|
|
318
|
+
"version": "16.2.0",
|
|
300
319
|
"singleton": true,
|
|
301
|
-
"requiredVersion": "
|
|
320
|
+
"requiredVersion": "16.2.0",
|
|
302
321
|
"assets": {
|
|
303
322
|
"js": {
|
|
304
323
|
"async": [],
|
|
305
324
|
"sync": [
|
|
306
|
-
"
|
|
325
|
+
"286.js"
|
|
307
326
|
]
|
|
308
327
|
},
|
|
309
328
|
"css": {
|
package/dist/mf/mf-stats.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "integrations_app",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.4.
|
|
8
|
+
"buildVersion": "0.4.31",
|
|
9
9
|
"buildName": "@airporting/integrations-app"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"shared": [
|
|
28
28
|
{
|
|
29
29
|
"singleton": true,
|
|
30
|
-
"requiredVersion": "1.1.
|
|
30
|
+
"requiredVersion": "1.1.22",
|
|
31
31
|
"shareScope": "default",
|
|
32
32
|
"strictVersion": false,
|
|
33
33
|
"name": "@airporting/app-front",
|
|
34
|
-
"version": "1.1.
|
|
34
|
+
"version": "1.1.22",
|
|
35
35
|
"eager": false,
|
|
36
36
|
"id": "integrations_app:@airporting/app-front",
|
|
37
37
|
"assets": {
|
|
@@ -195,8 +195,8 @@
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
"usedIn": [
|
|
198
|
-
"./
|
|
199
|
-
"./
|
|
198
|
+
"./connectors",
|
|
199
|
+
"./single-connector"
|
|
200
200
|
]
|
|
201
201
|
},
|
|
202
202
|
{
|
|
@@ -250,11 +250,11 @@
|
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
"singleton": true,
|
|
253
|
-
"requiredVersion": "1.133.
|
|
253
|
+
"requiredVersion": "1.133.27",
|
|
254
254
|
"shareScope": "default",
|
|
255
255
|
"strictVersion": false,
|
|
256
256
|
"name": "@tanstack/react-router",
|
|
257
|
-
"version": "1.133.
|
|
257
|
+
"version": "1.133.27",
|
|
258
258
|
"eager": false,
|
|
259
259
|
"id": "integrations_app:@tanstack/react-router",
|
|
260
260
|
"assets": {
|
|
@@ -294,6 +294,29 @@
|
|
|
294
294
|
},
|
|
295
295
|
"usedIn": []
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
"singleton": true,
|
|
299
|
+
"requiredVersion": "25.6.0",
|
|
300
|
+
"shareScope": "default",
|
|
301
|
+
"strictVersion": false,
|
|
302
|
+
"name": "i18next",
|
|
303
|
+
"version": "25.6.0",
|
|
304
|
+
"eager": false,
|
|
305
|
+
"id": "integrations_app:i18next",
|
|
306
|
+
"assets": {
|
|
307
|
+
"js": {
|
|
308
|
+
"async": [],
|
|
309
|
+
"sync": [
|
|
310
|
+
"600.js"
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
"css": {
|
|
314
|
+
"async": [],
|
|
315
|
+
"sync": []
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"usedIn": []
|
|
319
|
+
},
|
|
297
320
|
{
|
|
298
321
|
"singleton": true,
|
|
299
322
|
"requiredVersion": "4.17.21",
|
|
@@ -369,18 +392,18 @@
|
|
|
369
392
|
},
|
|
370
393
|
{
|
|
371
394
|
"singleton": true,
|
|
372
|
-
"requiredVersion": "
|
|
395
|
+
"requiredVersion": "16.2.0",
|
|
373
396
|
"shareScope": "default",
|
|
374
397
|
"strictVersion": false,
|
|
375
398
|
"name": "react-i18next",
|
|
376
|
-
"version": "
|
|
399
|
+
"version": "16.2.0",
|
|
377
400
|
"eager": false,
|
|
378
401
|
"id": "integrations_app:react-i18next",
|
|
379
402
|
"assets": {
|
|
380
403
|
"js": {
|
|
381
404
|
"async": [],
|
|
382
405
|
"sync": [
|
|
383
|
-
"
|
|
406
|
+
"286.js"
|
|
384
407
|
]
|
|
385
408
|
},
|
|
386
409
|
"css": {
|
|
@@ -412,8 +435,8 @@
|
|
|
412
435
|
}
|
|
413
436
|
},
|
|
414
437
|
"usedIn": [
|
|
415
|
-
"./
|
|
416
|
-
"./
|
|
438
|
+
"./single-connector",
|
|
439
|
+
"./connectors"
|
|
417
440
|
]
|
|
418
441
|
},
|
|
419
442
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airporting/integrations-app",
|
|
3
3
|
"description": "⚡ Intégrations app front-end",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.31",
|
|
5
5
|
"packageManager": "yarn@4.10.3",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"v:patch": "npm version patch -m \"chore: bump patch to %s\""
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@airporting/app-front": "1.1.
|
|
27
|
+
"@airporting/app-front": "1.1.22",
|
|
28
28
|
"@mantine/charts": "8.3.5",
|
|
29
29
|
"@mantine/core": "8.3.5",
|
|
30
30
|
"@mantine/dates": "8.3.5",
|
|
@@ -34,21 +34,22 @@
|
|
|
34
34
|
"@mantine/notifications": "8.3.5",
|
|
35
35
|
"@tabler/icons-react": "3.35.0",
|
|
36
36
|
"@tanstack/react-query": "5.90.5",
|
|
37
|
-
"@tanstack/react-router": "1.133.
|
|
37
|
+
"@tanstack/react-router": "1.133.27",
|
|
38
38
|
"date-fns": "4.1.0",
|
|
39
39
|
"dayjs": "1.11.18",
|
|
40
|
+
"i18next": "25.6.0",
|
|
40
41
|
"jotai": "2.15.0",
|
|
41
42
|
"lodash-es": "4.17.21",
|
|
42
43
|
"proper-url-join": "2.1.2",
|
|
43
44
|
"radash": "12.1.1",
|
|
44
45
|
"react": "19.2.0",
|
|
45
46
|
"react-dom": "19.2.0",
|
|
46
|
-
"react-i18next": "
|
|
47
|
+
"react-i18next": "16.2.0",
|
|
47
48
|
"react-use": "17.6.0",
|
|
48
49
|
"recharts": "3.3.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@airporting/airpkg": "
|
|
52
|
+
"@airporting/airpkg": "0.11.37",
|
|
52
53
|
"@commitlint/cli": "19.8.1",
|
|
53
54
|
"@commitlint/config-conventional": "19.8.1",
|
|
54
55
|
"@commitlint/types": "19.8.1",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"@module-federation/rsbuild-plugin": "0.21.1",
|
|
57
58
|
"@rsbuild/core": "1.5.17",
|
|
58
59
|
"@rsbuild/plugin-react": "1.4.1",
|
|
59
|
-
"@rslib/core": "0.16.
|
|
60
|
+
"@rslib/core": "0.16.1",
|
|
60
61
|
"@types/lodash-es": "4.17.12",
|
|
61
62
|
"@types/node": "24.9.1",
|
|
62
63
|
"@types/proper-url-join": "2.1.5",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"postcss-simple-vars": "7.0.1",
|
|
75
76
|
"prettier": "3.6.2",
|
|
76
77
|
"swagger-typescript-api": "13.2.16",
|
|
77
|
-
"tsx": "4.20.
|
|
78
|
+
"tsx": "4.20.6",
|
|
78
79
|
"typescript": "5.9.3",
|
|
79
80
|
"typescript-eslint": "8.46.2"
|
|
80
81
|
},
|
package/dist/mf/49.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["49"],{4915:function(module){module.exports={area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,link:true,meta:true,param:true,source:true,track:true,wbr:true}},2776:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{withSSR:()=>withSSR,I18nextProvider:()=>I18nextProvider,selectOrdinal:()=>selectOrdinal,getI18n:()=>getI18n,date:()=>date,initReactI18next:()=>initReactI18next,useTranslation:()=>useTranslation,select:()=>es_select,Translation:()=>Translation,setI18n:()=>setI18n,withTranslation:()=>withTranslation,TransWithoutContext:()=>Trans,setDefaults:()=>setDefaults,getDefaults:()=>getDefaults,time:()=>time,I18nContext:()=>I18nContext,number:()=>number,plural:()=>plural,Trans:()=>Trans_Trans,getInitialProps:()=>getInitialProps,composeInitialProps:()=>composeInitialProps,useSSR:()=>useSSR});var index_js_=__webpack_require__(3620);var void_elements=__webpack_require__(4915);var void_elements_default=/*#__PURE__*/__webpack_require__.n(void_elements);var html_parse_stringify_module_t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function html_parse_stringify_module_n(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],(void_elements_default()[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return{type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(html_parse_stringify_module_t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var html_parse_stringify_module_r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,html_parse_stringify_module_i=/^\s*$/,html_parse_stringify_module_s=Object.create(null);function html_parse_stringify_module_a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(html_parse_stringify_module_a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var html_parse_stringify_module_c={parse:function(e,t){t||(t={}),t.components||(t.components=html_parse_stringify_module_s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)})}return e.replace(html_parse_stringify_module_r,function(r,s){if(m){if(r!=="</"+a.name+">")return;m=!1}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=html_parse_stringify_module_n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=html_parse_stringify_module_n(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);html_parse_stringify_module_i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+html_parse_stringify_module_a("",t)},"")}};const html_parse_stringify_module=html_parse_stringify_module_c;const warn=(i18n,code,msg,rest)=>{const args=[msg,{code,...rest||{}}];if(i18n?.services?.logger?.forward)return i18n.services.logger.forward(args,"warn","react-i18next::",true);if(isString(args[0]))args[0]=`react-i18next:: ${args[0]}`;if(i18n?.services?.logger?.warn)i18n.services.logger.warn(...args);else if(console?.warn)console.warn(...args)};const alreadyWarned={};const warnOnce=(i18n,code,msg,rest)=>{if(isString(msg)&&alreadyWarned[msg])return;if(isString(msg))alreadyWarned[msg]=new Date;warn(i18n,code,msg,rest)};const loadedClb=(i18n,cb)=>()=>{if(i18n.isInitialized)cb();else{const initialized=()=>{setTimeout(()=>{i18n.off("initialized",initialized)},0);cb()};i18n.on("initialized",initialized)}};const loadNamespaces=(i18n,ns,cb)=>{i18n.loadNamespaces(ns,loadedClb(i18n,cb))};const loadLanguages=(i18n,lng,ns,cb)=>{if(isString(ns))ns=[ns];if(i18n.options.preload&&i18n.options.preload.indexOf(lng)>-1)return loadNamespaces(i18n,ns,cb);ns.forEach(n=>{if(i18n.options.ns.indexOf(n)<0)i18n.options.ns.push(n)});i18n.loadLanguages(lng,loadedClb(i18n,cb))};const hasLoadedNamespace=(ns,i18n,options={})=>{if(!i18n.languages||!i18n.languages.length){warnOnce(i18n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i18n.languages});return true}return i18n.hasLoadedNamespace(ns,{lng:options.lng,precheck:(i18nInstance,loadNotPending)=>{if(options.bindI18n&&options.bindI18n.indexOf("languageChanging")>-1&&i18nInstance.services.backendConnector.backend&&i18nInstance.isLanguageChangingTo&&!loadNotPending(i18nInstance.isLanguageChangingTo,ns))return false}})};const getDisplayName=Component=>Component.displayName||Component.name||(isString(Component)&&Component.length>0?Component:"Unknown");const isString=obj=>"string"==typeof obj;const isObject=obj=>"object"==typeof obj&&null!==obj;const matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;const htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"…","…":"…","/":"/","/":"/"};const unescapeHtmlEntity=m=>htmlEntities[m];const unescape_unescape=text=>text.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:true,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:true,unescape:unescape_unescape};const setDefaults=(options={})=>{defaultOptions={...defaultOptions,...options}};const getDefaults=()=>defaultOptions;let i18nInstance_i18nInstance;const setI18n=instance=>{i18nInstance_i18nInstance=instance};const getI18n=()=>i18nInstance_i18nInstance;const hasChildren=(node,checkLength)=>{if(!node)return false;const base=node.props?.children??node.children;if(checkLength)return base.length>0;return!!base};const getChildren=node=>{if(!node)return[];const children=node.props?.children??node.children;return node.props?.i18nIsDynamicList?getAsArray(children):children};const hasValidReactChildren=children=>Array.isArray(children)&&children.every(index_js_.isValidElement);const getAsArray=data=>Array.isArray(data)?data:[data];const mergeProps=(source,target)=>{const newTarget={...target};newTarget.props=Object.assign(source.props,target.props);return newTarget};const nodesToString=(children,i18nOptions,i18n,i18nKey)=>{if(!children)return"";let stringNode="";const childrenArray=getAsArray(children);const keepArray=i18nOptions?.transSupportBasicHtmlNodes?i18nOptions.transKeepBasicHtmlNodesFor??[]:[];childrenArray.forEach((child,childIndex)=>{if(isString(child)){stringNode+=`${child}`;return}if((0,index_js_.isValidElement)(child)){const{props,type}=child;const childPropsCount=Object.keys(props).length;const shouldKeepChild=keepArray.indexOf(type)>-1;const childChildren=props.children;if(!childChildren&&shouldKeepChild&&!childPropsCount){stringNode+=`<${type}/>`;return}if(!childChildren&&(!shouldKeepChild||childPropsCount)||props.i18nIsDynamicList){stringNode+=`<${childIndex}></${childIndex}>`;return}if(shouldKeepChild&&1===childPropsCount&&isString(childChildren)){stringNode+=`<${type}>${childChildren}</${type}>`;return}const content=nodesToString(childChildren,i18nOptions,i18n,i18nKey);stringNode+=`<${childIndex}>${content}</${childIndex}>`;return}if(null===child)return void warn(i18n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey});if(isObject(child)){const{format,...clone}=child;const keys=Object.keys(clone);if(1===keys.length){const value=format?`${keys[0]}, ${format}`:keys[0];stringNode+=`{{${value}}}`;return}warn(i18n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey,child});return}warn(i18n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey,child})});return stringNode};const renderNodes=(children,knownComponentsMap,targetString,i18n,i18nOptions,combinedTOpts,shouldUnescape)=>{if(""===targetString)return[];const keepArray=i18nOptions.transKeepBasicHtmlNodesFor||[];const emptyChildrenButNeedsHandling=targetString&&new RegExp(keepArray.map(keep=>`<${keep}`).join("|")).test(targetString);if(!children&&!knownComponentsMap&&!emptyChildrenButNeedsHandling&&!shouldUnescape)return[targetString];const data=knownComponentsMap??{};const getData=childs=>{const childrenArray=getAsArray(childs);childrenArray.forEach(child=>{if(isString(child))return;if(hasChildren(child))getData(getChildren(child));else if(isObject(child)&&!(0,index_js_.isValidElement)(child))Object.assign(data,child)})};getData(children);const ast=html_parse_stringify_module.parse(`<0>${targetString}</0>`);const opts={...data,...combinedTOpts};const renderInner=(child,node,rootReactNode)=>{const childs=getChildren(child);const mappedChildren=mapAST(childs,node.children,rootReactNode);return hasValidReactChildren(childs)&&0===mappedChildren.length||child.props?.i18nIsDynamicList?childs:mappedChildren};const pushTranslatedJSX=(child,inner,mem,i,isVoid)=>{if(child.dummy){child.children=inner;mem.push((0,index_js_.cloneElement)(child,{key:i},isVoid?void 0:inner))}else mem.push(...index_js_.Children.map([child],c=>{const props={...c.props};delete props.i18nIsDynamicList;return(0,index_js_.createElement)(c.type,{...props,key:i,ref:c.props.ref??c.ref},isVoid?null:inner)}))};const mapAST=(reactNode,astNode,rootReactNode)=>{const reactNodes=getAsArray(reactNode);const astNodes=getAsArray(astNode);return astNodes.reduce((mem,node,i)=>{const translationContent=node.children?.[0]?.content&&i18n.services.interpolator.interpolate(node.children[0].content,opts,i18n.language);if("tag"===node.type){let tmp=reactNodes[parseInt(node.name,10)];if(!tmp&&knownComponentsMap)tmp=knownComponentsMap[node.name];if(1===rootReactNode.length&&!tmp)tmp=rootReactNode[0][node.name];if(!tmp)tmp={};const child=0!==Object.keys(node.attrs).length?mergeProps({props:node.attrs},tmp):tmp;const isElement=(0,index_js_.isValidElement)(child);const isValidTranslationWithChildren=isElement&&hasChildren(node,true)&&!node.voidElement;const isEmptyTransWithHTML=emptyChildrenButNeedsHandling&&isObject(child)&&child.dummy&&!isElement;const isKnownComponent=isObject(knownComponentsMap)&&Object.hasOwnProperty.call(knownComponentsMap,node.name);if(isString(child)){const value=i18n.services.interpolator.interpolate(child,opts,i18n.language);mem.push(value)}else if(hasChildren(child)||isValidTranslationWithChildren){const inner=renderInner(child,node,rootReactNode);pushTranslatedJSX(child,inner,mem,i)}else if(isEmptyTransWithHTML){const inner=mapAST(reactNodes,node.children,rootReactNode);pushTranslatedJSX(child,inner,mem,i)}else if(Number.isNaN(parseFloat(node.name)))if(isKnownComponent){const inner=renderInner(child,node,rootReactNode);pushTranslatedJSX(child,inner,mem,i,node.voidElement)}else if(i18nOptions.transSupportBasicHtmlNodes&&keepArray.indexOf(node.name)>-1)if(node.voidElement)mem.push((0,index_js_.createElement)(node.name,{key:`${node.name}-${i}`}));else{const inner=mapAST(reactNodes,node.children,rootReactNode);mem.push((0,index_js_.createElement)(node.name,{key:`${node.name}-${i}`},inner))}else if(node.voidElement)mem.push(`<${node.name} />`);else{const inner=mapAST(reactNodes,node.children,rootReactNode);mem.push(`<${node.name}>${inner}</${node.name}>`)}else if(isObject(child)&&!isElement){const content=node.children[0]?translationContent:null;if(content)mem.push(content)}else pushTranslatedJSX(child,translationContent,mem,i,1!==node.children.length||!translationContent)}else if("text"===node.type){const wrapTextNodes=i18nOptions.transWrapTextNodes;const content=shouldUnescape?i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content,opts,i18n.language)):i18n.services.interpolator.interpolate(node.content,opts,i18n.language);if(wrapTextNodes)mem.push((0,index_js_.createElement)(wrapTextNodes,{key:`${node.name}-${i}`},content));else mem.push(content)}return mem},[])};const result=mapAST([{dummy:true,children:children||[]}],ast,getAsArray(children||[]));return getChildren(result[0])};const fixComponentProps=(component,index,translation)=>{const componentKey=component.key||index;const comp=(0,index_js_.cloneElement)(component,{key:componentKey});if(!comp.props||!comp.props.children||translation.indexOf(`${index}/>`)<0&&translation.indexOf(`${index} />`)<0)return comp;function Componentized(){return(0,index_js_.createElement)(index_js_.Fragment,null,comp)}return(0,index_js_.createElement)(Componentized,{key:componentKey})};const generateArrayComponents=(components,translation)=>components.map((c,index)=>fixComponentProps(c,index,translation));const generateObjectComponents=(components,translation)=>{const componentMap={};Object.keys(components).forEach(c=>{Object.assign(componentMap,{[c]:fixComponentProps(components[c],c,translation)})});return componentMap};const generateComponents=(components,translation,i18n,i18nKey)=>{if(!components)return null;if(Array.isArray(components))return generateArrayComponents(components,translation);if(isObject(components))return generateObjectComponents(components,translation);warnOnce(i18n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey});return null};const isComponentsMap=object=>{if(!isObject(object))return false;if(Array.isArray(object))return false;return Object.keys(object).reduce((acc,key)=>acc&&Number.isNaN(Number.parseFloat(key)),true)};function Trans({children,count,parent,i18nKey,context,tOptions={},values,defaults,components,ns,i18n:i18nFromProps,t:tFromProps,shouldUnescape,...additionalProps}){const i18n=i18nFromProps||getI18n();if(!i18n){warnOnce(i18n,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey});return children}const t=tFromProps||i18n.t.bind(i18n)||(k=>k);const reactI18nextOptions={...getDefaults(),...i18n.options?.react};let namespaces=ns||t.ns||i18n.options?.defaultNS;namespaces=isString(namespaces)?[namespaces]:namespaces||["translation"];const nodeAsString=nodesToString(children,reactI18nextOptions,i18n,i18nKey);const defaultValue=defaults||nodeAsString||reactI18nextOptions.transEmptyNodeValue||i18nKey;const{hashTransKey}=reactI18nextOptions;const key=i18nKey||(hashTransKey?hashTransKey(nodeAsString||defaultValue):nodeAsString||defaultValue);if(i18n.options?.interpolation?.defaultVariables)values=values&&Object.keys(values).length>0?{...values,...i18n.options.interpolation.defaultVariables}:{...i18n.options.interpolation.defaultVariables};const interpolationOverride=!values&&(void 0===count||i18n.options?.interpolation?.alwaysFormat)&&children?{interpolation:{...tOptions.interpolation,prefix:"#$?",suffix:"?$#"}}:tOptions.interpolation;const combinedTOpts={...tOptions,context:context||tOptions.context,count,...values,...interpolationOverride,defaultValue,ns:namespaces};const translation=key?t(key,combinedTOpts):defaultValue;const generatedComponents=generateComponents(components,translation,i18n,i18nKey);let indexedChildren=generatedComponents||children;let componentsMap=null;if(isComponentsMap(generatedComponents)){componentsMap=generatedComponents;indexedChildren=children}const content=renderNodes(indexedChildren,componentsMap,translation,i18n,reactI18nextOptions,combinedTOpts,shouldUnescape);const useAsParent=parent??reactI18nextOptions.defaultTransParent;return useAsParent?(0,index_js_.createElement)(useAsParent,additionalProps,content):content}const initReactI18next={type:"3rdParty",init(instance){setDefaults(instance.options.react);setI18n(instance)}};const I18nContext=(0,index_js_.createContext)();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(namespaces){namespaces.forEach(ns=>{if(!this.usedNamespaces[ns])this.usedNamespaces[ns]=true})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const composeInitialProps=ForComponent=>async ctx=>{const componentsInitialProps=await ForComponent.getInitialProps?.(ctx)??{};const i18nInitialProps=getInitialProps();return{...componentsInitialProps,...i18nInitialProps}};const getInitialProps=()=>{const i18n=getI18n();const namespaces=i18n.reportNamespaces?.getUsedNamespaces()??[];const ret={};const initialI18nStore={};i18n.languages.forEach(l=>{initialI18nStore[l]={};namespaces.forEach(ns=>{initialI18nStore[l][ns]=i18n.getResourceBundle(l,ns)||{}})});ret.initialI18nStore=initialI18nStore;ret.initialLanguage=i18n.language;return ret};function Trans_Trans({children,count,parent,i18nKey,context,tOptions={},values,defaults,components,ns,i18n:i18nFromProps,t:tFromProps,shouldUnescape,...additionalProps}){const{i18n:i18nFromContext,defaultNS:defaultNSFromContext}=(0,index_js_.useContext)(I18nContext)||{};const i18n=i18nFromProps||i18nFromContext||getI18n();const t=tFromProps||i18n?.t.bind(i18n);return Trans({children,count,parent,i18nKey,context,tOptions,values,defaults,components,ns:ns||t?.ns||defaultNSFromContext||i18n?.options?.defaultNS,i18n,t:tFromProps,shouldUnescape,...additionalProps})}const usePrevious=(value,ignore)=>{const ref=(0,index_js_.useRef)();(0,index_js_.useEffect)(()=>{ref.current=ignore?ref.current:value},[value,ignore]);return ref.current};const alwaysNewT=(i18n,language,namespace,keyPrefix)=>i18n.getFixedT(language,namespace,keyPrefix);const useMemoizedT=(i18n,language,namespace,keyPrefix)=>(0,index_js_.useCallback)(alwaysNewT(i18n,language,namespace,keyPrefix),[i18n,language,namespace,keyPrefix]);const useTranslation=(ns,props={})=>{const{i18n:i18nFromProps}=props;const{i18n:i18nFromContext,defaultNS:defaultNSFromContext}=(0,index_js_.useContext)(I18nContext)||{};const i18n=i18nFromProps||i18nFromContext||getI18n();if(i18n&&!i18n.reportNamespaces)i18n.reportNamespaces=new ReportNamespaces;if(!i18n){warnOnce(i18n,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const notReadyT=(k,optsOrDefaultValue)=>{if(isString(optsOrDefaultValue))return optsOrDefaultValue;if(isObject(optsOrDefaultValue)&&isString(optsOrDefaultValue.defaultValue))return optsOrDefaultValue.defaultValue;return Array.isArray(k)?k[k.length-1]:k};const retNotReady=[notReadyT,{},false];retNotReady.t=notReadyT;retNotReady.i18n={};retNotReady.ready=false;return retNotReady}if(i18n.options.react?.wait)warnOnce(i18n,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const i18nOptions={...getDefaults(),...i18n.options.react,...props};const{useSuspense,keyPrefix}=i18nOptions;let namespaces=ns||defaultNSFromContext||i18n.options?.defaultNS;namespaces=isString(namespaces)?[namespaces]:namespaces||["translation"];i18n.reportNamespaces.addUsedNamespaces?.(namespaces);const ready=(i18n.isInitialized||i18n.initializedStoreOnce)&&namespaces.every(n=>hasLoadedNamespace(n,i18n,i18nOptions));const memoGetT=useMemoizedT(i18n,props.lng||null,"fallback"===i18nOptions.nsMode?namespaces:namespaces[0],keyPrefix);const getT=()=>memoGetT;const getNewT=()=>alwaysNewT(i18n,props.lng||null,"fallback"===i18nOptions.nsMode?namespaces:namespaces[0],keyPrefix);const[t,setT]=(0,index_js_.useState)(getT);let joinedNS=namespaces.join();if(props.lng)joinedNS=`${props.lng}${joinedNS}`;const previousJoinedNS=usePrevious(joinedNS);const isMounted=(0,index_js_.useRef)(true);(0,index_js_.useEffect)(()=>{const{bindI18n,bindI18nStore}=i18nOptions;isMounted.current=true;if(!ready&&!useSuspense)if(props.lng)loadLanguages(i18n,props.lng,namespaces,()=>{if(isMounted.current)setT(getNewT)});else loadNamespaces(i18n,namespaces,()=>{if(isMounted.current)setT(getNewT)});if(ready&&previousJoinedNS&&previousJoinedNS!==joinedNS&&isMounted.current)setT(getNewT);const boundReset=()=>{if(isMounted.current)setT(getNewT)};if(bindI18n)i18n?.on(bindI18n,boundReset);if(bindI18nStore)i18n?.store.on(bindI18nStore,boundReset);return()=>{isMounted.current=false;if(i18n&&bindI18n)bindI18n?.split(" ").forEach(e=>i18n.off(e,boundReset));if(bindI18nStore&&i18n)bindI18nStore.split(" ").forEach(e=>i18n.store.off(e,boundReset))}},[i18n,joinedNS]);(0,index_js_.useEffect)(()=>{if(isMounted.current&&ready)setT(getT)},[i18n,keyPrefix,ready]);const ret=[t,i18n,ready];ret.t=t;ret.i18n=i18n;ret.ready=ready;if(ready)return ret;if(!ready&&!useSuspense)return ret;throw new Promise(resolve=>{if(props.lng)loadLanguages(i18n,props.lng,namespaces,()=>resolve());else loadNamespaces(i18n,namespaces,()=>resolve())})};const withTranslation=(ns,options={})=>function(WrappedComponent){function I18nextWithTranslation({forwardedRef,...rest}){const[t,i18n,ready]=useTranslation(ns,{...rest,keyPrefix:options.keyPrefix});const passDownProps={...rest,t,i18n,tReady:ready};if(options.withRef&&forwardedRef)passDownProps.ref=forwardedRef;else if(!options.withRef&&forwardedRef)passDownProps.forwardedRef=forwardedRef;return(0,index_js_.createElement)(WrappedComponent,passDownProps)}I18nextWithTranslation.displayName=`withI18nextTranslation(${getDisplayName(WrappedComponent)})`;I18nextWithTranslation.WrappedComponent=WrappedComponent;const forwardRef=(props,ref)=>(0,index_js_.createElement)(I18nextWithTranslation,Object.assign({},props,{forwardedRef:ref}));return options.withRef?(0,index_js_.forwardRef)(forwardRef):I18nextWithTranslation};const Translation=({ns,children,...options})=>{const[t,i18n,ready]=useTranslation(ns,options);return children(t,{i18n,lng:i18n.language},ready)};function I18nextProvider({i18n,defaultNS,children}){const value=(0,index_js_.useMemo)(()=>({i18n,defaultNS}),[i18n,defaultNS]);return(0,index_js_.createElement)(I18nContext.Provider,{value},children)}const useSSR=(initialI18nStore,initialLanguage,props={})=>{const{i18n:i18nFromProps}=props;const{i18n:i18nFromContext}=(0,index_js_.useContext)(I18nContext)||{};const i18n=i18nFromProps||i18nFromContext||getI18n();if(i18n.options?.isClone)return;if(initialI18nStore&&!i18n.initializedStoreOnce){i18n.services.resourceStore.data=initialI18nStore;i18n.options.ns=Object.values(initialI18nStore).reduce((mem,lngResources)=>{Object.keys(lngResources).forEach(ns=>{if(mem.indexOf(ns)<0)mem.push(ns)});return mem},i18n.options.ns);i18n.initializedStoreOnce=true;i18n.isInitialized=true}if(initialLanguage&&!i18n.initializedLanguageOnce){i18n.changeLanguage(initialLanguage);i18n.initializedLanguageOnce=true}};const withSSR=()=>function(WrappedComponent){function I18nextWithSSR({initialI18nStore,initialLanguage,...rest}){useSSR(initialI18nStore,initialLanguage);return(0,index_js_.createElement)(WrappedComponent,{...rest})}I18nextWithSSR.getInitialProps=composeInitialProps(WrappedComponent);I18nextWithSSR.displayName=`withI18nextSSR(${getDisplayName(WrappedComponent)})`;I18nextWithSSR.WrappedComponent=WrappedComponent;return I18nextWithSSR};const date=()=>"";const time=()=>"";const number=()=>"";const es_select=()=>"";const plural=()=>"";const selectOrdinal=()=>""}}]);
|