@penn-libraries/web 1.0.0-dev.2 → 1.1.0-dev.0

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 (103) hide show
  1. package/dist/cjs/{index-B6HF5D3u.js → index-C0A2bnrZ.js} +76 -3
  2. package/dist/cjs/index-C0A2bnrZ.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/pennlibs-allow-tracking.pennlibs-autocomplete.pennlibs-footer.pennlibs-header.entry.cjs.js.map +1 -0
  6. package/dist/cjs/{pennlibs-chat_6.cjs.entry.js → pennlibs-allow-tracking_4.cjs.entry.js} +264 -121
  7. package/dist/cjs/pennlibs-allow-tracking_4.cjs.entry.js.map +1 -0
  8. package/dist/cjs/pennlibs-banner.cjs.entry.js +2 -2
  9. package/dist/cjs/pennlibs-chat.cjs.entry.js +25 -0
  10. package/dist/cjs/pennlibs-chat.cjs.entry.js.map +1 -0
  11. package/dist/cjs/pennlibs-chat.entry.cjs.js.map +1 -0
  12. package/dist/cjs/pennlibs-fallback-img.cjs.entry.js +22 -0
  13. package/dist/cjs/pennlibs-fallback-img.cjs.entry.js.map +1 -0
  14. package/dist/cjs/pennlibs-fallback-img.entry.cjs.js.map +1 -0
  15. package/dist/cjs/pennlibs-feedback.cjs.entry.js +60 -0
  16. package/dist/cjs/pennlibs-feedback.cjs.entry.js.map +1 -0
  17. package/dist/cjs/pennlibs-feedback.entry.cjs.js.map +1 -0
  18. package/dist/cjs/pennlibs-hero.cjs.entry.js +62 -0
  19. package/dist/cjs/pennlibs-hero.cjs.entry.js.map +1 -0
  20. package/dist/cjs/pennlibs-hero.entry.cjs.js.map +1 -0
  21. package/dist/cjs/web.cjs.js +2 -2
  22. package/dist/collection/collection-manifest.json +2 -0
  23. package/dist/collection/components/pennlibs-allow-tracking/pennlibs-allow-tracking.css +110 -0
  24. package/dist/collection/components/pennlibs-allow-tracking/pennlibs-allow-tracking.js +67 -0
  25. package/dist/collection/components/pennlibs-allow-tracking/pennlibs-allow-tracking.js.map +1 -0
  26. package/dist/collection/components/pennlibs-autocomplete/pennlibs-autocomplete.css +79 -0
  27. package/dist/collection/components/pennlibs-autocomplete/pennlibs-autocomplete.js +309 -0
  28. package/dist/collection/components/pennlibs-autocomplete/pennlibs-autocomplete.js.map +1 -0
  29. package/dist/collection/components/pennlibs-banner/pennlibs-banner.js +1 -1
  30. package/dist/collection/components/pennlibs-chat/pennlibs-chat.js +1 -1
  31. package/dist/collection/components/pennlibs-fallback-img/pennlibs-fallback-img.js +1 -1
  32. package/dist/collection/components/pennlibs-footer/pennlibs-footer.js +3 -3
  33. package/dist/collection/components/pennlibs-header/pennlibs-header.js +1 -1
  34. package/dist/collection/components/pennlibs-hero/pennlibs-hero.js +1 -1
  35. package/dist/components/index.d.ts +4 -0
  36. package/dist/components/index.js +2 -0
  37. package/dist/components/index.js.map +1 -1
  38. package/dist/components/pennlibs-allow-tracking.d.ts +11 -0
  39. package/dist/components/pennlibs-allow-tracking.js +79 -0
  40. package/dist/components/pennlibs-allow-tracking.js.map +1 -0
  41. package/dist/components/pennlibs-autocomplete.d.ts +11 -0
  42. package/dist/components/pennlibs-autocomplete.js +259 -0
  43. package/dist/components/pennlibs-autocomplete.js.map +1 -0
  44. package/dist/components/pennlibs-banner.js +1 -1
  45. package/dist/components/pennlibs-chat.js +1 -1
  46. package/dist/components/pennlibs-fallback-img.js +1 -1
  47. package/dist/components/pennlibs-footer.js +3 -3
  48. package/dist/components/pennlibs-header.js +1 -1
  49. package/dist/components/pennlibs-hero.js +1 -1
  50. package/dist/docs.json +102 -2
  51. package/dist/{web/p-BAQIT3Vo.js → esm/index-CE_ILdTo.js} +76 -3
  52. package/dist/{web/p-BAQIT3Vo.js.map → esm/index-CE_ILdTo.js.map} +1 -1
  53. package/dist/esm/index.js +1 -1
  54. package/dist/esm/loader.js +3 -3
  55. package/dist/esm/pennlibs-allow-tracking.pennlibs-autocomplete.pennlibs-footer.pennlibs-header.entry.js.map +1 -0
  56. package/dist/esm/{pennlibs-chat_6.entry.js → pennlibs-allow-tracking_4.entry.js} +263 -118
  57. package/dist/esm/pennlibs-allow-tracking_4.entry.js.map +1 -0
  58. package/dist/esm/pennlibs-banner.entry.js +2 -2
  59. package/dist/esm/pennlibs-chat.entry.js +23 -0
  60. package/dist/esm/pennlibs-chat.entry.js.map +1 -0
  61. package/dist/esm/pennlibs-fallback-img.entry.js +20 -0
  62. package/dist/esm/pennlibs-fallback-img.entry.js.map +1 -0
  63. package/dist/esm/pennlibs-feedback.entry.js +58 -0
  64. package/dist/esm/pennlibs-feedback.entry.js.map +1 -0
  65. package/dist/esm/pennlibs-hero.entry.js +60 -0
  66. package/dist/esm/pennlibs-hero.entry.js.map +1 -0
  67. package/dist/esm/web.js +3 -3
  68. package/dist/types/components/pennlibs-allow-tracking/pennlibs-allow-tracking.d.ts +11 -0
  69. package/dist/types/components/pennlibs-autocomplete/pennlibs-autocomplete.d.ts +63 -0
  70. package/dist/types/components.d.ts +47 -0
  71. package/dist/web/index.esm.js +1 -1
  72. package/dist/web/p-07ad051f.entry.js +60 -0
  73. package/dist/web/p-07ad051f.entry.js.map +1 -0
  74. package/dist/web/{p-e331a309.entry.js → p-20c0bd7a.entry.js} +3 -3
  75. package/dist/web/p-370e32b1.entry.js +58 -0
  76. package/dist/web/p-370e32b1.entry.js.map +1 -0
  77. package/dist/web/p-5e385536.entry.js +20 -0
  78. package/dist/web/p-5e385536.entry.js.map +1 -0
  79. package/dist/{esm/index-BAQIT3Vo.js → web/p-CE_ILdTo.js} +76 -3
  80. package/dist/web/p-CE_ILdTo.js.map +1 -0
  81. package/dist/web/p-cbae5952.entry.js +23 -0
  82. package/dist/web/p-cbae5952.entry.js.map +1 -0
  83. package/dist/web/{p-ffdd436d.entry.js → p-ceaf55b0.entry.js} +263 -118
  84. package/dist/web/p-ceaf55b0.entry.js.map +1 -0
  85. package/dist/web/pennlibs-allow-tracking.pennlibs-autocomplete.pennlibs-footer.pennlibs-header.entry.esm.js.map +1 -0
  86. package/dist/web/pennlibs-chat.entry.esm.js.map +1 -0
  87. package/dist/web/pennlibs-fallback-img.entry.esm.js.map +1 -0
  88. package/dist/web/pennlibs-feedback.entry.esm.js.map +1 -0
  89. package/dist/web/pennlibs-hero.entry.esm.js.map +1 -0
  90. package/dist/web/web.esm.js +3 -3
  91. package/hydrate/index.js +361 -9
  92. package/hydrate/index.mjs +361 -9
  93. package/package.json +2 -2
  94. package/readme.md +2 -0
  95. package/dist/cjs/index-B6HF5D3u.js.map +0 -1
  96. package/dist/cjs/pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.cjs.js.map +0 -1
  97. package/dist/cjs/pennlibs-chat_6.cjs.entry.js.map +0 -1
  98. package/dist/esm/index-BAQIT3Vo.js.map +0 -1
  99. package/dist/esm/pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.js.map +0 -1
  100. package/dist/esm/pennlibs-chat_6.entry.js.map +0 -1
  101. package/dist/web/p-ffdd436d.entry.js.map +0 -1
  102. package/dist/web/pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.esm.js.map +0 -1
  103. /package/dist/web/{p-e331a309.entry.js.map → p-20c0bd7a.entry.js.map} +0 -0
@@ -1,87 +1,286 @@
1
- import { r as registerInstance, h, g as getAssetPath, c as createEvent, a as getElement } from './index-BAQIT3Vo.js';
1
+ import { r as registerInstance, h, c as createEvent, a as getElement, g as getAssetPath } from './index-CE_ILdTo.js';
2
2
 
3
- const pennlibsChatCss = ":host {\n font-family: var(--pl-font-family);\n font-size: var(--pl-font-size);\n line-height: normal;\n}\n\n@media print {\n :host {\n display: none;\n }\n}\n\na {\n display: flex;\n align-items: center;\n background: linear-gradient(45deg, #faa755, #fcca99);\n border-radius: 1em;\n position: fixed;\n bottom: 0.75em;\n right: 0.75em;\n box-shadow: rgba(0,0,0,0.3) 0px 2px 16px 0px;\n color: var(--pl-color-penn-blue);\n text-decoration: none;\n font-weight: 500;\n padding: 0.15em;\n font-size: 1em;\n\n @media (min-width: 820px) {\n bottom: 1.5em;\n right: 1.5em;\n width: auto;\n padding: 0.15em 0.75em;\n padding-left: 0.5em;\n }\n}\n\na:hover {\n text-decoration: underline;\n text-underline-offset: var(--pl-link-text-underline-offset);\n text-decoration-thickness: var(--pl-link-hover-text-decoration-thickness);\n}\n\na:hover,\na:focus {\n outline: none;\n box-shadow: 0 0 0 2px var(--pl-color-bg-attention),0 0 0 4px var(--pl-color-penn-blue), rgba(0,0,0,0.3) 0px 2px 16px 0px;;\n}\n\nsvg {\n width: 2.5em;\n height: 2.5em;\n}\n\nspan {\n display: none;\n font-size: 1.1em;\n\n @media (min-width: 820px) {\n display: inline;\n }\n}";
3
+ const pennlibsAllowTrackingCss = ":host {\n background: var(--pl-color-penn-blue);\n display: block;\n margin: 0;\n font-family: var(--pl-font-family);\n font-size: var(--pl-font-size);\n color: var(--pl-color-fg-on-emphasis);\n\n *, *:before, *:after {\n box-sizing: inherit;\n }\n\n & h2 {\n font-size: var(--pl-font-size-xl);\n font-family: var(--pl-font-sans-serif);\n margin-bottom: 0;\n margin-top: 0;\n display: inline-flex;\n flex-wrap: wrap;\n\n & span {\n padding-right: var(--pl-space-xs);\n }\n }\n\n & p {\n margin: 0;\n }\n\n & *:focus {\n box-shadow: 0 0 0 2px var(--pl-color-bg-accent-emphasis), 0 0 0 4px var(--pl-color-bg-accent);\n outline: none;\n }\n\n & a {\n color: var(--pl-color-fg-on-emphasis);\n text-decoration: underline;\n text-underline-offset: var(--pl-link-text-underline-offset);\n\n &:hover {\n text-underline-offset: var(--pl-link-text-underline-offset);\n text-decoration-thickness: 0.1em;\n }\n }\n}\n\n.container {\n padding: var(--pl-space-m) 0;\n}\n\n.pl-viewport-margins {\n width: 100%;\n max-width: var(--pl-viewport-margins-max-width);\n margin: 0 auto;\n padding: 0 var(--pl-viewport-margins-gutter, 1em);\n\n display: flex;\n gap: var(--pl-space-m);\n align-items: center;\n justify-content: space-between;\n\n flex-wrap: wrap;\n\n & div:last-of-type {\n display: flex;\n gap: var(--pl-space-xs);\n }\n}\n\nbutton {\n all: unset;\n display: flex;\n align-items: center;\n gap: 0.5em;\n padding: 0.5em 1.5em;\n font-family: var(--pl-font-family);\n font-weight: 500;\n line-height: 1.4;\n color: var(--pl-color-fg-default);\n background: var(--pl-color-bg-default);\n border-radius: 1em;\n box-sizing: border-box;\n\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n text-underline-offset: var(--pl-link-text-underline-offset);\n text-decoration-thickness: 0.1em;\n }\n}\n\n.stop-sharing {\n background: none;\n color: var(--pl-color-fg-on-emphasis);\n border: solid 1px var(--pl-color-fg-on-emphasis);\n}\n\n.tracking-message {\n display: flex;\n gap: var(--pl-space-xs);\n align-items: center;\n\n & svg {\n flex-shrink: 0;\n }\n}\n\n.tracking-options {\n flex-wrap: wrap;\n}";
4
4
 
5
- const Chat = class {
5
+ const AllowTracking = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
- this.libchat_url = "https://faq.library.upenn.edu/chat/widget/32588ef2b889010cb2f3f39c678ffba58e390e74d013b238dd2b1e35717f7857";
9
- this.href = "";
8
+ this.consentGiven = null;
9
+ this.hide = true;
10
+ this.handleAllow = () => {
11
+ this.setCookie('pennlibs-allow-tracking', 'YES');
12
+ this.consentGiven = 'YES';
13
+ };
14
+ this.handleDoNotTrack = () => {
15
+ this.setCookie('pennlibs-allow-tracking', 'NO');
16
+ this.consentGiven = 'NO';
17
+ };
18
+ this.handleHide = () => {
19
+ this.hide = true;
20
+ };
10
21
  }
11
- connectedCallback() {
12
- this.href = this.libchat_url + '?referer=' + window.location.href;
22
+ componentWillLoad() {
23
+ if (navigator.cookieEnabled) {
24
+ this.hide = false;
25
+ }
26
+ const existingConsent = this.getCookie('pennlibs-allow-tracking');
27
+ if (existingConsent) {
28
+ this.consentGiven = existingConsent;
29
+ }
13
30
  }
14
- render() {
15
- return (h("a", { key: '7e987c36da941c639917c16b2aa273262c1cabbb', href: this.href, target: "_blank", "aria-label": "Chat", id: "pennlibs-chat" }, h("svg", { key: '74dedb9dce8e714dc58df0f88149c157ae8f3ee0', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 82 82" }, h("path", { key: '0bbdb855437c5c35ef3067e328c72325c0e40f6e', fill: "#fff", d: "M66.17 31.97H24.08c-1.19 0-2.17.97-2.17 2.17v28.55c0 1.19.97 2.17 2.17 2.17h24.68c1.19 0 2.17.97 2.17 2.17v2.28c0 1.93 2.33 2.89 3.69 1.53l5.34-5.34c.41-.41.96-.63 1.53-.63h4.67c1.19 0 2.17-.97 2.17-2.17V34.15c0-1.19-.97-2.17-2.17-2.17Z" }), h("path", { key: '23832dead6b6c2efe3353fef8c0367c50f7bffea', fill: "#011f5b", d: "M28.91 57.96c-1.01 0-2.01-.39-2.76-1.14l-5.34-5.34c-.08-.08-.19-.13-.31-.13h-4.67c-2.15 0-3.9-1.75-3.9-3.9V18.9c0-2.15 1.75-3.9 3.9-3.9h42.09c2.15 0 3.9 1.75 3.9 3.9v28.55c0 2.15-1.75 3.9-3.9 3.9H33.24c-.24 0-.43.19-.43.43v2.28c0 1.58-.94 2.99-2.41 3.6-.48.2-.99.3-1.5.3ZM15.83 18.47c-.24 0-.43.19-.43.43v28.55c0 .24.19.43.43.43h4.67c1.04 0 2.02.41 2.76 1.14l5.34 5.34c.13.13.29.17.47.09.18-.07.27-.21.27-.4v-2.28c0-2.15 1.75-3.9 3.9-3.9h24.68c.24 0 .43-.19.43-.43V18.89c0-.24-.19-.43-.43-.43H15.83Z" })), h("span", { key: '5fe7d4714917699688a27cfac156e3cc88545d4c' }, "Chat")));
31
+ getCookie(name) {
32
+ var _a;
33
+ return ((_a = document.cookie
34
+ .split('; ')
35
+ .find(row => row.startsWith(`${name}=`))) === null || _a === void 0 ? void 0 : _a.split('=')[1]) || null;
16
36
  }
17
- };
18
- Chat.style = pennlibsChatCss;
19
-
20
- const pennlibsFallbackImgCss = ":host{font-family:var(--pl-font-family);font-size:var(--pl-font-size);display:flex;align-items:center;justify-content:center;padding:1rem;background:var(--pl-color-bg-subtle);aspect-ratio:3/2}.no-image__img{width:100%;max-width:150px;filter:grayscale(1) opacity(0.3)}";
21
-
22
- const NoImage = class {
23
- constructor(hostRef) {
24
- registerInstance(this, hostRef);
37
+ setCookie(name, value) {
38
+ document.cookie = `${name}=${value}; path=/; max-age=31536000`;
25
39
  }
26
40
  render() {
27
- const shieldImg = getAssetPath('./assets/simplified-shield.webp');
28
- return (h("img", { key: '042513b9ac53d6d78dd2af6a58b8ad18cf82ec0f', src: shieldImg, alt: "", class: "no-image__img" }));
41
+ if (this.hide) {
42
+ return null;
43
+ }
44
+ if (this.consentGiven) {
45
+ return (h("div", { class: "container" }, h("div", { class: "pl-viewport-margins" }, h("div", null, h("p", null, "You've ", h("strong", null, this.consentGiven === 'YES' ? 'accepted' : 'rejected'), " tracking. You can ", h("a", { href: "#" }, "change this setting"), " at anytime.")), h("div", null, h("button", { onClick: this.handleHide }, "Hide tracking message")))));
46
+ }
47
+ return (h("div", { class: "container" }, h("div", { class: "pl-viewport-margins" }, h("div", { class: "tracking-message" }, h(TrackingIcon, null), h("p", null, h("a", { href: "https://www.library.upenn.edu/about/policies/penn-libraries-privacy-policy" }, "We use anonymized data"), " from your visit such as clicks to gather analytics and understand how we can make improvements.")), h("div", { class: "tracking-options" }, h("button", { onClick: this.handleAllow }, "Continue sharing"), h("button", { onClick: this.handleDoNotTrack, class: "stop-sharing" }, "Stop sharing")))));
29
48
  }
30
- static get assetsDirs() { return ["assets"]; }
31
49
  };
32
- NoImage.style = pennlibsFallbackImgCss;
50
+ function TrackingIcon() {
51
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-trending-up-down-icon lucide-trending-up-down" }, h("path", { d: "M14.828 14.828 21 21" }), h("path", { d: "M21 16v5h-5" }), h("path", { d: "m21 3-9 9-4-4-6 6" }), h("path", { d: "M21 8V3h-5" })));
52
+ }
53
+ AllowTracking.style = pennlibsAllowTrackingCss;
33
54
 
34
- const pennlibsFeedbackCss = ":host{display:block;background:#eeeff4;padding:1.5em 1em;font-family:var(--pl-font-family);font-size:var(--pl-font-size);color:var(--pl-color-fg-default);line-height:1.4;box-sizing:border-box}@media print{:host{display:none}}.feedback-container{display:flex;align-items:center;flex-wrap:wrap;gap:0.5em;width:100%;justify-content:center}@media (max-width: 26em){.feedback-container{justify-content:center}}h2{display:inline-block;margin:0 0.5em 0 0;font-family:var(--pl-font-sans-serif);font-size:1em;font-weight:600}p{margin:0;padding:calc(0.5em + 1px) 0}strong{font-weight:600}a{color:var(--pl-color-fg-accent);text-decoration:underline;text-underline-offset:var(--pl-link-text-underline-offset);text-decoration-thickness:var(--pl-link-text-decoration-thickness)}button{all:unset;display:flex;align-items:center;gap:0.5em;padding:0.5em 1.5em;font-family:var(--pl-font-family);font-weight:500;line-height:1.4;color:var(--pl-color-fg-default);background:var(--pl-color-bg-default);border:solid 1px var(--pl-color-fg-subtle);border-radius:1em;box-sizing:border-box}button:hover{cursor:pointer}button:hover span{text-decoration:underline}*:focus{outline:0;box-shadow:0 0 0 2px var(--pl-color-bg-attention),\n 0 0 0 3px var(--pl-color-bg-emphasis)}p:focus{outline:none;box-shadow:0 0 0 2px var(--pl-color-bg-attention), 0 0 0 3px var(--pl-color-bg-emphasis)}@media (max-width: 26em){h2{display:block;width:100%;text-align:center}}.help-us{display:flex;flex-direction:column;gap:0.5em}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.visually-hidden:focus,.visually-hidden:active{clip:auto;clip-path:none;height:auto;overflow:visible;position:static;white-space:normal;width:auto}";
55
+ const pennlibsAutocompleteCss = ":host {\n display: block;\n border-radius: 1.25rem;\n padding: 0;\n border-top: 0;\n position: relative;\n}\n\n[role=listbox] {\n position: absolute;\n margin-top: var(--pl-space-xs);\n background: var(--pl-color-bg-default);\n border-radius: 1.25rem;\n box-shadow: rgba(140, 149, 159, 0.3) 0px 8px 24px 0px;\n width: 100%;\n overflow: hidden;\n z-index: 1;\n\n display: flex;\n flex-direction: column;\n}\n\np {\n margin: 0;\n font-size: var(--pl-font-size-s);\n color: var(--pl-color-fg-subtle);\n padding: var(--pl-space-xs) calc(var(--pl-space-m) + var(--pl-space-2xs));\n font-size: var(--pl-font-size-s);\n order: 2;\n font-weight: 500;\n background: var(--pl-color-bg-subtle);\n border-radius: 0 0 1.25rem 1.25rem;\n\n display: flex;\n gap: var(--pl-space-s) var(--pl-space-l);\n flex-wrap: wrap;\n}\n\nol {\n list-style: none;\n margin: 0;\n padding: var(--pl-space-xs) 0;\n order: 1;\n}\n\n[role=option] {\n color: var(--pl-color-fg-default);\n padding: var(--pl-space-s) calc(var(--pl-space-m) + var(--pl-space-2xs));\n text-decoration: none;\n font-weight: 700; \n\n &:hover {\n cursor: pointer;\n }\n\n &:hover,\n &:focus {\n text-decoration-thickness: 2px;\n text-underline-offset: 2px;\n text-decoration: underline;\n }\n}\n\n[aria-selected=true] {\n text-decoration-thickness: 2px;\n text-underline-offset: 2px;\n text-decoration: underline;\n}\n\nmark {\n background: none;\n font-weight: 400;\n}\n\n.suggestion--border {\n border-bottom: solid 1px rgb(from var(--pl-color-fg-default) r g b / 0.2);\n padding-bottom: calc(var(--pl-space-2xs) + var(--pl-space-s));\n margin-bottom: var(--pl-space-2xs);\n}";
35
56
 
36
- const FEEDBACK_STORAGE_KEY = 'pennlibs-feedback-answer';
37
- const FEEDBACK_QUESTION = 'Did you find what you need?';
38
- const FEEDBACK_ERROR_STORAGE_KEY = 'pennlibs-feedback-error';
39
- const PennlibsFeedback = class {
57
+ const Autocomplete = class {
40
58
  constructor(hostRef) {
41
59
  registerInstance(this, hostRef);
42
- this.feedbackEvent = createEvent(this, "pennlibs-feedback");
43
- this.error = false;
44
- this.answer = undefined;
60
+ this.activated = createEvent(this, "pl:activated");
61
+ this.showSuggestions = false;
62
+ this.currentIndex = -1;
63
+ this.originalValue = '';
64
+ this.options = [];
65
+ this.handleOptionClick = (index) => {
66
+ this.currentIndex = index;
67
+ this.selectCurrent();
68
+ };
45
69
  }
46
70
  componentWillLoad() {
47
- if (sessionStorage.getItem(FEEDBACK_STORAGE_KEY)) {
48
- this.answer = sessionStorage.getItem(FEEDBACK_STORAGE_KEY);
49
- }
50
- if (sessionStorage.getItem(FEEDBACK_ERROR_STORAGE_KEY)) {
51
- this.error = sessionStorage.getItem(FEEDBACK_ERROR_STORAGE_KEY) === 'true';
52
- }
71
+ this.options = this.parseOptionsFromDOM();
72
+ }
73
+ componentDidLoad() {
74
+ this.setupInput();
75
+ }
76
+ disconnectedCallback() {
77
+ if (this.blurTimeout)
78
+ clearTimeout(this.blurTimeout);
53
79
  }
54
- componentDidRender() {
55
- if (this.answer === 'yes' && this.yesMessageRef) {
56
- this.yesMessageRef.focus();
80
+ parseOptionsFromDOM() {
81
+ const listbox = this.findListbox();
82
+ if (!listbox)
83
+ return [];
84
+ const elements = Array.from(listbox.querySelectorAll('[role="option"]'));
85
+ return elements.map((el, i) => this.createOption(el, i));
86
+ }
87
+ findListbox() {
88
+ return Array.from(this.el.children).find(child => child.matches('ol[role="listbox"]'));
89
+ }
90
+ createOption(element, index) {
91
+ var _a;
92
+ return {
93
+ id: element.id || `option-${index}`,
94
+ html: element.innerHTML,
95
+ value: element.getAttribute('data-value') || ((_a = element.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || ''
96
+ };
97
+ }
98
+ getInput() {
99
+ var _a, _b;
100
+ const slot = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="start"]');
101
+ return ((_b = slot === null || slot === void 0 ? void 0 : slot.assignedElements()[0]) === null || _b === void 0 ? void 0 : _b.querySelector('input')) || null;
102
+ }
103
+ isInputFocused() {
104
+ return this.getInput() === document.activeElement;
105
+ }
106
+ isTrackedInput(input) {
107
+ return (input === null || input === void 0 ? void 0 : input.getAttribute('data-pl-autocomplete-input')) === 'true' &&
108
+ this.el.contains(input);
109
+ }
110
+ setupInput() {
111
+ const input = this.getInput();
112
+ if (!input)
113
+ return;
114
+ this.setComboboxAttributes(input);
115
+ input.setAttribute('data-pl-autocomplete-input', 'true');
116
+ }
117
+ setComboboxAttributes(input) {
118
+ input.setAttribute('role', 'combobox');
119
+ input.setAttribute('aria-autocomplete', 'list');
120
+ input.setAttribute('aria-expanded', 'false');
121
+ input.setAttribute('aria-controls', 'listbox');
122
+ }
123
+ handleSlotChange() {
124
+ this.setupInput();
125
+ }
126
+ handleInputEvent(event) {
127
+ const input = event.target;
128
+ if (this.isTrackedInput(input))
129
+ this.openSuggestions();
130
+ }
131
+ handleFocusEvent(event) {
132
+ const input = event.target;
133
+ if (this.isTrackedInput(input))
134
+ this.showSuggestionsPanel();
135
+ }
136
+ handleBlurEvent(event) {
137
+ const input = event.target;
138
+ if (this.isTrackedInput(input))
139
+ this.deferCloseSuggestions();
140
+ }
141
+ handleFocusOut(event) {
142
+ if (this.isFocusLeavingComponent(event))
143
+ this.closeSuggestions();
144
+ }
145
+ handleKeyDown(event) {
146
+ if (!this.isInputFocused())
147
+ return;
148
+ if (event.metaKey || event.ctrlKey)
149
+ return; // Ignore keyboard shortcuts
150
+ const handler = this.keyHandlers()[event.key];
151
+ if (handler) {
152
+ event.preventDefault();
153
+ handler();
57
154
  }
58
- else if (this.answer === 'no' && this.noMessageRef) {
59
- this.noMessageRef.focus();
155
+ }
156
+ keyHandlers() {
157
+ return {
158
+ 'Escape': () => this.handleEscape(),
159
+ 'ArrowDown': () => this.handleArrowDown(),
160
+ 'ArrowUp': () => this.handleArrowUp(),
161
+ 'Enter': () => this.handleEnter()
162
+ };
163
+ }
164
+ handleEscape() {
165
+ this.reset();
166
+ this.syncInputState();
167
+ }
168
+ handleArrowDown() {
169
+ if (!this.showSuggestions)
170
+ return;
171
+ this.moveNext();
172
+ this.syncInputState();
173
+ }
174
+ handleArrowUp() {
175
+ if (!this.showSuggestions)
176
+ return;
177
+ this.movePrevious();
178
+ this.syncInputState();
179
+ }
180
+ handleEnter() {
181
+ if (this.canSelect())
182
+ this.selectCurrent();
183
+ }
184
+ // Navigation
185
+ moveNext() {
186
+ const lastIndex = this.options.length - 1;
187
+ this.currentIndex = this.currentIndex < lastIndex ? this.currentIndex + 1 : -1;
188
+ }
189
+ movePrevious() {
190
+ const lastIndex = this.options.length - 1;
191
+ this.currentIndex = this.currentIndex > -1 ? this.currentIndex - 1 : lastIndex;
192
+ }
193
+ canSelect() {
194
+ return this.showSuggestions && this.currentIndex >= 0;
195
+ }
196
+ selectCurrent() {
197
+ if (this.currentIndex < 0)
198
+ return;
199
+ const selectedOption = this.options[this.currentIndex];
200
+ const input = this.getInput();
201
+ if (input) {
202
+ input.value = selectedOption.value;
203
+ this.originalValue = selectedOption.value;
60
204
  }
205
+ this.activated.emit({
206
+ index: this.currentIndex,
207
+ value: selectedOption.value
208
+ });
209
+ this.closeSuggestions();
210
+ }
211
+ openSuggestions() {
212
+ if (!this.isInputFocused())
213
+ return;
214
+ const input = this.getInput();
215
+ if (input)
216
+ this.originalValue = input.value;
217
+ this.showSuggestionsPanel();
218
+ this.syncInputState();
61
219
  }
62
- handleFeedback(answer) {
220
+ showSuggestionsPanel() {
221
+ this.showSuggestions = true;
222
+ this.syncInputState();
223
+ }
224
+ closeSuggestions() {
225
+ this.reset();
226
+ this.syncInputState();
227
+ }
228
+ deferCloseSuggestions() {
229
+ this.blurTimeout = setTimeout(() => {
230
+ if (this.isFocusOutsideComponent())
231
+ this.closeSuggestions();
232
+ }, 150);
233
+ }
234
+ reset() {
235
+ this.showSuggestions = false;
236
+ this.currentIndex = -1;
237
+ }
238
+ isFocusLeavingComponent(event) {
63
239
  var _a;
64
- this.answer = answer;
65
- sessionStorage.setItem(FEEDBACK_STORAGE_KEY, answer);
66
- this.feedbackEvent.emit({
67
- question: FEEDBACK_QUESTION,
68
- answer: answer,
69
- url: window.location.href,
70
- pageHeading: ((_a = document.querySelector('h1')) === null || _a === void 0 ? void 0 : _a.textContent) || undefined,
71
- pageTitle: document.title || undefined
72
- });
240
+ const target = event.relatedTarget;
241
+ return !target ||
242
+ (!this.el.contains(target) && !((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(target)));
73
243
  }
74
- render() {
75
- if (this.answer === 'yes') {
76
- return (h("div", { class: "feedback-container" }, h("p", { ref: (el) => this.yesMessageRef = el, tabindex: "-1" }, h("strong", null, "Thank you"), " for your feedback! \uD83D\uDC4D")));
244
+ isFocusOutsideComponent() {
245
+ var _a;
246
+ const active = document.activeElement;
247
+ return !((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(active)) && active !== this.getInput();
248
+ }
249
+ // Input State Sync
250
+ syncInputState() {
251
+ const input = this.getInput();
252
+ if (!input)
253
+ return;
254
+ this.updateAriaExpanded(input);
255
+ this.updateAriaActiveDescendant(input);
256
+ this.updateInputValue(input);
257
+ }
258
+ updateAriaExpanded(input) {
259
+ input.setAttribute('aria-expanded', this.showSuggestions.toString());
260
+ }
261
+ updateAriaActiveDescendant(input) {
262
+ const hasSelection = this.showSuggestions && this.currentIndex >= 0;
263
+ if (hasSelection && this.options[this.currentIndex]) {
264
+ input.setAttribute('aria-activedescendant', this.options[this.currentIndex].id);
77
265
  }
78
- if (this.answer === 'no') {
79
- return (h("div", { class: "feedback-container" }, h("p", { ref: (el) => this.noMessageRef = el, tabindex: "-1" }, "To ", h("strong", null, "help us improve"), ", we'd like to know more about your visit. Please ", h("a", { href: "https://www.library.upenn.edu/contact-us" }, "contact us with your feedback"), ".")));
266
+ else {
267
+ input.removeAttribute('aria-activedescendant');
80
268
  }
81
- return (h("div", { class: "feedback-container" }, h("h2", null, FEEDBACK_QUESTION), h("button", { onClick: () => this.handleFeedback('yes') }, "\uD83D\uDC4D", h("span", null, "Yes", h("span", { class: "visually-hidden" }, ", I found what I need."))), h("button", { onClick: () => this.handleFeedback('no') }, "\uD83D\uDC4E", h("span", null, "No", h("span", { class: "visually-hidden" }, ", I didn't find what I need.")))));
82
269
  }
270
+ updateInputValue(input) {
271
+ input.value = this.currentIndex >= 0
272
+ ? this.options[this.currentIndex].value
273
+ : this.originalValue;
274
+ }
275
+ shouldShowListbox() {
276
+ return this.showSuggestions && this.options.length > 0 && this.isInputFocused();
277
+ }
278
+ render() {
279
+ return (h("div", { key: '115c30f765cf21c38e2e5376da41295850ec76e3' }, h("slot", { key: '878c10f3b561bf8c85f920b7238227a5b0429204', name: "start" }), this.shouldShowListbox() && (h("ol", { key: 'ea491160d597a9c2b553107fb3edad698d652549', role: "listbox", id: "listbox" }, this.options.map((option, index) => (h("li", { role: "option", id: option.id, "aria-selected": this.currentIndex === index ? 'true' : 'false', tabindex: "-1", onClick: () => this.handleOptionClick(index), innerHTML: option.html })))))));
280
+ }
281
+ get el() { return getElement(this); }
83
282
  };
84
- PennlibsFeedback.style = pennlibsFeedbackCss;
283
+ Autocomplete.style = pennlibsAutocompleteCss;
85
284
 
86
285
  const pennlibsFooterCss = ":host {\n font-family: var(--pl-font-family);\n font-size: var(--pl-font-size);\n --padding-bottom: 5.75rem;\n}\n\n@media print {\n :host {\n display: none;\n }\n}\n\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\n.website-footer-wrapper {\n background: var(--pl-color-penn-blue);\n padding-bottom: var(--padding-bottom);\n}\n\n.viewport-margins {\n max-width: var(--pl-viewport-margins-max-width);\n margin: 0 auto;\n padding: 0 var(--pl-viewport-margins-gutter, 1em);\n}\n\n.website-footer {\n background-size: cover;\n color: var(--pl-color-fg-subtle-on-emphasis);\n}\n\n.website-footer a {\n color: var(--pl-color-fg-subtle-on-emphasis);\n}\n\n.website-footer__content {\n padding: 4em 0;\n}\n\n.website-footer__links-container {\n gap: 4em 2em;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(12em, 1fr));\n}\n\n.website-footer__heading {\n font-size: 0.8em;\n text-transform: uppercase;\n letter-spacing: 0.075em;\n margin-bottom: 1em;\n opacity: 0.75;\n}\n\n.website-footer__links {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.75em;\n}\n\n.website-footer__links a {\n text-decoration: none;\n}\n\n.website-footer__links a:hover {\n text-decoration: underline;\n text-underline-offset: var(--pl-link-text-underline-offset);\n}\n\n.website-footer__footer {\n padding: 1em 0;\n background: rgba(1, 31, 91, 0.65);\n}\n\n.website-footer__links--footer {\n display: flex;\n flex-wrap: wrap;\n gap: 0;\n flex-direction: row;\n margin-left: -0.5em;\n\n @media (max-width: 1080px) {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(16em, 1fr));\n }\n}\n\n.website-footer__links--footer a {\n display: inline-block;\n padding: 0.5em 0.75em;\n font-size: 0.875em;\n opacity: 0.875;\n font-weight: 500;\n}\n\n.website-footer__links--footer a:hover {\n text-decoration: underline;\n text-underline-offset: var(--pl-link-text-underline-offset);\n}";
87
286
 
@@ -112,12 +311,12 @@ const Footer = class {
112
311
  }
113
312
  render() {
114
313
  const footerBackgroundSrc = getAssetPath('./assets/footer-bg.webp');
115
- return (h("div", { key: 'a1cbb7636191cb3ac934a1bb375054357bcf93fc', class: "website-footer-wrapper" }, h("footer", { key: 'f2f2ab282f7d8e5a4603e0a6d8337135c4625ba6', class: "website-footer", style: {
314
+ return (h("div", { key: '968368b94435f332d852c7599308992195df8792', class: "website-footer-wrapper" }, h("footer", { key: '6c709b86bef34533d5350e7040d043fd2dd5caf2', class: "website-footer", style: {
116
315
  background: `var(--pl-color-penn-blue) url(${footerBackgroundSrc}) no-repeat 50% 50%`,
117
316
  backgroundSize: 'cover',
118
- } }, h("div", { key: 'eb24a52f9c3f135bc75f3e23ef3088a928a3ce65', class: "viewport-margins" }, h("div", { key: '439be8c6582f5eaa173251af97f17252fce9243c', class: "website-footer__content" }, h("div", { key: '3f30c3156c96a35a772fb85d890e1f5d81af8ec6', class: "website-footer__links-container" }, h("section", { key: 'e32be08455a07061a8eaeb13b2ae3f377f818c5f' }, h("h2", { key: 'bc2be34b67cc0953338d8f418950f428a5f55172', class: "website-footer__heading" }, "Penn Libraries"), h("ul", { key: 'bae0ee381df1883da90752c9476491217a2c2ca7', class: "website-footer__links" }, h("li", { key: 'f5025e51424e5c972b46a5d1650552b6187aa4e9' }, h("a", { key: '836172e6d531eb0d37d0c0a5e66a3a6c92ba95b3', href: "https://maps.google.com/?q=Van Pelt Library 3420 Walnut Street, Philadelphia, PA 19104-6206" }, "3420 Walnut Street", h("br", { key: 'ae8b8d41baccd3bb62c15d336c7664100f407886' }), "Philadelphia, PA 19104-6206")), h("li", { key: 'ed016c0fbe56c899bedb3e25eabbb1b3773b0167' }, h("a", { key: '04eab3b14fcda0ccff15f069beceb0bd0ef111fa', href: "tel:(215) 898-7555" }, "(215) 898-7555")), h("li", { key: 'e1968b748a2303a2b6176f502f68f7ed20e90c9b' }, h("a", { key: '9823456a1a5d7016431f88cd5a1c871cc8ef6a6d', href: "https://www.library.upenn.edu/contact-us" }, "Contact us")), h("li", { key: 'aedd3b51a66e6a78c463d0e76a9fddd60a0e4fa8' }, h("a", { key: '1972520903c54834e83c3f99ea4b35964d09b8a5', href: "https://www.library.upenn.edu/about/hours", target: "_blank" }, "Locations and hours")))), h("section", { key: '3604f648361768c4c4fdae3bb19af3625ccc5cbd' }, h("h2", { key: 'a79782bb074b215f3e44ebaf7e2bdcb8e1b37e27', class: "website-footer__heading" }, "Stay in touch"), h("ul", { key: 'cf7d5c3ddf5473471a5e4f154a82a3c4c6d3b7b5', class: "website-footer__links" }, h("li", { key: '8eb5e4f10197d0a428088e676d55620cc4a5ca6a' }, h("a", { key: '8e698ca0cc1614db65e64466dd1912bd74a8f58c', href: "https://www.alumni.upenn.edu/libsignup" }, "Newsletter")), h("li", { key: '62e6161d9ef81872473cb3c7df8df82fa5e49027' }, h("a", { key: 'b24bd5cfea7998bdf3b7674e32b0e72597cdf6c9', href: "https://www.instagram.com/upennlib/" }, "Instagram")), h("li", { key: 'd7260d10fda8fcde1bb799b2a6f5d9e34c47b4e1' }, h("a", { key: 'b24f2b33851e30a61d859c507ee5781caec47cb3', href: "https://www.facebook.com/PennLibraries/" }, "Facebook")), h("li", { key: '796d833e8f9e21a2739079ee7c5e7cf4f5bf5aa4' }, h("a", { key: 'e8ec25b48d06450abe3db34eb98f338e1caadd1b', href: "https://www.linkedin.com/company/penn-libraries" }, "LinkedIn")))), this.navigationByChildren && [
317
+ } }, h("div", { key: 'cfb33794f711d427f8cc64026bc1caff589ff444', class: "viewport-margins" }, h("div", { key: '7f7518568ef5884a0014be4e10b4ba6d00b14d9c', class: "website-footer__content" }, h("div", { key: '8fb9612358f3c42b3a5621f54cb646c06307776a', class: "website-footer__links-container" }, h("section", { key: '1bed43fbe1c161d8d4de0381f71f093bab6a3791' }, h("h2", { key: 'bdd5487da839597ce52715eff9fae099301a3f4b', class: "website-footer__heading" }, "Penn Libraries"), h("ul", { key: '0579c77c9120b73f67eb5560716cc9194182e645', class: "website-footer__links" }, h("li", { key: 'c8cadddc0867b4bded9f22975bc6e80210501737' }, h("a", { key: '34a076d9417b0da1a390f9757be5cece974b8658', href: "https://maps.google.com/?q=Van Pelt Library 3420 Walnut Street, Philadelphia, PA 19104-6206" }, "3420 Walnut Street", h("br", { key: '159e1ceed4693f7a85489ad4a1ef8f916f505955' }), "Philadelphia, PA 19104-6206")), h("li", { key: '3de1e966c16afc1ae5c82d25b1d87e24f27af826' }, h("a", { key: '39a6709291115a6f6ead9116171b97c31c6e77d9', href: "tel:(215) 898-7555" }, "(215) 898-7555")), h("li", { key: '7236b41454b66bc155bc4a7568f603c70504f01b' }, h("a", { key: '49b285935d3240e900079b62c8d90eb564e5707d', href: "https://www.library.upenn.edu/contact-us" }, "Contact us")), h("li", { key: '9329fe40a9aef5e1eaa74c6b22b33aee5b94f624' }, h("a", { key: 'd2bc79dff8b3a5c01cbc1ece4268b4fdddc56954', href: "https://www.library.upenn.edu/about/hours", target: "_blank" }, "Locations and hours")))), h("section", { key: '8b05b90f531f99c6223a7a080baa9472bb00b2b0' }, h("h2", { key: 'c950fd6a248e5d673a8a4e050f3aaa84f91c5014', class: "website-footer__heading" }, "Stay in touch"), h("ul", { key: '7ce913dd26948c9c1bb6f5ab14f1febc07425836', class: "website-footer__links" }, h("li", { key: 'ccd80b1eee71f058caad49e3da56cbf1a8d28aa2' }, h("a", { key: 'b09d62df23e341bd9424ff541a842c3b17a24637', href: "https://www.alumni.upenn.edu/libsignup" }, "Newsletter")), h("li", { key: '7b7c04fdf9d6673fef77fecd460c110f55700350' }, h("a", { key: '08cd159b59ff63471f4075913a644bbd171c5e90', href: "https://www.instagram.com/upennlib/" }, "Instagram")), h("li", { key: 'f0fffc02b5a55f41ad9e97b1e35dd7217e4d3aa6' }, h("a", { key: '0269c87d87e2b2b3db93fae2d5e33d19cf6a82a1', href: "https://www.facebook.com/PennLibraries/" }, "Facebook")), h("li", { key: '3c008831c4c3e5d700d4f16427b3cfd50082a8a6' }, h("a", { key: 'db56894184243b375d3f8c7c42458720f70a34f2', href: "https://www.linkedin.com/company/penn-libraries" }, "LinkedIn")))), this.navigationByChildren && [
119
318
  this.navigationByChildren.map(section => (h("section", null, h("h2", { class: "website-footer__heading" }, section.heading), h("ul", { class: "website-footer__links" }, section.links.map(link => (h("li", null, h("a", { href: link.href }, link.label))))))))
120
- ]))), h("div", { key: 'eb01f1b9475979942a291cecb5c49a7f99ac76ff', class: "website-footer__footer" }, h("div", { key: 'fe811b0a667ac77fbd65c6947fc64b11e6fd105a', class: "viewport-margins" }, h("ul", { key: '2999c3b798c86365232fa948bba6ba42bad4ac05', class: "website-footer__links website-footer__links--footer" }, h("li", { key: '5fbd7893982b9bd85dd0bec9ae0ced8fa254b01c' }, h("a", { key: '9ae82c6cad2c9d97a479407a8c1a2b7db451ba6e', href: "https://www.upenn.edu/" }, "UPenn")), h("li", { key: '9a312ef71677395ae9e36140b50f26283e463e1f' }, h("a", { key: '34881d92dd5bafaddda98f492e531663993ebcb5', href: "https://www.upenn.edu/about/privacy-policy" }, "Privacy Policy")), h("li", { key: 'be80ff6346e925d3d4ca73148cab8f87e9eafc00' }, h("a", { key: '1aa4f3965db242abaaea538a6c3d5a5358215348', href: "https://accessibility.web-resources.upenn.edu/get-help" }, "Report Accessibility Issues and Get Help")), h("li", { key: '4f6e9174acdf75d75b8beefc12950fee8d185f94' }, h("a", { key: '81b1a21a40057f8b1bb66efdd6fc264ebf132370', href: "https://www.upenn.edu/about/disclaimer" }, "Disclaimer")), h("li", { key: 'd9054f8cb3a387947a75e0ce686401d43fbfac9a' }, h("a", { key: '2bf7344740a7418eb68170b46afdb5eefc73dae3', href: "https://www.publicsafety.upenn.edu/contact/" }, "Emergency Services")), h("li", { key: 'c6962c1ea1e96c351da514ac41eb7782a79d3c22' }, h("a", { key: '0fd6ebe891954438f46c0265366a69ae319c2b7e', href: "https://www.upenn.edu/about/report-copyright-infringement" }, "Report Copyright Infringement"))))))));
319
+ ]))), h("div", { key: '3a48e365b66300beeb261d3c14e8d98e7565373d', class: "website-footer__footer" }, h("div", { key: '699738c3f57f35796a1f4397a6fada44eaaa1683', class: "viewport-margins" }, h("ul", { key: 'c88fb2fb6bbc3fc5eb13664f7288d7afe3ec7e57', class: "website-footer__links website-footer__links--footer" }, h("li", { key: '8c3ecc9499cb5fdf180906d2d681eba515dae399' }, h("a", { key: 'ae916ed72fc00e93f0e9c73b49878c75790a0227', href: "https://www.upenn.edu/" }, "UPenn")), h("li", { key: 'c5a51aabc04937e09ae3df7c0fe13fbb9ff9b0d8' }, h("a", { key: '359a6693330af0a701ff2e9a13fffb9e5ca573b6', href: "https://www.upenn.edu/about/privacy-policy" }, "Privacy Policy")), h("li", { key: '1e323f9c47a94933f48abaf0c1c5fef1479a1395' }, h("a", { key: '55dde719bb09dc79fc158f931adaf2b1926120c9', href: "https://accessibility.web-resources.upenn.edu/get-help" }, "Report Accessibility Issues and Get Help")), h("li", { key: 'e83955780f877039da38ddd946fd9ab0455812e1' }, h("a", { key: '7ed5e27e6f6ea677a35c7f3e78dba2e72f629488', href: "https://www.upenn.edu/about/disclaimer" }, "Disclaimer")), h("li", { key: 'cd28d78bec76cc13e0272cbb30e11bcde6459cb9' }, h("a", { key: 'a6a64d9949ea4cbbc8f90703d886e83dd9f0df9b', href: "https://www.publicsafety.upenn.edu/contact/" }, "Emergency Services")), h("li", { key: 'cbc668f7728653b15748a8488f9694c632884d6f' }, h("a", { key: 'b681b57236ee23c3be9c85c4f199ef7f4c66b607', href: "https://www.upenn.edu/about/report-copyright-infringement" }, "Report Copyright Infringement"))))))));
121
320
  }
122
321
  static get assetsDirs() { return ["assets"]; }
123
322
  get hostElement() { return getElement(this); }
@@ -190,68 +389,14 @@ const Header = class {
190
389
  return (h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, h("path", { fill: "currentColor", d: "M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z" })));
191
390
  }
192
391
  render() {
193
- return (h("header", { key: 'b0f71640bc4b1fb494f78cac49c3f7383ab80aad', class: `viewport-margins website-header ${this.theme === 'dark' && 'website-header--dark'}` }, h("div", { key: '5492827910960ab2ccb95879d512ef9b029ec852', class: "website-header__inner-container" }, h("div", { key: '298b7f9aa12d67009b61ff5df6215117943e2d6c', class: "website-header__logo-name-container" }, h("a", { key: '2664b772fda1ea60ba2fbe84a4383faee5111dce', href: "https://www.library.upenn.edu/", class: "website-header_logo-link", "aria-label": "Penn Libraries" }, this.theme === 'dark' ? h(LogoWhite, null) : h(LogoBlue, null)), this.serviceName && (h("a", { key: '6310df5c59a848778bc9fa7525ca43eb0b40acdf', href: "/", class: "website-header__service-link" }, h("span", { key: '55b750954e5576380e0341bc6506db961644593b', class: "website-header__service-name" }, this.serviceName), this.serviceLede && h("span", { key: '3cf6efc9e14dd0e3aa9ca5f18d87ebe8ed0f3a55', class: "website-header__service-lede" }, this.serviceLede))), h("slot", { key: 'd549e890b64cf848f2a9854d9e8e27af372d4d13', name: "name-end" })), this.navigation.length > 0 && (h("nav", { key: '3577977564128734899f3725454ab405bab1524d', class: "website-header__navigation" }, h("button", { key: '5f6d6d8c3f9428741d8920ba402e5427b450c9be', class: "website-header__navigation-button", "aria-expanded": `${this.isMenuOpen}`, onClick: () => this.handleToggleMenu() }, this.renderMenuIcon(), " Menu"), this.navigation && (h("ol", { key: '73c47406768a97690b06b18f84acc3822a646b12', class: `website-header__navigation-list ${this.isMenuOpen && 'website-header__navigation-list--visible'}` }, this.navigation.map(element => h("li", { innerHTML: element.outerHTML })))))), h("slot", { key: '28c4bae6cd0c86909c991a501cc5e7e1cb94b73c', name: "end" }))));
392
+ return (h("header", { key: '7764d8c5041a19eba4786e6469e6b915066523da', class: `viewport-margins website-header ${this.theme === 'dark' && 'website-header--dark'}` }, h("div", { key: 'f7ab412767f5cf4e8d4cb9c1c05e969ece062927', class: "website-header__inner-container" }, h("div", { key: '55a8d55b15be439e772c59bd6fb1d6d34cf073f3', class: "website-header__logo-name-container" }, h("a", { key: 'edb380951b11d45b9b61b39253eebf0df32131de', href: "https://www.library.upenn.edu/", class: "website-header_logo-link", "aria-label": "Penn Libraries" }, this.theme === 'dark' ? h(LogoWhite, null) : h(LogoBlue, null)), this.serviceName && (h("a", { key: '036d3e3eac035f8eb8c8999892bc3322f5171e05', href: "/", class: "website-header__service-link" }, h("span", { key: '8d8ae853e2ce7ef8713226317260c2fdd79ae11b', class: "website-header__service-name" }, this.serviceName), this.serviceLede && h("span", { key: '5c878d5bb98689268362d76cdf04db42d7444560', class: "website-header__service-lede" }, this.serviceLede))), h("slot", { key: '3370137e9c3099f534c890d7422608fcf8bae09a', name: "name-end" })), this.navigation.length > 0 && (h("nav", { key: '50751b716f9600691093ace08e2c90a92a2274c5', class: "website-header__navigation" }, h("button", { key: 'e57793641ed5d314f1fec03821586d71cc82d889', class: "website-header__navigation-button", "aria-expanded": `${this.isMenuOpen}`, onClick: () => this.handleToggleMenu() }, this.renderMenuIcon(), " Menu"), this.navigation && (h("ol", { key: '8c6f479cf0da87a289593fceab55a4ce1436b146', class: `website-header__navigation-list ${this.isMenuOpen && 'website-header__navigation-list--visible'}` }, this.navigation.map(element => h("li", { innerHTML: element.outerHTML })))))), h("slot", { key: '04edf00df086103b723f3e2bcf2241aa7a4624f2', name: "end" }))));
194
393
  }
195
394
  static get assetsDirs() { return ["assets"]; }
196
395
  get hostElement() { return getElement(this); }
197
396
  };
198
397
  Header.style = pennlibsHeaderCss;
199
398
 
200
- const pennlibsHeroCss = ":host{--pl-hero-height:clamp(42vh, 32rem, 26rem);--pl-hero-heading-font:var(--pl-font-serif);--pl-hero-color:var(--pl-color-fg-on-emphasis)}*,*:before,*:after{box-sizing:inherit}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.viewport-margins{width:100%;max-width:var(--pl-viewport-margins-max-width);margin:0 auto;padding:0 var(--pl-viewport-margins-gutter, 1em)}.hero{position:relative;min-height:var(--pl-hero-height);height:100%;background-size:cover;background-repeat:no-repeat;background-position:50% 33%;display:flex}.hero::before{content:\"\";display:flex;width:100%;height:100%;top:0;position:absolute;background:linear-gradient(360deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 20%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.05) 100%);z-index:0}.hero::after{content:\"\";display:flex;width:100%;height:100%;top:0;position:absolute;background:linear-gradient(180deg, rgba(1, 31, 91, 1) 0%, rgba(1, 31, 91, 0.9) 10%, rgba(1, 31, 91, 0.8) 20%, rgba(1, 31, 91, 0.1) 50%, rgba(1, 31, 91, 0.0) 100%);z-index:0}.hero__content{position:relative;display:flex;flex-direction:column;width:100%;z-index:1}.hero__heading-container{margin-top:auto;padding-top:var(--pl-space-3xl);padding-bottom:var(--pl-space-3xl)}.hero__heading{text-shadow:1px 1px 2px var(--pl-color-fg-default);line-height:1.1;font-size:3em;font-weight:bold;font-family:var(--pl-hero-heading-font);text-wrap:pretty;max-width:30ch;margin:0;color:var(--pl-hero-color)}@media (max-width: 920px){.hero__heading{font-size:2.5em}}.hero__sub-heading{font-size:1.25em;font-family:var(--pl-font-family);font-weight:500;color:var(--pl-hero-color);max-width:52ch;text-wrap:pretty;margin-top:1em;margin-bottom:0}.hero__sub-heading a{text-decoration:underline;text-underline-offset:var(--pl-link-text-underline-offset);text-decoration-thickness:var(--pl-link-text-decoration-thickness);color:var(--pl-hero-color)}.hero__sub-heading a:hover{text-decoration-thickness:var(--pl-link-hover-text-decoration-thickness)}.hero__sub-heading strong{font-weight:bold}@media (max-width: 620px){.hero__heading{font-size:2.75em}.hero__sub-heading{font-size:1em}}";
201
-
202
- const getCurrentImageSource = (pictureElement) => {
203
- const imgElement = pictureElement.querySelector('img');
204
- return (imgElement === null || imgElement === void 0 ? void 0 : imgElement.currentSrc) || '';
205
- };
206
- const Hero = class {
207
- constructor(hostRef) {
208
- registerInstance(this, hostRef);
209
- this.heroPictureElement = null;
210
- this.heroHeadingElement = null;
211
- this.heroParagraphElement = null;
212
- this.heroSrc = "";
213
- this.lastSrc = "";
214
- }
215
- componentWillLoad() {
216
- const heroPictureElement = this.hostElement.querySelector('picture[hero=art-direction]');
217
- if (heroPictureElement) {
218
- this.heroPictureElement = heroPictureElement;
219
- this.startWatchingCurrentSrc(heroPictureElement);
220
- }
221
- const heroHeadingElement = this.hostElement.querySelector('h1[hero=heading]');
222
- if (heroHeadingElement) {
223
- this.heroHeadingElement = heroHeadingElement;
224
- }
225
- const heroParagraphElement = this.hostElement.querySelector('p[hero=sub-heading]');
226
- if (heroParagraphElement) {
227
- this.heroParagraphElement = heroParagraphElement;
228
- }
229
- }
230
- startWatchingCurrentSrc(pictureElement) {
231
- const checkCurrentSrc = () => {
232
- const currentSrc = getCurrentImageSource(pictureElement);
233
- if (currentSrc !== this.lastSrc) {
234
- this.lastSrc = currentSrc;
235
- this.heroSrc = currentSrc;
236
- }
237
- this.animationFrameId = requestAnimationFrame(checkCurrentSrc);
238
- };
239
- this.animationFrameId = requestAnimationFrame(checkCurrentSrc);
240
- }
241
- disconnectedCallback() {
242
- if (this.animationFrameId) {
243
- cancelAnimationFrame(this.animationFrameId);
244
- }
245
- }
246
- render() {
247
- return (h("div", { key: '284eede0a201fc23f19af63ce875cf82514c007f', class: "hero", style: { backgroundImage: `url(${this.heroSrc})` } }, h("div", { key: '6d1643211563e173e20be38fa480d622a2e08d9b', class: "hero__content" }, h("slot", { key: 'd5905b079db6367dd6c917588d76c3bc949cc078', name: "start" }), h("div", { key: 'ecfbcb172bfb018ede01a1773ce12f135dac60f6', class: "hero__heading-container" }, this.heroHeadingElement && (h("div", { key: 'fd285ee37293132a02b03c70eb53b31fde007c7e', class: "viewport-margins" }, h("h1", { key: '3d71930c47c9c5d6a64c240847407953f424dac2', class: "hero__heading", innerHTML: this.heroHeadingElement.innerText }), this.heroParagraphElement && h("p", { key: '828d2a13daa5ae92c1591d0ea00ee8e91ab4f6cf', class: "hero__sub-heading", innerHTML: this.heroParagraphElement.innerHTML })))))));
248
- }
249
- static get assetsDirs() { return ["assets"]; }
250
- get hostElement() { return getElement(this); }
251
- };
252
- Hero.style = pennlibsHeroCss;
253
-
254
- export { Chat as pennlibs_chat, NoImage as pennlibs_fallback_img, PennlibsFeedback as pennlibs_feedback, Footer as pennlibs_footer, Header as pennlibs_header, Hero as pennlibs_hero };
255
- //# sourceMappingURL=pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.js.map
399
+ export { AllowTracking as pennlibs_allow_tracking, Autocomplete as pennlibs_autocomplete, Footer as pennlibs_footer, Header as pennlibs_header };
400
+ //# sourceMappingURL=pennlibs-allow-tracking.pennlibs-autocomplete.pennlibs-footer.pennlibs-header.entry.js.map
256
401
 
257
- //# sourceMappingURL=pennlibs-chat_6.entry.js.map
402
+ //# sourceMappingURL=pennlibs-allow-tracking_4.entry.js.map