@techdocs/cli 1.5.2-next.1 → 1.6.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/{mkdocs-582c42fd.cjs.js → mkdocs-571e2dc0.cjs.js} +2 -2
- package/dist/cjs/{mkdocs-582c42fd.cjs.js.map → mkdocs-571e2dc0.cjs.js.map} +1 -1
- package/dist/cjs/{mkdocsServer-99ec8af2.cjs.js → mkdocsServer-107b8efd.cjs.js} +16 -6
- package/dist/cjs/mkdocsServer-107b8efd.cjs.js.map +1 -0
- package/dist/cjs/{serve-552eaafd.cjs.js → serve-bf2ff8e3.cjs.js} +10 -7
- package/dist/cjs/serve-bf2ff8e3.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +19 -20
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/3893.18294a43.chunk.js +3 -0
- package/dist/embedded-app/static/3893.18294a43.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.a4e3d2e1.js +487 -0
- package/dist/embedded-app/static/main.a4e3d2e1.js.map +1 -0
- package/dist/embedded-app/static/module-lodash.adfd55fe.js +29 -0
- package/dist/embedded-app/static/module-lodash.adfd55fe.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.65ce4c09.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.65ce4c09.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.652daaf3.js +22 -0
- package/dist/embedded-app/static/module-react-router.652daaf3.js.map +1 -0
- package/dist/embedded-app/static/module-zod.9e0f365e.js +3 -0
- package/dist/embedded-app/static/module-zod.9e0f365e.js.map +1 -0
- package/dist/embedded-app/static/{runtime.42be8165.js → runtime.a4e3d2e1.js} +2 -2
- package/dist/embedded-app/static/{runtime.42be8165.js.map → runtime.a4e3d2e1.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.42be8165.js → vendor.a4e3d2e1.js} +1 -1
- package/dist/embedded-app/static/{vendor.42be8165.js.map → vendor.a4e3d2e1.js.map} +1 -1
- package/dist/index.cjs.js +6 -3
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/mkdocsServer-99ec8af2.cjs.js.map +0 -1
- package/dist/cjs/serve-552eaafd.cjs.js.map +0 -1
- package/dist/embedded-app/static/3893.0eb40023.chunk.js +0 -3
- package/dist/embedded-app/static/3893.0eb40023.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.42be8165.js +0 -487
- package/dist/embedded-app/static/main.42be8165.js.map +0 -1
- package/dist/embedded-app/static/module-lodash.8166f005.js +0 -29
- package/dist/embedded-app/static/module-lodash.8166f005.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.a0f835fd.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.a0f835fd.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.8e9755f1.js +0 -22
- package/dist/embedded-app/static/module-react-router.8e9755f1.js.map +0 -1
- package/dist/embedded-app/static/module-zod.c74c6842.js +0 -3
- package/dist/embedded-app/static/module-zod.c74c6842.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
+
## 1.6.0-next.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d06b30b050: Add possibility to use a mkdocs config file with a different name than `mkdocs.<yaml|yml> with the serve command using the `--mkdocs-config-file-name` argument
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/backend-common@0.19.8-next.2
|
|
13
|
+
- @backstage/plugin-techdocs-node@1.9.0-next.2
|
|
14
|
+
- @backstage/catalog-model@1.4.3-next.0
|
|
15
|
+
- @backstage/cli-common@0.1.13-next.0
|
|
16
|
+
- @backstage/config@1.1.1-next.0
|
|
17
|
+
|
|
3
18
|
## 1.5.2-next.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var openBrowser = require('react-dev-utils/openBrowser');
|
|
4
4
|
var utility = require('./utility-3c0df5a9.cjs.js');
|
|
5
|
-
var mkdocsServer = require('./mkdocsServer-
|
|
5
|
+
var mkdocsServer = require('./mkdocsServer-107b8efd.cjs.js');
|
|
6
6
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
7
7
|
var fs = require('fs-extra');
|
|
8
8
|
require('winston');
|
|
@@ -60,4 +60,4 @@ Starting mkdocs server on ${localAddr}
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
exports["default"] = serveMkdocs;
|
|
63
|
-
//# sourceMappingURL=mkdocs-
|
|
63
|
+
//# sourceMappingURL=mkdocs-571e2dc0.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mkdocs-
|
|
1
|
+
{"version":3,"file":"mkdocs-571e2dc0.cjs.js","sources":["../../src/commands/serve/mkdocs.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { createLogger } from '../../lib/utility';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\n\nexport default async function serveMkdocs(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const dockerAddr = `http://0.0.0.0:${opts.port}`;\n const localAddr = `http://127.0.0.1:${opts.port}`;\n const expectedDevAddr = opts.docker ? dockerAddr : localAddr;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n './',\n opts.siteName,\n );\n\n // We want to open browser only once based on a log.\n let boolOpenBrowserTriggered = false;\n\n const logFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line in between\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n // Logs from container is verbose.\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !boolOpenBrowserTriggered &&\n line.includes(`Serving on ${expectedDevAddr}`)\n ) {\n // Always open the local address, since 0.0.0.0 belongs to docker\n logger.info(`\\nStarting mkdocs server on ${localAddr}\\n`);\n openBrowser(localAddr);\n boolOpenBrowserTriggered = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n\n // Commander stores --no-docker in cmd.docker variable\n const childProcess = await runMkdocsServer({\n port: opts.port,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n stdoutLogFunc: logFunc,\n stderrLogFunc: logFunc,\n });\n\n // Keep waiting for user to cancel the process\n await waitForSignal([childProcess]);\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["createLogger","getMkdocsYml","openBrowser","runMkdocsServer","waitForSignal","fs"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,eAA8B,YAAY,IAAoB,EAAA;AAC5D,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,E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,4BAAgB,CAAA;AAAA,IACzC,MAAM,IAAK,CAAA,IAAA;AAAA,IACX,aAAa,IAAK,CAAA,WAAA;AAAA,IAClB,kBAAkB,IAAK,CAAA,gBAAA;AAAA,IACvB,eAAe,IAAK,CAAA,YAAA;AAAA,IACpB,WAAW,IAAK,CAAA,MAAA;AAAA,IAChB,aAAe,EAAA,OAAA;AAAA,IACf,aAAe,EAAA,OAAA;AAAA,GAChB,CAAA,CAAA;AAGD,EAAM,MAAAC,0BAAA,CAAc,CAAC,YAAY,CAAC,CAAA,CAAA;AAElC,EAAA,IAAI,iBAAmB,EAAA;AACrB,IAAQ,OAAA,CAAA,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAGC,sBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
|
|
@@ -77,7 +77,8 @@ const runMkdocsServer = async (options) => {
|
|
|
77
77
|
dockerImage,
|
|
78
78
|
"serve",
|
|
79
79
|
"--dev-addr",
|
|
80
|
-
`0.0.0.0:${port}
|
|
80
|
+
`0.0.0.0:${port}`,
|
|
81
|
+
...options.mkdocsConfigFileName ? ["--config-file", options.mkdocsConfigFileName] : []
|
|
81
82
|
],
|
|
82
83
|
{
|
|
83
84
|
stdoutLogFunc: options.stdoutLogFunc,
|
|
@@ -85,12 +86,21 @@ const runMkdocsServer = async (options) => {
|
|
|
85
86
|
}
|
|
86
87
|
);
|
|
87
88
|
}
|
|
88
|
-
return await run(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
return await run(
|
|
90
|
+
"mkdocs",
|
|
91
|
+
[
|
|
92
|
+
"serve",
|
|
93
|
+
"--dev-addr",
|
|
94
|
+
`127.0.0.1:${port}`,
|
|
95
|
+
...options.mkdocsConfigFileName ? ["--config-file", options.mkdocsConfigFileName] : []
|
|
96
|
+
],
|
|
97
|
+
{
|
|
98
|
+
stdoutLogFunc: options.stdoutLogFunc,
|
|
99
|
+
stderrLogFunc: options.stderrLogFunc
|
|
100
|
+
}
|
|
101
|
+
);
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
exports.runMkdocsServer = runMkdocsServer;
|
|
95
105
|
exports.waitForSignal = waitForSignal;
|
|
96
|
-
//# sourceMappingURL=mkdocsServer-
|
|
106
|
+
//# sourceMappingURL=mkdocsServer-107b8efd.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mkdocsServer-107b8efd.cjs.js","sources":["../../src/lib/run.ts","../../src/lib/mkdocsServer.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { spawn, SpawnOptions, ChildProcess } from 'child_process';\n\nexport type LogFunc = (data: Buffer | string) => void;\ntype SpawnOptionsPartialEnv = Omit<SpawnOptions, 'env'> & {\n env?: Partial<NodeJS.ProcessEnv>;\n // Pipe stdout to this log function\n stdoutLogFunc?: LogFunc;\n // Pipe stderr to this log function\n stderrLogFunc?: LogFunc;\n};\n\n// TODO: Accept log functions to pipe logs with.\n// Runs a child command, returning the child process instance.\n// Use it along with waitForSignal to run a long running process e.g. mkdocs serve\nexport const run = async (\n name: string,\n args: string[] = [],\n options: SpawnOptionsPartialEnv = {},\n): Promise<ChildProcess> => {\n const { stdoutLogFunc, stderrLogFunc } = options;\n\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n FORCE_COLOR: 'true',\n ...(options.env ?? {}),\n };\n\n // Refer: https://nodejs.org/api/child_process.html#child_process_subprocess_stdio\n const stdio = [\n 'inherit',\n stdoutLogFunc ? 'pipe' : 'inherit',\n stderrLogFunc ? 'pipe' : 'inherit',\n ] as ('inherit' | 'pipe')[];\n\n const childProcess = spawn(name, args, {\n stdio: stdio,\n ...options,\n env,\n });\n\n if (stdoutLogFunc && childProcess.stdout) {\n childProcess.stdout.on('data', stdoutLogFunc);\n }\n if (stderrLogFunc && childProcess.stderr) {\n childProcess.stderr.on('data', stderrLogFunc);\n }\n\n return childProcess;\n};\n\n// Block indefinitely and wait for a signal to stop the child process(es)\n// Throw error if any child process errors\n// Resolves only when all processes exit with status code 0\nexport async function waitForSignal(\n childProcesses: Array<ChildProcess>,\n): Promise<void> {\n const promises: Array<Promise<void>> = [];\n\n for (const signal of ['SIGINT', 'SIGTERM'] as const) {\n process.on(signal, () => {\n childProcesses.forEach(childProcess => {\n childProcess.kill();\n });\n });\n }\n\n childProcesses.forEach(childProcess => {\n if (typeof childProcess.exitCode === 'number') {\n if (childProcess.exitCode) {\n throw new Error(`Non zero exit code from child process`);\n }\n return;\n }\n\n promises.push(\n new Promise<void>((resolve, reject) => {\n childProcess.once('error', reject);\n childProcess.once('exit', resolve);\n }),\n );\n });\n\n await Promise.all(promises);\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ChildProcess } from 'child_process';\nimport { run, LogFunc } from './run';\n\nexport const runMkdocsServer = async (options: {\n port?: string;\n useDocker?: boolean;\n dockerImage?: string;\n dockerEntrypoint?: string;\n dockerOptions?: string[];\n stdoutLogFunc?: LogFunc;\n stderrLogFunc?: LogFunc;\n mkdocsConfigFileName?: string;\n}): Promise<ChildProcess> => {\n const port = options.port ?? '8000';\n const useDocker = options.useDocker ?? true;\n const dockerImage = options.dockerImage ?? 'spotify/techdocs';\n\n if (useDocker) {\n return await run(\n 'docker',\n [\n 'run',\n '--rm',\n '-w',\n '/content',\n '-v',\n `${process.cwd()}:/content`,\n '-p',\n `${port}:${port}`,\n '-it',\n ...(options.dockerEntrypoint\n ? ['--entrypoint', options.dockerEntrypoint]\n : []),\n ...(options.dockerOptions || []),\n dockerImage,\n 'serve',\n '--dev-addr',\n `0.0.0.0:${port}`,\n ...(options.mkdocsConfigFileName\n ? ['--config-file', options.mkdocsConfigFileName]\n : []),\n ],\n {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n },\n );\n }\n\n return await run(\n 'mkdocs',\n [\n 'serve',\n '--dev-addr',\n `127.0.0.1:${port}`,\n ...(options.mkdocsConfigFileName\n ? ['--config-file', options.mkdocsConfigFileName]\n : []),\n ],\n {\n stdoutLogFunc: options.stdoutLogFunc,\n stderrLogFunc: options.stderrLogFunc,\n },\n );\n};\n"],"names":["spawn"],"mappings":";;;;AA6Ba,MAAA,GAAA,GAAM,OACjB,IACA,EAAA,IAAA,GAAiB,EACjB,EAAA,OAAA,GAAkC,EACR,KAAA;AAjC5B,EAAA,IAAA,EAAA,CAAA;AAkCE,EAAM,MAAA,EAAE,aAAe,EAAA,aAAA,EAAkB,GAAA,OAAA,CAAA;AAEzC,EAAA,MAAM,GAAyB,GAAA;AAAA,IAC7B,GAAG,OAAQ,CAAA,GAAA;AAAA,IACX,WAAa,EAAA,MAAA;AAAA,IACb,GAAI,CAAA,EAAA,GAAA,OAAA,CAAQ,GAAR,KAAA,IAAA,GAAA,EAAA,GAAe,EAAC;AAAA,GACtB,CAAA;AAGA,EAAA,MAAM,KAAQ,GAAA;AAAA,IACZ,SAAA;AAAA,IACA,gBAAgB,MAAS,GAAA,SAAA;AAAA,IACzB,gBAAgB,MAAS,GAAA,SAAA;AAAA,GAC3B,CAAA;AAEA,E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AC9C,EAAC;AAAA,OACP;AAAA,MACA;AAAA,QACE,eAAe,OAAQ,CAAA,aAAA;AAAA,QACvB,eAAe,OAAQ,CAAA,aAAA;AAAA,OACzB;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAA,OAAO,MAAM,GAAA;AAAA,IACX,QAAA;AAAA,IACA;AAAA,MACE,OAAA;AAAA,MACA,YAAA;AAAA,MACA,aAAa,IAAI,CAAA,CAAA;AAAA,MACjB,GAAI,QAAQ,oBACR,GAAA,CAAC,iBAAiB,OAAQ,CAAA,oBAAoB,IAC9C,EAAC;AAAA,KACP;AAAA,IACA;AAAA,MACE,eAAe,OAAQ,CAAA,aAAA;AAAA,MACvB,eAAe,OAAQ,CAAA,aAAA;AAAA,KACzB;AAAA,GACF,CAAA;AACF;;;;;"}
|
|
@@ -7,7 +7,7 @@ var serveHandler = require('serve-handler');
|
|
|
7
7
|
var http = require('http');
|
|
8
8
|
var httpProxy = require('http-proxy');
|
|
9
9
|
var utility = require('./utility-3c0df5a9.cjs.js');
|
|
10
|
-
var mkdocsServer = require('./mkdocsServer-
|
|
10
|
+
var mkdocsServer = require('./mkdocsServer-107b8efd.cjs.js');
|
|
11
11
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
12
12
|
var fs = require('fs-extra');
|
|
13
13
|
require('winston');
|
|
@@ -121,10 +121,12 @@ async function serve(opts) {
|
|
|
121
121
|
const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;
|
|
122
122
|
const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;
|
|
123
123
|
const mkdocsExpectedDevAddr = opts.docker ? mkdocsDockerAddr : mkdocsLocalAddr;
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const mkdocsConfigFileName = opts.mkdocsConfigFileName;
|
|
125
|
+
const siteName = opts.siteName;
|
|
126
|
+
const { path: mkdocsYmlPath, configIsTemporary } = await pluginTechdocsNode.getMkdocsYml("./", {
|
|
127
|
+
name: siteName,
|
|
128
|
+
mkdocsConfigFileName
|
|
129
|
+
});
|
|
128
130
|
let mkdocsServerHasStarted = false;
|
|
129
131
|
const mkdocsLogFunc = (data) => {
|
|
130
132
|
const logLines = data.toString().split("\n");
|
|
@@ -147,7 +149,8 @@ async function serve(opts) {
|
|
|
147
149
|
dockerOptions: opts.dockerOption,
|
|
148
150
|
useDocker: opts.docker,
|
|
149
151
|
stdoutLogFunc: mkdocsLogFunc,
|
|
150
|
-
stderrLogFunc: mkdocsLogFunc
|
|
152
|
+
stderrLogFunc: mkdocsLogFunc,
|
|
153
|
+
mkdocsConfigFileName: mkdocsYmlPath
|
|
151
154
|
});
|
|
152
155
|
for (let attempt = 0; attempt < 30; attempt++) {
|
|
153
156
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
@@ -189,4 +192,4 @@ Opening browser.`
|
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
exports["default"] = serve;
|
|
192
|
-
//# sourceMappingURL=serve-
|
|
195
|
+
//# sourceMappingURL=serve-bf2ff8e3.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-bf2ff8e3.cjs.js","sources":["../../src/lib/httpServer.ts","../../src/commands/serve/serve.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport serveHandler from 'serve-handler';\nimport http from 'http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsTargetAddress: string;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsTargetAddress: string,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/techdocs/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsTargetAddress = mkdocsTargetAddress;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: this.mkdocsTargetAddress,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request path is prefixed with this.proxyEndpoint, remove it.\n const proxyEndpointPath = new RegExp(`^${this.proxyEndpoint}`, 'i');\n const forwardPath = request.url?.replace(proxyEndpointPath, '') || '';\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n if (request.url?.startsWith(this.proxyEndpoint)) {\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OptionValues } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { createLogger } from '../../lib/utility';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\n\nfunction findPreviewBundlePath(): string {\n try {\n return path.join(\n path.dirname(require.resolve('techdocs-cli-embedded-app/package.json')),\n 'dist',\n );\n } catch {\n // If the techdocs-cli-embedded-app package is not available it means we're\n // running a published package. For published packages the preview bundle is\n // copied to dist/embedded-app be the prepack script.\n //\n // This can be tested by running `yarn pack` and extracting the resulting tarball into a directory.\n // Within the extracted directory, run `npm install --only=prod`.\n // Once that's done you can test the CLI in any directory using `node <tmp-dir>/package <command>`.\n // eslint-disable-next-line no-restricted-syntax\n return findPaths(__dirname).resolveOwn('dist/embedded-app');\n }\n}\n\nfunction getPreviewAppPath(opts: OptionValues): string {\n return opts.previewAppBundlePath ?? findPreviewBundlePath();\n}\n\nexport default async function serve(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;\n const mkdocsExpectedDevAddr = opts.docker\n ? mkdocsDockerAddr\n : mkdocsLocalAddr;\n const mkdocsConfigFileName = opts.mkdocsConfigFileName;\n const siteName = opts.siteName;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml('./', {\n name: siteName,\n mkdocsConfigFileName,\n });\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = await runMkdocsServer({\n port: opts.mkdocsPort,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n stdoutLogFunc: mkdocsLogFunc,\n stderrLogFunc: mkdocsLogFunc,\n mkdocsConfigFileName: mkdocsYmlPath,\n });\n\n // Wait until mkdocs server has started so that Backstage starts with docs loaded\n // Takes 1-5 seconds\n for (let attempt = 0; attempt < 30; attempt++) {\n await new Promise(r => setTimeout(r, 3000));\n if (mkdocsServerHasStarted) {\n break;\n }\n logger.info('Waiting for mkdocs server to start...');\n }\n\n if (!mkdocsServerHasStarted) {\n logger.error(\n 'mkdocs server did not start. Exiting. Try re-running command with -v option for more details.',\n );\n }\n\n const port = isDevMode ? backstageBackendPort : opts.previewAppPort;\n const previewAppPath = getPreviewAppPath(opts);\n const httpServer = new HTTPServer(\n previewAppPath,\n port,\n mkdocsExpectedDevAddr,\n opts.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error('Failed to start HTTP server', err);\n mkdocsChildProcess.kill();\n process.exit(1);\n })\n .then(() => {\n // The last three things default/component/local/ don't matter. They can be anything.\n openBrowser(`http://localhost:${port}/docs/default/component/local/`);\n logger.info(\n `Serving docs in Backstage at http://localhost:${port}/docs/default/component/local/\\nOpening browser.`,\n );\n });\n\n await waitForSignal([mkdocsChildProcess]);\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["httpProxy","http","serveHandler","createLogger","path","findPaths","getMkdocsYml","runMkdocsServer","openBrowser","waitForSignal","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAqB,UAAW,CAAA;AAAA,EAO9B,WACE,CAAA,kBAAA,EACA,aACA,EAAA,mBAAA,EACA,OACA,EAAA;AAXF,IAAiB,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,oBAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,qBAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AAQf,IAAA,IAAA,CAAK,aAAgB,GAAA,gBAAA,CAAA;AACrB,IAAA,IAAA,CAAK,kBAAqB,GAAA,kBAAA,CAAA;AAC1B,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA,CAAA;AACrB,IAAA,IAAA,CAAK,mBAAsB,GAAA,mBAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,OAAU,GAAA,OAAA,CAAA;AAAA,GACjB;AAAA;AAAA,EA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,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
|
|
@@ -972,9 +972,7 @@
|
|
|
972
972
|
}
|
|
973
973
|
},
|
|
974
974
|
{
|
|
975
|
-
"
|
|
976
|
-
true
|
|
977
|
-
],
|
|
975
|
+
"const": true,
|
|
978
976
|
"type": "boolean"
|
|
979
977
|
}
|
|
980
978
|
]
|
|
@@ -1099,9 +1097,7 @@
|
|
|
1099
1097
|
"properties": {
|
|
1100
1098
|
"store": {
|
|
1101
1099
|
"type": "string",
|
|
1102
|
-
"
|
|
1103
|
-
"memory"
|
|
1104
|
-
]
|
|
1100
|
+
"const": "memory"
|
|
1105
1101
|
}
|
|
1106
1102
|
},
|
|
1107
1103
|
"required": [
|
|
@@ -1113,9 +1109,7 @@
|
|
|
1113
1109
|
"properties": {
|
|
1114
1110
|
"store": {
|
|
1115
1111
|
"type": "string",
|
|
1116
|
-
"
|
|
1117
|
-
"redis"
|
|
1118
|
-
]
|
|
1112
|
+
"const": "redis"
|
|
1119
1113
|
},
|
|
1120
1114
|
"connection": {
|
|
1121
1115
|
"description": "A redis connection string in the form `redis://user:pass@host:port`.",
|
|
@@ -1133,9 +1127,7 @@
|
|
|
1133
1127
|
"properties": {
|
|
1134
1128
|
"store": {
|
|
1135
1129
|
"type": "string",
|
|
1136
|
-
"
|
|
1137
|
-
"memcache"
|
|
1138
|
-
]
|
|
1130
|
+
"const": "memcache"
|
|
1139
1131
|
},
|
|
1140
1132
|
"connection": {
|
|
1141
1133
|
"description": "A memcache connection string in the form `user:pass@host:port`.",
|
|
@@ -1260,9 +1252,7 @@
|
|
|
1260
1252
|
}
|
|
1261
1253
|
},
|
|
1262
1254
|
{
|
|
1263
|
-
"
|
|
1264
|
-
false
|
|
1265
|
-
],
|
|
1255
|
+
"const": false,
|
|
1266
1256
|
"type": "boolean"
|
|
1267
1257
|
}
|
|
1268
1258
|
]
|
|
@@ -1274,7 +1264,20 @@
|
|
|
1274
1264
|
"database",
|
|
1275
1265
|
"listen"
|
|
1276
1266
|
]
|
|
1277
|
-
}
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
"required": [
|
|
1270
|
+
"app",
|
|
1271
|
+
"backend"
|
|
1272
|
+
],
|
|
1273
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
"path": "../backend-app-api/config.d.ts",
|
|
1278
|
+
"value": {
|
|
1279
|
+
"type": "object",
|
|
1280
|
+
"properties": {
|
|
1278
1281
|
"discovery": {
|
|
1279
1282
|
"description": "Discovery options.",
|
|
1280
1283
|
"type": "object",
|
|
@@ -1328,10 +1331,6 @@
|
|
|
1328
1331
|
]
|
|
1329
1332
|
}
|
|
1330
1333
|
},
|
|
1331
|
-
"required": [
|
|
1332
|
-
"app",
|
|
1333
|
-
"backend"
|
|
1334
|
-
],
|
|
1335
1334
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
1336
1335
|
}
|
|
1337
1336
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.a4e3d2e1.js"></script><script defer="defer" src="/static/module-material-ui.bdbd8daa.js"></script><script defer="defer" src="/static/module-lodash.adfd55fe.js"></script><script defer="defer" src="/static/module-date-fns.b8b6c380.js"></script><script defer="defer" src="/static/module-material-table.0f5635dd.js"></script><script defer="defer" src="/static/module-react-dom.07625e59.js"></script><script defer="defer" src="/static/module-react-router.652daaf3.js"></script><script defer="defer" src="/static/module-react-router-dom.65ce4c09.js"></script><script defer="defer" src="/static/module-zod.9e0f365e.js"></script><script defer="defer" src="/static/module-i18next.db8a27ed.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.62627182.js"></script><script defer="defer" src="/static/vendor.a4e3d2e1.js"></script><script defer="defer" src="/static/main.a4e3d2e1.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[3893],{88188:function(v,y,t){"use strict";var u,c=t(71600),i=t(34590);u={value:!0},y.Z=void 0;var r=i(t(2784)),a=c(t(50175)),f=(0,a.default)(r.createElement("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"AddCircleOutline");y.Z=f},2997:function(v,y,t){"use strict";var u,c=t(71600),i=t(34590);u={value:!0},y.Z=void 0;var r=i(t(2784)),a=c(t(50175)),f=(0,a.default)(r.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");y.Z=f},29862:function(v,y,t){"use strict";t.d(y,{t:function(){return c}});var u=t(2784);function c(i){i===void 0&&(i=!1);var r=(0,u.useRef)(i),a=(0,u.useCallback)(function(){return r.current},[]);return(0,u.useEffect)(function(){return r.current=!0,function(){r.current=!1}},[]),a}},24303:function(v,y,t){var u=t(26548),c=t(92019),i=c(u);v.exports=i},62034:function(v,y,t){var u=t(65067),c=t(95882);function i(r,a,f,h,s){var b=-1,T=r.length;for(f||(f=c),s||(s=[]);++b<T;){var p=r[b];a>0&&f(p)?a>1?i(p,a-1,f,h,s):u(s,p):h||(s[s.length]=p)}return s}v.exports=i},93401:function(v,y,t){var u=t(24303),c=t(67878);function i(r,a){var f=-1,h=c(r)?Array(r.length):[];return u(r,function(s,b,T){h[++f]=a(s,b,T)}),h}v.exports=i},23813:function(v,y,t){var u=t(50343),c=t(13324),i=t(68286),r=t(93401),a=t(27095),f=t(47826),h=t(18477),s=t(23059),b=t(86152);function T(p,e,d){e.length?e=u(e,function(x){return b(x)?function(P){return c(P,x.length===1?x[0]:x)}:x}):e=[s];var E=-1;e=u(e,f(i));var C=r(p,function(x,P,W){var V=u(e,function(B){return B(x)});return{criteria:V,index:++E,value:x}});return a(C,function(x,P){return h(x,P,d)})}v.exports=T},27095:function(v){function y(t,u){var c=t.length;for(t.sort(u);c--;)t[c]=t[c].value;return t}v.exports=y},27520:function(v,y,t){var u=t(4795);function c(i,r){if(i!==r){var a=i!==void 0,f=i===null,h=i===i,s=u(i),b=r!==void 0,T=r===null,p=r===r,e=u(r);if(!T&&!e&&!s&&i>r||s&&b&&p&&!T&&!e||f&&b&&p||!a&&p||!h)return 1;if(!f&&!s&&!e&&i<r||e&&a&&h&&!f&&!s||T&&a&&h||!b&&h||!p)return-1}return 0}v.exports=c},18477:function(v,y,t){var u=t(27520);function c(i,r,a){for(var f=-1,h=i.criteria,s=r.criteria,b=h.length,T=a.length;++f<b;){var p=u(h[f],s[f]);if(p){if(f>=T)return p;var e=a[f];return p*(e=="desc"?-1:1)}}return i.index-r.index}v.exports=c},92019:function(v,y,t){var u=t(67878);function c(i,r){return function(a,f){if(a==null)return a;if(!u(a))return i(a,f);for(var h=a.length,s=r?h:-1,b=Object(a);(r?s--:++s<h)&&f(b[s],s,b)!==!1;);return a}}v.exports=c},95882:function(v,y,t){var u=t(50857),c=t(79631),i=t(86152),r=u?u.isConcatSpreadable:void 0;function a(f){return i(f)||c(f)||!!(r&&f&&f[r])}v.exports=a},18149:function(v,y,t){var u=t(88746);function c(i,r){return u(i,r)}v.exports=c},829:function(v,y,t){var u=t(62034),c=t(23813),i=t(36060),r=t(82406),a=i(function(f,h){if(f==null)return[];var s=h.length;return s>1&&r(f,h[0],h[1])?h=[]:s>2&&r(h[0],h[1],h[2])&&(h=[h[0]]),c(f,u(h,1),[])});v.exports=a},19928:function(v){(function(y,t){v.exports=t()})(this,function(){var y=[],t=[],u={},c={},i={};function r(e){return typeof e=="string"?new RegExp("^"+e+"$","i"):e}function a(e,d){return e===d?d:e===e.toLowerCase()?d.toLowerCase():e===e.toUpperCase()?d.toUpperCase():e[0]===e[0].toUpperCase()?d.charAt(0).toUpperCase()+d.substr(1).toLowerCase():d.toLowerCase()}function f(e,d){return e.replace(/\$(\d{1,2})/g,function(E,C){return d[C]||""})}function h(e,d){return e.replace(d[0],function(E,C){var x=f(d[1],arguments);return a(E===""?e[C-1]:E,x)})}function s(e,d,E){if(!e.length||u.hasOwnProperty(e))return d;for(var C=E.length;C--;){var x=E[C];if(x[0].test(d))return h(d,x)}return d}function b(e,d,E){return function(C){var x=C.toLowerCase();return d.hasOwnProperty(x)?a(C,x):e.hasOwnProperty(x)?a(C,e[x]):s(x,C,E)}}function T(e,d,E,C){return function(x){var P=x.toLowerCase();return d.hasOwnProperty(P)?!0:e.hasOwnProperty(P)?!1:s(P,P,E)===P}}function p(e,d,E){var C=d===1?p.singular(e):p.plural(e);return(E?d+" ":"")+C}return p.plural=b(i,c,y),p.isPlural=T(i,c,y),p.singular=b(c,i,t),p.isSingular=T(c,i,t),p.addPluralRule=function(e,d){y.push([r(e),d])},p.addSingularRule=function(e,d){t.push([r(e),d])},p.addUncountableRule=function(e){if(typeof e=="string"){u[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,d){d=d.toLowerCase(),e=e.toLowerCase(),i[e]=d,c[d]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p})},15277:function(v,y,t){"use strict";var u,c,i;(function(r,a){if(!0)c=[y,t(2784),t(13980)],u=a,i=typeof u=="function"?u.apply(y,c):u,i!==void 0&&(v.exports=i);else var f})(void 0,function(r,a,f){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var h=b(a),s=b(f);function b(o){return o&&o.__esModule?o:{default:o}}function T(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T=function(m){return typeof m}:T=function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},T(o)}function p(o,l){if(o==null)return{};var m=e(o,l),n,g;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(g=0;g<w.length;g++)n=w[g],!(l.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(o,n)&&(m[n]=o[n])}return m}function e(o,l){if(o==null)return{};var m={},n=Object.keys(o),g,w;for(w=0;w<n.length;w++)g=n[w],!(l.indexOf(g)>=0)&&(m[g]=o[g]);return m}function d(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function E(o,l){for(var m=0;m<l.length;m++){var n=l[m];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}function C(o,l,m){return l&&E(o.prototype,l),m&&E(o,m),o}function x(o,l){return l&&(T(l)==="object"||typeof l=="function")?l:W(o)}function P(o){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},P(o)}function W(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function V(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),l&&B(o,l)}function B(o,l){return B=Object.setPrototypeOf||function(n,g){return n.__proto__=g,n},B(o,l)}function L(o,l,m){return l in o?Object.defineProperty(o,l,{value:m,enumerable:!0,configurable:!0,writable:!0}):o[l]=m,o}var ae=1e-4,te=function(l,m){return Math.abs(l-m)<ae},Y=function(o){V(l,o);function l(){var m,n;d(this,l);for(var g=arguments.length,w=new Array(g),A=0;A<g;A++)w[A]=arguments[A];return n=x(this,(m=P(l)).call.apply(m,[this].concat(w))),L(W(n),"onResize",function(){n.rafId&&window.cancelAnimationFrame(n.rafId),n.rafId=window.requestAnimationFrame(n.update.bind(W(n)))}),L(W(n),"onToggled",function(S){typeof n.props.onToggled=="function"&&setTimeout(function(){return n.props.onToggled(S)},0)}),L(W(n),"onTruncated",function(){typeof n.props.onTruncated=="function"&&setTimeout(function(){return n.props.onTruncated()},0)}),L(W(n),"onCalculated",function(){typeof n.props.onCalculated=="function"&&setTimeout(function(){return n.props.onCalculated()},0)}),L(W(n),"update",function(){var S=window.getComputedStyle(n.scope),k=[S["font-weight"],S["font-style"],S["font-size"],S["font-family"],S["letter-spacing"]].join(" ");n.canvas.font=k,n.forceUpdate()}),n}return C(l,[{key:"componentDidMount",value:function(){var n=document.createElement("canvas"),g=document.createDocumentFragment(),w=window.getComputedStyle(this.scope),A=[w["font-weight"],w["font-style"],w["font-size"],w["font-family"]].join(" ");g.appendChild(n),this.canvas=n.getContext("2d"),this.canvas.font=A,this.forceUpdate(),window.addEventListener("resize",this.onResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize),this.rafId&&window.cancelAnimationFrame(this.rafId)}},{key:"measureWidth",value:function(n){return this.canvas.measureText(n).width}},{key:"getRenderText",value:function(){var n=this.props,g=n.containerClassName,w=n.element,A=n.line,S=n.onCalculated,k=n.onTruncated,ne=n.onToggled,O=n.text,K=n.textElement,j=n.textTruncateChild,G=n.truncateText,J=n.maxCalculateTimes,D=p(n,["containerClassName","element","line","onCalculated","onTruncated","onToggled","text","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),M=this.scope.getBoundingClientRect().width;if(M===0)return null;var Q=this.measureWidth(O);if(M>Q||te(M,Q))return this.onToggled(!1),(0,a.createElement)(K,D,O);var N="";if(j&&typeof j.type=="string"){var Z=j.type;(Z.indexOf("span")>=0||Z.indexOf("a")>=0)&&(N=j.props.children)}for(var $=1,U=O.length,R="",I=0,z=0,_=A,F=0,H=!1,re=!1,X=0,q=-1,ee="",ie=0;_-- >0;){for(ee=_?"":G+(N?" "+N:"");$<=U;)if(R=O.substr(z,$),F=this.measureWidth(R+ee),F<M)I=O.indexOf(" ",$+1),I===-1?($+=1,H=!1):(H=!0,$=I);else{do{if(ie++>=J)break;R=O.substr(z,$),_||$--,R[R.length-1]===" "&&(R=O.substr(z,$-1)),H?(q=R.lastIndexOf(" "),q>-1?($=q,_&&$++,R=O.substr(z,$)):($--,R=O.substr(z,$))):($--,R=O.substr(z,$)),F=this.measureWidth(R+ee)}while((F>M||te(F,M))&&R.length>0);z+=$;break}if($>=U){z=U;break}H&&!re&&O.substr(X,$).indexOf(" ")===-1&&(re=O.substr(X,$).indexOf(" ")===-1,_--),X=$+1}return z===U?(this.onToggled(!1),(0,a.createElement)(K,D,O)):(this.onTruncated(),this.onToggled(!0),h.default.createElement("span",D,(0,a.createElement)(K,D,O.substr(0,z)+G+" "),j))}},{key:"render",value:function(){var n=this,g=this.props,w=g.element,A=g.text,S=g.style,k=S===void 0?{}:S,ne=g.containerClassName,O=g.line,K=g.onCalculated,j=g.onTruncated,G=g.onToggled,J=g.textElement,D=g.textTruncateChild,M=g.truncateText,Q=g.maxCalculateTimes,N=p(g,["element","text","style","containerClassName","line","onCalculated","onTruncated","onToggled","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),Z=k.fontWeight,$=k.fontStyle,U=k.fontSize,R=k.fontFamily,I=this.scope&&O?this.getRenderText():(0,a.createElement)(J,N,A),z={ref:function(F){n.scope=F},className:ne,style:{overflow:"hidden",fontWeight:Z,fontStyle:$,fontSize:U,fontFamily:R}};return this.scope&&this.onCalculated(),(0,a.createElement)(w,z,I)}}]),l}(a.Component);L(Y,"propTypes",{containerClassName:s.default.string,element:s.default.string,line:s.default.oneOfType([s.default.number,s.default.bool]),onCalculated:s.default.func,onTruncated:s.default.func,onToggled:s.default.func,text:s.default.string,textElement:s.default.elementType,textTruncateChild:s.default.node,truncateText:s.default.string,maxCalculateTimes:s.default.number}),L(Y,"defaultProps",{element:"div",line:1,text:"",textElement:"span",truncateText:"\u2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AC,oBAAqB,QAAQ,EAC9B,CAAC,eAAgB,IAAI,EACrB,CAAC,YAAa,IAAI,EAClB,CAAC,QAAS,KAAK,CACjB,EAAE,QAAQ,SAAUA,EAAM,CACxB,OAAOP,EAAU,gBAAgBO,EAAK,CAAC,EAAGA,EAAK,CAAC,CAAC,CACnD,CAAC,EAKD,CAEE,YACA,SACA,SACA,MACA,WACA,UACA,OACA,YACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,WACA,MACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,OACA,YACA,OACA,WACA,SACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,WACA,UACA,QACA,QACA,SACA,UACA,iBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MACA,eAEA,gBACA,SACA,SACA,YACA,WACA,QACA,SACF,EAAE,QAAQP,EAAU,kBAAkB,EAE/BA,CACT,CAAC,C,qCCtfD,WAEC,SAAU8B,EAAQC,EAAS,CAC1B,GAAI,GACF,EAAO,CAAC,EAAW,QAAS,QAAY,EAAG,EAAAA,EAAO,oEAC7C,MAST,GAAG,OAAQ,SAAUpG,EAASqG,EAAQC,EAAY,CAChD,aAEA,OAAO,eAAetG,EAAS,aAAc,CAC3C,MAAO,EACT,CAAC,EACDA,EAAQ,QAAU,OAElB,IAAIuG,EAAUzG,EAAuBuG,CAAM,EAEvCG,EAAc1G,EAAuBwG,CAAU,EAEnD,SAASxG,EAAuB2G,EAAK,CACnC,OAAOA,GAAOA,EAAI,WAAaA,EAAM,CACnC,QAASA,CACX,CACF,CAEA,SAASC,EAAQD,EAAK,CACpB,OAAI,OAAO,QAAW,YAAc,OAAO,OAAO,UA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,QAAU2I,EAElBhI,EAAO,QAAUX,EAAQ,OAC3B,CAAC,C","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/AddCircleOutline.js","webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/OpenInNew.js","webpack://techdocs-cli-embedded-app/../../node_modules/@react-hookz/web/esm/useIsMounted/useIsMounted.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_baseEach.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_baseFlatten.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_baseMap.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_baseOrderBy.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_baseSortBy.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_compareAscending.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_compareMultiple.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_createBaseEach.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/_isFlattenable.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/isEqual.js","webpack://techdocs-cli-embedded-app/../../node_modules/lodash/sortBy.js","webpack://techdocs-cli-embedded-app/../../node_modules/pluralize/pluralize.js","webpack://techdocs-cli-embedded-app/../../node_modules/react-text-truncate/lib/index.js"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z\"\n}), 'AddCircleOutline');\n\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z\"\n}), 'OpenInNew');\n\nexports.default = _default;","import { useCallback, useEffect, useRef } from 'react';\n/**\n * Returns function that yields current mount state.\n *\n * Returned function yields `true` only in case component is mounted. This hook\n * is handy for the cases when you have to detect component mount state within\n * async effects.\n *\n * @param initialValue Initial value. By default, this hook assumes that hook is\n * not mounted yet at first render.\n */\nexport function useIsMounted(initialValue) {\n if (initialValue === void 0) { initialValue = false; }\n var isMounted = useRef(initialValue);\n var get = useCallback(function () { return isMounted.current; }, []);\n useEffect(function () {\n isMounted.current = true;\n return function () {\n isMounted.current = false;\n };\n }, []);\n return get;\n}\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Lower cased words. E.g. \"hello\".\n if (word === word.toLowerCase()) return token.toLowerCase();\n\n // Upper cased words. E.g. \"WHISKY\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word The word to pluralize\n * @param {number} count How many of the word exist\n * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['passerby', 'passersby']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'aircraft',\n 'alcohol',\n 'ammo',\n 'analytics',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'firmware',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'hardware',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'mud',\n 'manga',\n 'news',\n 'only',\n 'personnel',\n 'pike',\n 'plankton',\n 'pliers',\n 'police',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'software',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transportation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n /pok[eé]mon$/i,\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","\"use strict\";\n\n(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([\"exports\", \"react\", \"prop-types\"], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports, require(\"react\"), require(\"prop-types\"));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, global.React, global.propTypes);\n global.undefined = mod.exports;\n }\n})(void 0, function (exports, _react, _propTypes) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = undefined;\n\n var _react2 = _interopRequireDefault(_react);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n var PRECISION = 0.0001;\n\n var isEqual = function isEqual(n1, n2) {\n return Math.abs(n1 - n2) < PRECISION;\n };\n\n var TextTruncate = function (_Component) {\n _inherits(TextTruncate, _Component);\n\n function TextTruncate() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, TextTruncate);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(TextTruncate)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"onResize\", function () {\n if (_this.rafId) {\n window.cancelAnimationFrame(_this.rafId);\n }\n\n _this.rafId = window.requestAnimationFrame(_this.update.bind(_assertThisInitialized(_this)));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onToggled\", function (truncated) {\n typeof _this.props.onToggled === 'function' && setTimeout(function () {\n return _this.props.onToggled(truncated);\n }, 0);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onTruncated\", function () {\n typeof _this.props.onTruncated === 'function' && setTimeout(function () {\n return _this.props.onTruncated();\n }, 0);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCalculated\", function () {\n typeof _this.props.onCalculated === 'function' && setTimeout(function () {\n return _this.props.onCalculated();\n }, 0);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"update\", function () {\n var style = window.getComputedStyle(_this.scope);\n var font = [style['font-weight'], style['font-style'], style['font-size'], style['font-family'], style['letter-spacing']].join(' ');\n _this.canvas.font = font;\n\n _this.forceUpdate();\n });\n\n return _this;\n }\n\n _createClass(TextTruncate, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var canvas = document.createElement('canvas');\n var docFragment = document.createDocumentFragment();\n var style = window.getComputedStyle(this.scope);\n var font = [style['font-weight'], style['font-style'], style['font-size'], style['font-family']].join(' ');\n docFragment.appendChild(canvas);\n this.canvas = canvas.getContext('2d');\n this.canvas.font = font;\n this.forceUpdate();\n window.addEventListener('resize', this.onResize);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.onResize);\n\n if (this.rafId) {\n window.cancelAnimationFrame(this.rafId);\n }\n }\n }, {\n key: \"measureWidth\",\n value: function measureWidth(text) {\n return this.canvas.measureText(text).width;\n }\n }, {\n key: \"getRenderText\",\n value: function getRenderText() {\n var _this$props = this.props,\n containerClassName = _this$props.containerClassName,\n element = _this$props.element,\n line = _this$props.line,\n onCalculated = _this$props.onCalculated,\n onTruncated = _this$props.onTruncated,\n onToggled = _this$props.onToggled,\n text = _this$props.text,\n textElement = _this$props.textElement,\n textTruncateChild = _this$props.textTruncateChild,\n truncateText = _this$props.truncateText,\n maxCalculateTimes = _this$props.maxCalculateTimes,\n props = _objectWithoutProperties(_this$props, [\"containerClassName\", \"element\", \"line\", \"onCalculated\", \"onTruncated\", \"onToggled\", \"text\", \"textElement\", \"textTruncateChild\", \"truncateText\", \"maxCalculateTimes\"]);\n\n var scopeWidth = this.scope.getBoundingClientRect().width; // return if display:none\n\n if (scopeWidth === 0) {\n return null;\n }\n\n var fullTextWidth = this.measureWidth(text); // return if all of text can be displayed\n\n if (scopeWidth > fullTextWidth || isEqual(scopeWidth, fullTextWidth)) {\n this.onToggled(false);\n return (0, _react.createElement)(textElement, props, text);\n }\n\n var childText = '';\n\n if (textTruncateChild && typeof textTruncateChild.type === 'string') {\n var type = textTruncateChild.type;\n\n if (type.indexOf('span') >= 0 || type.indexOf('a') >= 0) {\n childText = textTruncateChild.props.children;\n }\n }\n\n var currentPos = 1;\n var maxTextLength = text.length;\n var truncatedText = '';\n var splitPos = 0;\n var startPos = 0;\n var displayLine = line;\n var width = 0;\n var lastIsEng = false;\n var isPrevLineWithoutSpace = false;\n var lastPos = 0;\n var lastSpaceIndex = -1;\n var ext = '';\n var loopCnt = 0;\n\n while (displayLine-- > 0) {\n ext = displayLine ? '' : truncateText + (childText ? ' ' + childText : '');\n\n while (currentPos <= maxTextLength) {\n truncatedText = text.substr(startPos, currentPos);\n width = this.measureWidth(truncatedText + ext);\n\n if (width < scopeWidth) {\n splitPos = text.indexOf(' ', currentPos + 1);\n\n if (splitPos === -1) {\n currentPos += 1;\n lastIsEng = false;\n } else {\n lastIsEng = true;\n currentPos = splitPos;\n }\n } else {\n do {\n if (loopCnt++ >= maxCalculateTimes) {\n break;\n }\n\n truncatedText = text.substr(startPos, currentPos);\n\n if (!displayLine) {\n currentPos--;\n }\n\n if (truncatedText[truncatedText.length - 1] === ' ') {\n truncatedText = text.substr(startPos, currentPos - 1);\n }\n\n if (lastIsEng) {\n lastSpaceIndex = truncatedText.lastIndexOf(' ');\n\n if (lastSpaceIndex > -1) {\n currentPos = lastSpaceIndex;\n\n if (displayLine) {\n currentPos++;\n }\n\n truncatedText = text.substr(startPos, currentPos);\n } else {\n currentPos--;\n truncatedText = text.substr(startPos, currentPos);\n }\n } else {\n currentPos--;\n truncatedText = text.substr(startPos, currentPos);\n }\n\n width = this.measureWidth(truncatedText + ext);\n } while ((width > scopeWidth || isEqual(width, scopeWidth)) && truncatedText.length > 0);\n\n startPos += currentPos;\n break;\n }\n }\n\n if (currentPos >= maxTextLength) {\n startPos = maxTextLength;\n break;\n }\n\n if (lastIsEng && !isPrevLineWithoutSpace && text.substr(lastPos, currentPos).indexOf(' ') === -1) {\n isPrevLineWithoutSpace = text.substr(lastPos, currentPos).indexOf(' ') === -1;\n displayLine--;\n }\n\n lastPos = currentPos + 1;\n }\n\n if (startPos === maxTextLength) {\n this.onToggled(false);\n return (0, _react.createElement)(textElement, props, text);\n }\n\n this.onTruncated();\n this.onToggled(true);\n return _react2[\"default\"].createElement(\"span\", props, (0, _react.createElement)(textElement, props, text.substr(0, startPos) + truncateText + ' '), textTruncateChild);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n element = _this$props2.element,\n text = _this$props2.text,\n _this$props2$style = _this$props2.style,\n style = _this$props2$style === void 0 ? {} : _this$props2$style,\n containerClassName = _this$props2.containerClassName,\n line = _this$props2.line,\n onCalculated = _this$props2.onCalculated,\n onTruncated = _this$props2.onTruncated,\n onToggled = _this$props2.onToggled,\n textElement = _this$props2.textElement,\n textTruncateChild = _this$props2.textTruncateChild,\n truncateText = _this$props2.truncateText,\n maxCalculateTimes = _this$props2.maxCalculateTimes,\n props = _objectWithoutProperties(_this$props2, [\"element\", \"text\", \"style\", \"containerClassName\", \"line\", \"onCalculated\", \"onTruncated\", \"onToggled\", \"textElement\", \"textTruncateChild\", \"truncateText\", \"maxCalculateTimes\"]);\n\n var fontWeight = style.fontWeight,\n fontStyle = style.fontStyle,\n fontSize = style.fontSize,\n fontFamily = style.fontFamily;\n var renderText = this.scope && line ? this.getRenderText() : (0, _react.createElement)(textElement, props, text);\n var rootProps = {\n ref: function ref(el) {\n _this2.scope = el;\n },\n className: containerClassName,\n style: {\n overflow: 'hidden',\n fontWeight: fontWeight,\n fontStyle: fontStyle,\n fontSize: fontSize,\n fontFamily: fontFamily\n }\n };\n this.scope && this.onCalculated();\n return (0, _react.createElement)(element, rootProps, renderText);\n }\n }]);\n\n return TextTruncate;\n }(_react.Component);\n\n _defineProperty(TextTruncate, \"propTypes\", {\n containerClassName: _propTypes2[\"default\"].string,\n element: _propTypes2[\"default\"].string,\n line: _propTypes2[\"default\"].oneOfType([_propTypes2[\"default\"].number, _propTypes2[\"default\"].bool]),\n onCalculated: _propTypes2[\"default\"].func,\n onTruncated: _propTypes2[\"default\"].func,\n onToggled: _propTypes2[\"default\"].func,\n text: _propTypes2[\"default\"].string,\n textElement: _propTypes2[\"default\"].elementType,\n textTruncateChild: _propTypes2[\"default\"].node,\n truncateText: _propTypes2[\"default\"].string,\n maxCalculateTimes: _propTypes2[\"default\"].number\n });\n\n _defineProperty(TextTruncate, \"defaultProps\", {\n element: 'div',\n line: 1,\n text: '',\n textElement: 'span',\n truncateText: '…',\n maxCalculateTimes: 10\n });\n\n exports.default = TextTruncate;\n ;\n module.exports = exports.default;\n});\n"],"names":["_interopRequireDefault","_interopRequireWildcard","exports","React","_createSvgIcon","_default","useIsMounted","initialValue","isMounted","get","baseForOwn","createBaseEach","baseEach","module","arrayPush","isFlattenable","baseFlatten","array","depth","predicate","isStrict","result","index","length","value","isArrayLike","baseMap","collection","iteratee","key","arrayMap","baseGet","baseIteratee","baseSortBy","baseUnary","compareMultiple","identity","isArray","baseOrderBy","iteratees","orders","criteria","object","other","comparer","isSymbol","compareAscending","valIsDefined","valIsNull","valIsReflexive","valIsSymbol","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","objCriteria","othCriteria","ordersLength","order","eachFunc","fromRight","iterable","Symbol","isArguments","spreadableSymbol","baseIsEqual","isEqual","baseRest","isIterateeCall","sortBy","root","pluralize","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","token","interpolate","str","args","match","replace","sanitizeWord","rules","len","replaceWord","replaceMap","keepMap","checkWord","bool","count","inclusive","pluralized","replacement","single","plural","global","factory","_react","_propTypes","_react2","_propTypes2","obj","_typeof","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","i","sourceSymbolKeys","sourceKeys","_classCallCheck","instance","Constructor","_defineProperties","props","descriptor","_createClass","protoProps","staticProps","_possibleConstructorReturn","self","call","_assertThisInitialized","_getPrototypeOf","o","_inherits","subClass","superClass","_setPrototypeOf","p","_defineProperty","PRECISION","n1","n2","TextTruncate","_Component","_getPrototypeOf2","_this","_len","_key","truncated","style","font","canvas","docFragment","text","_this$props","containerClassName","element","line","onCalculated","onTruncated","onToggled","textElement","textTruncateChild","truncateText","maxCalculateTimes","scopeWidth","fullTextWidth","childText","type","currentPos","maxTextLength","truncatedText","splitPos","startPos","displayLine","width","lastIsEng","isPrevLineWithoutSpace","lastPos","lastSpaceIndex","ext","loopCnt","_this2","_this$props2","_this$props2$style","fontWeight","fontStyle","fontSize","fontFamily","renderText","rootProps","el"],"sourceRoot":""}
|