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E,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;IAiD/C,WAAW;IAsBX,QAAQ,CAAC,KAAK,EAAE,MAAM;IAUtB,QAAQ;IAKR,WAAW,CAAC,WAAW,EAAE,MAAM;IAuB/B,WAAW,CAAC,SAAS,UAAQ;IAY7B,QAAQ;IAgBR,IAAI,CAAC,IAAI,UAAO;IAYhB,IAAI;IAIJ,QAAQ,CAAC,SAAS,EAAE,MAAM;IAI1B,KAAK,CAAC,KAAK,EAAE,OAAO;CAqBrB","sources":["src/src/index.ts","src/index.ts"],"sourcesContent":[null,"import Sortable from \"sortablejs\";\n// @ts-ignore\nimport styles from \"bundle-text:./style.css\";\n\nif (!document) {\n throw Error(\"Electron Tabs(electron-tabs) module must be called in renderer process\");\n}\n\ninterface TabGroupOptions {\n closeButtonText: string,\n defaultTab: TabOptions | ((tabGroup: TabGroup) => TabOptions),\n newTabButton: boolean,\n newTabButtonText: string,\n sortable: boolean,\n sortableOptions?: Sortable.Options\n visibilityThreshold: number,\n}\n\ninterface TabOptions {\n active?: boolean;\n closable?: boolean;\n ready?: ((tab: Tab) => void);\n src?: string;\n title?: string;\n visible?: boolean;\n webviewAttributes?: { [key: string]: any };\n}\n\nconst CLASSNAMES = {\n ROOT: \"etabs\",\n NAV: \"nav\",\n TABS: \"tabs\",\n TAB: \"tab\",\n BUTTONS: \"buttons\",\n VIEWS: \"views\",\n VIEW: \"view\"\n}\n\nfunction emit(emitter: TabGroup | Tab, type: string, args: any[]) {\n if (type === \"ready\") {\n emitter.isReady = true;\n }\n emitter.dispatchEvent(new CustomEvent(type, { detail: args }));\n}\n\nfunction on(emitter: TabGroup | Tab, type: string, fn: (detail: string) => void, options?: { [key: string]: any }) {\n if (type === \"ready\" && emitter.isReady === true) {\n fn.apply(emitter, [emitter]);\n }\n emitter.addEventListener(type, ((e: CustomEvent) => fn.apply(emitter, e.detail)) as EventListener, options);\n}\n\nclass TabGroup extends HTMLElement {\n buttonContainer: HTMLDivElement;\n isReady: boolean;\n newTabId: number;\n options: TabGroupOptions;\n shadow: ShadowRoot;\n tabContainer: HTMLDivElement;\n tabs: Array<Tab>;\n viewContainer: HTMLDivElement;\n\n constructor() {\n super();\n\n this.isReady =
|