\n notification?: string\n}) {\n Modal.confirm({\n title: \"Confirm to delete\",\n icon: ,\n content: `Are you sure you want to delete ${entityName}? This action cannot be undone.`,\n okText: \"Confirm\",\n cancelText: \"Cancel\",\n onCancel: () => {},\n onOk: async () => {\n await action()\n if (notification) {\n actionNotification.success(\"Sources list successfully updated\")\n }\n },\n })\n}\n","function formatCode(code: string) {\n let lines: string[] = code.split(\"\\n\")\n while (lines.length > 0 && lines[0].trim() === \"\") {\n lines = lines.slice(1)\n }\n while (lines.length > 0 && lines[lines.length - 1].trim() === \"\") {\n lines = lines.slice(0, lines.length - 1)\n }\n if (lines.length > 0) {\n let indent = findIndent(lines[0])\n if (indent.length > 0) {\n lines = lines.map(line => (line.startsWith(indent) ? line.substr(indent.length) : line))\n }\n }\n return lines.join(\"\\n\")\n}\n\nfunction findIndent(str: string) {\n function isWhitespace(char: string) {\n return char === \" \" || char === \"\\t\"\n }\n let ident = []\n\n for (let i = 0; i < str.length; i++) {\n let char = str[i]\n if (isWhitespace(char)) {\n ident.push(char)\n } else {\n break\n }\n }\n return ident.join(\"\")\n}\n\nexport function getEmbeddedHtml(segment: boolean, key: string, host: string) {\n return formatCode(`\n \n \n `)\n}\n\nexport function getNPMDocumentation(key: string, host: string) {\n return formatCode(`\n import { jitsuClient } from '@jitsu/sdk-js'\n //init\n const jitsu = jitsuClient({\n key: \"${key}\",\n tracking_host: \"${host}\"\n });\n //identify user\n jitsu.id({\n \"email\": getEmail(),\n \"internal_id\": getId()\n });\n //track page views\n jitsu.track('app_page');\n `)\n}\n\nexport function getCurlDocumentation(key: string, host: string) {\n return formatCode(`\n curl -i -X POST -H \"Content-Type: application/json\" \\\\\n -H 'X-Auth-Token: ${key}' \\\\\n --data-binary '{\"test_str_field\": \"str\", \"test_int_field\": 42}' '${host}/api/v1/s2s/event'\n `)\n}\n","export class ErrorDetailed extends Error {\n private readonly _message: string\n private readonly _name: string\n private readonly _payload: P\n\n constructor(parameters: { message: string; name?: string; payload?: P }) {\n const { message, name, payload } = parameters\n super(message)\n this._message = message\n this._name = name\n this._payload = payload\n }\n\n get message(): string {\n return this._message\n }\n\n get name(): string {\n return this._name\n }\n\n get payload(): P {\n return this._payload\n }\n}\n\nexport function getErrorMessage(e: any): string {\n return e?.message || \"unknown error\";\n}\n"],"sourceRoot":""}