@next-bricks/presentational 1.21.4 → 1.21.6

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.
Files changed (59) hide show
  1. package/dist/bricks.json +6 -6
  2. package/dist/chunks/{3171.080badce.js → 3171.3bb3ff80.js} +2 -2
  3. package/dist/chunks/{5552.42e6f90b.js.map → 3171.3bb3ff80.js.map} +1 -1
  4. package/dist/chunks/{7146.7f525c72.js → 4765.653a09de.js} +2 -2
  5. package/dist/chunks/{7146.7f525c72.js.map → 4765.653a09de.js.map} +1 -1
  6. package/dist/chunks/{5045.31c04635.js → 5045.bd51599d.js} +2 -2
  7. package/dist/chunks/{5045.31c04635.js.map → 5045.bd51599d.js.map} +1 -1
  8. package/dist/chunks/{5552.42e6f90b.js → 5552.5d29c532.js} +2 -2
  9. package/dist/chunks/{3171.080badce.js.map → 5552.5d29c532.js.map} +1 -1
  10. package/dist/chunks/{4765.477a4581.js → 7146.53826a39.js} +2 -2
  11. package/dist/chunks/{4765.477a4581.js.map → 7146.53826a39.js.map} +1 -1
  12. package/dist/chunks/{8097.de8e20b7.js → 8097.bc056995.js} +2 -2
  13. package/dist/chunks/{8097.de8e20b7.js.map → 8097.bc056995.js.map} +1 -1
  14. package/dist/chunks/948.817a1ef0.js +3 -0
  15. package/dist/chunks/948.817a1ef0.js.map +1 -0
  16. package/dist/chunks/{code-wrapper.43c8bd5f.js → code-wrapper.40655769.js} +3 -3
  17. package/dist/chunks/{code-wrapper.43c8bd5f.js.map → code-wrapper.40655769.js.map} +1 -1
  18. package/dist/chunks/{eo-card-item.eb94d440.js → eo-card-item.fbff6f7e.js} +3 -3
  19. package/dist/chunks/{eo-card-item.eb94d440.js.map → eo-card-item.fbff6f7e.js.map} +1 -1
  20. package/dist/chunks/{eo-code-block.4656a45a.js → eo-code-block.ea4f7b95.js} +2 -2
  21. package/dist/chunks/{eo-code-block.4656a45a.js.map → eo-code-block.ea4f7b95.js.map} +1 -1
  22. package/dist/chunks/{eo-code-display.03e566ca.js → eo-code-display.ffd79558.js} +2 -2
  23. package/dist/chunks/{eo-code-display.03e566ca.js.map → eo-code-display.ffd79558.js.map} +1 -1
  24. package/dist/chunks/{eo-descriptions.180f1004.js → eo-descriptions.b8320ca9.js} +3 -3
  25. package/dist/chunks/{eo-descriptions.180f1004.js.map → eo-descriptions.b8320ca9.js.map} +1 -1
  26. package/dist/chunks/{eo-humanize-time.6a0d34b7.js → eo-humanize-time.2397ce6e.js} +2 -2
  27. package/dist/chunks/{eo-humanize-time.6a0d34b7.js.map → eo-humanize-time.2397ce6e.js.map} +1 -1
  28. package/dist/chunks/{eo-info-card-item.9bc3b172.js → eo-info-card-item.0d15cb28.js} +3 -3
  29. package/dist/chunks/eo-info-card-item.0d15cb28.js.map +1 -0
  30. package/dist/chunks/{eo-loading-step.07d6af2f.js → eo-loading-step.834e0aa3.js} +3 -3
  31. package/dist/chunks/{eo-loading-step.07d6af2f.js.map → eo-loading-step.834e0aa3.js.map} +1 -1
  32. package/dist/chunks/{eo-pagination.44c58ba7.js → eo-pagination.16fd816a.js} +3 -3
  33. package/dist/chunks/eo-pagination.16fd816a.js.map +1 -0
  34. package/dist/chunks/{main.c8ba23c8.js → main.6bd0f564.js} +2 -2
  35. package/dist/chunks/main.6bd0f564.js.map +1 -0
  36. package/dist/examples.json +3 -3
  37. package/dist/index.1eab27f7.js +2 -0
  38. package/dist/index.1eab27f7.js.map +1 -0
  39. package/dist/manifest.json +57 -57
  40. package/dist/types.json +62 -62
  41. package/dist-types/info-card-item/index.d.ts +5 -6
  42. package/dist-types/jsx.d.ts +49 -0
  43. package/dist-types/loading-step/index.d.ts +2 -3
  44. package/dist-types/pagination/index.d.ts +8 -8
  45. package/package.json +5 -3
  46. package/dist/chunks/948.bcad3ed3.js +0 -3
  47. package/dist/chunks/948.bcad3ed3.js.map +0 -1
  48. package/dist/chunks/eo-info-card-item.9bc3b172.js.map +0 -1
  49. package/dist/chunks/eo-pagination.44c58ba7.js.map +0 -1
  50. package/dist/chunks/main.c8ba23c8.js.map +0 -1
  51. package/dist/index.b4970d2b.js +0 -2
  52. package/dist/index.b4970d2b.js.map +0 -1
  53. /package/dist/chunks/{948.bcad3ed3.js.LICENSE.txt → 948.817a1ef0.js.LICENSE.txt} +0 -0
  54. /package/dist/chunks/{code-wrapper.43c8bd5f.js.LICENSE.txt → code-wrapper.40655769.js.LICENSE.txt} +0 -0
  55. /package/dist/chunks/{eo-card-item.eb94d440.js.LICENSE.txt → eo-card-item.fbff6f7e.js.LICENSE.txt} +0 -0
  56. /package/dist/chunks/{eo-descriptions.180f1004.js.LICENSE.txt → eo-descriptions.b8320ca9.js.LICENSE.txt} +0 -0
  57. /package/dist/chunks/{eo-info-card-item.9bc3b172.js.LICENSE.txt → eo-info-card-item.0d15cb28.js.LICENSE.txt} +0 -0
  58. /package/dist/chunks/{eo-loading-step.07d6af2f.js.LICENSE.txt → eo-loading-step.834e0aa3.js.LICENSE.txt} +0 -0
  59. /package/dist/chunks/{eo-pagination.44c58ba7.js.LICENSE.txt → eo-pagination.16fd816a.js.LICENSE.txt} +0 -0
package/dist/bricks.json CHANGED
@@ -11,8 +11,8 @@
11
11
  "elements": [
12
12
  "eo-descriptions",
13
13
  "eo-alert",
14
- "eo-pagination",
15
14
  "eo-code-display",
15
+ "eo-pagination",
16
16
  "eo-card-item",
17
17
  "eo-divider",
18
18
  "eo-info-card-item",
@@ -40,10 +40,6 @@
40
40
  "presentational.general-alert": [
41
41
  "eo-icon"
42
42
  ],
43
- "eo-pagination": [
44
- "eo-icon",
45
- "eo-dropdown-actions"
46
- ],
47
43
  "eo-code-display": [
48
44
  "eo-icon",
49
45
  "basic.copy-to-clipboard",
@@ -54,6 +50,10 @@
54
50
  "basic.copy-to-clipboard",
55
51
  "basic.show-notification"
56
52
  ],
53
+ "eo-pagination": [
54
+ "eo-icon",
55
+ "eo-dropdown-actions"
56
+ ],
57
57
  "eo-card-item": [
58
58
  "eo-link",
59
59
  "eo-icon",
@@ -92,5 +92,5 @@
92
92
  "basic.copy-to-clipboard"
93
93
  ]
94
94
  },
95
- "filePath": "bricks/presentational/dist/index.b4970d2b.js"
95
+ "filePath": "bricks/presentational/dist/index.1eab27f7.js"
96
96
  }
@@ -1,2 +1,2 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_presentational=globalThis.webpackChunk_next_bricks_presentational||[]).push([[3171,5552],{75552:(n,e,t)=>{t.r(e),t.d(e,{i18n:()=>p,i18nText:()=>l,initializeI18n:()=>u});var i=t(75630),s=t(52616),r=t(848);let a=!1;const o=new Set;function u(n,e){if(a||(a=!0,s.i18n.use(r.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),n&&e&&!o.has(n)){o.add(n);for(const[t,i]of Object.entries(e))s.i18n.addResourceBundle(t,n,i)}}var c=t(77019);function l(n){var e;if(!n)return;const t=null!==(e=s.i18n.language)&&void 0!==e?e:"zh-CN";if((0,c.hasOwnProperty)(n,t))return n[t];const i=t.split("-")[0];if(i!==t)return(0,c.hasOwnProperty)(n,i)?n[i]:void 0;const r=`${i}-`;for(const e of Object.keys(n))if(e.startsWith(r))return n[e]}const p=i.default}}]);
2
- //# sourceMappingURL=3171.080badce.js.map
1
+ "use strict";(globalThis.webpackChunk_next_bricks_presentational=globalThis.webpackChunk_next_bricks_presentational||[]).push([[3171,5552],{75552:(n,e,t)=>{t.r(e),t.d(e,{i18n:()=>p,i18nText:()=>l,initializeI18n:()=>u});var i=t(75630),s=t(67177),r=t(848);let a=!1;const o=new Set;function u(n,e){if(a||(a=!0,s.i18n.use(r.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),n&&e&&!o.has(n)){o.add(n);for(const[t,i]of Object.entries(e))s.i18n.addResourceBundle(t,n,i)}}var c=t(40410);function l(n){var e;if(!n)return;const t=null!==(e=s.i18n.language)&&void 0!==e?e:"zh-CN";if((0,c.hasOwnProperty)(n,t))return n[t];const i=t.split("-")[0];if(i!==t)return(0,c.hasOwnProperty)(n,i)?n[i]:void 0;const r=`${i}-`;for(const e of Object.keys(n))if(e.startsWith(r))return n[e]}const p=i.default}}]);
2
+ //# sourceMappingURL=3171.3bb3ff80.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/5552.42e6f90b.js","mappings":"8PAEA,IAAIA,GAAc,EAClB,MAAMC,EAAwB,IAAIC,IAC3B,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAAjD,CAGAH,EAAsBmB,IAAIhB,GAC1B,IAAK,MAAOiB,EAAMH,KAAcI,OAAOC,QAAQlB,GAC7C,EAAAC,KAAKkB,kBAAkBH,EAAMjB,EAAIc,EAHnC,CAKF,C,eCjCO,SAASO,EAASC,GACvB,IAAIC,EACJ,IAAKD,EACH,OAEF,MAAME,EAAgD,QAApCD,EAAiB,EAAArB,KAAKsB,gBAAyC,IAAnBD,EAA4BA,EAAiB,QAE3G,IAAI,IAAAE,gBAAeH,EAAME,GACvB,OAAOF,EAAKE,GAGd,MAAME,EAAkBF,EAASG,MAAM,KAAK,GAC5C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeH,EAAMI,GAAmBJ,EAAKI,QAAmBE,EAKzE,MAAMC,EAAS,GAAGH,KAClB,IAAK,MAAMI,KAAOZ,OAAOa,KAAKT,GAC5B,GAAIQ,EAAIE,WAAWH,GACjB,OAAOP,EAAKQ,EAGlB,CC3BO,MAAM5B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nlet initialized = false;\nconst initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (const [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n var _i18n$language;\n if (!data) {\n return;\n }\n const language = (_i18n$language = i18n.language) !== null && _i18n$language !== void 0 ? _i18n$language : \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n const primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n const prefix = `${primaryLanguage}-`;\n for (const key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport const i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","add","lang","Object","entries","addResourceBundle","i18nText","data","_i18n$language","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","key","keys","startsWith"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/3171.3bb3ff80.js","mappings":"8PAEA,IAAIA,GAAc,EAClB,MAAMC,EAAwB,IAAIC,IAC3B,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAAjD,CAGAH,EAAsBmB,IAAIhB,GAC1B,IAAK,MAAOiB,EAAMH,KAAcI,OAAOC,QAAQlB,GAC7C,EAAAC,KAAKkB,kBAAkBH,EAAMjB,EAAIc,EAHnC,CAKF,C,eCjCO,SAASO,EAASC,GACvB,IAAIC,EACJ,IAAKD,EACH,OAEF,MAAME,EAAgD,QAApCD,EAAiB,EAAArB,KAAKsB,gBAAyC,IAAnBD,EAA4BA,EAAiB,QAE3G,IAAI,IAAAE,gBAAeH,EAAME,GACvB,OAAOF,EAAKE,GAGd,MAAME,EAAkBF,EAASG,MAAM,KAAK,GAC5C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeH,EAAMI,GAAmBJ,EAAKI,QAAmBE,EAKzE,MAAMC,EAAS,GAAGH,KAClB,IAAK,MAAMI,KAAOZ,OAAOa,KAAKT,GAC5B,GAAIQ,EAAIE,WAAWH,GACjB,OAAOP,EAAKQ,EAGlB,CC3BO,MAAM5B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nlet initialized = false;\nconst initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (const [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n var _i18n$language;\n if (!data) {\n return;\n }\n const language = (_i18n$language = i18n.language) !== null && _i18n$language !== void 0 ? _i18n$language : \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n const primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n const prefix = `${primaryLanguage}-`;\n for (const key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport const i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","add","lang","Object","entries","addResourceBundle","i18nText","data","_i18n$language","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","key","keys","startsWith"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_presentational=globalThis.webpackChunk_next_bricks_presentational||[]).push([[4765,7146],{97146:(e,t,r)=>{function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(n,s){if("string"==typeof t?n.name===t:t.includes(n.name)){const t=[];for(let i=1;i<=r;i++){const r=s[s.length-i];if("MemberExpression"===(null==r?void 0:r.node.type)&&"object"===r.key){const s=r.node;s.computed||"Identifier"!==s.property.type?s.computed&&"Literal"===s.property.type&&"string"==typeof s.property.value?t.push(o?`${n.name}.${s.property.value}`:s.property.value):e.hasNonStaticUsage=!0:t.push(o?`${n.name}.${s.property.name}`:s.property.name)}else e.hasNonStaticUsage=!0}t.length===r&&e.usedProperties.add(t.join("."))}}}function n(e,t){return function(r,o,n){if(o.name===e){const e=n[n.length-1],o=n[n.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==e?void 0:e.node.type)&&"object"===e.key&&(e.node.computed?"Literal"===e.node.property.type&&e.node.property.value===t:"Identifier"===e.node.property.type&&e.node.property.name===t)){const e=o.node.arguments;if(e.length>0){const t=e[0];"Literal"===t.type&&"string"==typeof t.value?r.usedArgs.add(t.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>o,collectAppGetMenuUsage:()=>s,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>b,createProviderClass:()=>c.createProviderClass,replaceUseChildren:()=>x,scanPermissionActionsInAny:()=>A,scanPermissionActionsInStoryboard:()=>m,strictCollectMemberUsage:()=>u,track:()=>f,trackAll:()=>y,traverseStoryboardExpressions:()=>l,traverseStoryboardFunction:()=>g,traverseStoryboardFunctions:()=>h,unwrapProvider:()=>c.unwrapProvider});const s=n("APP","getMenu"),i=n("INSTALLED_APPS","has");var a=r(71321),c=r(77019);function l(e,t,r){const o=new WeakSet,{matchExpressionString:n,visitNotMatchedExpressionString:s,visitNonExpressionString:i,visitObject:l}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,a.isEvaluable)(r))if(n(r))try{(0,a.preevaluate)(r,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,o){t(e,o,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==s||s(r);else null==i||i(r);else if((0,c.isObject)(r)){if(o.has(r))return;o.add(r),null==l||l(r);for(const t of Array.isArray(r)?r:Object.values(r))e(t)}}(e)}function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{hasNonStaticUsage:o,nonStaticUsage:n,usedProperties:s}=p(e,t,r);if(o)throw new Error(`Non-static usage of ${t} is prohibited, check your expression: "${n}"`);return s}function p(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n={usedProperties:new Set,hasNonStaticUsage:!1},s=o(n,t,r);return l(e,((e,t,r)=>{s(e,t),n.hasNonStaticUsage&&(n.nonStaticUsage=r)}),t),n}const d=["CTX","STATE","FORM_STATE"];function f(e,t,r){if(e.includes(t)){const n={usedProperties:new Set,hasNonStaticUsage:!1},{expression:s}=(0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:o(n,r)}});let i;if("SequenceExpression"===s.type&&(i=s.expressions[0])&&"Literal"===i.type&&i.value===t){if(n.usedProperties.size>0)return n.usedProperties;console.warn(`You are using "${t}" but no \`${r}\` usage found in your expression: ${JSON.stringify(e)}`)}}return!1}function y(e){if(d.some((t=>e.includes(t)))){const t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:o(t,d,1,!0)}}),t.usedProperties.size>0){const e=[...t.usedProperties],r={context:!1,state:!1,formState:!1},o={CTX:"context",STATE:"state",FORM_STATE:"formState"};return e.forEach((e=>{const[t,n]=e.split(".");r[o[t]]||(r[o[t]]=[]),r[o[t]].push(n)})),r}console.warn(`You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: ${JSON.stringify(e)}`)}return!1}function h(e,t,r){if(Array.isArray(e))for(const o of e)null!=r&&r.matchSource&&!r.matchSource(o.source)||g(o,t)}function g(e,t,r){try{(0,a.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t},cacheKey:e})}catch(t){r||console.error(`Parse storyboard function "${e.name}" failed:`,t)}}function b(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const s={usedProperties:new Set,hasNonStaticUsage:!1};if(e.source.includes(t)&&g(e,o(s,t,n),r),s.hasNonStaticUsage&&!r)throw new Error(`Non-static usage of ${t} is prohibited, check your function: "${e.name}"`);return s.usedProperties.delete(e.name),s.usedProperties}const S="PERMISSIONS",v="check";function m(e){var t;const r=new Set,o=P(r),{customTemplates:n,functions:s}=null!==(t=e.meta)&&void 0!==t?t:{};return l([e.routes,n],o,S),h(s,o,{matchSource:e=>e.includes(S)}),Array.from(r)}function A(e){const t=new Set;return l(e,P(t),S),Array.from(t)}function P(e){return function(t,r){if(t.name===S){const t=r[r.length-1],o=r[r.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==t?void 0:t.node.type)&&"object"===t.key&&(t.node.computed?"Literal"===t.node.property.type&&t.node.property.value===v:"Identifier"===t.node.property.type&&t.node.property.name===v))for(const t of o.node.arguments)"Literal"===t.type&&"string"==typeof t.value&&e.add(t.value)}}}var k=r(20563);const{pull:w}=k,E=/^\[\w+\]$/;function x(e){if(Array.isArray(e))for(const t of e)T(t);else T(e)}function T(e){let t=e.slots;const r=new Map;if(Array.isArray(e.children)&&!t){const t=[];for(const n of e.children){var o;const e=null!==(o=n.slot)&&void 0!==o?o:"";if(E.test(e)){delete n.slot;const o=r.get(e);o?o.push(n):r.set(e,[n]),t.push(n)}T(n)}w(e.children,...t)}else{null!=t||(t={});for(const[e,o]of Object.entries(t)){if(E.test(e)){const{bricks:n}=o;Array.isArray(n)&&n.length>0&&(r.set(e,n),x(n)),delete t[e]}Array.isArray(o.bricks)&&x(o.bricks)}}r.size>0&&N(e.properties,r)}function N(e,t){if(Array.isArray(e))for(const r of e)N(r,t);else if((0,c.isObject)(e))for(const[r,o]of Object.entries(e))if("useChildren"===r){const n=t.get(o);n&&(delete e[r],e.useBrick=1===n.length?n[0]:n)}else N(o,t)}}}]);
2
- //# sourceMappingURL=7146.7f525c72.js.map
1
+ "use strict";(globalThis.webpackChunk_next_bricks_presentational=globalThis.webpackChunk_next_bricks_presentational||[]).push([[4765,7146],{97146:(e,t,r)=>{function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(n,s){if("string"==typeof t?n.name===t:t.includes(n.name)){const t=[];for(let i=1;i<=r;i++){const r=s[s.length-i];if("MemberExpression"===(null==r?void 0:r.node.type)&&"object"===r.key){const s=r.node;s.computed||"Identifier"!==s.property.type?s.computed&&"Literal"===s.property.type&&"string"==typeof s.property.value?t.push(o?`${n.name}.${s.property.value}`:s.property.value):e.hasNonStaticUsage=!0:t.push(o?`${n.name}.${s.property.name}`:s.property.name)}else e.hasNonStaticUsage=!0}t.length===r&&e.usedProperties.add(t.join("."))}}}function n(e,t){return function(r,o,n){if(o.name===e){const e=n[n.length-1],o=n[n.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==e?void 0:e.node.type)&&"object"===e.key&&(e.node.computed?"Literal"===e.node.property.type&&e.node.property.value===t:"Identifier"===e.node.property.type&&e.node.property.name===t)){const e=o.node.arguments;if(e.length>0){const t=e[0];"Literal"===t.type&&"string"==typeof t.value?r.usedArgs.add(t.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>o,collectAppGetMenuUsage:()=>s,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>b,createProviderClass:()=>c.createProviderClass,replaceUseChildren:()=>x,scanPermissionActionsInAny:()=>A,scanPermissionActionsInStoryboard:()=>m,strictCollectMemberUsage:()=>u,track:()=>f,trackAll:()=>y,traverseStoryboardExpressions:()=>l,traverseStoryboardFunction:()=>g,traverseStoryboardFunctions:()=>h,unwrapProvider:()=>c.unwrapProvider});const s=n("APP","getMenu"),i=n("INSTALLED_APPS","has");var a=r(71321),c=r(40410);function l(e,t,r){const o=new WeakSet,{matchExpressionString:n,visitNotMatchedExpressionString:s,visitNonExpressionString:i,visitObject:l}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,a.isEvaluable)(r))if(n(r))try{(0,a.preevaluate)(r,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,o){t(e,o,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==s||s(r);else null==i||i(r);else if((0,c.isObject)(r)){if(o.has(r))return;o.add(r),null==l||l(r);for(const t of Array.isArray(r)?r:Object.values(r))e(t)}}(e)}function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{hasNonStaticUsage:o,nonStaticUsage:n,usedProperties:s}=p(e,t,r);if(o)throw new Error(`Non-static usage of ${t} is prohibited, check your expression: "${n}"`);return s}function p(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n={usedProperties:new Set,hasNonStaticUsage:!1},s=o(n,t,r);return l(e,((e,t,r)=>{s(e,t),n.hasNonStaticUsage&&(n.nonStaticUsage=r)}),t),n}const d=["CTX","STATE","FORM_STATE"];function f(e,t,r){if(e.includes(t)){const n={usedProperties:new Set,hasNonStaticUsage:!1},{expression:s}=(0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:o(n,r)}});let i;if("SequenceExpression"===s.type&&(i=s.expressions[0])&&"Literal"===i.type&&i.value===t){if(n.usedProperties.size>0)return n.usedProperties;console.warn(`You are using "${t}" but no \`${r}\` usage found in your expression: ${JSON.stringify(e)}`)}}return!1}function y(e){if(d.some((t=>e.includes(t)))){const t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:o(t,d,1,!0)}}),t.usedProperties.size>0){const e=[...t.usedProperties],r={context:!1,state:!1,formState:!1},o={CTX:"context",STATE:"state",FORM_STATE:"formState"};return e.forEach((e=>{const[t,n]=e.split(".");r[o[t]]||(r[o[t]]=[]),r[o[t]].push(n)})),r}console.warn(`You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: ${JSON.stringify(e)}`)}return!1}function h(e,t,r){if(Array.isArray(e))for(const o of e)null!=r&&r.matchSource&&!r.matchSource(o.source)||g(o,t)}function g(e,t,r){try{(0,a.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t},cacheKey:e})}catch(t){r||console.error(`Parse storyboard function "${e.name}" failed:`,t)}}function b(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const s={usedProperties:new Set,hasNonStaticUsage:!1};if(e.source.includes(t)&&g(e,o(s,t,n),r),s.hasNonStaticUsage&&!r)throw new Error(`Non-static usage of ${t} is prohibited, check your function: "${e.name}"`);return s.usedProperties.delete(e.name),s.usedProperties}const S="PERMISSIONS",v="check";function m(e){var t;const r=new Set,o=P(r),{customTemplates:n,functions:s}=null!==(t=e.meta)&&void 0!==t?t:{};return l([e.routes,n],o,S),h(s,o,{matchSource:e=>e.includes(S)}),Array.from(r)}function A(e){const t=new Set;return l(e,P(t),S),Array.from(t)}function P(e){return function(t,r){if(t.name===S){const t=r[r.length-1],o=r[r.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==t?void 0:t.node.type)&&"object"===t.key&&(t.node.computed?"Literal"===t.node.property.type&&t.node.property.value===v:"Identifier"===t.node.property.type&&t.node.property.name===v))for(const t of o.node.arguments)"Literal"===t.type&&"string"==typeof t.value&&e.add(t.value)}}}var k=r(20563);const{pull:w}=k,E=/^\[\w+\]$/;function x(e){if(Array.isArray(e))for(const t of e)T(t);else T(e)}function T(e){let t=e.slots;const r=new Map;if(Array.isArray(e.children)&&!t){const t=[];for(const n of e.children){var o;const e=null!==(o=n.slot)&&void 0!==o?o:"";if(E.test(e)){delete n.slot;const o=r.get(e);o?o.push(n):r.set(e,[n]),t.push(n)}T(n)}w(e.children,...t)}else{null!=t||(t={});for(const[e,o]of Object.entries(t)){if(E.test(e)){const{bricks:n}=o;Array.isArray(n)&&n.length>0&&(r.set(e,n),x(n)),delete t[e]}Array.isArray(o.bricks)&&x(o.bricks)}}r.size>0&&N(e.properties,r)}function N(e,t){if(Array.isArray(e))for(const r of e)N(r,t);else if((0,c.isObject)(e))for(const[r,o]of Object.entries(e))if("useChildren"===r){const n=t.get(o);n&&(delete e[r],e.useBrick=1===n.length?n[0]:n)}else N(o,t)}}}]);
2
+ //# sourceMappingURL=4765.653a09de.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/7146.7f525c72.js","mappings":"4JAAO,SAASA,EAAwBC,EAAOC,GAC7C,IAAIC,EAAQC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,EAC5EG,EAAqBH,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,IAAmBA,UAAU,GACxF,OAAO,SAA2BI,EAAMC,GACtC,GAA0B,iBAAfP,EAA0BM,EAAKE,OAASR,EAAaA,EAAWS,SAASH,EAAKE,MAAO,CAC9F,MAAME,EAAW,GACjB,IAAK,IAAIC,EAAI,EAAGA,GAAKV,EAAOU,IAAK,CAC/B,MAAMC,EAAeL,EAAOA,EAAOJ,OAASQ,GAC5C,GAA6F,sBAAxFC,aAAmD,EAASA,EAAaN,KAAKO,OAAqD,WAArBD,EAAaE,IAAkB,CAChJ,MAAMC,EAAaH,EAAaN,KAC3BS,EAAWC,UAAyC,eAA7BD,EAAWE,SAASJ,KAErCE,EAAWC,UAAyC,YAA7BD,EAAWE,SAASJ,MAA2D,iBAA9BE,EAAWE,SAASC,MACrGR,EAASS,KAAKd,EAAqB,GAAGC,EAAKE,QAAQO,EAAWE,SAASC,QAAUH,EAAWE,SAASC,OAErGnB,EAAMqB,mBAAoB,EAJ1BV,EAASS,KAAKd,EAAqB,GAAGC,EAAKE,QAAQO,EAAWE,SAAST,OAASO,EAAWE,SAAST,KAMxG,MACET,EAAMqB,mBAAoB,CAE9B,CACIV,EAASP,SAAWF,GACtBF,EAAMsB,eAAeC,IAAIZ,EAASa,KAAK,KAE3C,CACF,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Q,CAAC,GACtD,IAAK,MAAOO,EAAMI,KAAa3E,OAAO4E,QAAQZ,GAAQ,CACpD,GAAIL,EAAyBa,KAAKD,GAAO,CACvC,MACEM,OAAQV,GACNQ,EACA7E,MAAMC,QAAQoE,IAAaA,EAASxH,OAAS,IAC/CsH,EAAeS,IAAIH,EAAMJ,GACzBP,EAAmBO,WAEdH,EAAMO,EACf,CACIzE,MAAMC,QAAQ4E,EAASE,SACzBjB,EAAmBe,EAASE,OAEhC,CACF,CACIZ,EAAejD,KAAO,GACxB8D,EAAoBhB,EAAMiB,WAAYd,EAE1C,CACA,SAASa,EAAoBpH,EAAOuG,GAClC,GAAInE,MAAMC,QAAQrC,GAChB,IAAK,MAAMmC,KAAQnC,EACjBoH,EAAoBjF,EAAMoE,QAEvB,IAAI,IAAAtE,UAASjC,GAClB,IAAK,MAAOsH,EAAG9F,KAAMc,OAAO4E,QAAQlH,GAClC,GAAU,gBAANsH,EAAqB,CACvB,MAAMb,EAAWF,EAAeQ,IAAIvF,GAChCiF,WACKzG,EAAMsH,GACbtH,EAAMuH,SAA+B,IAApBd,EAASxH,OAAewH,EAAS,GAAKA,EAE3D,MACEW,EAAoB5F,EAAG+E,EAI/B,C","sources":["webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/beforeVisitGlobalMember.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberCallUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/track.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/collectMemberUsageInFunction.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/permissions.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/replaceUseChildren.js"],"sourcesContent":["export function beforeVisitGlobalMember(usage, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n let rememberObjectName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return function beforeVisitGlobal(node, parent) {\n if (typeof objectName === \"string\" ? node.name === objectName : objectName.includes(node.name)) {\n const segments = [];\n for (let i = 1; i <= level; i++) {\n const memberParent = parent[parent.length - i];\n if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\") {\n const memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.name}` : memberNode.property.name);\n } else if (memberNode.computed && memberNode.property.type === \"Literal\" && typeof memberNode.property.value === \"string\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.value}` : memberNode.property.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n if (segments.length === level) {\n usage.usedProperties.add(segments.join(\".\"));\n }\n }\n };\n}\n//# sourceMappingURL=beforeVisitGlobalMember.js.map","function collectMemberCallUsageFactory(object, property) {\n return function collectMemberCallUsage(usage, node, parent) {\n if (node.name === object) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === property : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === property)) {\n const args = callParent.node.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n if (firstArg.type === \"Literal\" && typeof firstArg.value === \"string\") {\n usage.usedArgs.add(firstArg.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n }\n }\n };\n}\nexport const collectAppGetMenuUsage = collectMemberCallUsageFactory(\"APP\", \"getMenu\");\nexport const collectInstalledAppsHasUsage = collectMemberCallUsageFactory(\"INSTALLED_APPS\", \"has\");\n//# sourceMappingURL=collectMemberCallUsage.js.map","import { isEvaluable, preevaluate } from \"@next-core/cook\";\nimport { isObject } from \"@next-core/utils/general\";\nexport function traverseStoryboardExpressions(data, beforeVisitGlobal,\n// If `options` is a string, it means the *keyword*.\noptions) {\n const memo = new WeakSet();\n const {\n matchExpressionString,\n visitNotMatchedExpressionString,\n visitNonExpressionString,\n visitObject\n } = typeof options === \"string\" ? {\n matchExpressionString: v => v.includes(options)\n } : options;\n function traverse(value) {\n if (typeof value === \"string\") {\n if (isEvaluable(value)) {\n if (matchExpressionString(value)) {\n try {\n preevaluate(value, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal(node, parent) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n beforeVisitGlobal(node, parent, value);\n }\n }\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNotMatchedExpressionString === null || visitNotMatchedExpressionString === void 0 || visitNotMatchedExpressionString(value);\n }\n } else {\n visitNonExpressionString === null || visitNonExpressionString === void 0 || visitNonExpressionString(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject === null || visitObject === void 0 || visitObject(value);\n for (const item of Array.isArray(value) ? value : Object.values(value)) {\n traverse(item);\n }\n }\n }\n traverse(data);\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nimport { traverseStoryboardExpressions } from \"./traverse.js\";\nexport function strictCollectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const {\n hasNonStaticUsage,\n nonStaticUsage,\n usedProperties\n } = collectMemberUsage(data, objectName, level);\n if (hasNonStaticUsage) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your expression: \"${nonStaticUsage}\"`);\n }\n return usedProperties;\n}\nexport function collectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const beforeVisitGlobal = beforeVisitGlobalMember(usage, objectName, level);\n traverseStoryboardExpressions(data, (node, parent, expr) => {\n beforeVisitGlobal(node, parent);\n if (usage.hasNonStaticUsage) {\n usage.nonStaticUsage = expr;\n }\n }, objectName);\n return usage;\n}\n//# sourceMappingURL=collectMemberUsage.js.map","import { preevaluate } from \"@next-core/cook\";\nimport { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nconst TRACK_NAMES = [\"CTX\", \"STATE\", \"FORM_STATE\"];\nexport function track(raw, trackText, variableName) {\n if (raw.includes(trackText)) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const {\n expression\n } = preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, variableName)\n }\n });\n let trackCtxExp;\n if (expression.type === \"SequenceExpression\" && (trackCtxExp = expression.expressions[0]) && trackCtxExp.type === \"Literal\" && trackCtxExp.value === trackText) {\n if (usage.usedProperties.size > 0) {\n return usage.usedProperties;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using \"${trackText}\" but no \\`${variableName}\\` usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n }\n return false;\n}\nexport function trackAll(raw) {\n // Do not pre-evaluate a string if it doesn't include track names.\n if (TRACK_NAMES.some(name => raw.includes(name))) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, TRACK_NAMES, 1, true)\n }\n });\n if (usage.usedProperties.size > 0) {\n const usedProperties = [...usage.usedProperties];\n const result = {\n context: false,\n state: false,\n formState: false\n };\n const keyMap = {\n CTX: \"context\",\n STATE: \"state\",\n FORM_STATE: \"formState\"\n };\n usedProperties.forEach(item => {\n const [key, name] = item.split(\".\");\n if (!result[keyMap[key]]) {\n result[keyMap[key]] = [];\n }\n result[keyMap[key]].push(name);\n });\n return result;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using track all but no \"CTX\" or \"STATE\" or \"FORM_STATE\" usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n return false;\n}\n//# sourceMappingURL=track.js.map","import { precookFunction } from \"@next-core/cook\";\nexport function traverseStoryboardFunctions(functions, beforeVisitGlobal, options) {\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n if (!(options !== null && options !== void 0 && options.matchSource) || options.matchSource(fn.source)) {\n traverseStoryboardFunction(fn, beforeVisitGlobal);\n }\n }\n }\n}\nexport function traverseStoryboardFunction(fn, beforeVisitGlobal, silentErrors) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: {\n beforeVisitGlobal\n },\n cacheKey: fn\n });\n } catch (error) {\n if (!silentErrors) {\n // eslint-disable-next-line no-console\n console.error(`Parse storyboard function \"${fn.name}\" failed:`, error);\n }\n }\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"../expressions/beforeVisitGlobalMember.js\";\nimport { traverseStoryboardFunction } from \"./traverse.js\";\nexport function collectMemberUsageInFunction(fn, objectName, silentErrors) {\n let level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n if (fn.source.includes(objectName)) {\n traverseStoryboardFunction(fn, beforeVisitGlobalMember(usage, objectName, level), silentErrors);\n }\n if (usage.hasNonStaticUsage && !silentErrors) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your function: \"${fn.name}\"`);\n }\n usage.usedProperties.delete(fn.name);\n return usage.usedProperties;\n}\n//# sourceMappingURL=collectMemberUsageInFunction.js.map","import { traverseStoryboardExpressions } from \"./expressions/index.js\";\nimport { traverseStoryboardFunctions } from \"./functions/index.js\";\nconst PERMISSIONS = \"PERMISSIONS\";\nconst check = \"check\";\nexport function scanPermissionActionsInStoryboard(storyboard) {\n var _storyboard$meta;\n const collection = new Set();\n const beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n const {\n customTemplates,\n functions\n } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};\n traverseStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, PERMISSIONS);\n traverseStoryboardFunctions(functions, beforeVisitPermissions, {\n matchSource(source) {\n return source.includes(PERMISSIONS);\n }\n });\n return Array.from(collection);\n}\nexport function scanPermissionActionsInAny(data) {\n const collection = new Set();\n traverseStoryboardExpressions(data, beforeVisitPermissionsFactory(collection), PERMISSIONS);\n return Array.from(collection);\n}\nfunction beforeVisitPermissionsFactory(collection) {\n return function beforeVisitPermissions(node, parent) {\n if (node.name === PERMISSIONS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === check : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === check)) {\n for (const arg of callParent.node.arguments) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n//# sourceMappingURL=permissions.js.map","import { isObject } from \"@next-core/utils/general\";\nimport lodash from \"lodash\";\nconst {\n pull\n} = lodash;\nconst USE_CHILDREN_SLOT_REGEXP = /^\\[\\w+\\]$/;\n\n/**\n * Replace `useChildren: \"[xxx]\"` with `useBrick`.\n *\n * This will mutate the input.\n */\nexport function replaceUseChildren(input) {\n if (Array.isArray(input)) {\n for (const brick of input) {\n replaceInBrick(brick);\n }\n } else {\n replaceInBrick(input);\n }\n}\nfunction replaceInBrick(brick) {\n let slots = brick.slots;\n const useChildrenMap = new Map();\n if (Array.isArray(brick.children) && !slots) {\n const removeBricks = [];\n for (const child of brick.children) {\n var _child$slot;\n const slot = (_child$slot = child.slot) !== null && _child$slot !== void 0 ? _child$slot : \"\";\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n delete child.slot;\n const children = useChildrenMap.get(slot);\n if (children) {\n children.push(child);\n } else {\n useChildrenMap.set(slot, [child]);\n }\n removeBricks.push(child);\n }\n replaceInBrick(child);\n }\n pull(brick.children, ...removeBricks);\n } else {\n slots !== null && slots !== void 0 ? slots : slots = {};\n for (const [slot, slotConf] of Object.entries(slots)) {\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n const {\n bricks: children\n } = slotConf;\n if (Array.isArray(children) && children.length > 0) {\n useChildrenMap.set(slot, children);\n replaceUseChildren(children);\n }\n delete slots[slot];\n }\n if (Array.isArray(slotConf.bricks)) {\n replaceUseChildren(slotConf.bricks);\n }\n }\n }\n if (useChildrenMap.size > 0) {\n replaceInProperties(brick.properties, useChildrenMap);\n }\n}\nfunction replaceInProperties(value, useChildrenMap) {\n if (Array.isArray(value)) {\n for (const item of value) {\n replaceInProperties(item, useChildrenMap);\n }\n } else if (isObject(value)) {\n for (const [k, v] of Object.entries(value)) {\n if (k === \"useChildren\") {\n const children = useChildrenMap.get(v);\n if (children) {\n delete value[k];\n value.useBrick = children.length === 1 ? children[0] : children;\n }\n } else {\n replaceInProperties(v, useChildrenMap);\n }\n }\n }\n}\n//# sourceMappingURL=replaceUseChildren.js.map"],"names":["beforeVisitGlobalMember","usage","objectName","level","arguments","length","undefined","rememberObjectName","node","parent","name","includes","segments","i","memberParent","type","key","memberNode","computed","property","value","push","hasNonStaticUsage","usedProperties","add","join","collectMemberCallUsageFactory","object","callParent","args","firstArg","usedArgs","collectAppGetMenuUsage","collectInstalledAppsHasUsage","traverseStoryboardExpressions","data","beforeVisitGlobal","options","memo","WeakSet","matchExpressionString","visitNotMatchedExpressionString","visitNonExpressionString","visitObject","v","traverse","isEvaluable","preevaluate","cache","withParent","hooks","error","console","isObject","has","item","Array","isArray","Object","values","strictCollectMemberUsage","nonStaticUsage","collectMemberUsage","Error","Set","expr","TRACK_NAMES","track","raw","trackText","variableName","expression","trackCtxExp","expressions","size","warn","JSON","stringify","trackAll","some","result","context","state","formState","keyMap","CTX","STATE","FORM_STATE","forEach","split","traverseStoryboardFunctions","functions","fn","matchSource","source","traverseStoryboardFunction","silentErrors","precookFunction","typescript","cacheKey","collectMemberUsageInFunction","delete","PERMISSIONS","check","scanPermissionActionsInStoryboard","storyboard","_storyboard$meta","collection","beforeVisitPermissions","beforeVisitPermissionsFactory","customTemplates","meta","routes","from","scanPermissionActionsInAny","arg","pull","USE_CHILDREN_SLOT_REGEXP","replaceUseChildren","input","brick","replaceInBrick","slots","useChildrenMap","Map","children","removeBricks","child","_child$slot","slot","test","get","set","slotConf","entries","bricks","replaceInProperties","properties","k","useBrick"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/4765.653a09de.js","mappings":"4JAAO,SAASA,EAAwBC,EAAOC,GAC7C,IAAIC,EAAQC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,EAC5EG,EAAqBH,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,IAAmBA,UAAU,GACxF,OAAO,SAA2BI,EAAMC,GACtC,GAA0B,iBAAfP,EAA0BM,EAAKE,OAASR,EAAaA,EAAWS,SAASH,EAAKE,MAAO,CAC9F,MAAME,EAAW,GACjB,IAAK,IAAIC,EAAI,EAAGA,GAAKV,EAAOU,IAAK,CAC/B,MAAMC,EAAeL,EAAOA,EAAOJ,OAASQ,GAC5C,GAA6F,sBAAxFC,aAAmD,EAASA,EAAaN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I/B,C","sources":["webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/beforeVisitGlobalMember.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberCallUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/track.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/collectMemberUsageInFunction.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/permissions.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/replaceUseChildren.js"],"sourcesContent":["export function beforeVisitGlobalMember(usage, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n let rememberObjectName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return function beforeVisitGlobal(node, parent) {\n if (typeof objectName === \"string\" ? node.name === objectName : objectName.includes(node.name)) {\n const segments = [];\n for (let i = 1; i <= level; i++) {\n const memberParent = parent[parent.length - i];\n if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\") {\n const memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.name}` : memberNode.property.name);\n } else if (memberNode.computed && memberNode.property.type === \"Literal\" && typeof memberNode.property.value === \"string\") {\n segments.push(rememberObjectName ? `${node.name}.${memberNode.property.value}` : memberNode.property.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n if (segments.length === level) {\n usage.usedProperties.add(segments.join(\".\"));\n }\n }\n };\n}\n//# sourceMappingURL=beforeVisitGlobalMember.js.map","function collectMemberCallUsageFactory(object, property) {\n return function collectMemberCallUsage(usage, node, parent) {\n if (node.name === object) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === property : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === property)) {\n const args = callParent.node.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n if (firstArg.type === \"Literal\" && typeof firstArg.value === \"string\") {\n usage.usedArgs.add(firstArg.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n }\n }\n };\n}\nexport const collectAppGetMenuUsage = collectMemberCallUsageFactory(\"APP\", \"getMenu\");\nexport const collectInstalledAppsHasUsage = collectMemberCallUsageFactory(\"INSTALLED_APPS\", \"has\");\n//# sourceMappingURL=collectMemberCallUsage.js.map","import { isEvaluable, preevaluate } from \"@next-core/cook\";\nimport { isObject } from \"@next-core/utils/general\";\nexport function traverseStoryboardExpressions(data, beforeVisitGlobal,\n// If `options` is a string, it means the *keyword*.\noptions) {\n const memo = new WeakSet();\n const {\n matchExpressionString,\n visitNotMatchedExpressionString,\n visitNonExpressionString,\n visitObject\n } = typeof options === \"string\" ? {\n matchExpressionString: v => v.includes(options)\n } : options;\n function traverse(value) {\n if (typeof value === \"string\") {\n if (isEvaluable(value)) {\n if (matchExpressionString(value)) {\n try {\n preevaluate(value, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal(node, parent) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n beforeVisitGlobal(node, parent, value);\n }\n }\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNotMatchedExpressionString === null || visitNotMatchedExpressionString === void 0 || visitNotMatchedExpressionString(value);\n }\n } else {\n visitNonExpressionString === null || visitNonExpressionString === void 0 || visitNonExpressionString(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject === null || visitObject === void 0 || visitObject(value);\n for (const item of Array.isArray(value) ? value : Object.values(value)) {\n traverse(item);\n }\n }\n }\n traverse(data);\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nimport { traverseStoryboardExpressions } from \"./traverse.js\";\nexport function strictCollectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const {\n hasNonStaticUsage,\n nonStaticUsage,\n usedProperties\n } = collectMemberUsage(data, objectName, level);\n if (hasNonStaticUsage) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your expression: \"${nonStaticUsage}\"`);\n }\n return usedProperties;\n}\nexport function collectMemberUsage(data, objectName) {\n let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const beforeVisitGlobal = beforeVisitGlobalMember(usage, objectName, level);\n traverseStoryboardExpressions(data, (node, parent, expr) => {\n beforeVisitGlobal(node, parent);\n if (usage.hasNonStaticUsage) {\n usage.nonStaticUsage = expr;\n }\n }, objectName);\n return usage;\n}\n//# sourceMappingURL=collectMemberUsage.js.map","import { preevaluate } from \"@next-core/cook\";\nimport { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nconst TRACK_NAMES = [\"CTX\", \"STATE\", \"FORM_STATE\"];\nexport function track(raw, trackText, variableName) {\n if (raw.includes(trackText)) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n const {\n expression\n } = preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, variableName)\n }\n });\n let trackCtxExp;\n if (expression.type === \"SequenceExpression\" && (trackCtxExp = expression.expressions[0]) && trackCtxExp.type === \"Literal\" && trackCtxExp.value === trackText) {\n if (usage.usedProperties.size > 0) {\n return usage.usedProperties;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using \"${trackText}\" but no \\`${variableName}\\` usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n }\n return false;\n}\nexport function trackAll(raw) {\n // Do not pre-evaluate a string if it doesn't include track names.\n if (TRACK_NAMES.some(name => raw.includes(name))) {\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n preevaluate(raw, {\n cache: true,\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, TRACK_NAMES, 1, true)\n }\n });\n if (usage.usedProperties.size > 0) {\n const usedProperties = [...usage.usedProperties];\n const result = {\n context: false,\n state: false,\n formState: false\n };\n const keyMap = {\n CTX: \"context\",\n STATE: \"state\",\n FORM_STATE: \"formState\"\n };\n usedProperties.forEach(item => {\n const [key, name] = item.split(\".\");\n if (!result[keyMap[key]]) {\n result[keyMap[key]] = [];\n }\n result[keyMap[key]].push(name);\n });\n return result;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`You are using track all but no \"CTX\" or \"STATE\" or \"FORM_STATE\" usage found in your expression: ${JSON.stringify(raw)}`);\n }\n }\n return false;\n}\n//# sourceMappingURL=track.js.map","import { precookFunction } from \"@next-core/cook\";\nexport function traverseStoryboardFunctions(functions, beforeVisitGlobal, options) {\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n if (!(options !== null && options !== void 0 && options.matchSource) || options.matchSource(fn.source)) {\n traverseStoryboardFunction(fn, beforeVisitGlobal);\n }\n }\n }\n}\nexport function traverseStoryboardFunction(fn, beforeVisitGlobal, silentErrors) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: {\n beforeVisitGlobal\n },\n cacheKey: fn\n });\n } catch (error) {\n if (!silentErrors) {\n // eslint-disable-next-line no-console\n console.error(`Parse storyboard function \"${fn.name}\" failed:`, error);\n }\n }\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"../expressions/beforeVisitGlobalMember.js\";\nimport { traverseStoryboardFunction } from \"./traverse.js\";\nexport function collectMemberUsageInFunction(fn, objectName, silentErrors) {\n let level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n const usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n if (fn.source.includes(objectName)) {\n traverseStoryboardFunction(fn, beforeVisitGlobalMember(usage, objectName, level), silentErrors);\n }\n if (usage.hasNonStaticUsage && !silentErrors) {\n throw new Error(`Non-static usage of ${objectName} is prohibited, check your function: \"${fn.name}\"`);\n }\n usage.usedProperties.delete(fn.name);\n return usage.usedProperties;\n}\n//# sourceMappingURL=collectMemberUsageInFunction.js.map","import { traverseStoryboardExpressions } from \"./expressions/index.js\";\nimport { traverseStoryboardFunctions } from \"./functions/index.js\";\nconst PERMISSIONS = \"PERMISSIONS\";\nconst check = \"check\";\nexport function scanPermissionActionsInStoryboard(storyboard) {\n var _storyboard$meta;\n const collection = new Set();\n const beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n const {\n customTemplates,\n functions\n } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};\n traverseStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, PERMISSIONS);\n traverseStoryboardFunctions(functions, beforeVisitPermissions, {\n matchSource(source) {\n return source.includes(PERMISSIONS);\n }\n });\n return Array.from(collection);\n}\nexport function scanPermissionActionsInAny(data) {\n const collection = new Set();\n traverseStoryboardExpressions(data, beforeVisitPermissionsFactory(collection), PERMISSIONS);\n return Array.from(collection);\n}\nfunction beforeVisitPermissionsFactory(collection) {\n return function beforeVisitPermissions(node, parent) {\n if (node.name === PERMISSIONS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === check : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === check)) {\n for (const arg of callParent.node.arguments) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n//# sourceMappingURL=permissions.js.map","import { isObject } from \"@next-core/utils/general\";\nimport lodash from \"lodash\";\nconst {\n pull\n} = lodash;\nconst USE_CHILDREN_SLOT_REGEXP = /^\\[\\w+\\]$/;\n\n/**\n * Replace `useChildren: \"[xxx]\"` with `useBrick`.\n *\n * This will mutate the input.\n */\nexport function replaceUseChildren(input) {\n if (Array.isArray(input)) {\n for (const brick of input) {\n replaceInBrick(brick);\n }\n } else {\n replaceInBrick(input);\n }\n}\nfunction replaceInBrick(brick) {\n let slots = brick.slots;\n const useChildrenMap = new Map();\n if (Array.isArray(brick.children) && !slots) {\n const removeBricks = [];\n for (const child of brick.children) {\n var _child$slot;\n const slot = (_child$slot = child.slot) !== null && _child$slot !== void 0 ? _child$slot : \"\";\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n delete child.slot;\n const children = useChildrenMap.get(slot);\n if (children) {\n children.push(child);\n } else {\n useChildrenMap.set(slot, [child]);\n }\n removeBricks.push(child);\n }\n replaceInBrick(child);\n }\n pull(brick.children, ...removeBricks);\n } else {\n slots !== null && slots !== void 0 ? slots : slots = {};\n for (const [slot, slotConf] of Object.entries(slots)) {\n if (USE_CHILDREN_SLOT_REGEXP.test(slot)) {\n const {\n bricks: children\n } = slotConf;\n if (Array.isArray(children) && children.length > 0) {\n useChildrenMap.set(slot, children);\n replaceUseChildren(children);\n }\n delete slots[slot];\n }\n if (Array.isArray(slotConf.bricks)) {\n replaceUseChildren(slotConf.bricks);\n }\n }\n }\n if (useChildrenMap.size > 0) {\n replaceInProperties(brick.properties, useChildrenMap);\n }\n}\nfunction replaceInProperties(value, useChildrenMap) {\n if (Array.isArray(value)) {\n for (const item of value) {\n replaceInProperties(item, useChildrenMap);\n }\n } else if (isObject(value)) {\n for (const [k, v] of Object.entries(value)) {\n if (k === \"useChildren\") {\n const children = useChildrenMap.get(v);\n if (children) {\n delete value[k];\n value.useBrick = children.length === 1 ? children[0] : children;\n }\n } else {\n replaceInProperties(v, useChildrenMap);\n }\n }\n }\n}\n//# sourceMappingURL=replaceUseChildren.js.map"],"names":["beforeVisitGlobalMember","usage","objectName","level","arguments","length","undefined","rememberObjectName","node","parent","name","includes","segments","i","memberParent","type","key","memberNode","computed","property","value","push","hasNonStaticUsage","usedProperties","add","join","collectMemberCallUsageFactory","object","callParent","args","firstArg","usedArgs","collectAppGetMenuUsage","collectInstalledAppsHasUsage","traverseStoryboardExpressions","data","beforeVisitGlobal","options","memo","WeakSet","matchExpressionString","visitNotMatchedExpressionString","visitNonExpressionString","visitObject","v","traverse","isEvaluable","preevaluate","cache","withParent","hooks","error","console","isObject","has","item","Array","isArray","Object","values","strictCollectMemberUsage","nonStaticUsage","collectMemberUsage","Error","Set","expr","TRACK_NAMES","track","raw","trackText","variableName","expression","trackCtxExp","expressions","size","warn","JSON","stringify","trackAll","some","result","context","state","formState","keyMap","CTX","STATE","FORM_STATE","forEach","split","traverseStoryboardFunctions","functions","fn","matchSource","source","traverseStoryboardFunction","silentErrors","precookFunction","typescript","cacheKey","collectMemberUsageInFunction","delete","PERMISSIONS","check","scanPermissionActionsInStoryboard","storyboard","_storyboard$meta","collection","beforeVisitPermissions","beforeVisitPermissionsFactory","customTemplates","meta","routes","from","scanPermissionActionsInAny","arg","pull","USE_CHILDREN_SLOT_REGEXP","replaceUseChildren","input","brick","replaceInBrick","slots","useChildrenMap","Map","children","removeBricks","child","_child$slot","slot","test","get","set","slotConf","entries","bricks","replaceInProperties","properties","k","useBrick"],"sourceRoot":""}