@oracle/oraclejet-audit 14.1.4 → 15.0.0

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 (278) hide show
  1. package/corePackMigrator/cli.js +6 -0
  2. package/corePackMigrator/corePackMigrator.js +10 -0
  3. package/corePackMigrator/metadata/avatarMetadata.json +40 -0
  4. package/corePackMigrator/metadata/buttonMetadata.json +55 -0
  5. package/corePackMigrator/metadata/collapsibleMetadata.json +15 -0
  6. package/corePackMigrator/metadata/filePickerMetadata.json +8 -0
  7. package/corePackMigrator/metadata/inputNumberMetadata.json +56 -0
  8. package/corePackMigrator/metadata/inputPasswordMetadata.json +50 -0
  9. package/corePackMigrator/metadata/inputTextMetadata.json +62 -0
  10. package/corePackMigrator/metadata/legendItemMetadata.json +8 -0
  11. package/corePackMigrator/metadata/legendMetadata.json +18 -0
  12. package/corePackMigrator/metadata/legendSectionMetadata.json +8 -0
  13. package/corePackMigrator/metadata/listItemLayoutMetadata.json +15 -0
  14. package/corePackMigrator/metadata/listviewMetadata.json +8 -0
  15. package/corePackMigrator/metadata/messagesMetadata.json +35 -0
  16. package/corePackMigrator/metadata/progressBarMetadata.json +15 -0
  17. package/corePackMigrator/metadata/progressCircleMetadata.json +8 -0
  18. package/corePackMigrator/metadata/ratingGaugeMetadata.json +78 -0
  19. package/corePackMigrator/metadata/selectManyMetadata.json +39 -0
  20. package/corePackMigrator/metadata/selectSingleMetadata.json +39 -0
  21. package/corePackMigrator/metadata/statusMeterGaugeMetadata.json +99 -0
  22. package/corePackMigrator/metadata/textAreaMetadata.json +44 -0
  23. package/corePackMigrator/resource/astUtils.js +6 -0
  24. package/corePackMigrator/resource/componentMigrator.js +6 -0
  25. package/corePackMigrator/resource/fileScanner.js +6 -0
  26. package/corePackMigrator/resource/htmlUtils.js +6 -0
  27. package/corePackMigrator/resource/manifest.json +102 -0
  28. package/corePackMigrator/resource/migrationConfig.json +21 -0
  29. package/corePackMigrator/templates/componentMetaData.json +119 -0
  30. package/corePackMigrator/templates/migrationConfig.json +17 -0
  31. package/corePackMigrator/utilities/logging.js +6 -0
  32. package/jaf-amd.js +1 -1
  33. package/lib/AST_Ts.js +1 -1
  34. package/lib/Cli.js +1 -1
  35. package/lib/Components.js +1 -1
  36. package/lib/Config.js +1 -1
  37. package/lib/ConfigLib.js +1 -1
  38. package/lib/DomUtils.js +1 -1
  39. package/lib/FileIndex.js +1 -1
  40. package/lib/FileSet.js +1 -1
  41. package/lib/FsUtils.js +1 -1
  42. package/lib/HtmlUtils.js +1 -1
  43. package/lib/JsonLoader.js +1 -1
  44. package/lib/MetaLib.js +1 -1
  45. package/lib/NetUtils.js +1 -1
  46. package/lib/Parser.js +1 -1
  47. package/lib/RegTypes.js +1 -1
  48. package/lib/Registry.js +1 -1
  49. package/lib/Reporter.js +1 -1
  50. package/lib/RulePack.js +1 -1
  51. package/lib/RuleSet.js +1 -1
  52. package/lib/Rules.js +1 -1
  53. package/lib/Scope.js +1 -1
  54. package/lib/Ts.js +1 -1
  55. package/lib/TsxUtils.js +1 -1
  56. package/lib/TsxUtils2.js +6 -0
  57. package/lib/Utils.js +1 -1
  58. package/lib/ZipUtils.js +1 -1
  59. package/lib/checkage.js +1 -1
  60. package/lib/cmdline.js +1 -1
  61. package/lib/defaults.js +1 -1
  62. package/lib/exportRules.js +1 -1
  63. package/lib/filetypes.js +1 -1
  64. package/lib/groups.js +1 -1
  65. package/lib/help.js +1 -1
  66. package/lib/jetver.js +1 -1
  67. package/lib/jsx.js +1 -1
  68. package/lib/maint.js +6 -0
  69. package/lib/manpage.js +1 -1
  70. package/lib/manual.js +1 -1
  71. package/lib/migrator.js +6 -0
  72. package/lib/msgidLoader.js +1 -1
  73. package/lib/ns.js +1 -1
  74. package/lib/outfile.js +1 -1
  75. package/lib/schema.js +1 -1
  76. package/lib/scopewalker.js +1 -1
  77. package/libext/expparser.js +1 -1
  78. package/meta/14.0.0/jetauditmeta.js +1 -1
  79. package/meta/14.1.0/jetauditmeta.js +1 -1
  80. package/meta/15.0.0/jetauditmeta.js +9 -0
  81. package/meta/metaverlist.json +1 -1
  82. package/package.json +16 -8
  83. package/profiles/redwood-strict.json +2 -1
  84. package/rulepacks/csp/csp-html-script-unsafe-inline.js +1 -1
  85. package/rulepacks/csp/csp-html-unsafe-expr.js +1 -1
  86. package/rulepacks/csp/csp-js-script-unsafe-eval.js +1 -1
  87. package/rulepacks/csp/csp-js-style-unsafe-inline.js +1 -1
  88. package/rulepacks/csp/csp-json-unsafe-expr.js +6 -0
  89. package/rulepacks/csp/msgid.json +1 -1
  90. package/rulepacks/csp/rules.json +1 -1
  91. package/rulepacks/jetwc/jetwc-absolute-jetversion.js +1 -1
  92. package/rulepacks/jetwc/jetwc-aria-redefinition.js +1 -1
  93. package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
  94. package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +1 -1
  95. package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +1 -1
  96. package/rulepacks/jetwc/jetwc-component-dependencies.js +1 -1
  97. package/rulepacks/jetwc/jetwc-component-displayname.js +1 -1
  98. package/rulepacks/jetwc/jetwc-component-foldername.js +1 -1
  99. package/rulepacks/jetwc/jetwc-component-location.js +1 -1
  100. package/rulepacks/jetwc/jetwc-component-type.js +1 -1
  101. package/rulepacks/jetwc/jetwc-css-oj-complete.js +1 -1
  102. package/rulepacks/jetwc/jetwc-css-pack-load-path.js +6 -0
  103. package/rulepacks/jetwc/jetwc-css-scoping.js +1 -1
  104. package/rulepacks/jetwc/jetwc-data-property-prefix.js +1 -1
  105. package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +1 -1
  106. package/rulepacks/jetwc/jetwc-disabled-property.js +1 -1
  107. package/rulepacks/jetwc/jetwc-displayname.js +1 -1
  108. package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +1 -1
  109. package/rulepacks/jetwc/jetwc-event-displayname.js +1 -1
  110. package/rulepacks/jetwc/jetwc-events.js +1 -1
  111. package/rulepacks/jetwc/jetwc-exchange-images.js +1 -1
  112. package/rulepacks/jetwc/jetwc-jet-version.js +1 -1
  113. package/rulepacks/jetwc/jetwc-loader-file.js +1 -1
  114. package/rulepacks/jetwc/jetwc-markdown-link.js +1 -1
  115. package/rulepacks/jetwc/jetwc-method-displayname.js +1 -1
  116. package/rulepacks/jetwc/jetwc-methods.js +1 -1
  117. package/rulepacks/jetwc/jetwc-namespace.js +1 -1
  118. package/rulepacks/jetwc/jetwc-nested-defaults.js +1 -1
  119. package/rulepacks/jetwc/jetwc-nls-languages.js +1 -1
  120. package/rulepacks/jetwc/jetwc-nls-root.js +1 -1
  121. package/rulepacks/jetwc/jetwc-oj-register.js +1 -1
  122. package/rulepacks/jetwc/jetwc-ojcss.js +1 -1
  123. package/rulepacks/jetwc/jetwc-pack-children.js +1 -1
  124. package/rulepacks/jetwc/jetwc-packable-components.js +1 -1
  125. package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +1 -1
  126. package/rulepacks/jetwc/jetwc-prerelease-pattern.js +1 -1
  127. package/rulepacks/jetwc/jetwc-prerelease-version.js +1 -1
  128. package/rulepacks/jetwc/jetwc-property-changed.js +1 -1
  129. package/rulepacks/jetwc/jetwc-property-displayname.js +1 -1
  130. package/rulepacks/jetwc/jetwc-property-nesting.js +1 -1
  131. package/rulepacks/jetwc/jetwc-property-translatable.js +1 -1
  132. package/rulepacks/jetwc/jetwc-public-modules.js +1 -1
  133. package/rulepacks/jetwc/jetwc-reference-npm-path.js +6 -0
  134. package/rulepacks/jetwc/jetwc-register-css.js +1 -1
  135. package/rulepacks/jetwc/jetwc-register-with-promises.js +1 -1
  136. package/rulepacks/jetwc/jetwc-require-paths.js +1 -1
  137. package/rulepacks/jetwc/jetwc-required-subproperty.js +1 -1
  138. package/rulepacks/jetwc/jetwc-reserved-property.js +1 -1
  139. package/rulepacks/jetwc/jetwc-schema.js +1 -1
  140. package/rulepacks/jetwc/jetwc-semantic-version.js +1 -1
  141. package/rulepacks/jetwc/jetwc-slot-displayname.js +1 -1
  142. package/rulepacks/jetwc/jetwc-slots.js +1 -1
  143. package/rulepacks/jetwc/jetwc-standard-files.js +1 -1
  144. package/rulepacks/jetwc/jetwc-status-since.js +6 -0
  145. package/rulepacks/jetwc/jetwc-unused-events.js +1 -1
  146. package/rulepacks/jetwc/jetwc-unused-slots.js +1 -1
  147. package/rulepacks/jetwc/jetwc-vb-category.js +1 -1
  148. package/rulepacks/jetwc/jetwc-vb-icon.js +1 -1
  149. package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +1 -1
  150. package/rulepacks/jetwc/jetwc-vcomponent-loader.js +1 -1
  151. package/rulepacks/jetwc/jetwc-vcomponent-version.js +1 -1
  152. package/rulepacks/jetwc/jetwc-version-openrange.js +1 -1
  153. package/rulepacks/jetwc/jetwc-writeback-required.js +1 -1
  154. package/rulepacks/jetwc/msgid.json +1 -1
  155. package/rulepacks/jetwc/rules.json +1 -1
  156. package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +1 -1
  157. package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +1 -1
  158. package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +1 -1
  159. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +1 -1
  160. package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +1 -1
  161. package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +1 -1
  162. package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
  163. package/rulepacks/jetwco/jetwco-cacc-componentType.js +1 -1
  164. package/rulepacks/jetwco/jetwco-cacc-dependencies.js +1 -1
  165. package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +1 -1
  166. package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +1 -1
  167. package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +1 -1
  168. package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +1 -1
  169. package/rulepacks/jetwco/jetwco-cacc-events.js +1 -1
  170. package/rulepacks/jetwco/jetwco-cacc-helpers.js +1 -1
  171. package/rulepacks/jetwco/jetwco-cacc-jetVer.js +1 -1
  172. package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +1 -1
  173. package/rulepacks/jetwco/jetwco-cacc-methodParams.js +1 -1
  174. package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +1 -1
  175. package/rulepacks/jetwco/jetwco-cacc-methods.js +1 -1
  176. package/rulepacks/jetwco/jetwco-cacc-packBundle.js +1 -1
  177. package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +1 -1
  178. package/rulepacks/jetwco/jetwco-cacc-packContent.js +1 -1
  179. package/rulepacks/jetwco/jetwco-cacc-properties.js +1 -1
  180. package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +1 -1
  181. package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +1 -1
  182. package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +1 -1
  183. package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +1 -1
  184. package/rulepacks/jetwco/jetwco-cacc-propertyType.js +1 -1
  185. package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +1 -1
  186. package/rulepacks/jetwco/jetwco-cacc-publicModules.js +1 -1
  187. package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +1 -1
  188. package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +1 -1
  189. package/rulepacks/jetwco/jetwco-cacc-slots.js +1 -1
  190. package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +1 -1
  191. package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +1 -1
  192. package/rulepacks/jetwco/jetwco-cacc-typeMappingOverrides.js +6 -0
  193. package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +1 -1
  194. package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +1 -1
  195. package/rulepacks/jetwco/jetwco-component-api-changes.js +1 -1
  196. package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +1 -1
  197. package/rulepacks/jetwco/jetwco-component-cdn.js +1 -1
  198. package/rulepacks/jetwco/jetwco-description-standards.js +1 -1
  199. package/rulepacks/jetwco/jetwco-displayname-standards.js +1 -1
  200. package/rulepacks/jetwco/jetwco-exchange-version-check.js +1 -1
  201. package/rulepacks/jetwco/jetwco-license-info.js +1 -1
  202. package/rulepacks/jetwco/jetwco-prerelease-cdn.js +1 -1
  203. package/rulepacks/jetwco/jetwco-thirdparty-ba.js +1 -1
  204. package/rulepacks/jetwco/msgid.json +1 -1
  205. package/rulepacks/jetwco/rules.json +1 -1
  206. package/rules/jaf/jaf-ts-noparser.js +6 -0
  207. package/rules/jaf/msgid.json +1 -1
  208. package/rules/jaf/rules.json +1 -1
  209. package/rules/jet/helpers/has-slot-name.js +1 -1
  210. package/rules/jet/helpers/style-selector.js +1 -1
  211. package/rules/jet/helpers/tsx/has-slot-name.js +6 -0
  212. package/rules/jet/msgid.json +1 -1
  213. package/rules/jet/oj-acc-aria-labelledby.js +1 -1
  214. package/rules/jet/oj-cca-compjson-bp-ar.js +1 -1
  215. package/rules/jet/oj-cca-compjson-bp-obj.js +1 -1
  216. package/rules/jet/oj-css-bp-dir-flow.js +1 -1
  217. package/rules/jet/oj-html-attr-$unique.js +1 -1
  218. package/rules/jet/oj-html-attr-expr-delims.js +6 -0
  219. package/rules/jet/oj-html-combo-converter.js +1 -1
  220. package/rules/jet/oj-html-file-pick-accept.js +1 -1
  221. package/rules/jet/oj-html-form-bindif.js +1 -1
  222. package/rules/jet/oj-html-input-isodate.js +1 -1
  223. package/rules/jet/oj-html-invalid-doctype.js +1 -1
  224. package/rules/jet/oj-html-msgs-cat-text.js +1 -1
  225. package/rules/jet/oj-html-ojattr-deprecated.js +1 -1
  226. package/rules/jet/oj-html-ojattr-enum-deprecated.js +1 -1
  227. package/rules/jet/oj-html-ojtag-deprecated.js +1 -1
  228. package/rules/jet/oj-html-ojtag-ns.js +1 -1
  229. package/rules/jet/oj-html-rating-gauge-track-resize.js +6 -0
  230. package/rules/jet/oj-html-self-close.js +1 -1
  231. package/rules/jet/oj-html-slot-deprecated.js +1 -1
  232. package/rules/jet/oj-html-slot-item-minmax.js +1 -1
  233. package/rules/jet/oj-html-slot-name.js +1 -1
  234. package/rules/jet/oj-html-slot-pref-content.js +1 -1
  235. package/rules/jet/oj-html-style.js +1 -1
  236. package/rules/jet/oj-html-stylesel.js +1 -1
  237. package/rules/jet/oj-html-tabbar-edge.js +6 -0
  238. package/rules/jet/oj-html-unsup-theme.js +1 -1
  239. package/rules/jet/oj-html-wctag-maintenance.js +1 -1
  240. package/rules/jet/oj-html-wctag-nested.js +1 -1
  241. package/rules/jet/oj-html-wctag-supersedes.js +6 -0
  242. package/rules/jet/oj-js-numconv-pattern.js +6 -0
  243. package/rules/jet/oj-ts-numconv-pattern.js +6 -0
  244. package/rules/jet/oj-tsx-5-tag-obs.js +1 -1
  245. package/rules/jet/oj-tsx-acc-avatar-aria-role.js +6 -0
  246. package/rules/jet/oj-tsx-acc-button-onclick.js +1 -1
  247. package/rules/jet/oj-tsx-aria-ojselector-labelledby.js +1 -1
  248. package/rules/jet/oj-tsx-aria-prop.js +1 -1
  249. package/rules/jet/oj-tsx-attr-req.js +1 -1
  250. package/rules/jet/oj-tsx-cca-tagname.js +1 -1
  251. package/rules/jet/oj-tsx-combo-converter.js +1 -1
  252. package/rules/jet/oj-tsx-databind-all.js +1 -1
  253. package/rules/jet/oj-tsx-dlg-title.js +1 -1
  254. package/rules/jet/oj-tsx-form-bindif.js +6 -0
  255. package/rules/jet/oj-tsx-form-noflex.js +6 -0
  256. package/rules/jet/oj-tsx-input-isodate.js +1 -1
  257. package/rules/jet/oj-tsx-ojattr-deprecated.js +6 -0
  258. package/rules/jet/oj-tsx-ojattr-enum-deprecated.js +6 -0
  259. package/rules/jet/oj-tsx-ojattr-value.js +1 -1
  260. package/rules/jet/oj-tsx-ojattr.js +1 -1
  261. package/rules/jet/oj-tsx-ojtag-deprecated.js +1 -1
  262. package/rules/jet/oj-tsx-ojtag-ns.js +6 -0
  263. package/rules/jet/oj-tsx-pageopts-type.js +1 -1
  264. package/rules/jet/oj-tsx-picker-attrs.js +1 -1
  265. package/rules/jet/oj-tsx-prop-inline-definition.js +1 -1
  266. package/rules/jet/oj-tsx-rating-gauge-size.js +1 -1
  267. package/rules/jet/oj-tsx-rating-gauge-track-resize.js +6 -0
  268. package/rules/jet/oj-tsx-slot-deprecated.js +6 -0
  269. package/rules/jet/oj-tsx-slot-pref-content.js +6 -0
  270. package/rules/jet/oj-tsx-tabbar-edge.js +6 -0
  271. package/rules/jet/oj-tsx-unsup-theme.js +1 -1
  272. package/rules/jet/oj-tsx-wctag-maintenance.js +1 -1
  273. package/rules/jet/oj-tsx-wctag-nested.js +1 -1
  274. package/rules/jet/rules.json +1 -1
  275. package/schema/component-schema.json +1 -1
  276. package/src/JafCore.js +1 -1
  277. package/types/index.d.ts +6 -4
  278. package/rules/jet/oj-html-cspexpr.js +0 -6
package/lib/HtmlUtils.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const COMMON_ATTRS={"accesskey":true,"class":true,"contenteditable":true,"contextmenu":true,"dir":true,"draggable":true,"hidden":true,"id":true,"lang":true,"role":true,"spellcheck":true,"style":true,"tabindex":true,"title":true,"translate":true};var COMMON_ELEMS={"a":true,"abbr":true,"address":true,"area":true,"article":true,"aside":true,"audio":true,"b":true,"base":true,"bdi":true,"bdo":true,"blockquote":true,"body":true,"br":true,"button":true,"canvas":true,"caption":true,"cite":true,"code":true,"col":true,"colgroup":true,"command":true,"datalist":true,"dd":true,"del":true,"details":true,"dfn":true,"div":true,"dl":true,"dt":true,"em":true,"embed":true,"fieldset":true,"figcaption":true,"figure":true,"footer":true,"form":true,"h1":true,"h2":true,"h3":true,"h4":true,"h5":true,"h6":true,"head":true,"header":true,"hgroup":true,"hr":true,"html":true,"i":true,"iframe":true,"img":true,"input":true,"ins":true,"kbd":true,"keygen":true,"label":true,"legend":true,"li":true,"link":true,"map":true,"main":true,"mark":true,"menu":true,"meta":true,"meter":true,"nav":true,"noscript":true,"object":true,"ol":true,"optgroup":true,"option":true,"output":true,"p":true,"param":true,"pre":true,"progress":true,"q":true,"rp":true,"rt":true,"ruby":true,"s":true,"samp":true,"script":true,"section":true,"select":true,"small":true,"source":true,"span":true,"strong":true,"style":true,"sub":true,"summary":true,"sup":true,"table":true,"tbody":true,"td":true,"textarea":true,"tfoot":true,"th":true,"thead":true,"time":true,"title":true,"tr":true,"track":true,"u":true,"ul":true,"var":true,"video":true,"wbr":true,"svg":true};var COMMON_EVENT_ATTRS={"onabort":true,"onauxclick":true,"onblur":true,"oncanplay":true,"oncanplaythrough":true,"onchange":true,"onclick":true,"oncontextmenu":true,"ondblclick":true,"ondrag":true,"ondragend":true,"ondragenter":true,"ondragleave":true,"ondragover":true,"ondragstart":true,"ondrop":true,"ondurationchange":true,"onemptied":true,"onended":true,"onerror":true,"onfocus":true,"onformchange":true,"onforminput":true,"oninput":true,"oninvalid":true,"onkeydown":true,"onkeypress":true,"onkeyup":true,"onload":true,"onloadeddata":true,"onloadedmetadata":true,"onloadstart":true,"onmousedown":true,"onmousemove":true,"onmouseout":true,"onmouseover":true,"onmouseup":true,"onmousewheel":true,"onpause":true,"onplay":true,"onplaying":true,"onprogress":true,"onratechange":true,"onreadystatechange":true,"onscroll":true,"onseeked":true,"onseeking":true,"onselect":true,"onshow":true,"onstalled":true,"onsubmit":true,"onsuspend":true,"ontimeupdate":true,"onvolumechange":true,"onwaiting":true};const SVG_ELEMS={"animate":true,"animatemotion":true,"animatetransform":true,"circle":true,"clippath":true,"color-profile":true,"defs":true,"desc":true,"discard":true,"ellipse":true,"feblend":true,"fecolormatrix":true,"fecomponenttransfer":true,"fecomposite":true,"feconvolvematrix":true,"fediffuselighting":true,"fedisplacementmap":true,"fedistantlight":true,"fedropshadow":true,"feflood":true,"fefunca":true,"fefuncb":true,"fefuncg":true,"fefuncr":true,"fegaussianblur":true,"feimage":true,"femerge":true,"femergenode":true,"femorphology":true,"feoffset":true,"fepointlight":true,"fespecularlighting":true,"fespotLight":true,"fetile":true,"feturbulence":true,"filter":true,"foreignobject":true,"g":true,"hatch":true,"hatchpath":true,"image":true,"line":true,"lineargradient":true,"marker":true,"mask":true,"mesh":true,"meshgradient":true,"meshpatch":true,"meshrow":true,"metadata":true,"mpath":true,"path":true,"pattern":true,"polygon":true,"polyline":true,"radialgradient":true,"rect":true,"script":true,"set":true,"solidcolor":true,"stop":true,"style":true,"svg":true,"switch":true,"symbol":true,"text":true,"textpath":true,"title":true,"tspan":true,"unknown":true,"use":true,"view":true};const HTML5_OBS_TAGS={"applet":true,"acronym":true,"basefont":true,"bgsound":true,"big":true,"blink":true,"center":true,"dir":true,"font":true,"frame":true,"frameset":true,"noframes":true,"isindex":true,"keygen":true,"listing":true,"marquee":true,"menuitem":true,"multicol":true,"nextid":true,"nobr":true,"noembed":true,"plaintext":true,"rb":true,"rlc":true,"s":true,"spacer":true,"strike":true,"tt":true,"xmp":true};const HTML5_OBS_ATTRS={"a":["charset","coords","methods","name","rev","shape","urn"],"area":["nohref"],"body":["alink","background","bgcolor","bottommargin","leftmargin","link","marginheight","marginwidth","rightmargin","text","vlink"],"br":["clear"],"caption":["align"],"col":["align","char","charoff","valign","width"],"div":["align"],"dl":["compact"],"embed":["align","name","hspace","vspace"],"form":["accept"],"head":["profile"],"hr":["align","noshade","size","width"],"h1":["align"],"h2":["align"],"h3":["align"],"h4":["align"],"h5":["align"],"h6":["align"],"html":["version"],"iframe":["align","allowtransparency","frameborder","framespacing","hspace","longdesc","marginheight","marginwidth","scrolling","vspace"],"img":["align","border","hspace","longdesc","lowsrc","name","vspace"],"input":["align","border","hspace","ismap","usemap","vspace"],"legend":["align"],"li":["type"],"link":["charset","methods","rev","target","urn"],"menu":["compact","label","type"],"meta":["scheme"],"object":["align","archive","border","classid","code","codebase","codetype","declare","hspace","standby","typemustmatch","vspace"],"ol":["compact"],"option":["name"],"p":["align"],"param":["type","valuetype"],"pre":["width"],"script":["charset","event","for","language"],"style":["type"],"table":["align","background","bgcolor","border","bordercolor","cellpadding","cellspacing","datapagesize","frame","height","rules","summary","width"],"tbody":["align","background","char","charoff","valign"],"tfoot":["align","background","char","charoff","valign"],"thead":["align","background","char","charoff","valign"],"td":["abbr","align","axis","background","bgcolor","char","charoff","height","nowrap","scope","valign","width"],"th":["abbr","align","axis","background","bgcolor","char","charoff","height","nowrap","valign","width"],"tr":["align","background","bgcolor","char","charoff","height","valign"],"ul":["compact","type"]};const HTML5_OBS_ATTR_ALL_ELEM=["contextmenu","dropzone","onshow"];const SELF_CLOSING_ELEMS={"area":true,"base":true,"br":true,"embed":true,"hr":true,"iframe":true,"img":true,"input":true,"link":true,"meta":true,"param":true,"source":true,"track":true};const SVG_PATH_COMMANDS=["M","m","L","I","H","h","V","v","C","c","S","s","Q","q","T","t","A","a","Z","z"];const OJ_NAMESPACE_PREFIXES=require("./ns");module.exports.isCommonAttr=function(attrName){var x;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;x=attrName.indexOf(".");if(x>=0){attrName=attrName.substring(0,x)};return COMMON_ATTRS[attrName]||attrName.startsWith("aria-")||attrName.startsWith("data-")&&attrName!=="data-oj-command"&&attrName!=="data-oj-context"};module.exports.isCommonEventAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(attrName.startsWith("on-oj-")){return false}if(attrName.startsWith("on-")){attrName=attrName.substring(0,2)+attrName.substring(3)}return COMMON_EVENT_ATTRS[attrName]};module.exports.isCommonElem=function(elem){return COMMON_ELEMS[elem.toLowerCase()]};module.exports.isSvgElem=function(elem){return SVG_ELEMS[elem.toLowerCase()]};module.exports.isSvgPath=function(s){var c=s.trim().charAt(0);return SVG_PATH_COMMANDS.indexOf(c)>=0};module.exports.isSelfClosingTag=function(elem){return SELF_CLOSING_ELEMS[elem]};module.exports.isNamespacePrefix=function(prefix){return OJ_NAMESPACE_PREFIXES.has(prefix)};module.exports.isNamespaceTag=function(tag){var s=tag.replace(/[<>]/g,"");var x,ret=false;if(tag.startsWith("demo-")||tag.startsWith("my-")||tag.startsWith("ns-")){return true}while(true){x=s.lastIndexOf("-");if(x>=0){s=s.substring(0,x);if(s.lastIndexOf("-")<0&&s==="oj"){break}if(OJ_NAMESPACE_PREFIXES.has(s)){ret=true;break}}else{break}}return ret};module.exports.isHtml5ObsoleteElem=function(tag){return HTML5_OBS_TAGS[tag.toLowerCase()]};module.exports.isHtml5ObsoleteAttr=function(tagName,attrName){var depAttrs,ret=false;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);depAttrs=HTML5_OBS_ATTRS[tagName];if(!depAttrs){depAttrs=HTML5_OBS_ATTR_ALL_ELEM}if(depAttrs){if(depAttrs.includes(attrName)){ret=true}}return ret};const EXPR_CHARS=new RegExp("[?\"'=+:/()[]{}]","g");module.exports.isEncodedLiteral=function(expr){if(expr.charAt(0)==="'"&&expr.charAt(expr.length-1)==="'"){return EXPR_CHARS.test(expr.substring(1,expr.length-1))}return false};module.exports.replaceEntities=function(s){const ENTITY_LT=/&lt;/g;const ENTITY_GT=/&amp;/g;const ENTITY_QUOT=/&quot;/g;const ENTITY_APOS=/&apos;/g;const ENTITY_AMP=/&amp;/g;const ENTITY_NBSP=/&nbsp;/g;if(s.indexOf("&")>=0){s=s.replace(ENTITY_LT,"<");s=s.replace(ENTITY_GT,"&");s=s.replace(ENTITY_QUOT,"\"");s=s.replace(ENTITY_APOS,"'");s=s.replace(ENTITY_AMP,"&");s=s.replace(ENTITY_NBSP," ")}return s};
6
+ const COMMON_ATTRS={"accesskey":true,"class":true,"contenteditable":true,"contextmenu":true,"dir":true,"draggable":true,"dropzone":true,"hidden":true,"id":true,"lang":true,"role":true,"spellcheck":true,"style":true,"tabindex":true,"title":true,"translate":true};var COMMON_ELEMS={"a":true,"abbr":true,"address":true,"area":true,"article":true,"aside":true,"audio":true,"b":true,"base":true,"bdi":true,"bdo":true,"blockquote":true,"body":true,"br":true,"button":true,"canvas":true,"caption":true,"cite":true,"code":true,"col":true,"colgroup":true,"command":true,"datalist":true,"dd":true,"del":true,"details":true,"dfn":true,"div":true,"dl":true,"dt":true,"em":true,"embed":true,"fieldset":true,"figcaption":true,"figure":true,"footer":true,"form":true,"h1":true,"h2":true,"h3":true,"h4":true,"h5":true,"h6":true,"head":true,"header":true,"hgroup":true,"hr":true,"html":true,"i":true,"iframe":true,"img":true,"input":true,"ins":true,"kbd":true,"keygen":true,"label":true,"legend":true,"li":true,"link":true,"map":true,"main":true,"mark":true,"menu":true,"meta":true,"meter":true,"nav":true,"noscript":true,"object":true,"ol":true,"optgroup":true,"option":true,"output":true,"p":true,"param":true,"pre":true,"progress":true,"q":true,"rp":true,"rt":true,"ruby":true,"s":true,"samp":true,"script":true,"section":true,"select":true,"small":true,"source":true,"span":true,"strong":true,"style":true,"sub":true,"summary":true,"sup":true,"table":true,"tbody":true,"td":true,"textarea":true,"tfoot":true,"th":true,"thead":true,"time":true,"title":true,"tr":true,"track":true,"u":true,"ul":true,"var":true,"video":true,"wbr":true,"svg":true};var COMMON_EVENT_ATTRS={"onabort":true,"onauxclick":true,"onblur":true,"oncanplay":true,"oncanplaythrough":true,"onchange":true,"onclick":true,"oncontextmenu":true,"ondblclick":true,"ondrag":true,"ondragend":true,"ondragenter":true,"ondragleave":true,"ondragover":true,"ondragstart":true,"ondrop":true,"ondurationchange":true,"onemptied":true,"onended":true,"onerror":true,"onfocus":true,"onformchange":true,"onforminput":true,"oninput":true,"oninvalid":true,"onkeydown":true,"onkeypress":true,"onkeyup":true,"onload":true,"onloadeddata":true,"onloadedmetadata":true,"onloadstart":true,"onmousedown":true,"onmousemove":true,"onmouseout":true,"onmouseover":true,"onmouseup":true,"onmousewheel":true,"onpause":true,"onplay":true,"onplaying":true,"onprogress":true,"onratechange":true,"onreadystatechange":true,"onreset":true,"onscroll":true,"onseeked":true,"onseeking":true,"onselect":true,"onshow":true,"onstalled":true,"onsubmit":true,"onsuspend":true,"ontimeupdate":true,"onvolumechange":true,"onwaiting":true};const SVG_ELEMS={"animate":true,"animatemotion":true,"animatetransform":true,"circle":true,"clippath":true,"color-profile":true,"defs":true,"desc":true,"discard":true,"ellipse":true,"feblend":true,"fecolormatrix":true,"fecomponenttransfer":true,"fecomposite":true,"feconvolvematrix":true,"fediffuselighting":true,"fedisplacementmap":true,"fedistantlight":true,"fedropshadow":true,"feflood":true,"fefunca":true,"fefuncb":true,"fefuncg":true,"fefuncr":true,"fegaussianblur":true,"feimage":true,"femerge":true,"femergenode":true,"femorphology":true,"feoffset":true,"fepointlight":true,"fespecularlighting":true,"fespotLight":true,"fetile":true,"feturbulence":true,"filter":true,"foreignobject":true,"g":true,"hatch":true,"hatchpath":true,"image":true,"line":true,"lineargradient":true,"marker":true,"mask":true,"mesh":true,"meshgradient":true,"meshpatch":true,"meshrow":true,"metadata":true,"mpath":true,"path":true,"pattern":true,"polygon":true,"polyline":true,"radialgradient":true,"rect":true,"script":true,"set":true,"solidcolor":true,"stop":true,"style":true,"svg":true,"switch":true,"symbol":true,"text":true,"textpath":true,"title":true,"tspan":true,"unknown":true,"use":true,"view":true};const HTML5_OBS_TAGS={"applet":true,"acronym":true,"basefont":true,"bgsound":true,"big":true,"blink":true,"center":true,"dir":true,"font":true,"frame":true,"frameset":true,"noframes":true,"isindex":true,"keygen":true,"listing":true,"marquee":true,"menuitem":true,"multicol":true,"nextid":true,"nobr":true,"noembed":true,"plaintext":true,"rb":true,"rlc":true,"s":true,"spacer":true,"strike":true,"tt":true,"xmp":true};const HTML5_OBS_ATTRS={"a":["charset","coords","methods","name","rev","shape","urn"],"area":["nohref"],"body":["alink","background","bgcolor","bottommargin","leftmargin","link","marginheight","marginwidth","rightmargin","text","vlink"],"br":["clear"],"caption":["align"],"col":["align","char","charoff","valign","width"],"div":["align"],"dl":["compact"],"embed":["align","name","hspace","vspace"],"form":["accept"],"head":["profile"],"hr":["align","noshade","size","width"],"h1":["align"],"h2":["align"],"h3":["align"],"h4":["align"],"h5":["align"],"h6":["align"],"html":["version"],"iframe":["align","allowtransparency","frameborder","framespacing","hspace","longdesc","marginheight","marginwidth","scrolling","vspace"],"img":["align","border","hspace","longdesc","lowsrc","name","vspace"],"input":["align","border","hspace","ismap","usemap","vspace"],"legend":["align"],"li":["type"],"link":["charset","methods","rev","target","urn"],"menu":["compact","label","type"],"meta":["scheme"],"object":["align","archive","border","classid","code","codebase","codetype","declare","hspace","standby","typemustmatch","vspace"],"ol":["compact"],"option":["name"],"p":["align"],"param":["type","valuetype"],"pre":["width"],"script":["charset","event","for","language"],"style":["type"],"table":["align","background","bgcolor","border","bordercolor","cellpadding","cellspacing","datapagesize","frame","height","rules","summary","width"],"tbody":["align","background","char","charoff","valign"],"tfoot":["align","background","char","charoff","valign"],"thead":["align","background","char","charoff","valign"],"td":["abbr","align","axis","background","bgcolor","char","charoff","height","nowrap","scope","valign","width"],"th":["abbr","align","axis","background","bgcolor","char","charoff","height","nowrap","valign","width"],"tr":["align","background","bgcolor","char","charoff","height","valign"],"ul":["compact","type"]};const HTML5_OBS_ATTR_ALL_ELEM=["contextmenu","dropzone","onshow"];const SELF_CLOSING_ELEMS={"area":true,"base":true,"br":true,"embed":true,"hr":true,"iframe":true,"img":true,"input":true,"link":true,"meta":true,"param":true,"source":true,"track":true};const SVG_PATH_COMMANDS=["M","m","L","I","H","h","V","v","C","c","S","s","Q","q","T","t","A","a","Z","z"];const OJ_NAMESPACE_PREFIXES=require("./ns");const ARIA_LIST=["aria-atomic","aria-busy","aria-controls","aria-describedat","aria-describedby","aria-disabled","aria-dropeffect","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-autocomplete","aria-checked","aria-disabled","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-multiline","aria-multiselectable","aria-orientation","aria-pressed","aria-readonly","aria-required","aria-rowcount","aria-rowindex","aria-selected","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-dropeffect","aria-grabbed","aria-activedescendant","aria-flowto","aria-posinset","aria-setsize"];module.exports.isCommonAttr=function(attrName){var x;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;x=attrName.indexOf(".");if(x>=0){attrName=attrName.substring(0,x)};return COMMON_ATTRS[attrName]||attrName.startsWith("aria-")||attrName.startsWith("data-")&&attrName!=="data-oj-command"&&attrName!=="data-oj-context"};module.exports.isCommonEventAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(attrName.startsWith("on-oj-")){return false}if(attrName.startsWith("on-")){attrName=attrName.substring(0,2)+attrName.substring(3)}return COMMON_EVENT_ATTRS[attrName]};module.exports.isCommonElem=function(elem){return COMMON_ELEMS[elem.toLowerCase()]};module.exports.isSvgElem=function(elem){return SVG_ELEMS[elem.toLowerCase()]};module.exports.isSvgPath=function(s){var c=s.trim().charAt(0);return SVG_PATH_COMMANDS.indexOf(c)>=0};module.exports.isSelfClosingTag=function(elem){return SELF_CLOSING_ELEMS[elem]};module.exports.isNamespacePrefix=function(prefix){return OJ_NAMESPACE_PREFIXES.has(prefix)};module.exports.isNamespaceTag=function(tag){var s=tag.replace(/[<>]/g,"");var x,ret=false;if(tag.startsWith("demo-")||tag.startsWith("my-")||tag.startsWith("ns-")){return true}while(true){x=s.lastIndexOf("-");if(x>=0){s=s.substring(0,x);if(s.lastIndexOf("-")<0&&s==="oj"){break}if(OJ_NAMESPACE_PREFIXES.has(s)){ret=true;break}}else{break}}return ret};module.exports.isHtml5ObsoleteElem=function(tag){return HTML5_OBS_TAGS[tag.toLowerCase()]};module.exports.isHtml5ObsoleteAttr=function(tagName,attrName){var depAttrs,ret=false;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);depAttrs=HTML5_OBS_ATTRS[tagName];if(!depAttrs){depAttrs=HTML5_OBS_ATTR_ALL_ELEM}if(depAttrs){if(depAttrs.includes(attrName)){ret=true}}return ret};module.exports.isAriaAttr=function(attrName){attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;return ARIA_LIST.includes(attrName.toLowerCase())};const EXPR_CHARS=new RegExp("[?\"'=+:/()[]{}]","g");module.exports.isEncodedLiteral=function(expr){if(expr.charAt(0)==="'"&&expr.charAt(expr.length-1)==="'"){return EXPR_CHARS.test(expr.substring(1,expr.length-1))}return false};module.exports.replaceEntities=function(s){const ENTITY_LT=/&lt;/g;const ENTITY_GT=/&amp;/g;const ENTITY_QUOT=/&quot;/g;const ENTITY_APOS=/&apos;/g;const ENTITY_AMP=/&amp;/g;const ENTITY_NBSP=/&nbsp;/g;if(s.indexOf("&")>=0){s=s.replace(ENTITY_LT,"<");s=s.replace(ENTITY_GT,"&");s=s.replace(ENTITY_QUOT,"\"");s=s.replace(ENTITY_APOS,"'");s=s.replace(ENTITY_AMP,"&");s=s.replace(ENTITY_NBSP," ")}return s};
package/lib/JsonLoader.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- function load(inFile,nd,fnError,allowComments,utils){var obj=null,json;try{if(nd.fs.existsSync(inFile)){json=nd.fs.readFileSync(inFile,'utf8');if(allowComments){json=nd.decomment(json)}obj=JSON.parse(nd.decomment(json))}else{if(fnError){fnError(`file not found "${inFile}"`)}}}catch(e){if(fnError){let msg=_convertJsonPosToRowCol(e.message,nd.fs.readFileSync(inFile,'utf8'),utils);fnError(msg?`${msg} : ${inFile}`:`${e.message}`)}}return obj};function _convertJsonPosToRowCol(msg,data,utils){var x,y,n,rc;x=msg.indexOf('position');if(x<0){return null}y=msg.indexOf('token');if(y>=0){y+=6;msg=msg.substring(0,y)+'\''+msg.substring(y,y+1)+'\''+msg.substring(y+1)}x=msg.indexOf('position');n=parseInt(msg.substr(x+8).trim());rc=utils.getRowColFromIndex(data,n);return msg.substring(0,x)+'line '+rc.row+', col '+rc.col};module.exports.load=load;
6
+ function load(inFile,nd,fnError,allowComments,utils){var o=loadEx(inFile,nd,fnError,allowComments,utils);return o?o.obj:null};function loadEx(inFile,nd,fnError,allowComments,utils){var o,obj=null,jsonRaw,json;try{if(nd.fs.existsSync(inFile)){jsonRaw=json=nd.fs.readFileSync(inFile,"utf8");if(allowComments){json=nd.decomment(jsonRaw)}o=JSON.parse(json);obj={json:jsonRaw,obj:o}}else{if(fnError){fnError(`file not found "${inFile}"`)}}}catch(e){if(fnError){let msg=_convertJsonPosToRowCol(e.message,nd.fs.readFileSync(inFile,"utf8"),utils);fnError(msg?`${msg} : ${inFile}`:`${e.message}`)}}return obj};function _convertJsonPosToRowCol(msg,data,utils){var x,y,n,rc;x=msg.indexOf("position");if(x<0){return null}y=msg.indexOf("token");if(y>=0){y+=6;msg=msg.substring(0,y)+"'"+msg.substring(y,y+1)+"'"+msg.substring(y+1)}x=msg.indexOf("position");n=parseInt(msg.substr(x+8).trim());rc=utils.getRowColFromIndex(data,n);return msg.substring(0,x)+"line "+rc.row+", col "+rc.col};module.exports.load=load;module.exports.loadEx=loadEx;
package/lib/MetaLib.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- "use strict";const Namespaces=require("./ns");const HtmlUtils=require("./HtmlUtils");const SemVer=require("semver");const NO_SUGGESTION_AVAIL="No suggestion available.";const OJPREFIX="oj-";const OJEVENTPREFIX="on-oj-";const OJS="ojs/oj";const EVENT_PREFIX="on-";const DOT=".";const DATA_OJ_CMD="data-oj-command";const DASH_CHANGED="-changed";const CHANGED="Changed";const PROP_SLOTS="slots";const PROP_PROPS="props";const PROP_EVENTS="events";const PROP_IMPLEMENTS="implements";const PROP_FOLDER="folder";const PROP_VERSION="version";const PROP_UNSUP_THEME="unsupTheme";const PROP_SUBCOMPONENT_TYPE="subcomponentType";const PACK_PRIVATE="packPrivate";const DEPRECATED="deprecated";const MAINTENANCE="maintenance";const SUPERSEDES="supersedes";const STRING="string";const BOOLEAN="boolean";const OBJECT="object";function MetaLib(nd,runMode,msgCtx,utils,fsUtils){this._json=null;this._delHist=null;this._renHist=null;this._reqAttrs=null;this._nonClasses=null;this._implements=null;this._hasJetWCIFCs=false;this._components=null;this._compSvcs=null;this._stylesets=null;this._runMode=runMode;this._utils=utils;this._fsUtils=fsUtils;this._domUtils=null;if(nd.jetver){this._jetVersions=nd.jetver.getVersions()}this._jetVer=null;this._theme=null;this._deprecatedMethods=null;this._deprecatedMembers=null;this._deletedMethods=null;this._deletedMembers=null;this._error=msgCtx.error;this._debug=msgCtx.debug;this._info=msgCtx.info;this._msg=msgCtx.msg;this._console=msgCtx.console;this._isDebug=msgCtx.isdebug;this._isVerbose=msgCtx.isVerbose;this._nd=nd};MetaLib.prototype.isNSRegistered=function(prefix){return Namespaces.has(prefix)};MetaLib.prototype.isNamespacePrefix=function(tagName){return HtmlUtils.isNamespaceTag(tagName)};MetaLib.prototype.isRuleIgnored=function(tagName,ruleName){var o,ret=false;if(o=this._getComponentFromTag(tagName)){if(o.extension&&o.extension.audit&&o.extension.audit.ignore){let ar=o.extension.audit.ignore;if(ar&&ar.length){ret=ar.includes(ruleName)}}}else{ret=this._components&&this._components.isRuleIgnored(tagName,ruleName)}return ret};MetaLib.prototype.isCoreTag=function(tag){return this._components.isJetTag(tag)};MetaLib.prototype.isJetLegacyTag=function(tag){return this._getComponentNameFromTag(_removeChevrons(tag))};MetaLib.prototype.isJetTag=function(tagName){return!!(this._components.isJetTag(tagName)||this._getComponentNameFromTag(_removeChevrons(tagName)))};MetaLib.prototype.isComponentTag=function(tagName){if(!tagName){return false}return this._components&&this._components.isTag(_removeChevrons(tagName))};MetaLib.prototype.isWCTag=function(tagName){return this.isJetTag(tagName)||this.isComponentTag(tagName)};MetaLib.prototype.isCCATag=function(tagName){if(!tagName){return false}return this.isWCTag(tagName)};MetaLib.prototype.isTagDeprecated=function(tagName){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tagName))){ret=this.isClassDeprecated(clazz)}else{ret=this._components.isTagDeprecated(tagName)}return ret};MetaLib.prototype.isTagAttrDeprecated=function(tagName,attrName){var member,ret=null;member=this._getTagAttrMemberObj(tagName,attrName);ret=member?this._isSubStateDeprecated(member,true):this._components.isTagAttrDeprecated(tagName,attrName);if(ret){ret.forEach(status=>{if(status.description){status.description=HtmlUtils.replaceEntities(status.description)}})}return ret};MetaLib.prototype.isTagEventDeprecated=function(tag,attr){var comp,member,ev,deps;if(comp=this._getComponentFromTag(tag)){if(!comp.event&&!comp.member){return null}if(ev=this.getTagPropertyFromEvent(tag,attr)){if(comp.event&&(member=comp.event[ev])||comp.htmlattributes&&(member=comp.member[ev])){deps=member.ojdeprecated}}}else{deps=this._components.isTagEventDeprecated(tag,attr)}return deps?deps:null};MetaLib.prototype.getTagPropertyFromEvent=function(tag,event){var comp,ev;if(comp=this._getComponentFromTag(tag)){if(comp.htmlevents&&(ev=comp.htmlevents[event])){if(!(comp.event&&comp.event[ev])){if(ev.endsWith(CHANGED)){ev=ev.substring(0,ev.length-CHANGED.length)}}}else if(event.endsWith(DASH_CHANGED)&&(ev=comp.htmlattributes[event])){if(!(comp.event&&comp.event[ev])){if(ev.endsWith(CHANGED)){ev=ev.substring(0,ev.length-CHANGED.length)}}}}return ev};MetaLib.prototype.isTagAttr=function(tagName,attrName){var o,ret=false;attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(o=this._getComponentFromTag(tagName)){ret=this.isJetTagAttr(o,attrName)}else{ret=this._components&&this._components.isTagAttr(tagName,attrName)}return ret};MetaLib.prototype.isJetTagAttr=function(tagObj,attrName){attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;var ret=!!(tagObj.htmlattributes&&tagObj.htmlattributes[attrName]);if(!ret&&attrName===DATA_OJ_CMD&&tagObj.member){ret=!!tagObj.member[DATA_OJ_CMD]}return ret};MetaLib.prototype._getTagAttrMemberObj=function(tagName,attrName){var obj,attrib,member,x;obj=this._getComponentFromTag(_removeChevrons(tagName));attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(!obj||!obj.htmlattributes||!obj.htmlattributes[attrName]){return null}member=null;attrib=obj.htmlattributes[attrName];if(attrib){x=attrib.indexOf(DOT);if(x>=0){if(obj.member){member=this._findSubMember(obj,obj.member,attrib,attrib)}}else{member=obj.member[attrib];if(member){return member}}}return member};MetaLib.prototype._findSubMember=function(obj,mem,attrName,subMemberPart){var member,ts,sm,rest,x,ret=null;x=subMemberPart.indexOf(DOT);if(x>=0){sm=subMemberPart.substring(0,x);rest=subMemberPart.substring(x+1)}else{sm=subMemberPart;rest=null}for(member in mem){member=mem[member];if(member.name===attrName&&!rest){ret=member;break}if(member.name!==sm){continue}if(!rest){ret=member;break}if(member.submember){ret=this._findSubMember(obj,member.submember,attrName,rest);if(ret){break}}else if(member.tstype){ts=this._getTsTypeObject(member);if(ts){ret=this._findSubMember(obj,ts.member,attrName,rest);if(ret){break}}}if(ret){break}}return ret};MetaLib.prototype._getTsTypeObject=function(mem){var ts,o,s,x;ts=mem.tstype;if(ts&&ts.target==="Type"&&typeof ts.value===STRING){s=ts.value;s=s.replace("=","");x=s.indexOf("|");if(x>=0){s=s.substring(0,x).trimRight()}if(s.charAt(s.length-1)===">"){x=s.lastIndexOf("<");if(s>=0){s=s.substring(0,x)}}o=this._json[s];if(!o){o=this._json[mem.memberof];if(o.typedef){s=ts.value;x=s.lastIndexOf(DOT);if(x>=0){s=s.substring(x+1);o=o.typedef[s]}}}}return o?o:null};MetaLib.prototype._getSubMemberPart=function(fullAttr,soFar){var s,x;s=fullAttr.replace(soFar,"");if(s.length){if(s.charAt(0)==="."){x=s.indexOf(DOT,1);if(x>=0){s=soFar+s.substring(0,x)}else{s=soFar+s}}}else{s=soFar}return s};MetaLib.prototype._handleAttrObject=function(member){var link,types,i,x;types=member.tstype;if(types){for(i=0;i<types.length;i++){if(types[i].target==="Type"){link=types[i].value;link=link.replace("=","");x=link.indexOf("<K");if(x>=0){link=link.substring(0,x)}break}}}return link};MetaLib.prototype.hasTagAttrValues=function(tagName,attrName){var member,ojv,ret=false;if(member=this._getTagAttrMemberObj(tagName,attrName)){ojv=this._getOjValues(member);ret=!!ojv}else if(this._components.isKnownTag(tagName)){ret=this._components.hasTagAttrValues(tagName,attrName)}return ret};MetaLib.prototype.isTagAttrValue=function(tagName,attrName,attrValue){var member,ojv,values,curValue,valType,i,ret=false;member=this._getTagAttrMemberObj(tagName,attrName);if(member){ojv=this._getOjValues(member);if(ojv){values=ojv.name;for(i=0;i<values.length;i++){if(ojv.type){valType=ojv.type[i];curValue=_convertValue(valType,attrValue);ret=curValue===values[i]}else{ret=attrValue===values[i]}if(ret){break}}}else{ret=true}}else{if(this._components.isKnownTag(tagName)){ret=this._components.isTagAttrValue(tagName,attrName,attrValue)}}return ret};MetaLib.prototype.isTagAttrEnumValueDeprecated=function(tagName,attrName,enumValue){var member,ojv,values,deps,dep,i,j,ret=null;member=this._getTagAttrMemberObj(tagName,attrName);if(!member){return this._isCompTagAttrEnumDepr(tagName,attrName,enumValue)}if(!member.ojdeprecated){return null}if(ojv=this._getOjValues(member)){values=ojv.name;for(i=0;i<values.length;i++){if(values[i]===enumValue){deps=member.ojdeprecated;for(j=0;j<deps.length;j++){dep=deps[j];if(dep.type&&dep.type!=="deprecated"){continue}if(dep.target==="propertyValue"&&dep.for===enumValue){ret={type:DEPRECATED,since:dep.since,description:dep.description};break}}}if(ret){break}}}return ret};MetaLib.prototype._isCompTagAttrEnumDepr=function(tagName,attrName,enumValue){return this._components?this._components.isTagAttrEnumDeprecated(tagName,attrName,enumValue):null};MetaLib.prototype.hasTagSlot=function(tagName){return this._getSlots(tagName)?true:false};MetaLib.prototype.hasTagDynamicSlot=function(tagName){var tag,b=false;tag=_removeChevrons(tagName);if(this.isJetLegacyTag(tag)){}else if(this._components){b=this._components.hasTagDynamicSlot(tag)}return b};MetaLib.prototype.isTagSlotName=function(tagName,slotName){var tag,slot;tag=_removeChevrons(tagName);if(this.isJetLegacyTag(tag)){slot=this._getSlotByName(this._getComponentFromTag(tag),slotName)}else if(this._components){if(!HtmlUtils.isCommonElem(tag)){slot=this._components.hasTagSlotName(tag,slotName)}}return!!slot};MetaLib.prototype.isTagSlotValue=function(tagName,slotName){return this.isTagSlotName(tagName,slotName)};MetaLib.prototype.isTagDynamicSlotValue=function(tagName,slotName){};MetaLib.prototype.getPreferredSlotContent=function(tag,slot){var obj,ret=null;if(obj=this.getPreferredSlotContentEx(tag,slot)){ret=obj.interfaces}return ret};MetaLib.prototype.getPreferredSlotContentEx=function(tag,slot){var ret;tag=_removeChevrons(tag);if(this.isJetTag(tag)){ret=this.getJetPreferredSlotContent(tag,slot)}else if(this._components&&this._implements){ret=this._components.getPreferredSlotContent(tag,slot,this._implements)}return ret};MetaLib.prototype.getJetPreferredSlotContent=function(tag,slot){var clazz,slot,prefContent,content,comps;if(!this._implements){return null}if(clazz=this._getComponentFromTag(tag)){if(clazz.slot){if(slot=clazz.slot[slot]){if(prefContent=slot.ojpreferredcontent){prefContent.forEach(impl=>{if(content=this._implements[impl]){if(!comps){comps=[]}comps.push(...content)}})}}}else{{let defMem;if(clazz.member&&(defMem=clazz.member["Default"])&&defMem.ojchild){if(prefContent=defMem.ojpreferredcontent){prefContent.forEach(impl=>{if(content=this._implements[impl]){if(!comps){comps=[]}comps.push(...content)}})}}}}}return prefContent||comps?{interfaces:prefContent,components:comps}:null};MetaLib.prototype.getTagSlotMetadata=function(tag,slot){var ret;tag=_removeChevrons(tag);if(this.isJetTag(tag)){ret=this._getJetTagSlotMetadata(tag,slot)}else if(this._components){ret=this._components.getTagSlotMetadata(tag,slot)}return ret};MetaLib.prototype._getJetTagSlotMetadata=function(tag,slot){var o,slots,slot,ret=null;if(o=this._getComponentFromTag(tag)){if(o.slot&&(slots=o.slot[slot])){if(slots=slots.ojdeprecated){let i;for(i=0;i<slots.length;i++){slot=slots[i];if(!slot.type||slot.type===DEPRECATED){ret={type:DEPRECATED};if(slot.hasOwnProperty("since")){ret.since=slot.since}if(slot.hasOwnProperty("description")){ret.description=slot.description}break}}}}}return ret};MetaLib.prototype.isTagSupportedInTheme=function(tag){var o,a,ret=true;o=this._getComponentFromTag(tag);if(o){if(o.header){a=o.header.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}}else{ret=this._components&&this._components.isTagSupportedInTheme(tag,this._theme)}return ret};MetaLib.prototype.isAttrSupportedInTheme=function(tag,attr){var o,a,ret=true;o=this._getTagAttrMemberObj(tag,attr);if(o){a=o.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}else{ret=this._components.isAttrSupportedInTheme(tag,attr,this._theme)}return ret};MetaLib.prototype.hasTagCompPropSubprop=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName];ret=ret&&ret.submember}else if(this._components){ret=this._components.getTagProp(tagName,propName);ret=ret&&ret.properties}}return ret};MetaLib.prototype.isTagCompProp=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName]}else if(this._components){ret=this._components.isTagProp(tagName,propName)}}return ret};MetaLib.prototype.getTagAttrType=function(tag,attr){var member=this._getTagAttrMemberObj(tag,attr);return member?member.type:this._components.getTagPropType(tag,attr)};MetaLib.prototype.getTagPropType=function(tagName,propName){var ret;if(this._components){ret=this._components.getTagPropType(tagName,propName)}return ret};MetaLib.prototype.getTagPropMetadata=function(tag,attr){var obj;if(this._components){obj=this._components.getUserComponentPropMetadata(tag,attr)}return obj};MetaLib.prototype.getTagMetadata=function(tag){var obj,comp,hdr,events,props,event,ret;tag=_removeChevrons(tag);if(obj=this._getComponentFromTag(tag)){if(hdr=obj.hdr){comp={};comp.name=hdr.customelement;if(hdr.slot){comp[PROP_SLOTS]=obj.slots}}if(obj.properties){comp[PROP_PROPS]=props={};this._extractProps(props,null,obj.properties,obj.name)}if(obj.events){comp[PROP_EVENTS]=events={};for(event in obj.events){}}if(obj.implements){comp[PROP_IMPLEMENTS]=obj.implements}if(obj.extension&&obj.extension.theme&&obj.extension.theme.unsupportedThemes){comp[PROP_UNSUP_THEME]=obj.extension.theme.unsupportedThemes}if(hdr&&hdr.ojsubcomponenttype){comp[PROP_SUBCOMPONENT_TYPE]=hdr.subcomponenttype}}else if(this._components){ret=this._components.getUserComponentMetadata(tag)}return ret};MetaLib.prototype.isTagStyleDeprecated=function(tagName,styleName){var o,ret;o=this.isWCStyleDeprecated(styleName);if(o){tagName=_removeChevrons(tagName);if(this._json.ojStyles.containers[o.index]===tagName){ret=o.dep.description}}return ret};MetaLib.prototype.isTagStyle=function(tagName,styleName){var obj,ret=false,compName,containers,indices,index,i;tagName=_removeChevrons(tagName);if(obj=this._getComponentFromTag(tagName)){compName=this._getComponentNameFromTag(tagName);containers=this._json.ojStyles.containers;indices=_getStyleIndices(this._json.ojStyles,styleName);if(indices){for(i=0;i<indices.length;i++){index=indices[i];if(index>=0){if(containers[index]===compName){ret=true;break}}}}}else{ret=this._components.isTagStyle(tagName)}return ret};MetaLib.prototype.isStyle=function(style){return this.isGenStyle(style)||this.isClassStyle(style)||this.isStylesetStyle(style)};MetaLib.prototype.isGenStyle=function(style){var x=this._json.genericStyles[style];return x||x===0?true:false};MetaLib.prototype.isJetStyle=function(style){return this._json.genericStyles[style]?"g":this._json.ojStyles[style]?"j":undefined};MetaLib.prototype.isCustomStyle=function(style){return this._components&&this._components.isStyle(style)};MetaLib.prototype.getStyleOrigin=function(style){var ret;if(this._json.genericStyles[style]){ret="g"}if(this._json.ojStyles[style]){ret=ret?"b":"j"}if(!ret&&this._components){if(this._components.isStyle(style)){ret="c"}}return ret};MetaLib.prototype.isClassStyle=function(style){var x=this._json.ojStyles[style];return x||x===0?true:false};MetaLib.prototype.isStylesetStyle=function(style){return this._stylesets?!!this._stylesets[style]:false};MetaLib.prototype.getStyleSelector=function(style,jet){var o,i,ret;if(typeof jet===BOOLEAN){o=jet?this._json.ojStyles[style]:this._json.genericStyles[style]}else{o=this._json.ojStyles[style];if(!o&&o!==0){o=this._json.genericStyles[style]}if(!o&&this._components){o=this._components.getStyleMetadata(style)}}if(this._utils.isObject(o)){if(o.styleselector){ret=o.styleselector}else if(o.meta){ret=o.meta.styleSelector}}else if(Array.isArray(o)){for(i=0;i<o.length;i++){if(this._utils.isObject(o[i])&&o[i].styleselector){if(!ret){ret=[]}ret.push(o[i].styleselector)}}if(ret&&ret.length===1){ret=ret[0]}}return ret?ret:null};MetaLib.prototype.isJetStylePrefix=function(s){var x;if(!s.startsWith(OJPREFIX)||!this._json.jetCssPrefixes.classes){return false}x=s.indexOf("-",3);if(x>=0){s=s.substring(0,x)}return this._json.jetCssPrefixes.classes.includes(s)};MetaLib.prototype.hasJetStylePrefixes=function(){return this._json.jetCssPrefixes&&this._json.jetCssPrefixes.classes};MetaLib.prototype.getClassesFromStyle=function(styleName,scope){var indices,oStyles,ret;scope=scope||"oj";if(scope==="oj"||scope==="both"){oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices)}}}if(scope==="gen"||scope==="both"){oStyles=this._json.genericStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){ret=_toContainers(oStyles,indices)}}}return ret?ret:null};MetaLib.prototype.getJetTagFromStyle=function(styleName){var indices,oStyles,clazz;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName)}if(indices){if(indices.length>1||indices.length===0){clazz=null}else{clazz=this.isGenStyle(styleName)?null:_toContainers(oStyles,indices)}}return clazz?this.getTagFromClass(clazz):null};MetaLib.prototype.getJetTagsFromStyle=function(styleName){var indices,oStyles;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices,this._json)}}return null};MetaLib.prototype.getClassFromTag=function(tagName){return this._getComponentNameFromTag(_removeChevrons(tagName))};MetaLib.prototype.getClassFromModule=function(module){var clazz=this._json.moduleLookup[module];return clazz?clazz:null};MetaLib.prototype.getTagFromClass=function(className){if(className==="oj.ojTree"){return"oj-tree"}let ret=this._json[className];return ret&&ret.header?ret.header.customelement:null};MetaLib.prototype.isClass=function(className){var b=this._json[className];if(!b){if(className=this._classChange[className]){b=this._json[className]}}return!!b};MetaLib.prototype.isClassFinal=function(className){var clazz=this._json[className];if(!clazz){if(className=this._classChange[className]){clazz=this._json[className]}}return clazz&&clazz.header&&clazz.header.readonly};MetaLib.prototype.isClassMethod=function(className,methName){var clazz=this._json[className];return!!(clazz&&clazz.function&&clazz.function[methName])};MetaLib.prototype.isClassMethodStatic=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth&&meth.scope&&meth.scope=="static"}return ret};MetaLib.prototype.getClassMethodScope=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth.scope}return ret};MetaLib.prototype.isClassMember=function(className,memName){var clazz=this._json[className];return!!(clazz&&clazz.member&&clazz.member[memName])};MetaLib.prototype.isClassMemberStatic=function(className,memName){var mem,ret=null;var clazz=this._json[className];if(clazz&&clazz.member){mem=clazz.member[memName];ret=mem&&mem.scope&&mem.scope=="static"}return ret};MetaLib.prototype.getRequiredAttrs=function(tagName){let obj,clazz,i,ret=null;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){clazz=this._getComponentNameFromTag(tagName)}ret=obj?this._reqAttrs[clazz]:this._components.getRequiredProps(tagName);if(obj&&ret&&ret.length){for(i=0;i<ret.length;i++){ret[i]=this._domUtils.kebabCase(ret[i])}}return ret};MetaLib.prototype.getTagsFromStyle=function(styleName){var classNames,tag,i,ret;ret=null;classNames=this.getClassesFromStyle(styleName);if(classNames){for(i=0;i<classNames.length;i++){tag=this.getTagFromClass(classNames[i]);if(tag){if(!ret){ret=[]}ret.push(tag)}}}return ret?ret:null};MetaLib.prototype.isStyleDeprecated=function(name){var s,o,t,i;s=this._json.genericStyles[name];if(!s&&s!==0&&this._json.ojStyles){s=this._json.ojStyles[name];if(!s&&s!==0&&this._stylesets){s=this._stylesets[name];return this._utils.isObject(s)?s:null}}if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[0];if(typeof o===OBJECT){break}}}else if(t==="object"){o=s}else{o=null}}return o?o.dep:null};MetaLib.prototype.isStyleDeprecatedEx=function(style){var a=null,ss,t,i;function _pushSS(o){if(o.dep){if(!a){a=[]}a.push(o)}};function _stashSS(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){_pushSS(s[i])}}else if(t==="object"){_pushSS(s)}};if(ss=this._json.genericStyles[style]){_stashSS(ss)}if(ss=this._json.ojStyles[style]){_stashSS(ss)}else if(ss!==0&&this._stylesets){ss=this._stylesets[style];return this._utils.isObject(ss)?ss:null}return a};MetaLib.prototype.isWCStyleDeprecated=function(name){var s,o,t,i;s=this._json.ojStyles[name];if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[i];if(typeof o===OBJECT){break}o=null}}else if(t==="object"){o=s}}return o?o:null};MetaLib.prototype.isBindingTag=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return obj&&obj.header?!!obj.header.ojbindingelement:false};MetaLib.prototype.isComponent=function(className){var obj=this._json[className];if(!obj){if(!className.startsWith("oj.")){obj=this._json["oj."+className]}}return!!obj};MetaLib.prototype.isClass=function(className){return!!this._json[className]};MetaLib.prototype.isJetComponentClass=function(className){return this.isClass(className)};MetaLib.prototype.isComponentDeprecated=function(className){return this.isClassDeprecated(className)};MetaLib.prototype.isClassDeleted=function(className){var classes,cn,version=null;if(this._delHist){if(classes=this._delHist.classes){cn=this._classChange[className];if(cn){className=cn}version=classes[className]}}return version};MetaLib.prototype.isClassRenamed=function(className){return this._renHist?this._renHist[className]:null};MetaLib.prototype.isClassDeprecated=function(className){var obj,ret=null;if(className==="oj.ojTree"){if(SemVer.gte(this._jetVer,"5.2.0")){return null}else{return{type:DEPRECATED,since:"5.2.0",description:"Use ojTreeView instead"}}}if(!(obj=this._json[className])){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj){if(obj.header){ret=this._isClassDeprecated(obj.header)}if(!ret){ret=this._isClassDeprecated(obj)}}return ret};MetaLib.prototype._isClassDeprecated=function(obj){var depr,status,ret=null;if(obj){if(obj.ojdeprecated&&obj.ojdeprecated.length){depr=obj.ojdeprecated;for(status of depr){if(!status.type||status.type===DEPRECATED){ret=status;if(!ret.type){ret.type=DEPRECATED}break}}}else if(depr=obj.deprecated){ret={type:DEPRECATED,description:typeof depr===BOOLEAN?NO_SUGGESTION_AVAIL:depr}}}return ret};MetaLib.prototype.isClassMethodDeleted=function(className,methodName){var a,cn,i,ret=null;a=this._deletedMethods[methodName];if(a){cn=this._classChange[className];if(cn){className=cn}for(i=0;i<a.length;i++){if(a[i]===className){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMethodDeprecated=function(className,methodName){var obj,method,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.function){for(method in obj.function){if(method===methodName){method=obj.function[method];ret=this._isSubStateDeprecated(method);break}}}return ret};MetaLib.prototype.isClassMemberDeleted=function(className,memberName){var a,i,cname,ret=null;a=this._deletedMembers[memberName];if(a){cname=this._classChange[className];for(i=0;i<a.length;i++){if(a[i]===className||a[i]===cname){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMemberDeprecated=function(className,memName){var obj,member,obj,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.member){memName=memName.charAt(0)===":"?memName.substr(1):memName;for(member in obj.member){if(member===memName){member=obj.member[memName];ret=this._isSubStateDeprecated(member,true);break}}}return ret};MetaLib.prototype.isClassAttrDeprecated=function(className,attrName){var obj,member,ret=null;obj=this._json[className];attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(obj&&obj.member){for(member in obj.member){member=obj.member[member];if(attrName===member.name){ret=this._isSubStateDeprecated(member,true);break}}}return ret};MetaLib.prototype.isComponentDeleted=function(className){return this.isClassDeleted(className)};MetaLib.prototype.isComponentAttrDeprecated=function(className,attrName){return this.isClassAttrDeprecated(className,attrName)};MetaLib.prototype.isComponentMethodDeprecated=function(className,methodName){return this.isClassMethodDeprecated(className,methodName)};MetaLib.prototype.isComponentMemberDeprecated=function(className,memberName){return this.isClassMemberDeprecated(className,memberName)};MetaLib.prototype.isComponentMethodDeleted=function(className,methodName){return this.isClassMethodDeleted(className,methodName)};MetaLib.prototype.isComponentMemberDeleted=function(className,memberName){return this.isClassMemberDeleted(className,memberName)};MetaLib.prototype.isTagPackPrivate=function(tag){var o,ret;if(!tag){return false}tag=_removeChevrons(tag);if(this.isJetTag(tag)){if(o=this._getComponentFromTag(tag)){ret=o.header&&o.header.ojsubcomponenttype===PACK_PRIVATE}}else if(this._components){ret=this._components.isTagPackPrivate(tag)}return ret};MetaLib.prototype.isTagAttrTranslatable=function(tag,attr){var member=this._getTagAttrMemberObj(tag,attr);return member?this._isSubStateTranslatable(member):this._components.isTagAttrTranslatable(tag,attr)};MetaLib.prototype.isTagAttrReadOnly=function(tag,attr){var o,ret=false;tag=_removeChevrons(tag);if(o=this._getTagAttrMemberObj(tag,attr)){ret=o&&o.readonly}else if(this._components){ret=this._components.isTagAttrReadOnly(tag,attr)}return ret};MetaLib.prototype.hasTagDataOjCommand=function(tagName){var obj,ret=false,compName,containers,indexes,i;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){compName=this._getComponentNameFromTag(tagName);indexes=this._json.dataOjCommand;if(indexes){containers=this._json.ojStyles.containers;for(i=0;i<indexes.length;i++){if(containers[indexes[i]]===compName){ret=true;break}}}}return ret};MetaLib.prototype.isTagEvent=function(tagName,eventName){var obj,attr,x,ret=false;eventName=eventName.charAt(0)===":"?eventName.substring(1):eventName;if(!eventName.startsWith(EVENT_PREFIX)){return ret}if(this.isWCTag(tagName)){if(this._getComponentNameFromTag(tagName)){obj=this._getComponentFromTag(_removeChevrons(tagName));if(obj&&obj.htmlevents){ret=!!obj.htmlevents[eventName]}if(!ret){if((x=eventName.lastIndexOf(DASH_CHANGED))>=0){attr=eventName.substring(3,x);attr=this._domUtils.camelCase(attr);ret=!!obj.member[attr]}}}else{ret=this._components&&this._components.isTagEvent(tagName,eventName)}if(!ret){ret=HtmlUtils.isCommonEventAttr(eventName)}}return ret};MetaLib.prototype.isTagMaintenance=function(tag){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tag))){}else{ret=this._components.isTagMaintenance(tag)}return ret};MetaLib.prototype.isTagSupersedes=function(tag){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tag))){}else{ret=this._components.isTagSupersedes(tag)}return ret};MetaLib.prototype.getTagMaintenanceStatus=function(tag){return this._getTagStatus(tag,MAINTENANCE)};MetaLib.prototype.getTagSupersedesStatus=function(tag){return this._getTagStatus(tag,SUPERSEDES)};MetaLib.prototype.getTagStatus=function(tag,type){var clazz,ret=null;if(type!==DEPRECATED&&type!==MAINTENANCE&&type!==SUPERSEDES){return null}if(clazz=this._getComponentNameFromTag(_removeChevrons(tag))){if(clazz==="oj.ojTree"){if(SemVer.gte(this._jetVer,"5.2.0")){return null}else{return{type:DEPRECATED,description:"Use ojTreeView instead"}}}let obj=this._json[clazz];if(obj&&obj.header){let arStat;if(Array.isArray(arStat=obj.header.ojdeprecated)){let stat,i,found;for(i=0;i<arStat.length;i++){stat=arStat[i];if(!stat.type){found=DEPRECATED}else if(stat.type===type){found=type}if(found===type){ret={type:found};if(stat.hasOwnProperty("since")){ret.since=stat.since}if(stat.hasOwnProperty("description")){ret.description=stat.description}break}}}else if(typeof arStat===STRING){ret={description:arStat}}}}else{ret=this._components.getTagStatus(tag,type)}return ret};MetaLib.prototype.applySchema=function(obj){return this._compSvcs.validateComponentJsonWithSchema(obj)};MetaLib.prototype.walkElemStackForOJTag=function(ctx,excludeBindIf){var i,name,ret=null;var stack=ctx.elemStack;if(stack&&stack.length){for(i=stack.length-1;i>=0;i--){name=stack[i].name;if(name.toLowerCase().startsWith(OJPREFIX)){if(!name.startsWith("oj-bind-")||!excludeBindIf){ret=name;break}}}}return ret};MetaLib.prototype.walkDomStackForOJTag=function(ctx,excludeBindIf){return this.walkElemStackForOJTag(ctx,excludeBindIf)};MetaLib.prototype.getPublicInterface=function(){return{isJetTag:this.isJetTag.bind(this),isWCTag:this.isWCTag.bind(this),isComponentTag:this.isComponentTag.bind(this),isTagDeprecated:this.isTagDeprecated.bind(this),isTagSupportedInTheme:this.isTagSupportedInTheme.bind(this),isAttrSupportedInTheme:this.isAttrSupportedInTheme.bind(this),isTagAttrDeprecated:this.isTagAttrDeprecated.bind(this),isTagAttrTranslatable:this.isTagAttrTranslatable.bind(this),isTagAttrReadOnly:this.isTagAttrReadOnly.bind(this),isTagEventDeprecated:this.isTagEventDeprecated.bind(this),isTagAttrEnumValueDeprecated:this.isTagAttrEnumValueDeprecated.bind(this),isTagAttr:this.isTagAttr.bind(this),isJetTagAttr:this.isJetTagAttr.bind(this),hasTagAttrValues:this.hasTagAttrValues.bind(this),isTagAttrValue:this.isTagAttrValue.bind(this),getTagAttrType:this.getTagAttrType.bind(this),getTagMetadata:this.getTagMetadata.bind(this),getTagPropMetadata:this.getTagPropMetadata.bind(this),getTagPropertyFromEvent:this.getTagPropertyFromEvent.bind(this),isTagCompProp:this.isTagCompProp.bind(this),hasTagCompPropSubprop:this.hasTagCompPropSubprop.bind(this),getTagPropType:this.getTagPropType.bind(this),hasTagSlot:this.hasTagSlot.bind(this),isTagSlotName:this.isTagSlotName.bind(this),isTagSlotValue:this.isTagSlotValue.bind(this),getPreferredSlotContent:this.getPreferredSlotContent.bind(this),getPreferredSlotContentEx:this.getPreferredSlotContentEx.bind(this),getTagSlotMetadata:this.getTagSlotMetadata.bind(this),hasTagDataOjCommand:this.hasTagDataOjCommand.bind(this),isBindingTag:this.isBindingTag.bind(this),isTagPackPrivate:this.isTagPackPrivate.bind(this),isTagMaintenance:this.isTagMaintenance.bind(this),isTagSupersedes:this.isTagSupersedes.bind(this),getTagMaintenanceStatus:this.getTagMaintenanceStatus.bind(this),getTagSupersedesStatus:this.getTagSupersedesStatus.bind(this),getTagStatus:this.getTagStatus.bind(this),isClass:this.isClass.bind(this),isClassRenamed:this.isClassRenamed.bind(this),isClassDeleted:this.isClassDeleted.bind(this),isClassDeprecated:this.isClassDeprecated.bind(this),isClassMethodDeleted:this.isClassMethodDeleted.bind(this),isClassMemberDeleted:this.isClassMemberDeleted.bind(this),isClassMethodDeprecated:this.isClassMethodDeprecated.bind(this),isClassMemberDeprecated:this.isClassMemberDeprecated.bind(this),isClassAttrDeprecated:this.isClassAttrDeprecated.bind(this),isClassFinal:this.isClassFinal.bind(this),isClassMethod:this.isClassMethod.bind(this),isClassMethodStatic:this.isClassMethodStatic.bind(this),isClassMember:this.isClassMember.bind(this),isClassMemberStatic:this.isClassMemberStatic.bind(this),getClassMethodScope:this.getClassMethodScope.bind(this),getStyleOrigin:this.getStyleOrigin.bind(this),isJetStyle:this.isJetStyle.bind(this),isCustomStyle:this.isCustomStyle.bind(this),isTagStyle:this.isTagStyle.bind(this),isStyle:this.isStyle.bind(this),isGenStyle:this.isGenStyle.bind(this),isClassStyle:this.isClassStyle.bind(this),isStylesetStyle:this.isStylesetStyle.bind(this),isStyleDeprecated:this.isStyleDeprecated.bind(this),isStyleDeprecatedEx:this.isStyleDeprecatedEx.bind(this),getStyleSelector:this.getStyleSelector.bind(this),getNonSSStyleElems:this.getNonSSStyleElems.bind(this),isJetStylePrefix:this.isJetStylePrefix.bind(this),hasJetStylePrefixes:this.hasJetStylePrefixes.bind(this),isTagEvent:this.isTagEvent.bind(this),getTagsFromStyle:this.getTagsFromStyle.bind(this),getJetTagFromStyle:this.getJetTagFromStyle.bind(this),getJetTagsFromStyle:this.getJetTagsFromStyle.bind(this),getClassesFromStyle:this.getClassesFromStyle.bind(this),getClassFromTag:this.getClassFromTag.bind(this),getClassFromModule:this.getClassFromModule.bind(this),getTagFromClass:this.getTagFromClass.bind(this),getDeprecatedMethodList:this.getDeprecatedMethodList.bind(this),getDeprecatedMemberList:this.getDeprecatedMemberList.bind(this),getDeletedMethodList:this.getDeletedMethodList.bind(this),getDeletedMemberList:this.getDeletedMemberList.bind(this),getRequiredAttrs:this.getRequiredAttrs.bind(this),isComponent:this.isComponent.bind(this),isNSRegistered:this.isNSRegistered.bind(this),isNamespacePrefix:this.isNamespacePrefix.bind(this),isRuleIgnored:this.isRuleIgnored.bind(this),getRenamedClassList:this.getRenamedClassList.bind(this),getDeletedClassList:this.getDeletedClassList.bind(this),processImplements:this.processImplements.bind(this),getInterfaces:this.getInterfaces.bind(this),getImplementers:this.getImplementers.bind(this),getSubcomponentType:this.getSubcomponentType.bind(this),getWCInterfaces:this.getWCInterfaces.bind(this),hasWCInterfaces:this.hasWCInterfaces.bind(this),hasJetWCInterfaces:this.hasJetWCInterfaces.bind(this),getMetaVers:this.getMetaVers.bind(this),walkElemStackForOJTag:this.walkelemStackForOJTag,walkDomStackForOJTag:this.walkDomStackForOJTag,isIgnoreAttr:this.isIgnoreAttr.bind(this),applySchema:this.applySchema.bind(this),getRevisionInfo:this.getRevisionInfo.bind(this)}};MetaLib.prototype.loadMeta=function(metaFile){var metaObj,ret=false;if(!this._json){try{if(metaObj=this._nd.metaLoader.loadMeta(metaFile,this._nd,this._fsUtils)){this._json=metaObj.meta;this._delHist=metaObj.delMeta;this._renHist=metaObj.renMeta;this._reqAttrs=metaObj.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();this._createClassNameChanges();this._fixup_jet_42315();this._createImplements();ret=true}else{this._error(`Metadata '${metaFile}' not found!`)}}catch(e){this._error(`[${e.name}]: Metadata load (${metaFile}) - ${e.message}`)}}return ret};MetaLib.prototype.getRenamedClassList=function(){return this._renHist};MetaLib.prototype.getDeletedClassList=function(){return this._delHist};MetaLib.prototype.processImplements=function(tag,impls){if(Array.isArray(impls)&&this._implements){impls.forEach(impl=>{if(this._implements[impl]){this._implements[impl].push(tag)}else{this._implements[impl]=[tag]}})}};const OJV_CHARS=/[<>]/;MetaLib.prototype._getOjValues=function(mem){var ts,ret;if(!mem){return false}if(mem.ojvalues){if(mem.ojvalues.name&&Array.isArray(mem.ojvalues.name)&&mem.ojvalues.name.length){return mem.ojvalues}return}if(mem.tstype&&mem.tstype.m_ojvalues){return mem.tstype.m_ojvalues}ts=this._getTsTypeObject(mem);if(ts&&ts.ojvalues&&ts.ojvalues.name){if(Array.isArray(ts.ojvalues.name)&&ts.ojvalues.name.length){ret=ts.ojvalues}}return ret};MetaLib.prototype.getImplementers=function(ifc){var ret;if(this._implements&&ifc){ret=this._implements[ifc]}return ret||null};MetaLib.prototype.getInterfaces=function(tag){var obj,hdr,impls,ret;if(!tag){return null}tag=_removeChevrons(tag);if(this.isJetTag(tag)){if(obj=this._getComponentFromTag(tag)){if(hdr=obj.header){if(hdr.domInterface&&hdr.customelement){impls=hdr.domInterface;ret=Array.isArray(impls)?impls:[impls]}}}}else if(this.isComponentTag(tag)){ret=this._components.getInterfaces(tag)}return ret||null};MetaLib.prototype.getWCInterfaces=function(){return this._implements};MetaLib.prototype.hasJetWCInterfaces=function(){return this._hasJetWCIFCs};MetaLib.prototype.hasWCInterfaces=function(){return!!this._implements};MetaLib.prototype.getSubcomponentType=function(tag){var obj,hdr,ret;if(tag=_removeChevrons(tag)){if(this.isJetTag(tag)){if(obj=this._getComponentFromTag(tag)){if(hdr=obj.header){ret=hdr.ojsubcomponenttype}}}else if(this.isComponentTag(tag)){ret=this._components.getSubcomponentType(tag)}}return ret||null};MetaLib.prototype._createNonClassList=function(mp){this._nonClasses=mp.nonClasses?mp.nonClasses:["genericStyles","ojStyles"];this._nonClasses.push("moduleLookup");this._nonClasses.push("newGenericStyles");this._nonClasses.push("newOjStyles");if(!this._nonClasses.includes("custElementClassLookup"))this._nonClasses.push("custElementClassLookup");if(!this._nonClasses.includes("meta"))this._nonClasses.push("meta");if(!this._nonClasses.includes("ResponsivePrefixes"))this._nonClasses.push("ResponsivePrefixes")};MetaLib.prototype.setAmdMeta=function(obj){this._json=obj.jetMeta.meta;this._delHist=obj.jetMeta.delMeta;this._reqAttrs=obj.jetMeta.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();return true};MetaLib.prototype.setTheme=function(theme){this._theme=theme};MetaLib.prototype._createModuleLookup=function(){var comps,compName,lookup,hdr;if(this._json.moduleLookup){return}this._json.moduleLookup=lookup={};comps=this._json;for(compName in comps){if(!this._nonClasses.includes(compName)&&!compName.startsWith("oj.__")){hdr=comps[compName].header;if(hdr){lookup[OJS+hdr.name.toLowerCase()]=compName}}}};MetaLib.prototype._createClassNameChanges=function(){var comps,compName,o,hdr;if(this._classChange=this._json.meta.isClassNameChanges){return}this._classChange=o={};comps=this._json;for(compName in comps){if(!this._nonClasses.includes(compName)){hdr=comps[compName].header;if(hdr&&compName!==hdr.name){o[hdr.name]=compName}}}this._json.meta.isClassNameChanges=true};MetaLib.prototype._fixup_jet_42315=function(){var o;if(SemVer.gte(this._jetVer,"8.0.0")){if(o=this._json.Color||this._json["oj.Color"]||this._json["oj.ojColor"]){if(!o.header){o.header={}}o.header.readonly=true}}};MetaLib.prototype._createImplements=function(){var clazzes,clazz,tag,impls,impl,o={},a,hdr;if(this._implements=this._json.meta.interfaces){return}clazzes=this._json;for(clazz in clazzes){if(this._nonClasses.includes(clazz)){continue}if(hdr=clazzes[clazz].header){if(hdr.domInterface&&hdr.customelement){impls=hdr.domInterface;impls=Array.isArray(impls)?impls:[impls];for(impl of impls){if(o[impl]){a=o[impl]}else{o[impl]=a=[]}this._hasJetWCIFCs=true;tag=this.getTagFromClass(clazz);if(tag&&!a.includes(tag)){a.push(tag)}}}}}this._implements=this._hasJetWCIFCs?o:null};MetaLib.prototype.getMetaVers=function(){return{versions:this._jetVersions,runver:this._jetVer}};MetaLib.prototype.setComponentsLib=function(compSvcs,comps){if(compSvcs){this._compSvcs=compSvcs}if(comps){this._components=comps}};MetaLib.prototype.setStylesets=function(ss){if(!ss){return}var o,obj,e,i;if(!this._stylesets){this._stylesets=obj={}}else{obj=this._stylesheets}for(i=0;i<ss.length;i++){o=ss[i];if(typeof o===STRING){obj[o]=true}else if(o.deprecated){obj[o.deprecated]=e={};if(o.since){e.since=o.since}if(o.note){e.description=o.note}else if(o.description){e.description=o.description}}}};MetaLib.prototype.setDomUtils=function(du){this._domUtils=du};MetaLib.prototype.getDomUtils=function(){return this._domUtils};MetaLib.prototype.getRevisionInfo=function(){var metaSect=this._json.meta;var revision="";return{revision:revision,tag:metaSect.jetrevision,jetVersion:metaSect.jetversion,date:metaSect.date,time:metaSect.time}};MetaLib.prototype._isSubStateDeprecated=function(obj,isMember){var depr,retStatus=null,o;if(!obj){return false}if(obj.ojdeprecated&&obj.ojdeprecated.length){retStatus=[];depr=obj.ojdeprecated;depr.forEach(status=>{o={type:DEPRECATED};if(status.hasOwnProperty("target")){o.target=status.target;if(isMember&&status.target==="memberType"){o.target="propertyType"}}if(status.hasOwnProperty("description")){o.description=status.description}if(status.hasOwnProperty("since")){o.since=status.since}if(status.hasOwnProperty("for")){o.value=[status.for]}else if(status.hasOwnProperty("value")){o.value=status.value}retStatus.push(o)});retStatus=retStatus.length?retStatus:null}else if(depr=obj.deprecated){retStatus=typeof depr===BOOLEAN?NO_SUGGESTION_AVAIL:depr;retStatus=[{type:DEPRECATED,description:retStatus}]}return retStatus};MetaLib.prototype._isSubStateTranslatable=function(obj){return obj&&obj.ojtranslatable};MetaLib.prototype._getComponentNameFromTag=function(tagName){var ret;if(tagName){tagName=tagName.toLowerCase();ret=this._json.custElementClassLookup[tagName]?this._json.custElementClassLookup[tagName]:null}else{ret=false}return ret};MetaLib.prototype.isIgnoreAttr=function(tagName,attrName){var ret=false;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(HtmlUtils.isCommonElem(attrName)||attrName.startsWith("aria-")){return true}if(tagName==="oj-avatar"){if(attrName==="src"||attrName==="initials")ret=true}else if(tagName==="oj-option"){if(attrName==="value")ret=true}return ret};MetaLib.prototype.getDeprecatedMethodList=function(){if(this._deprecatedMethods){return this._deprecatedMethods}var json=this._json;var name,methName,methObj,o,a;var ret={};for(name in json){o=json[name];if(o&&o.function){for(methName in o.function){methObj=o.function[methName];if(methObj.ojdeprecated){if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name)}}}}return this._deprecatedMethods=ret};MetaLib.prototype.getDeprecatedMemberList=function(){if(this._deprecatedMembers){return this._deprecatedMembers}var json=this._json;var name,memName,memObj,o,a;var ret={};for(name in json){o=json[name];if(o&&o.member){for(memName in o.member){memObj=o.member[memName];if(memObj.ojdeprecated){if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name)}}}}return this._deprecatedMembers=ret};MetaLib.prototype.getDeletedMethodList=function(){if(this._deletedMethods){return this._deletedMethods}var json=this._delHist;var name,methName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.methods){for(methName in o.methods){ver=o.methods[methName];if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMethods=ret};MetaLib.prototype.getDeletedMemberList=function(){if(this._deletedMembers){return this._deletedMembers}var json=this._delHist;var name,memName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.members){for(memName in o.members){ver=o.members[memName];if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMembers=ret};MetaLib.prototype._getSlots=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return this._getSlots2(obj)};MetaLib.prototype._getSlots2=function(base){var bases,base,i,ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){break}bases=base.header&&base.header.augments?base.header.augments:null;if(!bases){break}for(i=0;i<bases.length;i++){base=this._json[bases[i]];ret=this._getSlots2(base);if(ret){base=null;break}}}return ret?ret:null};MetaLib.prototype._getSlotByName=function(base,slotName){var ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){ret=base.slot[slotName];if(ret){break}}break}return ret?ret:null};MetaLib.prototype._getComponentFromTag=function(tagName){var o=this._getComponentNameFromTag(tagName);if(o){o=this._json[o]}return o?o:null};function _getStyleIndices(scope,styleName){var a,n,ret,i;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n===OBJECT){n=a[i].index}ret.push(n)}}else{if(typeof a===OBJECT){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?ret:null};MetaLib.prototype.getNonSSStyleElems=function(styleName,scope){var a,n,ret,i;scope=scope?this._json.ojStyles:this._json.genericStyles;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n===OBJECT&&!n.styleselector){n=a[i].index}ret.push(n)}}else{if(typeof a===OBJECT&&!a.styleselector){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?_toContainers(scope,ret,this._json):null};MetaLib.prototype.displayImpls=function(){var impls,impl;this._console("[info] :--------- JET Interfaces Implemented ---------","I");if(!(impls=this._implements)){this._console(" None!","I")}else{for(impl in impls){this._console(`${impl} : <- <${impls[impl].join(",")}>`,"I")}}this._console("[info]: -------- End Declared Web Components ---------\n","I")};function _toContainers(scope,indices,json){var cont,ret,clazz,elem,n,i;cont=scope.containers;for(i=0;i<indices.length;i++){n=indices[i];if(n>=0){if(!ret){ret=[]}if(!json){ret[i]=cont[n]}else{clazz=cont[n];elem=json[clazz];if(elem&&elem.header){elem=elem.header.customelement;if(elem){ret[i]=elem}}}}}return ret&&ret.length?ret:null};function _convertValue(valType,value){var retValue=value;if(valType===STRING){retValue=value}else if(valType==="number"){retValue=Number(value)}else if(valType==="boolean"){retValue=value.toLowerCase()==="true"}return retValue};function _removeChevrons(tagName){if(tagName){let len=tagName.length-1;let start=tagName.charAt(0)==="<"?1:0;let end=tagName.charAt(len)===">"?len:++len;tagName=tagName.substring(start,end)}return tagName};module.exports=MetaLib;
6
+ "use strict";const Namespaces=require("./ns");const HtmlUtils=require("./HtmlUtils");const SemVer=require("semver");const OJ_NAMESPACE_PREFIXES=require("./ns");const NO_SUGGESTION_AVAIL="No suggestion available.";const OJPREFIX="oj-";const OJEVENTPREFIX="on-oj-";const OJS="ojs/oj";const EVENT_ON_DASH="on-";const EVENT_ON="on";const DOT=".";const DATA_OJ_CMD="data-oj-command";const DASH_CHANGED="-changed";const CHANGED="Changed";const PROP_SLOTS="slots";const PROP_PROPS="props";const PROP_EVENTS="events";const PROP_IMPLEMENTS="implements";const PROP_FOLDER="folder";const PROP_VERSION="version";const PROP_UNSUP_THEME="unsupTheme";const PROP_SUBCOMPONENT_TYPE="subcomponentType";const PACK_PRIVATE="packPrivate";const ANTIPATTERN="antiPattern";const DEPRECATED="deprecated";const MAINTENANCE="maintenance";const SUPERSEDES="supersedes";const FT_TSX="tsx";const STRING="string";const BOOLEAN="boolean";const OBJECT="object";function MetaLib(nd,runMode,msgCtx,utils,fsUtils){this._json=null;this._delHist=null;this._renHist=null;this._reqAttrs=null;this._nonClasses=null;this._implements=null;this._hasJetWCIFCs=false;this._components=null;this._compSvcs=null;this._stylesets=null;this._runMode=runMode;this._utils=utils;this._fsUtils=fsUtils;this._domUtils=null;if(nd.jetver){this._jetVersions=nd.jetver.getVersions()}this._jetVer=null;this._theme=null;this._curFileType=null;this._deprecatedMethods=null;this._deprecatedMembers=null;this._deletedMethods=null;this._deletedMembers=null;this._error=msgCtx.error;this._debug=msgCtx.debug;this._info=msgCtx.info;this._msg=msgCtx.msg;this._console=msgCtx.console;this._isDebug=msgCtx.isdebug;this._isVerbose=msgCtx.isVerbose;this._nd=nd};MetaLib.prototype.isNSRegistered=function(prefix){return Namespaces.has(prefix)};MetaLib.prototype.isNamespaceTag=function(tagName){var s=tagName.replace(/[<>]/g,"");var x,ret=false;if(tagName.startsWith("demo-")||tagName.startsWith("my-")||tagName.startsWith("ns-")){return true}while(true){x=s.lastIndexOf("-");if(x>=0){s=s.substring(0,x);if(s.lastIndexOf("-")<0&&s==="oj"){break}if(OJ_NAMESPACE_PREFIXES.has(s)){ret=true;break}}else{break}}if(!ret&&this.isJetTag(tagName)){ret=true}return ret};MetaLib.prototype.isNamespacePrefix=function(tagName){return this.isNamespaceTag(tagName)};MetaLib.prototype.isRuleIgnored=function(tagName,ruleName){var o,ret=false;if(o=this._getComponentFromTag(tagName)){if(o.extension&&o.extension.audit&&o.extension.audit.ignore){let ar=o.extension.audit.ignore;if(ar&&ar.length){ret=ar.includes(ruleName)}}}else{ret=this._components&&this._components.isRuleIgnored(tagName,ruleName)}return ret};MetaLib.prototype.isCoreTag=function(tag){return this._components.isJetTag(tag)};MetaLib.prototype.isJetLegacyTag=function(tag){return this._getComponentNameFromTag(_removeChevrons(tag))};MetaLib.prototype.isJetTag=function(tagName){return!!(this._components.isJetTag(tagName)||this._getComponentNameFromTag(_removeChevrons(tagName)))};MetaLib.prototype.isComponentTag=function(tagName){if(!tagName){return false}return this._components&&this._components.isTag(_removeChevrons(tagName))};MetaLib.prototype.isWCTag=function(tagName){return this.isJetTag(tagName)||this.isComponentTag(tagName)};MetaLib.prototype.isCCATag=function(tagName){if(!tagName){return false}return this.isWCTag(tagName)};MetaLib.prototype.isTagDeprecated=function(tagName){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tagName))){ret=this.isClassDeprecated(clazz)}else{ret=this._components.isTagDeprecated(tagName)}return ret};MetaLib.prototype.isTagAttrDeprecated=function(tagName,attrName){var member,ret=null;if(!attrName){return null}member=this._getTagAttrMemberObj(tagName,attrName);ret=member?this._isSubStateDeprecated(member,true):this._components.isTagAttrDeprecated(tagName,attrName);if(ret){ret.forEach(status=>{if(status.description){status.description=HtmlUtils.replaceEntities(status.description)}})}return ret};MetaLib.prototype.isTagEventDeprecated=function(tag,attr){var comp,member,ev,deps,retStatus=null;if(comp=this._getComponentFromTag(tag)){if(!comp.event&&!comp.member){return null}if(ev=this.getTagPropertyFromEvent(tag,attr)){if(comp.event&&(member=comp.event[ev])||comp.htmlattributes&&(member=comp.member[ev])){if(deps=member.ojdeprecated){if(deps.length){retStatus=this._createLegacyDeprecatedStatus(deps,true)}}}}}else{retStatus=this._components.isTagEventDeprecated(tag,attr)}return retStatus};MetaLib.prototype.getTagPropertyFromEvent=function(tag,event){var comp,ev;if(comp=this._getComponentFromTag(tag)){if(this._curFileType===FT_TSX){event=this._domUtils.kebabCase(event)}if(comp.htmlevents&&(ev=comp.htmlevents[event])||event.endsWith(DASH_CHANGED)&&(ev=comp.htmlattributes[event])){if(!(comp.event&&comp.event[ev])){if(ev.endsWith(CHANGED)){ev=ev.substring(0,ev.length-CHANGED.length)}}}}return ev};MetaLib.prototype.isTagAttr=function(tagName,attrName){var o,ret=false;if(!attrName){return false}attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(o=this._getComponentFromTag(tagName)){ret=this.isJetTagAttr(o,attrName)}else{ret=this._components&&this._components.isTagAttr(tagName,attrName)}return ret};MetaLib.prototype.isJetTagAttr=function(tagObj,attrName){var ret;if(!attrName){return false}attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;ret=this._curFileType===FT_TSX?tagObj.member[attrName]:tagObj.htmlattributes&&tagObj.htmlattributes[attrName];if(!ret&&attrName===DATA_OJ_CMD&&tagObj.member){ret=tagObj.member[DATA_OJ_CMD]}return!!ret};MetaLib.prototype._getTagAttrMemberObj=function(tagName,attrName){var obj,attrib,member,x;if(!attrName){return null}obj=this._getComponentFromTag(_removeChevrons(tagName));attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(this._curFileType===FT_TSX){attrName=this._domUtils.kebabCase(attrName)}if(!obj||!obj.htmlattributes||!obj.htmlattributes[attrName]){return null}member=null;attrib=obj.htmlattributes[attrName];if(attrib){x=attrib.indexOf(DOT);if(x>=0){if(obj.member){member=this._findSubMember(obj,obj.member,attrib,attrib)}}else{member=obj.member[attrib];if(member){return member}}}return member};MetaLib.prototype._findSubMember=function(obj,mem,attrName,subMemberPart){var member,ts,sm,rest,x,ret=null;x=subMemberPart.indexOf(DOT);if(x>=0){sm=subMemberPart.substring(0,x);rest=subMemberPart.substring(x+1)}else{sm=subMemberPart;rest=null}for(member in mem){member=mem[member];if(member.name===attrName&&!rest){ret=member;break}if(member.name!==sm){continue}if(!rest){ret=member;break}if(member.submember){ret=this._findSubMember(obj,member.submember,attrName,rest);if(ret){break}}else if(member.tstype){ts=this._getTsTypeObject(member);if(ts){ret=this._findSubMember(obj,ts.member,attrName,rest);if(ret){break}}}if(ret){break}}return ret};MetaLib.prototype._getTsTypeObject=function(mem){var ts,o,s,x;ts=mem.tstype;if(ts&&ts.target==="Type"&&typeof ts.value===STRING){s=ts.value;s=s.replace("=","");x=s.indexOf("|");if(x>=0){s=s.substring(0,x).trimRight()}if(s.charAt(s.length-1)===">"){x=s.lastIndexOf("<");if(s>=0){s=s.substring(0,x)}}o=this._json[s];if(!o){o=this._json[mem.memberof];if(o.typedef){s=ts.value;x=s.lastIndexOf(DOT);if(x>=0){s=s.substring(x+1);o=o.typedef[s]}}}}return o?o:null};MetaLib.prototype._getSubMemberPart=function(fullAttr,soFar){var s,x;s=fullAttr.replace(soFar,"");if(s.length){if(s.charAt(0)==="."){x=s.indexOf(DOT,1);if(x>=0){s=soFar+s.substring(0,x)}else{s=soFar+s}}}else{s=soFar}return s};MetaLib.prototype._handleAttrObject=function(member){var link,types,i,x;types=member.tstype;if(types){for(i=0;i<types.length;i++){if(types[i].target==="Type"){link=types[i].value;link=link.replace("=","");x=link.indexOf("<K");if(x>=0){link=link.substring(0,x)}break}}}return link};MetaLib.prototype.hasTagAttrValues=function(tagName,attrName){var member,ojv,ret=false;if(!attrName){return false}if(member=this._getTagAttrMemberObj(tagName,attrName)){ojv=this._getOjValues(member);ret=!!ojv}else if(this._components.isKnownTag(tagName)){ret=this._components.hasTagAttrValues(tagName,attrName)}return ret};MetaLib.prototype.isTagAttrValue=function(tagName,attrName,attrValue){var member,ojv,values,curValue,valType,i,ret=false;if(!attrName){return false}member=this._getTagAttrMemberObj(tagName,attrName);if(member){ojv=this._getOjValues(member);if(ojv){values=ojv.name;for(i=0;i<values.length;i++){if(ojv.type){valType=ojv.type[i];curValue=_convertValue(valType,attrValue);ret=curValue===values[i]}else{ret=attrValue===values[i]}if(ret){break}}}else{ret=true}}else{if(this._components.isKnownTag(tagName)){ret=this._components.isTagAttrValue(tagName,attrName,attrValue)}}return ret};MetaLib.prototype.isTagAttrEnumValueDeprecated=function(tagName,attrName,enumValue){var member,ojv,values,deps,dep,i,j,ret=null;if(!attrName){return null}member=this._getTagAttrMemberObj(tagName,attrName);if(!member){return this._isCompTagAttrEnumDepr(tagName,attrName,enumValue)}if(!member.ojdeprecated){return null}if(ojv=this._getOjValues(member)){values=ojv.name;for(i=0;i<values.length;i++){if(values[i]===enumValue){deps=member.ojdeprecated;for(j=0;j<deps.length;j++){dep=deps[j];if(dep.type&&dep.type!=="deprecated"){continue}if(dep.target==="propertyValue"&&dep.for===enumValue){ret={type:DEPRECATED,since:dep.since,description:dep.description};break}}}if(ret){break}}}return ret};MetaLib.prototype._isCompTagAttrEnumDepr=function(tagName,attrName,enumValue){if(!attrName){return null}return this._components?this._components.isTagAttrEnumDeprecated(tagName,attrName,enumValue):null};MetaLib.prototype.hasTagSlot=function(tagName){var ret;if(this.isJetLegacyTag(tagName)){ret=this._getSlots(tagName)?true:false}else if(this._components){this._components.hasTagSlot(tagName)}return ret};MetaLib.prototype.hasTagDefaultSlot=function(tag){return this.isTagSlotName(tag,"")};MetaLib.prototype.hasTagDynamicSlot=function(tagName){var tag,b=false;tag=_removeChevrons(tagName);if(this.isJetLegacyTag(tag)){}else if(this._components){b=this._components.hasTagDynamicSlot(tag)}return b};MetaLib.prototype.isTagSlotName=function(tagName,slotName){var tag,slot;tag=_removeChevrons(tagName);slotName=slotName?slotName:"";if(this.isJetLegacyTag(tag)){slot=this._getSlotByName(this._getComponentFromTag(tag),slotName)}else if(this._components){if(!HtmlUtils.isCommonElem(tag)){slot=this._components.hasTagSlotName(tag,slotName)}}return!!slot};MetaLib.prototype.isTagSlotValue=function(tagName,slotName){return this.isTagSlotName(tagName,slotName)};MetaLib.prototype.isTagDynamicSlotValue=function(tagName,slotName){};MetaLib.prototype.getPreferredSlotContent=function(tag,slot){var obj,ret=null;if(obj=this.getPreferredSlotContentEx(tag,slot)){ret=obj.interfaces}return ret};MetaLib.prototype.getPreferredSlotContentEx=function(tag,slot){var ret;tag=_removeChevrons(tag);slot=slot?slot:"";if(this.isJetLegacyTag(tag)){ret=this.getJetPreferredSlotContent(tag,slot)}else if(this._components&&this._implements){ret=this._components.getPreferredSlotContent(tag,slot,this._implements)}return ret};MetaLib.prototype.getJetPreferredSlotContent=function(tag,slot){var clazz,slot,prefContent,content,comps;if(!this._implements||!(clazz=this._getComponentFromTag(tag))){return null}if(!slot){let defMem;if(clazz.member&&(defMem=clazz.member["Default"])&&defMem.ojchild){if(prefContent=defMem.ojpreferredcontent){prefContent.forEach(impl=>{if(content=this._implements[impl]){if(!comps){comps=[]}comps.push(...content)}})}}}else{if(clazz.slot){if(slot=clazz.slot[slot]){if(prefContent=slot.ojpreferredcontent){prefContent.forEach(impl=>{if(content=this._implements[impl]){if(!comps){comps=[]}comps.push(...content)}})}}}}return prefContent||comps?{interfaces:prefContent,components:comps}:null};MetaLib.prototype.isTagSlotDeprecated=function(tag,slotName){var status,md,ret;md=this.getTagSlotMetadata(tag,slotName);if(md&&(status=md.status)){let stat;for(let i=0;i<status.length;i++){stat=status[i];if(!stat.type||stat.type===DEPRECATED){ret=stat;break}}}return ret?ret:null};MetaLib.prototype.getTagSlotMetadata=function(tag,slot){var ret;tag=_removeChevrons(tag);if(this.isJetLegacyTag(tag)){ret=this._getJetTagSlotMetadata(tag,slot)}else if(this._components){ret=this._components.getTagSlotMetadata(tag,slot)}return ret};MetaLib.prototype._getJetTagSlotMetadata=function(tag,slotName){var o,slot;if(!(o=this._getComponentFromTag(tag))){return null}if(!o.slot||!(slot=o.slot[slotName])){return null}let deps,ret={};if(slot.ojpreferredcontent){ret.preferredContent=slot.ojpreferredcontent}if(slot.hasOwnProperty("ojminitems")){ret.minItems=slot.ojminitems}if(slot.hasOwnProperty("ojmaxitems")){ret.maxItems=slot.ojmaxitems}if(deps=slot.ojdeprecated){let dep,oStat,i;ret.status=[];for(i=0;i<deps.length;i++){dep=deps[i];oStat={};if(dep.hasOwnProperty("type")){oStat.type=dep.type}if(!dep.type||dep.type===DEPRECATED){if(dep.hasOwnProperty("target")){oStat.target=dep.target}if(dep.hasOwnProperty("for")){oStat.for=dep.for}if(dep.hasOwnProperty("value")){oStat.value=dep.value}}else if(dep.type===ANTIPATTERN){if(dep.hasOwnProperty("themes")){oStat.themes=dep.themes}}if(dep.hasOwnProperty("since")){oStat.since=dep.since}if(dep.hasOwnProperty("description")){oStat.description=dep.description}ret.status.push(oStat)}}return ret};MetaLib.prototype.isTagSupportedInTheme=function(tag){var o,a,ret=true;o=this._getComponentFromTag(tag);if(o){if(o.header){a=o.header.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}}else{ret=this._components&&this._components.isTagSupportedInTheme(tag,this._theme)}return ret};MetaLib.prototype.isAttrSupportedInTheme=function(tag,attr){var o,a,ret=true;o=this._getTagAttrMemberObj(tag,attr);if(o){a=o.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}else{ret=this._components.isAttrSupportedInTheme(tag,attr,this._theme)}return ret};MetaLib.prototype.hasTagCompPropSubprop=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName];ret=ret&&ret.submember}else if(this._components){ret=this._components.getTagProp(tagName,propName);ret=ret&&ret.properties}}return ret};MetaLib.prototype.isTagCompProp=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName]}else if(this._components){ret=this._components.isTagProp(tagName,propName)}}return ret};MetaLib.prototype.getTagAttrType=function(tag,attr){var member=this._getTagAttrMemberObj(tag,attr);return member?member.type:this._components.getTagPropType(tag,attr)};MetaLib.prototype.getTagAttrTypeEx=function(tag,attr){var ret={};var member=this._getTagAttrMemberObj(tag,attr);var t=member?member.type:this._components.getTagPropType(tag,attr);ret.raw=t;ret.types=t.split("|");ret.types.forEach((v,i,ar)=>{v=v.trim().toLowerCase().replace("array","Array");ar[i]=v.replace(">.",">")});return ret};MetaLib.prototype.getTagPropType=function(tagName,propName){return this._components?this._components.getTagPropType(tagName,propName):null};MetaLib.prototype.getTagPropMetadata=function(tag,attr){var obj;if(this._components){obj=this._components.getComponentPropMetadata(tag,attr)}return obj};MetaLib.prototype.getTagMetadata=function(tag){var obj,comp,hdr,events,props,event,ret;tag=_removeChevrons(tag);if(!(obj=this._getComponentFromTag(tag))){if(this._components){ret=this._components.getComponentMetadata(tag)}return ret}if(hdr=obj.hdr){comp={};comp.name=hdr.customelement;if(hdr.slot){comp[PROP_SLOTS]=obj.slots}}if(obj.properties){comp[PROP_PROPS]=props={};this._extractProps(props,null,obj.properties,obj.name)}if(obj.events){comp[PROP_EVENTS]=events={};for(event in obj.events){}}if(obj.implements){comp[PROP_IMPLEMENTS]=obj.implements}if(obj.extension&&obj.extension.theme&&obj.extension.theme.unsupportedThemes){comp[PROP_UNSUP_THEME]=obj.extension.theme.unsupportedThemes}if(hdr&&hdr.ojsubcomponenttype){comp[PROP_SUBCOMPONENT_TYPE]=hdr.subcomponenttype}return ret};MetaLib.prototype._getObjectMetadata=function(name){return this._json[name]};MetaLib.prototype.isTagStyleDeprecated=function(tagName,styleName){var o,ret;o=this.isWCStyleDeprecated(styleName);if(o){tagName=_removeChevrons(tagName);if(this._json.ojStyles.containers[o.index]===tagName){ret=o.dep.description}}return ret};MetaLib.prototype.isTagStyle=function(tagName,styleName){var obj,ret=false,compName,containers,indices,index,i;tagName=_removeChevrons(tagName);if(obj=this._getComponentFromTag(tagName)){compName=this._getComponentNameFromTag(tagName);containers=this._json.ojStyles.containers;indices=_getStyleIndices(this._json.ojStyles,styleName);if(indices){for(i=0;i<indices.length;i++){index=indices[i];if(index>=0){if(containers[index]===compName){ret=true;break}}}}}else{ret=this._components.isTagStyle(tagName)}return ret};MetaLib.prototype.isStyle=function(style){return this.isGenStyle(style)||this.isClassStyle(style)||this.isStylesetStyle(style)};MetaLib.prototype.isGenStyle=function(style){var x=this._json.genericStyles[style];return x||x===0?true:false};MetaLib.prototype.isJetStyle=function(style){return this._json.genericStyles[style]?"g":this._json.ojStyles[style]?"j":undefined};MetaLib.prototype.isCustomStyle=function(style){return this._components&&this._components.isStyle(style)};MetaLib.prototype.getStyleOrigin=function(style){var ret;if(this._json.genericStyles[style]){ret="g"}if(this._json.ojStyles[style]){ret=ret?"b":"j"}if(!ret&&this._components){if(this._components.isStyle(style)){ret="c"}}return ret};MetaLib.prototype.isClassStyle=function(style){var x=this._json.ojStyles[style];return x||x===0?true:false};MetaLib.prototype.isStylesetStyle=function(style){return this._stylesets?!!this._stylesets[style]:false};MetaLib.prototype.getStyleSelector=function(style,jet){var o,i,ret;if(typeof jet===BOOLEAN){o=jet?this._json.ojStyles[style]:this._json.genericStyles[style]}else{o=this._json.ojStyles[style];if(!o&&o!==0){o=this._json.genericStyles[style]}if(!o&&this._components){o=this._components.getStyleMetadata(style)}}if(this._utils.isObject(o)){if(o.styleselector){ret=o.styleselector}else if(o.meta){ret=o.meta.styleSelector}}else if(Array.isArray(o)){for(i=0;i<o.length;i++){if(this._utils.isObject(o[i])&&o[i].styleselector){if(!ret){ret=[]}ret.push(o[i].styleselector)}}if(ret&&ret.length===1){ret=ret[0]}}return ret?ret:null};MetaLib.prototype.isJetStylePrefix=function(s){var x;if(!s.startsWith(OJPREFIX)||!this._json.jetCssPrefixes.classes){return false}x=s.indexOf("-",3);if(x>=0){s=s.substring(0,x)}return this._json.jetCssPrefixes.classes.includes(s)};MetaLib.prototype.hasJetStylePrefixes=function(){return this._json.jetCssPrefixes&&this._json.jetCssPrefixes.classes};MetaLib.prototype.getClassesFromStyle=function(styleName,scope){var indices,oStyles,ret;scope=scope||"oj";if(scope==="oj"||scope==="both"){oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices)}}}if(scope==="gen"||scope==="both"){oStyles=this._json.genericStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){ret=_toContainers(oStyles,indices)}}}return ret?ret:null};MetaLib.prototype.getJetTagFromStyle=function(styleName){var indices,oStyles,clazz;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName)}if(indices){if(indices.length>1||indices.length===0){clazz=null}else{clazz=this.isGenStyle(styleName)?null:_toContainers(oStyles,indices)}}return clazz?this.getTagFromClass(clazz):null};MetaLib.prototype.getJetTagsFromStyle=function(styleName){var indices,oStyles;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices,this._json)}}return null};MetaLib.prototype.getClassFromTag=function(tagName){return this._getComponentNameFromTag(_removeChevrons(tagName))};MetaLib.prototype.getClassFromModule=function(module){var clazz=this._json.moduleLookup[module];return clazz?clazz:null};MetaLib.prototype.getTagFromClass=function(className){if(className==="oj.ojTree"){return"oj-tree"}let ret=this._json[className];return ret&&ret.header?ret.header.customelement:null};MetaLib.prototype.isClass=function(className){var b=this._json[className];if(!b){if(className=this._classChange[className]){b=this._json[className]}}return!!b};MetaLib.prototype.isClassFinal=function(className){var clazz=this._json[className];if(!clazz){if(className=this._classChange[className]){clazz=this._json[className]}}return clazz&&clazz.header&&clazz.header.readonly};MetaLib.prototype.isClassMethod=function(className,methName){var clazz=this._json[className];return!!(clazz&&clazz.function&&clazz.function[methName])};MetaLib.prototype.isClassMethodStatic=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth&&meth.scope&&meth.scope=="static"}return ret};MetaLib.prototype.getClassMethodScope=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth.scope}return ret};MetaLib.prototype.isClassMember=function(className,memName){var clazz=this._json[className];return!!(clazz&&clazz.member&&clazz.member[memName])};MetaLib.prototype.isClassMemberStatic=function(className,memName){var mem,ret=null;var clazz=this._json[className];if(clazz&&clazz.member){mem=clazz.member[memName];ret=mem&&mem.scope&&mem.scope=="static"}return ret};MetaLib.prototype.getRequiredAttrs=function(tagName){let obj,clazz,i,ret=null;tagName=_removeChevrons(tagName);if(obj=this._getComponentFromTag(tagName)){clazz=this._getComponentNameFromTag(tagName)}ret=obj?this._reqAttrs[clazz]:this._components.getRequiredProps(tagName);if(this._curFileType!==FT_TSX&&ret&&ret.length){let ret2=[];for(i=0;i<ret.length;i++){ret2[i]=this._domUtils.kebabCase(ret[i])}ret=ret2}return ret};MetaLib.prototype.getTagsFromStyle=function(styleName){var classNames,tag,i,ret;ret=null;classNames=this.getClassesFromStyle(styleName);if(classNames){for(i=0;i<classNames.length;i++){tag=this.getTagFromClass(classNames[i]);if(tag){if(!ret){ret=[]}ret.push(tag)}}}return ret?ret:null};MetaLib.prototype.isStyleDeprecated=function(name){var s,o,t,i;s=this._json.genericStyles[name];if(!s&&s!==0&&this._json.ojStyles){s=this._json.ojStyles[name];if(!s&&s!==0&&this._stylesets){if(s=this._stylesets[name]){if(this._utils.isObject(s)){return!s.type||s.type==="deprecated"?s:null}}}}if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[0];if(typeof o===OBJECT){if(!o.type||o.type==="deprecated"){break}}}}else if(t==="object"){if(!s.type||s.type==="deprecated"){o=s}}else{o=null}}return o?o.dep:null};MetaLib.prototype.isStyleDeprecatedEx=function(style){var a=null,ss,t,i;function _pushSS(o){if(o.dep){if(!o.dep.type||o.dep.type==="deprecated"){if(!a){a=[]}a.push(o)}}};function _stashSS(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){_pushSS(s[i])}}else if(t==="object"){_pushSS(s)}};if(ss=this._json.genericStyles[style]){_stashSS(ss)}if(ss=this._json.ojStyles[style]){_stashSS(ss)}else if(ss!==0&&this._stylesets){ss=this._stylesets[style];return this._utils.isObject(ss)?ss:null}return a};MetaLib.prototype.isWCStyleDeprecated=function(name){var s,o,t,i;s=this._json.ojStyles[name];if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[i];if(typeof o===OBJECT){break}o=null}}else if(t==="object"){o=s}}return o?o:null};MetaLib.prototype.isBindingTag=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return obj&&obj.header?!!obj.header.ojbindingelement:false};MetaLib.prototype.isComponent=function(className){var obj=this._json[className];if(!obj){if(!className.startsWith("oj.")){obj=this._json["oj."+className]}}return!!obj};MetaLib.prototype.isClass=function(className){return!!this._json[className]};MetaLib.prototype.isJetComponentClass=function(className){return this.isClass(className)};MetaLib.prototype.isComponentDeprecated=function(className){return this.isClassDeprecated(className)};MetaLib.prototype.isClassDeleted=function(className){var classes,cn,version=null;if(this._delHist){if(classes=this._delHist.classes){cn=this._classChange[className];if(cn){className=cn}version=classes[className]}}return version};MetaLib.prototype.isClassRenamed=function(className){return this._renHist?this._renHist[className]:null};MetaLib.prototype.isClassDeprecated=function(className){var obj,ret=null;if(className==="oj.ojTree"){if(SemVer.gte(this._jetVer,"5.2.0")){return null}else{return{type:DEPRECATED,since:"5.2.0",description:"Use ojTreeView instead"}}}if(!(obj=this._json[className])){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj){if(obj.header){ret=this._isClassDeprecated(obj.header);if(ret&&ret.description){ret.description=this._utils.removeLink(ret.description)}}if(!ret){ret=this._isClassDeprecated(obj)}}return ret};MetaLib.prototype._isClassDeprecated=function(obj){var depr,status,ret=null;if(obj){if(obj.ojdeprecated&&obj.ojdeprecated.length){depr=obj.ojdeprecated;for(status of depr){if(!status.type||status.type===DEPRECATED){ret=status;if(!ret.type){ret.type=DEPRECATED}break}}}else if(depr=obj.deprecated){ret={type:DEPRECATED,description:typeof depr===BOOLEAN?NO_SUGGESTION_AVAIL:depr}}}return ret};MetaLib.prototype.isClassMethodDeleted=function(className,methodName){var a,cn,i,ret=null;a=this._deletedMethods[methodName];if(a){cn=this._classChange[className];if(cn){className=cn}for(i=0;i<a.length;i++){if(a[i]===className){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMethodDeprecated=function(className,methodName){var obj,method,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.function){for(method in obj.function){if(method===methodName){method=obj.function[method];ret=this._isSubStateDeprecated(method);break}}}return ret};MetaLib.prototype.isClassMemberDeleted=function(className,memberName){var a,i,cname,ret=null;a=this._deletedMembers[memberName];if(a){cname=this._classChange[className];for(i=0;i<a.length;i++){if(a[i]===className||a[i]===cname){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMemberDeprecated=function(className,memName){var obj,member,obj,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.member){memName=memName.charAt(0)===":"?memName.substr(1):memName;for(member in obj.member){if(member===memName){member=obj.member[memName];ret=this._isSubStateDeprecated(member,true);break}}}return ret};MetaLib.prototype.isClassAttrDeprecated=function(className,attrName){var obj,member,ret=null;obj=this._json[className];attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(obj&&obj.member){for(member in obj.member){member=obj.member[member];if(attrName===member.name){ret=this._isSubStateDeprecated(member,true);break}}}return ret};MetaLib.prototype.isComponentDeleted=function(className){return this.isClassDeleted(className)};MetaLib.prototype.isComponentAttrDeprecated=function(className,attrName){return this.isClassAttrDeprecated(className,attrName)};MetaLib.prototype.isComponentMethodDeprecated=function(className,methodName){return this.isClassMethodDeprecated(className,methodName)};MetaLib.prototype.isComponentMemberDeprecated=function(className,memberName){return this.isClassMemberDeprecated(className,memberName)};MetaLib.prototype.isComponentMethodDeleted=function(className,methodName){return this.isClassMethodDeleted(className,methodName)};MetaLib.prototype.isComponentMemberDeleted=function(className,memberName){return this.isClassMemberDeleted(className,memberName)};MetaLib.prototype.isTagPackPrivate=function(tag){var o,ret;if(!tag){return false}tag=_removeChevrons(tag);if(this.isJetTag(tag)){if(o=this._getComponentFromTag(tag)){ret=o.header&&o.header.ojsubcomponenttype===PACK_PRIVATE}}else if(this._components){ret=this._components.isTagPackPrivate(tag)}return ret};MetaLib.prototype.isTagAttrTranslatable=function(tag,attr){var member=this._getTagAttrMemberObj(tag,attr);return member?this._isSubStateTranslatable(member):this._components.isTagAttrTranslatable(tag,attr)};MetaLib.prototype.isTagAttrReadOnly=function(tag,attr){var o,ret=false;tag=_removeChevrons(tag);if(o=this._getTagAttrMemberObj(tag,attr)){ret=o&&o.readonly}else if(this._components){ret=this._components.isTagAttrReadOnly(tag,attr)}return ret};MetaLib.prototype.hasTagDataOjCommand=function(tagName){var obj,ret=false,compName,containers,indexes,i;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){compName=this._getComponentNameFromTag(tagName);indexes=this._json.dataOjCommand;if(indexes){containers=this._json.ojStyles.containers;for(i=0;i<indexes.length;i++){if(containers[indexes[i]]===compName){ret=true;break}}}}return ret};MetaLib.prototype.isTagEvent=function(tagName,eventName){var obj,attr,x,ret=false;eventName=eventName.charAt(0)===":"?eventName.substring(1):eventName;if(!eventName.startsWith(EVENT_ON)){return ret}if(this.isWCTag(tagName)){if(this._getComponentNameFromTag(tagName)){obj=this._getComponentFromTag(_removeChevrons(tagName));if(obj&&obj.htmlevents){ret=!!obj.htmlevents[eventName]}if(!ret){if((x=eventName.lastIndexOf(DASH_CHANGED))>=0){attr=eventName.substring(3,x);attr=this._domUtils.camelCase(attr);ret=!!obj.member[attr]}}}else{ret=this._components&&this._components.isTagEvent(tagName,eventName)}if(!ret){ret=HtmlUtils.isCommonEventAttr(eventName)}}return ret};MetaLib.prototype.isTagMaintenance=function(tag){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tag))){}else{ret=this._components.isTagMaintenance(tag)}return ret};MetaLib.prototype.isTagSupersedes=function(tag){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tag))){}else{ret=this._components.isTagSupersedes(tag)}return ret};MetaLib.prototype.getTagMaintenanceStatus=function(tag){return this.getTagStatus(tag,MAINTENANCE)};MetaLib.prototype.getTagSupersedesStatus=function(tag){return this.getTagStatus(tag,SUPERSEDES)};MetaLib.prototype.getTagAntiPatternStatus=function(tag){return this.getTagStatus(tag,ANTIPATTERN)};MetaLib.prototype.getTagStatus=function(tag,type){var clazz,ret=null;if(type!==DEPRECATED&&type!==MAINTENANCE&&type!==SUPERSEDES&&type!==ANTIPATTERN){return null}if(clazz=this._getComponentNameFromTag(_removeChevrons(tag))){if(clazz==="oj.ojTree"){if(SemVer.gte(this._jetVer,"5.2.0")){return null}else{if(type===DEPRECATED){return{type:DEPRECATED,description:"Use <oj-tree-view> instead"}}else if(type===SUPERSEDES){return{type:SUPERSEDES,description:"Superseded by <oj-tree-view>"}}return null}}let obj=this._json[clazz];if(obj&&obj.header){let arStat;if(Array.isArray(arStat=obj.header.ojdeprecated)){let stat,i,found;for(i=0;i<arStat.length;i++){stat=arStat[i];if(!stat.type){found=DEPRECATED}else if(stat.type===type){found=type}if(found===type){ret={type:found};if(stat.hasOwnProperty("target")){ret.target=stat.target}if(stat.hasOwnProperty("value")){ret.value=stat.value}if(stat.hasOwnProperty("since")){ret.since=stat.since}if(stat.hasOwnProperty("description")){ret.description=stat.description}if(found===ANTIPATTERN&&stat.hasOwnProperty("themes")){ret.themes=stat.themes}break}}}else if(typeof arStat===STRING){ret={description:arStat}}}}else{ret=this._components.getTagStatus(tag,type)}return ret};MetaLib.prototype.applySchema=function(obj){return this._compSvcs.validateComponentJsonWithSchema(obj)};MetaLib.prototype.walkElemStackForOJTag=function(ctx,excludeBindIf){var i,name,ret=null;var stack=ctx.elemStack;if(stack&&stack.length){for(i=stack.length-1;i>=0;i--){name=stack[i].name;if(name.toLowerCase().startsWith(OJPREFIX)){if(!name.startsWith("oj-bind-")||!excludeBindIf){ret=name;break}}}}return ret};MetaLib.prototype.walkDomStackForOJTag=function(ctx,excludeBindIf){return this.walkElemStackForOJTag(ctx,excludeBindIf)};MetaLib.prototype.getPublicInterface=function(){return{isJetTag:this.isJetTag.bind(this),isWCTag:this.isWCTag.bind(this),isComponentTag:this.isComponentTag.bind(this),isTagDeprecated:this.isTagDeprecated.bind(this),isTagSupportedInTheme:this.isTagSupportedInTheme.bind(this),isAttrSupportedInTheme:this.isAttrSupportedInTheme.bind(this),isTagAttrDeprecated:this.isTagAttrDeprecated.bind(this),isTagAttrTranslatable:this.isTagAttrTranslatable.bind(this),isTagAttrReadOnly:this.isTagAttrReadOnly.bind(this),isTagAttrEnumValueDeprecated:this.isTagAttrEnumValueDeprecated.bind(this),isTagAttr:this.isTagAttr.bind(this),isJetTagAttr:this.isJetTagAttr.bind(this),hasTagAttrValues:this.hasTagAttrValues.bind(this),isTagAttrValue:this.isTagAttrValue.bind(this),getTagAttrType:this.getTagAttrType.bind(this),getTagAttrTypeEx:this.getTagAttrTypeEx.bind(this),getTagMetadata:this.getTagMetadata.bind(this),getTagPropMetadata:this.getTagPropMetadata.bind(this),isTagCompProp:this.isTagCompProp.bind(this),hasTagCompPropSubprop:this.hasTagCompPropSubprop.bind(this),getTagPropType:this.getTagPropType.bind(this),hasTagSlot:this.hasTagSlot.bind(this),hasTagDefaultSlot:this.hasTagDefaultSlot.bind(this),isTagSlotName:this.isTagSlotName.bind(this),isTagSlotValue:this.isTagSlotValue.bind(this),isTagSlotDeprecated:this.isTagSlotDeprecated.bind(this),getPreferredSlotContent:this.getPreferredSlotContent.bind(this),getPreferredSlotContentEx:this.getPreferredSlotContentEx.bind(this),getTagSlotMetadata:this.getTagSlotMetadata.bind(this),hasTagDataOjCommand:this.hasTagDataOjCommand.bind(this),isBindingTag:this.isBindingTag.bind(this),isTagPackPrivate:this.isTagPackPrivate.bind(this),isTagMaintenance:this.isTagMaintenance.bind(this),isTagSupersedes:this.isTagSupersedes.bind(this),getTagMaintenanceStatus:this.getTagMaintenanceStatus.bind(this),getTagSupersedesStatus:this.getTagSupersedesStatus.bind(this),getTagAntiPatternStatus:this.getTagAntiPatternStatus.bind(this),getTagStatus:this.getTagStatus.bind(this),isClass:this.isClass.bind(this),isClassRenamed:this.isClassRenamed.bind(this),isClassDeleted:this.isClassDeleted.bind(this),isClassDeprecated:this.isClassDeprecated.bind(this),isClassMethodDeleted:this.isClassMethodDeleted.bind(this),isClassMemberDeleted:this.isClassMemberDeleted.bind(this),isClassMethodDeprecated:this.isClassMethodDeprecated.bind(this),isClassMemberDeprecated:this.isClassMemberDeprecated.bind(this),isClassAttrDeprecated:this.isClassAttrDeprecated.bind(this),isClassFinal:this.isClassFinal.bind(this),isClassMethod:this.isClassMethod.bind(this),isClassMethodStatic:this.isClassMethodStatic.bind(this),isClassMember:this.isClassMember.bind(this),isClassMemberStatic:this.isClassMemberStatic.bind(this),getClassMethodScope:this.getClassMethodScope.bind(this),getStyleOrigin:this.getStyleOrigin.bind(this),isJetStyle:this.isJetStyle.bind(this),isCustomStyle:this.isCustomStyle.bind(this),isTagStyle:this.isTagStyle.bind(this),isStyle:this.isStyle.bind(this),isGenStyle:this.isGenStyle.bind(this),isClassStyle:this.isClassStyle.bind(this),isStylesetStyle:this.isStylesetStyle.bind(this),isStyleDeprecated:this.isStyleDeprecated.bind(this),isStyleDeprecatedEx:this.isStyleDeprecatedEx.bind(this),getStyleSelector:this.getStyleSelector.bind(this),getNonSSStyleElems:this.getNonSSStyleElems.bind(this),isJetStylePrefix:this.isJetStylePrefix.bind(this),hasJetStylePrefixes:this.hasJetStylePrefixes.bind(this),isTagEvent:this.isTagEvent.bind(this),isTagEventDeprecated:this.isTagEventDeprecated.bind(this),getTagPropertyFromEvent:this.getTagPropertyFromEvent.bind(this),getTagsFromStyle:this.getTagsFromStyle.bind(this),getJetTagFromStyle:this.getJetTagFromStyle.bind(this),getJetTagsFromStyle:this.getJetTagsFromStyle.bind(this),getClassesFromStyle:this.getClassesFromStyle.bind(this),getClassFromTag:this.getClassFromTag.bind(this),getClassFromModule:this.getClassFromModule.bind(this),getTagFromClass:this.getTagFromClass.bind(this),getDeprecatedMethodList:this.getDeprecatedMethodList.bind(this),getDeprecatedMemberList:this.getDeprecatedMemberList.bind(this),getDeletedMethodList:this.getDeletedMethodList.bind(this),getDeletedMemberList:this.getDeletedMemberList.bind(this),getRequiredAttrs:this.getRequiredAttrs.bind(this),isComponent:this.isComponent.bind(this),isNamespaceTag:this.isNamespaceTag.bind(this),isNSRegistered:this.isNSRegistered.bind(this),isNamespacePrefix:this.isNamespacePrefix.bind(this),isRuleIgnored:this.isRuleIgnored.bind(this),getRenamedClassList:this.getRenamedClassList.bind(this),getDeletedClassList:this.getDeletedClassList.bind(this),processImplements:this.processImplements.bind(this),isInterfaceImplemented:this.isInterfaceImplemented.bind(this),getInterfaces:this.getInterfaces.bind(this),getImplementers:this.getImplementers.bind(this),getSubcomponentType:this.getSubcomponentType.bind(this),getWCInterfaces:this.getWCInterfaces.bind(this),hasWCInterfaces:this.hasWCInterfaces.bind(this),hasJetWCInterfaces:this.hasJetWCInterfaces.bind(this),getMetaVers:this.getMetaVers.bind(this),walkElemStackForOJTag:this.walkelemStackForOJTag,walkDomStackForOJTag:this.walkDomStackForOJTag,isIgnoreAttr:this.isIgnoreAttr.bind(this),applySchema:this.applySchema.bind(this),getRevisionInfo:this.getRevisionInfo.bind(this),_getObjectMetadata:this._getObjectMetadata.bind(this)}};MetaLib.prototype.loadMeta=function(metaFile){var metaObj,ret=false;if(!this._json){try{if(metaObj=this._nd.metaLoader.loadMeta(metaFile,this._nd,this._fsUtils)){this._json=metaObj.meta;this._delHist=metaObj.delMeta;this._renHist=metaObj.renMeta;this._reqAttrs=metaObj.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();this._createClassNameChanges();this._fixup_jet_42315();this._createImplements();ret=true}else{this._error(`Metadata '${metaFile}' not found!`)}}catch(e){this._error(`[${e.name}]: Metadata load (${metaFile}) - ${e.message}`)}}return ret};MetaLib.prototype.getNonLegacyMaintenanceTags=function(){return this._components.getMaintenanceTags()};MetaLib.prototype.getRenamedClassList=function(){return this._renHist};MetaLib.prototype.getDeletedClassList=function(){return this._delHist};MetaLib.prototype.processImplements=function(tag,impls){if(Array.isArray(impls)&&this._implements){impls.forEach(impl=>{if(this._implements[impl]){this._implements[impl].push(tag)}else{this._implements[impl]=[tag]}})}};const OJV_CHARS=/[<>]/;MetaLib.prototype._getOjValues=function(mem){var ts,ret;if(!mem){return false}if(mem.ojvalues){if(mem.ojvalues.name&&Array.isArray(mem.ojvalues.name)&&mem.ojvalues.name.length){return mem.ojvalues}return}if(mem.tstype&&mem.tstype.m_ojvalues){return mem.tstype.m_ojvalues}ts=this._getTsTypeObject(mem);if(ts&&ts.ojvalues&&ts.ojvalues.name){if(Array.isArray(ts.ojvalues.name)&&ts.ojvalues.name.length){ret=ts.ojvalues}}return ret};MetaLib.prototype.getImplementers=function(ifc){var ret;if(this._implements&&ifc){ret=this._implements[ifc]}return ret||null};MetaLib.prototype.getInterfaces=function(tag){var obj,hdr,impls,ret;if(!tag){return null}tag=_removeChevrons(tag);if(this.isJetTag(tag)){if(obj=this._getComponentFromTag(tag)){if(hdr=obj.header){if(hdr.domInterface&&hdr.customelement){impls=hdr.domInterface;ret=Array.isArray(impls)?impls:[impls]}}}}else if(this.isComponentTag(tag)){ret=this._components.getInterfaces(tag)}return ret||null};MetaLib.prototype.getWCInterfaces=function(){return this._implements};MetaLib.prototype.hasJetWCInterfaces=function(){return this._hasJetWCIFCs};MetaLib.prototype.hasWCInterfaces=function(){return!!this._implements};MetaLib.prototype.isInterfaceImplemented=function(tag,ifcName){var ifc,ret;if(ifc=this.getInterfaces(tag)){for(let i=0;i<ifc.length;i++){if(ifc[i]===ifcName){ret=true;break}}}return!!ret};MetaLib.prototype.getSubcomponentType=function(tag){var obj,hdr,ret;if(tag=_removeChevrons(tag)){if(this.isJetTag(tag)){if(obj=this._getComponentFromTag(tag)){if(hdr=obj.header){ret=hdr.ojsubcomponenttype}}}else if(this.isComponentTag(tag)){ret=this._components.getSubcomponentType(tag)}}return ret||null};MetaLib.prototype._createNonClassList=function(mp){this._nonClasses=mp.nonClasses?mp.nonClasses:["genericStyles","ojStyles"];this._nonClasses.push("moduleLookup");this._nonClasses.push("newGenericStyles");this._nonClasses.push("newOjStyles");if(!this._nonClasses.includes("custElementClassLookup"))this._nonClasses.push("custElementClassLookup");if(!this._nonClasses.includes("meta"))this._nonClasses.push("meta");if(!this._nonClasses.includes("ResponsivePrefixes"))this._nonClasses.push("ResponsivePrefixes")};MetaLib.prototype.setAmdMeta=function(obj){this._json=obj.jetMeta.meta;this._delHist=obj.jetMeta.delMeta;this._reqAttrs=obj.jetMeta.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();return true};MetaLib.prototype.setTheme=function(theme){this._theme=theme};MetaLib.prototype._createModuleLookup=function(){var comps,compName,lookup,hdr;if(this._json.moduleLookup){return}this._json.moduleLookup=lookup={};comps=this._json;for(compName in comps){if(!this._nonClasses.includes(compName)&&!compName.startsWith("oj.__")){hdr=comps[compName].header;if(hdr){lookup[OJS+hdr.name.toLowerCase()]=compName}}}};MetaLib.prototype._createClassNameChanges=function(){var comps,compName,o,hdr;if(this._classChange=this._json.meta.isClassNameChanges){return}this._classChange=o={};comps=this._json;for(compName in comps){if(!this._nonClasses.includes(compName)){hdr=comps[compName].header;if(hdr&&compName!==hdr.name){o[hdr.name]=compName}}}this._json.meta.isClassNameChanges=true};MetaLib.prototype._fixup_jet_42315=function(){var o;if(SemVer.gte(this._jetVer,"8.0.0")){if(o=this._json.Color||this._json["oj.Color"]||this._json["oj.ojColor"]){if(!o.header){o.header={}}o.header.readonly=true}}};MetaLib.prototype._createImplements=function(){var clazzes,clazz,tag,impls,impl,o={},a,hdr;if(this._implements=this._json.meta.interfaces){return}clazzes=this._json;for(clazz in clazzes){if(this._nonClasses.includes(clazz)){continue}if(hdr=clazzes[clazz].header){if(hdr.domInterface&&hdr.customelement){impls=hdr.domInterface;impls=Array.isArray(impls)?impls:[impls];for(impl of impls){if(o[impl]){a=o[impl]}else{o[impl]=a=[]}this._hasJetWCIFCs=true;tag=this.getTagFromClass(clazz);if(tag&&!a.includes(tag)){a.push(tag)}}}}}this._implements=this._hasJetWCIFCs?o:null};MetaLib.prototype.getMetaVers=function(){return{versions:this._jetVersions,runver:this._jetVer}};MetaLib.prototype.setComponentsLib=function(compSvcs,comps){if(compSvcs){this._compSvcs=compSvcs}if(comps){this._components=comps}};MetaLib.prototype.setStylesets=function(ss){if(!ss){return}var o,obj,e,i;if(!this._stylesets){this._stylesets=obj={}}else{obj=this._stylesheets}for(i=0;i<ss.length;i++){o=ss[i];if(typeof o===STRING){obj[o]=true}else if(o.deprecated){obj[o.deprecated]=e={};if(o.since){e.since=o.since}if(o.note){e.description=o.note}else if(o.description){e.description=o.description}}}};MetaLib.prototype.setDomUtils=function(du){this._domUtils=du};MetaLib.prototype.getDomUtils=function(){return this._domUtils};MetaLib.prototype.setCurFileType=function(ft){this._curFileType=ft&&ft.startsWith(DOT)?ft.substring(1):ft;this._components.setCurFileType(this._curFileType)};MetaLib.prototype.getRevisionInfo=function(){var metaSect=this._json.meta;var revision="";return{revision:revision,tag:metaSect.jetrevision,jetVersion:metaSect.jetversion,date:metaSect.date,time:metaSect.time}};MetaLib.prototype._isSubStateDeprecated=function(obj,isMember){var depr,retStatus=null;if(obj&&obj.ojdeprecated&&obj.ojdeprecated.length){retStatus=this._createLegacyDeprecatedStatus(obj.ojdeprecated,isMember)}else if(depr=obj.deprecated){retStatus=typeof depr===BOOLEAN?NO_SUGGESTION_AVAIL:depr;retStatus=[{type:DEPRECATED,description:retStatus}]}return retStatus};MetaLib.prototype._isSubStateTranslatable=function(obj){return obj&&obj.ojtranslatable};MetaLib.prototype._createLegacyDeprecatedStatus=function(depr,isMember){var retStatus,depr,o;if(depr){depr.forEach(status=>{if(status.type&&status.type!==DEPRECATED){return}retStatus=[];o={type:DEPRECATED};if(status.hasOwnProperty("target")){o.target=status.target;if(isMember&&status.target==="memberType"){o.target="propertyType"}}if(status.hasOwnProperty("description")){o.description=status.description}if(status.hasOwnProperty("since")){o.since=status.since}if(status.hasOwnProperty("for")){o.value=[status.for]}else if(status.hasOwnProperty("value")){o.value=status.value}retStatus.push(o)})}return retStatus&&retStatus.length?retStatus:null};MetaLib.prototype._getComponentNameFromTag=function(tagName){var ret;if(tagName){tagName=tagName.toLowerCase();ret=this._json.custElementClassLookup[tagName]?this._json.custElementClassLookup[tagName]:null}else{ret=false}return ret};MetaLib.prototype.isIgnoreAttr=function(tagName,attrName){var ret=false;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(HtmlUtils.isCommonElem(attrName)||attrName.startsWith("aria-")){return true}if(tagName==="oj-avatar"){if(attrName==="src"||attrName==="initials")ret=true}else if(tagName==="oj-option"){if(attrName==="value")ret=true}return ret};MetaLib.prototype.getDeprecatedMethodList=function(){if(this._deprecatedMethods){return this._deprecatedMethods}var json=this._json;var name,methName,methObj,depMeth,o,a;var ret={};for(name in json){o=json[name];if(o&&o.function){for(methName in o.function){methObj=o.function[methName];depMeth=methObj.ojdeprecated;if(depMeth&&(!depMeth.type||depMeth.type==="deprecated")){if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name)}}}}return this._deprecatedMethods=ret};MetaLib.prototype.getDeprecatedMemberList=function(){if(this._deprecatedMembers){return this._deprecatedMembers}var json=this._json;var name,memName,memObj,depMem,o,a;var ret={};for(name in json){o=json[name];if(o&&o.member){for(memName in o.member){memObj=o.member[memName];depMem=memObj.ojdeprecated;if(depMem&&(!depMem.type||depMem.type==="deprecated")){if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name)}}}}return this._deprecatedMembers=ret};MetaLib.prototype.getDeletedMethodList=function(){if(this._deletedMethods){return this._deletedMethods}var json=this._delHist;var name,methName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.methods){for(methName in o.methods){ver=o.methods[methName];if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMethods=ret};MetaLib.prototype.getDeletedMemberList=function(){if(this._deletedMembers){return this._deletedMembers}var json=this._delHist;var name,memName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.members){for(memName in o.members){ver=o.members[memName];if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMembers=ret};MetaLib.prototype._getSlots=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return this._getSlots2(obj)};MetaLib.prototype._getSlots2=function(base){var bases,base,i,ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){break}bases=base.header&&base.header.augments?base.header.augments:null;if(!bases){break}for(i=0;i<bases.length;i++){base=this._json[bases[i]];ret=this._getSlots2(base);if(ret){base=null;break}}}return ret?ret:null};MetaLib.prototype._getSlotByName=function(base,slotName){var ret=null;while(base){if(!slotName){ret=base&&base.member?base.member.Default:null}else{if(base&&base.slot){ret=base.slot[slotName]}}break}return ret?ret:null};MetaLib.prototype._getComponentFromTag=function(tagName){var o=this._getComponentNameFromTag(tagName);if(o){o=this._json[o]}return o?o:null};MetaLib.prototype._getCamelPropFromEvent=function(eventName){var x;if(eventName.indexOf("-")>=0){eventName=this._domUtils.camelCase(eventName)}if((x=eventName.lastIndexOf(CHANGED))<0){x=eventName.length+1}return eventName.substring(3,x)};function _getStyleIndices(scope,styleName){var a,n,ret,i;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n===OBJECT){n=a[i].index}ret.push(n)}}else{if(typeof a===OBJECT){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?ret:null};MetaLib.prototype.getNonSSStyleElems=function(styleName,scope){var a,n,ret,i;scope=scope?this._json.ojStyles:this._json.genericStyles;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n===OBJECT&&!n.styleselector){n=a[i].index}ret.push(n)}}else{if(typeof a===OBJECT&&!a.styleselector){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?_toContainers(scope,ret,this._json):null};MetaLib.prototype.displayImpls=function(){var impls,impl;this._console("[info] :--------- JET Interfaces Implemented ---------","I");if(!(impls=this._implements)){this._console(" None!","I")}else{for(impl in impls){this._console(`${impl} : <- <${impls[impl].join(",")}>`,"I")}}this._console("[info]: -------- End Declared Web Components ---------\n","I")};function _toContainers(scope,indices,json){var cont,ret,clazz,elem,n,i;cont=scope.containers;for(i=0;i<indices.length;i++){n=indices[i];if(n>=0){if(!ret){ret=[]}if(!json){ret[i]=cont[n]}else{clazz=cont[n];elem=json[clazz];if(elem&&elem.header){elem=elem.header.customelement;if(elem){ret[i]=elem}}}}}return ret&&ret.length?ret:null};function _convertValue(valType,value){var retValue=value;if(valType===STRING){retValue=value}else if(valType==="number"){retValue=Number(value)}else if(valType==="boolean"){retValue=value.toLowerCase()==="true"}return retValue};function _removeChevrons(tagName){if(tagName){let len=tagName.length-1;let start=tagName.charAt(0)==="<"?1:0;let end=tagName.charAt(len)===">"?len:++len;tagName=tagName.substring(start,end)}return tagName};module.exports=MetaLib;
package/lib/NetUtils.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const Url=require('url');var NetUtils=function(){this._request=require('sync-request')};NetUtils.prototype.loadUrl=function(url){var res,ret={};try{res=this._request('GET',url);ret.statusCode=res.statusCode;ret.headers=res.headers;if(res.statusCode===200){this._evalMediaType(res,ret)}}catch(e){ret.eCode=e.code;if(e.code=='ECONNREFUSED'&&url.startsWith('http://localhost:8136/rules')){ret.statusCode=4242}else{ret.statusCode=e.code==='ENOTFOUND'?404:999}}return ret};NetUtils.prototype.stripQuery=function(url){var u,path,x;u=Url.parse(url);path=u.pathname;x=url.indexOf(path);return url.substr(0,x+path.length)};NetUtils.prototype._evalMediaType=function(resp,ret){var contentType,body;contentType=resp.headers['content-type'];contentType=contentType?contentType.trim().toLowerCase():'text/plain';body=resp.getBody();if(contentType==='application/zip'||contentType==='application/7z'||contentType.startsWith('application/x-7z')||body[0]===80&&body[1]===75){ret.body=body;ret.type='zip'}else{if(contentType==='application/json'){ret.type='json'}else if(contentType.startsWith('application/javascript')||contentType.startsWith('text/javascript')){ret.type='js'}else if(contentType==='text/html'){ret.type='html'}else if(contentType==='text/css'){ret.type='css'}else if(contentType==='text/plain'){ret.type='text'}ret.body=body.toString('utf8')}};module.exports=NetUtils;
6
+ const Url=require("url");var NetUtils=function(){this._request=require("sync-request")};NetUtils.prototype.loadUrl=function(url){var res,ret={};try{res=this._request("GET",url);ret.statusCode=res.statusCode;ret.headers=res.headers;if(res.statusCode===200){this._evalMediaType(res,ret)}}catch(e){ret.eCode=e.code;if(e.code=="ECONNREFUSED"&&url.startsWith("http://localhost:8136/rules")){ret.statusCode=4242}else{ret.statusCode=e.code==="ENOTFOUND"?404:999}}return ret};NetUtils.prototype.stripQuery=function(url){var u,path,x;u=Url.parse(url);path=u.pathname;x=url.indexOf(path);return url.substr(0,x+path.length)};NetUtils.prototype._evalMediaType=function(resp,ret){var contentType,body;contentType=resp.headers["content-type"];contentType=contentType?contentType.trim().toLowerCase():"text/plain";body=resp.getBody();if(contentType==="application/zip"||contentType==="application/7z"||contentType.startsWith("application/x-7z")||body[0]===80&&body[1]===75){ret.body=body;ret.type="zip"}else{if(contentType==="application/json"){ret.type="json"}else if(contentType.startsWith("application/javascript")||contentType.startsWith("text/javascript")){ret.type="js"}else if(contentType==="text/html"){ret.type="html"}else if(contentType==="text/css"){ret.type="css"}else if(contentType==="text/plain"){ret.type="text"}ret.body=body.toString("utf8")}};module.exports=NetUtils;
package/lib/Parser.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const FILETYPE=require("./filetypes");const Json=require("./Json.js");const Ts=require("./Ts.js");const Md=require("./Md.js");function Parser(core,nodeDeps,rules,fileIndex,DomUtils,appCtx,msgCtx,constants){this.cssUtils=null;this.curFile=null;this.curFileType=null;this._fireHookFileRules=appCtx.fireHookFileRules;this.startCssPosition=0;this.startJsPosition=0;this.startIndex=0;this.endIndex=0;this.parseErrors=0;this._setConstants(constants);this._appCtx=appCtx;this._msgCtx=msgCtx;this._Json=new Json(this,nodeDeps,rules,fileIndex,appCtx,msgCtx);this._Ts=new Ts(this,nodeDeps,rules,fileIndex,appCtx,msgCtx);this._Md=new Md(this,nodeDeps,rules,fileIndex,appCtx,msgCtx)};Parser.prototype.clear=function(){this.startIndex=0;this.endIndex=0;this.startCssPosition={row:1,col:1,index:0};this._Json.clear();this._Ts.clear();this._Md.clear()};Parser.prototype.getAst=function(){var o;switch(this.curFileType){case FILETYPE.TS:o=this._Ts;break;case FILETYPE.JS:o=this._Js;break;case FILETYPE.JSON:o=this._Json;break;case FILETYPE.MD:o=this._Md;break;}return o?o.getAst():null};Parser.prototype.getAstUtils=function(){return FILETYPE.isFileTypeTsOrTsx(this.curFileType)?this._Ts.getAstUtils():this.curFileType==="js"?this.Js.getAstUtils():null};Parser.prototype.fireHookFileRules=function(node,obj,inScriptJs){return this._fireHookFileRules(node,obj,inScriptJs)};Parser.prototype.getParseErrors=function(){return this.parseErrors};Parser.prototype.parse=function(text,curFile,curFileType,arg1){var ret;switch(curFileType){case FILETYPE.TS:case FILETYPE.TSX:ret=this._parseTs(text,curFile,curFileType,arg1);break;case FILETYPE.JSON:ret=this._parseJson(text,curFile,curFileType);break;case FILETYPE.MD:ret=this._parseMd(text,curFile,curFileType);break;}return ret};Parser.prototype.parseOnly=function(text,curFile,curFileType){var ret;switch(curFileType){case FILETYPE.JSON:ret=this._parseJsonOnly(text,curFile,curFileType);break;default:this._msgCtx.assert("Unhandled Parser.parseOnly unexpected invocation");}return ret};Parser.prototype._parseHtml=function(text,curFile,curFileType,rawData,suppData){};Parser.prototype.getHtmlTopNode=function(){return this._Html.getTopNode()};Parser.prototype.getCurTagNode=function(){return this._Html.getCurTagNode()};Parser.prototype._parseCss=function(text){return this._Css.parse(text)};Parser.prototype._parseJs=function(text,curFile,curFileType,inner){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Js.parse(text,inner)};Parser.prototype.getJsAst=function(){return this._Js.getJsAst()};Parser.prototype.getInScriptJs=function(){return this._Html.getInScriptJs()};Parser.prototype._parseTs=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Ts.parse(text,curFile,curFileType)};Parser.prototype._parseJson=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Json.parse(text,curFile,curFileType)};Parser.prototype._parseJsonOnly=function(text,curFile,curFileType){return this._Json.parseOnly(text,curFile,curFileType)};Parser.prototype._parseMd=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Md.parse(text,curFile,curFileType)};Parser.prototype.setCssUtils=function(utils){this.cssUtils=utils};Parser.prototype._setConstants=function(constants){for(let con in constants){this[con]=constants[con]}};module.exports=Parser;
6
+ const FILETYPE=require("./filetypes");const Json=require("./Json.js");const Ts=require("./Ts.js");const Md=require("./Md.js");function Parser(core,nodeDeps,rules,fileIndex,DomUtils,appCtx,msgCtx,constants){this.cssUtils=null;this.curFile=null;this.curFileType=null;this._fireHookFileRules=appCtx.fireHookFileRules;this.startCssPosition=0;this.startJsPosition=0;this.startIndex=0;this.endIndex=0;this.parseErrors=0;this._setConstants(constants);this._appCtx=appCtx;this._msgCtx=msgCtx;this._Json=new Json(this,nodeDeps,rules,fileIndex,appCtx,msgCtx);this._Ts=new Ts(this,nodeDeps,rules,fileIndex,appCtx,msgCtx);this._Md=new Md(this,nodeDeps,rules,fileIndex,appCtx,msgCtx)};Parser.prototype.clear=function(){this.startIndex=0;this.endIndex=0;this.startCssPosition={row:1,col:1,index:0};this._Json.clear();this._Ts.clear();this._Md.clear()};Parser.prototype.getAst=function(){var o;switch(this.curFileType){case FILETYPE.TS:o=this._Ts;break;case FILETYPE.JS:o=this._Js;break;case FILETYPE.JSON:o=this._Json;break;case FILETYPE.MD:o=this._Md;break}return o?o.getAst():null};Parser.prototype.getAstUtils=function(){return FILETYPE.isFileTypeTsOrTsx(this.curFileType)?this._Ts.getAstUtils():this.curFileType==="js"?this.Js.getAstUtils():null};Parser.prototype.fireHookFileRules=function(node,obj,inScriptJs){return this._fireHookFileRules(node,obj,inScriptJs)};Parser.prototype.getParseErrors=function(){return this.parseErrors};Parser.prototype.parse=function(text,curFile,curFileType,arg1){var ret;switch(curFileType){case FILETYPE.TS:case FILETYPE.TSX:ret=this._parseTs(text,curFile,curFileType,arg1);break;case FILETYPE.JSON:ret=this._parseJson(text,curFile,curFileType);break;case FILETYPE.MD:ret=this._parseMd(text,curFile,curFileType);break}return ret};Parser.prototype.parseOnly=function(text,curFile,curFileType){var ret;switch(curFileType){case FILETYPE.JSON:ret=this._parseJsonOnly(text,curFile,curFileType);break;default:this._msgCtx.assert("Unhandled Parser.parseOnly unexpected invocation")}return ret};Parser.prototype._parseHtml=function(text,curFile,curFileType,rawData,suppData){};Parser.prototype.getHtmlTopNode=function(){return this._Html.getTopNode()};Parser.prototype.getCurTagNode=function(){return this._Html.getCurTagNode()};Parser.prototype._parseCss=function(text){return this._Css.parse(text)};Parser.prototype._parseJs=function(text,curFile,curFileType,inner){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Js.parse(text,inner)};Parser.prototype.getJsAst=function(){return this._Js.getJsAst()};Parser.prototype.getInScriptJs=function(){return this._Html.getInScriptJs()};Parser.prototype._parseTs=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}if(this._Ts.hasParser()){return this._Ts.parse(text,curFile,curFileType)}if(!this._oneTimeMsg){this._Ts.reportNoParser();this._oneTimeMsg=true}return false};Parser.prototype._parseJson=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Json.parse(text,curFile,curFileType)};Parser.prototype._parseJsonOnly=function(text,curFile,curFileType){return this._Json.parseOnly(text,curFile,curFileType)};Parser.prototype._parseMd=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Md.parse(text,curFile,curFileType)};Parser.prototype.setCssUtils=function(utils){this.cssUtils=utils};Parser.prototype._setConstants=function(constants){for(let con in constants){this[con]=constants[con]}};module.exports=Parser;
package/lib/RegTypes.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- module.exports={ELEM:"elem",TAG:"tag",OJTAG:"ojtag",BINDING_TAG:"bindingtag",WEBCOMP:"webcomp",GLOBTAG:"globtag",ATTR:"attr",ATTREXPR:"attrexpr",ATTREXPR_$PROPS:"attrexpr-$props",CLASS:"class",EVENT:"event",COMMENT:"comment",PROCSTMT:"procstmt",DIRECTIVE:"directive",DOCTYPE:"doctype",PHASE_FILE:"file",PHASE_STARTUP:"startup",PHASE_CLOSEDOWN:"closedown",PHASE_STARTUP_RULEPACK:"startupRP",PHASE_CLOSEDOWN_RULEPACK:"closedownRP",PHASE_START_AUDIT:"startaudit",PHASE_END_AUDIT:"endaudit"};
6
+ module.exports={ELEM:"elem",TAG:"tag",OJTAG:"ojtag",BINDING_TAG:"bindingtag",WEBCOMP:"webcomp",GLOBTAG:"globtag",NOTGLOB:"notglob",ATTR:"attr",ATTREXPR:"attrexpr",ATTREXPR_$PROPS:"attrexpr-$props",CLASS:"class",EVENT:"event",COMMENT:"comment",PROCSTMT:"procstmt",DIRECTIVE:"directive",DOCTYPE:"doctype",PHASE_FILE:"file",PHASE_STARTUP:"startup",PHASE_CLOSEDOWN:"closedown",PHASE_STARTUP_RULEPACK:"startupRP",PHASE_CLOSEDOWN_RULEPACK:"closedownRP",PHASE_START_AUDIT:"startaudit",PHASE_END_AUDIT:"endaudit"};
package/lib/Registry.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_RE=new RegExp(/[~`!#$%\^&*+\[\]\\';,/{}|\\"\?]/);var Registry=function(appCtx){this._registry={};this._regexps={};this._reObjs={};this._appCtx=appCtx;this._info=appCtx.info;this._assert=appCtx.assert};Registry.prototype.getRegisteredCallbacks=function(type){var reo,ret;ret=this._registry[type];if(!type.startsWith("css-")&&type.indexOf("-")>0&&type.indexOf("|")<0){ret={...ret};type=type.substring(1,type.length-1).trim();for(re in this._regexps){reo=this._reObjs[re];if(reo&&reo.test(type)){if(!ret){ret={}}for(x in this._regexps[re]){ret[x]=this._regexps[re][x]}}};}return ret};Registry.prototype.isRegisteredCallback=function(type){if(type==="Tsx<"){let entry,ret;for(entry in this._registry){if(entry.startsWith("Tsx<")){ret=true;break}}return ret||false}return!!this._registry[type]};Registry.prototype.isRegisteredCallbackRE=function(elem){var ret,i;if(ret=this.isRegisteredCallback(elem)){return ret}elem=elem.startsWith("<")?elem.substring(1,elem.length-1):elem;for(re in this._regexps){if(this._reObjs[re].test(elem)){return true}}return false};Registry.prototype.setRuleCallback=function(ruleName,ruleRegs,rsi){var typeObj,regType,rt,callbacks,func,args,elem;for(regType in ruleRegs){func=ruleRegs[regType];if(typeof func!=="function"){this._info(`Rule ${ruleName} : registered '${regType}' is not a function`);continue}rt=elem=regType;if(regType.charAt(0)==="<"){rt=regType.substring(1,regType.length-1).trim();args=rt.split(" ");if(args.length>1){attrib=args[args.length-1];if(attrib.endsWith("=")){rt=args[0]+"|"+attrib.substring(0,attrib.length-1)}elem=args[0]}else{elem=rt.endsWith("=")?null:rt}regType=`<${rt}>`}if(!elem||!_isRE(elem)){if(!(typeObj=this._registry[regType])){this._registry[regType]=typeObj={}}}else{if(!(typeObj=this._regexps[rt])){this._regexps[rt]=typeObj={}}if(!this._reObjs[rt]){this._reObjs[rt]=new RegExp(rt)}}if(!(callbacks=typeObj[ruleName])){typeObj[ruleName]=callbacks=[]}callbacks.push({cb:func,rsi:rsi})}};Registry.prototype.XXsetRuleCallback=function(ruleName,ruleRegs,rsi){var typeObj,callbackType,ruleCallbacks,func;if(Array.isArray(ruleRegs)){var jj=this._setRuleCallback2(ruleName,ruleRegs)}else if(typeof ruleRegs!=="object"){return}else if(ruleRegs.cb){let regs=this._setExtended(ruleName,ruleRegs,rsi);if(regs){ruleRegs=regs}}for(callbackType in ruleRegs){func=ruleRegs[callbackType];if(typeof func!=="function"){this._info("Rule "+ruleName+" : registered '"+callbackType+"' is not a function");continue}typeObj=this._registry[callbackType];if(!typeObj){this._registry[callbackType]=typeObj={}}ruleCallbacks=typeObj[ruleName];if(!ruleCallbacks){typeObj[ruleName]=ruleCallbacks=[]}ruleCallbacks.push({cb:func,rsi:rsi})}};Registry.prototype.XXsetRuleCallback2=function(ruleName,regs,rsi){var a,i,j,props,prop,reg,val;for(i=0;i<regs.length;i++){reg=regs[i];if(!reg.cb){if(!a){a=[]}a.push(reg);continue}props=Object.keys(reg);if(props.length===2){for(j=0;j<props.length;j++){prop=props[j];if(prop!=="cb"){val=reg[prop];if(typeof val==="boolean"&&val){a.push({prop:val});break}}}continue}}};Registry.prototype.isEmpty=function(){return!this._appCtx.utils.hasAnyProps(this._registry)};Registry.prototype.dump=function(){var type,rule,vals,tagWidth,tagLen=0,indent,isFirst,s="";var list2={},ruleWidth,ruleLen=0,source,aSource,i;for(type in this._registry){if(type.length>tagLen){tagLen=type.length}}for(type in this._regexps){if(type.length>tagLen){tagLen=type.length}}if(!tagLen){return"\n-- No rules enabled - nothing to report --\n"}tagWidth=tagLen+3;indent=" ".repeat(tagWidth);s="\n"+ljustify("--- Tags ---",indent.length,indent)+"----- rules -----";source=this._registry;for(i=0;i<2;i++){aSource=Object.keys(source).sort();aSource.forEach(type=>{s+="\n"+ljustify(type,tagWidth,indent);vals=source[type];isFirst=true;for(rule in vals){s+=(isFirst?"":indent)+rule+"\n";isFirst=false;if(!list2[rule]){list2[rule]=[]}list2[rule].push(type);if(rule.length>ruleLen){ruleLen=rule.length}}});source=this._regexps}ruleWidth=ruleLen+2;indent=" ".repeat(ruleWidth);s+="\n"+ljustify("----- Rules -----",indent.length,indent)+"--- Tags ---";aSource=Object.keys(list2).sort();aSource.forEach(rule=>{vals=list2[rule];s+="\n"+ljustify(rule,ruleWidth,indent);isFirst=true;for(i=0;i<vals.length;i++){s+=(isFirst?"":indent)+vals[i]+"\n";isFirst=false}});return s+"\n"};function ljustify(n,w,blanks){var s=n.toString();var l=s.length;return s+blanks.substr(0,w-l)};function _isRE(s){var ret=s==="attrexpr-$props";return ret?!ret:RULE_RE.test(s)};module.exports=Registry;
6
+ const RULE_RE=new RegExp(/[~`!#$%\^&*+\[\]\\';,/{}|\\"\?]/);var Registry=function(appCtx){this._registry={};this._regexps={};this._reObjs={};this._TsxSynopsis={};this._appCtx=appCtx;this._info=appCtx.info;this._assert=appCtx.assert};Registry.prototype.getRegisteredCallbacks=function(type){var reo,ret;ret=this._registry[type];if(!type.startsWith("css-")&&type.indexOf("-")>0&&type.indexOf("|")<0){ret={...ret};type=type.substring(1,type.length-1).trim();for(re in this._regexps){reo=this._reObjs[re];if(reo&&reo.test(type)){if(!ret){ret={}}for(x in this._regexps[re]){ret[x]=this._regexps[re][x]}}};}return ret};Registry.prototype.isRegisteredCallback=function(type){if(type==="Tsx<"){let entry,ret;for(entry in this._registry){if(entry.startsWith("Tsx<")){ret=true;break}}return ret||false}return!!this._registry[type]};Registry.prototype.isRegisteredCallbackRE=function(elem){var ret,i;if(ret=this.isRegisteredCallback(elem)){return ret}elem=elem.startsWith("<")?elem.substring(1,elem.length-1):elem;for(re in this._regexps){if(this._reObjs[re].test(elem)){return true}}return false};Registry.prototype.getTsxRuleSynopsis=function(){var o=this._TsxSynopsis;o.isTsxRC=this.isRegisteredCallback("TsxRenderComponent");o.isTsxWC=this.isRegisteredCallback("TsxWebComponent");o.isTsxJetWC=this.isRegisteredCallback("TsxJetComponent");o.isTsxComp=this.isRegisteredCallback("TsxComponent");o.isTsxElem=this.isRegisteredCallback("TsxElem");o.isTsxProp=this.isRegisteredCallback("TsxProperty");o.isTsxNamedComp=this.isRegisteredCallback("Tsx<");o.isAnyTsxCompAttr=this.isRegisteredAnyTsxCompAttr();o.isAnyTsxAttr=this.isRegisteredAnyTsxAttr();return o};Registry.prototype.isAnyTsxTypeRegistered=function(){var keys,key,ret,i;keys=Object.keys(this._registry);for(i=0;i<keys.length;i++){key=keys[i];if(ret=key.startsWith("Tsx")){break}}return!!ret};Registry.prototype.isRegisteredAnyTsxCompAttr=function(){var keys,key,ret,i;keys=Object.keys(this._registry);for(i=0;i<keys.length;i++){key=keys[i];if(ret=key.startsWith("Tsx<")&&key.includes("|")){break}}return!!ret};Registry.prototype.isRegisteredAnyTsxAttr=function(){var keys,key,ret,i;keys=Object.keys(this._registry);for(i=0;i<keys.length;i++){key=keys[i];if(ret=key.startsWith("Tsx<")&&key.includes("=")&&!key.includes("|")){break}}return!!ret};Registry.prototype.setRuleCallback=function(ruleName,ruleRegs,rsi){var typeObj,regType,rt,callbacks,func,args,elem,isTsx;for(regType in ruleRegs){func=ruleRegs[regType];if(typeof func!=="function"){this._info(`Rule ${ruleName} : registered '${regType}' is not a function`);continue}rt=elem=regType;if(isTsx=rt.startsWith("Tsx<")){regType=rt.substring(3)}if(regType.charAt(0)==="<"){rt=regType.substring(1,regType.length-1).trim();args=rt.split(" ");if(args.length>1){attrib=args[args.length-1];if(attrib.endsWith("=")){rt=args[0]+"|"+attrib.substring(0,attrib.length-1)}elem=args[0]}else{elem=rt.endsWith("=")?null:rt}regType=`<${rt}>`;regType=(isTsx?"Tsx":"")+regType}if(!elem||!_isRE(elem)){if(!(typeObj=this._registry[regType])){this._registry[regType]=typeObj={}}}else{if(!(typeObj=this._regexps[rt])){this._regexps[rt]=typeObj={}}if(!this._reObjs[rt]){this._reObjs[rt]=new RegExp(rt)}}if(!(callbacks=typeObj[ruleName])){typeObj[ruleName]=callbacks=[]}callbacks.push({cb:func,rsi:rsi})}};Registry.prototype.XXsetRuleCallback=function(ruleName,ruleRegs,rsi){var typeObj,callbackType,ruleCallbacks,func;if(Array.isArray(ruleRegs)){var jj=this._setRuleCallback2(ruleName,ruleRegs)}else if(typeof ruleRegs!=="object"){return}else if(ruleRegs.cb){let regs=this._setExtended(ruleName,ruleRegs,rsi);if(regs){ruleRegs=regs}}for(callbackType in ruleRegs){func=ruleRegs[callbackType];if(typeof func!=="function"){this._info("Rule "+ruleName+" : registered '"+callbackType+"' is not a function");continue}typeObj=this._registry[callbackType];if(!typeObj){this._registry[callbackType]=typeObj={}}ruleCallbacks=typeObj[ruleName];if(!ruleCallbacks){typeObj[ruleName]=ruleCallbacks=[]}ruleCallbacks.push({cb:func,rsi:rsi})}};Registry.prototype.XXsetRuleCallback2=function(ruleName,regs,rsi){var a,i,j,props,prop,reg,val;for(i=0;i<regs.length;i++){reg=regs[i];if(!reg.cb){if(!a){a=[]}a.push(reg);continue}props=Object.keys(reg);if(props.length===2){for(j=0;j<props.length;j++){prop=props[j];if(prop!=="cb"){val=reg[prop];if(typeof val==="boolean"&&val){a.push({prop:val});break}}}continue}}};Registry.prototype.isEmpty=function(){return!this._appCtx.utils.hasAnyProps(this._registry)};Registry.prototype.dump=function(){var type,rule,vals,tagWidth,tagLen=0,indent,isFirst,s="";var list2={},ruleWidth,ruleLen=0,source,aSource,i;for(type in this._registry){if(type.length>tagLen){tagLen=type.length}}for(type in this._regexps){if(type.length>tagLen){tagLen=type.length}}if(!tagLen){return"\n-- No rules enabled - nothing to report --\n"}tagWidth=tagLen+3;indent=" ".repeat(tagWidth);s="\n"+ljustify("--- Tags ---",indent.length,indent)+"----- rules -----";source=this._registry;for(i=0;i<2;i++){aSource=Object.keys(source).sort();aSource.forEach(type=>{s+="\n"+ljustify(type,tagWidth,indent);vals=source[type];isFirst=true;for(rule in vals){s+=(isFirst?"":indent)+rule+"\n";isFirst=false;if(!list2[rule]){list2[rule]=[]}list2[rule].push(type);if(rule.length>ruleLen){ruleLen=rule.length}}});source=this._regexps}ruleWidth=ruleLen+2;indent=" ".repeat(ruleWidth);s+="\n"+ljustify("----- Rules -----",indent.length,indent)+"--- Tags ---";aSource=Object.keys(list2).sort();aSource.forEach(rule=>{vals=list2[rule];s+="\n"+ljustify(rule,ruleWidth,indent);isFirst=true;for(i=0;i<vals.length;i++){s+=(isFirst?"":indent)+vals[i]+"\n";isFirst=false}});return s+"\n"};function ljustify(n,w,blanks){var s=n.toString();var l=s.length;return s+blanks.substr(0,w-l)};function _isRE(s){var ret=s==="attrexpr-$props";return ret?!ret:RULE_RE.test(s)};module.exports=Registry;
package/lib/Reporter.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const FORMAT_JSON="json";var Reporter=function(msgCtx){this._issues=[];this._msgCtx=msgCtx;this._msgFilter=null;this._severity=null};Reporter.prototype.addIssue=function(issue,ruleCtx,severity){var sev,usev,id,offset;if(!issue||!ruleCtx){return}var rulePack=ruleCtx.rulePack;var opts=rulePack.getRuleOptions(ruleCtx.ruleName,null,true);if(opts.$sevLocked){issue.severity=opts.severity}else{issue.severity=severity&&this._severity.isValidRuleSeverity(severity)?severity:issue.severity?issue.severity:opts.severity}if(!issue.msgId){issue.msgId=ruleCtx.getMsgId(ruleCtx,issue.msgKey)}issue.prefix=rulePack.getPrefix();id=issue.prefix+"-"+issue.msgId;if(this._msgFilter&&!this._isMsgFiltered(id)){return}sev=this._severity.getMsgSev(id);usev=sev?this._severity.unmap(sev):issue.severity;if(!this._severity.matchSeverityLevel(usev)){this._msgCtx.debug("Reporter ignoring issue because of severity");return}issue.severity=sev||usev;issue.rsi=ruleCtx._rsi;offset=ruleCtx.position?ruleCtx.position.offset:0;offset=typeof offset==="number"?offset:0;if(issue.index!==undefined){if(issue.index.start===undefined){issue.index.start=ruleCtx.position.start;issue.index.end=ruleCtx.position.end}}else{issue.index=ruleCtx.position}if(issue.index&&issue.index.start!==undefined){issue.index.start+=offset;issue.index.end+=offset}issue.$hook=opts.$hook;if(this._outFormat===FORMAT_JSON){issue.name=issue.filepath?issue.filepath:ruleCtx.filepath}issue.ruleName=ruleCtx.ruleName;issue.token=this._parseData;issue.tokType=this._parseType;if(ruleCtx.filepath&&!issue.filepath){issue.filepath=ruleCtx.filepath}issue.msg=issue.msg.replace(/&lt;/g,"<");issue.msg=issue.msg.replace(/&gt;/g,">");this._issues.push(issue)};Reporter.prototype.getIssues=function(){return this._issues};Reporter.prototype.getCount=function(){return this._issues.length};Reporter.prototype.clearIssues=function(){return this._issues.length=0};Reporter.prototype.setParseData=function(parseData,parseType){this._parseData=parseData;this._parseType=parseType};Reporter.prototype.getFormat=function(){return this._outFormat};Reporter.prototype.setOutFormat=function(format){return this._outFormat=format};Reporter.prototype.setSevInstance=function(sevInst){this._severity=sevInst};Reporter.prototype.setMessageFilter=function(messages){var a,am,i;if(messages){a=messages.accept?messages.accept:messages.reject?messages.reject:null;if(a&&a.length){am=[];for(i=0;i<a.length;i++){am.push(new RegExp(a[i]))}}if(am){if(messages.reject){this._msgFilter={reject:am}}else if(messages.accept){this._msgFilter={accept:am}}}}if(!am){this._msgFilter=null}};Reporter.prototype._isMsgFiltered=function(msgId){var a,b=false,i;if(!this._msgFilter){return true}a=this._msgFilter.accept?this._msgFilter.accept:this._msgFilter.reject?this._msgFilter.reject:null;if(a){for(i=0;i<a.length;i++){if(a[i].test(msgId)){b=true;break}}}return this._msgFilter.accept?b:!b};module.exports=Reporter;
6
+ const FORMAT_JSON="json";var Reporter=function(msgCtx){this._issues=[];this._msgCtx=msgCtx;this._msgFilter=null;this._isDebug=msgCtx.isDebug;this._debug=msgCtx.debug;this._severity=null};Reporter.prototype.addIssue=function(issue,ruleCtx,severity){var sev,usev,id,offset;if(!issue||!ruleCtx){return}var rulePack=ruleCtx.rulePack;var opts=rulePack.getRuleOptions(ruleCtx.ruleName,null,true);if(opts.$sevLocked){issue.severity=opts.severity}else{issue.severity=severity&&this._severity.isValidRuleSeverity(severity)?severity:issue.severity?issue.severity:opts.severity}if(!issue.msgId){issue.msgId=ruleCtx.getMsgId(ruleCtx,issue.msgKey)}issue.prefix=rulePack.getPrefix();id=issue.prefix+"-"+issue.msgId;if(this._isDebug){this._debug(` emitted -> [${id}]: "${issue.msg&&issue.msg.length>60?issue.msg.substring(0,60)+"...":issue.msg}"`)}if(this._msgFilter&&!this._isMsgFiltered(id)){if(this._isDebug){this._debug("..Issue suppressed by config.messages")}return}sev=this._severity.getMsgSev(id);usev=sev?this._severity.unmap(sev):issue.severity;if(!this._severity.matchSeverityLevel(usev)){if(this._isDebug)this._debug("Reporter ignoring issue because of severity");return}issue.severity=sev||usev;issue.rsi=ruleCtx._rsi;offset=ruleCtx.position?ruleCtx.position.offset:0;offset=typeof offset==="number"?offset:0;if(issue.index!==undefined){if(issue.index.start===undefined){issue.index.start=ruleCtx.position.start;issue.index.end=ruleCtx.position.end}}else{issue.index=ruleCtx.position}if(issue.index&&issue.index.start!==undefined){if(offset>0){issue.index.start+=offset;issue.index.end+=offset;issue.index.line=undefined}}issue.$hook=opts.$hook;if(this._outFormat===FORMAT_JSON){issue.name=issue.filepath?issue.filepath:ruleCtx.filepath}issue.ruleName=ruleCtx.ruleName;issue.token=this._parseData;issue.tokType=this._parseType;if(ruleCtx.filepath&&!issue.filepath){issue.filepath=ruleCtx.filepath}issue.msg=issue.msg.replace(/&lt;/g,"<");issue.msg=issue.msg.replace(/&gt;/g,">");this._issues.push(issue)};Reporter.prototype.getIssues=function(){return this._issues};Reporter.prototype.getCount=function(){return this._issues.length};Reporter.prototype.clearIssues=function(){return this._issues.length=0};Reporter.prototype.setParseData=function(parseData,parseType){this._parseData=parseData;this._parseType=parseType};Reporter.prototype.getFormat=function(){return this._outFormat};Reporter.prototype.setOutFormat=function(format){return this._outFormat=format};Reporter.prototype.setSevInstance=function(sevInst){this._severity=sevInst};Reporter.prototype.setDebugMode=function(b){this._isDebug=b};Reporter.prototype.setMessageFilter=function(messages){var a,am,i;if(messages){a=messages.accept?messages.accept:messages.reject?messages.reject:null;if(a&&a.length){am=[];for(i=0;i<a.length;i++){am.push(new RegExp(a[i]))}}if(am){if(messages.reject){this._msgFilter={reject:am}}else if(messages.accept){this._msgFilter={accept:am}}}}if(!am){this._msgFilter=null}};Reporter.prototype._isMsgFiltered=function(msgId){var a,b=false,i;if(!this._msgFilter){return true}a=this._msgFilter.accept?this._msgFilter.accept:this._msgFilter.reject?this._msgFilter.reject:null;if(a){for(i=0;i<a.length;i++){if(a[i].test(msgId)){b=true;break}}}return this._msgFilter.accept?b:!b};module.exports=Reporter;
package/lib/RulePack.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const clone=require("./clone");const ONMSG="onMsg";var RulePack=function(packSummary,rulePacks,shadPacks,rsi,appCtx){this._rulePacks=rulePacks;this._shadPacks=shadPacks;this._summary=packSummary;this._rsi=rsi;this._appCtx=appCtx;this._ruleCtx=null;this._extension=null;this._count=-1;this._activeCount=-1};RulePack.prototype.getPackInfo=function(){var rpinfo=this._summary[this._rsi];return{title:rpinfo.title,path:rpinfo.path,version:rpinfo.version,prefix:rpinfo.prefix,status:rpinfo.status,packData:rpinfo.packData}};RulePack.prototype.getPrefix=function(){var s=this._summary[this._rsi].prefix;return s.slice(0)};RulePack.prototype.getRuleOptions=function(name,prefix,internal){var rsi,rp,opts;if(!this._ruleCtx){this._appCtx.assert("getRuleOptions - Unset rulepack ctx");if(!name)return null}name=name||this._ruleCtx.ruleName;if(prefix){rsi=this._getRsiByPrefix(prefix);if(rsi<0){return null}}else{rsi=this._rsi}rp=this._rulePacks[rsi];opts=rp.rulesJson.rules[name];return opts?internal?opts:clone.cloneOptions(opts):null};RulePack.prototype.getRuleOption=function(property,name,prefix){var rsi,rp,opts;name=name||this._ruleCtx.ruleName;if(prefix){rsi=this._getRsiByPrefix(prefix);if(rsi<0){return null}}else{rsi=this._rsi}rp=this._rulePacks[rsi];opts=rp.rulesJson.rules[name];return opts?clone.cloneProperty(opts[property]):null};RulePack.prototype.getRuleCustomOptions=function(name,prefix,internal){var opts;if(opts=this.getRuleOptions(name,prefix,internal)){opts=opts.customOpts}return opts||{}};RulePack.prototype.setRuleOptions=function(name,opts){var o,prop,ret=false;if(this._ruleCtx._rsi!==this._rsi){return false}name=name||this._ruleCtx.ruleName;if(!name){return false}if(opts&&typeof opts==="object"&&!Array.isArray(opts)){o=this.getRuleOptions(name);if(o){for(prop in opts){if(prop.charAt(0)==="$"||prop==="name"){continue}if(prop==="enabled"){if(opts.enabled){if(o.enabled){continue}this.enableRule(name)}else{if(o.enabled){this.disableRule(name)}}}o[prop]=opts[prop];ret=true}}}return ret};RulePack.prototype.isRuleEnabled=function(name,prefix){var o=this.getRuleOptions(name,prefix,true);return o?o.enabled:false};RulePack.prototype.isRuleDisabled=function(name,prefix){var o=this.getRuleOptions(name,prefix,true);return o?!o.enabled:false};RulePack.prototype.disableRule=function(name){var ret=true;if(this._ruleCtx._rsi!==this._rsi){return false}name=name||this._ruleCtx.ruleName;if(!name){return false}var o=this.getRuleOptions(name,null,true);if(o){if(o.enabled){o.enabled=false;if(this._activeCount>=0){this._activeCount--}}}else{ret=false}return ret};RulePack.prototype.enableRule=function(name){if(this._ruleCtx._rsi!==this._rsi){return false}var ret=true;var o=this.getRuleOptions(name,null,true);if(o){if(!o.enabled){o.enabled=true;this._activeCount++}}else{ret=false}return ret};RulePack.prototype.getRuleCount=function(){if(this._ruleCount>=0){return this._rulecount}var rules,n,r;rules=this._rulePacks[this._rsi].rulesJson.rules;n=0;for(r in rules){n++}this._ruleCount=n;return n};RulePack.prototype.getEnabledRuleCount=function(){if(this._activeCount>=0){return this._activeCount}var opts,r,n;opts=this._rulePacks[this._rsi].rulesJson.rules;n=0;for(r in opts){if(opts[r].enabled){n++}}this._activeCount=n;return n};RulePack.prototype.getRuleList=function(){var rules=this._rulePacks[this._rsi].rulesJson.rules;var a,r;a=[];for(r in rules){a.push(r)}return a};RulePack.prototype.getEnabledRuleList=function(){var rules=this._rulePacks[this._rsi].rulesJson.rules;var a,r;a=[];for(r in rules){if(rules[r].enabled){a.push(r)}}return a};RulePack.prototype.getRule=function(name){var r;if(this._ruleCtx._rsi===this._rsi){if(name){r=this._shadPacks[this._rsi];if(r){r=r[name]}}}return r};RulePack.prototype.sendMsg=function(name,...args){var rc;if(!Array.isArray(name)&&typeof name==="string"){this._pushRuleName();if(this._ruleCtx._rsi===this._rsi&&name!==this._ruleCtx.ruleName){rc=this._sendMsg([name],args,true)}this._popRuleName()}return rc};RulePack.prototype.broadcastMsg=function(names,...data){var rc;if(this._ruleCtx._rsi!==this._rsi||names&&!Array.isArray(names)){return false}var a;if(!names){a=this.getEnabledRuleList()}else if(Array.isArray(names)){a=names}else{return false}this._pushRuleName();rc=this._sendMsg(a,data);this._popRuleName();return rc};RulePack.prototype.setExtension=function(data){this._extension=data};RulePack.prototype.getExtension=function(){return this._extension};RulePack.prototype._setCBCtx=function(ctx){this._ruleCtx=ctx};RulePack.prototype._getRsiByPrefix=function(prefix){var rsi,l;l=this._summary.length;for(rsi=0;rsi<l;rsi++){if(this._summary[rsi].prefix===prefix){break}}return rsi>=l?-1:rsi};RulePack.prototype._sendMsg=function(a,args,isSendMsg){var n=0,i,rc;let sender=clone.cloneOptions(this._summary[this._rsi]);sender.ruleName=this._ruleCtx.ruleName;sender.regType=this._ruleCtx.type;for(i=0;i<a.length;i++){let rn=a[i];if(rn===this._ruleCtx.ruleName){continue}let r=this.getRule(rn);if(r&&r[ONMSG]){try{this._ruleCtx.ruleName=rn;rc=r[ONMSG](sender,args);n++}catch(e){this._appCtx.error("rule '"+rn+"' onMsg() : "+e)}}}return isSendMsg?rc:n};RulePack.prototype._pushRuleName=function(){if(!this._nameStack){this._nameStack=[]}this._nameStack.push(this._ruleCtx.ruleName)};RulePack.prototype._popRuleName=function(){if(this._nameStack&&this._nameStack.length){this._ruleCtx.ruleName=this._nameStack.pop()}};module.exports=RulePack;
6
+ const clone=require("./clone");const ONMSG="onMsg";var RulePack=function(packSummary,rulePacks,shadPacks,rsi,appCtx){this._rulePacks=rulePacks;this._shadPacks=shadPacks;this._summary=packSummary;this._rsi=rsi;this._appCtx=appCtx;this._ruleCtx=null;this._extension=null;this._count=-1;this._activeCount=-1};RulePack.prototype.getPackInfo=function(){var rpinfo=this._summary[this._rsi];return{title:rpinfo.title,path:rpinfo.path,version:rpinfo.version,prefix:rpinfo.prefix,status:rpinfo.status,packData:rpinfo.packData}};RulePack.prototype.getPrefix=function(){var s=this._summary[this._rsi].prefix;return s.slice(0)};RulePack.prototype.getRuleOptions=function(name,prefix,internal){var rsi,rp,opts;if(!this._ruleCtx){this._appCtx.assert("getRuleOptions - Unset rulepack ctx");if(!name)return null}name=name||this._ruleCtx.ruleName;if(prefix){rsi=this._getRsiByPrefix(prefix);if(rsi<0){return null}}else{rsi=this._rsi}rp=this._rulePacks[rsi];opts=rp.rulesJson.rules[name];return opts?internal?opts:clone.cloneOptions(opts):null};RulePack.prototype.getRuleOption=function(property,name,prefix){var rsi,rp,opts;name=name||this._ruleCtx.ruleName;if(prefix){rsi=this._getRsiByPrefix(prefix);if(rsi<0){return null}}else{rsi=this._rsi}rp=this._rulePacks[rsi];opts=rp.rulesJson.rules[name];return opts?clone.cloneProperty(opts[property]):null};RulePack.prototype.getRuleCustomOptions=function(name,prefix,internal){var opts;if(opts=this.getRuleOptions(name,prefix,internal)){opts=opts.customOpts}return opts||{}};RulePack.prototype.getRuleCustomOption=function(property,name,prefix){var rsi,rp,opts;name=name||this._ruleCtx.ruleName;if(prefix){rsi=this._getRsiByPrefix(prefix);if(rsi<0){return null}}else{rsi=this._rsi}rp=this._rulePacks[rsi];opts=rp.rulesJson.rules[name].customOpts;return opts?clone.cloneProperty(opts[property]):null};RulePack.prototype.setRuleOptions=function(name,opts){var o,prop,ret=false;if(this._ruleCtx._rsi!==this._rsi){return false}name=name||this._ruleCtx.ruleName;if(!name){return false}if(opts&&typeof opts==="object"&&!Array.isArray(opts)){o=this.getRuleOptions(name);if(o){for(prop in opts){if(prop.charAt(0)==="$"||prop==="name"){continue}if(prop==="enabled"){if(opts.enabled){if(o.enabled){continue}this.enableRule(name)}else{if(o.enabled){this.disableRule(name)}}}o[prop]=opts[prop];ret=true}}}return ret};RulePack.prototype.isRuleEnabled=function(name,prefix){var o=this.getRuleOptions(name,prefix,true);return o?o.enabled:false};RulePack.prototype.isRuleDisabled=function(name,prefix){var o=this.getRuleOptions(name,prefix,true);return o?!o.enabled:false};RulePack.prototype.disableRule=function(name){var ret=true;if(this._ruleCtx._rsi!==this._rsi){return false}name=name||this._ruleCtx.ruleName;if(!name){return false}var o=this.getRuleOptions(name,null,true);if(o){if(o.enabled){o.enabled=false;if(this._activeCount>=0){this._activeCount--}}}else{ret=false}return ret};RulePack.prototype.enableRule=function(name){if(this._ruleCtx._rsi!==this._rsi){return false}var ret=true;var o=this.getRuleOptions(name,null,true);if(o){if(!o.enabled){o.enabled=true;this._activeCount++}}else{ret=false}return ret};RulePack.prototype.getRuleCount=function(){if(this._ruleCount>=0){return this._rulecount}var rules,n,r;rules=this._rulePacks[this._rsi].rulesJson.rules;n=0;for(r in rules){n++}this._ruleCount=n;return n};RulePack.prototype.getEnabledRuleCount=function(){if(this._activeCount>=0){return this._activeCount}var opts,r,n;opts=this._rulePacks[this._rsi].rulesJson.rules;n=0;for(r in opts){if(opts[r].enabled){n++}}this._activeCount=n;return n};RulePack.prototype.getRuleList=function(){var rules=this._rulePacks[this._rsi].rulesJson.rules;var a,r;a=[];for(r in rules){a.push(r)}return a};RulePack.prototype.getEnabledRuleList=function(){var rules=this._rulePacks[this._rsi].rulesJson.rules;var a,r;a=[];for(r in rules){if(rules[r].enabled){a.push(r)}}return a};RulePack.prototype.getRule=function(name){var r;if(this._ruleCtx._rsi===this._rsi){if(name){r=this._shadPacks[this._rsi];if(r){r=r[name]}}}return r};RulePack.prototype.sendMsg=function(name,...args){var rc;if(!Array.isArray(name)&&typeof name==="string"){this._pushRuleName();if(this._ruleCtx._rsi===this._rsi&&name!==this._ruleCtx.ruleName){rc=this._sendMsg([name],args,true)}this._popRuleName()}return rc};RulePack.prototype.broadcastMsg=function(names,...data){var rc;if(this._ruleCtx._rsi!==this._rsi||names&&!Array.isArray(names)){return false}var a;if(!names){a=this.getEnabledRuleList()}else if(Array.isArray(names)){a=names}else{return false}this._pushRuleName();rc=this._sendMsg(a,data);this._popRuleName();return rc};RulePack.prototype.setExtension=function(data){this._extension=data};RulePack.prototype.getExtension=function(){return this._extension};RulePack.prototype._setCBCtx=function(ctx){this._ruleCtx=ctx};RulePack.prototype._getRsiByPrefix=function(prefix){var rsi,l;l=this._summary.length;for(rsi=0;rsi<l;rsi++){if(this._summary[rsi].prefix===prefix){break}}return rsi>=l?-1:rsi};RulePack.prototype._sendMsg=function(a,args,isSendMsg){var n=0,i,rc;let sender=clone.cloneOptions(this._summary[this._rsi]);sender.ruleName=this._ruleCtx.ruleName;sender.regType=this._ruleCtx.type;for(i=0;i<a.length;i++){let rn=a[i];if(rn===this._ruleCtx.ruleName){continue}let r=this.getRule(rn);if(r&&r[ONMSG]){try{this._ruleCtx.ruleName=rn;rc=r[ONMSG](sender,args);n++}catch(e){this._appCtx.error("rule '"+rn+"' onMsg() : "+e)}}}return isSendMsg?rc:n};RulePack.prototype._pushRuleName=function(){if(!this._nameStack){this._nameStack=[]}this._nameStack.push(this._ruleCtx.ruleName)};RulePack.prototype._popRuleName=function(){if(this._nameStack&&this._nameStack.length){this._ruleCtx.ruleName=this._nameStack.pop()}};module.exports=RulePack;