/*
 * Copyright (c) 2018, 2025, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const NS=require("./ns").getKeys();const OJ="oj-";function show(){var oj,noj,m,i;oj=[];noj=[];for(i=0;i<NS.length;i++){if(NS[i].startsWith(OJ)){oj.push(NS[i])}else{noj.push(NS[i])}}oj=oj.sort();var col1l,col2l;var col1l=Math.floor(oj.length/3)+(oj.length%3?1:0);if(!(oj.length%3)){col2l=col1l}else{if(oj.length-col1l){col2l=Math.floor((oj.length-col1l)/2)+(oj.length%2?1:0)}else{col2l=0}}col2l+=col1l;var col1w=0,col2w=0;for(i=0;i<col1l;i++){if(oj[i].length>col1w){col1w=oj[i].length}}for(i=col1l;i<col2l;i++){if(oj[i].length>col2w){col2w=oj[i].length}}col1w+=3;col2w+=3;m="\nJET Registered Namespaces";console.log(`\n${m}\n${"-".repeat(m.length)}`);for(i=0;i<col1l;i++){let col1=oj[i];let col2=i+col1l<col2l?oj[i+col1l]:"";let col3=i+col2l<oj.length?oj[i+col2l]:"";console.log(`${_left(col1,col1w)}${_left(col2,col2w)}${col3}`)}noj.sort();m="\nMiscellaneous Non-OJ Registered Namespaces";console.log(`\n${m}\n${"-".repeat(m.length)}`);for(i=0;i<noj.length;i++){console.log(noj[i])}};function _left(s,len){var l=len-s.length;if(l<0){l=0}return s+" ".repeat(l)};module.exports.showNamespaces=show;