qiskit-sphinx-theme 1.13.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. qiskit_sphinx_theme/__init__.py +113 -0
  2. qiskit_sphinx_theme/assets/scripts/gumshoe-patched.js +467 -0
  3. qiskit_sphinx_theme/assets/scripts/qiskit-sphinx-theme.js +185 -0
  4. qiskit_sphinx_theme/assets/styles/_admonitions.scss +135 -0
  5. qiskit_sphinx_theme/assets/styles/_api.scss +103 -0
  6. qiskit_sphinx_theme/assets/styles/_custom-directives.scss +168 -0
  7. qiskit_sphinx_theme/assets/styles/_drop-shadows.scss +50 -0
  8. qiskit_sphinx_theme/assets/styles/_footer.scss +42 -0
  9. qiskit_sphinx_theme/assets/styles/_icons.scss +30 -0
  10. qiskit_sphinx_theme/assets/styles/_layout.scss +73 -0
  11. qiskit_sphinx_theme/assets/styles/_left-sidebar.scss +203 -0
  12. qiskit_sphinx_theme/assets/styles/_sphinx-extensions.scss +34 -0
  13. qiskit_sphinx_theme/assets/styles/_tables.scss +42 -0
  14. qiskit_sphinx_theme/assets/styles/_top-nav-bar.scss +80 -0
  15. qiskit_sphinx_theme/assets/styles/_typography.scss +26 -0
  16. qiskit_sphinx_theme/assets/styles/qiskit-sphinx-theme.scss +36 -0
  17. qiskit_sphinx_theme/directives.py +102 -0
  18. qiskit_sphinx_theme/previous_releases.py +39 -0
  19. qiskit_sphinx_theme/pytorch/breadcrumbs.html +31 -0
  20. qiskit_sphinx_theme/pytorch/footer.html +78 -0
  21. qiskit_sphinx_theme/pytorch/languages.html +40 -0
  22. qiskit_sphinx_theme/pytorch/layout.html +206 -0
  23. qiskit_sphinx_theme/pytorch/search.html +60 -0
  24. qiskit_sphinx_theme/pytorch/searchbox.html +21 -0
  25. qiskit_sphinx_theme/pytorch/sidebar.html +115 -0
  26. qiskit_sphinx_theme/pytorch/static/css/theme.css +12700 -0
  27. qiskit_sphinx_theme/pytorch/static/images/chevron-down-grey.svg +18 -0
  28. qiskit_sphinx_theme/pytorch/static/images/chevron-right-purple.svg +66 -0
  29. qiskit_sphinx_theme/pytorch/static/images/chevron-right-white.svg +17 -0
  30. qiskit_sphinx_theme/pytorch/static/images/icon-close.svg +21 -0
  31. qiskit_sphinx_theme/pytorch/static/images/icon-menu-dots-dark.svg +42 -0
  32. qiskit_sphinx_theme/pytorch/static/images/launch.svg +5 -0
  33. qiskit_sphinx_theme/pytorch/static/images/logo-facebook-dark.svg +8 -0
  34. qiskit_sphinx_theme/pytorch/static/images/logo-icon.svg +12 -0
  35. qiskit_sphinx_theme/pytorch/static/images/logo-twitter-dark.svg +16 -0
  36. qiskit_sphinx_theme/pytorch/static/images/logo-youtube-dark.svg +21 -0
  37. qiskit_sphinx_theme/pytorch/static/images/logo.png +0 -0
  38. qiskit_sphinx_theme/pytorch/static/images/logo.svg +1 -0
  39. qiskit_sphinx_theme/pytorch/static/images/logo_wordmark.svg +1 -0
  40. qiskit_sphinx_theme/pytorch/static/images/qiskit-chevron-down.svg +4 -0
  41. qiskit_sphinx_theme/pytorch/static/images/qiskit-chevron-up.svg +4 -0
  42. qiskit_sphinx_theme/pytorch/static/images/search-icon.svg +90 -0
  43. qiskit_sphinx_theme/pytorch/static/images/view-page-source-icon.svg +70 -0
  44. qiskit_sphinx_theme/pytorch/static/js/modernizr.min.js +4 -0
  45. qiskit_sphinx_theme/pytorch/static/js/theme.js +962 -0
  46. qiskit_sphinx_theme/pytorch/static/js/web-components/top-nav-bar.js +657 -0
  47. qiskit_sphinx_theme/pytorch/theme.conf +30 -0
  48. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/base.html +119 -0
  49. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/custom_templates/extra_head.html +84 -0
  50. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/custom_templates/footer_analytics.html +28 -0
  51. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/custom_templates/sidebar_languages.html +53 -0
  52. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/custom_templates/sidebar_version_list.html +43 -0
  53. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/page.html +229 -0
  54. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/partials/icons.html +68 -0
  55. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/sidebar/search.html +13 -0
  56. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/images/logo.png +0 -0
  57. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/js/web-components/top-nav-bar.js +657 -0
  58. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/scripts/qiskit-sphinx-theme.js +3 -0
  59. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/scripts/qiskit-sphinx-theme.js.LICENSE.txt +9 -0
  60. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/scripts/qiskit-sphinx-theme.js.map +1 -0
  61. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/styles/qiskit-sphinx-theme.css +2 -0
  62. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/static/styles/qiskit-sphinx-theme.css.map +1 -0
  63. qiskit_sphinx_theme/theme/qiskit-sphinx-theme/theme.conf +23 -0
  64. qiskit_sphinx_theme/translations.py +57 -0
  65. qiskit_sphinx_theme-1.13.0.dist-info/LICENSE +249 -0
  66. qiskit_sphinx_theme-1.13.0.dist-info/METADATA +270 -0
  67. qiskit_sphinx_theme-1.13.0.dist-info/RECORD +69 -0
  68. qiskit_sphinx_theme-1.13.0.dist-info/WHEEL +4 -0
  69. qiskit_sphinx_theme-1.13.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,113 @@
1
+ # This code is a Qiskit project.
2
+ #
3
+ # (C) Copyright IBM 2020, 2023.
4
+ #
5
+ # This code is licensed under the Apache License, Version 2.0. You may
6
+ # obtain a copy of this license in the LICENSE.txt file in the root directory
7
+ # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8
+ #
9
+ # Any modifications or derivative works of this code must retain this
10
+ # copyright notice, and modified files need to carry a notice indicating
11
+ # that they have been altered from the originals.
12
+
13
+ from __future__ import annotations
14
+
15
+ from pathlib import Path
16
+ from typing import TYPE_CHECKING
17
+
18
+ from qiskit_sphinx_theme import directives, previous_releases, translations
19
+
20
+ if TYPE_CHECKING:
21
+ import sphinx.addnodes
22
+ import sphinx.application
23
+ import sphinx.config
24
+
25
+ __version__ = "1.13.0"
26
+ __version_full__ = __version__
27
+
28
+
29
+ def _get_theme_absolute_path(folder_name: str) -> str:
30
+ path = Path(__file__).parent / folder_name
31
+ return str(path.resolve())
32
+
33
+
34
+ def remove_thebe_if_not_needed(
35
+ app: sphinx.application.Sphinx,
36
+ pagename: str,
37
+ templatename: str,
38
+ context: dict,
39
+ doctree: sphinx.addnodes.document,
40
+ ) -> None:
41
+ """
42
+ Remove files that jupyter-sphinx incorrectly tries to add.
43
+
44
+ See https://github.com/Qiskit/qiskit_sphinx_theme/issues/291 for more context.
45
+ """
46
+ # jupyter-sphinx might be not installed. If so, skip this function.
47
+ try:
48
+ from jupyter_sphinx.thebelab import ThebeButtonNode
49
+ except ImportError:
50
+ return
51
+
52
+ if not doctree or doctree.traverse(ThebeButtonNode):
53
+ return
54
+
55
+ thebe_js_files = [
56
+ "_static/sphinx-thebe.js",
57
+ "_static/thebelab-helper.js",
58
+ "https://unpkg.com/thebelab@latest/lib/index.js",
59
+ ]
60
+ context["script_files"] = [
61
+ js_file for js_file in context["script_files"] if js_file not in thebe_js_files
62
+ ]
63
+
64
+ thebe_css_files = ["_static/thebelab.css", "_static/sphinx-thebe.css"]
65
+ context["css_files"] = [
66
+ css_file for css_file in context["css_files"] if css_file not in thebe_css_files
67
+ ]
68
+
69
+
70
+ def activate_themes(app: sphinx.application.Sphinx, config: sphinx.config.Config) -> None:
71
+ if config.html_theme == "qiskit":
72
+ # We set a low priority so that our Qiskit CSS file overrides Furo.
73
+ app.add_css_file("styles/furo.css", 100)
74
+ app.add_js_file("scripts/qiskit-sphinx-theme.js")
75
+ else:
76
+ # Sphinx 6 stopped including jQuery by default. Our Pytorch theme depend on jQuery,
77
+ # so activate it for our users automatically.
78
+ app.setup_extension("sphinxcontrib.jquery")
79
+
80
+
81
+ def remove_furo_js(
82
+ app: sphinx.application.Sphinx,
83
+ pagename: str,
84
+ templatename: str,
85
+ context: dict,
86
+ doctree: sphinx.addnodes.document,
87
+ ) -> None:
88
+ context["script_files"] = [
89
+ js_file for js_file in context["script_files"] if js_file != "_static/scripts/furo.js"
90
+ ]
91
+
92
+
93
+ # See https://www.sphinx-doc.org/en/master/development/theming.html
94
+ def setup(app: sphinx.application.Sphinx) -> dict[str, bool]:
95
+ # Used to generate URL references. Expected to be e.g. `ecosystem/finance`.
96
+ app.add_config_value("docs_url_prefix", default=None, rebuild="html", types=[str])
97
+
98
+ # We always activate these plugins, but they are only used when users:
99
+ # * use the directives in their RST,
100
+ # * set `translations_list` in conf.py, or
101
+ # * set `versions_list` in conf.py.
102
+ directives.setup(app)
103
+ previous_releases.setup(app)
104
+ translations.setup(app)
105
+
106
+ app.add_html_theme("qiskit_sphinx_theme", _get_theme_absolute_path("pytorch"))
107
+ app.add_html_theme("qiskit", _get_theme_absolute_path("theme/qiskit-sphinx-theme"))
108
+
109
+ app.connect("config-inited", activate_themes)
110
+ app.connect("html-page-context", remove_furo_js, priority=600)
111
+ app.connect("html-page-context", remove_thebe_if_not_needed)
112
+
113
+ return {"parallel_read_safe": True, "parallel_write_safe": True}
@@ -0,0 +1,467 @@
1
+ /*! This file is vendored from Furo (created by Pradyun Gedam) and used under the MIT license. */
2
+ /*!
3
+ * gumshoejs v5.1.2 (patched by @pradyunsg)
4
+ * A simple, framework-agnostic scrollspy script.
5
+ * (c) 2019 Chris Ferdinandi
6
+ * MIT License
7
+ * http://github.com/cferdinandi/gumshoe
8
+ */
9
+
10
+ (function (root, factory) {
11
+ if (typeof define === "function" && define.amd) {
12
+ define([], function () {
13
+ return factory(root);
14
+ });
15
+ } else if (typeof exports === "object") {
16
+ module.exports = factory(root);
17
+ } else {
18
+ root.Gumshoe = factory(root);
19
+ }
20
+ })(
21
+ typeof global !== "undefined"
22
+ ? global
23
+ : typeof window !== "undefined"
24
+ ? window
25
+ : this,
26
+ function (window) {
27
+ "use strict";
28
+
29
+ //
30
+ // Defaults
31
+ //
32
+
33
+ var defaults = {
34
+ // Active classes
35
+ navClass: "active",
36
+ contentClass: "active",
37
+
38
+ // Nested navigation
39
+ nested: false,
40
+ nestedClass: "active",
41
+
42
+ // Offset & reflow
43
+ offset: 0,
44
+ reflow: false,
45
+
46
+ // Event support
47
+ events: true,
48
+ };
49
+
50
+ //
51
+ // Methods
52
+ //
53
+
54
+ /**
55
+ * Merge two or more objects together.
56
+ * @param {Object} objects The objects to merge together
57
+ * @returns {Object} Merged values of defaults and options
58
+ */
59
+ var extend = function () {
60
+ var merged = {};
61
+ Array.prototype.forEach.call(arguments, function (obj) {
62
+ for (var key in obj) {
63
+ if (!obj.hasOwnProperty(key)) return;
64
+ merged[key] = obj[key];
65
+ }
66
+ });
67
+ return merged;
68
+ };
69
+
70
+ /**
71
+ * Emit a custom event
72
+ * @param {String} type The event type
73
+ * @param {Node} elem The element to attach the event to
74
+ * @param {Object} detail Any details to pass along with the event
75
+ */
76
+ var emitEvent = function (type, elem, detail) {
77
+ // Make sure events are enabled
78
+ if (!detail.settings.events) return;
79
+
80
+ // Create a new event
81
+ var event = new CustomEvent(type, {
82
+ bubbles: true,
83
+ cancelable: true,
84
+ detail: detail,
85
+ });
86
+
87
+ // Dispatch the event
88
+ elem.dispatchEvent(event);
89
+ };
90
+
91
+ /**
92
+ * Get an element's distance from the top of the Document.
93
+ * @param {Node} elem The element
94
+ * @return {Number} Distance from the top in pixels
95
+ */
96
+ var getOffsetTop = function (elem) {
97
+ var location = 0;
98
+ if (elem.offsetParent) {
99
+ while (elem) {
100
+ location += elem.offsetTop;
101
+ elem = elem.offsetParent;
102
+ }
103
+ }
104
+ return location >= 0 ? location : 0;
105
+ };
106
+
107
+ /**
108
+ * Sort content from first to last in the DOM
109
+ * @param {Array} contents The content areas
110
+ */
111
+ var sortContents = function (contents) {
112
+ if (contents) {
113
+ contents.sort(function (item1, item2) {
114
+ var offset1 = getOffsetTop(item1.content);
115
+ var offset2 = getOffsetTop(item2.content);
116
+ if (offset1 < offset2) return -1;
117
+ return 1;
118
+ });
119
+ }
120
+ };
121
+
122
+ /**
123
+ * Get the offset to use for calculating position
124
+ * @param {Object} settings The settings for this instantiation
125
+ * @return {Float} The number of pixels to offset the calculations
126
+ */
127
+ var getOffset = function (settings) {
128
+ // if the offset is a function run it
129
+ if (typeof settings.offset === "function") {
130
+ return parseFloat(settings.offset());
131
+ }
132
+
133
+ // Otherwise, return it as-is
134
+ return parseFloat(settings.offset);
135
+ };
136
+
137
+ /**
138
+ * Get the document element's height
139
+ * @private
140
+ * @returns {Number}
141
+ */
142
+ var getDocumentHeight = function () {
143
+ return Math.max(
144
+ document.body.scrollHeight,
145
+ document.documentElement.scrollHeight,
146
+ document.body.offsetHeight,
147
+ document.documentElement.offsetHeight,
148
+ document.body.clientHeight,
149
+ document.documentElement.clientHeight,
150
+ );
151
+ };
152
+
153
+ /**
154
+ * Determine if an element is in view
155
+ * @param {Node} elem The element
156
+ * @param {Object} settings The settings for this instantiation
157
+ * @param {Boolean} bottom If true, check if element is above bottom of viewport instead
158
+ * @return {Boolean} Returns true if element is in the viewport
159
+ */
160
+ var isInView = function (elem, settings, bottom) {
161
+ var bounds = elem.getBoundingClientRect();
162
+ var offset = getOffset(settings);
163
+ if (bottom) {
164
+ return (
165
+ parseInt(bounds.bottom, 10) <
166
+ (window.innerHeight || document.documentElement.clientHeight)
167
+ );
168
+ }
169
+ return parseInt(bounds.top, 10) <= offset;
170
+ };
171
+
172
+ /**
173
+ * Check if at the bottom of the viewport
174
+ * @return {Boolean} If true, page is at the bottom of the viewport
175
+ */
176
+ var isAtBottom = function () {
177
+ if (
178
+ Math.ceil(window.innerHeight + window.pageYOffset) >=
179
+ getDocumentHeight()
180
+ )
181
+ return true;
182
+ return false;
183
+ };
184
+
185
+ /**
186
+ * Check if the last item should be used (even if not at the top of the page)
187
+ * @param {Object} item The last item
188
+ * @param {Object} settings The settings for this instantiation
189
+ * @return {Boolean} If true, use the last item
190
+ */
191
+ var useLastItem = function (item, settings) {
192
+ if (isAtBottom() && isInView(item.content, settings, true)) return true;
193
+ return false;
194
+ };
195
+
196
+ /**
197
+ * Get the active content
198
+ * @param {Array} contents The content areas
199
+ * @param {Object} settings The settings for this instantiation
200
+ * @return {Object} The content area and matching navigation link
201
+ */
202
+ var getActive = function (contents, settings) {
203
+ var last = contents[contents.length - 1];
204
+ if (useLastItem(last, settings)) return last;
205
+ for (var i = contents.length - 1; i >= 0; i--) {
206
+ if (isInView(contents[i].content, settings)) return contents[i];
207
+ }
208
+ };
209
+
210
+ /**
211
+ * Deactivate parent navs in a nested navigation
212
+ * @param {Node} nav The starting navigation element
213
+ * @param {Object} settings The settings for this instantiation
214
+ */
215
+ var deactivateNested = function (nav, settings) {
216
+ // If nesting isn't activated, bail
217
+ if (!settings.nested || !nav.parentNode) return;
218
+
219
+ // Get the parent navigation
220
+ var li = nav.parentNode.closest("li");
221
+ if (!li) return;
222
+
223
+ // Remove the active class
224
+ li.classList.remove(settings.nestedClass);
225
+
226
+ // Apply recursively to any parent navigation elements
227
+ deactivateNested(li, settings);
228
+ };
229
+
230
+ /**
231
+ * Deactivate a nav and content area
232
+ * @param {Object} items The nav item and content to deactivate
233
+ * @param {Object} settings The settings for this instantiation
234
+ */
235
+ var deactivate = function (items, settings) {
236
+ // Make sure there are items to deactivate
237
+ if (!items) return;
238
+
239
+ // Get the parent list item
240
+ var li = items.nav.closest("li");
241
+ if (!li) return;
242
+
243
+ // Remove the active class from the nav and content
244
+ li.classList.remove(settings.navClass);
245
+ items.content.classList.remove(settings.contentClass);
246
+
247
+ // Deactivate any parent navs in a nested navigation
248
+ deactivateNested(li, settings);
249
+
250
+ // Emit a custom event
251
+ emitEvent("gumshoeDeactivate", li, {
252
+ link: items.nav,
253
+ content: items.content,
254
+ settings: settings,
255
+ });
256
+ };
257
+
258
+ /**
259
+ * Activate parent navs in a nested navigation
260
+ * @param {Node} nav The starting navigation element
261
+ * @param {Object} settings The settings for this instantiation
262
+ */
263
+ var activateNested = function (nav, settings) {
264
+ // If nesting isn't activated, bail
265
+ if (!settings.nested) return;
266
+
267
+ // Get the parent navigation
268
+ var li = nav.parentNode.closest("li");
269
+ if (!li) return;
270
+
271
+ // Add the active class
272
+ li.classList.add(settings.nestedClass);
273
+
274
+ // Apply recursively to any parent navigation elements
275
+ activateNested(li, settings);
276
+ };
277
+
278
+ /**
279
+ * Activate a nav and content area
280
+ * @param {Object} items The nav item and content to activate
281
+ * @param {Object} settings The settings for this instantiation
282
+ */
283
+ var activate = function (items, settings) {
284
+ // Make sure there are items to activate
285
+ if (!items) return;
286
+
287
+ // Get the parent list item
288
+ var li = items.nav.closest("li");
289
+ if (!li) return;
290
+
291
+ // Add the active class to the nav and content
292
+ li.classList.add(settings.navClass);
293
+ items.content.classList.add(settings.contentClass);
294
+
295
+ // Activate any parent navs in a nested navigation
296
+ activateNested(li, settings);
297
+
298
+ // Emit a custom event
299
+ emitEvent("gumshoeActivate", li, {
300
+ link: items.nav,
301
+ content: items.content,
302
+ settings: settings,
303
+ });
304
+ };
305
+
306
+ /**
307
+ * Create the Constructor object
308
+ * @param {String} selector The selector to use for navigation items
309
+ * @param {Object} options User options and settings
310
+ */
311
+ var Constructor = function (selector, options) {
312
+ //
313
+ // Variables
314
+ //
315
+
316
+ var publicAPIs = {};
317
+ var navItems, contents, current, timeout, settings;
318
+
319
+ //
320
+ // Methods
321
+ //
322
+
323
+ /**
324
+ * Set variables from DOM elements
325
+ */
326
+ publicAPIs.setup = function () {
327
+ // Get all nav items
328
+ navItems = document.querySelectorAll(selector);
329
+
330
+ // Create contents array
331
+ contents = [];
332
+
333
+ // Loop through each item, get it's matching content, and push to the array
334
+ Array.prototype.forEach.call(navItems, function (item) {
335
+ // Get the content for the nav item
336
+ var content = document.getElementById(
337
+ decodeURIComponent(item.hash.substr(1)),
338
+ );
339
+ if (!content) return;
340
+
341
+ // Push to the contents array
342
+ contents.push({
343
+ nav: item,
344
+ content: content,
345
+ });
346
+ });
347
+
348
+ // Sort contents by the order they appear in the DOM
349
+ sortContents(contents);
350
+ };
351
+
352
+ /**
353
+ * Detect which content is currently active
354
+ */
355
+ publicAPIs.detect = function () {
356
+ // Get the active content
357
+ var active = getActive(contents, settings);
358
+
359
+ // if there's no active content, deactivate and bail
360
+ if (!active) {
361
+ if (current) {
362
+ deactivate(current, settings);
363
+ current = null;
364
+ }
365
+ return;
366
+ }
367
+
368
+ // If the active content is the one currently active, do nothing
369
+ if (current && active.content === current.content) return;
370
+
371
+ // Deactivate the current content and activate the new content
372
+ deactivate(current, settings);
373
+ activate(active, settings);
374
+
375
+ // Update the currently active content
376
+ current = active;
377
+ };
378
+
379
+ /**
380
+ * Detect the active content on scroll
381
+ * Debounced for performance
382
+ */
383
+ var scrollHandler = function (event) {
384
+ // If there's a timer, cancel it
385
+ if (timeout) {
386
+ window.cancelAnimationFrame(timeout);
387
+ }
388
+
389
+ // Setup debounce callback
390
+ timeout = window.requestAnimationFrame(publicAPIs.detect);
391
+ };
392
+
393
+ /**
394
+ * Update content sorting on resize
395
+ * Debounced for performance
396
+ */
397
+ var resizeHandler = function (event) {
398
+ // If there's a timer, cancel it
399
+ if (timeout) {
400
+ window.cancelAnimationFrame(timeout);
401
+ }
402
+
403
+ // Setup debounce callback
404
+ timeout = window.requestAnimationFrame(function () {
405
+ sortContents(contents);
406
+ publicAPIs.detect();
407
+ });
408
+ };
409
+
410
+ /**
411
+ * Destroy the current instantiation
412
+ */
413
+ publicAPIs.destroy = function () {
414
+ // Undo DOM changes
415
+ if (current) {
416
+ deactivate(current, settings);
417
+ }
418
+
419
+ // Remove event listeners
420
+ window.removeEventListener("scroll", scrollHandler, false);
421
+ if (settings.reflow) {
422
+ window.removeEventListener("resize", resizeHandler, false);
423
+ }
424
+
425
+ // Reset variables
426
+ contents = null;
427
+ navItems = null;
428
+ current = null;
429
+ timeout = null;
430
+ settings = null;
431
+ };
432
+
433
+ /**
434
+ * Initialize the current instantiation
435
+ */
436
+ var init = function () {
437
+ // Merge user options into defaults
438
+ settings = extend(defaults, options || {});
439
+
440
+ // Setup variables based on the current DOM
441
+ publicAPIs.setup();
442
+
443
+ // Find the currently active content
444
+ publicAPIs.detect();
445
+
446
+ // Setup event listeners
447
+ window.addEventListener("scroll", scrollHandler, false);
448
+ if (settings.reflow) {
449
+ window.addEventListener("resize", resizeHandler, false);
450
+ }
451
+ };
452
+
453
+ //
454
+ // Initialize and return the public APIs
455
+ //
456
+
457
+ init();
458
+ return publicAPIs;
459
+ };
460
+
461
+ //
462
+ // Return the Constructor
463
+ //
464
+
465
+ return Constructor;
466
+ },
467
+ );