@playpilot/tpi 5.3.0 → 5.3.1
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/dist/link-injections.js +9 -9
- package/package.json +1 -1
- package/src/lib/array.ts +11 -0
- package/src/lib/linkInjection.ts +19 -5
- package/src/lib/text.ts +27 -1
- package/src/routes/+layout.svelte +3 -0
- package/src/tests/lib/array.test.js +51 -1
- package/src/tests/lib/linkInjection.test.js +18 -0
- package/src/tests/lib/text.test.js +46 -1
package/dist/link-injections.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.button.svelte-1qqv88o{display:flex;align-items:center;justify-content:center;flex:0 0 var(--size);width:var(--size);height:var(--size);border-radius:50%;border:0;padding:var(--playpilot-button-padding, 0);background:var(--playpilot-button-background, var(--playpilot-content));box-shadow:var(--playpilot-button-shadow, var(--playpilot-shadow));color:var(--playpilot-button-text-color, var(--playpilot-text-color-alt));cursor:pointer;transition:transform 50ms}.button.svelte-1qqv88o:hover{filter:brightness(1.2);transform:scale(1.05)}.modal.svelte-aqwna4{z-index:2147483647;box-sizing:border-box;position:fixed;display:flex;justify-content:center;align-items:flex-start;top:0;left:0;width:100%;height:100%;background:var(--playpilot-detail-backdrop, rgba(0, 0, 0, .65))}@media (min-width: 600px){.modal.svelte-aqwna4{padding:32px}}.dialog.svelte-aqwna4{z-index:1;position:relative;width:100%;max-width:600px;max-height:80vh;overflow:auto;margin-top:auto;border-radius:var(--playpilot-detail-border-radius, 16px 16px 0 0);background:var(--playpilot-detail-background, var(--playpilot-light))}@media (min-width: 600px){.dialog.svelte-aqwna4{margin-top:0;border-radius:var(--playpilot-detail-border-radius, 16px);max-height:100%}}.backdrop.svelte-aqwna4{z-index:0;position:absolute;top:0;right:0;bottom:0;left:0}.close.svelte-aqwna4{--playpilot-button-background: var(--playpilot-modal-close-button-background, var(--playpilot-content));--playpilot-button-shadow: var(--playpilot-modal-close-button-shadow, var(--playpilot-shadow));--playpilot-button-padding: var(--playpilot-modal-close-button-padding, .5rem);--playpilot-button-text-color: var(--playpilot-modal-close-button-text-color, var(--playpilot-text-color-alt));z-index:5;position:absolute;top:16px;right:16px}.close.svelte-aqwna4:hover{filter:brightness(1.1)}.genre.svelte-1ebula3{display:flex;flex-wrap:wrap;background:var(--playpilot-genre-background, var(--playpilot-content));border:0;border-radius:var(--playpilot-genre-border-radius, 16px);padding:4px 8px;font-family:var(--playpilot-genre-font-family, inherit);font-weight:var(--playpilot-genre-font-weight, inherit);text-transform:var(--playpilot-genre-text-transform, none);color:var(--playpilot-genre-text-color, var(--playpilot-text-color-alt));line-height:1;font-size:inherit}.genre.svelte-1ebula3:is(button:where(.svelte-1ebula3)):hover{cursor:pointer;filter:var(--playpilot-genre-hover-filter, brightness(1.1));background:var(--playpilot-genre-hover-background, var(--playpilot-genre-background, var(--playpilot-content)))}img.svelte-g63n1y{--size: 32px;height:var(--size);width:var(--size);border-radius:8px;background:#00000040}@media (min-width: 640px){img.svelte-g63n1y{--size: 40px}}.heading.svelte-g63n1y{margin:0;color:var(--playpilot-playlinks-title-color, var(--playpilot-text-color-alt));font-family:var(--playpilot-playlinks-title-font-family, inherit);font-weight:var(--playpilot-playlinks-title-font-weight, lighter);font-size:var(--playpilot-playlinks-title-font-size, 14px);line-height:normal}.playlinks.svelte-g63n1y{box-sizing:border-box;display:flex;gap:8px;width:calc(100% + 32px);padding:8px 16px;margin:0 -16px;overflow:auto;scrollbar-width:none}.playlinks.svelte-g63n1y::-webkit-scrollbar{display:none}.list.svelte-g63n1y{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}@media (min-width: 640px){.list.svelte-g63n1y img:where(.svelte-g63n1y){--size: 32px}}.playlink.svelte-g63n1y{position:relative;display:flex;align-items:center;gap:12px;padding:12px;background:var(--playpilot-playlink-background, var(--playpilot-lighter));box-shadow:var(--playpilot-playlink-shadow, var(--playpilot-shadow));border-radius:var(--playpilot-playlink-border-radius, 8px);color:var(--playpilot-playlink-text-color, var(--playpilot-text-color-alt))!important;font-weight:var(--playpilot-playlink-font-weight, inherit);font-style:var(--playpilot-playlink-font-style, normal)!important;text-decoration:none!important;white-space:nowrap;font-size:var(--playpilot-playlinks-font-size, 12px);line-height:1}.playlink.svelte-g63n1y:hover,.playlink.svelte-g63n1y:active{filter:var(--playpilot-playlink-hover-filter, brightness(1.1));background:var(--playpilot-playlink-hover-background, var(--playpilot-playlink-background, var(--playpilot-lighter)))!important;text-decoration:none!important}.playlink.highlighted.svelte-g63n1y:before{content:"";z-index:1;display:block;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;box-shadow:inset 0 0 0 2px currentColor;opacity:.35;pointer-events:none}.playlink.svelte-g63n1y img:where(.svelte-g63n1y){margin:0}.list.svelte-g63n1y .playlink:where(.svelte-g63n1y){padding:8px;gap:8px}.name.svelte-g63n1y{font-weight:var(--playpilot-playlink-font-weight, inherit);font-family:var(--playpilot-playlink-font-family, inherit)}.category.svelte-g63n1y{margin-top:var(--playpilot-playlinks-category-margin, 8px);font-size:var(--playpilot-playlinks-category-font-size, 10px);color:var(--playpilot-playlink-category-text-color, var(--playpilot-text-color));font-weight:var(--playpilot-playlink-category-font-weight, inherit);font-family:var(--playpilot-playlink-category-font-family, inherit)}.empty.svelte-g63n1y{white-space:initial;line-height:1.35}.arrow.svelte-g63n1y{display:flex;margin-left:auto;padding:0 8px}.paragraph.svelte-1u3je71{display:block;margin:16px 0 0}.show-more.svelte-1u3je71{display:inline;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;background:transparent;border:0;color:var(--playpilot-read-more-text-color, var(--playpilot-text-color-alt));font-weight:var(--playpilot-read-more-font-weight, inherit);font-family:inherit;font-size:inherit}.show-more.svelte-1u3je71:hover{text-decoration:underline;text-decoration-thickness:2px;cursor:pointer}.heading.svelte-1026zg0{margin:8px 0;color:var(--playpilot-detail-title-text-color, #fff);font-family:var(--playpilot-detail-title-font-family, inherit);font-weight:var(--playpilot-detail-title-font-weight, lighter);font-size:var(--playpilot-detail-title-font-size, 24px);line-height:normal;font-style:var(--playpilot-detail-title-font-style, normal)}.small.svelte-1026zg0 .heading:where(.svelte-1026zg0){font-size:var(--playpilot-detail-title-font-size-small, 18px)}.compact.svelte-1026zg0 .heading:where(.svelte-1026zg0){margin-top:0}.content.svelte-1026zg0{z-index:1;position:relative;padding:16px;color:var(--playpilot-detail-text-color, var(--playpilot-text-color));font-family:var(--playpilot-detail-font-family, var(--playpilot-font-family));font-weight:var(--playpilot-detail-font-weight, normal);font-size:var(--playpilot-detail-font-size, 14px);line-height:normal;font-style:normal}.content.svelte-1026zg0 ::view-transition-old(content),.content.svelte-1026zg0 ::view-transition-new(content){height:100%}.content.small.svelte-1026zg0{font-size:var(--playpilot-detail-font-size, 12px);line-height:1.45;padding-bottom:8px}.header.svelte-1026zg0{padding:32px 0 16px;background:transparent}.small.svelte-1026zg0 .header:where(.svelte-1026zg0){padding-top:16px}.compact.svelte-1026zg0 .header:where(.svelte-1026zg0){padding:0 0 16px}.top.svelte-1026zg0{display:flex;justify-content:space-between;align-items:flex-end}.poster.svelte-1026zg0{display:block;width:72px;margin:0;aspect-ratio:2/3;border-radius:var(--playpilot-detail-image-border-radius, 8px);background:var(--playpilot-detail-image-background, var(--playpilot-content));box-shadow:var(--playpilot-detail-image-shadow, var(--playpilot-shadow));opacity:0}.poster.loaded.svelte-1026zg0{opacity:1}.info.svelte-1026zg0{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}.small.svelte-1026zg0 .info:where(.svelte-1026zg0){gap:8px 12px}.imdb.svelte-1026zg0{display:flex;align-items:center;gap:4px}.imdb.svelte-1026zg0 svg{margin-top:-2px}.small.svelte-1026zg0 .imdb:where(.svelte-1026zg0) svg{margin-top:0;width:12px;height:12px}.background.svelte-1026zg0{position:absolute;top:0;left:0;width:100%;height:192px;overflow:hidden;background:var(--playpilot-detail-background, var(--playpilot-lighter));z-index:0}.background.svelte-1026zg0:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(to top,var(--playpilot-detail-background, var(--playpilot-light)),transparent 40%);z-index:1}.background.svelte-1026zg0 img:where(.svelte-1026zg0){width:100%;height:100%;object-fit:cover;object-position:center;margin:0;opacity:0;z-index:0}.background.svelte-1026zg0 img.loaded:where(.svelte-1026zg0){opacity:1}.background.svelte-1026zg0 img.blur:where(.svelte-1026zg0){opacity:.5;transform:scale(1.1);filter:blur(.75rem)}.faded.svelte-1026zg0{opacity:.15}.capitalize.svelte-1026zg0{text-transform:capitalize}.truncate.svelte-1026zg0{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.popover.svelte-tb2xdq{--offset: 8px;position:absolute;top:calc((var(--offset) - 1px) * -1);left:0;width:calc(100vw - 32px);max-width:320px;padding:var(--offset) 0;transform:translateY(calc(-100% + var(--offset)));z-index:2147483647}.popover.flip.svelte-tb2xdq{top:auto;bottom:calc(var(--offset) + 1px);transform:translateY(calc(100% + var(--offset)))}.dialog.svelte-tb2xdq{cursor:default;position:relative;border-radius:var(--playpilot-popover-border-radius, 16px);background:var(--playpilot-popover-background, var(--playpilot-light));box-shadow:var(--playpilot-popover-shadow, var(--playpilot-shadow-large));max-height:min(var(--max-height),560px);scrollbar-width:thin;overflow-y:overlay;overflow-x:hidden;view-transition-name:playpilot-title-content}.title-popover.svelte-d86q0q{position:absolute}p.svelte-pfvkex{font-weight:var(--playpilot-after-article-text-font-weight, normal)}span.svelte-pfvkex{display:block}button.svelte-pfvkex{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--playpilot-after-article-button-padding, 4px 12px);margin:var(--playpilot-after-article-button-margin, 4px 0 0);background:var(--playpilot-after-article-button-background, transparent);border:var(--playpilot-after-article-button-border, 2px solid currentColor);border-radius:var(--playpilot-after-article-button-border-radius, 16px);color:var(--playpilot-after-article-button-text-color, inherit);font-weight:var(--playpilot-after-article-button-font-weight, bold);font-size:var(--playpilot-after-article-button-font-size, 16px);cursor:pointer;transition:all 50ms}button.svelte-pfvkex:hover{background:var(--playpilot-after-article-button-background-hover, transparent);border:var(--playpilot-after-article-button-border-hover, 2px solid currentColor);color:var(--playpilot-after-article-button-text-color-hover, inherit);transform:var(--playpilot-after-article-button-transform-hover, scale(1.02))}svg.svelte-by11ix{transition:transform .1s}.expanded.svelte-by11ix{transform:rotate(180deg)}.switch.svelte-91s87b{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;align-items:center;border:0;padding:0;background:transparent;cursor:pointer}.fullwidth.svelte-91s87b{width:100%;justify-content:space-between}.label.svelte-91s87b{display:flex;align-items:center;gap:8px;margin-right:8px;font-family:var(--playpilot-font-family);color:var(--playpilot-text-color-alt);font-size:12px}.switch.svelte-91s87b:hover .label:where(.svelte-91s87b){color:var(--playpilot-text-color)}.track.svelte-91s87b{position:relative;width:32px;height:20px;border-radius:16px;background:var(--playpilot-content);transition:background-color .1s}.active.svelte-91s87b .track:where(.svelte-91s87b){background:var(--playpilot-green)}.knob.svelte-91s87b{position:absolute;top:2px;left:2px;height:16px;width:16px;border-radius:50%;background:#fff;transition:left .1s}.active.svelte-91s87b .knob:where(.svelte-91s87b){left:14px}input.svelte-1vrer3i{width:100%;padding:8px 16px;border:0;border-radius:32px;background:var(--playpilot-light);color:var(--playpilot-text-color-alt);font-size:12px;font-family:var(--playpilot-font-family)}input.svelte-1vrer3i:focus{background:var(--playpilot-lighter);outline:1px solid white}input.svelte-1vrer3i::placeholder{color:var(--playpilot-text-color-alt);opacity:.75}.alert.svelte-df5n87{padding:8px;border-radius:8px;border:1px solid var(--playpilot-error);background:var(--playpilot-error-dark);font-size:12px;font-family:var(--playpilot-font-family)}.alert.warning.svelte-df5n87{border-color:var(--playpilot-warning);background:var(--playpilot-warning-dark)}.alert.fixed.svelte-df5n87{position:fixed;bottom:1rem;right:1rem;width:80%;max-width:25rem}.alert.svelte-df5n87 a{color:currentColor}.switches.svelte-1shw34x{display:flex;flex-direction:column;gap:12px}button.svelte-1shw34x{z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:32px;padding:8px;background:transparent;font-family:var(--playpilot-font-family);font-size:10.4px;color:var(--playpilot-text-color-alt);cursor:pointer}button.svelte-1shw34x:hover,button.active.svelte-1shw34x{color:var(--playpilot-text-color)}.group.svelte-1shw34x{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;padding:4px;border:0;border-radius:32px;background:var(--playpilot-light);color:var(--playpilot-text-color-alt);font-size:12px;font-family:var(--playpilot-font-family)}.active-marker.svelte-1shw34x{z-index:0;position:absolute;width:calc(50% - 8px);height:calc(100% - 8px);left:4px;top:4px;border-radius:32px;background:var(--playpilot-content);transition:left .1s}.right.svelte-1shw34x{left:calc(50% + 4px)}.label.svelte-1shw34x{margin:10.8px 0 4px;opacity:.75;font-size:10.8px;color:var(--playpilot-text-color-alt)}.alert.svelte-1shw34x{margin-top:8px}button.svelte-zpsd2z{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;border-radius:4px;background:transparent;color:var(--playpilot-text-color-alt)}button.svelte-zpsd2z:hover{cursor:pointer;color:#fff}.context-menu.svelte-zpsd2z{position:relative}.content.svelte-zpsd2z{z-index:1;position:absolute;top:100%;right:0;max-width:240px;border-radius:8px;background:var(--playpilot-lighter)}select.svelte-o5qkco{background:var(--playpilot-content);padding:8px 16px;width:100%;border:0;border-radius:8px;color:var(--playpilot-text-color);font-family:inherit;font-size:13.6px}option.svelte-o5qkco:hover,option.svelte-o5qkco:active,option.svelte-o5qkco:checked{background-color:var(--playpilot-content-light);font-weight:700}.form.svelte-o5qkco{padding:32px;font-family:var(--playpilot-font-family);color:var(--playpilot-text-color)}.heading.svelte-o5qkco{font-size:20px}.info.svelte-o5qkco{margin:16px 0;font-size:13.6px;color:var(--playpilot-text-color-alt)}.info.svelte-o5qkco strong:where(.svelte-o5qkco){color:var(--playpilot-text-color)}.submit.svelte-o5qkco{margin-top:16px;padding:8px 16px;border:0;border-radius:32px;background:var(--playpilot-green);box-shadow:var(--playpilot-shadow);font-family:inherit;color:var(--playpilot-text-color);font-size:13.6px;cursor:pointer}.submit[disabled].svelte-o5qkco{background:var(--playpilot-content);color:var(--playpilot-text-color-alt);box-shadow:none;opacity:.5;cursor:default}.sent.svelte-o5qkco{margin-top:16px;padding:8px 0;color:var(--playpilot-green);font-size:13.6px}.item.svelte-lo6h85{padding:16px 8px;border-bottom:1px solid var(--playpilot-lighter);transition:outline-offset .1s}.item.svelte-lo6h85:hover,.item.highlighted.svelte-lo6h85{border-radius:8px;border-color:transparent;outline:2px solid var(--playpilot-content);outline-offset:1px}.item.highlighted.svelte-lo6h85{outline:2px solid var(--playpilot-primary)}.header.svelte-lo6h85{display:flex;gap:16px;width:100%}.poster.svelte-lo6h85{display:block;width:32px;height:48px;border-radius:4px;background:var(--playpilot-content)}.inactive.svelte-lo6h85 .poster:where(.svelte-lo6h85){opacity:.35}.title.svelte-lo6h85{font-size:14px;word-break:break-word}.sentence.svelte-lo6h85{font-size:.7em;line-height:150%;margin-right:-8px;color:var(--playpilot-text-color-alt);opacity:.75}.sentence.svelte-lo6h85 em{color:var(--playpilot-text-color);font-weight:700}.expand-sentence.svelte-lo6h85{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;margin:0;background:transparent;font-family:inherit;color:inherit;font-size:inherit;line-height:inherit;font-style:italic;text-decoration:underline}.expand-sentence.svelte-lo6h85:hover{color:var(--playpilot-text-color)}.content.svelte-lo6h85{padding-top:8px}.inactive.svelte-lo6h85 .info:where(.svelte-lo6h85){opacity:.35}.context-menu.svelte-lo6h85{margin:0 -4px 0 auto}.context-menu-action.svelte-lo6h85{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;padding:8px 16px;width:100%;text-align:left;font-family:inherit;white-space:nowrap;color:var(--playpilot-text-color-alt);cursor:pointer}.context-menu-action.svelte-lo6h85:hover{color:var(--playpilot-text-color);background-color:var(--playpilot-content-light)}.context-menu-action.svelte-lo6h85:first-child{margin-top:8px}.context-menu-action.svelte-lo6h85:last-child{margin-bottom:8px}.actions.svelte-lo6h85{display:flex;align-items:center;justify-content:space-between;width:100%}.expand.svelte-lo6h85{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:50%;background:var(--playpilot-content);color:var(--playpilot-text-color);box-shadow:var(--playpilot-shadow);cursor:pointer}.expand.svelte-lo6h85:hover{filter:brightness(1.2)}.expanded.svelte-lo6h85{padding-top:16px}.type-select.svelte-lo6h85{margin-top:8px}.label.svelte-lo6h85{margin-bottom:4px;opacity:.75;font-size:10.8px;color:var(--playpilot-text-color-alt)}.offset.svelte-lo6h85{margin-top:12px}.warning.svelte-lo6h85{margin:0 auto 0 8px}.warning.svelte-lo6h85 svg{display:block}.drag-handle.svelte-19mcc5g{z-index:10;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;top:8px;left:30%;width:40%;height:16px;background:transparent;border:0;cursor:grab}.drag-handle.svelte-19mcc5g:hover:before{opacity:.65;transform:scale(1.05)}.drag-handle.svelte-19mcc5g:active:before{opacity:.9;transform:scale(.95)}.drag-handle.svelte-19mcc5g:active{cursor:grabbing}.drag-handle.svelte-19mcc5g:before{display:block;content:"";position:absolute;top:20%;right:0;bottom:60%;left:0;border-radius:16px;background:var(--playpilot-text-color);opacity:.15;transition:opacity .1s,transform 50ms}.resize-handle.svelte-sxkuxk{z-index:10;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;top:0;left:0;width:100%;height:8px;background:transparent;border:0;cursor:ns-resize}.resize-handle.svelte-sxkuxk:hover:before{opacity:.65;transform:scale(1.05)}.resize-handle.svelte-sxkuxk:active:before{opacity:.9;transform:scale(.95)}.resize-handle.svelte-sxkuxk:active{cursor:grabbing}.resize-handle.svelte-sxkuxk:before{display:block;content:"";position:absolute;top:0;right:20%;left:20%;bottom:80%;border-radius:0 0 16px 16px;background:var(--playpilot-text-color);opacity:.15;transition:opacity .1s,transform 50ms}.item.svelte-rjq94e{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;align-items:flex-start;gap:16px;width:100%;background:transparent;border:0;padding:8px;border-bottom:1px solid var(--playpilot-content);color:var(--playpilot-text-color-alt);font-family:inherit;text-align:left;font-size:13.6px}.item.hoverable.svelte-rjq94e{cursor:pointer}.item.hoverable.svelte-rjq94e:hover{background:var(--playpilot-lighter)}.item.svelte-rjq94e:last-child{border-bottom:0}.poster.svelte-rjq94e{flex:0 0 auto;height:auto;width:28px;aspect-ratio:28/42;border-radius:4px;background:var(--playpilot-content)}.name.svelte-rjq94e{color:var(--playpilot-text-color)}.meta.svelte-rjq94e{display:flex;flex-wrap:wrap;gap:0 8px;font-size:12px}.imdb.svelte-rjq94e{display:flex;align-items:center;gap:4px}.open-in-new-tab.svelte-rjq94e{margin-left:auto;color:var(--playpilot-text-color-alt)}.open-in-new-tab.svelte-rjq94e:hover{color:vaR(--playpilot-text-color)}.search.svelte-1olb8n0{position:relative}.results.svelte-1olb8n0{z-index:1;position:absolute;top:calc(100% + 8px);left:0;right:0;height:30vh;max-height:160px;border-radius:8px;background:var(--playpilot-light);scrollbar-width:thin;overflow:auto}.empty.svelte-1olb8n0{padding:8px;font-size:12px;color:var(--playpilot-text-color-alt)}.selected.svelte-1olb8n0{margin:8px 0;border-radius:.5rem;border:2px solid var(--playpilot-green)}p.svelte-1i8p6op,label.svelte-1i8p6op{font-size:12px;max-width:240px;color:var(--playpilot-text-color-alt)}label.svelte-1i8p6op{display:block;margin-top:16px}.layout.svelte-1i8p6op{height:100%;display:flex;flex-direction:column;margin:0}.header.svelte-1i8p6op{display:flex;align-items:center;gap:8px;margin-bottom:16px}.heading.svelte-1i8p6op{margin:0;color:var(--playpilot-text-color);font-size:16px;line-height:normal;font-weight:400}.error.svelte-1i8p6op{margin-top:8px}.save.svelte-1i8p6op{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;margin-top:auto;padding:8px;border:0;border-radius:32px;background:var(--playpilot-green);transition:opacity .1s;font-family:inherit;color:var(--playpilot-text-color)}.save.svelte-1i8p6op:not([disabled]):hover{outline:2px solid currentColor}.save[disabled].svelte-1i8p6op{cursor:default;background:var(--playpilot-light);opacity:.5;color:var(--playpilot-text-color-alt)}p.svelte-2m2urs{margin:0 0 8px}.alert.svelte-2m2urs{margin:0 8px}.button.svelte-2m2urs{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;padding:4px;border:0;border-radius:4px;background:var(--playpilot-warning);transition:opacity .1s;font-family:inherit;color:var(--playpilot-dark);font-size:.85rem;cursor:pointer}.button.svelte-2m2urs:hover{background:#fff}a.svelte-1kpafo0{color:currentColor}p.svelte-1kpafo0{margin:0}.ai-indicator.svelte-1kpafo0{position:relative;margin:0 8px}.content.svelte-1kpafo0{position:relative;display:flex;gap:8px;background:var(--playpilot-light);padding:8px;margin:2px;border-radius:.5rem;font-size:12px;line-height:1.5;z-index:1;color:var(--playpilot-text-color-alt);overflow:hidden}.message.svelte-1kpafo0{display:flex;margin-top:4px;font-style:italic}.icon.svelte-1kpafo0{color:var(--playpilot-green)}.border.svelte-1kpafo0{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:.5rem;background:var(--playpilot-green);overflow:hidden;transition:background-color .5s}.running.svelte-1kpafo0 .border:where(.svelte-1kpafo0){background:var(--playpilot-light)}@keyframes svelte-1kpafo0-rotate{to{rotate:360deg}}.animator.svelte-1kpafo0{position:absolute;left:50%;top:50%;transform:translateY(-50%);width:100%;height:20rem;background:var(--playpilot-green);transform-origin:left 50%;animation:svelte-1kpafo0-rotate 2s infinite linear;filter:blur(5rem)}.loading-bar.svelte-1kpafo0{display:grid;grid-template-columns:auto 3em;align-items:center}.loading-bar-progress.svelte-1kpafo0{height:.5em;border-radius:.25rem;background:var(--playpilot-dark)}.loading-bar-fill.svelte-1kpafo0{height:100%;border-radius:.25rem;background:var(--playpilot-green);transition:width .2s}.loading-bar-label.svelte-1kpafo0{text-align:right}@keyframes svelte-1kpafo0-fade{0%,to{opacity:0}25%,75%{opacity:1}}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0){animation:svelte-1kpafo0-fade 2s infinite}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0):nth-child(1){animation-delay:.2s}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0):nth-child(2){animation-delay:.4s}.ellipses.svelte-1kpafo0 span:where(.svelte-1kpafo0):nth-child(3){animation-delay:.6s}.dismiss.svelte-1kpafo0{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin-top:4px;padding:4px;border:2px solid var(--playpilot-content-light);border-radius:4px;background:var(--playpilot-light);font-family:inherit;color:var(--playpilot-text-color-alt);font-size:12px;line-height:1;cursor:pointer}.dismiss.svelte-1kpafo0:hover{background:var(--playpilot-content-light);color:var(--playpilot-text-color)}.editor.svelte-11aj6xq{z-index:2147483646;display:flex;flex-direction:column;position:fixed;bottom:16px;right:16px;width:100%;max-width:352px;height:min(70vh,640px);min-height:min(25rem,80vh);margin:0;padding:16px;border-radius:24px;background:var(--playpilot-dark);box-shadow:var(--playpilot-shadow-large);color:var(--playpilot-text-color);font-family:var(--playpilot-font-family);transition:border-radius .1s;overflow-y:auto;overflow-x:hidden;line-height:normal}.panel-open.svelte-11aj6xq{overflow:hidden}.loading.svelte-11aj6xq{height:auto;min-height:0;border-radius:32px;margin-left:auto;padding-right:8px;color:var(--playpilot-text-color-alt);font-size:13.6px}.handles.svelte-11aj6xq,.header.svelte-11aj6xq{z-index:20;position:sticky;top:-16px;margin:-16px -16px 0}.handle.svelte-11aj6xq{opacity:0;transition:opacity .15s}.editor.svelte-11aj6xq:hover .handle:where(.svelte-11aj6xq){opacity:1}.header.svelte-11aj6xq{z-index:5;display:flex;align-items:center;padding:16px 16px 16px 24px;margin:0 -16px;border:0;background:var(--playpilot-dark)}.loading.svelte-11aj6xq .header:where(.svelte-11aj6xq){margin:-16px}.heading.svelte-11aj6xq{margin:0 12px 0 0;color:var(--playpilot-text-color);font-size:20px;font-weight:400;line-height:normal}.bubble.svelte-11aj6xq{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:24px;height:24px;border:0;padding:0;margin-right:auto;border-radius:50%;background:var(--playpilot-green);line-height:24px;text-align:center;font-size:13.6px}.items.svelte-11aj6xq{padding-top:8px;margin-bottom:auto}.empty.svelte-11aj6xq{padding:8px;font-size:13.6px;font-style:italic;color:var(--playpilot-text-color-alt)}.save.svelte-11aj6xq{z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:sticky;bottom:0;left:0;width:100%;margin-top:16px;padding:8px;border:0;border-radius:32px;background:var(--playpilot-content);box-shadow:0 0 16px 16px var(--playpilot-dark);transition:opacity .1s;font-family:inherit;color:var(--playpilot-text-color-alt);font-size:13.6px;cursor:pointer}.save.svelte-11aj6xq:hover{background:var(--playpilot-content-light);color:var(--playpilot-text-color)}.save[disabled].svelte-11aj6xq{opacity:.75;background:var(--playpilot-light);color:var(--playpilot-content-light)}.error.svelte-11aj6xq{margin-top:8px}.alert.svelte-11aj6xq{margin:8px 8px 0}.panel.svelte-11aj6xq{z-index:10;position:absolute;top:0;left:0;width:100%;height:100%;padding:24px;background:var(--playpilot-dark);overflow-y:auto}.trigger.svelte-qee95d{position:fixed;bottom:16px;right:16px}.button.svelte-qee95d{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:48px;height:48px;border:0;padding:12px;border-radius:50%;background:var(--playpilot-light);box-shadow:var(--playpilot-shadow-large);transition:transform 50ms;line-height:24px;text-align:center;font-size:13.6px}.button.svelte-qee95d:hover{filter:brightness(1.1);transform:scale(1.05)}.button.svelte-qee95d svg{width:100%}.close.svelte-qee95d{display:flex;text-align:center;justify-content:center;position:absolute;top:-8px;right:-8px;width:24px;height:24px;padding:4px;background:var(--playpilot-content);color:#fff}.close.svelte-qee95d svg{width:12px}:root{--playpilot-primary: #fa548a;--playpilot-dark: #101426;--playpilot-light: #1b2743;--playpilot-lighter: #233257;--playpilot-content: #354367;--playpilot-content-light: #4b5b82;--playpilot-green: #53bca0;--playpilot-font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;--playpilot-text-color: #fff;--playpilot-text-color-alt: #c8d4de;--playpilot-shadow: 3.2px 2.4px 2.4px rgba(0, 0, 0, .2);--playpilot-shadow-large: 2.4px 2.4px 3.2px rgba(0, 0, 0, .05), 3.2px 5.6px 5.6px rgba(0, 0, 0, .1), 1.6px 1.6px 12px rgba(0, 0, 0, .25);--playpilot-error: #ea5a5a;--playpilot-error-dark: #442533;--playpilot-warning: #f7c74e;--playpilot-warning-dark: #413c23}[data-playpilot-injection-key]{position:relative}.playpilot-injection-highlight{outline:4px solid var(--playpilot-primary)!important;outline-offset:8px!important;border-radius:.8px;scroll-margin:80px}.playpilot-styled-scrollbar{scrollbar-color:var(--playpilot-content-light) var(--playpilot-lighter);scrollbar-width:thin}.playpilot-styled-scrollbed::-webkit-scrollbar{width:12px}.playpilot-styled-scrollbed::-webkit-scrollbar-track{background:var(--playpilot-light)}.playpilot-styled-scrollbed::-webkit-scrollbar-thumb{border:2px solid var(--playpilot-light);border-radius:16px;background:var(--playpilot-lighter)}.playpilot-styled-scrollbed::-webkit-scrollbar-thumb:hover{background:var(--playpilot-content-light)}.playpilot-styled-scrollbed::-webkit-scrollbar-thumb:active{background:var(--playpilot-text-color-alt)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight]{font-weight:var(--playpilot-injection-font-weight)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-color]{color:var(--playpilot-injection-text-color)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-color-hover]:hover{color:var(--playpilot-injection-text-color-hover)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-decoration]{text-decoration:var(--playpilot-injection-text-decoration)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-text-decoration-hover]:hover{text-decoration:var(--playpilot-injection-text-decoration-hover)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-background-color]{background-color:var(--playpilot-injection-background-color)}[data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-background-color-hover]:hover{background-color:var(--playpilot-injection-background-color-hover)}h1 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h2 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h3 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h4 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]),h5 [data-playpilot-injection-key] a:not([data-used-css-variables*=--playpilot-injection-font-weight-headings]){font-weight:inherit}h1 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h2 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h3 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h4 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings],h5 [data-playpilot-injection-key] a[data-used-css-variables*=--playpilot-injection-font-weight-headings]{font-weight:var(--playpilot-injection-font-weight-headings)}::view-transition-old(playpilot-title-content),::view-transition-new(playpilot-title-content){height:100%}.playpilot-link-injections.svelte-13rmd3g *{box-sizing:border-box}.playpilot-link-injections.svelte-13rmd3g svg{fill:none}.playpilot-link-injections.svelte-13rmd3g a,.playpilot-link-injections.svelte-13rmd3g button,.playpilot-link-injections.svelte-13rmd3g input{transition:outline-offset .1s}.playpilot-link-injections.svelte-13rmd3g a:focus-visible,.playpilot-link-injections.svelte-13rmd3g button:focus-visible,.playpilot-link-injections.svelte-13rmd3g input:focus-visible{outline:2px solid white;outline-offset:2px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
3
|
-
var yi=e=>{throw TypeError(e)};var wi=(e,t,n)=>t.has(e)||yi("Cannot "+n);var Pn=(e,t,n)=>(wi(e,t,"read from private field"),n?n.call(e):t.get(e)),Cn=(e,t,n)=>t.has(e)?yi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jn=(e,t,n,i)=>(wi(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();const On=!1;var Yn=Array.isArray,ca=Array.prototype.indexOf,Zn=Array.from,ua=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,Ui=Object.getOwnPropertyDescriptors,da=Object.prototype,fa=Array.prototype,Gn=Object.getPrototypeOf;function wt(e){return typeof e=="function"}const st=()=>{};function va(e){for(var t=0;t<e.length;t++)e[t]()}function sn(e,t,n=!1){return e===void 0?n?t():t:e}const He=2,zi=4,Kt=8,hn=16,Ve=32,Yt=64,cn=128,gt=256,un=512,Me=1024,rt=2048,gn=4096,Ue=8192,Et=16384,Wi=32768,mt=65536,_a=1<<17,Ki=1<<19,Yi=1<<20,ze=Symbol("$state"),Zi=Symbol("legacy props"),ha=Symbol("");function Gi(e){return e===this.v}function Xn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ga(e,t){return e!==t}function Jn(e){return!Xn(e,this.v)}function ma(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function pa(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ya(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wa(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ka(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ba(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function xa(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Sa(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Ea(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Tt=!1,Ta=!1;function Ia(){Tt=!0}const Qn=1,$n=2,Xi=4,Aa=8,Pa=16,Ca=1,ja=2,Ma=4,La=8,Na=16,Da=1,Oa=2,Ra=4,qa=1,Ha=2,ke=Symbol(),Ji="http://www.w3.org/2000/svg";function Ee(e,t){var n={f:0,v:e,reactions:null,equals:Gi,rv:0,wv:0};return n}function U(e){return Ba(Ee(e))}function Qi(e,t=!1){var i;const n=Ee(e);return t||(n.equals=Jn),Tt&&ie!==null&&ie.l!==null&&((i=ie.l).s??(i.s=[])).push(n),n}function Ba(e){return $!==null&&$.f&He&&(We===null?eo([e]):We.push(e)),e}function P(e,t){return $!==null&&Zt()&&$.f&(He|hn)&&(We===null||!We.includes(e))&&Ea(),Rn(e,t)}function Rn(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=gr(),$i(e,rt),Zt()&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&(ye!==null&&ye.includes(e)?(Ye(Z,rt),kn(Z)):it===null?to([e]):it.push(e))),t}function $i(e,t){var n=e.reactions;if(n!==null)for(var i=Zt(),r=n.length,a=0;a<r;a++){var o=n[a],s=o.f;s&rt||!i&&o===Z||(Ye(o,t),s&(Me|gt)&&(s&He?$i(o,gn):kn(o)))}}let er=!1;function X(e,t=null,n){if(typeof e!="object"||e===null||ze in e)return e;const i=Gn(e);if(i!==da&&i!==fa)return e;var r=new Map,a=Yn(e),o=Ee(0);a&&r.set("length",Ee(e.length));var s;return new Proxy(e,{defineProperty(l,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&ba();var f=r.get(d);return f===void 0?(f=Ee(u.value),r.set(d,f)):P(f,X(u.value,s)),!0},deleteProperty(l,d){var u=r.get(d);if(u===void 0)d in l&&r.set(d,Ee(ke));else{if(a&&typeof d=="string"){var f=r.get("length"),_=Number(d);Number.isInteger(_)&&_<f.v&&P(f,_)}P(u,ke),ki(o)}return!0},get(l,d,u){var g;if(d===ze)return e;var f=r.get(d),_=d in l;if(f===void 0&&(!_||(g=nt(l,d))!=null&&g.writable)&&(f=Ee(X(_?l[d]:ke,s)),r.set(d,f)),f!==void 0){var m=c(f);return m===ke?void 0:m}return Reflect.get(l,d,u)},getOwnPropertyDescriptor(l,d){var u=Reflect.getOwnPropertyDescriptor(l,d);if(u&&"value"in u){var f=r.get(d);f&&(u.value=c(f))}else if(u===void 0){var _=r.get(d),m=_==null?void 0:_.v;if(_!==void 0&&m!==ke)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,d){var m;if(d===ze)return!0;var u=r.get(d),f=u!==void 0&&u.v!==ke||Reflect.has(l,d);if(u!==void 0||Z!==null&&(!f||(m=nt(l,d))!=null&&m.writable)){u===void 0&&(u=Ee(f?X(l[d],s):ke),r.set(d,u));var _=c(u);if(_===ke)return!1}return f},set(l,d,u,f){var S;var _=r.get(d),m=d in l;if(a&&d==="length")for(var g=u;g<_.v;g+=1){var v=r.get(g+"");v!==void 0?P(v,ke):g in l&&(v=Ee(ke),r.set(g+"",v))}_===void 0?(!m||(S=nt(l,d))!=null&&S.writable)&&(_=Ee(void 0),P(_,X(u,s)),r.set(d,_)):(m=_.v!==ke,P(_,X(u,s)));var p=Reflect.getOwnPropertyDescriptor(l,d);if(p!=null&&p.set&&p.set.call(f,u),!m){if(a&&typeof d=="string"){var y=r.get("length"),w=Number(d);Number.isInteger(w)&&w>=y.v&&P(y,w+1)}ki(o)}return!0},ownKeys(l){c(o);var d=Reflect.ownKeys(l).filter(_=>{var m=r.get(_);return m===void 0||m.v!==ke});for(var[u,f]of r)f.v!==ke&&!(u in l)&&d.push(u);return d},setPrototypeOf(){xa()}})}function ki(e,t=1){P(e,e.v+t)}function bi(e){return e!==null&&typeof e=="object"&&ze in e?e[ze]:e}function Fa(e,t){return Object.is(bi(e),bi(t))}var we,tr,nr;function Va(){if(we===void 0){we=window;var e=Element.prototype,t=Node.prototype;tr=nt(t,"firstChild").get,nr=nt(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function It(e=""){return document.createTextNode(e)}function ft(e){return tr.call(e)}function mn(e){return nr.call(e)}function b(e,t){return ft(e)}function ne(e,t){{var n=ft(e);return n instanceof Comment&&n.data===""?mn(n):n}}function E(e,t=1,n=!1){let i=e;for(;t--;)i=mn(i);return i}function Ua(e){e.textContent=""}function K(e){var t=He|rt;Z===null?t|=gt:Z.f|=Yi;var n=$!==null&&$.f&He?$:null;const i={children:null,ctx:ie,deps:null,equals:Gi,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??Z};return n!==null&&(n.children??(n.children=[])).push(i),i}function za(e){const t=K(e);return t.equals=Jn,t}function ir(e){var t=e.children;if(t!==null){e.children=null;for(var n=0;n<t.length;n+=1){var i=t[n];i.f&He?ei(i):Re(i)}}}function Wa(e){for(var t=e.parent;t!==null;){if(!(t.f&He))return t;t=t.parent}return null}function rr(e){var t,n=Z;Ie(Wa(e));try{ir(e),t=mr(e)}finally{Ie(n)}return t}function ar(e){var t=rr(e),n=(tt||e.f>)&&e.deps!==null?gn:Me;Ye(e,n),e.equals(t)||(e.v=t,e.wv=gr())}function ei(e){ir(e),Bt(e,0),Ye(e,Et),e.v=e.children=e.deps=e.ctx=e.reactions=null}function Ka(e){Z===null&&$===null&&ya(),$!==null&&$.f>&&pa(),ni&&ma()}function Ya(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function At(e,t,n,i=!0){var r=(e&Yt)!==0,a=Z,o={ctx:ie,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|rt,first:null,fn:t,last:null,next:null,parent:r?null:a,prev:null,teardown:null,transitions:null,wv:0};if(n){var s=kt;try{xi(!0),wn(o),o.f|=Wi}catch(u){throw Re(o),u}finally{xi(s)}}else t!==null&&kn(o);var l=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&Yi)===0;if(!l&&!r&&i&&(a!==null&&Ya(o,a),$!==null&&$.f&He)){var d=$;(d.children??(d.children=[])).push(o)}return o}function Za(){return $===null?!1:!tt}function Ga(e){const t=At(Kt,null,!1);return Ye(t,Me),t.teardown=e,t}function pn(e){Ka();var t=Z!==null&&(Z.f&Ve)!==0&&ie!==null&&!ie.m;if(t){var n=ie;(n.e??(n.e=[])).push({fn:e,effect:Z,reaction:$})}else{var i=pt(e);return i}}function Xa(e){const t=At(Yt,e,!0);return(n={})=>new Promise(i=>{n.outro?vt(t,()=>{Re(t),i(void 0)}):(Re(t),i(void 0))})}function pt(e){return At(zi,e,!1)}function yn(e){return At(Kt,e,!0)}function N(e){return Je(e)}function Je(e,t=0){return At(Kt|hn|t,e,!0)}function Oe(e,t=!0){return At(Kt|Ve,e,!0,t)}function or(e){var t=e.teardown;if(t!==null){const n=ni,i=$;Si(!0),qe(null);try{t.call(null)}finally{Si(n),qe(i)}}}function lr(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n<t.length;n+=1)ei(t[n])}}function sr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;Re(n,t),n=i}}function Ja(e){for(var t=e.first;t!==null;){var n=t.next;t.f&Ve||Re(t),t=n}}function Re(e,t=!0){var n=!1;if((t||e.f&Ki)&&e.nodes_start!==null){for(var i=e.nodes_start,r=e.nodes_end;i!==null;){var a=i===r?null:mn(i);i.remove(),i=a}n=!0}sr(e,t&&!n),lr(e),Bt(e,0),Ye(e,Et);var o=e.transitions;if(o!==null)for(const l of o)l.stop();or(e);var s=e.parent;s!==null&&s.first!==null&&cr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function cr(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function vt(e,t){var n=[];ti(e,n,!0),ur(n,()=>{Re(e),t&&t()})}function ur(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var r of e)r.out(i)}else t()}function ti(e,t,n){if(!(e.f&Ue)){if(e.f^=Ue,e.transitions!==null)for(const o of e.transitions)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var r=i.next,a=(i.f&mt)!==0||(i.f&Ve)!==0;ti(i,t,a?n:!1),i=r}}}function Rt(e){dr(e,!0)}function dr(e,t){if(e.f&Ue){Gt(e)&&wn(e),e.f^=Ue;for(var n=e.first;n!==null;){var i=n.next,r=(n.f&mt)!==0||(n.f&Ve)!==0;dr(n,r?t:!1),n=i}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}let dn=!1,qn=[];function fr(){dn=!1;const e=qn.slice();qn=[],va(e)}function Pt(e){dn||(dn=!0,queueMicrotask(fr)),qn.push(e)}function Qa(){dn&&fr()}function vr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const _r=0,$a=1;let Mt=!1,ln=_r,qt=!1,Ht=null,kt=!1,ni=!1;function xi(e){kt=e}function Si(e){ni=e}let ct=[],bt=0;let $=null;function qe(e){$=e}let Z=null;function Ie(e){Z=e}let We=null;function eo(e){We=e}let ye=null,Ce=0,it=null;function to(e){it=e}let hr=1,Hn=0,tt=!1,ie=null;function Ei(e){ie=e}function gr(){return++hr}function Zt(){return!Tt||ie!==null&&ie.l===null}function Gt(e){var d;var t=e.f;if(t&rt)return!0;if(t&gn){var n=e.deps,i=(t>)!==0;if(n!==null){var r,a,o=(t&un)!==0,s=i&&Z!==null&&!tt,l=n.length;if(o||s){for(r=0;r<l;r++)a=n[r],(o||!((d=a==null?void 0:a.reactions)!=null&&d.includes(e)))&&(a.reactions??(a.reactions=[])).push(e);o&&(e.f^=un)}for(r=0;r<l;r++)if(a=n[r],Gt(a)&&ar(a),a.wv>e.wv)return!0}(!i||Z!==null&&!tt)&&Ye(e,Me)}return!1}function no(e,t){for(var n=t;n!==null;){if(n.f&cn)try{n.fn(e);return}catch{n.f^=cn}n=n.parent}throw Mt=!1,e}function io(e){return(e.f&Et)===0&&(e.parent===null||(e.parent.f&cn)===0)}function Mn(){Mt=!1}function Xt(e,t,n,i){if(Mt){if(n===null&&(Mt=!1),io(t))throw e;return}n!==null&&(Mt=!0);{no(e,t);return}}function mr(e){var _;var t=ye,n=Ce,i=it,r=$,a=tt,o=We,s=ie,l=e.f;ye=null,Ce=0,it=null,$=l&(Ve|Yt)?null:e,tt=!kt&&(l>)!==0,We=null,ie=e.ctx,Hn++;try{var d=(0,e.fn)(),u=e.deps;if(ye!==null){var f;if(Bt(e,Ce),u!==null&&Ce>0)for(u.length=Ce+ye.length,f=0;f<ye.length;f++)u[Ce+f]=ye[f];else e.deps=u=ye;if(!tt)for(f=Ce;f<u.length;f++)((_=u[f]).reactions??(_.reactions=[])).push(e)}else u!==null&&Ce<u.length&&(Bt(e,Ce),u.length=Ce);return d}finally{ye=t,Ce=n,it=i,$=r,tt=a,We=o,ie=s}}function ro(e,t){let n=t.reactions;if(n!==null){var i=ca.call(n,e);if(i!==-1){var r=n.length-1;r===0?n=t.reactions=null:(n[i]=n[r],n.pop())}}n===null&&t.f&He&&(ye===null||!ye.includes(t))&&(Ye(t,gn),t.f&(gt|un)||(t.f^=un),Bt(t,0))}function Bt(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)ro(e,n[i])}function wn(e){var t=e.f;if(!(t&Et)){Ye(e,Me);var n=Z,i=ie;Z=e;try{t&hn?Ja(e):sr(e),lr(e),or(e);var r=mr(e);e.teardown=typeof r=="function"?r:null,e.wv=hr;var a=e.deps,o;On&&Ta&&e.f&rt}catch(s){Xt(s,e,n,i||e.ctx)}finally{Z=n}}}function pr(){if(bt>1e3){bt=0;try{wa()}catch(e){if(Ht!==null)Xt(e,Ht,null);else throw e}}bt++}function yr(e){var t=e.length;if(t!==0){pr();var n=kt;kt=!0;try{for(var i=0;i<t;i++){var r=e[i];r.f&Me||(r.f^=Me);var a=[];wr(r,a),ao(a)}}finally{kt=n}}}function ao(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if(!(i.f&(Et|Ue)))try{Gt(i)&&(wn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?cr(i):i.fn=null))}catch(r){Xt(r,i,null,i.ctx)}}}function oo(){if(qt=!1,bt>1001)return;const e=ct;ct=[],yr(e),qt||(bt=0,Ht=null)}function kn(e){ln===_r&&(qt||(qt=!0,queueMicrotask(oo))),Ht=e;for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(Yt|Ve)){if(!(n&Me))return;t.f^=Me}}ct.push(t)}function wr(e,t){var n=e.first,i=[];e:for(;n!==null;){var r=n.f,a=(r&Ve)!==0,o=a&&(r&Me)!==0,s=n.next;if(!o&&!(r&Ue))if(r&Kt){if(a)n.f^=Me;else try{Gt(n)&&wn(n)}catch(f){Xt(f,n,null,n.ctx)}var l=n.first;if(l!==null){n=l;continue}}else r&zi&&i.push(n);if(s===null){let f=n.parent;for(;f!==null;){if(e===f)break e;var d=f.next;if(d!==null){n=d;continue e}f=f.parent}}n=s}for(var u=0;u<i.length;u++)l=i[u],t.push(l),wr(l,t)}function kr(e){var t=ln,n=ct;try{pr();const r=[];ln=$a,ct=r,qt=!1,yr(n);var i=e==null?void 0:e();return Qa(),(ct.length>0||r.length>0)&&kr(),bt=0,Ht=null,i}finally{ln=t,ct=n}}async function Bn(){await Promise.resolve(),kr()}function c(e){var u;var t=e.f,n=(t&He)!==0;if(n&&t&Et){var i=rr(e);return ei(e),i}if($!==null){We!==null&&We.includes(e)&&Sa();var r=$.deps;e.rv<Hn&&(e.rv=Hn,ye===null&&r!==null&&r[Ce]===e?Ce++:ye===null?ye=[e]:ye.push(e),it!==null&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&it.includes(e)&&(Ye(Z,rt),kn(Z)))}else if(n&&e.deps===null)for(var a=e,o=a.parent,s=a;o!==null;)if(o.f&He){var l=o;s=l,o=l.parent}else{var d=o;(u=d.deriveds)!=null&&u.includes(s)||(d.deriveds??(d.deriveds=[])).push(s);break}return n&&(a=e,Gt(a)&&ar(a)),e.v}function Ke(e){const t=$;try{return $=null,e()}finally{$=t}}const lo=-7169;function Ye(e,t){e.f=e.f&lo|t}function so(e){return xr().get(e)}function br(e,t){return xr().set(e,t),t}function xr(e){return ie===null&&vr(),ie.c??(ie.c=new Map(co(ie)||void 0))}function co(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}function ae(e,t=!1,n){ie={p:ie,c:null,e:null,m:!1,s:e,x:null,l:null},Tt&&!t&&(ie.l={s:null,u:null,r1:[],r2:Ee(!1)})}function oe(e){const t=ie;if(t!==null){const o=t.e;if(o!==null){var n=Z,i=$;t.e=null;try{for(var r=0;r<o.length;r++){var a=o[r];Ie(a.effect),qe(a.reaction),pt(a.fn)}}finally{Ie(n),qe(i)}}ie=t.p,t.m=!0}return{}}function uo(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(ze in e)Fn(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&ze in n&&Fn(n)}}}function Fn(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let i in e)try{Fn(e[i],t)}catch{}const n=Gn(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const i=Ui(n);for(let r in i){const a=i[r].get;if(a)try{a.call(e)}catch{}}}}}function fo(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const vo=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function _o(e){return vo.includes(e)}const ho={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function go(e){return e=e.toLowerCase(),ho[e]??e}const mo=["touchstart","touchmove"];function po(e){return mo.includes(e)}function yo(e,t){if(t){const n=document.body;e.autofocus=!0,Pt(()=>{document.activeElement===n&&e.focus()})}}let Ti=!1;function wo(){Ti||(Ti=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Sr(e){var t=$,n=Z;qe(null),Ie(null);try{return e()}finally{qe(t),Ie(n)}}function Er(e,t,n,i=n){e.addEventListener(t,()=>Sr(n));const r=e.__on_r;r?e.__on_r=()=>{r(),i(!0)}:e.__on_r=()=>i(!0),wo()}const Tr=new Set,Vn=new Set;function ii(e,t,n,i){function r(a){if(i.capture||jt.call(t,a),!a.cancelBubble)return Sr(()=>n.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Pt(()=>{t.addEventListener(e,r,i)}):t.addEventListener(e,r,i),r}function ko(e,t,n,i={}){var r=ii(t,e,n,i);return()=>{e.removeEventListener(t,r,i)}}function ce(e,t,n,i,r){var a={capture:i,passive:r},o=ii(e,t,n,a);(t===document.body||t===window||t===document)&&Ga(()=>{t.removeEventListener(e,o,a)})}function fe(e){for(var t=0;t<e.length;t++)Tr.add(e[t]);for(var n of Vn)n(e)}function jt(e){var w;var t=this,n=t.ownerDocument,i=e.type,r=((w=e.composedPath)==null?void 0:w.call(e))||[],a=r[0]||e.target,o=0,s=e.__root;if(s){var l=r.indexOf(s);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var d=r.indexOf(t);if(d===-1)return;l<=d&&(o=l)}if(a=r[o]||e.target,a!==t){ua(e,"currentTarget",{configurable:!0,get(){return a||n}});var u=$,f=Z;qe(null),Ie(null);try{for(var _,m=[];a!==null;){var g=a.assignedSlot||a.parentNode||a.host||null;try{var v=a["__"+i];if(v!==void 0&&!a.disabled)if(Yn(v)){var[p,...y]=v;p.apply(a,[e,...y])}else v.call(a,e)}catch(S){_?m.push(S):_=S}if(e.cancelBubble||g===t||g===null)break;a=g}if(_){for(let S of m)queueMicrotask(()=>{throw S});throw _}}finally{e.__root=t,delete e.currentTarget,qe(u),Ie(f)}}}function bo(e){var t;t=document.head.appendChild(It());try{Je(()=>e(t),Ki)}finally{}}function ri(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function _t(e,t){var n=Z;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function I(e,t){var n=(t&qa)!==0,i=(t&Ha)!==0,r,a=!e.startsWith("<!>");return()=>{r===void 0&&(r=ri(a?e:"<!>"+e),n||(r=ft(r)));var o=i?document.importNode(r,!0):r.cloneNode(!0);if(n){var s=ft(o),l=o.lastChild;_t(s,l)}else _t(o,o);return o}}function Le(e,t,n="svg"){var i=!e.startsWith("<!>"),r=`<${n}>${i?e:"<!>"+e}</${n}>`,a;return()=>{if(!a){var o=ri(r),s=ft(o);a=ft(s)}var l=a.cloneNode(!0);return _t(l,l),l}}function Be(e=""){{var t=It(e+"");return _t(t,t),t}}function Fe(){var e=document.createDocumentFragment(),t=document.createComment(""),n=It();return e.append(t,n),_t(t,n),e}function k(e,t){e!==null&&e.before(t)}let fn=!0;function Ii(e){fn=e}function G(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function Jt(e,t){return xo(e,t)}const yt=new Map;function xo(e,{target:t,anchor:n,props:i={},events:r,context:a,intro:o=!0}){Va();var s=new Set,l=f=>{for(var _=0;_<f.length;_++){var m=f[_];if(!s.has(m)){s.add(m);var g=po(m);t.addEventListener(m,jt,{passive:g});var v=yt.get(m);v===void 0?(document.addEventListener(m,jt,{passive:g}),yt.set(m,1)):yt.set(m,v+1)}}};l(Zn(Tr)),Vn.add(l);var d=void 0,u=Xa(()=>{var f=n??t.appendChild(It());return Oe(()=>{if(a){ae({});var _=ie;_.c=a}r&&(i.$$events=r),fn=o,d=e(f,i)||{},fn=!0,a&&oe()}),()=>{var g;for(var _ of s){t.removeEventListener(_,jt);var m=yt.get(_);--m===0?(document.removeEventListener(_,jt),yt.delete(_)):yt.set(_,m)}Vn.delete(l),f!==n&&((g=f.parentNode)==null||g.removeChild(f))}});return Un.set(d,u),d}let Un=new WeakMap;function bn(e,t){const n=Un.get(e);return n?(Un.delete(e),n(t)):Promise.resolve()}function q(e,t,n=!1){var i=e,r=null,a=null,o=ke,s=n?mt:0,l=!1;const d=(f,_=!0)=>{l=!0,u(_,f)},u=(f,_)=>{o!==(o=f)&&(o?(r?Rt(r):_&&(r=Oe(()=>_(i))),a&&vt(a,()=>{a=null})):(a?Rt(a):_&&(a=Oe(()=>_(i))),r&&vt(r,()=>{r=null})))};Je(()=>{l=!1,t(d),l||u(null,null)},s)}function Ir(e,t,n){var i=e,r=ke,a,o=Zt()?ga:Xn;Je(()=>{o(r,r=t())&&(a&&vt(a),a=Oe(()=>n(i)))})}function xt(e,t){return t}function So(e,t,n,i){for(var r=[],a=t.length,o=0;o<a;o++)ti(t[o].e,r,!0);var s=a>0&&r.length===0&&n!==null;if(s){var l=n.parentNode;Ua(l),l.append(n),i.clear(),et(e,t[0].prev,t[a-1].next)}ur(r,()=>{for(var d=0;d<a;d++){var u=t[d];s||(i.delete(u.k),et(e,u.prev,u.next)),Re(u.e,!s)}})}function at(e,t,n,i,r,a=null){var o=e,s={flags:t,items:new Map,first:null},l=(t&Xi)!==0;if(l){var d=e;o=d.appendChild(It())}var u=null,f=!1;Je(()=>{var _=n(),m=Yn(_)?_:_==null?[]:Zn(_),g=m.length;if(!(f&&g===0)){f=g===0;{var v=$;Eo(m,s,o,r,t,(v.f&Ue)!==0,i)}a!==null&&(g===0?u?Rt(u):u=Oe(()=>a(o)):u!==null&&vt(u,()=>{u=null})),n()}})}function Eo(e,t,n,i,r,a,o,s){var F,V,W,J;var l=(r&Aa)!==0,d=(r&(Qn|$n))!==0,u=e.length,f=t.items,_=t.first,m=_,g,v=null,p,y=[],w=[],S,j,x,T;if(l)for(T=0;T<u;T+=1)S=e[T],j=o(S,T),x=f.get(j),x!==void 0&&((F=x.a)==null||F.measure(),(p??(p=new Set)).add(x));for(T=0;T<u;T+=1){if(S=e[T],j=o(S,T),x=f.get(j),x===void 0){var H=m?m.e.nodes_start:n;v=Io(H,t,v,v===null?t.first:v.next,S,j,T,i,r),f.set(j,v),y=[],w=[],m=v.next;continue}if(d&&To(x,S,T,r),x.e.f&Ue&&(Rt(x.e),l&&((V=x.a)==null||V.unfix(),(p??(p=new Set)).delete(x))),x!==m){if(g!==void 0&&g.has(x)){if(y.length<w.length){var M=w[0],A;v=M.prev;var O=y[0],C=y[y.length-1];for(A=0;A<y.length;A+=1)Ai(y[A],M,n);for(A=0;A<w.length;A+=1)g.delete(w[A]);et(t,O.prev,C.next),et(t,v,O),et(t,C,M),m=M,v=C,T-=1,y=[],w=[]}else g.delete(x),Ai(x,m,n),et(t,x.prev,x.next),et(t,x,v===null?t.first:v.next),et(t,v,x),v=x;continue}for(y=[],w=[];m!==null&&m.k!==j;)(a||!(m.e.f&Ue))&&(g??(g=new Set)).add(m),w.push(m),m=m.next;if(m===null)continue;x=m}y.push(x),v=x,m=x.next}if(m!==null||g!==void 0){for(var B=g===void 0?[]:Zn(g);m!==null;)(a||!(m.e.f&Ue))&&B.push(m),m=m.next;var D=B.length;if(D>0){var z=r&Xi&&u===0?n:null;if(l){for(T=0;T<D;T+=1)(W=B[T].a)==null||W.measure();for(T=0;T<D;T+=1)(J=B[T].a)==null||J.fix()}So(t,B,z,f)}}l&&Pt(()=>{var ee;if(p!==void 0)for(x of p)(ee=x.a)==null||ee.apply()}),Z.first=t.first&&t.first.e,Z.last=v&&v.e}function To(e,t,n,i){i&Qn&&Rn(e.v,t),i&$n?Rn(e.i,n):e.i=n}function Io(e,t,n,i,r,a,o,s,l,d){var u=(l&Qn)!==0,f=(l&Pa)===0,_=u?f?Qi(r):Ee(r):r,m=l&$n?Ee(o):o,g={i:m,v:_,k:a,a:null,e:null,prev:n,next:i};try{return g.e=Oe(()=>s(e,_,m),er),g.e.prev=n&&n.e,g.e.next=i&&i.e,n===null?t.first=g:(n.next=g,n.e.next=g.e),i!==null&&(i.prev=g,i.e.prev=g.e),g}finally{}}function Ai(e,t,n){for(var i=e.next?e.next.e.nodes_start:n,r=t?t.e.nodes_start:n,a=e.e.nodes_start;a!==i;){var o=mn(a);r.before(a),a=o}}function et(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function Ao(e,t,n,i,r){var a=e,o="",s;Je(()=>{o!==(o=t()??"")&&(s!==void 0&&(Re(s),s=void 0),o!==""&&(s=Oe(()=>{var l=o+"",d=ri(l);_t(ft(d),d.lastChild),a.before(d)})))})}function Ct(e,t,...n){var i=e,r=st,a;Je(()=>{r!==(r=t())&&(a&&(Re(a),a=null),a=Oe(()=>r(i,...n)))},mt)}function Po(e,t,n,i,r,a){var o,s,l=null,d=e,u;Je(()=>{const f=t()||null;var _=f==="svg"?Ji:null;f!==o&&(u&&(f===null?vt(u,()=>{u=null,s=null}):f===s?Rt(u):(Re(u),Ii(!1))),f&&f!==s&&(u=Oe(()=>{l=_?document.createElementNS(_,f):document.createElement(f),_t(l,l);{var m=l.appendChild(It());i(l,m)}Z.nodes_end=l,d.before(l)})),o=f,o&&(s=o),Ii(!0))},mt)}function Qt(e,t,n){pt(()=>{var i=Ke(()=>t(e,n==null?void 0:n())||{});if(n&&(i!=null&&i.update)){var r=!1,a={};yn(()=>{var o=n();uo(o),r&&Xn(a,o)&&(a=o,i.update(o))}),r=!0}if(i!=null&&i.destroy)return()=>i.destroy()})}function Ar(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Ar(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Co(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Ar(e))&&(i&&(i+=" "),i+=t);return i}function jo(e){return typeof e=="object"?Co(e):e??""}function Mo(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ue(e,t,n,i){var r=e.__attributes??(e.__attributes={});r[t]!==(r[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[ha]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Pr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Lo(e,t,n,i,r=!1,a=!1,o=!1){var s=t||{},l=e.tagName==="OPTION";for(var d in t)d in n||(n[d]=null);n.class&&(n.class=jo(n.class)),n.class=n.class?n.class+" "+i:i;var u=Pr(e),f=e.__attributes??(e.__attributes={});for(const w in n){let S=n[w];if(l&&w==="value"&&S==null){e.value=e.__value="",s[w]=S;continue}var _=s[w];if(S!==_){s[w]=S;var m=w[0]+w[1];if(m!=="$$"){if(m==="on"){const j={},x="$$"+w;let T=w.slice(2);var g=_o(T);if(fo(T)&&(T=T.slice(0,-7),j.capture=!0),!g&&_){if(S!=null)continue;e.removeEventListener(T,s[x],j),s[x]=null}if(S!=null)if(g)e[`__${T}`]=S,fe([T]);else{let H=function(M){s[w].call(this,M)};var y=H;s[x]=ii(T,e,H,j)}else g&&(e[`__${T}`]=void 0)}else if(w==="style"&&S!=null)e.style.cssText=S+"";else if(w==="autofocus")yo(e,!!S);else if(w==="__value"||w==="value"&&S!=null)e.value=e[w]=e.__value=S;else if(w==="selected"&&l)Mo(e,S);else{var v=w;r||(v=go(v));var p=v==="defaultValue"||v==="defaultChecked";if(S==null&&!a&&!p)if(f[w]=null,v==="value"||v==="checked"){let j=e;if(v==="value"){let x=j.defaultValue;j.removeAttribute(v),j.defaultValue=x}else{let x=j.defaultChecked;j.removeAttribute(v),j.defaultChecked=x}}else e.removeAttribute(w);else p||u.includes(v)&&(a||typeof S!="string")?e[v]=S:typeof S!="function"&&ue(e,v,S)}w==="style"&&"__styles"in e&&(e.__styles={})}}}return s}var Pi=new Map;function Pr(e){var t=Pi.get(e.nodeName);if(t)return t;Pi.set(e.nodeName,t=[]);for(var n,i=e,r=Element.prototype;r!==i;){n=Ui(i);for(var a in n)n[a].set&&t.push(a);i=Gn(i)}return t}function No(e,t,n){var i=e.__className,r=Do(t);(i!==r||er)&&(t==null?e.removeAttribute("class"):e.className=r,e.__className=r)}function Do(e,t){return(e??"")+""}function se(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function xn(e,t,n,i){var r=e.__styles??(e.__styles={});r[t]!==n&&(r[t]=n,n==null?e.style.removeProperty(t):e.style.setProperty(t,n,""))}const Oo=()=>performance.now(),Xe={tick:e=>requestAnimationFrame(e),now:()=>Oo(),tasks:new Set};function Cr(){const e=Xe.now();Xe.tasks.forEach(t=>{t.c(e)||(Xe.tasks.delete(t),t.f())}),Xe.tasks.size!==0&&Xe.tick(Cr)}function Ro(e){let t;return Xe.tasks.size===0&&Xe.tick(Cr),{promise:new Promise(n=>{Xe.tasks.add(t={c:e,f:n})}),abort(){Xe.tasks.delete(t)}}}function an(e,t){e.dispatchEvent(new CustomEvent(t))}function qo(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("")}function Ci(e){const t={},n=e.split(";");for(const i of n){const[r,a]=i.split(":");if(!r||a===void 0)break;const o=qo(r.trim());t[o]=a.trim()}return t}const Ho=e=>e;function je(e,t,n,i){var r=(e&Da)!==0,a=(e&Oa)!==0,o=r&&a,s=(e&Ra)!==0,l=o?"both":r?"in":"out",d,u=t.inert,f,_;function m(){var w=$,S=Z;qe(null),Ie(null);try{return d??(d=n()(t,(i==null?void 0:i())??{},{direction:l}))}finally{qe(w),Ie(S)}}var g={is_global:s,in(){var w;if(t.inert=u,!r){_==null||_.abort(),(w=_==null?void 0:_.reset)==null||w.call(_);return}a||f==null||f.abort(),an(t,"introstart"),f=zn(t,m(),_,1,()=>{an(t,"introend"),f==null||f.abort(),f=d=void 0})},out(w){if(!a){w==null||w(),d=void 0;return}t.inert=!0,an(t,"outrostart"),_=zn(t,m(),f,0,()=>{an(t,"outroend"),w==null||w()})},stop:()=>{f==null||f.abort(),_==null||_.abort()}},v=Z;if((v.transitions??(v.transitions=[])).push(g),r&&fn){var p=s;if(!p){for(var y=v.parent;y&&y.f&mt;)for(;(y=y.parent)&&!(y.f&hn););p=!y||(y.f&Wi)!==0}p&&pt(()=>{Ke(()=>g.in())})}}function zn(e,t,n,i,r){var a=i===1;if(wt(t)){var o,s=!1;return Pt(()=>{if(!s){var p=t({direction:a?"in":"out"});o=zn(e,p,n,i,r)}}),{abort:()=>{s=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(n==null||n.deactivate(),!(t!=null&&t.duration))return r(),{abort:st,deactivate:st,reset:st,t:()=>i};const{delay:l=0,css:d,tick:u,easing:f=Ho}=t;var _=[];if(a&&n===void 0&&(u&&u(0,1),d)){var m=Ci(d(0,1));_.push(m,m)}var g=()=>1-i,v=e.animate(_,{duration:l});return v.onfinish=()=>{var p=(n==null?void 0:n.t())??1-i;n==null||n.abort();var y=i-p,w=t.duration*Math.abs(y),S=[];if(w>0){if(d)for(var j=Math.ceil(w/16.666666666666668),x=0;x<=j;x+=1){var T=p+y*f(x/j),H=d(T,1-T);S.push(Ci(H))}g=()=>{var M=v.currentTime;return p+y*f(M/w)},u&&Ro(()=>{if(v.playState!=="running")return!1;var M=g();return u(M,1-M),!0})}v=e.animate(S,{duration:w,fill:"forwards"}),v.onfinish=()=>{g=()=>i,u==null||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=st)},deactivate:()=>{r=st},reset:()=>{i===0&&(u==null||u(1,0))},t:()=>g()}}function Bo(e,t,n=t){var i=Zt();Er(e,"input",r=>{var a=r?e.defaultValue:e.value;if(a=Ln(e)?Nn(a):a,n(a),i&&a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd;e.value=a??"",s!==null&&(e.selectionStart=o,e.selectionEnd=Math.min(s,e.value.length))}}),Ke(t)==null&&e.value&&n(Ln(e)?Nn(e.value):e.value),yn(()=>{var r=t();Ln(e)&&r===Nn(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function Ln(e){var t=e.type;return t==="number"||t==="range"}function Nn(e){return e===""?null:+e}function jr(e,t,n){if(e.multiple)return Uo(e,t);for(var i of e.options){var r=Lt(i);if(Fa(r,t)){i.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Fo(e,t){pt(()=>{var n=new MutationObserver(()=>{var i=e.__value;jr(e,i)});return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),()=>{n.disconnect()}})}function Vo(e,t,n=t){var i=!0;Er(e,"change",r=>{var a=r?"[selected]":":checked",o;if(e.multiple)o=[].map.call(e.querySelectorAll(a),Lt);else{var s=e.querySelector(a)??e.querySelector("option:not([disabled])");o=s&&Lt(s)}n(o)}),pt(()=>{var r=t();if(jr(e,r,i),i&&r===void 0){var a=e.querySelector(":checked");a!==null&&(r=Lt(a),n(r))}e.__value=r,i=!1}),Fo(e)}function Uo(e,t){for(var n of e.options)n.selected=~t.indexOf(Lt(n))}function Lt(e){return"__value"in e?e.__value:e.value}function ji(e,t){return e===t||(e==null?void 0:e[ze])===t}function $t(e={},t,n,i){return pt(()=>{var r,a;return yn(()=>{r=a,a=[],Ke(()=>{e!==n(...a)&&(t(e,...a),r&&ji(n(...r),e)&&t(null,...r))})}),()=>{Pt(()=>{a&&ji(n(...a),e)&&t(null,...a)})}}),e}let on=!1;function zo(e){var t=on;try{return on=!1,[e(),on]}finally{on=t}}const Wo={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Ko(e,t,n){return new Proxy({props:e,exclude:t},Wo)}const Yo={get(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i)return i[t]}},set(e,t,n){let i=e.props.length;for(;i--;){let r=e.props[i];wt(r)&&(r=r());const a=nt(r,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i){const r=nt(i,t);return r&&!r.configurable&&(r.configurable=!0),r}}},has(e,t){if(t===ze||t===Zi)return!1;for(let n of e.props)if(wt(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props){wt(n)&&(n=n());for(const i in n)t.includes(i)||t.push(i)}return t}};function Zo(...e){return new Proxy({props:e},Yo)}function Mi(e){for(var t=Z,n=Z;t!==null&&!(t.f&(Ve|Yt));)t=t.parent;try{return Ie(t),e()}finally{Ie(n)}}function L(e,t,n,i){var H;var r=(n&Ca)!==0,a=!Tt||(n&ja)!==0,o=(n&La)!==0,s=(n&Na)!==0,l=!1,d;o?[d,l]=zo(()=>e[t]):d=e[t];var u=ze in e||Zi in e,f=o&&(((H=nt(e,t))==null?void 0:H.set)??(u&&t in e&&(M=>e[t]=M)))||void 0,_=i,m=!0,g=!1,v=()=>(g=!0,m&&(m=!1,s?_=Ke(i):_=i),_);d===void 0&&i!==void 0&&(f&&a&&ka(),d=v(),f&&f(d));var p;if(a)p=()=>{var M=e[t];return M===void 0?v():(m=!0,g=!1,M)};else{var y=Mi(()=>(r?K:za)(()=>e[t]));y.f|=_a,p=()=>{var M=c(y);return M!==void 0&&(_=void 0),M===void 0?_:M}}if(!(n&Ma))return p;if(f){var w=e.$$legacy;return function(M,A){return arguments.length>0?((!a||!A||w||l)&&f(A?p():M),M):p()}}var S=!1,j=!1,x=Qi(d),T=Mi(()=>K(()=>{var M=p(),A=c(x);return S?(S=!1,j=!0,A):(j=!1,x.v=M)}));return r||(T.equals=Jn),function(M,A){if(arguments.length>0){const O=A?c(T):a&&o?X(M):M;return T.equals(O)||(S=!0,P(x,O),g&&_!==void 0&&(_=O),Ke(()=>c(T))),M}return c(T)}}function Li(e,t){var n=Z,i=$,r=ie;Ie(e),qe(e),Ei(e.ctx);try{t()}finally{Ie(n),qe(i),Ei(r)}}function Go(e,t,n){var i=e,r;Je(()=>{var a=Z,o=!1;a.fn=s=>{var l=t.onerror;let d=t.failed;if(!l&&!d||o)throw s;var u=()=>{vt(r),Li(a,()=>{o=!1,r=Oe(()=>n(i)),Mn()})};l==null||l(s,u),r&&Re(r),Pt(()=>{Li(a,()=>{o=!0;try{r=Oe(()=>{d(i,()=>s,()=>u)})}catch(f){Xt(f,a,null,a.ctx)}Mn(),o=!1})})},r=Oe(()=>n(i)),Mn()},mt|cn)}function Ze(e){ie===null&&vr(),Tt&&ie.l!==null?Xo(ie).m.push(e):pn(()=>{const t=Ke(e);if(typeof t=="function")return t})}function Xo(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const Jo="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jo);const Mr="https://www.playpilot.com",Sn="https://partner-api.playpilot.tech/1.0.0",Lr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",he=Object.freeze({ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error"});function ai(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}const Qo="https://insights.playpilot.net";async function pe(e,t=null,n={}){var r,a,o;const i=new Headers({"Content-Type":"application/json"});t&&(n={original_title:t.original_title,title_sid:t.sid,title_type:t.type,providers:[...new Set(((r=t.providers)==null?void 0:r.map(s=>s.name))||[])],...n}),n.url=ai(),n.organization_sid=(a=window.PlayPilotLinkInjections)==null?void 0:a.organization_sid,n.domain_sid=(o=window.PlayPilotLinkInjections)==null?void 0:o.domain_sid,fetch(Qo,{headers:i,method:"POST",body:JSON.stringify({event:e,payload:n,source:"ali"})}),$o({event:e,payload:n})}function $o(e){var t;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(t=window.PlayPilotLinkInjections.tracked_events)==null||t.push(e)}function el({organizationSid:e=null,domainSid:t=null}){window.PlayPilotLinkInjections.organization_sid=e||null,window.PlayPilotLinkInjections.domain_sid=t||null}const oi="EncryptedToken",Nr="articleReplacementEditToken",Dr="playpilot-editorial-mode";async function Or(e=window.location.href){const t=new Headers({"Content-Type":"application/json"});try{const n=In();if(!n)throw new Error("No token was provided");const i=li(e);if(!i)throw new Error("Could not be authenticated");const r=await fetch(Sn+`/external-pages/edit-authorization?api-token=${n}`,{headers:t,method:"POST",body:JSON.stringify({private_token:i})});if(!r.ok)throw r;return tl(i),!0}catch(n){console.error(n),pe(he.AuthFailed)}finally{rl()}return!1}function li(e=""){var i,r;const t=(i=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:i.editorial_token;if(t)return t;if(e){const a=new URL(e).searchParams.get(Nr);if(a)return decodeURI(a)}return((r=("; "+document.cookie).split(`; ${oi}=`).pop())==null?void 0:r.split(";")[0])||""}function tl(e){const t=new Date;t.setTime(t.getTime()+30*24*60*60*1e3);const i="expires="+t.toUTCString();document.cookie=oi+"="+e+";"+i+";path=/"}function nl(){document.cookie=oi+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function Rr(){var t;const e=(t=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:t.editorial_token;return new URLSearchParams(window.location.search).get(Dr)==="true"||!!e}function il(){const e=new URL(window.location.href);e.searchParams.set(Dr,"true"),window.history.replaceState({},"",e)}function rl(){const e=new URL(window.location.href);e.searchParams.delete(Nr),window.history.replaceState({},"",e)}function al(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t=t*31+i>>>0}return t.toString(16)}function qr(){return(Math.random()+1).toString(36).substring(7)}const h=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"}),ol={"Where To Stream Online":{[h.English]:"Where to stream online",[h.Swedish]:"Var kan man streama online",[h.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[h.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[h.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[h.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"An Error Occurred":{[h.English]:"An error occurred",[h.Swedish]:"Ett fel inträffade",[h.Danish]:"Der opstod en fejl"},"Title Unavailable":{[h.English]:"This title is not currently available to stream.",[h.Swedish]:"Den här titeln går inte att streama just nu.",[h.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[h.English]:"is not currently available to stream.",[h.Swedish]:"går inte att streama just nu.",[h.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[h.English]:"is available to stream on",[h.Swedish]:"finns att streama på",[h.Danish]:"kan streames på"},"Is Available To Stream":{[h.English]:"is available to stream.",[h.Swedish]:"finns att streama.",[h.Danish]:"kan streames."},"View Streaming Options":{[h.English]:"View streaming options",[h.Swedish]:"Se streamingalternativ",[h.Danish]:"Se streamingmuligheder"},And:{[h.English]:"and",[h.Swedish]:"och",[h.Danish]:"og"},Minutes:{[h.English]:"minutes",[h.Swedish]:"minuter",[h.Danish]:"minutter"},"Type: movie":{[h.English]:"Movie",[h.Swedish]:"Film",[h.Danish]:"Film"},"Type: series":{[h.English]:"Series",[h.Swedish]:"Serie",[h.Danish]:"Serie"},Stream:{[h.English]:"Stream",[h.Swedish]:"Streama",[h.Danish]:"Stream"},Buy:{[h.English]:"Buy",[h.Swedish]:"Köp",[h.Danish]:"Køb"},Rent:{[h.English]:"Rent",[h.Swedish]:"Hyra",[h.Danish]:"Lej"},"Rent Or Buy":{[h.English]:"Rent or Buy",[h.Swedish]:"Hyra",[h.Danish]:"Lej eller køb"},All:{[h.English]:"All",[h.Swedish]:"Alla",[h.Danish]:"Alle"},Unscripted:{[h.English]:"Unscripted",[h.Swedish]:"Oscripterat",[h.Danish]:"Umanuskriptet"},Independent:{[h.English]:"Independent",[h.Swedish]:"Indie",[h.Danish]:"Indie"},"Game Show":{[h.English]:"Game Show",[h.Swedish]:"Gameshow",[h.Danish]:"Quizshow"},"Film Noir":{[h.English]:"Film Noir",[h.Swedish]:"Film noir",[h.Danish]:"Film noir"},Entertainment:{[h.English]:"Entertainment",[h.Swedish]:"Underhållning",[h.Danish]:"Underholdning"},News:{[h.English]:"News",[h.Swedish]:"Nyheter",[h.Danish]:"Nyheder"},Short:{[h.English]:"Short",[h.Swedish]:"Kortfilm",[h.Danish]:"Kortfilm"},Bollywood:{[h.English]:"Bollywood",[h.Swedish]:"Bollywood",[h.Danish]:"Bollywood"},Concert:{[h.English]:"Concert",[h.Swedish]:"Konsert",[h.Danish]:"Koncert"},Arthouse:{[h.English]:"Arthouse",[h.Swedish]:"Arthouse",[h.Danish]:"Arthouse"},"Alternate Version":{[h.English]:"Alternate Version",[h.Swedish]:"Alternativ version",[h.Danish]:"Alternativ version"},"Reality TV":{[h.English]:"Reality TV",[h.Swedish]:"Reality-TV",[h.Danish]:"Reality-TV"},Culture:{[h.English]:"Culture",[h.Swedish]:"Kultur",[h.Danish]:"Kultur"},Drama:{[h.English]:"Drama",[h.Swedish]:"Drama",[h.Danish]:"Drama"},Crime:{[h.English]:"Crime",[h.Swedish]:"Kriminal",[h.Danish]:"Krimi"},Western:{[h.English]:"Western",[h.Swedish]:"Western",[h.Danish]:"Western"},Thriller:{[h.English]:"Thriller",[h.Swedish]:"Thriller",[h.Danish]:"Thriller"},Animation:{[h.English]:"Animation",[h.Swedish]:"Animerat",[h.Danish]:"Animation"},Mystery:{[h.English]:"Mystery",[h.Swedish]:"Mysterium",[h.Danish]:"Mysterium"},Science:{[h.English]:"Science",[h.Swedish]:"Vetenskap",[h.Danish]:"Videnskab"},Nature:{[h.English]:"Nature",[h.Swedish]:"Natur",[h.Danish]:"Natur"},War:{[h.English]:"War",[h.Swedish]:"Krig",[h.Danish]:"Krig"},"Sci-Fi":{[h.English]:"Sci-Fi",[h.Swedish]:"Sci-fi",[h.Danish]:"Sci-fi"},Documentary:{[h.English]:"Documentary",[h.Swedish]:"Dokumentär",[h.Danish]:"Dokumentar"},"Stand-up":{[h.English]:"Stand-up",[h.Swedish]:"Standup",[h.Danish]:"Stand-up"},"Talk Show":{[h.English]:"Talk Show",[h.Swedish]:"Talkshow",[h.Danish]:"Talkshow"},Fantasy:{[h.English]:"Fantasy",[h.Swedish]:"Fantasy",[h.Danish]:"Fantasy"},History:{[h.English]:"History",[h.Swedish]:"Historia",[h.Danish]:"Historie"},Adventure:{[h.English]:"Adventure",[h.Swedish]:"Äventyr",[h.Danish]:"Eventyr"},Action:{[h.English]:"Action",[h.Swedish]:"Action",[h.Danish]:"Action"},Horror:{[h.English]:"Horror",[h.Swedish]:"Skräck",[h.Danish]:"Gyser"},Comedy:{[h.English]:"Comedy",[h.Swedish]:"Komedi",[h.Danish]:"Komedie"},Biography:{[h.English]:"Biography",[h.Swedish]:"Biografi",[h.Danish]:"Biografi"},Music:{[h.English]:"Music",[h.Swedish]:"Musik",[h.Danish]:"Musik"},Sport:{[h.English]:"Sport",[h.Swedish]:"Sport",[h.Danish]:"Sport"},Romance:{[h.English]:"Romance",[h.Swedish]:"Romantik",[h.Danish]:"Romantik"},Kids:{[h.English]:"Kids",[h.Swedish]:"Barn",[h.Danish]:"Børn"},Lifestyle:{[h.English]:"Lifestyle",[h.Swedish]:"Livsstil",[h.Danish]:"Livsstil"},Musical:{[h.English]:"Musical",[h.Swedish]:"Musikal",[h.Danish]:"Musical"},Anime:{[h.English]:"Anime",[h.Swedish]:"Anime",[h.Danish]:"Anime"},Family:{[h.English]:"Family",[h.Swedish]:"Familj",[h.Danish]:"Familie"}};function be(e,t=Hr()){var n;return((n=ol[e])==null?void 0:n[t])||e}function Hr(){var i,r;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.language,t=Object.values(h);if(e){if(t.includes(e))return e;console.warn(`PlayPilot Link Injections: ${e} is not an accepted language`)}const n=(r=document.querySelector("html"))==null?void 0:r.getAttribute("lang");if(n){if(t.includes(n))return n;const a=t.find(o=>o.toLowerCase().startsWith(n+"-"));if(a)return a}return h.English}const ll=e=>e;function si(e){const t=e-1;return t*t*t+1}function Ni(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}function Ft(e,{delay:t=0,duration:n=400,easing:i=ll}={}){const r=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:a=>`opacity: ${a*r}`}}function En(e,{delay:t=0,duration:n=400,easing:i=si,x:r=0,y:a=0,opacity:o=0}={}){const s=getComputedStyle(e),l=+s.opacity,d=s.transform==="none"?"":s.transform,u=l*(1-o),[f,_]=Ni(r),[m,g]=Ni(a);return{delay:t,duration:n,easing:i,css:(v,p)=>`
|
|
4
|
-
transform: ${
|
|
5
|
-
opacity: ${
|
|
6
|
-
transform: ${
|
|
7
|
-
opacity: ${
|
|
8
|
-
`}}Ia();var cl=Le('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M14 2L2 14M2 2L14 14" stroke="currentColor" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Br(e){var t=cl();k(e,t)}function ci(e,t){ae(t,!0);const n=L(t,"size",3,"margin(2)"),i=L(t,"onclick",3,()=>null),r=Ko(t,["$$slots","$$events","$$legacy","children","size","onclick"]);var a=Fe(),o=ne(a);Po(o,()=>t.href?"a":"button",!1,(s,l)=>{let d;N(()=>{d=Lo(s,d,{role:t.href?"link":"button",onclick:i(),class:"button",...r},"svelte-1qqv88o",s.namespaceURI===Ji,s.nodeName.includes("-")),xn(s,"--size",n())});var u=Fe(),f=ne(u);Ct(f,()=>t.children??st),k(l,u)}),k(e,a),oe()}function ul(e){P(e,e.v+1)}function dl(e){let t=0,n=Ee(0),i;return()=>{Za()&&(c(n),yn(()=>(t===0&&(i=Ke(()=>e(()=>ul(n)))),t+=1,()=>{Bn().then(()=>{t-=1,t===0&&(i==null||i(),i=void 0)})})))}}var zt,Wt;class fl{constructor(t,n){Cn(this,zt);Cn(this,Wt);jn(this,zt,t),jn(this,Wt,dl(n))}get current(){return Pn(this,Wt).call(this),Pn(this,zt).call(this)}}zt=new WeakMap,Wt=new WeakMap;const vl=/\(.+\)/;class _l extends fl{constructor(t,n){let i=vl.test(t)?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,a=>ko(r,"change",a))}}const ui=new _l("(prefers-reduced-motion: reduce)");var hl=(e,t)=>t()(),gl=I('<div class="modal svelte-aqwna4"><div class="dialog svelte-aqwna4" role="dialog" aria-labelledby="title" data-view-transition-new=""><div class="close svelte-aqwna4"><!></div> <!></div> <div class="backdrop svelte-aqwna4"></div></div>');function Fr(e,t){ae(t,!0);const n=L(t,"onclose",3,()=>null),i=L(t,"onscroll",3,()=>null);br("scope","modal"),Ze(()=>{const f=document.body.style.overflowY;return document.body.style.overflowY="hidden",()=>document.body.style.overflowY=f||""});function r(f){return ui.current?Ft(f,{duration:0}):window.innerWidth<600?En(f,{duration:250,y:window.innerHeight}):sl(f,{duration:150,start:.85})}var a=gl();ce("keydown",we,({key:f})=>{f==="Escape"&&n()()});var o=b(a),s=b(o),l=b(s);ci(l,{onclick:()=>n()(),children:(f,_)=>{Br(f)},$$slots:{default:!0}});var d=E(s,2);Ct(d,()=>t.children);var u=E(o,2);u.__click=[hl,n],ce("scroll",o,function(...f){var _;(_=i())==null||_.apply(this,f)}),je(7,o,()=>r),je(7,a,()=>Ft,()=>({duration:150})),k(e,a),oe()}fe(["click"]);const ml=[{slug:"100",name:"All",categories:{movie:100,series:100,documentary:100,kids:100,cinema:100,podcasts:100}},{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];var pl=I('<div class="genre svelte-1ebula3"> </div>'),yl=(e,t)=>P(t,!0),wl=I('<button class="genre expand svelte-1ebula3"> </button>'),kl=I("<!> <!>",1);function bl(e,t){ae(t,!0);let n=U(!1);const i=K(()=>c(n)?t.genres:[t.genres[0]]);var r=kl(),a=ne(r);at(a,17,()=>c(i),xt,(l,d)=>{var u=Fe();const f=K(()=>{var g;return(g=ml.find(v=>v.slug===c(d)))==null?void 0:g.name});var _=ne(u);{var m=g=>{var v=pl(),p=b(v);N(()=>G(p,be(c(f)))),k(g,v)};q(_,g=>{c(f)&&g(m)})}k(l,u)});var o=E(a,2);{var s=l=>{var d=wl();d.__click=[yl,n];var u=b(d);N(()=>G(u,`+${t.genres.length-1}`)),k(l,d)};q(o,l=>{!c(n)&&t.genres.length>1&&l(s)})}k(e,r),oe()}fe(["click"]);function xl(e){let t=[];for(const n of e){let i=n;const r=t.find(s=>s.name===i.name),a=r==null?void 0:r.extra_info.category,o=i.extra_info.category;(a==="RENT"&&o==="BUY"||a==="BUY"&&o==="RENT")&&(t=t.filter(s=>s.name!==i.name),i={...i,extra_info:{...i.extra_info,category:"TVOD"}}),t.push(i)}return t}function xe(e,t=1){e.role="heading",e.ariaLevel=t.toString()}var Sl=Le('<svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 11L5 6L0 1" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function El(e){var t=Sl();k(e,t)}function Ut(e){return e?e.replace("/src/img",""):null}var Tl=(e,t,n)=>t(n()),Il=I('<div class="arrow svelte-g63n1y"><!></div>'),Al=I('<a target="_blank" class="playlink svelte-g63n1y" rel="sponsored"><img alt="" height="32" width="32" class="svelte-g63n1y"> <div><span class="name svelte-g63n1y"> </span> <div class="category svelte-g63n1y"> </div></div> <!></a>'),Pl=I('<div class="playlink empty svelte-g63n1y"> </div>'),Cl=I('<div class="heading svelte-g63n1y"> </div> <div class="playlinks svelte-g63n1y"><!> <!></div>',1);function jl(e,t){ae(t,!0);const n=L(t,"list",3,!1),i=so("scope")==="modal",r=K(()=>t.playlinks.filter(v=>!!v.logo_url)),a=K(()=>xl(c(r))),o={SVOD:be("Stream"),BUY:be("Buy"),RENT:be("Rent"),TVOD:be("Rent Or Buy")};function s(v){pe(i?he.TitleModalPlaylinkClick:he.TitlePopoverPlaylinkClick,t.title,{playlink:v})}var l=Cl(),d=ne(l),u=b(d);N(()=>G(u,be("Where To Stream Online"))),Qt(d,(v,p)=>xe==null?void 0:xe(v,p),()=>3);var f=E(d,2),_=b(f);at(_,17,()=>c(a),xt,(v,p)=>{let y=()=>c(p).name,w=()=>c(p).url,S=()=>c(p).logo_url,j=()=>c(p).highlighted,x=()=>c(p).cta_text,T=()=>c(p).extra_info.category;var H=Al();H.__click=[Tl,s,y];var M=b(H);N(()=>ue(M,"src",Ut(S())));var A=E(M,2),O=b(A),C=b(O),B=E(O,2),D=b(B);N(()=>G(D,x()||o[T()]||be("Stream")));var z=E(A,2);{var F=V=>{var W=Il(),J=b(W);El(J),k(V,W)};q(z,V=>{n()&&V(F)})}N(()=>{ue(H,"href",w()),ue(H,"data-playlink",y()),se(H,"highlighted",j()&&x()),G(C,y())}),k(v,H)});var m=E(_,2);{var g=v=>{var p=Pl(),y=b(p);N(()=>G(y,be("Title Unavailable"))),k(v,p)};q(m,v=>{t.playlinks.length||v(g)})}N(()=>se(f,"list",n())),k(e,l),oe()}fe(["click"]);var Ml=(e,t)=>P(t,!0),Ll=I('<button class="show-more svelte-1u3je71">Show more</button>'),Nl=I('<div class="paragraph svelte-1u3je71" role="paragraph"> </div>'),Dl=I('<div><span class="paragraph svelte-1u3je71" role="paragraph"> <!> <!></span> <!></div>');function Ol(e,t){ae(t,!0);const n=L(t,"blurb",3,""),i=L(t,"limit",3,200);let r=U(!1);const a=K(()=>t.text.slice(0,i()));var o=Dl(),s=b(o),l=b(s),d=E(l);{var u=v=>{var p=Be("...");k(v,p)};q(d,v=>{!c(r)&&t.text.length>i()&&v(u)})}var f=E(d,2);{var _=v=>{var p=Ll();p.__click=[Ml,r],k(v,p)};q(f,v=>{!c(r)&&(t.text.length>i()||n())&&v(_)})}var m=E(s,2);{var g=v=>{var p=Nl(),y=b(p);N(()=>G(y,n())),k(v,p)};q(m,v=>{c(r)&&v(g)})}N(()=>G(l,c(r)?t.text:c(a))),k(e,o),oe()}fe(["click"]);var Rl=Le('<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 0.351929L9.163 4.72803L14 5.43408L10.5 8.8385L11.326 13.648L7 11.3761L2.674 13.648L3.5 8.8385L0 5.43408L4.837 4.72803L7 0.351929Z" fill="#F6C045"></path></svg>');function Vr(e){var t=Rl();k(e,t)}var ql=I('<div class="top svelte-1026zg0"><img class="poster svelte-1026zg0"></div>'),Hl=I("<div> </div>"),Bl=I('<img alt="" class="svelte-1026zg0">'),Fl=I('<div class="content svelte-1026zg0" data-playpilot-link-injections-title=""><div class="header svelte-1026zg0"><!> <div class="heading svelte-1026zg0" id="title"> </div> <div class="info svelte-1026zg0"><div class="imdb svelte-1026zg0"><!> </div> <!> <div> </div> <div class="capitalize svelte-1026zg0"> </div> <!></div></div> <div class="main"><!> <!></div></div> <div class="background svelte-1026zg0"><!></div>',1);function Ur(e,t){ae(t,!0);const n=L(t,"small",3,!1),i=L(t,"compact",3,!1);let r=U(!1),a=U(!1),o=U(!1);var s=Fl(),l=ne(s),d=b(l),u=b(d);{var f=F=>{var V=ql(),W=b(V);N(()=>ue(W,"src",Ut(t.title.standing_poster))),N(()=>{ue(W,"alt",`Movie poster for '${t.title.title??""}'`),se(W,"loaded",c(r))}),ce("load",W,()=>P(r,!0)),k(F,V)};q(u,F=>{i()||F(f)})}var _=E(u,2),m=b(_);Qt(_,(F,V)=>xe==null?void 0:xe(F,V),()=>2);var g=E(_,2),v=b(g),p=b(v);Vr(p);var y=E(p),w=E(v,2);bl(w,{get genres(){return t.title.genres}});var S=E(w,2),j=b(S),x=E(S,2),T=b(x);N(()=>G(T,be(`Type: ${t.title.type}`)));var H=E(x,2);{var M=F=>{var V=Hl(),W=b(V);N(()=>G(W,`${t.title.length??""} ${be("Minutes")??""}`)),k(F,V)};q(H,F=>{!n()&&t.title.length&&F(M)})}var A=E(d,2),O=b(A);jl(O,{get playlinks(){return t.title.providers},get title(){return t.title},list:!0});var C=E(O,2);{var B=F=>{Ol(F,{get text(){return t.title.description},get blurb(){return t.title.blurb}})};q(C,F=>{n()||F(B)})}var D=E(l,2),z=b(D);Ir(z,()=>c(o),F=>{var V=Bl();N(()=>ue(V,"src",Ut(c(o)?t.title.standing_poster:t.title.medium_poster))),N(()=>{se(V,"loaded",c(a)),se(V,"blur",c(o))}),ce("load",V,()=>P(a,!0)),ce("error",V,()=>P(o,!0)),k(F,V)}),N(()=>{se(l,"small",n()),se(l,"compact",i()),se(_,"truncate",n()),G(m,t.title.title),G(y,` ${t.title.imdb_score??""}`),G(j,t.title.year),se(D,"faded",i())}),k(e,s),oe()}function Vl(e,t){ae(t,!0),pe(he.TitleModalView,t.title);let n=!1;Ze(()=>{const r=Date.now();return()=>pe(he.TitleModalClose,t.title,{time_spent:Date.now()-r})});function i(){n||(pe(he.TitleModalScroll,t.title),n=!0)}Fr(e,{get onclose(){return t.onclose},onscroll:i,children:(r,a)=>{Ur(r,{get title(){return t.title}})},$$slots:{default:!0}}),oe()}var Ul=I('<div class="popover svelte-tb2xdq" tabindex="-1" aria-hidden="true"><div class="dialog svelte-tb2xdq" data-view-transition-old=""><!></div></div>');function zl(e,t){ae(t,!0);let n=L(t,"maxHeight",15);br("scope","popover");let i=U(null),r=U(!1);Ze(async()=>{await Bn(),a(),await Bn(),o()});function a(){if(!c(i))return;const{top:f,right:_,bottom:m,height:g}=c(i).getBoundingClientRect(),v=s();P(r,X(f-v<0&&window.innerHeight-m>f+g));const p=window.innerWidth-_-v;_+v>window.innerWidth&&(c(i).style.left=`${p}px`)}function o(){if(!c(i))return;const{top:f,height:_}=c(i).getBoundingClientRect(),m=s(),g=c(r)?window.innerHeight-f-m:f+_-m;n(Math.min(g,window.innerHeight*.8))}function s(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}var l=Ul(),d=b(l),u=b(d);Ct(u,()=>t.children),$t(l,f=>P(i,f),()=>c(i)),N(()=>{se(l,"flip",c(r)),xn(l,"--max-height",n()?n()+"px":null)}),je(7,d,()=>En,()=>({duration:ui.current?0:100,y:10})),k(e,l),oe()}var Wl=I('<div class="title-popover svelte-d86q0q" data-playpilot-title-popover="" role="region" aria-labelledby="title"><!></div>');function Kl(e,t){ae(t,!0);let n=U(0),i=U(null);pe(he.TitlePopoverView,t.title),Ze(()=>{r();const s=Date.now();return()=>pe(he.TitlePopoverClose,t.title,{time_spent:Date.now()-s})});function r(){const s=t.event.target;if(!(s!=null&&s.getClientRects))return;const l=Array.from(s.getClientRects()),u=l.map(_=>_.x).map(_=>Math.abs(_-t.event.clientX)),f=l[u.indexOf(Math.min(...u))];c(i).style.top=f.top+window.scrollY+"px",c(i).style.left=f.left+window.scrollX+"px",c(i).style.height=f.height+"px"}var a=Wl(),o=b(a);zl(o,{get maxHeight(){return c(n)},set maxHeight(s){P(n,X(s))},children:(s,l)=>{var d=K(()=>!!c(n)&&c(n)<250);Ur(s,{get title(){return t.title},small:!0,get compact(){return c(d)}})},$$slots:{default:!0}}),$t(a,s=>P(i,s),()=>c(i)),k(e,a),oe()}var Yl=e=>e.stopPropagation(),Zl=(e,t,n,i)=>t(e,c(n).title_details,c(i)),Gl=I(' <span class="svelte-pfvkex"><button class="svelte-pfvkex"> </button></span>',1),Xl=(e,t,n,i)=>t(c(n).title_details,i()),Jl=I('<!> <a target="_blank"> </a>',1),Ql=I(" <!>.",1),$l=I("<!> <br>",1),es=I(" <br>",1),ts=I('<span class="svelte-pfvkex"><!></span>'),ns=I('<p class="svelte-pfvkex"></p>');function is(e,t){ae(t,!0);const n=L(t,"onclickmodal",3,()=>null);function i(l,d){pe(he.AfterArticlePlaylinkClick,l,{playlink:d})}function r(l,d,u){pe(he.AfterArticleModalButtonClick,d),n()(l,u)}var a=Fe(),o=ne(a);{var s=l=>{var d=ns();at(d,21,()=>t.linkInjections,xt,(u,f)=>{var _=ts();const m=K(()=>{const{key:w,title:S,title_details:j,after_article_style:x}=c(f);return{key:w,title:S,title_details:j,after_article_style:x}}),g=K(()=>{var w;return((w=c(m).title_details)==null?void 0:w.providers)||[]});var v=b(_);{var p=w=>{var S=$l(),j=ne(S);{var x=H=>{var M=Gl(),A=ne(M);N(()=>G(A,`"${c(m).title??""}" ${be("Is Available To Stream")??""} `));var O=E(A);O.__click=[Yl];var C=b(O);C.__click=[Zl,r,m,f];var B=b(C);N(()=>G(B,be("View Streaming Options"))),k(H,M)},T=H=>{var M=Ql(),A=ne(M);N(()=>G(A,`"${c(m).title??""}" ${be("Is Available To Stream On")??""} `));var O=E(A);at(O,17,()=>c(g),xt,(C,B,D)=>{let z=()=>c(B).name,F=()=>c(B).url;var V=Jl(),W=ne(V);{var J=de=>{var Ae=Be();N(()=>G(Ae,D===c(g).length-1?`, ${be("And")}`:",")),k(de,Ae)};q(W,de=>{D&&de(J)})}var ee=E(W,2);ee.__click=[Xl,i,m,z];var re=b(ee);N(()=>{ue(ee,"href",F()),G(re,z())}),k(C,V)}),k(H,M)};q(j,H=>{c(m).after_article_style==="modal_button"?H(x):H(T,!1)})}k(w,S)},y=w=>{var S=es(),j=ne(S);N(()=>G(j,`"${c(m).title??""}" ${be("Title Unavailable Suffix")??""} `)),k(w,S)};q(v,w=>{c(g).length?w(p):w(y,!1)})}N(()=>ue(_,"data-playpilot-injection-key",c(m).key)),k(u,_)}),k(l,d)};q(o,l=>{t.linkInjections.length&&l(s)})}k(e,a),oe()}fe(["click"]);function rs(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function di(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||""}function Di(e,t,n=[]){var a,o;const i=document.createTreeWalker(t);let r;for(;(r=i.nextNode())&&!((a=r.nodeValue)!=null&&a.includes(e)&&!n.includes(((o=r.parentNode)==null?void 0:o.nodeName)||"")););return r}function Oi(e){const t=e.parentNode;return t?t.nodeName==="A"||!!t.closest("a"):!1}function as(e,t,n,i){const r=rs(t),a=di(t),o=e.slice(0,i),s=e.slice(i),l=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${a.replace(l,"\\$&")}|${r.replace(l,"\\$&")}`),u=s.replace(d,n);return o+u}function os(e,t,n,i){return e.substring(0,n)+t+e.substring(i)}function Te(e){return di(e).toLowerCase().replace(/\s+/g,"")}function zr(e,t,n){const r=e.indexOf(t),a=Math.floor((n-t.length)/2);let o=Math.max(0,r-a),s=o+n;s>e.length&&(s=e.length,o=Math.max(0,s-n));let l=e.slice(o,s).trim();return o>0&&(l="…"+l),s<e.length&&(l+="…"),l}function ls(e,t,n){const i=e.nodeType===Node.TEXT_NODE&&e.parentNode?e.parentElement:e;if(!i||!e.textContent)return{before:"",after:""};const r=i.innerText.indexOf(e.textContent),a=Ri(i.innerText.slice(0,t+r)),o=i.innerText.slice(n+r),s=Ri(qi(a,2)),l=qi(o,2);return{before:s,after:l}}function Ri(e){return e.split("").reverse().join("")}function qi(e,t=1){const n=e.match(/[^\s]+/g);return n?n.slice(0,t).join(" ").replace(/[.,!?;:]+$/u,""):""}function ss(e,t){let n=0,i=0;for(;(i=e.indexOf(t,i))!==-1;)n++,i+=t.length;return n}function cs(e,t,n){const i=[];let r=0;for(;r<=e.length;){const a=t?e.indexOf(t,r):r;if(a===-1&&t)break;const o=t?a+t.length:a,s=n?e.indexOf(n,o):e.length;if(n&&s===-1)break;const l=e.slice(o,s);i.push({match:l,index:o}),r=n?s+n.length:e.length+1}return i}function us(e,t,n,i){const a=cs(e,n,i).filter(({match:s})=>di(s).includes(t));return a.length?a.reduce((s,l)=>!s||l.match.length<s.match.length?l:s):null}function ds(e){var t,n;return{leadingSpaces:((t=e.match(/^\s*/))==null?void 0:t[0].length)||0,trailingSpaces:((n=e.match(/\s*$/))==null?void 0:n[0].length)||0}}function Wr(e){return e.ctrlKey||e.metaKey||e.button!==0}function fs(e,t){if(!document.startViewTransition||!t){e();return}document.startViewTransition(()=>{const n=document.querySelector("[data-view-transition-old]");if(!n)return;const i=window.getComputedStyle(n).getPropertyValue("view-transition-name");n.style.viewTransitionName="none",e();const r=document.querySelector("[data-view-transition-new]");r&&(r.style.viewTransitionName=i)})}const ut="data-playpilot-injection-key",Nt=`[${ut}]`;let vn=null,dt=null,Dt=null,Ot=null;function fi(e,t=""){const n=[],i=[e];for(;i.length>0;){const r=i.pop();if(n.includes(r)||t&&r.matches(t)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|H1)$/.test(r.tagName)||r.offsetWidth<=1)continue;const a=Array.from(r.childNodes).some(l=>{var d;return l.nodeType===Node.TEXT_NODE&&((d=l.nodeValue)==null?void 0:d.trim())!==""});if(a&&r.tagName==="LI"){const l=r.closest("ul, ol");l&&!n.includes(l)&&n.push(l);continue}const o=r.tagName==="P"&&!!r.textContent;if(a||o){n.push(r);continue}const s=Array.from(r.children);for(let l=s.length-1;l>=0;l--)i.push(s[l])}return n}function St(){var t;const e=(t=window.PlayPilotLinkInjections)==null?void 0:t.selector;if(e){const n=e.replace(/(:)/g,"\\$1"),i=document.querySelector(n);if(i)return i}return document.querySelector("article")||document.querySelector("main")||document.body}function Kr(e){return e.map(t=>t.innerText).join(`
|
|
3
|
+
var yi=e=>{throw TypeError(e)};var wi=(e,t,n)=>t.has(e)||yi("Cannot "+n);var Cn=(e,t,n)=>(wi(e,t,"read from private field"),n?n.call(e):t.get(e)),Pn=(e,t,n)=>t.has(e)?yi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jn=(e,t,n,i)=>(wi(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();const Dn=!1;var Yn=Array.isArray,ca=Array.prototype.indexOf,Zn=Array.from,ua=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,Ui=Object.getOwnPropertyDescriptors,da=Object.prototype,fa=Array.prototype,Gn=Object.getPrototypeOf;function wt(e){return typeof e=="function"}const st=()=>{};function va(e){for(var t=0;t<e.length;t++)e[t]()}function sn(e,t,n=!1){return e===void 0?n?t():t:e}const He=2,zi=4,Kt=8,hn=16,Ve=32,Yt=64,cn=128,gt=256,un=512,Me=1024,rt=2048,gn=4096,Ue=8192,Et=16384,Wi=32768,mt=65536,_a=1<<17,Ki=1<<19,Yi=1<<20,ze=Symbol("$state"),Zi=Symbol("legacy props"),ha=Symbol("");function Gi(e){return e===this.v}function Xn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ga(e,t){return e!==t}function Jn(e){return!Xn(e,this.v)}function ma(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function pa(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ya(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wa(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ka(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ba(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function xa(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Sa(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Ea(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Tt=!1,Ta=!1;function Ia(){Tt=!0}const Qn=1,$n=2,Xi=4,Aa=8,Ca=16,Pa=1,ja=2,Ma=4,La=8,Na=16,Oa=1,Da=2,Ra=4,qa=1,Ha=2,ke=Symbol(),Ji="http://www.w3.org/2000/svg";function Ee(e,t){var n={f:0,v:e,reactions:null,equals:Gi,rv:0,wv:0};return n}function U(e){return Ba(Ee(e))}function Qi(e,t=!1){var i;const n=Ee(e);return t||(n.equals=Jn),Tt&&ie!==null&&ie.l!==null&&((i=ie.l).s??(i.s=[])).push(n),n}function Ba(e){return $!==null&&$.f&He&&(We===null?eo([e]):We.push(e)),e}function C(e,t){return $!==null&&Zt()&&$.f&(He|hn)&&(We===null||!We.includes(e))&&Ea(),Rn(e,t)}function Rn(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=gr(),$i(e,rt),Zt()&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&(ye!==null&&ye.includes(e)?(Ye(Z,rt),kn(Z)):it===null?to([e]):it.push(e))),t}function $i(e,t){var n=e.reactions;if(n!==null)for(var i=Zt(),r=n.length,a=0;a<r;a++){var o=n[a],l=o.f;l&rt||!i&&o===Z||(Ye(o,t),l&(Me|gt)&&(l&He?$i(o,gn):kn(o)))}}let er=!1;function X(e,t=null,n){if(typeof e!="object"||e===null||ze in e)return e;const i=Gn(e);if(i!==da&&i!==fa)return e;var r=new Map,a=Yn(e),o=Ee(0);a&&r.set("length",Ee(e.length));var l;return new Proxy(e,{defineProperty(c,s,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&ba();var f=r.get(s);return f===void 0?(f=Ee(d.value),r.set(s,f)):C(f,X(d.value,l)),!0},deleteProperty(c,s){var d=r.get(s);if(d===void 0)s in c&&r.set(s,Ee(ke));else{if(a&&typeof s=="string"){var f=r.get("length"),v=Number(s);Number.isInteger(v)&&v<f.v&&C(f,v)}C(d,ke),ki(o)}return!0},get(c,s,d){var g;if(s===ze)return e;var f=r.get(s),v=s in c;if(f===void 0&&(!v||(g=nt(c,s))!=null&&g.writable)&&(f=Ee(X(v?c[s]:ke,l)),r.set(s,f)),f!==void 0){var m=u(f);return m===ke?void 0:m}return Reflect.get(c,s,d)},getOwnPropertyDescriptor(c,s){var d=Reflect.getOwnPropertyDescriptor(c,s);if(d&&"value"in d){var f=r.get(s);f&&(d.value=u(f))}else if(d===void 0){var v=r.get(s),m=v==null?void 0:v.v;if(v!==void 0&&m!==ke)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return d},has(c,s){var m;if(s===ze)return!0;var d=r.get(s),f=d!==void 0&&d.v!==ke||Reflect.has(c,s);if(d!==void 0||Z!==null&&(!f||(m=nt(c,s))!=null&&m.writable)){d===void 0&&(d=Ee(f?X(c[s],l):ke),r.set(s,d));var v=u(d);if(v===ke)return!1}return f},set(c,s,d,f){var S;var v=r.get(s),m=s in c;if(a&&s==="length")for(var g=d;g<v.v;g+=1){var _=r.get(g+"");_!==void 0?C(_,ke):g in c&&(_=Ee(ke),r.set(g+"",_))}v===void 0?(!m||(S=nt(c,s))!=null&&S.writable)&&(v=Ee(void 0),C(v,X(d,l)),r.set(s,v)):(m=v.v!==ke,C(v,X(d,l)));var p=Reflect.getOwnPropertyDescriptor(c,s);if(p!=null&&p.set&&p.set.call(f,d),!m){if(a&&typeof s=="string"){var y=r.get("length"),w=Number(s);Number.isInteger(w)&&w>=y.v&&C(y,w+1)}ki(o)}return!0},ownKeys(c){u(o);var s=Reflect.ownKeys(c).filter(v=>{var m=r.get(v);return m===void 0||m.v!==ke});for(var[d,f]of r)f.v!==ke&&!(d in c)&&s.push(d);return s},setPrototypeOf(){xa()}})}function ki(e,t=1){C(e,e.v+t)}function bi(e){return e!==null&&typeof e=="object"&&ze in e?e[ze]:e}function Fa(e,t){return Object.is(bi(e),bi(t))}var we,tr,nr;function Va(){if(we===void 0){we=window;var e=Element.prototype,t=Node.prototype;tr=nt(t,"firstChild").get,nr=nt(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function It(e=""){return document.createTextNode(e)}function ft(e){return tr.call(e)}function mn(e){return nr.call(e)}function x(e,t){return ft(e)}function ne(e,t){{var n=ft(e);return n instanceof Comment&&n.data===""?mn(n):n}}function E(e,t=1,n=!1){let i=e;for(;t--;)i=mn(i);return i}function Ua(e){e.textContent=""}function K(e){var t=He|rt;Z===null?t|=gt:Z.f|=Yi;var n=$!==null&&$.f&He?$:null;const i={children:null,ctx:ie,deps:null,equals:Gi,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??Z};return n!==null&&(n.children??(n.children=[])).push(i),i}function za(e){const t=K(e);return t.equals=Jn,t}function ir(e){var t=e.children;if(t!==null){e.children=null;for(var n=0;n<t.length;n+=1){var i=t[n];i.f&He?ei(i):Re(i)}}}function Wa(e){for(var t=e.parent;t!==null;){if(!(t.f&He))return t;t=t.parent}return null}function rr(e){var t,n=Z;Ie(Wa(e));try{ir(e),t=mr(e)}finally{Ie(n)}return t}function ar(e){var t=rr(e),n=(tt||e.f>)&&e.deps!==null?gn:Me;Ye(e,n),e.equals(t)||(e.v=t,e.wv=gr())}function ei(e){ir(e),Bt(e,0),Ye(e,Et),e.v=e.children=e.deps=e.ctx=e.reactions=null}function Ka(e){Z===null&&$===null&&ya(),$!==null&&$.f>&&pa(),ni&&ma()}function Ya(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function At(e,t,n,i=!0){var r=(e&Yt)!==0,a=Z,o={ctx:ie,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|rt,first:null,fn:t,last:null,next:null,parent:r?null:a,prev:null,teardown:null,transitions:null,wv:0};if(n){var l=kt;try{xi(!0),wn(o),o.f|=Wi}catch(d){throw Re(o),d}finally{xi(l)}}else t!==null&&kn(o);var c=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&Yi)===0;if(!c&&!r&&i&&(a!==null&&Ya(o,a),$!==null&&$.f&He)){var s=$;(s.children??(s.children=[])).push(o)}return o}function Za(){return $===null?!1:!tt}function Ga(e){const t=At(Kt,null,!1);return Ye(t,Me),t.teardown=e,t}function pn(e){Ka();var t=Z!==null&&(Z.f&Ve)!==0&&ie!==null&&!ie.m;if(t){var n=ie;(n.e??(n.e=[])).push({fn:e,effect:Z,reaction:$})}else{var i=pt(e);return i}}function Xa(e){const t=At(Yt,e,!0);return(n={})=>new Promise(i=>{n.outro?vt(t,()=>{Re(t),i(void 0)}):(Re(t),i(void 0))})}function pt(e){return At(zi,e,!1)}function yn(e){return At(Kt,e,!0)}function N(e){return Je(e)}function Je(e,t=0){return At(Kt|hn|t,e,!0)}function De(e,t=!0){return At(Kt|Ve,e,!0,t)}function or(e){var t=e.teardown;if(t!==null){const n=ni,i=$;Si(!0),qe(null);try{t.call(null)}finally{Si(n),qe(i)}}}function lr(e){var t=e.deriveds;if(t!==null){e.deriveds=null;for(var n=0;n<t.length;n+=1)ei(t[n])}}function sr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;Re(n,t),n=i}}function Ja(e){for(var t=e.first;t!==null;){var n=t.next;t.f&Ve||Re(t),t=n}}function Re(e,t=!0){var n=!1;if((t||e.f&Ki)&&e.nodes_start!==null){for(var i=e.nodes_start,r=e.nodes_end;i!==null;){var a=i===r?null:mn(i);i.remove(),i=a}n=!0}sr(e,t&&!n),lr(e),Bt(e,0),Ye(e,Et);var o=e.transitions;if(o!==null)for(const c of o)c.stop();or(e);var l=e.parent;l!==null&&l.first!==null&&cr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function cr(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function vt(e,t){var n=[];ti(e,n,!0),ur(n,()=>{Re(e),t&&t()})}function ur(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var r of e)r.out(i)}else t()}function ti(e,t,n){if(!(e.f&Ue)){if(e.f^=Ue,e.transitions!==null)for(const o of e.transitions)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var r=i.next,a=(i.f&mt)!==0||(i.f&Ve)!==0;ti(i,t,a?n:!1),i=r}}}function Rt(e){dr(e,!0)}function dr(e,t){if(e.f&Ue){Gt(e)&&wn(e),e.f^=Ue;for(var n=e.first;n!==null;){var i=n.next,r=(n.f&mt)!==0||(n.f&Ve)!==0;dr(n,r?t:!1),n=i}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}let dn=!1,qn=[];function fr(){dn=!1;const e=qn.slice();qn=[],va(e)}function Ct(e){dn||(dn=!0,queueMicrotask(fr)),qn.push(e)}function Qa(){dn&&fr()}function vr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const _r=0,$a=1;let Mt=!1,ln=_r,qt=!1,Ht=null,kt=!1,ni=!1;function xi(e){kt=e}function Si(e){ni=e}let ct=[],bt=0;let $=null;function qe(e){$=e}let Z=null;function Ie(e){Z=e}let We=null;function eo(e){We=e}let ye=null,Pe=0,it=null;function to(e){it=e}let hr=1,Hn=0,tt=!1,ie=null;function Ei(e){ie=e}function gr(){return++hr}function Zt(){return!Tt||ie!==null&&ie.l===null}function Gt(e){var s;var t=e.f;if(t&rt)return!0;if(t&gn){var n=e.deps,i=(t>)!==0;if(n!==null){var r,a,o=(t&un)!==0,l=i&&Z!==null&&!tt,c=n.length;if(o||l){for(r=0;r<c;r++)a=n[r],(o||!((s=a==null?void 0:a.reactions)!=null&&s.includes(e)))&&(a.reactions??(a.reactions=[])).push(e);o&&(e.f^=un)}for(r=0;r<c;r++)if(a=n[r],Gt(a)&&ar(a),a.wv>e.wv)return!0}(!i||Z!==null&&!tt)&&Ye(e,Me)}return!1}function no(e,t){for(var n=t;n!==null;){if(n.f&cn)try{n.fn(e);return}catch{n.f^=cn}n=n.parent}throw Mt=!1,e}function io(e){return(e.f&Et)===0&&(e.parent===null||(e.parent.f&cn)===0)}function Mn(){Mt=!1}function Xt(e,t,n,i){if(Mt){if(n===null&&(Mt=!1),io(t))throw e;return}n!==null&&(Mt=!0);{no(e,t);return}}function mr(e){var v;var t=ye,n=Pe,i=it,r=$,a=tt,o=We,l=ie,c=e.f;ye=null,Pe=0,it=null,$=c&(Ve|Yt)?null:e,tt=!kt&&(c>)!==0,We=null,ie=e.ctx,Hn++;try{var s=(0,e.fn)(),d=e.deps;if(ye!==null){var f;if(Bt(e,Pe),d!==null&&Pe>0)for(d.length=Pe+ye.length,f=0;f<ye.length;f++)d[Pe+f]=ye[f];else e.deps=d=ye;if(!tt)for(f=Pe;f<d.length;f++)((v=d[f]).reactions??(v.reactions=[])).push(e)}else d!==null&&Pe<d.length&&(Bt(e,Pe),d.length=Pe);return s}finally{ye=t,Pe=n,it=i,$=r,tt=a,We=o,ie=l}}function ro(e,t){let n=t.reactions;if(n!==null){var i=ca.call(n,e);if(i!==-1){var r=n.length-1;r===0?n=t.reactions=null:(n[i]=n[r],n.pop())}}n===null&&t.f&He&&(ye===null||!ye.includes(t))&&(Ye(t,gn),t.f&(gt|un)||(t.f^=un),Bt(t,0))}function Bt(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)ro(e,n[i])}function wn(e){var t=e.f;if(!(t&Et)){Ye(e,Me);var n=Z,i=ie;Z=e;try{t&hn?Ja(e):sr(e),lr(e),or(e);var r=mr(e);e.teardown=typeof r=="function"?r:null,e.wv=hr;var a=e.deps,o;Dn&&Ta&&e.f&rt}catch(l){Xt(l,e,n,i||e.ctx)}finally{Z=n}}}function pr(){if(bt>1e3){bt=0;try{wa()}catch(e){if(Ht!==null)Xt(e,Ht,null);else throw e}}bt++}function yr(e){var t=e.length;if(t!==0){pr();var n=kt;kt=!0;try{for(var i=0;i<t;i++){var r=e[i];r.f&Me||(r.f^=Me);var a=[];wr(r,a),ao(a)}}finally{kt=n}}}function ao(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if(!(i.f&(Et|Ue)))try{Gt(i)&&(wn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?cr(i):i.fn=null))}catch(r){Xt(r,i,null,i.ctx)}}}function oo(){if(qt=!1,bt>1001)return;const e=ct;ct=[],yr(e),qt||(bt=0,Ht=null)}function kn(e){ln===_r&&(qt||(qt=!0,queueMicrotask(oo))),Ht=e;for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(Yt|Ve)){if(!(n&Me))return;t.f^=Me}}ct.push(t)}function wr(e,t){var n=e.first,i=[];e:for(;n!==null;){var r=n.f,a=(r&Ve)!==0,o=a&&(r&Me)!==0,l=n.next;if(!o&&!(r&Ue))if(r&Kt){if(a)n.f^=Me;else try{Gt(n)&&wn(n)}catch(f){Xt(f,n,null,n.ctx)}var c=n.first;if(c!==null){n=c;continue}}else r&zi&&i.push(n);if(l===null){let f=n.parent;for(;f!==null;){if(e===f)break e;var s=f.next;if(s!==null){n=s;continue e}f=f.parent}}n=l}for(var d=0;d<i.length;d++)c=i[d],t.push(c),wr(c,t)}function kr(e){var t=ln,n=ct;try{pr();const r=[];ln=$a,ct=r,qt=!1,yr(n);var i=e==null?void 0:e();return Qa(),(ct.length>0||r.length>0)&&kr(),bt=0,Ht=null,i}finally{ln=t,ct=n}}async function Bn(){await Promise.resolve(),kr()}function u(e){var d;var t=e.f,n=(t&He)!==0;if(n&&t&Et){var i=rr(e);return ei(e),i}if($!==null){We!==null&&We.includes(e)&&Sa();var r=$.deps;e.rv<Hn&&(e.rv=Hn,ye===null&&r!==null&&r[Pe]===e?Pe++:ye===null?ye=[e]:ye.push(e),it!==null&&Z!==null&&Z.f&Me&&!(Z.f&Ve)&&it.includes(e)&&(Ye(Z,rt),kn(Z)))}else if(n&&e.deps===null)for(var a=e,o=a.parent,l=a;o!==null;)if(o.f&He){var c=o;l=c,o=c.parent}else{var s=o;(d=s.deriveds)!=null&&d.includes(l)||(s.deriveds??(s.deriveds=[])).push(l);break}return n&&(a=e,Gt(a)&&ar(a)),e.v}function Ke(e){const t=$;try{return $=null,e()}finally{$=t}}const lo=-7169;function Ye(e,t){e.f=e.f&lo|t}function so(e){return xr().get(e)}function br(e,t){return xr().set(e,t),t}function xr(e){return ie===null&&vr(),ie.c??(ie.c=new Map(co(ie)||void 0))}function co(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}function ae(e,t=!1,n){ie={p:ie,c:null,e:null,m:!1,s:e,x:null,l:null},Tt&&!t&&(ie.l={s:null,u:null,r1:[],r2:Ee(!1)})}function oe(e){const t=ie;if(t!==null){const o=t.e;if(o!==null){var n=Z,i=$;t.e=null;try{for(var r=0;r<o.length;r++){var a=o[r];Ie(a.effect),qe(a.reaction),pt(a.fn)}}finally{Ie(n),qe(i)}}ie=t.p,t.m=!0}return{}}function uo(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(ze in e)Fn(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&ze in n&&Fn(n)}}}function Fn(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let i in e)try{Fn(e[i],t)}catch{}const n=Gn(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const i=Ui(n);for(let r in i){const a=i[r].get;if(a)try{a.call(e)}catch{}}}}}function fo(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const vo=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function _o(e){return vo.includes(e)}const ho={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function go(e){return e=e.toLowerCase(),ho[e]??e}const mo=["touchstart","touchmove"];function po(e){return mo.includes(e)}function yo(e,t){if(t){const n=document.body;e.autofocus=!0,Ct(()=>{document.activeElement===n&&e.focus()})}}let Ti=!1;function wo(){Ti||(Ti=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Sr(e){var t=$,n=Z;qe(null),Ie(null);try{return e()}finally{qe(t),Ie(n)}}function Er(e,t,n,i=n){e.addEventListener(t,()=>Sr(n));const r=e.__on_r;r?e.__on_r=()=>{r(),i(!0)}:e.__on_r=()=>i(!0),wo()}const Tr=new Set,Vn=new Set;function ii(e,t,n,i){function r(a){if(i.capture||jt.call(t,a),!a.cancelBubble)return Sr(()=>n.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ct(()=>{t.addEventListener(e,r,i)}):t.addEventListener(e,r,i),r}function ko(e,t,n,i={}){var r=ii(t,e,n,i);return()=>{e.removeEventListener(t,r,i)}}function ce(e,t,n,i,r){var a={capture:i,passive:r},o=ii(e,t,n,a);(t===document.body||t===window||t===document)&&Ga(()=>{t.removeEventListener(e,o,a)})}function fe(e){for(var t=0;t<e.length;t++)Tr.add(e[t]);for(var n of Vn)n(e)}function jt(e){var w;var t=this,n=t.ownerDocument,i=e.type,r=((w=e.composedPath)==null?void 0:w.call(e))||[],a=r[0]||e.target,o=0,l=e.__root;if(l){var c=r.indexOf(l);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var s=r.indexOf(t);if(s===-1)return;c<=s&&(o=c)}if(a=r[o]||e.target,a!==t){ua(e,"currentTarget",{configurable:!0,get(){return a||n}});var d=$,f=Z;qe(null),Ie(null);try{for(var v,m=[];a!==null;){var g=a.assignedSlot||a.parentNode||a.host||null;try{var _=a["__"+i];if(_!==void 0&&!a.disabled)if(Yn(_)){var[p,...y]=_;p.apply(a,[e,...y])}else _.call(a,e)}catch(S){v?m.push(S):v=S}if(e.cancelBubble||g===t||g===null)break;a=g}if(v){for(let S of m)queueMicrotask(()=>{throw S});throw v}}finally{e.__root=t,delete e.currentTarget,qe(d),Ie(f)}}}function bo(e){var t;t=document.head.appendChild(It());try{Je(()=>e(t),Ki)}finally{}}function ri(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function _t(e,t){var n=Z;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function I(e,t){var n=(t&qa)!==0,i=(t&Ha)!==0,r,a=!e.startsWith("<!>");return()=>{r===void 0&&(r=ri(a?e:"<!>"+e),n||(r=ft(r)));var o=i?document.importNode(r,!0):r.cloneNode(!0);if(n){var l=ft(o),c=o.lastChild;_t(l,c)}else _t(o,o);return o}}function Le(e,t,n="svg"){var i=!e.startsWith("<!>"),r=`<${n}>${i?e:"<!>"+e}</${n}>`,a;return()=>{if(!a){var o=ri(r),l=ft(o);a=ft(l)}var c=a.cloneNode(!0);return _t(c,c),c}}function Be(e=""){{var t=It(e+"");return _t(t,t),t}}function Fe(){var e=document.createDocumentFragment(),t=document.createComment(""),n=It();return e.append(t,n),_t(t,n),e}function k(e,t){e!==null&&e.before(t)}let fn=!0;function Ii(e){fn=e}function G(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n==null?"":n+"")}function Jt(e,t){return xo(e,t)}const yt=new Map;function xo(e,{target:t,anchor:n,props:i={},events:r,context:a,intro:o=!0}){Va();var l=new Set,c=f=>{for(var v=0;v<f.length;v++){var m=f[v];if(!l.has(m)){l.add(m);var g=po(m);t.addEventListener(m,jt,{passive:g});var _=yt.get(m);_===void 0?(document.addEventListener(m,jt,{passive:g}),yt.set(m,1)):yt.set(m,_+1)}}};c(Zn(Tr)),Vn.add(c);var s=void 0,d=Xa(()=>{var f=n??t.appendChild(It());return De(()=>{if(a){ae({});var v=ie;v.c=a}r&&(i.$$events=r),fn=o,s=e(f,i)||{},fn=!0,a&&oe()}),()=>{var g;for(var v of l){t.removeEventListener(v,jt);var m=yt.get(v);--m===0?(document.removeEventListener(v,jt),yt.delete(v)):yt.set(v,m)}Vn.delete(c),f!==n&&((g=f.parentNode)==null||g.removeChild(f))}});return Un.set(s,d),s}let Un=new WeakMap;function bn(e,t){const n=Un.get(e);return n?(Un.delete(e),n(t)):Promise.resolve()}function H(e,t,n=!1){var i=e,r=null,a=null,o=ke,l=n?mt:0,c=!1;const s=(f,v=!0)=>{c=!0,d(v,f)},d=(f,v)=>{o!==(o=f)&&(o?(r?Rt(r):v&&(r=De(()=>v(i))),a&&vt(a,()=>{a=null})):(a?Rt(a):v&&(a=De(()=>v(i))),r&&vt(r,()=>{r=null})))};Je(()=>{c=!1,t(s),c||d(null,null)},l)}function Ir(e,t,n){var i=e,r=ke,a,o=Zt()?ga:Xn;Je(()=>{o(r,r=t())&&(a&&vt(a),a=De(()=>n(i)))})}function xt(e,t){return t}function So(e,t,n,i){for(var r=[],a=t.length,o=0;o<a;o++)ti(t[o].e,r,!0);var l=a>0&&r.length===0&&n!==null;if(l){var c=n.parentNode;Ua(c),c.append(n),i.clear(),et(e,t[0].prev,t[a-1].next)}ur(r,()=>{for(var s=0;s<a;s++){var d=t[s];l||(i.delete(d.k),et(e,d.prev,d.next)),Re(d.e,!l)}})}function at(e,t,n,i,r,a=null){var o=e,l={flags:t,items:new Map,first:null},c=(t&Xi)!==0;if(c){var s=e;o=s.appendChild(It())}var d=null,f=!1;Je(()=>{var v=n(),m=Yn(v)?v:v==null?[]:Zn(v),g=m.length;if(!(f&&g===0)){f=g===0;{var _=$;Eo(m,l,o,r,t,(_.f&Ue)!==0,i)}a!==null&&(g===0?d?Rt(d):d=De(()=>a(o)):d!==null&&vt(d,()=>{d=null})),n()}})}function Eo(e,t,n,i,r,a,o,l){var F,V,W,J;var c=(r&Aa)!==0,s=(r&(Qn|$n))!==0,d=e.length,f=t.items,v=t.first,m=v,g,_=null,p,y=[],w=[],S,j,b,T;if(c)for(T=0;T<d;T+=1)S=e[T],j=o(S,T),b=f.get(j),b!==void 0&&((F=b.a)==null||F.measure(),(p??(p=new Set)).add(b));for(T=0;T<d;T+=1){if(S=e[T],j=o(S,T),b=f.get(j),b===void 0){var R=m?m.e.nodes_start:n;_=Io(R,t,_,_===null?t.first:_.next,S,j,T,i,r),f.set(j,_),y=[],w=[],m=_.next;continue}if(s&&To(b,S,T,r),b.e.f&Ue&&(Rt(b.e),c&&((V=b.a)==null||V.unfix(),(p??(p=new Set)).delete(b))),b!==m){if(g!==void 0&&g.has(b)){if(y.length<w.length){var M=w[0],A;_=M.prev;var D=y[0],P=y[y.length-1];for(A=0;A<y.length;A+=1)Ai(y[A],M,n);for(A=0;A<w.length;A+=1)g.delete(w[A]);et(t,D.prev,P.next),et(t,_,D),et(t,P,M),m=M,_=P,T-=1,y=[],w=[]}else g.delete(b),Ai(b,m,n),et(t,b.prev,b.next),et(t,b,_===null?t.first:_.next),et(t,_,b),_=b;continue}for(y=[],w=[];m!==null&&m.k!==j;)(a||!(m.e.f&Ue))&&(g??(g=new Set)).add(m),w.push(m),m=m.next;if(m===null)continue;b=m}y.push(b),_=b,m=b.next}if(m!==null||g!==void 0){for(var B=g===void 0?[]:Zn(g);m!==null;)(a||!(m.e.f&Ue))&&B.push(m),m=m.next;var O=B.length;if(O>0){var z=r&Xi&&d===0?n:null;if(c){for(T=0;T<O;T+=1)(W=B[T].a)==null||W.measure();for(T=0;T<O;T+=1)(J=B[T].a)==null||J.fix()}So(t,B,z,f)}}c&&Ct(()=>{var ee;if(p!==void 0)for(b of p)(ee=b.a)==null||ee.apply()}),Z.first=t.first&&t.first.e,Z.last=_&&_.e}function To(e,t,n,i){i&Qn&&Rn(e.v,t),i&$n?Rn(e.i,n):e.i=n}function Io(e,t,n,i,r,a,o,l,c,s){var d=(c&Qn)!==0,f=(c&Ca)===0,v=d?f?Qi(r):Ee(r):r,m=c&$n?Ee(o):o,g={i:m,v,k:a,a:null,e:null,prev:n,next:i};try{return g.e=De(()=>l(e,v,m),er),g.e.prev=n&&n.e,g.e.next=i&&i.e,n===null?t.first=g:(n.next=g,n.e.next=g.e),i!==null&&(i.prev=g,i.e.prev=g.e),g}finally{}}function Ai(e,t,n){for(var i=e.next?e.next.e.nodes_start:n,r=t?t.e.nodes_start:n,a=e.e.nodes_start;a!==i;){var o=mn(a);r.before(a),a=o}}function et(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function Ao(e,t,n,i,r){var a=e,o="",l;Je(()=>{o!==(o=t()??"")&&(l!==void 0&&(Re(l),l=void 0),o!==""&&(l=De(()=>{var c=o+"",s=ri(c);_t(ft(s),s.lastChild),a.before(s)})))})}function Pt(e,t,...n){var i=e,r=st,a;Je(()=>{r!==(r=t())&&(a&&(Re(a),a=null),a=De(()=>r(i,...n)))},mt)}function Co(e,t,n,i,r,a){var o,l,c=null,s=e,d;Je(()=>{const f=t()||null;var v=f==="svg"?Ji:null;f!==o&&(d&&(f===null?vt(d,()=>{d=null,l=null}):f===l?Rt(d):(Re(d),Ii(!1))),f&&f!==l&&(d=De(()=>{c=v?document.createElementNS(v,f):document.createElement(f),_t(c,c);{var m=c.appendChild(It());i(c,m)}Z.nodes_end=c,s.before(c)})),o=f,o&&(l=o),Ii(!0))},mt)}function Qt(e,t,n){pt(()=>{var i=Ke(()=>t(e,n==null?void 0:n())||{});if(n&&(i!=null&&i.update)){var r=!1,a={};yn(()=>{var o=n();uo(o),r&&Xn(a,o)&&(a=o,i.update(o))}),r=!0}if(i!=null&&i.destroy)return()=>i.destroy()})}function Ar(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Ar(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Po(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Ar(e))&&(i&&(i+=" "),i+=t);return i}function jo(e){return typeof e=="object"?Po(e):e??""}function Mo(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ue(e,t,n,i){var r=e.__attributes??(e.__attributes={});r[t]!==(r[t]=n)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[ha]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Cr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Lo(e,t,n,i,r=!1,a=!1,o=!1){var l=t||{},c=e.tagName==="OPTION";for(var s in t)s in n||(n[s]=null);n.class&&(n.class=jo(n.class)),n.class=n.class?n.class+" "+i:i;var d=Cr(e),f=e.__attributes??(e.__attributes={});for(const w in n){let S=n[w];if(c&&w==="value"&&S==null){e.value=e.__value="",l[w]=S;continue}var v=l[w];if(S!==v){l[w]=S;var m=w[0]+w[1];if(m!=="$$"){if(m==="on"){const j={},b="$$"+w;let T=w.slice(2);var g=_o(T);if(fo(T)&&(T=T.slice(0,-7),j.capture=!0),!g&&v){if(S!=null)continue;e.removeEventListener(T,l[b],j),l[b]=null}if(S!=null)if(g)e[`__${T}`]=S,fe([T]);else{let R=function(M){l[w].call(this,M)};var y=R;l[b]=ii(T,e,R,j)}else g&&(e[`__${T}`]=void 0)}else if(w==="style"&&S!=null)e.style.cssText=S+"";else if(w==="autofocus")yo(e,!!S);else if(w==="__value"||w==="value"&&S!=null)e.value=e[w]=e.__value=S;else if(w==="selected"&&c)Mo(e,S);else{var _=w;r||(_=go(_));var p=_==="defaultValue"||_==="defaultChecked";if(S==null&&!a&&!p)if(f[w]=null,_==="value"||_==="checked"){let j=e;if(_==="value"){let b=j.defaultValue;j.removeAttribute(_),j.defaultValue=b}else{let b=j.defaultChecked;j.removeAttribute(_),j.defaultChecked=b}}else e.removeAttribute(w);else p||d.includes(_)&&(a||typeof S!="string")?e[_]=S:typeof S!="function"&&ue(e,_,S)}w==="style"&&"__styles"in e&&(e.__styles={})}}}return l}var Ci=new Map;function Cr(e){var t=Ci.get(e.nodeName);if(t)return t;Ci.set(e.nodeName,t=[]);for(var n,i=e,r=Element.prototype;r!==i;){n=Ui(i);for(var a in n)n[a].set&&t.push(a);i=Gn(i)}return t}function No(e,t,n){var i=e.__className,r=Oo(t);(i!==r||er)&&(t==null?e.removeAttribute("class"):e.className=r,e.__className=r)}function Oo(e,t){return(e??"")+""}function se(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}function xn(e,t,n,i){var r=e.__styles??(e.__styles={});r[t]!==n&&(r[t]=n,n==null?e.style.removeProperty(t):e.style.setProperty(t,n,""))}const Do=()=>performance.now(),Xe={tick:e=>requestAnimationFrame(e),now:()=>Do(),tasks:new Set};function Pr(){const e=Xe.now();Xe.tasks.forEach(t=>{t.c(e)||(Xe.tasks.delete(t),t.f())}),Xe.tasks.size!==0&&Xe.tick(Pr)}function Ro(e){let t;return Xe.tasks.size===0&&Xe.tick(Pr),{promise:new Promise(n=>{Xe.tasks.add(t={c:e,f:n})}),abort(){Xe.tasks.delete(t)}}}function an(e,t){e.dispatchEvent(new CustomEvent(t))}function qo(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const t=e.split("-");return t.length===1?t[0]:t[0]+t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("")}function Pi(e){const t={},n=e.split(";");for(const i of n){const[r,a]=i.split(":");if(!r||a===void 0)break;const o=qo(r.trim());t[o]=a.trim()}return t}const Ho=e=>e;function je(e,t,n,i){var r=(e&Oa)!==0,a=(e&Da)!==0,o=r&&a,l=(e&Ra)!==0,c=o?"both":r?"in":"out",s,d=t.inert,f,v;function m(){var w=$,S=Z;qe(null),Ie(null);try{return s??(s=n()(t,(i==null?void 0:i())??{},{direction:c}))}finally{qe(w),Ie(S)}}var g={is_global:l,in(){var w;if(t.inert=d,!r){v==null||v.abort(),(w=v==null?void 0:v.reset)==null||w.call(v);return}a||f==null||f.abort(),an(t,"introstart"),f=zn(t,m(),v,1,()=>{an(t,"introend"),f==null||f.abort(),f=s=void 0})},out(w){if(!a){w==null||w(),s=void 0;return}t.inert=!0,an(t,"outrostart"),v=zn(t,m(),f,0,()=>{an(t,"outroend"),w==null||w()})},stop:()=>{f==null||f.abort(),v==null||v.abort()}},_=Z;if((_.transitions??(_.transitions=[])).push(g),r&&fn){var p=l;if(!p){for(var y=_.parent;y&&y.f&mt;)for(;(y=y.parent)&&!(y.f&hn););p=!y||(y.f&Wi)!==0}p&&pt(()=>{Ke(()=>g.in())})}}function zn(e,t,n,i,r){var a=i===1;if(wt(t)){var o,l=!1;return Ct(()=>{if(!l){var p=t({direction:a?"in":"out"});o=zn(e,p,n,i,r)}}),{abort:()=>{l=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(n==null||n.deactivate(),!(t!=null&&t.duration))return r(),{abort:st,deactivate:st,reset:st,t:()=>i};const{delay:c=0,css:s,tick:d,easing:f=Ho}=t;var v=[];if(a&&n===void 0&&(d&&d(0,1),s)){var m=Pi(s(0,1));v.push(m,m)}var g=()=>1-i,_=e.animate(v,{duration:c});return _.onfinish=()=>{var p=(n==null?void 0:n.t())??1-i;n==null||n.abort();var y=i-p,w=t.duration*Math.abs(y),S=[];if(w>0){if(s)for(var j=Math.ceil(w/16.666666666666668),b=0;b<=j;b+=1){var T=p+y*f(b/j),R=s(T,1-T);S.push(Pi(R))}g=()=>{var M=_.currentTime;return p+y*f(M/w)},d&&Ro(()=>{if(_.playState!=="running")return!1;var M=g();return d(M,1-M),!0})}_=e.animate(S,{duration:w,fill:"forwards"}),_.onfinish=()=>{g=()=>i,d==null||d(i,1-i),r()}},{abort:()=>{_&&(_.cancel(),_.effect=null,_.onfinish=st)},deactivate:()=>{r=st},reset:()=>{i===0&&(d==null||d(1,0))},t:()=>g()}}function Bo(e,t,n=t){var i=Zt();Er(e,"input",r=>{var a=r?e.defaultValue:e.value;if(a=Ln(e)?Nn(a):a,n(a),i&&a!==(a=t())){var o=e.selectionStart,l=e.selectionEnd;e.value=a??"",l!==null&&(e.selectionStart=o,e.selectionEnd=Math.min(l,e.value.length))}}),Ke(t)==null&&e.value&&n(Ln(e)?Nn(e.value):e.value),yn(()=>{var r=t();Ln(e)&&r===Nn(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function Ln(e){var t=e.type;return t==="number"||t==="range"}function Nn(e){return e===""?null:+e}function jr(e,t,n){if(e.multiple)return Uo(e,t);for(var i of e.options){var r=Lt(i);if(Fa(r,t)){i.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Fo(e,t){pt(()=>{var n=new MutationObserver(()=>{var i=e.__value;jr(e,i)});return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),()=>{n.disconnect()}})}function Vo(e,t,n=t){var i=!0;Er(e,"change",r=>{var a=r?"[selected]":":checked",o;if(e.multiple)o=[].map.call(e.querySelectorAll(a),Lt);else{var l=e.querySelector(a)??e.querySelector("option:not([disabled])");o=l&&Lt(l)}n(o)}),pt(()=>{var r=t();if(jr(e,r,i),i&&r===void 0){var a=e.querySelector(":checked");a!==null&&(r=Lt(a),n(r))}e.__value=r,i=!1}),Fo(e)}function Uo(e,t){for(var n of e.options)n.selected=~t.indexOf(Lt(n))}function Lt(e){return"__value"in e?e.__value:e.value}function ji(e,t){return e===t||(e==null?void 0:e[ze])===t}function $t(e={},t,n,i){return pt(()=>{var r,a;return yn(()=>{r=a,a=[],Ke(()=>{e!==n(...a)&&(t(e,...a),r&&ji(n(...r),e)&&t(null,...r))})}),()=>{Ct(()=>{a&&ji(n(...a),e)&&t(null,...a)})}}),e}let on=!1;function zo(e){var t=on;try{return on=!1,[e(),on]}finally{on=t}}const Wo={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Ko(e,t,n){return new Proxy({props:e,exclude:t},Wo)}const Yo={get(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i)return i[t]}},set(e,t,n){let i=e.props.length;for(;i--;){let r=e.props[i];wt(r)&&(r=r());const a=nt(r,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let i=e.props[n];if(wt(i)&&(i=i()),typeof i=="object"&&i!==null&&t in i){const r=nt(i,t);return r&&!r.configurable&&(r.configurable=!0),r}}},has(e,t){if(t===ze||t===Zi)return!1;for(let n of e.props)if(wt(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props){wt(n)&&(n=n());for(const i in n)t.includes(i)||t.push(i)}return t}};function Zo(...e){return new Proxy({props:e},Yo)}function Mi(e){for(var t=Z,n=Z;t!==null&&!(t.f&(Ve|Yt));)t=t.parent;try{return Ie(t),e()}finally{Ie(n)}}function L(e,t,n,i){var R;var r=(n&Pa)!==0,a=!Tt||(n&ja)!==0,o=(n&La)!==0,l=(n&Na)!==0,c=!1,s;o?[s,c]=zo(()=>e[t]):s=e[t];var d=ze in e||Zi in e,f=o&&(((R=nt(e,t))==null?void 0:R.set)??(d&&t in e&&(M=>e[t]=M)))||void 0,v=i,m=!0,g=!1,_=()=>(g=!0,m&&(m=!1,l?v=Ke(i):v=i),v);s===void 0&&i!==void 0&&(f&&a&&ka(),s=_(),f&&f(s));var p;if(a)p=()=>{var M=e[t];return M===void 0?_():(m=!0,g=!1,M)};else{var y=Mi(()=>(r?K:za)(()=>e[t]));y.f|=_a,p=()=>{var M=u(y);return M!==void 0&&(v=void 0),M===void 0?v:M}}if(!(n&Ma))return p;if(f){var w=e.$$legacy;return function(M,A){return arguments.length>0?((!a||!A||w||c)&&f(A?p():M),M):p()}}var S=!1,j=!1,b=Qi(s),T=Mi(()=>K(()=>{var M=p(),A=u(b);return S?(S=!1,j=!0,A):(j=!1,b.v=M)}));return r||(T.equals=Jn),function(M,A){if(arguments.length>0){const D=A?u(T):a&&o?X(M):M;return T.equals(D)||(S=!0,C(b,D),g&&v!==void 0&&(v=D),Ke(()=>u(T))),M}return u(T)}}function Li(e,t){var n=Z,i=$,r=ie;Ie(e),qe(e),Ei(e.ctx);try{t()}finally{Ie(n),qe(i),Ei(r)}}function Go(e,t,n){var i=e,r;Je(()=>{var a=Z,o=!1;a.fn=l=>{var c=t.onerror;let s=t.failed;if(!c&&!s||o)throw l;var d=()=>{vt(r),Li(a,()=>{o=!1,r=De(()=>n(i)),Mn()})};c==null||c(l,d),r&&Re(r),Ct(()=>{Li(a,()=>{o=!0;try{r=De(()=>{s(i,()=>l,()=>d)})}catch(f){Xt(f,a,null,a.ctx)}Mn(),o=!1})})},r=De(()=>n(i)),Mn()},mt|cn)}function Ze(e){ie===null&&vr(),Tt&&ie.l!==null?Xo(ie).m.push(e):pn(()=>{const t=Ke(e);if(typeof t=="function")return t})}function Xo(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}const Jo="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jo);const Mr="https://www.playpilot.com",Sn="https://partner-api.playpilot.tech/1.0.0",Lr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",he=Object.freeze({ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error"});function ai(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}const Qo="https://insights.playpilot.net";async function pe(e,t=null,n={}){var r,a,o;const i=new Headers({"Content-Type":"application/json"});t&&(n={original_title:t.original_title,title_sid:t.sid,title_type:t.type,providers:[...new Set(((r=t.providers)==null?void 0:r.map(l=>l.name))||[])],...n}),n.url=ai(),n.organization_sid=(a=window.PlayPilotLinkInjections)==null?void 0:a.organization_sid,n.domain_sid=(o=window.PlayPilotLinkInjections)==null?void 0:o.domain_sid,fetch(Qo,{headers:i,method:"POST",body:JSON.stringify({event:e,payload:n,source:"ali"})}),$o({event:e,payload:n})}function $o(e){var t;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(t=window.PlayPilotLinkInjections.tracked_events)==null||t.push(e)}function el({organizationSid:e=null,domainSid:t=null}){window.PlayPilotLinkInjections.organization_sid=e||null,window.PlayPilotLinkInjections.domain_sid=t||null}const oi="EncryptedToken",Nr="articleReplacementEditToken",Or="playpilot-editorial-mode";async function Dr(e=window.location.href){const t=new Headers({"Content-Type":"application/json"});try{const n=In();if(!n)throw new Error("No token was provided");const i=li(e);if(!i)throw new Error("Could not be authenticated");const r=await fetch(Sn+`/external-pages/edit-authorization?api-token=${n}`,{headers:t,method:"POST",body:JSON.stringify({private_token:i})});if(!r.ok)throw r;return tl(i),!0}catch(n){console.error(n),pe(he.AuthFailed)}finally{rl()}return!1}function li(e=""){var i,r;const t=(i=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:i.editorial_token;if(t)return t;if(e){const a=new URL(e).searchParams.get(Nr);if(a)return decodeURI(a)}return((r=("; "+document.cookie).split(`; ${oi}=`).pop())==null?void 0:r.split(";")[0])||""}function tl(e){const t=new Date;t.setTime(t.getTime()+30*24*60*60*1e3);const i="expires="+t.toUTCString();document.cookie=oi+"="+e+";"+i+";path=/"}function nl(){document.cookie=oi+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function Rr(){var t;const e=(t=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:t.editorial_token;return new URLSearchParams(window.location.search).get(Or)==="true"||!!e}function il(){const e=new URL(window.location.href);e.searchParams.set(Or,"true"),window.history.replaceState({},"",e)}function rl(){const e=new URL(window.location.href);e.searchParams.delete(Nr),window.history.replaceState({},"",e)}function al(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t=t*31+i>>>0}return t.toString(16)}function qr(){return(Math.random()+1).toString(36).substring(7)}const h=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"}),ol={"Where To Stream Online":{[h.English]:"Where to stream online",[h.Swedish]:"Var kan man streama online",[h.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[h.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[h.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[h.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"An Error Occurred":{[h.English]:"An error occurred",[h.Swedish]:"Ett fel inträffade",[h.Danish]:"Der opstod en fejl"},"Title Unavailable":{[h.English]:"This title is not currently available to stream.",[h.Swedish]:"Den här titeln går inte att streama just nu.",[h.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[h.English]:"is not currently available to stream.",[h.Swedish]:"går inte att streama just nu.",[h.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[h.English]:"is available to stream on",[h.Swedish]:"finns att streama på",[h.Danish]:"kan streames på"},"Is Available To Stream":{[h.English]:"is available to stream.",[h.Swedish]:"finns att streama.",[h.Danish]:"kan streames."},"View Streaming Options":{[h.English]:"View streaming options",[h.Swedish]:"Se streamingalternativ",[h.Danish]:"Se streamingmuligheder"},And:{[h.English]:"and",[h.Swedish]:"och",[h.Danish]:"og"},Minutes:{[h.English]:"minutes",[h.Swedish]:"minuter",[h.Danish]:"minutter"},"Type: movie":{[h.English]:"Movie",[h.Swedish]:"Film",[h.Danish]:"Film"},"Type: series":{[h.English]:"Series",[h.Swedish]:"Serie",[h.Danish]:"Serie"},Stream:{[h.English]:"Stream",[h.Swedish]:"Streama",[h.Danish]:"Stream"},Buy:{[h.English]:"Buy",[h.Swedish]:"Köp",[h.Danish]:"Køb"},Rent:{[h.English]:"Rent",[h.Swedish]:"Hyra",[h.Danish]:"Lej"},"Rent Or Buy":{[h.English]:"Rent or Buy",[h.Swedish]:"Hyra",[h.Danish]:"Lej eller køb"},All:{[h.English]:"All",[h.Swedish]:"Alla",[h.Danish]:"Alle"},Unscripted:{[h.English]:"Unscripted",[h.Swedish]:"Oscripterat",[h.Danish]:"Umanuskriptet"},Independent:{[h.English]:"Independent",[h.Swedish]:"Indie",[h.Danish]:"Indie"},"Game Show":{[h.English]:"Game Show",[h.Swedish]:"Gameshow",[h.Danish]:"Quizshow"},"Film Noir":{[h.English]:"Film Noir",[h.Swedish]:"Film noir",[h.Danish]:"Film noir"},Entertainment:{[h.English]:"Entertainment",[h.Swedish]:"Underhållning",[h.Danish]:"Underholdning"},News:{[h.English]:"News",[h.Swedish]:"Nyheter",[h.Danish]:"Nyheder"},Short:{[h.English]:"Short",[h.Swedish]:"Kortfilm",[h.Danish]:"Kortfilm"},Bollywood:{[h.English]:"Bollywood",[h.Swedish]:"Bollywood",[h.Danish]:"Bollywood"},Concert:{[h.English]:"Concert",[h.Swedish]:"Konsert",[h.Danish]:"Koncert"},Arthouse:{[h.English]:"Arthouse",[h.Swedish]:"Arthouse",[h.Danish]:"Arthouse"},"Alternate Version":{[h.English]:"Alternate Version",[h.Swedish]:"Alternativ version",[h.Danish]:"Alternativ version"},"Reality TV":{[h.English]:"Reality TV",[h.Swedish]:"Reality-TV",[h.Danish]:"Reality-TV"},Culture:{[h.English]:"Culture",[h.Swedish]:"Kultur",[h.Danish]:"Kultur"},Drama:{[h.English]:"Drama",[h.Swedish]:"Drama",[h.Danish]:"Drama"},Crime:{[h.English]:"Crime",[h.Swedish]:"Kriminal",[h.Danish]:"Krimi"},Western:{[h.English]:"Western",[h.Swedish]:"Western",[h.Danish]:"Western"},Thriller:{[h.English]:"Thriller",[h.Swedish]:"Thriller",[h.Danish]:"Thriller"},Animation:{[h.English]:"Animation",[h.Swedish]:"Animerat",[h.Danish]:"Animation"},Mystery:{[h.English]:"Mystery",[h.Swedish]:"Mysterium",[h.Danish]:"Mysterium"},Science:{[h.English]:"Science",[h.Swedish]:"Vetenskap",[h.Danish]:"Videnskab"},Nature:{[h.English]:"Nature",[h.Swedish]:"Natur",[h.Danish]:"Natur"},War:{[h.English]:"War",[h.Swedish]:"Krig",[h.Danish]:"Krig"},"Sci-Fi":{[h.English]:"Sci-Fi",[h.Swedish]:"Sci-fi",[h.Danish]:"Sci-fi"},Documentary:{[h.English]:"Documentary",[h.Swedish]:"Dokumentär",[h.Danish]:"Dokumentar"},"Stand-up":{[h.English]:"Stand-up",[h.Swedish]:"Standup",[h.Danish]:"Stand-up"},"Talk Show":{[h.English]:"Talk Show",[h.Swedish]:"Talkshow",[h.Danish]:"Talkshow"},Fantasy:{[h.English]:"Fantasy",[h.Swedish]:"Fantasy",[h.Danish]:"Fantasy"},History:{[h.English]:"History",[h.Swedish]:"Historia",[h.Danish]:"Historie"},Adventure:{[h.English]:"Adventure",[h.Swedish]:"Äventyr",[h.Danish]:"Eventyr"},Action:{[h.English]:"Action",[h.Swedish]:"Action",[h.Danish]:"Action"},Horror:{[h.English]:"Horror",[h.Swedish]:"Skräck",[h.Danish]:"Gyser"},Comedy:{[h.English]:"Comedy",[h.Swedish]:"Komedi",[h.Danish]:"Komedie"},Biography:{[h.English]:"Biography",[h.Swedish]:"Biografi",[h.Danish]:"Biografi"},Music:{[h.English]:"Music",[h.Swedish]:"Musik",[h.Danish]:"Musik"},Sport:{[h.English]:"Sport",[h.Swedish]:"Sport",[h.Danish]:"Sport"},Romance:{[h.English]:"Romance",[h.Swedish]:"Romantik",[h.Danish]:"Romantik"},Kids:{[h.English]:"Kids",[h.Swedish]:"Barn",[h.Danish]:"Børn"},Lifestyle:{[h.English]:"Lifestyle",[h.Swedish]:"Livsstil",[h.Danish]:"Livsstil"},Musical:{[h.English]:"Musical",[h.Swedish]:"Musikal",[h.Danish]:"Musical"},Anime:{[h.English]:"Anime",[h.Swedish]:"Anime",[h.Danish]:"Anime"},Family:{[h.English]:"Family",[h.Swedish]:"Familj",[h.Danish]:"Familie"}};function be(e,t=Hr()){var n;return((n=ol[e])==null?void 0:n[t])||e}function Hr(){var i,r;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.language,t=Object.values(h);if(e){if(t.includes(e))return e;console.warn(`PlayPilot Link Injections: ${e} is not an accepted language`)}const n=(r=document.querySelector("html"))==null?void 0:r.getAttribute("lang");if(n){if(t.includes(n))return n;const a=t.find(o=>o.toLowerCase().startsWith(n+"-"));if(a)return a}return h.English}const ll=e=>e;function si(e){const t=e-1;return t*t*t+1}function Ni(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}function Ft(e,{delay:t=0,duration:n=400,easing:i=ll}={}){const r=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:a=>`opacity: ${a*r}`}}function En(e,{delay:t=0,duration:n=400,easing:i=si,x:r=0,y:a=0,opacity:o=0}={}){const l=getComputedStyle(e),c=+l.opacity,s=l.transform==="none"?"":l.transform,d=c*(1-o),[f,v]=Ni(r),[m,g]=Ni(a);return{delay:t,duration:n,easing:i,css:(_,p)=>`
|
|
4
|
+
transform: ${s} translate(${(1-_)*f}${v}, ${(1-_)*m}${g});
|
|
5
|
+
opacity: ${c-d*p}`}}function Vt(e,{delay:t=0,duration:n=400,easing:i=si,axis:r="y"}={}){const a=getComputedStyle(e),o=+a.opacity,l=r==="y"?"height":"width",c=parseFloat(a[l]),s=r==="y"?["top","bottom"]:["left","right"],d=s.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),f=parseFloat(a[`padding${d[0]}`]),v=parseFloat(a[`padding${d[1]}`]),m=parseFloat(a[`margin${d[0]}`]),g=parseFloat(a[`margin${d[1]}`]),_=parseFloat(a[`border${d[0]}Width`]),p=parseFloat(a[`border${d[1]}Width`]);return{delay:t,duration:n,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${l}: ${y*c}px;padding-${s[0]}: ${y*f}px;padding-${s[1]}: ${y*v}px;margin-${s[0]}: ${y*m}px;margin-${s[1]}: ${y*g}px;border-${s[0]}-width: ${y*_}px;border-${s[1]}-width: ${y*p}px;min-${l}: 0`}}function sl(e,{delay:t=0,duration:n=400,easing:i=si,start:r=0,opacity:a=0}={}){const o=getComputedStyle(e),l=+o.opacity,c=o.transform==="none"?"":o.transform,s=1-r,d=l*(1-a);return{delay:t,duration:n,easing:i,css:(f,v)=>`
|
|
6
|
+
transform: ${c} scale(${1-s*v});
|
|
7
|
+
opacity: ${l-d*v}
|
|
8
|
+
`}}Ia();var cl=Le('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M14 2L2 14M2 2L14 14" stroke="currentColor" stroke-width="1.33" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Br(e){var t=cl();k(e,t)}function ci(e,t){ae(t,!0);const n=L(t,"size",3,"margin(2)"),i=L(t,"onclick",3,()=>null),r=Ko(t,["$$slots","$$events","$$legacy","children","size","onclick"]);var a=Fe(),o=ne(a);Co(o,()=>t.href?"a":"button",!1,(l,c)=>{let s;N(()=>{s=Lo(l,s,{role:t.href?"link":"button",onclick:i(),class:"button",...r},"svelte-1qqv88o",l.namespaceURI===Ji,l.nodeName.includes("-")),xn(l,"--size",n())});var d=Fe(),f=ne(d);Pt(f,()=>t.children??st),k(c,d)}),k(e,a),oe()}function ul(e){C(e,e.v+1)}function dl(e){let t=0,n=Ee(0),i;return()=>{Za()&&(u(n),yn(()=>(t===0&&(i=Ke(()=>e(()=>ul(n)))),t+=1,()=>{Bn().then(()=>{t-=1,t===0&&(i==null||i(),i=void 0)})})))}}var zt,Wt;class fl{constructor(t,n){Pn(this,zt);Pn(this,Wt);jn(this,zt,t),jn(this,Wt,dl(n))}get current(){return Cn(this,Wt).call(this),Cn(this,zt).call(this)}}zt=new WeakMap,Wt=new WeakMap;const vl=/\(.+\)/;class _l extends fl{constructor(t,n){let i=vl.test(t)?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,a=>ko(r,"change",a))}}const ui=new _l("(prefers-reduced-motion: reduce)");var hl=(e,t)=>t()(),gl=I('<div class="modal svelte-aqwna4"><div class="dialog svelte-aqwna4" role="dialog" aria-labelledby="title" data-view-transition-new=""><div class="close svelte-aqwna4"><!></div> <!></div> <div class="backdrop svelte-aqwna4"></div></div>');function Fr(e,t){ae(t,!0);const n=L(t,"onclose",3,()=>null),i=L(t,"onscroll",3,()=>null);br("scope","modal"),Ze(()=>{const f=document.body.style.overflowY;return document.body.style.overflowY="hidden",()=>document.body.style.overflowY=f||""});function r(f){return ui.current?Ft(f,{duration:0}):window.innerWidth<600?En(f,{duration:250,y:window.innerHeight}):sl(f,{duration:150,start:.85})}var a=gl();ce("keydown",we,({key:f})=>{f==="Escape"&&n()()});var o=x(a),l=x(o),c=x(l);ci(c,{onclick:()=>n()(),children:(f,v)=>{Br(f)},$$slots:{default:!0}});var s=E(l,2);Pt(s,()=>t.children);var d=E(o,2);d.__click=[hl,n],ce("scroll",o,function(...f){var v;(v=i())==null||v.apply(this,f)}),je(7,o,()=>r),je(7,a,()=>Ft,()=>({duration:150})),k(e,a),oe()}fe(["click"]);const ml=[{slug:"100",name:"All",categories:{movie:100,series:100,documentary:100,kids:100,cinema:100,podcasts:100}},{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];var pl=I('<div class="genre svelte-1ebula3"> </div>'),yl=(e,t)=>C(t,!0),wl=I('<button class="genre expand svelte-1ebula3"> </button>'),kl=I("<!> <!>",1);function bl(e,t){ae(t,!0);let n=U(!1);const i=K(()=>u(n)?t.genres:[t.genres[0]]);var r=kl(),a=ne(r);at(a,17,()=>u(i),xt,(c,s)=>{var d=Fe();const f=K(()=>{var g;return(g=ml.find(_=>_.slug===u(s)))==null?void 0:g.name});var v=ne(d);{var m=g=>{var _=pl(),p=x(_);N(()=>G(p,be(u(f)))),k(g,_)};H(v,g=>{u(f)&&g(m)})}k(c,d)});var o=E(a,2);{var l=c=>{var s=wl();s.__click=[yl,n];var d=x(s);N(()=>G(d,`+${t.genres.length-1}`)),k(c,s)};H(o,c=>{!u(n)&&t.genres.length>1&&c(l)})}k(e,r),oe()}fe(["click"]);function xl(e){let t=[];for(const n of e){let i=n;const r=t.find(l=>l.name===i.name),a=r==null?void 0:r.extra_info.category,o=i.extra_info.category;(a==="RENT"&&o==="BUY"||a==="BUY"&&o==="RENT")&&(t=t.filter(l=>l.name!==i.name),i={...i,extra_info:{...i.extra_info,category:"TVOD"}}),t.push(i)}return t}function xe(e,t=1){e.role="heading",e.ariaLevel=t.toString()}var Sl=Le('<svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 11L5 6L0 1" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function El(e){var t=Sl();k(e,t)}function Ut(e){return e?e.replace("/src/img",""):null}var Tl=(e,t,n)=>t(n()),Il=I('<div class="arrow svelte-g63n1y"><!></div>'),Al=I('<a target="_blank" class="playlink svelte-g63n1y" rel="sponsored"><img alt="" height="32" width="32" class="svelte-g63n1y"> <div><span class="name svelte-g63n1y"> </span> <div class="category svelte-g63n1y"> </div></div> <!></a>'),Cl=I('<div class="playlink empty svelte-g63n1y"> </div>'),Pl=I('<div class="heading svelte-g63n1y"> </div> <div class="playlinks svelte-g63n1y"><!> <!></div>',1);function jl(e,t){ae(t,!0);const n=L(t,"list",3,!1),i=so("scope")==="modal",r=K(()=>t.playlinks.filter(_=>!!_.logo_url)),a=K(()=>xl(u(r))),o={SVOD:be("Stream"),BUY:be("Buy"),RENT:be("Rent"),TVOD:be("Rent Or Buy")};function l(_){pe(i?he.TitleModalPlaylinkClick:he.TitlePopoverPlaylinkClick,t.title,{playlink:_})}var c=Pl(),s=ne(c),d=x(s);N(()=>G(d,be("Where To Stream Online"))),Qt(s,(_,p)=>xe==null?void 0:xe(_,p),()=>3);var f=E(s,2),v=x(f);at(v,17,()=>u(a),xt,(_,p)=>{let y=()=>u(p).name,w=()=>u(p).url,S=()=>u(p).logo_url,j=()=>u(p).highlighted,b=()=>u(p).cta_text,T=()=>u(p).extra_info.category;var R=Al();R.__click=[Tl,l,y];var M=x(R);N(()=>ue(M,"src",Ut(S())));var A=E(M,2),D=x(A),P=x(D),B=E(D,2),O=x(B);N(()=>G(O,b()||o[T()]||be("Stream")));var z=E(A,2);{var F=V=>{var W=Il(),J=x(W);El(J),k(V,W)};H(z,V=>{n()&&V(F)})}N(()=>{ue(R,"href",w()),ue(R,"data-playlink",y()),se(R,"highlighted",j()&&b()),G(P,y())}),k(_,R)});var m=E(v,2);{var g=_=>{var p=Cl(),y=x(p);N(()=>G(y,be("Title Unavailable"))),k(_,p)};H(m,_=>{t.playlinks.length||_(g)})}N(()=>se(f,"list",n())),k(e,c),oe()}fe(["click"]);var Ml=(e,t)=>C(t,!0),Ll=I('<button class="show-more svelte-1u3je71">Show more</button>'),Nl=I('<div class="paragraph svelte-1u3je71" role="paragraph"> </div>'),Ol=I('<div><span class="paragraph svelte-1u3je71" role="paragraph"> <!> <!></span> <!></div>');function Dl(e,t){ae(t,!0);const n=L(t,"blurb",3,""),i=L(t,"limit",3,200);let r=U(!1);const a=K(()=>t.text.slice(0,i()));var o=Ol(),l=x(o),c=x(l),s=E(c);{var d=_=>{var p=Be("...");k(_,p)};H(s,_=>{!u(r)&&t.text.length>i()&&_(d)})}var f=E(s,2);{var v=_=>{var p=Ll();p.__click=[Ml,r],k(_,p)};H(f,_=>{!u(r)&&(t.text.length>i()||n())&&_(v)})}var m=E(l,2);{var g=_=>{var p=Nl(),y=x(p);N(()=>G(y,n())),k(_,p)};H(m,_=>{u(r)&&_(g)})}N(()=>G(c,u(r)?t.text:u(a))),k(e,o),oe()}fe(["click"]);var Rl=Le('<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 0.351929L9.163 4.72803L14 5.43408L10.5 8.8385L11.326 13.648L7 11.3761L2.674 13.648L3.5 8.8385L0 5.43408L4.837 4.72803L7 0.351929Z" fill="#F6C045"></path></svg>');function Vr(e){var t=Rl();k(e,t)}var ql=I('<div class="top svelte-1026zg0"><img class="poster svelte-1026zg0"></div>'),Hl=I("<div> </div>"),Bl=I('<img alt="" class="svelte-1026zg0">'),Fl=I('<div class="content svelte-1026zg0" data-playpilot-link-injections-title=""><div class="header svelte-1026zg0"><!> <div class="heading svelte-1026zg0" id="title"> </div> <div class="info svelte-1026zg0"><div class="imdb svelte-1026zg0"><!> </div> <!> <div> </div> <div class="capitalize svelte-1026zg0"> </div> <!></div></div> <div class="main"><!> <!></div></div> <div class="background svelte-1026zg0"><!></div>',1);function Ur(e,t){ae(t,!0);const n=L(t,"small",3,!1),i=L(t,"compact",3,!1);let r=U(!1),a=U(!1),o=U(!1);var l=Fl(),c=ne(l),s=x(c),d=x(s);{var f=F=>{var V=ql(),W=x(V);N(()=>ue(W,"src",Ut(t.title.standing_poster))),N(()=>{ue(W,"alt",`Movie poster for '${t.title.title??""}'`),se(W,"loaded",u(r))}),ce("load",W,()=>C(r,!0)),k(F,V)};H(d,F=>{i()||F(f)})}var v=E(d,2),m=x(v);Qt(v,(F,V)=>xe==null?void 0:xe(F,V),()=>2);var g=E(v,2),_=x(g),p=x(_);Vr(p);var y=E(p),w=E(_,2);bl(w,{get genres(){return t.title.genres}});var S=E(w,2),j=x(S),b=E(S,2),T=x(b);N(()=>G(T,be(`Type: ${t.title.type}`)));var R=E(b,2);{var M=F=>{var V=Hl(),W=x(V);N(()=>G(W,`${t.title.length??""} ${be("Minutes")??""}`)),k(F,V)};H(R,F=>{!n()&&t.title.length&&F(M)})}var A=E(s,2),D=x(A);jl(D,{get playlinks(){return t.title.providers},get title(){return t.title},list:!0});var P=E(D,2);{var B=F=>{Dl(F,{get text(){return t.title.description},get blurb(){return t.title.blurb}})};H(P,F=>{n()||F(B)})}var O=E(c,2),z=x(O);Ir(z,()=>u(o),F=>{var V=Bl();N(()=>ue(V,"src",Ut(u(o)?t.title.standing_poster:t.title.medium_poster))),N(()=>{se(V,"loaded",u(a)),se(V,"blur",u(o))}),ce("load",V,()=>C(a,!0)),ce("error",V,()=>C(o,!0)),k(F,V)}),N(()=>{se(c,"small",n()),se(c,"compact",i()),se(v,"truncate",n()),G(m,t.title.title),G(y,` ${t.title.imdb_score??""}`),G(j,t.title.year),se(O,"faded",i())}),k(e,l),oe()}function Vl(e,t){ae(t,!0),pe(he.TitleModalView,t.title);let n=!1;Ze(()=>{const r=Date.now();return()=>pe(he.TitleModalClose,t.title,{time_spent:Date.now()-r})});function i(){n||(pe(he.TitleModalScroll,t.title),n=!0)}Fr(e,{get onclose(){return t.onclose},onscroll:i,children:(r,a)=>{Ur(r,{get title(){return t.title}})},$$slots:{default:!0}}),oe()}var Ul=I('<div class="popover svelte-tb2xdq" tabindex="-1" aria-hidden="true"><div class="dialog svelte-tb2xdq" data-view-transition-old=""><!></div></div>');function zl(e,t){ae(t,!0);let n=L(t,"maxHeight",15);br("scope","popover");let i=U(null),r=U(!1);Ze(async()=>{await Bn(),a(),await Bn(),o()});function a(){if(!u(i))return;const{top:f,right:v,bottom:m,height:g}=u(i).getBoundingClientRect(),_=l();C(r,X(f-_<0&&window.innerHeight-m>f+g));const p=window.innerWidth-v-_;v+_>window.innerWidth&&(u(i).style.left=`${p}px`)}function o(){if(!u(i))return;const{top:f,height:v}=u(i).getBoundingClientRect(),m=l(),g=u(r)?window.innerHeight-f-m:f+v-m;n(Math.min(g,window.innerHeight*.8))}function l(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}var c=Ul(),s=x(c),d=x(s);Pt(d,()=>t.children),$t(c,f=>C(i,f),()=>u(i)),N(()=>{se(c,"flip",u(r)),xn(c,"--max-height",n()?n()+"px":null)}),je(7,s,()=>En,()=>({duration:ui.current?0:100,y:10})),k(e,c),oe()}var Wl=I('<div class="title-popover svelte-d86q0q" data-playpilot-title-popover="" role="region" aria-labelledby="title"><!></div>');function Kl(e,t){ae(t,!0);let n=U(0),i=U(null);pe(he.TitlePopoverView,t.title),Ze(()=>{r();const l=Date.now();return()=>pe(he.TitlePopoverClose,t.title,{time_spent:Date.now()-l})});function r(){const l=t.event.target;if(!(l!=null&&l.getClientRects))return;const c=Array.from(l.getClientRects()),d=c.map(v=>v.x).map(v=>Math.abs(v-t.event.clientX)),f=c[d.indexOf(Math.min(...d))];u(i).style.top=f.top+window.scrollY+"px",u(i).style.left=f.left+window.scrollX+"px",u(i).style.height=f.height+"px"}var a=Wl(),o=x(a);zl(o,{get maxHeight(){return u(n)},set maxHeight(l){C(n,X(l))},children:(l,c)=>{var s=K(()=>!!u(n)&&u(n)<250);Ur(l,{get title(){return t.title},small:!0,get compact(){return u(s)}})},$$slots:{default:!0}}),$t(a,l=>C(i,l),()=>u(i)),k(e,a),oe()}var Yl=e=>e.stopPropagation(),Zl=(e,t,n,i)=>t(e,u(n).title_details,u(i)),Gl=I(' <span class="svelte-pfvkex"><button class="svelte-pfvkex"> </button></span>',1),Xl=(e,t,n,i)=>t(u(n).title_details,i()),Jl=I('<!> <a target="_blank"> </a>',1),Ql=I(" <!>.",1),$l=I("<!> <br>",1),es=I(" <br>",1),ts=I('<span class="svelte-pfvkex"><!></span>'),ns=I('<p class="svelte-pfvkex"></p>');function is(e,t){ae(t,!0);const n=L(t,"onclickmodal",3,()=>null);function i(c,s){pe(he.AfterArticlePlaylinkClick,c,{playlink:s})}function r(c,s,d){pe(he.AfterArticleModalButtonClick,s),n()(c,d)}var a=Fe(),o=ne(a);{var l=c=>{var s=ns();at(s,21,()=>t.linkInjections,xt,(d,f)=>{var v=ts();const m=K(()=>{const{key:w,title:S,title_details:j,after_article_style:b}=u(f);return{key:w,title:S,title_details:j,after_article_style:b}}),g=K(()=>{var w;return((w=u(m).title_details)==null?void 0:w.providers)||[]});var _=x(v);{var p=w=>{var S=$l(),j=ne(S);{var b=R=>{var M=Gl(),A=ne(M);N(()=>G(A,`"${u(m).title??""}" ${be("Is Available To Stream")??""} `));var D=E(A);D.__click=[Yl];var P=x(D);P.__click=[Zl,r,m,f];var B=x(P);N(()=>G(B,be("View Streaming Options"))),k(R,M)},T=R=>{var M=Ql(),A=ne(M);N(()=>G(A,`"${u(m).title??""}" ${be("Is Available To Stream On")??""} `));var D=E(A);at(D,17,()=>u(g),xt,(P,B,O)=>{let z=()=>u(B).name,F=()=>u(B).url;var V=Jl(),W=ne(V);{var J=de=>{var Ae=Be();N(()=>G(Ae,O===u(g).length-1?`, ${be("And")}`:",")),k(de,Ae)};H(W,de=>{O&&de(J)})}var ee=E(W,2);ee.__click=[Xl,i,m,z];var re=x(ee);N(()=>{ue(ee,"href",F()),G(re,z())}),k(P,V)}),k(R,M)};H(j,R=>{u(m).after_article_style==="modal_button"?R(b):R(T,!1)})}k(w,S)},y=w=>{var S=es(),j=ne(S);N(()=>G(j,`"${u(m).title??""}" ${be("Title Unavailable Suffix")??""} `)),k(w,S)};H(_,w=>{u(g).length?w(p):w(y,!1)})}N(()=>ue(v,"data-playpilot-injection-key",u(m).key)),k(d,v)}),k(c,s)};H(o,c=>{t.linkInjections.length&&c(l)})}k(e,a),oe()}fe(["click"]);function rs(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function di(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||""}function Oi(e,t,n=[]){var a,o;const i=document.createTreeWalker(t);let r;for(;(r=i.nextNode())&&!((a=r.nodeValue)!=null&&a.includes(e)&&!n.includes(((o=r.parentNode)==null?void 0:o.nodeName)||"")););return r}function Di(e){const t=e.parentNode;return t?t.nodeName==="A"||!!t.closest("a"):!1}function as(e,t,n,i){const r=rs(t),a=di(t),o=e.slice(0,i),l=e.slice(i),c=/[-/\\^$*+?.()|[\]{}]/g,s=new RegExp(`${a.replace(c,"\\$&")}|${r.replace(c,"\\$&")}`),d=l.replace(s,n);return o+d}function os(e,t,n,i){return e.substring(0,n)+t+e.substring(i)}function Te(e){return di(e).toLowerCase().replace(/\s+/g,"")}function zr(e,t,n){const r=e.indexOf(t),a=Math.floor((n-t.length)/2);let o=Math.max(0,r-a),l=o+n;l>e.length&&(l=e.length,o=Math.max(0,l-n));let c=e.slice(o,l).trim();return o>0&&(c="…"+c),l<e.length&&(c+="…"),c}function ls(e,t,n){const i=e.nodeType===Node.TEXT_NODE&&e.parentNode?e.parentElement:e;if(!i||!e.textContent)return{before:"",after:""};const r=i.innerText.indexOf(e.textContent),a=Ri(i.innerText.slice(0,t+r)),o=i.innerText.slice(n+r),l=Ri(qi(a,2)),c=qi(o,2);return{before:l,after:c}}function Ri(e){return e.split("").reverse().join("")}function qi(e,t=1){const n=e.match(/[^\s]+/g);return n?n.slice(0,t).join(" ").replace(/[.,!?;:]+$/u,""):""}function ss(e,t){let n=0,i=0;for(;(i=e.indexOf(t,i))!==-1;)n++,i+=t.length;return n}function cs(e,t,n){const i=[];let r=0;for(;r<=e.length;){const a=t?e.indexOf(t,r):r;if(a===-1&&t)break;const o=t?a+t.length:a,l=n?e.indexOf(n,o):e.length;if(n&&l===-1)break;const c=e.slice(o,l);i.push({match:c,index:o}),r=n?l+n.length:e.length+1}return i}function us(e,t,n,i){const a=cs(e,n,i).filter(({match:l})=>di(l).includes(t));return a.length?a.reduce((l,c)=>!l||c.match.length<l.match.length?c:l):null}function ds(e){var t,n;return{leadingSpaces:((t=e.match(/^\s*/))==null?void 0:t[0].length)||0,trailingSpaces:((n=e.match(/\s*$/))==null?void 0:n[0].length)||0}}function fs(e,t,n=0){const i=["-","_","/"],r=[];let a=t.indexOf(e);for(;a!==-1;){const o=t[a-1],l=i.includes(o),c=t[a+e.length],s=i.includes(c);!l&&!s&&r.push(a),a=t.indexOf(e,a+1)}return r[n]??-1}function Wr(e){return e.ctrlKey||e.metaKey||e.button!==0}function vs(e,t){if(!document.startViewTransition||!t){e();return}document.startViewTransition(()=>{const n=document.querySelector("[data-view-transition-old]");if(!n)return;const i=window.getComputedStyle(n).getPropertyValue("view-transition-name");n.style.viewTransitionName="none",e();const r=document.querySelector("[data-view-transition-new]");r&&(r.style.viewTransitionName=i)})}function _s(e,t,n){return e.filter(i=>n.every(r=>i[r]===t[r])).length}const ut="data-playpilot-injection-key",Nt=`[${ut}]`;let vn=null,dt=null,Ot=null,Dt=null;function fi(e,t=""){const n=[],i=[e];for(;i.length>0;){const r=i.pop();if(n.includes(r)||t&&r.matches(t)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|H1)$/.test(r.tagName)||r.offsetWidth<=1)continue;const a=Array.from(r.childNodes).some(c=>{var s;return c.nodeType===Node.TEXT_NODE&&((s=c.nodeValue)==null?void 0:s.trim())!==""});if(a&&r.tagName==="LI"){const c=r.closest("ul, ol");c&&!n.includes(c)&&n.push(c);continue}const o=r.tagName==="P"&&!!r.textContent;if(a||o){n.push(r);continue}const l=Array.from(r.children);for(let c=l.length-1;c>=0;c--)i.push(l[c])}return n}function St(){var t;const e=(t=window.PlayPilotLinkInjections)==null?void 0:t.selector;if(e){const n=e.replace(/(:)/g,"\\$1"),i=document.querySelector(n);if(i)return i}return document.querySelector("article")||document.querySelector("main")||document.body}function Kr(e){return e.map(t=>t.innerText).join(`
|
|
9
9
|
|
|
10
|
-
`)}function vs(e,t={aiInjections:[],manualInjections:[]}){vi();const n=ks(t);if(!n)return[];const i=Te(e.map(l=>l.innerText).join(" ")),r=bs(n),a=r.filter(l=>i.includes(Te(l.sentence))),o={};for(const l of a){const d=e.findIndex(S=>Te(S.innerText).includes(Te(l.sentence))),u=e[d];if(!u)continue;const f=Di(l.title,u,["A"]);if(!(f!=null&&f.nodeValue)||Oi(f)){const S=Di(l.title,u);if(S&&Oi(S)){o[l.key]="Given text is already inside of a link.";continue}}const{injectionElement:_,linkElement:m}=_s(l),{phrase_before:g,phrase_after:v}=l;let p=-1,y=!1;if(ss(Te(u.innerText),Te(l.title))===1&&(p=u.innerHTML.indexOf(l.title)),p===-1&&(g||v)){const S=[g,l.title,v].filter(Boolean).join(" ");if(p=u.innerHTML.indexOf(S),p===-1){const j=us(u.innerHTML,l.title,g||"",v||"");if(j){const{leadingSpaces:x,trailingSpaces:T}=ds(j.match);m.innerHTML=j.match.trim();const H=j.index+x,M=j.index+j.match.length-T;u.innerHTML=os(u.innerHTML,_.outerHTML,H,M),p=j.index,y=!0}}}if(p===-1&&(f!=null&&f.nodeValue)){const S=u.innerHTML.indexOf(f.nodeValue),j=u.innerHTML.indexOf(l.sentence);p=Math.max(S,j,0)}p!==-1&&(y||(u.innerHTML=as(u.innerHTML,l.title,_.outerHTML,p)))}gs(r),hs();const s=xs(n);return s.length&&ps(e,s),n.filter(l=>l.title_details).map((l,d)=>{const u=l.duplicate??(!l.manual&&Ss(l,d,n)),f=document.querySelector(`[${ut}="${l.key}"]`),_=Tn(l)&&!l.inactive&&!l.after_article&&!f,m=!!e.find(v=>Te(v.innerText).includes(Te(l.sentence))),g=_?o[l.key]||(m?"The link failed to inject for unknown reasons.":"Given sentence was not found in the article."):"";return{...l,inactive:l.inactive??!1,duplicate:u,failed:_,failed_message:g}})}function _s(e){const t=document.createElement("span");t.dataset.playpilotInjectionKey=e.key;const n=document.createElement("a");return n.innerText=e.title,n.href=e.playpilot_url,n.target="_blank",n.rel="noopener nofollow noreferrer",t.insertAdjacentElement("beforeend",n),{injectionElement:t,linkElement:n}}function hs(){const e=Array.from(document.querySelectorAll(`${Nt} a`)),t=["--playpilot-injection-text-color","--playpilot-injection-text-color-hover","--playpilot-injection-font-weight","--playpilot-injection-font-weight-headings","--playpilot-injection-text-decoration","--playpilot-injection-text-decoration-hover","--playpilot-injection-background-color","--playpilot-injection-background-color-hover"];e.forEach(n=>{t.forEach(i=>{getComputedStyle(n).getPropertyValue(i)&&(n.dataset.usedCssVariables=`${n.dataset.usedCssVariables||""} ${i}`)})})}function gs(e){window.addEventListener("click",n=>{if(Wr(n))return;let i=n.target;if(!i||(i.hasAttribute(ut)||(i=i.closest(Nt)),!i))return;const r=i.getAttribute(ut);if(!r)return;const a=e.find(o=>r===o.key);a&&(n.preventDefault(),fs(()=>{_n(!1),Yr(n,a)},!ui.current&&window.innerWidth>=600&&!window.matchMedia("(pointer: coarse)").matches))}),window.addEventListener("mousemove",n=>{if(!dt)return;const i=n.target;i.hasAttribute("data-playpilot-title-popover")||i.closest("[data-playpilot-title-popover]")||i.hasAttribute(ut)||i.closest(Nt)||_n()}),Array.from(document.querySelectorAll(Nt)).forEach(n=>{const i=n.dataset.playpilotInjectionKey,r=e.find(a=>i===a.key);r&&(n.addEventListener("mouseenter",a=>{dt||ms(a,r)}),n.addEventListener("mouseleave",()=>vn=null))})}function Yr(e,t){Wr(e)||Ot||(e.preventDefault(),Ot=Jt(Vl,{target:$r(),props:{title:t.title_details,onclose:Zr}}))}function Zr(e=!0){Ot&&(bn(Ot,{outro:e}),Ot=null)}function ms(e,t){if(window.matchMedia("(pointer: coarse)").matches)return;dt&&_n();const n=e.currentTarget;vn=n,setTimeout(()=>{vn===n&&(dt=Jt(Kl,{target:$r(),props:{event:e,title:t.title_details}}))},100)}function _n(e=!0){dt&&(bn(dt,{outro:e}),vn=null,dt=null)}function ps(e,t){var o,s;if(Dt||!t.length)return;const n=document.createElement("div"),i=(o=window.PlayPilotLinkInjections)==null?void 0:o.after_article_selector,r=(i?document.querySelector(i):null)||e[e.length-1],a=((s=window.PlayPilotLinkInjections)==null?void 0:s.after_article_insert_position)||"afterend";n.dataset.playpilotAfterArticlePlaylinks="true",r.insertAdjacentElement(a,n),Dt=Jt(is,{target:n,props:{linkInjections:t,onclickmodal:(l,d)=>Yr(l,d)}})}function ys(){var e;Dt&&(bn(Dt),(e=document.querySelector("[data-playpilot-after-article-playlinks]"))==null||e.remove(),Dt=null)}function vi(){document.querySelectorAll(Nt).forEach(t=>ws(t.getAttribute(ut)||"")),ys(),Zr(!1),_n(!1)}function ws(e){var i;const t=document.querySelector(`[${ut}="${e}"]`);if(!t)return;const n=(i=t.querySelector("a"))==null?void 0:i.innerHTML;t.outerHTML=n||""}function ks({aiInjections:e,manualInjections:t}){return[...t.map(n=>({...n,manual:!0})),...e]}function Gr(e){return{aiInjections:e.filter(t=>!t.manual),manualInjections:e.filter(t=>t.manual)}}function Xr(e){return!e.inactive&&!e.removed&&!e.duplicate&&!!e.title_details&&Tn(e)}function Tn(e){return e.in_text||e.in_text===void 0?!0:!!e.after_article}function bs(e){return Jr(e).filter(t=>t.in_text!==!1&&Xr(t))}function xs(e){return Jr(e).filter(t=>t.after_article===!0&&Xr(t))}function Jr(e){return e.filter(t=>t.removed||t.inactive?!1:t.manual&&!t.removed&&!t.inactive?!0:!e.some(n=>n.manual&&(n.removed||n.inactive)&&Qr(n,t)))}function Ss(e,t,n){return n.some((i,r)=>t!==r&&i.manual&&Qr(i,e))}function Qr(e,t){return e.title===t.title&&Te(e.sentence)===Te(t.sentence)}function $r(){return document.querySelector("[data-playpilot-link-injections]")||document.body}function _i(){const e=St();return{content_heading:Es(e),content_modified_time:Ts(e),content_published_time:Is(e)}}function Es(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function Ts(e){const t=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||e.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?hi(n):null}function Is(e){const t=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||e.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||e.querySelector("time")||document.querySelector("time")||e.querySelector("[datetime]")||document.querySelector("[datetime]")||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?hi(n):null}function hi(e){try{return new Date(e).toISOString()}catch{return null}}let Dn=null;async function en(e,{url:t=ai(),hash:n=al(e||""),params:i={}}={}){const r=new Headers({"Content-Type":"application/json"}),a=In(),o=Rr()?await Or():!1,s=Hr();if(!a)throw new Error("No token was provided");i.metadata=_i(),i.run_ai&&(i.hash=n,i.page_text=e);const l=await fetch(Sn+`/external-pages/?api-token=${a}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${s}`,{headers:r,method:"POST",body:JSON.stringify({url:t,...i})});if(!l.ok)throw l;const d=await l.json();return window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function Hi(e,{requireCompletedResult:t=!1,runAiWhenRelevant:n=!1,pollInterval:i=3e3,maxTries:r=600,onpoll:a=()=>null}={}){let o=0;Dn&&clearTimeout(Dn);const s=async(l,d)=>{let u;try{if(u=await en(e),n&&(u=await As(e,u)),t&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=Bi(u.manual_injections||[]),u.ai_injections=Bi(u.ai_injections||[]),l(u);return}catch{if(o++,o>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),l();return}u&&a(u),Dn=setTimeout(()=>s(l),i)}};return new Promise(s)}async function As(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=_i().content_modified_time,i=t.content_modified_time?hi(t.content_modified_time):null,r=n&&i===n;return t.ai_last_run&&r?t:await en(e,{params:{run_ai:!0}})}async function Ps(e,t){var o;const n=(o=window.PlayPilotLinkInjections)==null?void 0:o.selector,r=e.filter(s=>s.manual).map(s=>({sid:s.sid,title:s.title,sentence:s.sentence,phrase_before:s.phrase_before,phrase_after:s.phrase_after,playpilot_url:s.playpilot_url,after_article:!!s.after_article,after_article_style:s.after_article_style||null,in_text:s.in_text??!0,inactive:!!s.inactive,removed:!!s.removed}));if(!await en(t,{params:{private_token:li(),manual_injections:r,content_text_selector:n}}))throw new Error("saveLinkInjections response was faulty");return e}async function Cs(){const e=new Headers({"Content-Type":"application/json"}),t=In();if(!t)throw new Error("No token was provided");const n=await fetch(Sn+`/domains/config?api-token=${t}`,{headers:e});if(!n.ok)throw n;try{return await n.json()||null}catch{return null}}function Bi(e){return e.map(t=>({...t,key:ea(t.sid)}))}function ea(e){return e+"-"+qr()}function In(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}function js(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}var Ms=Le('<svg width="8" height="4" viewBox="0 0 8 4" fill="none" class="svelte-by11ix"><path d="M1 0.5L4 3.5L7 0.5" stroke="currentColor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Ls(e,t){const n=L(t,"expanded",3,!1);var i=Ms();N(()=>se(i,"expanded",n())),k(e,i)}var Ns=Le('<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="17" r="1" fill="var(--playpilot-warning)"></circle><path d="M12 10L12 14" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.44722 18.1056L10.2111 4.57771C10.9482 3.10361 13.0518 3.10362 13.7889 4.57771L20.5528 18.1056C21.2177 19.4354 20.2507 21 18.7639 21H5.23607C3.7493 21 2.78231 19.4354 3.44722 18.1056Z" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Ds(e){var t=Ns();k(e,t)}function Os(e,t,n){t(!t()),n()(t())}var Rs=I('<button class="switch svelte-91s87b"><div class="label svelte-91s87b"><!></div> <div class="track svelte-91s87b"><div class="knob svelte-91s87b"></div></div></button>');function Wn(e,t){ae(t,!0);let n=L(t,"active",15),i=L(t,"fullwidth",3,!1),r=L(t,"label",3,""),a=L(t,"onclick",3,()=>null);var o=Rs();o.__click=[Os,n,a];var s=b(o),l=b(s);Ct(l,()=>t.children),N(()=>{ue(o,"aria-label",`Toggle ${r()??""} ${(n()?"off":"on")??""}`),se(o,"active",n()),se(o,"fullwidth",i())}),k(e,o),oe()}fe(["click"]);var qs=I('<input type="text" autocomplete="off" class="svelte-1vrer3i">');function gi(e,t){let n=L(t,"value",15),i=L(t,"label",3,""),r=L(t,"name",3,""),a=L(t,"readonly",3,!1),o=L(t,"oninput",3,()=>null);var s=qs();s.__input=function(...l){var d;(d=o())==null||d.apply(this,l)},N(()=>{ue(s,"name",r()),ue(s,"aria-label",i()),ue(s,"placeholder",i()),s.readOnly=a()}),Bo(s,n),k(e,s)}fe(["input"]);var Hs=Le('<path d="M13.5833 13.6667L4.41667 13.6667M5.5 1.5H12.5C13.9001 1.5 14.6002 1.5 15.135 1.77248C15.6054 2.01217 15.9878 2.39462 16.2275 2.86502C16.5 3.3998 16.5 4.09987 16.5 5.5V12.5C16.5 13.9001 16.5 14.6002 16.2275 15.135C15.9878 15.6054 15.6054 15.9878 15.135 16.2275C14.6002 16.5 13.9001 16.5 12.5 16.5H5.5C4.09987 16.5 3.3998 16.5 2.86502 16.2275C2.39462 15.9878 2.01217 15.6054 1.77248 15.135C1.5 14.6002 1.5 13.9001 1.5 12.5V5.5C1.5 4.09987 1.5 3.3998 1.77248 2.86502C2.01217 2.39462 2.39462 2.01217 2.86502 1.77248C3.3998 1.5 4.09987 1.5 5.5 1.5Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Bs=Le('<path d="M13.5833 8.58342H4.41667M5.5 1.50009H12.5C13.9001 1.50009 14.6002 1.50009 15.135 1.77258C15.6054 2.01226 15.9878 2.39471 16.2275 2.86512C16.5 3.39989 16.5 4.09996 16.5 5.50009V12.5001C16.5 13.9002 16.5 14.6003 16.2275 15.1351C15.9878 15.6055 15.6054 15.9879 15.135 16.2276C14.6002 16.5001 13.9001 16.5001 12.5 16.5001H5.5C4.09987 16.5001 3.3998 16.5001 2.86502 16.2276C2.39462 15.9879 2.01217 15.6055 1.77248 15.1351C1.5 14.6003 1.5 13.9002 1.5 12.5001V5.50009C1.5 4.09996 1.5 3.39989 1.77248 2.86512C2.01217 2.39471 2.39462 2.01226 2.86502 1.77258C3.3998 1.50009 4.09987 1.50009 5.5 1.50009Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Fs=Le('<svg width="18" height="18" viewBox="0 0 18 18" fill="none"><!></svg>');function Fi(e,t){const n=L(t,"align",3,"bottom");var i=Fs(),r=b(i);{var a=s=>{var l=Hs();k(s,l)},o=s=>{var l=Fe(),d=ne(l);{var u=f=>{var _=Bs();k(f,_)};q(d,f=>{n()==="center"&&f(u)},!0)}k(s,l)};q(r,s=>{n()==="bottom"?s(a):s(o,!1)})}k(e,i)}var Vs=I("<div><!></div>");function ht(e,t){ae(t,!0);const n=L(t,"type",3,"error"),i=L(t,"fixed",3,!1);var r=Vs(),a=b(r);Ct(a,()=>t.children),N(()=>{No(r,`alert ${n()??""} svelte-df5n87`),se(r,"fixed",i())}),k(e,r),oe()}var Us=I("<!> In-text Playlink",1),zs=I("<!> Bottom Playlink",1),Ws=I('<div class="alert svelte-1shw34x"><!></div>'),Ks=(e,t)=>t().after_article_style="playlinks",Ys=(e,t)=>t().after_article_style="modal_button",Zs=I('<div><div class="label svelte-1shw34x">Bottom playlinks style</div> <div class="group svelte-1shw34x" role="listbox" tabindex="0" aria-label="Playlink type"><button role="option" id="playlinks-in-text" class="svelte-1shw34x">Playlinks sentence</button> <button role="option" id="playlinks-after-article" class="svelte-1shw34x">Modal button</button> <div class="active-marker svelte-1shw34x"></div></div></div>'),Gs=I('<div class="switches svelte-1shw34x"><!> <!></div> <!> <!>',1);function Xs(e,t){ae(t,!0);const n=L(t,"linkInjection",7),i=K(()=>n().after_article_style==="modal_button");var r=Gs(),a=ne(r),o=b(a),s=K(()=>n().in_text??!0);Wn(o,{fullwidth:!0,get active(){return c(s)},onclick:g=>{n().in_text=g,n().manual=!0},label:"In-text Playlink",children:(g,v)=>{var p=Us(),y=ne(p);Fi(y,{align:"center"}),k(g,p)},$$slots:{default:!0}});var l=E(o,2),d=K(()=>n().after_article??!1);Wn(l,{fullwidth:!0,get active(){return c(d)},onclick:g=>{n().after_article=g,n().manual=!0},label:"Bottom Playlink",children:(g,v)=>{var p=zs(),y=ne(p);Fi(y,{align:"bottom"}),k(g,p)},$$slots:{default:!0}});var u=E(a,2);{var f=g=>{var v=Ws(),p=b(v);ht(p,{type:"warning",children:(y,w)=>{var S=Be("At least one layout option must be selected for the playlink to be visible.");k(y,S)},$$slots:{default:!0}}),je(3,v,()=>Vt,()=>({duration:200})),k(g,v)};q(u,g=>{Tn(n())||g(f)})}var _=E(u,2);{var m=g=>{var v=Zs(),p=E(b(v),2),y=b(p);y.__click=[Ks,n];var w=E(y,2);w.__click=[Ys,n];var S=E(w,2);N(()=>{ue(p,"aria-activedescendant",`playlinks-${(c(i)?"after-article":"in-text")??""}`),ue(y,"aria-selected",!c(i)||null),se(y,"active",!c(i)),ue(w,"aria-selected",c(i)||null),se(w,"active",c(i)),se(S,"right",c(i))}),je(3,v,()=>Vt,()=>({duration:100})),k(g,v)};q(_,g=>{n().after_article&&g(m)})}k(e,r),oe()}fe(["click"]);var Js=Le('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.99984 10.8333C10.4601 10.8333 10.8332 10.4602 10.8332 10C10.8332 9.53977 10.4601 9.16668 9.99984 9.16668C9.5396 9.16668 9.1665 9.53977 9.1665 10C9.1665 10.4602 9.5396 10.8333 9.99984 10.8333Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 5.00001C10.4601 5.00001 10.8332 4.62691 10.8332 4.16668C10.8332 3.70644 10.4601 3.33334 9.99984 3.33334C9.5396 3.33334 9.1665 3.70644 9.1665 4.16668C9.1665 4.62691 9.5396 5.00001 9.99984 5.00001Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 16.6667C10.4601 16.6667 10.8332 16.2936 10.8332 15.8333C10.8332 15.3731 10.4601 15 9.99984 15C9.5396 15 9.1665 15.3731 9.1665 15.8333C9.1665 16.2936 9.5396 16.6667 9.99984 16.6667Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Qs(e){var t=Js();k(e,t)}var $s=(e,t)=>P(t,!c(t)),ec=I('<div class="content svelte-zpsd2z"><!></div>'),tc=I('<div class="context-menu svelte-zpsd2z"><button class="svelte-zpsd2z"><!></button> <!></div>');function nc(e,t){ae(t,!0);let n=U(!1),i=U(null);function r(u){var _;const f=u.target;f===c(i)||(_=c(i))!=null&&_.contains(f)||P(n,!1)}var a=tc();ce("click",we,r);var o=b(a);o.__click=[$s,n];var s=b(o);Qs(s),$t(o,u=>P(i,u),()=>c(i));var l=E(o,2);{var d=u=>{var f=ec(),_=b(f);Ct(_,()=>t.children),je(1,f,()=>En,()=>({duration:150,y:5})),k(u,f)};q(l,u=>{c(n)&&u(d)})}N(()=>{ue(o,"aria-label",t.ariaLabel),ue(o,"aria-expanded",c(n))}),k(e,a),oe()}fe(["click"]);function ic(e,t,n,i){var r,a;c(t)&&(pe(he.ManualReport,n.linkInjection.title_details,{report_reason:c(t),sid:n.linkInjection.sid,title:n.linkInjection.title,sentence:n.linkInjection.sentence,failed:(r=n.linkInjection.failed)==null?void 0:r.toString(),failed_message:n.linkInjection.failed_message,manual:(a=n.linkInjection.manual)==null?void 0:a.toString()}),P(i,!0),setTimeout(n.onclose,3e3))}var rc=(e,t,n)=>P(t,X(n())),ac=I('<option class="svelte-o5qkco"> </option>'),oc=I('<div class="sent svelte-o5qkco">Report has been sent, thank you! Closing window...</div>'),lc=I('<button class="submit svelte-o5qkco">Send report</button>'),sc=I('<div class="form svelte-o5qkco"><div class="heading svelte-o5qkco">Report issue</div> <div class="info svelte-o5qkco"><div><strong class="svelte-o5qkco">Title</strong> </div> <div><strong class="svelte-o5qkco">Sentence</strong> </div></div> <label for="reason">What would you like to report?</label> <select id="reason" name="reason" class="svelte-o5qkco"><option class="svelte-o5qkco">Select an issue...</option><!></select> <div><!></div></div>');function cc(e,t){ae(t,!0);const n=[{value:"failed_injection",label:"The link failed to appear on the page."},{value:"layout_issue",label:"The link is breaking the layout or formatting of my page."},{value:"wrong_content",label:"The link points to the wrong movie or show."},{value:"inappropriate_title",label:"The link points to an inappropriate movie or show."},{value:"broken_link",label:"The link is broken or leads to an error page."},{value:"other",label:"My issue is not listed, but please have a look regardless."}];let i=U(""),r=U(!1);Fr(e,{get onclose(){return t.onclose},children:(a,o)=>{var s=sc(),l=b(s);Qt(l,(x,T)=>xe==null?void 0:xe(x,T),()=>2);var d=E(l,2),u=b(d),f=E(b(u)),_=E(u,2),m=E(b(_));N(()=>G(m,`:
|
|
11
|
-
${zr(t.linkInjection.sentence,t.linkInjection.title,100)??""}`));var g=E(d,4),v=b(g);v.value=((v.__value="")==null,"");var p=E(v);at(p,17,()=>n,xt,(x,T)=>{let H=()=>c(T).value,M=()=>c(T).label;var A=ac(),O={};A.__click=[rc,i,H];var C=b(A);N(()=>{O!==(O=H())&&(A.value=(A.__value=H())==null?"":H()),G(C,M())}),k(x,A)});var y=E(g,2),w=b(y);{var S=x=>{var T=oc();je(1,T,()=>Ft,()=>({duration:200})),k(x,T)},j=x=>{var T=lc();T.__click=[ic,i,t,r],N(()=>T.disabled=!c(i)),k(x,T)};q(w,x=>{c(r)?x(S):x(j,!1)})}N(()=>G(f,`: ${t.linkInjection.title??""}`)),Vo(g,()=>c(i),x=>P(i,x)),k(a,s)},$$slots:{default:!0}}),oe()}fe(["click"]);function uc(e,t,n){requestAnimationFrame(()=>t());const i=e.target;if(["BUTTON","INPUT"].includes(i.nodeName)||i.closest("button")||i.closest("input"))return;const r=n()[0];r&&r.scrollIntoView({behavior:"smooth"})}function dc(e,t){const n=Jt(cc,{target:document.body,props:{linkInjection:t(),onclose:()=>bn(n)}})}var fc=(e,t)=>P(t,!c(t)),vc=I('<button class="expand-sentence svelte-lo6h85"> </button>'),_c=I('<button class="context-menu-action svelte-lo6h85">Remove</button> <button class="context-menu-action svelte-lo6h85">Report issue</button>',1),hc=(e,t)=>P(t,!c(t)),gc=I('<div class="warning svelte-lo6h85" aria-label="Invalid playlink settings"><!></div>'),mc=I('<div class="actions svelte-lo6h85"><button class="expand svelte-lo6h85" aria-label="Expand"><!></button> <!> <!></div>'),pc=I('<div class="expanded svelte-lo6h85"><div class="label svelte-lo6h85">Link URL</div> <!> <div class="label offset svelte-lo6h85">Layout options</div> <div class="type-select svelte-lo6h85"><!></div></div>'),yc=I('<div class="item svelte-lo6h85"><div class="header svelte-lo6h85"><img class="poster svelte-lo6h85" alt="" width="32" height="48"> <div class="info svelte-lo6h85"><div class="title svelte-lo6h85"> </div> <div class="sentence svelte-lo6h85"><!> <!></div></div> <div class="context-menu svelte-lo6h85"><!></div></div> <div class="content svelte-lo6h85"><!> <!></div></div>');function wc(e,t){ae(t,!0);const n=L(t,"linkInjection",15),i=L(t,"onremove",3,()=>null),r=L(t,"onhighlight",3,()=>null),a=K(()=>n()||{}),o=K(()=>c(a).key),s=K(()=>c(a).sentence),l=K(()=>c(a).title_details),d=K(()=>c(a).failed),u=K(()=>c(a).failed_message),f=K(()=>c(a).inactive),_=K(()=>c(l)),m=K(()=>zr(n().sentence,n().title,60));let g=U(!1),v=U(!1),p=U(!1),y=U(null);Ze(()=>{c(d)&&pe(he.InjectionFailed,c(_),{phrase:n().title,sentence:c(s)})});function w(Q=!0){j().forEach(le=>{le.classList.toggle("playpilot-injection-highlight",Q)})}function S(Q){let te=Q.target,le=te==null?void 0:te.dataset.playpilotInjectionKey;te&&!le&&(te=te.closest(`[data-playpilot-injection-key="${c(o)}"]`),le=te==null?void 0:te.dataset.playpilotInjectionKey),P(p,le===c(o)),c(y)&&c(p)&&r()(c(y))}function j(){const Q=Array.from(document.querySelectorAll(`[data-playpilot-injection-key="${c(o)}"]`));return Q.length?Q:fi(St()).filter(te=>Te(te.innerText).includes(Te(n().sentence)))||[]}var x=yc();ce("mouseover",we,S),x.__click=[uc,w,j];var T=b(x),H=b(T);N(()=>ue(H,"src",Ut(c(_).standing_poster)));var M=E(H,2),A=b(M),O=b(A),C=E(A,2),B=b(C);Ao(B,()=>(c(v)?c(s):c(m)).replace(n().title,`<em>${n().title}</em>`));var D=E(B,2);{var z=Q=>{var te=vc();te.__click=[fc,v];var le=b(te);N(()=>G(le,c(v)?"Less":"More")),k(Q,te)};q(D,Q=>{c(m).length<c(s).length&&Q(z)})}var F=E(M,2),V=b(F);nc(V,{ariaLabel:"More options",children:(Q,te)=>{var le=_c(),Pe=ne(le);Pe.__click=function(...ot){var R;(R=i())==null||R.apply(this,ot)};var Qe=E(Pe,2);Qe.__click=[dc,n],k(Q,le)},$$slots:{default:!0}});var W=E(T,2),J=b(W);{var ee=Q=>{ht(Q,{children:(te,le)=>{var Pe=Be();N(()=>G(Pe,c(u))),k(te,Pe)},$$slots:{default:!0}})},re=Q=>{var te=mc(),le=b(te);le.__click=[hc,g];var Pe=b(le);Ls(Pe,{get expanded(){return c(g)}});var Qe=E(le,2);{var ot=ve=>{var Se=gc(),Ne=b(Se);Ds(Ne),je(3,Se,()=>Ft,()=>({duration:100})),k(ve,Se)};q(Qe,ve=>{Tn(n())||ve(ot)})}var R=E(Qe,2),Y=K(()=>c(f)?"Inactive":"Visible"),_e=K(()=>!n().inactive);Wn(R,{get label(){return c(Y)},get active(){return c(_e)},onclick:ve=>{n(n().inactive=!ve,!0),n(n().manual=!0,!0)},children:(ve,Se)=>{var Ne=Be();N(()=>G(Ne,c(f)?"Inactive":"Visible")),k(ve,Ne)},$$slots:{default:!0}}),N(()=>ue(le,"aria-expanded",c(g))),k(Q,te)};q(J,Q=>{c(d)?Q(ee):Q(re,!1)})}var de=E(J,2);{var Ae=Q=>{var te=pc(),le=E(b(te),2);gi(le,{oninput:()=>n(n().manual=!0,!0),label:"Playlink URL",get value(){return n().playpilot_url},set value(ot){n(n().playpilot_url=ot,!0)}});var Pe=E(le,4),Qe=b(Pe);Xs(Qe,{get linkInjection(){return n()}}),je(3,te,()=>Vt,()=>({duration:100})),k(Q,te)};q(de,Q=>{c(g)&&Q(Ae)})}$t(x,Q=>P(y,Q),()=>c(y)),N(()=>{se(x,"highlighted",c(p)),se(x,"inactive",c(f)),G(O,c(_).title)}),ce("mouseenter",x,()=>w(!0)),ce("mouseleave",x,()=>w(!1)),ce("error",H,({target:Q})=>Q.src=Lr),je(6,x,()=>Vt,()=>({duration:200})),k(e,x),oe()}fe(["click"]);var kc=I('<button class="drag-handle svelte-19mcc5g" aria-label="Move editor"></button>');function bc(e,t){ae(t,!0);let n=L(t,"element",7),i=L(t,"position",23,()=>({x:0,y:0})),r=L(t,"limit",19,()=>({x:0,y:0})),a=L(t,"onchange",3,()=>null),o=!1,s={x:0,y:0},l=i();Ze(()=>{d(i().x,i().y)});function d(v,p){const y=window.innerWidth,w=window.innerHeight,S=n().clientWidth,j=n().clientHeight;v=Math.min(Math.max(v,r().x),y-S-r().x),p=Math.min(Math.max(p,r().y),w-j-r().y),n().style.right=v+"px",n().style.bottom=Math.max(p,r().y)+"px",i({x:v,y:p}),a()(i())}function u(v){var p,y;return{x:v.pageX||((p=v.touches)==null?void 0:p[0].pageX)||0,y:v.pageY||((y=v.touches)==null?void 0:y[0].pageY)||0}}function f(v){o=!0,s=u(v),l=i()}function _(v){if(!o)return;const p=u(v),y=p.x-s.x,w=p.y-s.y,S=l.x-y,j=l.y-w;d(S,j)}function m(){o&&(o=!1)}var g=kc();ce("mousemove",we,_),ce("touchmove",we,_,void 0,!0),ce("mouseup",we,m),ce("touchend",we,m),ce("resize",we,()=>d(i().x,i().y)),g.__mousedown=f,g.__touchstart=f,k(e,g),oe()}fe(["mousedown","touchstart"]);var xc=I('<button class="resize-handle svelte-sxkuxk" aria-label="Move editor"></button>');function Sc(e,t){ae(t,!0);let n=L(t,"element",7),i=L(t,"height",7,200),r=L(t,"onchange",3,()=>null);const a=16;let o=!1,s=0,l=i();Ze(()=>{i()&&d(i())});function d(v){const p=window.getComputedStyle(n()).minHeight||"0",y=Math.max(parseInt(p),Math.min(v,m()));n().style.height=`${y}px`,i(y),r()(y)}function u(v){var p,y;o=!0,s=v.pageY||((y=(p=v.touches)==null?void 0:p[0])==null?void 0:y.pageY)||0,l=n().clientHeight}function f(v){var S,j;if(!o)return;const p=v.pageY||((j=(S=v.touches)==null?void 0:S[0])==null?void 0:j.pageY)||0,y=s-p,w=l+y;d(w)}function _(){o=!1}function m(){const v=window.innerHeight-n().getBoundingClientRect().bottom;return Math.max(window.innerHeight-a*2-v,0)}var g=xc();ce("mousemove",we,f),ce("touchmove",we,f,void 0,!0),ce("mouseup",we,_),ce("touchend",we,_),ce("resize",we,()=>{i()&&d(i())}),g.__mousedown=u,g.__touchstart=u,k(e,g),oe()}fe(["mousedown","touchstart"]);var Ec=Le('<svg width="4" height="8" viewBox="0 0 4 8" fill="none"><path d="M3.5 7L0.5 4L3.5 1" stroke="currentcolor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Tc(e){var t=Ec();k(e,t)}async function Ic(e){const t=new Headers({"Content-Type":"application/json"}),n=In();if(!n)throw new Error("No token was provided");const i=await fetch(Sn+`/search/titles/?api-token=${n}&query=${e}`,{headers:t});if(!i.ok)throw i;return await i.json()}var Ac=Le('<svg viewBox="0 -960 960 960" width="18" height="18"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"></path></svg>');function Pc(e){var t=Ac();k(e,t)}var Cc=I("<div> </div>"),jc=e=>e.stopImmediatePropagation(),Mc=I('<button class="item svelte-rjq94e"><img class="poster svelte-rjq94e" alt="" width="28" height="42"> <div class="content"><div class="name svelte-rjq94e"> </div> <div class="meta svelte-rjq94e"><div class="imdb svelte-rjq94e"><!> </div> <div> </div> <div> </div> <!></div></div> <a target="_blank" class="open-in-new-tab svelte-rjq94e"><!></a></button>');function Vi(e,t){ae(t,!0);const n=L(t,"hoverable",3,!0),i=L(t,"onclick",3,()=>null);var r=Mc();r.__click=function(...x){var T;(T=i())==null||T.apply(this,x)};var a=b(r);N(()=>ue(a,"src",Ut(t.title.standing_poster)));var o=E(a,2),s=b(o),l=b(s),d=E(s,2),u=b(d),f=b(u);Vr(f);var _=E(f),m=E(u,2),g=b(m),v=E(m,2),p=b(v),y=E(v,2);{var w=x=>{var T=Cc(),H=b(T);N(()=>G(H,`${t.title.length??""} min`)),k(x,T)};q(y,x=>{t.title.length&&x(w)})}var S=E(o,2);S.__click=[jc];var j=b(S);Pc(j),N(()=>{se(r,"hoverable",n()),G(l,t.title.title),G(_,` ${t.title.imdb_score??""}`),G(g,t.title.year),G(p,t.title.type),ue(S,"href",`${Mr}/${t.title.type??""}/${t.title.slug??""}`)}),ce("error",a,({target:x})=>x.src=Lr),k(e,r),oe()}fe(["click"]);var Lc=I('<em class="empty svelte-1olb8n0">No results found</em>'),Nc=I('<div class="results svelte-1olb8n0" data-testid="search-results"></div>'),Dc=I('<div class="selected svelte-1olb8n0"><!></div>'),Oc=I('<div class="search svelte-1olb8n0"><!> <!> <!></div>');function Rc(e,t){ae(t,!0);let n=L(t,"onselect",3,()=>null),i=L(t,"query",15),r=U(X([])),a=U(null),o=U(!1);pn(()=>{i()&&s(i())});async function s(v){P(o,!0);try{P(r,X(await Ic(v)))}finally{P(o,!1)}}function l(v){i(v.title),P(a,X(v)),n()(v)}var d=Oc(),u=b(d);gi(u,{oninput:()=>P(a,null),name:"search",label:"Search...",get value(){return i()},set value(v){i(v)}});var f=E(u,2);{var _=v=>{var p=Nc();at(p,21,()=>c(r),y=>y.sid,(y,w)=>{Vi(y,{get title(){return c(w)},onclick:()=>l(c(w))})},y=>{var w=Fe(),S=ne(w);{var j=x=>{var T=Lc();k(x,T)};q(S,x=>{c(o)||x(j)})}k(y,w)}),k(v,p)};q(f,v=>{i()&&!c(a)&&v(_)})}var m=E(f,2);{var g=v=>{var p=Dc(),y=b(p);Vi(y,{get title(){return c(a)},hoverable:!1}),k(v,p)};q(m,v=>{c(a)&&v(g)})}k(e,d),oe()}function qc(e,t=e.anchorNode){if(!e.anchorNode||!t)return{start:-1,end:-1};const n=e.toString().trim(),i=e.toString().search(/\S/);if(e.anchorNode===t&&t.nodeType===Node.TEXT_NODE){const d=Math.min(e.anchorOffset,e.focusOffset)+i;return{start:d,end:d+n.length}}const r=e.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset);const s=a.toString().length+i,l=s+n.length;return{start:s,end:l}}function Hc(e,t,n,i,r,a,o,s){if(!c(t)||!c(n))return;const l=c(n).type==="movie"?"movie":"show",d=Mr+`/${l}/${c(n).slug}`,u={sid:c(n).sid,title:c(t),sentence:c(i),phrase_before:c(r),phrase_after:c(a),playpilot_url:d,key:ea(c(n).sid),title_details:c(n),manual:!0};o.onsave(u),s()()}var Bc=I('<div class="error svelte-1i8p6op"><!></div>'),Fc=I('<label for="text" class="svelte-1i8p6op">Paired title</label> <!>',1),Vc=I('<section class="layout svelte-1i8p6op"><div class="header svelte-1i8p6op"><!> <div class="heading svelte-1i8p6op">Add Playlink manually</div></div> <p class="svelte-1i8p6op">Highlight the text section in your post that you want to turn into a Playlink.</p> <label for="text" class="svelte-1i8p6op">Selected text</label> <!> <!> <!> <button class="save svelte-1i8p6op">Add playlink</button></section>');function Uc(e,t){ae(t,!0);const n=L(t,"pageText",3,""),i=L(t,"onclose",3,()=>null);let r=U(""),a=U(""),o=U(null),s=U(""),l=U(""),d=U(""),u=U("");Ze(f);function f(){const A=window.getSelection();if(!(A!=null&&A.anchorNode)||A.anchorNode.parentElement&&!St().contains(A.anchorNode.parentElement))return;const O=A.toString().trim();if(!O)return;P(d,""),P(r,X(O));const C=A.getRangeAt(0).cloneContents();if(Array.from(C.childNodes).filter(ee=>{var re;return(re=ee.textContent)==null?void 0:re.trim()}).find(ee=>{var re;return ee.nodeName==="A"||((re=ee.querySelector)==null?void 0:re.call(ee,"a"))})){P(d,"Selection is or contains a link. Injections can not be created around already existing links.");return}P(u,X(c(r)));const{node:D,sentence:z}=_(A,O);if(!D)return;P(a,X(z));const{start:F,end:V}=qc(A,D);(ee=>(P(l,X(ee.before)),P(s,X(ee.after))))(ls(D,F,V)),z.includes(c(l))||P(l,""),z.includes(c(s))||P(s,"");const W=A.getRangeAt(0).commonAncestorContainer.textContent,J=Te(n());(!W||!J.includes(Te(W)))&&P(d,"Selection was not inside of given content")}function _(A,O){const C=A.getRangeAt(0),B=St();let D=C.startContainer;for(;(D.textContent||"").length<=O.length*3&&D.parentNode&&D.parentNode.textContent!==B.textContent;)D=D.parentNode;if(!D||!D.textContent)return{node:null,sentence:""};const z=D.textContent,F=m(D,C.startContainer,C.startOffset),V=m(D,C.endContainer,C.endOffset),W=z.slice(0,F).lastIndexOf("."),J=z.slice(V).match(/[.!?]/),ee=J?V+J.index:z.length,re=W===-1?0:W+1,de=ee,Ae=z.slice(re,de+1).trim();return{node:D,sentence:Ae}}function m(A,O,C){let B=0;const D=A,z=F=>{var V;if(F===O)return B+=C,!0;F.nodeType===Node.TEXT_NODE&&(B+=((V=F.textContent)==null?void 0:V.length)||0);for(let W=F.firstChild;W;W=W.nextSibling)if(z(W))return!0;return!1};return z(D),B}function g(A){var O,C;P(o,X(A)),(C=(O=window.getSelection())==null?void 0:O.removeAllRanges)==null||C.call(O)}var v=Vc();ce("mouseup",we,f);var p=b(v),y=b(p);ci(y,{get onclick(){return i()},size:"24px",children:(A,O)=>{Tc(A)},$$slots:{default:!0}});var w=E(y,2);Qt(w,(A,O)=>xe==null?void 0:xe(A,O),()=>2);var S=E(p,6);gi(S,{get value(){return c(r)},label:"Select text on the page",name:"selected-text",readonly:!0});var j=E(S,2);{var x=A=>{var O=Bc(),C=b(O);ht(C,{children:(B,D)=>{var z=Be();N(()=>G(z,c(d))),k(B,z)},$$slots:{default:!0}}),k(A,O)};q(j,A=>{c(d)&&A(x)})}var T=E(j,2);{var H=A=>{var O=Fc(),C=E(ne(O),2);Ir(C,()=>c(a)+c(r),B=>{Rc(B,{onselect:g,get query(){return c(u)},set query(D){P(u,X(D))}})}),k(A,O)};q(T,A=>{c(d)||A(H)})}var M=E(T,2);M.__click=[Hc,r,o,a,l,s,t,i],N(()=>M.disabled=!c(r)||!c(o)),k(e,v),oe()}fe(["click"]);const Kn="PlayPilotEditorialSessionId",ta=5e3,zc=ta*2;async function Wc(e){const{ai_enabled:t,injections_enabled:n,ai_last_run:i,session_id:r,session_last_ping:a}=await en(e),o=ia(r||null,a||null),s={ai_enabled:t,ai_last_run:i,injections_enabled:n,session_id:r,session_last_ping:a};return o?await na(e):s}async function na(e){const t=ra(),n=new Date(Date.now()).toISOString(),i={session_id:t,session_last_ping:n.toString()},{ai_enabled:r,injections_enabled:a,ai_last_run:o}=await en(e,{params:i});return{ai_enabled:r,ai_last_run:o,injections_enabled:a,...i}}function ia(e,t){if(!e||!t)return!0;const n=Date.now(),i=new Date(t),r=ra();return n-i.getTime()>zc?!0:r===e}function ra(){return sessionStorage.getItem(Kn)||Kc()}function Kc(){const e=sessionStorage.getItem(Kn)||qr();return sessionStorage.setItem(Kn,e),e}function Yc(e,t,n){na(t()),n()()}var Zc=I('<p class="svelte-2m2urs"><strong>Someone else is currently editing this document.</strong> Wait for them to exit the page or take over edit permissions, preventing them from making more changes.</p> <button class="button svelte-2m2urs">Take over editing</button>',1),Gc=I('<div class="alert svelte-2m2urs"><!></div>');function Xc(e,t){ae(t,!0);const n=L(t,"pageText",3,""),i=L(t,"onpoll",3,()=>null),r=L(t,"onallow",3,()=>null),a=L(t,"ondisallow",3,()=>null),o=L(t,"ontakeover",3,()=>null);let s=null,l=U(!0);Ze(()=>(d(),()=>{s&&clearInterval(s)}));function d(){u(),s=setInterval(u,ta)}async function u(){const g=await Wc(n());g&&(P(l,X(ia(g.session_id||null,g.session_last_ping||null))),c(l)?r()():a()(),i()({injectionsEnabled:!!g.injections_enabled,aiEnabled:!!g.ai_enabled}))}var f=Fe(),_=ne(f);{var m=g=>{var v=Gc(),p=b(v);ht(p,{type:"warning",children:(y,w)=>{var S=Zc(),j=E(ne(S),2);j.__click=[Yc,n,o],k(y,S)},$$slots:{default:!0}}),k(g,v)};q(_,g=>{c(l)||g(m)})}k(e,f),oe()}fe(["click"]);var Jc=Le('<svg width="24px" height="24px" viewBox="0 0 64 64" stroke-width="3" stroke="currentColor" fill="none"><circle cx="34.52" cy="11.43" r="5.82"></circle><circle cx="53.63" cy="31.6" r="5.82"></circle><circle cx="34.52" cy="50.57" r="5.82"></circle><circle cx="15.16" cy="42.03" r="5.82"></circle><circle cx="15.16" cy="19.27" r="5.82"></circle><circle cx="34.51" cy="29.27" r="4.7"></circle><line x1="20.17" y1="16.3" x2="28.9" y2="12.93"></line><line x1="38.6" y1="15.59" x2="49.48" y2="27.52"></line><line x1="50.07" y1="36.2" x2="38.67" y2="46.49"></line><line x1="18.36" y1="24.13" x2="30.91" y2="46.01"></line><line x1="20.31" y1="44.74" x2="28.7" y2="48.63"></line><line x1="17.34" y1="36.63" x2="31.37" y2="16.32"></line><line x1="20.52" y1="21.55" x2="30.34" y2="27.1"></line><line x1="39.22" y1="29.8" x2="47.81" y2="30.45"></line><line x1="34.51" y1="33.98" x2="34.52" y2="44.74"></line></svg>');function Qc(e){var t=Jc();k(e,t)}var $c=I('<strong class="svelte-1kpafo0">AI processing is disabled.</strong> Enable AI from the <a href="https://partner.playpilot.net" class="svelte-1kpafo0">Partner Portal</a>',1),eu=I('<span class="svelte-1kpafo0">.</span>'),tu=I(`<strong class="svelte-1kpafo0">AI links are currently processing.</strong> This can take several minutes. We'll insert all found injections once ready. <div class="message svelte-1kpafo0"> <span class="ellipses svelte-1kpafo0"></span></div> <div class="loading-bar svelte-1kpafo0"><div class="loading-bar-progress svelte-1kpafo0"><div class="loading-bar-fill svelte-1kpafo0" data-testid="loading-bar"></div></div> <div class="loading-bar-label svelte-1kpafo0"> </div></div>`,1),nu=(e,t)=>P(t,!0),iu=I('<p class="svelte-1kpafo0"><strong class="svelte-1kpafo0">AI has finished processing.</strong> <br class="svelte-1kpafo0"> <!></p> <button class="dismiss svelte-1kpafo0">Dismiss</button>',1),ru=I('<div class="animator svelte-1kpafo0" data-test-id="animator"></div>'),au=I('<div class="ai-indicator svelte-1kpafo0" data-testid="ai-indicator"><div class="content svelte-1kpafo0"><div class="icon svelte-1kpafo0"><!></div> <div class="svelte-1kpafo0"><!></div></div> <div class="border svelte-1kpafo0"><!></div></div>');function ou(e,t){const n=L(t,"aiRunning",3,!1),i=L(t,"aiEnabled",3,!1),r=L(t,"message",3,""),a=L(t,"percentage",3,0),o=L(t,"aiInjectionsCount",3,0),s=o();let l=U(!1);var d=Fe(),u=ne(d);{var f=_=>{var m=au(),g=b(m),v=b(g),p=b(v);Qc(p);var y=E(v,2),w=b(y);{var S=M=>{var A=$c();k(M,A)},j=M=>{var A=Fe(),O=ne(A);{var C=D=>{var z=tu(),F=E(ne(z),2),V=b(F),W=E(V);at(W,20,()=>({length:3}),xt,(te,le)=>{var Pe=eu();k(te,Pe)});var J=E(F,2),ee=b(J),re=b(ee);const de=K(()=>`${Math.max(a(),3)??""}%`);N(()=>xn(re,"width",c(de)));var Ae=E(ee,2),Q=b(Ae);N(()=>G(Q,`${Math.floor(a())??""}%`)),N(()=>G(V,`${r()??""} `)),k(D,z)},B=D=>{var z=iu(),F=ne(z),V=E(b(F),4);{var W=re=>{var de=Be("No new injections where found.");k(re,de)},J=re=>{var de=Be();N(()=>G(de,`${o()??""} Injections where found and added to the page.`)),k(re,de)};q(V,re=>{s===o()?re(W):re(J,!1)})}var ee=E(F,2);ee.__click=[nu,l],k(D,z)};q(O,D=>{n()?D(C):D(B,!1)},!0)}k(M,A)};q(w,M=>{i()?M(j,!1):M(S)})}var x=E(g,2),T=b(x);{var H=M=>{var A=ru();k(M,A)};q(T,M=>{n()&&M(H)})}N(()=>se(m,"running",n())),k(_,m)};q(u,_=>{c(l)||_(f)})}k(e,d)}fe(["click"]);async function lu(e,t,n,i,r,a,o){try{P(t,!0),P(n,!1),i(await Ps(i(),r())),P(a,X(c(o)))}catch{P(n,!0)}finally{P(t,!1)}}var su=I('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:400,600,700">'),cu=I('<div class="handles svelte-11aj6xq"><div class="handle svelte-11aj6xq"><!></div> <div class="handle svelte-11aj6xq"><!></div></div>'),uu=I('<div class="loading svelte-11aj6xq">Loading...</div>'),du=I('<div class="bubble svelte-11aj6xq"> </div> <!>',1),fu=I(`<strong>Playlinks are currently not published.</strong> Visitors to this page will not see any of the injected links.
|
|
12
|
-
Publish playlinks from the <a href="https://partner.playpilot.net">Partner Portal.</a>`,1),vu=I('<div class="alert svelte-11aj6xq"><!></div>'),_u=I('<div class="error svelte-11aj6xq"><!></div>'),hu=I('<div class="empty svelte-11aj6xq">No links available. Add links manually by clicking the + button and select text to add a link to.</div>'),gu=I('<button class="save svelte-11aj6xq"> </button>'),mu=I('<!> <!> <div class="items svelte-11aj6xq"></div> <!>',1),pu=I("<!> <!> <!>",1),yu=I('<div class="panel playpilot-styled-scrollbar svelte-11aj6xq"><!></div>'),wu=I('<section class="editor playpilot-styled-scrollbar svelte-11aj6xq"><!> <header class="header svelte-11aj6xq"><div class="heading svelte-11aj6xq">Playlinks</div> <!></header> <!> <!></section>');function ku(e,t){ae(t,!0);let n=L(t,"linkInjections",15),i=L(t,"pageText",3,""),r=L(t,"loading",3,!1),a=L(t,"injectionsEnabled",7,!1),o=L(t,"aiStatus",23,()=>({})),s=L(t,"onreinitialize",3,()=>null);const l="editor-position",d="editor-height",u=JSON.parse(localStorage.getItem(l)||'{ "x": 0, "y": 0 }'),f=parseInt(localStorage.getItem(d)||"0");let _=U(null),m=U(!1),g=U(!1),v=U(!1),p=U(!0),y=U(0),w=U("");const S=K(()=>sn(o().aiEnabled,!1)),j=K(()=>sn(o().aiRunning,!1)),x=K(()=>JSON.stringify(n())),T=K(()=>!c(j)&&c(p)),H=K(()=>c(w)&&c(w)!==c(x)),M=K(()=>n().filter(R=>R.title_details&&!R.removed&&!R.duplicate&&(R.manual||!R.manual&&!R.failed))),A=K(()=>C(c(M))),O=K(()=>!r()&&Ke(()=>o().aiRunning));pn(()=>{r()||Ke(()=>{requestAnimationFrame(()=>P(w,X(c(x)))),V()})});function C(R){return R.sort((Y,_e)=>Y.failed!==_e.failed?Y.failed?1:-1:Y.title_details.title.localeCompare(_e.title_details.title))}function B(R,Y){localStorage.setItem(R,Y)}function D(R){const Y=n().findIndex(_e=>_e.key===R);n(n()[Y].manual=!0,!0),n(n()[Y].removed=!0,!0),n([...n()])}function z(R){if(!c(_))return;const Y=R.offsetTop,_e=Y+R.offsetHeight,ve=c(_).scrollTop,Se=ve+c(_).clientHeight;Y>=ve&&_e<=Se||c(_).scrollTo({top:Y-c(_).clientHeight/2,behavior:"smooth"})}function F(R){const Y=R.target;P(y,X(Y.scrollTop))}function V(){const R={total:n().length,failed_automatic:n().filter(Y=>Y.failed&&!Y.manual).length,failed_manual:n().filter(Y=>Y.failed&&Y.manual).length,final_injected:c(M).length};pe(he.TotalInjectionsCount,null,R)}var W=wu();bo(R=>{var Y=su();k(R,Y)});var J=b(W);{var ee=R=>{var Y=cu(),_e=b(Y),ve=b(_e);Sc(ve,{get element(){return c(_)},height:f,onchange:Ge=>B(d,JSON.stringify(Ge))});var Se=E(_e,2),Ne=b(Se);bc(Ne,{get element(){return c(_)},position:u,limit:{x:16,y:16},onchange:Ge=>B(l,JSON.stringify(Ge))}),k(R,Y)};q(J,R=>{c(_)&&!r()&&R(ee)})}var re=E(J,2),de=b(re);Qt(de,R=>xe==null?void 0:xe(R));var Ae=E(de,2);{var Q=R=>{var Y=uu();k(R,Y)},te=R=>{var Y=Fe(),_e=ne(Y);{var ve=Se=>{var Ne=du(),Ge=ne(Ne),De=b(Ge),tn=E(Ge,2);ci(tn,{onclick:()=>P(m,!0),size:"24px","aria-label":"Add manual injection",children:(nn,mi)=>{var rn=Be("+");k(nn,rn)},$$slots:{default:!0}}),N(()=>{ue(Ge,"aria-label",`${c(M).length??""} found playlinks`),G(De,c(M).length)}),k(Se,Ne)};q(_e,Se=>{c(T)&&Se(ve)},!0)}k(R,Y)};q(Ae,R=>{r()?R(Q):R(te,!1)})}var le=E(re,2);{var Pe=R=>{var Y=pu(),_e=ne(Y);Xc(_e,{get pageText(){return i()},onallow:()=>P(p,!0),ondisallow:()=>P(p,!1),get ontakeover(){return s()},onpoll:De=>{a(De.injectionsEnabled),o({...o(),aiEnabled:De.aiEnabled})}});var ve=E(_e,2);{var Se=De=>{ou(De,Zo(o,{get aiInjectionsCount(){return Gr(n()).aiInjections.length}}))};q(ve,De=>{c(p)&&(c(O)||!c(S))&&De(Se)})}var Ne=E(ve,2);{var Ge=De=>{var tn=mu(),nn=ne(tn);{var mi=ge=>{var me=vu(),$e=b(me);ht($e,{type:"warning",children:(lt,sa)=>{var An=fu();k(lt,An)},$$slots:{default:!0}}),k(ge,me)};q(nn,ge=>{a()||ge(mi)})}var rn=E(nn,2);{var aa=ge=>{var me=_u(),$e=b(me);ht($e,{children:(lt,sa)=>{var An=Be("Something went wrong, check your links below.");k(lt,An)},$$slots:{default:!0}}),je(7,me,()=>Vt,()=>({duration:150})),k(ge,me)};q(rn,ge=>{c(v)&&ge(aa)})}var pi=E(rn,2);at(pi,21,()=>c(A),ge=>ge.key,(ge,me)=>{const $e=K(()=>n().findIndex(lt=>lt.key===c(me).key));wc(ge,{onremove:()=>D(c(me).key),onhighlight:z,get linkInjection(){return n()[c($e)]},set linkInjection(lt){n(n()[c($e)]=lt,!0)}})},ge=>{var me=hu();k(ge,me)});var oa=E(pi,2);{var la=ge=>{var me=gu();me.__click=[lu,g,v,n,i,w,x];var $e=b(me);N(()=>{me.disabled=c(g),G($e,c(g)?"Saving...":"Save links")}),je(1,me,()=>Ft,()=>({duration:100})),k(ge,me)};q(oa,ge=>{c(H)&&n().length&&c(p)&&ge(la)})}k(De,tn)};q(Ne,De=>{c(T)&&De(Ge)})}k(R,Y)};q(le,R=>{r()||R(Pe)})}var Qe=E(le,2);{var ot=R=>{var Y=yu(),_e=b(Y);Uc(_e,{get pageText(){return i()},onclose:()=>P(m,!1),onsave:ve=>n().push(ve)}),N(()=>xn(Y,"top",`${c(y)??""}px`)),je(3,Y,()=>En,()=>({x:Math.min(window.innerWidth,320),duration:200,opacity:1})),k(R,Y)};q(Qe,R=>{c(m)&&R(ot)})}$t(W,R=>P(_,R),()=>c(_)),N(()=>{se(W,"panel-open",c(m)),se(W,"loading",r())}),ce("scroll",W,F),k(e,W),oe()}fe(["click"]);var bu=Le('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57.48 62.96"><defs><style>.playpilot-logo{fill:url(#playpilot-linear-gradient);}</style><linearGradient id="playpilot-linear-gradient" x1="-90.03" y1="-40.23" x2="-34.8" y2="-101.48" gradientTransform="translate(74.02 108.65)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#de00b9"></stop><stop offset="0.99" stop-color="#ff557b"></stop></linearGradient></defs><path class="playpilot-logo" d="M57.48,31.48C57.48,22.17,20.85,2.19,9.2.18,7.42-.12,3.78-.37,1.36,2.25-4.32,8.39,9.62,21.5,9.62,31.48S-4.32,54.57,1.36,60.72c2.42,2.61,6.06,2.37,7.84,2.06C20.85,60.78,57.48,40.79,57.48,31.48Z"></path></svg>');function xu(e){var t=bu();k(e,t)}var Su=I('<div class="trigger svelte-qee95d"><button type="button" class="button svelte-qee95d" title="Show PlayPilot TPI editor"><!></button> <button type="button" class="button close svelte-qee95d" title="Close PlayPilot TPI"><!></button></div>');function Eu(e,t){var n=Su(),i=b(n);i.__click=function(...s){var l;(l=t.onclick)==null||l.apply(this,s)};var r=b(i);xu(r);var a=E(i,2);a.__click=function(...s){var l;(l=t.onclose)==null||l.apply(this,s)};var o=b(a);Br(o),k(e,n)}fe(["click"]);var Tu=I('<div class="playpilot-link-injections svelte-13rmd3g" data-playpilot-link-injections=""><!> <!></div>');function Iu(e,t){ae(t,!0);let n=U(null),i=U(X([])),r=U(null),a=U(X(Rr())),o=U(!!li()),s=U(!1),l=U(!0),d=U(!0),u=U(X([]));const f=K(()=>c(r)||{}),_=K(()=>sn(c(f).ai_injections,()=>[],!0)),m=K(()=>sn(c(f).manual_injections,()=>[],!0)),g=K(()=>Kr(c(i)));pn(()=>{c(a)&&!c(l)&&p()}),Ze(()=>{if(!js())return(async()=>(await v(),pe(he.ArticlePageView)))(),()=>vi()});async function v(){P(l,!0),c(a)&&P(s,X(await Or()));try{const C=await Cs(),B=ai();if(P(d,!!(C!=null&&C.exclude_urls_pattern&&B.match(new RegExp(C.exclude_urls_pattern)))),c(d))return;C!=null&&C.custom_style&&x(C.custom_style||""),S((C==null?void 0:C.html_selector)||"",(C==null?void 0:C.exclude_elements_selector)||"")}catch(C){pe(he.FetchingConfigFailed),console.error("TPI Config failed to fetch",C);return}try{if(P(r,X(await Hi(c(g),{maxTries:1,runAiWhenRelevant:!0}))),P(l,!1),!c(r))return;if(el({organizationSid:c(r).organization_sid,domainSid:c(r).domain_sid}),!c(r).ai_running||!c(r).ai_enabled){w({aiInjections:c(_),manualInjections:c(m)});return}if(!c(a))return;P(r,X(await Hi(c(g),{requireCompletedResult:!0,onpoll:C=>P(r,X(C))}))),w({aiInjections:c(_),manualInjections:c(m)})}catch(C){console.error(C),pe(he.InjectionError,null,{message:C.message})}}function p(){w(Gr(c(u)))}function y(){P(a,!1),requestAnimationFrame(()=>{P(a,!0),v()})}function w(C={aiInjections:c(_),manualInjections:c(m)}){const B=vs(c(i),C);JSON.stringify(B)!==JSON.stringify(c(u))&&P(u,X(B));const D=B.filter(z=>!z.failed);D.length&&(c(a)||pe(he.ArticleInjected,null,{manual:D.filter(z=>z.manual).length,ai:D.filter(z=>!z.manual).length}))}function S(C,B){C&&(window.PlayPilotLinkInjections.selector=C),P(n,X(St())),P(i,X(fi(c(n),B)))}function j(){P(a,!0),il(),v()}function x(C){const B="playpilot-custom-style",D=document.getElementById(B),z=D||document.createElement("style");z.textContent=`[data-playpilot-link-injections] { ${C} }`,z.id=B,D||document.body.appendChild(z)}var T=Tu(),H=b(T);{var M=C=>{Eu(C,{onclick:j,onclose:()=>{P(o,!1),nl()}})};q(H,C=>{!c(d)&&c(o)&&!c(a)&&C(M)})}var A=E(H,2);{var O=C=>{var B=Fe(),D=ne(B);Go(D,{onerror:F=>pe(he.EditorError,null,{message:F.message}),failed:F=>{ht(F,{fixed:!0,children:(V,W)=>{var J=Be("An error has occured in the PlayPilot Linkinjections editor view. We've been notified and will investigate!");k(V,J)},$$slots:{default:!0}})}},F=>{var V=K(()=>{var J;return(J=c(r))==null?void 0:J.injections_enabled}),W=K(()=>{var J,ee,re,de,Ae;return{aiEnabled:(J=c(r))==null?void 0:J.ai_enabled,aiRunning:((ee=c(r))==null?void 0:ee.ai_running)&&((re=c(r))==null?void 0:re.ai_enabled),message:(de=c(r))==null?void 0:de.ai_progress_message,percentage:(Ae=c(r))==null?void 0:Ae.ai_progress_percentage}});ku(F,{get pageText(){return c(g)},get loading(){return c(l)},onreinitialize:y,get injectionsEnabled(){return c(V)},get aiStatus(){return c(W)},get linkInjections(){return c(u)},set linkInjections(J){P(u,X(J))}})}),k(C,B)};q(A,C=>{!c(d)&&c(a)&&c(s)&&C(O)})}k(e,T),oe()}window.PlayPilotLinkInjections={token:"",editorial_token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,last_successful_fetch:null,tracked_events:[],app:null,initialize(e={token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,editorial_token:""}){if(!e.token){console.error("An API token is required.");return}this.token=e.token,this.editorial_token=e.editorial_token,this.selector=e.selector,this.after_article_selector=e.after_article_selector,this.after_article_insert_position=e.after_article_insert_position,this.language=e.language,this.organization_sid=e.organization_sid,this.domain_sid=e.domain_sid,this.app&&this.destroy();const t=document.createElement("div");t.id="playpilot-link-injection",document.body.insertAdjacentElement("beforeend",t),this.app=Jt(Iu,{target:t})},destroy(){if(!this.app)return;this.app=null;const e=document.getElementById("playpilot-link-injection");e&&e.remove(),vi()},debug(){const e=St(),t=fi(e);console.group("PlayPilot Link Injection Debug"),console.groupCollapsed("Config"),console.table(Object.entries(this)),console.groupEnd(),console.groupCollapsed("Elements"),console.log("Parent element",e),console.log("Valid elements",t),console.groupEnd(),console.groupCollapsed("Last fetch"),console.log(this.last_successful_fetch),console.groupEnd(),console.groupCollapsed("Meta"),console.log(_i()),console.groupEnd(),console.groupCollapsed("Page text"),console.log(Kr(t)),console.groupEnd(),console.groupCollapsed("Tracked events"),console.log(this.tracked_events),console.groupEnd(),console.groupEnd()}};
|
|
10
|
+
`)}function hs(e,t={aiInjections:[],manualInjections:[]}){vi();const n=xs(t);if(!n)return[];const i=Te(e.map(s=>s.innerText).join(" ")),r=Ss(n),a=r.filter(s=>i.includes(Te(s.sentence))),o={};let l=-1;for(const s of a){l++;const d=e.findIndex(j=>Te(j.innerText).includes(Te(s.sentence))),f=e[d];if(!f)continue;const v=Oi(s.title,f,["A"]);if(!(v!=null&&v.nodeValue)||Di(v)){const j=Oi(s.title,f);if(j&&Di(j)){o[s.key]="Given text is already inside of a link.";continue}}const{injectionElement:m,linkElement:g}=gs(s),{phrase_before:_,phrase_after:p}=s;let y=-1,w=!1;if(ss(Te(f.innerText),Te(s.title))===1&&(y=f.innerHTML.indexOf(s.title)),y===-1&&(_||p)){const j=[_,s.title,p].filter(Boolean).join(" ");if(y=f.innerHTML.indexOf(j),y===-1){const b=us(f.innerHTML,s.title,_||"",p||"");if(b){const{leadingSpaces:T,trailingSpaces:R}=ds(b.match);g.innerHTML=b.match.trim();const M=b.index+T,A=b.index+b.match.length-R;f.innerHTML=os(f.innerHTML,m.outerHTML,M,A),y=b.index,w=!0}}}if(y===-1&&(v!=null&&v.nodeValue)){const j=f.innerHTML.indexOf(v.nodeValue),b=f.innerHTML.indexOf(s.sentence),T=_s(a.slice(0,l+1),s,["title","sentence"])-1,R=fs(v.nodeValue,f.innerHTML,T);y=Math.max(j,R,b,0)}y!==-1&&(w||(f.innerHTML=as(f.innerHTML,s.title,m.outerHTML,y)))}ps(r),ms();const c=Es(n);return c.length&&ws(e,c),n.filter(s=>s.title_details).map((s,d)=>{const f=s.duplicate??(!s.manual&&Ts(s,d,n)),v=document.querySelector(`[${ut}="${s.key}"]`),m=Tn(s)&&!s.inactive&&!s.after_article&&!v,g=!!e.find(p=>Te(p.innerText).includes(Te(s.sentence))),_=m?o[s.key]||(g?"The link failed to inject for unknown reasons.":"Given sentence was not found in the article."):"";return{...s,inactive:s.inactive??!1,duplicate:f,failed:m,failed_message:_}})}function gs(e){const t=document.createElement("span");t.dataset.playpilotInjectionKey=e.key;const n=document.createElement("a");return n.innerText=e.title,n.href=e.playpilot_url,n.target="_blank",n.rel="noopener nofollow noreferrer",t.insertAdjacentElement("beforeend",n),{injectionElement:t,linkElement:n}}function ms(){const e=Array.from(document.querySelectorAll(`${Nt} a`)),t=["--playpilot-injection-text-color","--playpilot-injection-text-color-hover","--playpilot-injection-font-weight","--playpilot-injection-font-weight-headings","--playpilot-injection-text-decoration","--playpilot-injection-text-decoration-hover","--playpilot-injection-background-color","--playpilot-injection-background-color-hover"];e.forEach(n=>{t.forEach(i=>{getComputedStyle(n).getPropertyValue(i)&&(n.dataset.usedCssVariables=`${n.dataset.usedCssVariables||""} ${i}`)})})}function ps(e){window.addEventListener("click",n=>{if(Wr(n))return;let i=n.target;if(!i||(i.hasAttribute(ut)||(i=i.closest(Nt)),!i))return;const r=i.getAttribute(ut);if(!r)return;const a=e.find(o=>r===o.key);a&&(n.preventDefault(),vs(()=>{_n(!1),Yr(n,a)},!ui.current&&window.innerWidth>=600&&!window.matchMedia("(pointer: coarse)").matches))}),window.addEventListener("mousemove",n=>{if(!dt)return;const i=n.target;i.hasAttribute("data-playpilot-title-popover")||i.closest("[data-playpilot-title-popover]")||i.hasAttribute(ut)||i.closest(Nt)||_n()}),Array.from(document.querySelectorAll(Nt)).forEach(n=>{const i=n.dataset.playpilotInjectionKey,r=e.find(a=>i===a.key);r&&(n.addEventListener("mouseenter",a=>{dt||ys(a,r)}),n.addEventListener("mouseleave",()=>vn=null))})}function Yr(e,t){Wr(e)||Dt||(e.preventDefault(),Dt=Jt(Vl,{target:$r(),props:{title:t.title_details,onclose:Zr}}))}function Zr(e=!0){Dt&&(bn(Dt,{outro:e}),Dt=null)}function ys(e,t){if(window.matchMedia("(pointer: coarse)").matches)return;dt&&_n();const n=e.currentTarget;vn=n,setTimeout(()=>{vn===n&&(dt=Jt(Kl,{target:$r(),props:{event:e,title:t.title_details}}))},100)}function _n(e=!0){dt&&(bn(dt,{outro:e}),vn=null,dt=null)}function ws(e,t){var o,l;if(Ot||!t.length)return;const n=document.createElement("div"),i=(o=window.PlayPilotLinkInjections)==null?void 0:o.after_article_selector,r=(i?document.querySelector(i):null)||e[e.length-1],a=((l=window.PlayPilotLinkInjections)==null?void 0:l.after_article_insert_position)||"afterend";n.dataset.playpilotAfterArticlePlaylinks="true",r.insertAdjacentElement(a,n),Ot=Jt(is,{target:n,props:{linkInjections:t,onclickmodal:(c,s)=>Yr(c,s)}})}function ks(){var e;Ot&&(bn(Ot),(e=document.querySelector("[data-playpilot-after-article-playlinks]"))==null||e.remove(),Ot=null)}function vi(){document.querySelectorAll(Nt).forEach(t=>bs(t.getAttribute(ut)||"")),ks(),Zr(!1),_n(!1)}function bs(e){var i;const t=document.querySelector(`[${ut}="${e}"]`);if(!t)return;const n=(i=t.querySelector("a"))==null?void 0:i.innerHTML;t.outerHTML=n||""}function xs({aiInjections:e,manualInjections:t}){return[...t.map(n=>({...n,manual:!0})),...e]}function Gr(e){return{aiInjections:e.filter(t=>!t.manual),manualInjections:e.filter(t=>t.manual)}}function Xr(e){return!e.inactive&&!e.removed&&!e.duplicate&&!!e.title_details&&Tn(e)}function Tn(e){return e.in_text||e.in_text===void 0?!0:!!e.after_article}function Ss(e){return Jr(e).filter(t=>t.in_text!==!1&&Xr(t))}function Es(e){return Jr(e).filter(t=>t.after_article===!0&&Xr(t))}function Jr(e){return e.filter(t=>t.removed||t.inactive?!1:t.manual&&!t.removed&&!t.inactive?!0:!e.some(n=>n.manual&&(n.removed||n.inactive)&&Qr(n,t)))}function Ts(e,t,n){return n.some((i,r)=>t!==r&&i.manual&&Qr(i,e))}function Qr(e,t){return e.title===t.title&&Te(e.sentence)===Te(t.sentence)}function $r(){return document.querySelector("[data-playpilot-link-injections]")||document.body}function _i(){const e=St();return{content_heading:Is(e),content_modified_time:As(e),content_published_time:Cs(e)}}function Is(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function As(e){const t=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||e.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?hi(n):null}function Cs(e){const t=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||e.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||e.querySelector("time")||document.querySelector("time")||e.querySelector("[datetime]")||document.querySelector("[datetime]")||null,n=(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?hi(n):null}function hi(e){try{return new Date(e).toISOString()}catch{return null}}let On=null;async function en(e,{url:t=ai(),hash:n=al(e||""),params:i={}}={}){const r=new Headers({"Content-Type":"application/json"}),a=In(),o=Rr()?await Dr():!1,l=Hr();if(!a)throw new Error("No token was provided");i.metadata=_i(),i.run_ai&&(i.hash=n,i.page_text=e);const c=await fetch(Sn+`/external-pages/?api-token=${a}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${l}`,{headers:r,method:"POST",body:JSON.stringify({url:t,...i})});if(!c.ok)throw c;const s=await c.json();return window.PlayPilotLinkInjections.last_successful_fetch=s,s}async function Hi(e,{requireCompletedResult:t=!1,runAiWhenRelevant:n=!1,pollInterval:i=3e3,maxTries:r=600,onpoll:a=()=>null}={}){let o=0;On&&clearTimeout(On);const l=async(c,s)=>{let d;try{if(d=await en(e),n&&(d=await Ps(e,d)),t&&d.ai_enabled&&d.ai_running)throw new Error;d.manual_injections=Bi(d.manual_injections||[]),d.ai_injections=Bi(d.ai_injections||[]),c(d);return}catch{if(o++,o>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),c();return}d&&a(d),On=setTimeout(()=>l(c),i)}};return new Promise(l)}async function Ps(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=_i().content_modified_time,i=t.content_modified_time?hi(t.content_modified_time):null,r=n&&i===n;return t.ai_last_run&&r?t:await en(e,{params:{run_ai:!0}})}async function js(e,t){var o;const n=(o=window.PlayPilotLinkInjections)==null?void 0:o.selector,r=e.filter(l=>l.manual).map(l=>({sid:l.sid,title:l.title,sentence:l.sentence,phrase_before:l.phrase_before,phrase_after:l.phrase_after,playpilot_url:l.playpilot_url,after_article:!!l.after_article,after_article_style:l.after_article_style||null,in_text:l.in_text??!0,inactive:!!l.inactive,removed:!!l.removed}));if(!await en(t,{params:{private_token:li(),manual_injections:r,content_text_selector:n}}))throw new Error("saveLinkInjections response was faulty");return e}async function Ms(){const e=new Headers({"Content-Type":"application/json"}),t=In();if(!t)throw new Error("No token was provided");const n=await fetch(Sn+`/domains/config?api-token=${t}`,{headers:e});if(!n.ok)throw n;try{return await n.json()||null}catch{return null}}function Bi(e){return e.map(t=>({...t,key:ea(t.sid)}))}function ea(e){return e+"-"+qr()}function In(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}function Ls(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}var Ns=Le('<svg width="8" height="4" viewBox="0 0 8 4" fill="none" class="svelte-by11ix"><path d="M1 0.5L4 3.5L7 0.5" stroke="currentColor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Os(e,t){const n=L(t,"expanded",3,!1);var i=Ns();N(()=>se(i,"expanded",n())),k(e,i)}var Ds=Le('<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="17" r="1" fill="var(--playpilot-warning)"></circle><path d="M12 10L12 14" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.44722 18.1056L10.2111 4.57771C10.9482 3.10361 13.0518 3.10362 13.7889 4.57771L20.5528 18.1056C21.2177 19.4354 20.2507 21 18.7639 21H5.23607C3.7493 21 2.78231 19.4354 3.44722 18.1056Z" stroke="var(--playpilot-warning)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Rs(e){var t=Ds();k(e,t)}function qs(e,t,n){t(!t()),n()(t())}var Hs=I('<button class="switch svelte-91s87b"><div class="label svelte-91s87b"><!></div> <div class="track svelte-91s87b"><div class="knob svelte-91s87b"></div></div></button>');function Wn(e,t){ae(t,!0);let n=L(t,"active",15),i=L(t,"fullwidth",3,!1),r=L(t,"label",3,""),a=L(t,"onclick",3,()=>null);var o=Hs();o.__click=[qs,n,a];var l=x(o),c=x(l);Pt(c,()=>t.children),N(()=>{ue(o,"aria-label",`Toggle ${r()??""} ${(n()?"off":"on")??""}`),se(o,"active",n()),se(o,"fullwidth",i())}),k(e,o),oe()}fe(["click"]);var Bs=I('<input type="text" autocomplete="off" class="svelte-1vrer3i">');function gi(e,t){let n=L(t,"value",15),i=L(t,"label",3,""),r=L(t,"name",3,""),a=L(t,"readonly",3,!1),o=L(t,"oninput",3,()=>null);var l=Bs();l.__input=function(...c){var s;(s=o())==null||s.apply(this,c)},N(()=>{ue(l,"name",r()),ue(l,"aria-label",i()),ue(l,"placeholder",i()),l.readOnly=a()}),Bo(l,n),k(e,l)}fe(["input"]);var Fs=Le('<path d="M13.5833 13.6667L4.41667 13.6667M5.5 1.5H12.5C13.9001 1.5 14.6002 1.5 15.135 1.77248C15.6054 2.01217 15.9878 2.39462 16.2275 2.86502C16.5 3.3998 16.5 4.09987 16.5 5.5V12.5C16.5 13.9001 16.5 14.6002 16.2275 15.135C15.9878 15.6054 15.6054 15.9878 15.135 16.2275C14.6002 16.5 13.9001 16.5 12.5 16.5H5.5C4.09987 16.5 3.3998 16.5 2.86502 16.2275C2.39462 15.9878 2.01217 15.6054 1.77248 15.135C1.5 14.6002 1.5 13.9001 1.5 12.5V5.5C1.5 4.09987 1.5 3.3998 1.77248 2.86502C2.01217 2.39462 2.39462 2.01217 2.86502 1.77248C3.3998 1.5 4.09987 1.5 5.5 1.5Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Vs=Le('<path d="M13.5833 8.58342H4.41667M5.5 1.50009H12.5C13.9001 1.50009 14.6002 1.50009 15.135 1.77258C15.6054 2.01226 15.9878 2.39471 16.2275 2.86512C16.5 3.39989 16.5 4.09996 16.5 5.50009V12.5001C16.5 13.9002 16.5 14.6003 16.2275 15.1351C15.9878 15.6055 15.6054 15.9879 15.135 16.2276C14.6002 16.5001 13.9001 16.5001 12.5 16.5001H5.5C4.09987 16.5001 3.3998 16.5001 2.86502 16.2276C2.39462 15.9879 2.01217 15.6055 1.77248 15.1351C1.5 14.6003 1.5 13.9002 1.5 12.5001V5.50009C1.5 4.09996 1.5 3.39989 1.77248 2.86512C2.01217 2.39471 2.39462 2.01226 2.86502 1.77258C3.3998 1.50009 4.09987 1.50009 5.5 1.50009Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"></path>'),Us=Le('<svg width="18" height="18" viewBox="0 0 18 18" fill="none"><!></svg>');function Fi(e,t){const n=L(t,"align",3,"bottom");var i=Us(),r=x(i);{var a=l=>{var c=Fs();k(l,c)},o=l=>{var c=Fe(),s=ne(c);{var d=f=>{var v=Vs();k(f,v)};H(s,f=>{n()==="center"&&f(d)},!0)}k(l,c)};H(r,l=>{n()==="bottom"?l(a):l(o,!1)})}k(e,i)}var zs=I("<div><!></div>");function ht(e,t){ae(t,!0);const n=L(t,"type",3,"error"),i=L(t,"fixed",3,!1);var r=zs(),a=x(r);Pt(a,()=>t.children),N(()=>{No(r,`alert ${n()??""} svelte-df5n87`),se(r,"fixed",i())}),k(e,r),oe()}var Ws=I("<!> In-text Playlink",1),Ks=I("<!> Bottom Playlink",1),Ys=I('<div class="alert svelte-1shw34x"><!></div>'),Zs=(e,t)=>t().after_article_style="playlinks",Gs=(e,t)=>t().after_article_style="modal_button",Xs=I('<div><div class="label svelte-1shw34x">Bottom playlinks style</div> <div class="group svelte-1shw34x" role="listbox" tabindex="0" aria-label="Playlink type"><button role="option" id="playlinks-in-text" class="svelte-1shw34x">Playlinks sentence</button> <button role="option" id="playlinks-after-article" class="svelte-1shw34x">Modal button</button> <div class="active-marker svelte-1shw34x"></div></div></div>'),Js=I('<div class="switches svelte-1shw34x"><!> <!></div> <!> <!>',1);function Qs(e,t){ae(t,!0);const n=L(t,"linkInjection",7),i=K(()=>n().after_article_style==="modal_button");var r=Js(),a=ne(r),o=x(a),l=K(()=>n().in_text??!0);Wn(o,{fullwidth:!0,get active(){return u(l)},onclick:g=>{n().in_text=g,n().manual=!0},label:"In-text Playlink",children:(g,_)=>{var p=Ws(),y=ne(p);Fi(y,{align:"center"}),k(g,p)},$$slots:{default:!0}});var c=E(o,2),s=K(()=>n().after_article??!1);Wn(c,{fullwidth:!0,get active(){return u(s)},onclick:g=>{n().after_article=g,n().manual=!0},label:"Bottom Playlink",children:(g,_)=>{var p=Ks(),y=ne(p);Fi(y,{align:"bottom"}),k(g,p)},$$slots:{default:!0}});var d=E(a,2);{var f=g=>{var _=Ys(),p=x(_);ht(p,{type:"warning",children:(y,w)=>{var S=Be("At least one layout option must be selected for the playlink to be visible.");k(y,S)},$$slots:{default:!0}}),je(3,_,()=>Vt,()=>({duration:200})),k(g,_)};H(d,g=>{Tn(n())||g(f)})}var v=E(d,2);{var m=g=>{var _=Xs(),p=E(x(_),2),y=x(p);y.__click=[Zs,n];var w=E(y,2);w.__click=[Gs,n];var S=E(w,2);N(()=>{ue(p,"aria-activedescendant",`playlinks-${(u(i)?"after-article":"in-text")??""}`),ue(y,"aria-selected",!u(i)||null),se(y,"active",!u(i)),ue(w,"aria-selected",u(i)||null),se(w,"active",u(i)),se(S,"right",u(i))}),je(3,_,()=>Vt,()=>({duration:100})),k(g,_)};H(v,g=>{n().after_article&&g(m)})}k(e,r),oe()}fe(["click"]);var $s=Le('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.99984 10.8333C10.4601 10.8333 10.8332 10.4602 10.8332 10C10.8332 9.53977 10.4601 9.16668 9.99984 9.16668C9.5396 9.16668 9.1665 9.53977 9.1665 10C9.1665 10.4602 9.5396 10.8333 9.99984 10.8333Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 5.00001C10.4601 5.00001 10.8332 4.62691 10.8332 4.16668C10.8332 3.70644 10.4601 3.33334 9.99984 3.33334C9.5396 3.33334 9.1665 3.70644 9.1665 4.16668C9.1665 4.62691 9.5396 5.00001 9.99984 5.00001Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.99984 16.6667C10.4601 16.6667 10.8332 16.2936 10.8332 15.8333C10.8332 15.3731 10.4601 15 9.99984 15C9.5396 15 9.1665 15.3731 9.1665 15.8333C9.1665 16.2936 9.5396 16.6667 9.99984 16.6667Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function ec(e){var t=$s();k(e,t)}var tc=(e,t)=>C(t,!u(t)),nc=I('<div class="content svelte-zpsd2z"><!></div>'),ic=I('<div class="context-menu svelte-zpsd2z"><button class="svelte-zpsd2z"><!></button> <!></div>');function rc(e,t){ae(t,!0);let n=U(!1),i=U(null);function r(d){var v;const f=d.target;f===u(i)||(v=u(i))!=null&&v.contains(f)||C(n,!1)}var a=ic();ce("click",we,r);var o=x(a);o.__click=[tc,n];var l=x(o);ec(l),$t(o,d=>C(i,d),()=>u(i));var c=E(o,2);{var s=d=>{var f=nc(),v=x(f);Pt(v,()=>t.children),je(1,f,()=>En,()=>({duration:150,y:5})),k(d,f)};H(c,d=>{u(n)&&d(s)})}N(()=>{ue(o,"aria-label",t.ariaLabel),ue(o,"aria-expanded",u(n))}),k(e,a),oe()}fe(["click"]);function ac(e,t,n,i){var r,a;u(t)&&(pe(he.ManualReport,n.linkInjection.title_details,{report_reason:u(t),sid:n.linkInjection.sid,title:n.linkInjection.title,sentence:n.linkInjection.sentence,failed:(r=n.linkInjection.failed)==null?void 0:r.toString(),failed_message:n.linkInjection.failed_message,manual:(a=n.linkInjection.manual)==null?void 0:a.toString()}),C(i,!0),setTimeout(n.onclose,3e3))}var oc=(e,t,n)=>C(t,X(n())),lc=I('<option class="svelte-o5qkco"> </option>'),sc=I('<div class="sent svelte-o5qkco">Report has been sent, thank you! Closing window...</div>'),cc=I('<button class="submit svelte-o5qkco">Send report</button>'),uc=I('<div class="form svelte-o5qkco"><div class="heading svelte-o5qkco">Report issue</div> <div class="info svelte-o5qkco"><div><strong class="svelte-o5qkco">Title</strong> </div> <div><strong class="svelte-o5qkco">Sentence</strong> </div></div> <label for="reason">What would you like to report?</label> <select id="reason" name="reason" class="svelte-o5qkco"><option class="svelte-o5qkco">Select an issue...</option><!></select> <div><!></div></div>');function dc(e,t){ae(t,!0);const n=[{value:"failed_injection",label:"The link failed to appear on the page."},{value:"layout_issue",label:"The link is breaking the layout or formatting of my page."},{value:"wrong_content",label:"The link points to the wrong movie or show."},{value:"inappropriate_title",label:"The link points to an inappropriate movie or show."},{value:"broken_link",label:"The link is broken or leads to an error page."},{value:"other",label:"My issue is not listed, but please have a look regardless."}];let i=U(""),r=U(!1);Fr(e,{get onclose(){return t.onclose},children:(a,o)=>{var l=uc(),c=x(l);Qt(c,(b,T)=>xe==null?void 0:xe(b,T),()=>2);var s=E(c,2),d=x(s),f=E(x(d)),v=E(d,2),m=E(x(v));N(()=>G(m,`:
|
|
11
|
+
${zr(t.linkInjection.sentence,t.linkInjection.title,100)??""}`));var g=E(s,4),_=x(g);_.value=((_.__value="")==null,"");var p=E(_);at(p,17,()=>n,xt,(b,T)=>{let R=()=>u(T).value,M=()=>u(T).label;var A=lc(),D={};A.__click=[oc,i,R];var P=x(A);N(()=>{D!==(D=R())&&(A.value=(A.__value=R())==null?"":R()),G(P,M())}),k(b,A)});var y=E(g,2),w=x(y);{var S=b=>{var T=sc();je(1,T,()=>Ft,()=>({duration:200})),k(b,T)},j=b=>{var T=cc();T.__click=[ac,i,t,r],N(()=>T.disabled=!u(i)),k(b,T)};H(w,b=>{u(r)?b(S):b(j,!1)})}N(()=>G(f,`: ${t.linkInjection.title??""}`)),Vo(g,()=>u(i),b=>C(i,b)),k(a,l)},$$slots:{default:!0}}),oe()}fe(["click"]);function fc(e,t,n){requestAnimationFrame(()=>t());const i=e.target;if(["BUTTON","INPUT"].includes(i.nodeName)||i.closest("button")||i.closest("input"))return;const r=n()[0];r&&r.scrollIntoView({behavior:"smooth"})}function vc(e,t){const n=Jt(dc,{target:document.body,props:{linkInjection:t(),onclose:()=>bn(n)}})}var _c=(e,t)=>C(t,!u(t)),hc=I('<button class="expand-sentence svelte-lo6h85"> </button>'),gc=I('<button class="context-menu-action svelte-lo6h85">Remove</button> <button class="context-menu-action svelte-lo6h85">Report issue</button>',1),mc=(e,t)=>C(t,!u(t)),pc=I('<div class="warning svelte-lo6h85" aria-label="Invalid playlink settings"><!></div>'),yc=I('<div class="actions svelte-lo6h85"><button class="expand svelte-lo6h85" aria-label="Expand"><!></button> <!> <!></div>'),wc=I('<div class="expanded svelte-lo6h85"><div class="label svelte-lo6h85">Link URL</div> <!> <div class="label offset svelte-lo6h85">Layout options</div> <div class="type-select svelte-lo6h85"><!></div></div>'),kc=I('<div class="item svelte-lo6h85"><div class="header svelte-lo6h85"><img class="poster svelte-lo6h85" alt="" width="32" height="48"> <div class="info svelte-lo6h85"><div class="title svelte-lo6h85"> </div> <div class="sentence svelte-lo6h85"><!> <!></div></div> <div class="context-menu svelte-lo6h85"><!></div></div> <div class="content svelte-lo6h85"><!> <!></div></div>');function bc(e,t){ae(t,!0);const n=L(t,"linkInjection",15),i=L(t,"onremove",3,()=>null),r=L(t,"onhighlight",3,()=>null),a=K(()=>n()||{}),o=K(()=>u(a).key),l=K(()=>u(a).sentence),c=K(()=>u(a).title_details),s=K(()=>u(a).failed),d=K(()=>u(a).failed_message),f=K(()=>u(a).inactive),v=K(()=>u(c)),m=K(()=>zr(n().sentence,n().title,60));let g=U(!1),_=U(!1),p=U(!1),y=U(null);Ze(()=>{u(s)&&pe(he.InjectionFailed,u(v),{phrase:n().title,sentence:u(l)})});function w(Q=!0){j().forEach(le=>{le.classList.toggle("playpilot-injection-highlight",Q)})}function S(Q){let te=Q.target,le=te==null?void 0:te.dataset.playpilotInjectionKey;te&&!le&&(te=te.closest(`[data-playpilot-injection-key="${u(o)}"]`),le=te==null?void 0:te.dataset.playpilotInjectionKey),C(p,le===u(o)),u(y)&&u(p)&&r()(u(y))}function j(){const Q=Array.from(document.querySelectorAll(`[data-playpilot-injection-key="${u(o)}"]`));return Q.length?Q:fi(St()).filter(te=>Te(te.innerText).includes(Te(n().sentence)))||[]}var b=kc();ce("mouseover",we,S),b.__click=[fc,w,j];var T=x(b),R=x(T);N(()=>ue(R,"src",Ut(u(v).standing_poster)));var M=E(R,2),A=x(M),D=x(A),P=E(A,2),B=x(P);Ao(B,()=>(u(_)?u(l):u(m)).replace(n().title,`<em>${n().title}</em>`));var O=E(B,2);{var z=Q=>{var te=hc();te.__click=[_c,_];var le=x(te);N(()=>G(le,u(_)?"Less":"More")),k(Q,te)};H(O,Q=>{u(m).length<u(l).length&&Q(z)})}var F=E(M,2),V=x(F);rc(V,{ariaLabel:"More options",children:(Q,te)=>{var le=gc(),Ce=ne(le);Ce.__click=function(...ot){var q;(q=i())==null||q.apply(this,ot)};var Qe=E(Ce,2);Qe.__click=[vc,n],k(Q,le)},$$slots:{default:!0}});var W=E(T,2),J=x(W);{var ee=Q=>{ht(Q,{children:(te,le)=>{var Ce=Be();N(()=>G(Ce,u(d))),k(te,Ce)},$$slots:{default:!0}})},re=Q=>{var te=yc(),le=x(te);le.__click=[mc,g];var Ce=x(le);Os(Ce,{get expanded(){return u(g)}});var Qe=E(le,2);{var ot=ve=>{var Se=pc(),Ne=x(Se);Rs(Ne),je(3,Se,()=>Ft,()=>({duration:100})),k(ve,Se)};H(Qe,ve=>{Tn(n())||ve(ot)})}var q=E(Qe,2),Y=K(()=>u(f)?"Inactive":"Visible"),_e=K(()=>!n().inactive);Wn(q,{get label(){return u(Y)},get active(){return u(_e)},onclick:ve=>{n(n().inactive=!ve,!0),n(n().manual=!0,!0)},children:(ve,Se)=>{var Ne=Be();N(()=>G(Ne,u(f)?"Inactive":"Visible")),k(ve,Ne)},$$slots:{default:!0}}),N(()=>ue(le,"aria-expanded",u(g))),k(Q,te)};H(J,Q=>{u(s)?Q(ee):Q(re,!1)})}var de=E(J,2);{var Ae=Q=>{var te=wc(),le=E(x(te),2);gi(le,{oninput:()=>n(n().manual=!0,!0),label:"Playlink URL",get value(){return n().playpilot_url},set value(ot){n(n().playpilot_url=ot,!0)}});var Ce=E(le,4),Qe=x(Ce);Qs(Qe,{get linkInjection(){return n()}}),je(3,te,()=>Vt,()=>({duration:100})),k(Q,te)};H(de,Q=>{u(g)&&Q(Ae)})}$t(b,Q=>C(y,Q),()=>u(y)),N(()=>{se(b,"highlighted",u(p)),se(b,"inactive",u(f)),G(D,u(v).title)}),ce("mouseenter",b,()=>w(!0)),ce("mouseleave",b,()=>w(!1)),ce("error",R,({target:Q})=>Q.src=Lr),je(6,b,()=>Vt,()=>({duration:200})),k(e,b),oe()}fe(["click"]);var xc=I('<button class="drag-handle svelte-19mcc5g" aria-label="Move editor"></button>');function Sc(e,t){ae(t,!0);let n=L(t,"element",7),i=L(t,"position",23,()=>({x:0,y:0})),r=L(t,"limit",19,()=>({x:0,y:0})),a=L(t,"onchange",3,()=>null),o=!1,l={x:0,y:0},c=i();Ze(()=>{s(i().x,i().y)});function s(_,p){const y=window.innerWidth,w=window.innerHeight,S=n().clientWidth,j=n().clientHeight;_=Math.min(Math.max(_,r().x),y-S-r().x),p=Math.min(Math.max(p,r().y),w-j-r().y),n().style.right=_+"px",n().style.bottom=Math.max(p,r().y)+"px",i({x:_,y:p}),a()(i())}function d(_){var p,y;return{x:_.pageX||((p=_.touches)==null?void 0:p[0].pageX)||0,y:_.pageY||((y=_.touches)==null?void 0:y[0].pageY)||0}}function f(_){o=!0,l=d(_),c=i()}function v(_){if(!o)return;const p=d(_),y=p.x-l.x,w=p.y-l.y,S=c.x-y,j=c.y-w;s(S,j)}function m(){o&&(o=!1)}var g=xc();ce("mousemove",we,v),ce("touchmove",we,v,void 0,!0),ce("mouseup",we,m),ce("touchend",we,m),ce("resize",we,()=>s(i().x,i().y)),g.__mousedown=f,g.__touchstart=f,k(e,g),oe()}fe(["mousedown","touchstart"]);var Ec=I('<button class="resize-handle svelte-sxkuxk" aria-label="Move editor"></button>');function Tc(e,t){ae(t,!0);let n=L(t,"element",7),i=L(t,"height",7,200),r=L(t,"onchange",3,()=>null);const a=16;let o=!1,l=0,c=i();Ze(()=>{i()&&s(i())});function s(_){const p=window.getComputedStyle(n()).minHeight||"0",y=Math.max(parseInt(p),Math.min(_,m()));n().style.height=`${y}px`,i(y),r()(y)}function d(_){var p,y;o=!0,l=_.pageY||((y=(p=_.touches)==null?void 0:p[0])==null?void 0:y.pageY)||0,c=n().clientHeight}function f(_){var S,j;if(!o)return;const p=_.pageY||((j=(S=_.touches)==null?void 0:S[0])==null?void 0:j.pageY)||0,y=l-p,w=c+y;s(w)}function v(){o=!1}function m(){const _=window.innerHeight-n().getBoundingClientRect().bottom;return Math.max(window.innerHeight-a*2-_,0)}var g=Ec();ce("mousemove",we,f),ce("touchmove",we,f,void 0,!0),ce("mouseup",we,v),ce("touchend",we,v),ce("resize",we,()=>{i()&&s(i())}),g.__mousedown=d,g.__touchstart=d,k(e,g),oe()}fe(["mousedown","touchstart"]);var Ic=Le('<svg width="4" height="8" viewBox="0 0 4 8" fill="none"><path d="M3.5 7L0.5 4L3.5 1" stroke="currentcolor" stroke-width="0.9975" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Ac(e){var t=Ic();k(e,t)}async function Cc(e){const t=new Headers({"Content-Type":"application/json"}),n=In();if(!n)throw new Error("No token was provided");const i=await fetch(Sn+`/search/titles/?api-token=${n}&query=${e}`,{headers:t});if(!i.ok)throw i;return await i.json()}var Pc=Le('<svg viewBox="0 -960 960 960" width="18" height="18"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"></path></svg>');function jc(e){var t=Pc();k(e,t)}var Mc=I("<div> </div>"),Lc=e=>e.stopImmediatePropagation(),Nc=I('<button class="item svelte-rjq94e"><img class="poster svelte-rjq94e" alt="" width="28" height="42"> <div class="content"><div class="name svelte-rjq94e"> </div> <div class="meta svelte-rjq94e"><div class="imdb svelte-rjq94e"><!> </div> <div> </div> <div> </div> <!></div></div> <a target="_blank" class="open-in-new-tab svelte-rjq94e"><!></a></button>');function Vi(e,t){ae(t,!0);const n=L(t,"hoverable",3,!0),i=L(t,"onclick",3,()=>null);var r=Nc();r.__click=function(...b){var T;(T=i())==null||T.apply(this,b)};var a=x(r);N(()=>ue(a,"src",Ut(t.title.standing_poster)));var o=E(a,2),l=x(o),c=x(l),s=E(l,2),d=x(s),f=x(d);Vr(f);var v=E(f),m=E(d,2),g=x(m),_=E(m,2),p=x(_),y=E(_,2);{var w=b=>{var T=Mc(),R=x(T);N(()=>G(R,`${t.title.length??""} min`)),k(b,T)};H(y,b=>{t.title.length&&b(w)})}var S=E(o,2);S.__click=[Lc];var j=x(S);jc(j),N(()=>{se(r,"hoverable",n()),G(c,t.title.title),G(v,` ${t.title.imdb_score??""}`),G(g,t.title.year),G(p,t.title.type),ue(S,"href",`${Mr}/${t.title.type??""}/${t.title.slug??""}`)}),ce("error",a,({target:b})=>b.src=Lr),k(e,r),oe()}fe(["click"]);var Oc=I('<em class="empty svelte-1olb8n0">No results found</em>'),Dc=I('<div class="results svelte-1olb8n0" data-testid="search-results"></div>'),Rc=I('<div class="selected svelte-1olb8n0"><!></div>'),qc=I('<div class="search svelte-1olb8n0"><!> <!> <!></div>');function Hc(e,t){ae(t,!0);let n=L(t,"onselect",3,()=>null),i=L(t,"query",15),r=U(X([])),a=U(null),o=U(!1);pn(()=>{i()&&l(i())});async function l(_){C(o,!0);try{C(r,X(await Cc(_)))}finally{C(o,!1)}}function c(_){i(_.title),C(a,X(_)),n()(_)}var s=qc(),d=x(s);gi(d,{oninput:()=>C(a,null),name:"search",label:"Search...",get value(){return i()},set value(_){i(_)}});var f=E(d,2);{var v=_=>{var p=Dc();at(p,21,()=>u(r),y=>y.sid,(y,w)=>{Vi(y,{get title(){return u(w)},onclick:()=>c(u(w))})},y=>{var w=Fe(),S=ne(w);{var j=b=>{var T=Oc();k(b,T)};H(S,b=>{u(o)||b(j)})}k(y,w)}),k(_,p)};H(f,_=>{i()&&!u(a)&&_(v)})}var m=E(f,2);{var g=_=>{var p=Rc(),y=x(p);Vi(y,{get title(){return u(a)},hoverable:!1}),k(_,p)};H(m,_=>{u(a)&&_(g)})}k(e,s),oe()}function Bc(e,t=e.anchorNode){if(!e.anchorNode||!t)return{start:-1,end:-1};const n=e.toString().trim(),i=e.toString().search(/\S/);if(e.anchorNode===t&&t.nodeType===Node.TEXT_NODE){const s=Math.min(e.anchorOffset,e.focusOffset)+i;return{start:s,end:s+n.length}}const r=e.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset);const l=a.toString().length+i,c=l+n.length;return{start:l,end:c}}function Fc(e,t,n,i,r,a,o,l){if(!u(t)||!u(n))return;const c=u(n).type==="movie"?"movie":"show",s=Mr+`/${c}/${u(n).slug}`,d={sid:u(n).sid,title:u(t),sentence:u(i),phrase_before:u(r),phrase_after:u(a),playpilot_url:s,key:ea(u(n).sid),title_details:u(n),manual:!0};o.onsave(d),l()()}var Vc=I('<div class="error svelte-1i8p6op"><!></div>'),Uc=I('<label for="text" class="svelte-1i8p6op">Paired title</label> <!>',1),zc=I('<section class="layout svelte-1i8p6op"><div class="header svelte-1i8p6op"><!> <div class="heading svelte-1i8p6op">Add Playlink manually</div></div> <p class="svelte-1i8p6op">Highlight the text section in your post that you want to turn into a Playlink.</p> <label for="text" class="svelte-1i8p6op">Selected text</label> <!> <!> <!> <button class="save svelte-1i8p6op">Add playlink</button></section>');function Wc(e,t){ae(t,!0);const n=L(t,"pageText",3,""),i=L(t,"onclose",3,()=>null);let r=U(""),a=U(""),o=U(null),l=U(""),c=U(""),s=U(""),d=U("");Ze(f);function f(){const A=window.getSelection();if(!(A!=null&&A.anchorNode)||A.anchorNode.parentElement&&!St().contains(A.anchorNode.parentElement))return;const D=A.toString().trim();if(!D)return;C(s,""),C(r,X(D));const P=A.getRangeAt(0).cloneContents();if(Array.from(P.childNodes).filter(ee=>{var re;return(re=ee.textContent)==null?void 0:re.trim()}).find(ee=>{var re;return ee.nodeName==="A"||((re=ee.querySelector)==null?void 0:re.call(ee,"a"))})){C(s,"Selection is or contains a link. Injections can not be created around already existing links.");return}C(d,X(u(r)));const{node:O,sentence:z}=v(A,D);if(!O)return;C(a,X(z));const{start:F,end:V}=Bc(A,O);(ee=>(C(c,X(ee.before)),C(l,X(ee.after))))(ls(O,F,V)),z.includes(u(c))||C(c,""),z.includes(u(l))||C(l,"");const W=A.getRangeAt(0).commonAncestorContainer.textContent,J=Te(n());(!W||!J.includes(Te(W)))&&C(s,"Selection was not inside of given content")}function v(A,D){const P=A.getRangeAt(0),B=St();let O=P.startContainer;for(;(O.textContent||"").length<=D.length*3&&O.parentNode&&O.parentNode.textContent!==B.textContent;)O=O.parentNode;if(!O||!O.textContent)return{node:null,sentence:""};const z=O.textContent,F=m(O,P.startContainer,P.startOffset),V=m(O,P.endContainer,P.endOffset),W=z.slice(0,F).lastIndexOf("."),J=z.slice(V).match(/[.!?]/),ee=J?V+J.index:z.length,re=W===-1?0:W+1,de=ee,Ae=z.slice(re,de+1).trim();return{node:O,sentence:Ae}}function m(A,D,P){let B=0;const O=A,z=F=>{var V;if(F===D)return B+=P,!0;F.nodeType===Node.TEXT_NODE&&(B+=((V=F.textContent)==null?void 0:V.length)||0);for(let W=F.firstChild;W;W=W.nextSibling)if(z(W))return!0;return!1};return z(O),B}function g(A){var D,P;C(o,X(A)),(P=(D=window.getSelection())==null?void 0:D.removeAllRanges)==null||P.call(D)}var _=zc();ce("mouseup",we,f);var p=x(_),y=x(p);ci(y,{get onclick(){return i()},size:"24px",children:(A,D)=>{Ac(A)},$$slots:{default:!0}});var w=E(y,2);Qt(w,(A,D)=>xe==null?void 0:xe(A,D),()=>2);var S=E(p,6);gi(S,{get value(){return u(r)},label:"Select text on the page",name:"selected-text",readonly:!0});var j=E(S,2);{var b=A=>{var D=Vc(),P=x(D);ht(P,{children:(B,O)=>{var z=Be();N(()=>G(z,u(s))),k(B,z)},$$slots:{default:!0}}),k(A,D)};H(j,A=>{u(s)&&A(b)})}var T=E(j,2);{var R=A=>{var D=Uc(),P=E(ne(D),2);Ir(P,()=>u(a)+u(r),B=>{Hc(B,{onselect:g,get query(){return u(d)},set query(O){C(d,X(O))}})}),k(A,D)};H(T,A=>{u(s)||A(R)})}var M=E(T,2);M.__click=[Fc,r,o,a,c,l,t,i],N(()=>M.disabled=!u(r)||!u(o)),k(e,_),oe()}fe(["click"]);const Kn="PlayPilotEditorialSessionId",ta=5e3,Kc=ta*2;async function Yc(e){const{ai_enabled:t,injections_enabled:n,ai_last_run:i,session_id:r,session_last_ping:a}=await en(e),o=ia(r||null,a||null),l={ai_enabled:t,ai_last_run:i,injections_enabled:n,session_id:r,session_last_ping:a};return o?await na(e):l}async function na(e){const t=ra(),n=new Date(Date.now()).toISOString(),i={session_id:t,session_last_ping:n.toString()},{ai_enabled:r,injections_enabled:a,ai_last_run:o}=await en(e,{params:i});return{ai_enabled:r,ai_last_run:o,injections_enabled:a,...i}}function ia(e,t){if(!e||!t)return!0;const n=Date.now(),i=new Date(t),r=ra();return n-i.getTime()>Kc?!0:r===e}function ra(){return sessionStorage.getItem(Kn)||Zc()}function Zc(){const e=sessionStorage.getItem(Kn)||qr();return sessionStorage.setItem(Kn,e),e}function Gc(e,t,n){na(t()),n()()}var Xc=I('<p class="svelte-2m2urs"><strong>Someone else is currently editing this document.</strong> Wait for them to exit the page or take over edit permissions, preventing them from making more changes.</p> <button class="button svelte-2m2urs">Take over editing</button>',1),Jc=I('<div class="alert svelte-2m2urs"><!></div>');function Qc(e,t){ae(t,!0);const n=L(t,"pageText",3,""),i=L(t,"onpoll",3,()=>null),r=L(t,"onallow",3,()=>null),a=L(t,"ondisallow",3,()=>null),o=L(t,"ontakeover",3,()=>null);let l=null,c=U(!0);Ze(()=>(s(),()=>{l&&clearInterval(l)}));function s(){d(),l=setInterval(d,ta)}async function d(){const g=await Yc(n());g&&(C(c,X(ia(g.session_id||null,g.session_last_ping||null))),u(c)?r()():a()(),i()({injectionsEnabled:!!g.injections_enabled,aiEnabled:!!g.ai_enabled}))}var f=Fe(),v=ne(f);{var m=g=>{var _=Jc(),p=x(_);ht(p,{type:"warning",children:(y,w)=>{var S=Xc(),j=E(ne(S),2);j.__click=[Gc,n,o],k(y,S)},$$slots:{default:!0}}),k(g,_)};H(v,g=>{u(c)||g(m)})}k(e,f),oe()}fe(["click"]);var $c=Le('<svg width="24px" height="24px" viewBox="0 0 64 64" stroke-width="3" stroke="currentColor" fill="none"><circle cx="34.52" cy="11.43" r="5.82"></circle><circle cx="53.63" cy="31.6" r="5.82"></circle><circle cx="34.52" cy="50.57" r="5.82"></circle><circle cx="15.16" cy="42.03" r="5.82"></circle><circle cx="15.16" cy="19.27" r="5.82"></circle><circle cx="34.51" cy="29.27" r="4.7"></circle><line x1="20.17" y1="16.3" x2="28.9" y2="12.93"></line><line x1="38.6" y1="15.59" x2="49.48" y2="27.52"></line><line x1="50.07" y1="36.2" x2="38.67" y2="46.49"></line><line x1="18.36" y1="24.13" x2="30.91" y2="46.01"></line><line x1="20.31" y1="44.74" x2="28.7" y2="48.63"></line><line x1="17.34" y1="36.63" x2="31.37" y2="16.32"></line><line x1="20.52" y1="21.55" x2="30.34" y2="27.1"></line><line x1="39.22" y1="29.8" x2="47.81" y2="30.45"></line><line x1="34.51" y1="33.98" x2="34.52" y2="44.74"></line></svg>');function eu(e){var t=$c();k(e,t)}var tu=I('<strong class="svelte-1kpafo0">AI processing is disabled.</strong> Enable AI from the <a href="https://partner.playpilot.net" class="svelte-1kpafo0">Partner Portal</a>',1),nu=I('<span class="svelte-1kpafo0">.</span>'),iu=I(`<strong class="svelte-1kpafo0">AI links are currently processing.</strong> This can take several minutes. We'll insert all found injections once ready. <div class="message svelte-1kpafo0"> <span class="ellipses svelte-1kpafo0"></span></div> <div class="loading-bar svelte-1kpafo0"><div class="loading-bar-progress svelte-1kpafo0"><div class="loading-bar-fill svelte-1kpafo0" data-testid="loading-bar"></div></div> <div class="loading-bar-label svelte-1kpafo0"> </div></div>`,1),ru=(e,t)=>C(t,!0),au=I('<p class="svelte-1kpafo0"><strong class="svelte-1kpafo0">AI has finished processing.</strong> <br class="svelte-1kpafo0"> <!></p> <button class="dismiss svelte-1kpafo0">Dismiss</button>',1),ou=I('<div class="animator svelte-1kpafo0" data-test-id="animator"></div>'),lu=I('<div class="ai-indicator svelte-1kpafo0" data-testid="ai-indicator"><div class="content svelte-1kpafo0"><div class="icon svelte-1kpafo0"><!></div> <div class="svelte-1kpafo0"><!></div></div> <div class="border svelte-1kpafo0"><!></div></div>');function su(e,t){const n=L(t,"aiRunning",3,!1),i=L(t,"aiEnabled",3,!1),r=L(t,"message",3,""),a=L(t,"percentage",3,0),o=L(t,"aiInjectionsCount",3,0),l=o();let c=U(!1);var s=Fe(),d=ne(s);{var f=v=>{var m=lu(),g=x(m),_=x(g),p=x(_);eu(p);var y=E(_,2),w=x(y);{var S=M=>{var A=tu();k(M,A)},j=M=>{var A=Fe(),D=ne(A);{var P=O=>{var z=iu(),F=E(ne(z),2),V=x(F),W=E(V);at(W,20,()=>({length:3}),xt,(te,le)=>{var Ce=nu();k(te,Ce)});var J=E(F,2),ee=x(J),re=x(ee);const de=K(()=>`${Math.max(a(),3)??""}%`);N(()=>xn(re,"width",u(de)));var Ae=E(ee,2),Q=x(Ae);N(()=>G(Q,`${Math.floor(a())??""}%`)),N(()=>G(V,`${r()??""} `)),k(O,z)},B=O=>{var z=au(),F=ne(z),V=E(x(F),4);{var W=re=>{var de=Be("No new injections where found.");k(re,de)},J=re=>{var de=Be();N(()=>G(de,`${o()??""} Injections where found and added to the page.`)),k(re,de)};H(V,re=>{l===o()?re(W):re(J,!1)})}var ee=E(F,2);ee.__click=[ru,c],k(O,z)};H(D,O=>{n()?O(P):O(B,!1)},!0)}k(M,A)};H(w,M=>{i()?M(j,!1):M(S)})}var b=E(g,2),T=x(b);{var R=M=>{var A=ou();k(M,A)};H(T,M=>{n()&&M(R)})}N(()=>se(m,"running",n())),k(v,m)};H(d,v=>{u(c)||v(f)})}k(e,s)}fe(["click"]);async function cu(e,t,n,i,r,a,o){try{C(t,!0),C(n,!1),i(await js(i(),r())),C(a,X(u(o)))}catch{C(n,!0)}finally{C(t,!1)}}var uu=I('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:400,600,700">'),du=I('<div class="handles svelte-11aj6xq"><div class="handle svelte-11aj6xq"><!></div> <div class="handle svelte-11aj6xq"><!></div></div>'),fu=I('<div class="loading svelte-11aj6xq">Loading...</div>'),vu=I('<div class="bubble svelte-11aj6xq"> </div> <!>',1),_u=I(`<strong>Playlinks are currently not published.</strong> Visitors to this page will not see any of the injected links.
|
|
12
|
+
Publish playlinks from the <a href="https://partner.playpilot.net">Partner Portal.</a>`,1),hu=I('<div class="alert svelte-11aj6xq"><!></div>'),gu=I('<div class="error svelte-11aj6xq"><!></div>'),mu=I('<div class="empty svelte-11aj6xq">No links available. Add links manually by clicking the + button and select text to add a link to.</div>'),pu=I('<button class="save svelte-11aj6xq"> </button>'),yu=I('<!> <!> <div class="items svelte-11aj6xq"></div> <!>',1),wu=I("<!> <!> <!>",1),ku=I('<div class="panel playpilot-styled-scrollbar svelte-11aj6xq"><!></div>'),bu=I('<section class="editor playpilot-styled-scrollbar svelte-11aj6xq"><!> <header class="header svelte-11aj6xq"><div class="heading svelte-11aj6xq">Playlinks</div> <!></header> <!> <!></section>');function xu(e,t){ae(t,!0);let n=L(t,"linkInjections",15),i=L(t,"pageText",3,""),r=L(t,"loading",3,!1),a=L(t,"injectionsEnabled",7,!1),o=L(t,"aiStatus",23,()=>({})),l=L(t,"onreinitialize",3,()=>null);const c="editor-position",s="editor-height",d=JSON.parse(localStorage.getItem(c)||'{ "x": 0, "y": 0 }'),f=parseInt(localStorage.getItem(s)||"0");let v=U(null),m=U(!1),g=U(!1),_=U(!1),p=U(!0),y=U(0),w=U("");const S=K(()=>sn(o().aiEnabled,!1)),j=K(()=>sn(o().aiRunning,!1)),b=K(()=>JSON.stringify(n())),T=K(()=>!u(j)&&u(p)),R=K(()=>u(w)&&u(w)!==u(b)),M=K(()=>n().filter(q=>q.title_details&&!q.removed&&!q.duplicate&&(q.manual||!q.manual&&!q.failed))),A=K(()=>P(u(M))),D=K(()=>!r()&&Ke(()=>o().aiRunning));pn(()=>{r()||Ke(()=>{requestAnimationFrame(()=>C(w,X(u(b)))),V()})});function P(q){return q.sort((Y,_e)=>Y.failed!==_e.failed?Y.failed?1:-1:Y.title_details.title.localeCompare(_e.title_details.title))}function B(q,Y){localStorage.setItem(q,Y)}function O(q){const Y=n().findIndex(_e=>_e.key===q);n(n()[Y].manual=!0,!0),n(n()[Y].removed=!0,!0),n([...n()])}function z(q){if(!u(v))return;const Y=q.offsetTop,_e=Y+q.offsetHeight,ve=u(v).scrollTop,Se=ve+u(v).clientHeight;Y>=ve&&_e<=Se||u(v).scrollTo({top:Y-u(v).clientHeight/2,behavior:"smooth"})}function F(q){const Y=q.target;C(y,X(Y.scrollTop))}function V(){const q={total:n().length,failed_automatic:n().filter(Y=>Y.failed&&!Y.manual).length,failed_manual:n().filter(Y=>Y.failed&&Y.manual).length,final_injected:u(M).length};pe(he.TotalInjectionsCount,null,q)}var W=bu();bo(q=>{var Y=uu();k(q,Y)});var J=x(W);{var ee=q=>{var Y=du(),_e=x(Y),ve=x(_e);Tc(ve,{get element(){return u(v)},height:f,onchange:Ge=>B(s,JSON.stringify(Ge))});var Se=E(_e,2),Ne=x(Se);Sc(Ne,{get element(){return u(v)},position:d,limit:{x:16,y:16},onchange:Ge=>B(c,JSON.stringify(Ge))}),k(q,Y)};H(J,q=>{u(v)&&!r()&&q(ee)})}var re=E(J,2),de=x(re);Qt(de,q=>xe==null?void 0:xe(q));var Ae=E(de,2);{var Q=q=>{var Y=fu();k(q,Y)},te=q=>{var Y=Fe(),_e=ne(Y);{var ve=Se=>{var Ne=vu(),Ge=ne(Ne),Oe=x(Ge),tn=E(Ge,2);ci(tn,{onclick:()=>C(m,!0),size:"24px","aria-label":"Add manual injection",children:(nn,mi)=>{var rn=Be("+");k(nn,rn)},$$slots:{default:!0}}),N(()=>{ue(Ge,"aria-label",`${u(M).length??""} found playlinks`),G(Oe,u(M).length)}),k(Se,Ne)};H(_e,Se=>{u(T)&&Se(ve)},!0)}k(q,Y)};H(Ae,q=>{r()?q(Q):q(te,!1)})}var le=E(re,2);{var Ce=q=>{var Y=wu(),_e=ne(Y);Qc(_e,{get pageText(){return i()},onallow:()=>C(p,!0),ondisallow:()=>C(p,!1),get ontakeover(){return l()},onpoll:Oe=>{a(Oe.injectionsEnabled),o({...o(),aiEnabled:Oe.aiEnabled})}});var ve=E(_e,2);{var Se=Oe=>{su(Oe,Zo(o,{get aiInjectionsCount(){return Gr(n()).aiInjections.length}}))};H(ve,Oe=>{u(p)&&(u(D)||!u(S))&&Oe(Se)})}var Ne=E(ve,2);{var Ge=Oe=>{var tn=yu(),nn=ne(tn);{var mi=ge=>{var me=hu(),$e=x(me);ht($e,{type:"warning",children:(lt,sa)=>{var An=_u();k(lt,An)},$$slots:{default:!0}}),k(ge,me)};H(nn,ge=>{a()||ge(mi)})}var rn=E(nn,2);{var aa=ge=>{var me=gu(),$e=x(me);ht($e,{children:(lt,sa)=>{var An=Be("Something went wrong, check your links below.");k(lt,An)},$$slots:{default:!0}}),je(7,me,()=>Vt,()=>({duration:150})),k(ge,me)};H(rn,ge=>{u(_)&&ge(aa)})}var pi=E(rn,2);at(pi,21,()=>u(A),ge=>ge.key,(ge,me)=>{const $e=K(()=>n().findIndex(lt=>lt.key===u(me).key));bc(ge,{onremove:()=>O(u(me).key),onhighlight:z,get linkInjection(){return n()[u($e)]},set linkInjection(lt){n(n()[u($e)]=lt,!0)}})},ge=>{var me=mu();k(ge,me)});var oa=E(pi,2);{var la=ge=>{var me=pu();me.__click=[cu,g,_,n,i,w,b];var $e=x(me);N(()=>{me.disabled=u(g),G($e,u(g)?"Saving...":"Save links")}),je(1,me,()=>Ft,()=>({duration:100})),k(ge,me)};H(oa,ge=>{u(R)&&n().length&&u(p)&&ge(la)})}k(Oe,tn)};H(Ne,Oe=>{u(T)&&Oe(Ge)})}k(q,Y)};H(le,q=>{r()||q(Ce)})}var Qe=E(le,2);{var ot=q=>{var Y=ku(),_e=x(Y);Wc(_e,{get pageText(){return i()},onclose:()=>C(m,!1),onsave:ve=>n().push(ve)}),N(()=>xn(Y,"top",`${u(y)??""}px`)),je(3,Y,()=>En,()=>({x:Math.min(window.innerWidth,320),duration:200,opacity:1})),k(q,Y)};H(Qe,q=>{u(m)&&q(ot)})}$t(W,q=>C(v,q),()=>u(v)),N(()=>{se(W,"panel-open",u(m)),se(W,"loading",r())}),ce("scroll",W,F),k(e,W),oe()}fe(["click"]);var Su=Le('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57.48 62.96"><defs><style>.playpilot-logo{fill:url(#playpilot-linear-gradient);}</style><linearGradient id="playpilot-linear-gradient" x1="-90.03" y1="-40.23" x2="-34.8" y2="-101.48" gradientTransform="translate(74.02 108.65)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#de00b9"></stop><stop offset="0.99" stop-color="#ff557b"></stop></linearGradient></defs><path class="playpilot-logo" d="M57.48,31.48C57.48,22.17,20.85,2.19,9.2.18,7.42-.12,3.78-.37,1.36,2.25-4.32,8.39,9.62,21.5,9.62,31.48S-4.32,54.57,1.36,60.72c2.42,2.61,6.06,2.37,7.84,2.06C20.85,60.78,57.48,40.79,57.48,31.48Z"></path></svg>');function Eu(e){var t=Su();k(e,t)}var Tu=I('<div class="trigger svelte-qee95d"><button type="button" class="button svelte-qee95d" title="Show PlayPilot TPI editor"><!></button> <button type="button" class="button close svelte-qee95d" title="Close PlayPilot TPI"><!></button></div>');function Iu(e,t){var n=Tu(),i=x(n);i.__click=function(...l){var c;(c=t.onclick)==null||c.apply(this,l)};var r=x(i);Eu(r);var a=E(i,2);a.__click=function(...l){var c;(c=t.onclose)==null||c.apply(this,l)};var o=x(a);Br(o),k(e,n)}fe(["click"]);var Au=I('<div class="playpilot-link-injections svelte-13rmd3g" data-playpilot-link-injections=""><!> <!></div>');function Cu(e,t){ae(t,!0);let n=U(null),i=U(X([])),r=U(null),a=U(X(Rr())),o=U(!!li()),l=U(!1),c=U(!0),s=U(!0),d=U(X([]));const f=K(()=>u(r)||{}),v=K(()=>sn(u(f).ai_injections,()=>[],!0)),m=K(()=>sn(u(f).manual_injections,()=>[],!0)),g=K(()=>Kr(u(i)));pn(()=>{u(a)&&!u(c)&&p()}),Ze(()=>{if(!Ls())return(async()=>(await _(),pe(he.ArticlePageView)))(),()=>vi()});async function _(){C(c,!0),u(a)&&C(l,X(await Dr()));try{const P=await Ms(),B=ai();if(C(s,!!(P!=null&&P.exclude_urls_pattern&&B.match(new RegExp(P.exclude_urls_pattern)))),u(s))return;P!=null&&P.custom_style&&b(P.custom_style||""),S((P==null?void 0:P.html_selector)||"",(P==null?void 0:P.exclude_elements_selector)||"")}catch(P){pe(he.FetchingConfigFailed),console.error("TPI Config failed to fetch",P);return}try{if(C(r,X(await Hi(u(g),{maxTries:1,runAiWhenRelevant:!0}))),C(c,!1),!u(r))return;if(el({organizationSid:u(r).organization_sid,domainSid:u(r).domain_sid}),!u(r).ai_running||!u(r).ai_enabled){w({aiInjections:u(v),manualInjections:u(m)});return}if(!u(a))return;C(r,X(await Hi(u(g),{requireCompletedResult:!0,onpoll:P=>C(r,X(P))}))),w({aiInjections:u(v),manualInjections:u(m)})}catch(P){console.error(P),pe(he.InjectionError,null,{message:P.message})}}function p(){w(Gr(u(d)))}function y(){C(a,!1),requestAnimationFrame(()=>{C(a,!0),_()})}function w(P={aiInjections:u(v),manualInjections:u(m)}){const B=hs(u(i),P);JSON.stringify(B)!==JSON.stringify(u(d))&&C(d,X(B));const O=B.filter(z=>!z.failed);O.length&&(u(a)||pe(he.ArticleInjected,null,{manual:O.filter(z=>z.manual).length,ai:O.filter(z=>!z.manual).length}))}function S(P,B){P&&(window.PlayPilotLinkInjections.selector=P),C(n,X(St())),C(i,X(fi(u(n),B)))}function j(){C(a,!0),il(),_()}function b(P){const B="playpilot-custom-style",O=document.getElementById(B),z=O||document.createElement("style");z.textContent=`[data-playpilot-link-injections] { ${P} }`,z.id=B,O||document.body.appendChild(z)}var T=Au(),R=x(T);{var M=P=>{Iu(P,{onclick:j,onclose:()=>{C(o,!1),nl()}})};H(R,P=>{!u(s)&&u(o)&&!u(a)&&P(M)})}var A=E(R,2);{var D=P=>{var B=Fe(),O=ne(B);Go(O,{onerror:F=>pe(he.EditorError,null,{message:F.message}),failed:F=>{ht(F,{fixed:!0,children:(V,W)=>{var J=Be("An error has occured in the PlayPilot Linkinjections editor view. We've been notified and will investigate!");k(V,J)},$$slots:{default:!0}})}},F=>{var V=K(()=>{var J;return(J=u(r))==null?void 0:J.injections_enabled}),W=K(()=>{var J,ee,re,de,Ae;return{aiEnabled:(J=u(r))==null?void 0:J.ai_enabled,aiRunning:((ee=u(r))==null?void 0:ee.ai_running)&&((re=u(r))==null?void 0:re.ai_enabled),message:(de=u(r))==null?void 0:de.ai_progress_message,percentage:(Ae=u(r))==null?void 0:Ae.ai_progress_percentage}});xu(F,{get pageText(){return u(g)},get loading(){return u(c)},onreinitialize:y,get injectionsEnabled(){return u(V)},get aiStatus(){return u(W)},get linkInjections(){return u(d)},set linkInjections(J){C(d,X(J))}})}),k(P,B)};H(A,P=>{!u(s)&&u(a)&&u(l)&&P(D)})}k(e,T),oe()}window.PlayPilotLinkInjections={token:"",editorial_token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,last_successful_fetch:null,tracked_events:[],app:null,initialize(e={token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,organization_sid:null,domain_sid:null,editorial_token:""}){if(!e.token){console.error("An API token is required.");return}this.token=e.token,this.editorial_token=e.editorial_token,this.selector=e.selector,this.after_article_selector=e.after_article_selector,this.after_article_insert_position=e.after_article_insert_position,this.language=e.language,this.organization_sid=e.organization_sid,this.domain_sid=e.domain_sid,this.app&&this.destroy();const t=document.createElement("div");t.id="playpilot-link-injection",document.body.insertAdjacentElement("beforeend",t),this.app=Jt(Cu,{target:t})},destroy(){if(!this.app)return;this.app=null;const e=document.getElementById("playpilot-link-injection");e&&e.remove(),vi()},debug(){const e=St(),t=fi(e);console.group("PlayPilot Link Injection Debug"),console.groupCollapsed("Config"),console.table(Object.entries(this)),console.groupEnd(),console.groupCollapsed("Elements"),console.log("Parent element",e),console.log("Valid elements",t),console.groupEnd(),console.groupCollapsed("Last fetch"),console.log(this.last_successful_fetch),console.groupEnd(),console.groupCollapsed("Meta"),console.log(_i()),console.groupEnd(),console.groupCollapsed("Page text"),console.log(Kr(t)),console.groupEnd(),console.groupCollapsed("Tracked events"),console.log(this.tracked_events),console.groupEnd(),console.groupEnd()}};
|
|
13
13
|
|
|
14
14
|
})();
|
package/package.json
CHANGED
package/src/lib/array.ts
CHANGED
|
@@ -11,3 +11,14 @@ export function getLargestValueInArray(array: number[]): number {
|
|
|
11
11
|
|
|
12
12
|
return largest
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the number of previous occurances in an array of objects based on a set of matching keys.
|
|
17
|
+
* For instance, in an array [{ id: 1, key: value }, { id: 2, key: value }], you might only want
|
|
18
|
+
* to match on the "key" key, rather than on the full object. An array is passed as keys to match
|
|
19
|
+
* on multiple keys.
|
|
20
|
+
*/
|
|
21
|
+
export function getNumberOfOccurrencesInArray<T>(array: T[], item: T, keys: string[]): number {
|
|
22
|
+
// @ts-ignore The key here used is a bit ambiguous
|
|
23
|
+
return array.filter(i => keys.every(key => i[key] === item[key])).length
|
|
24
|
+
}
|
package/src/lib/linkInjection.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { mount, unmount } from 'svelte'
|
|
|
2
2
|
import TitleModal from '../routes/components/TitleModal.svelte'
|
|
3
3
|
import TitlePopover from '../routes/components/TitlePopover.svelte'
|
|
4
4
|
import AfterArticlePlaylinks from '../routes/components/AfterArticlePlaylinks.svelte'
|
|
5
|
-
import { cleanPhrase, findNumberOfMatchesInString, findShortestMatchBetweenPhrases, findTextNodeContaining, getNumberOfLeadingAndTrailingSpaces, isNodeInLink, replaceBetween, replaceStartingFrom } from './text'
|
|
5
|
+
import { cleanPhrase, findNumberOfMatchesInString, findShortestMatchBetweenPhrases, findTextNodeContaining, getIndexOfPhraseWithSentenceBoundary, getNumberOfLeadingAndTrailingSpaces, isNodeInLink, replaceBetween, replaceStartingFrom } from './text'
|
|
6
6
|
import type { LinkInjection, LinkInjectionTypes } from './types/injection'
|
|
7
7
|
import { isHoldingSpecialKey } from './event'
|
|
8
8
|
import { playFallbackViewTransition } from './viewTransition'
|
|
9
9
|
import { prefersReducedMotion } from 'svelte/motion'
|
|
10
|
+
import { getNumberOfOccurrencesInArray } from './array'
|
|
10
11
|
|
|
11
12
|
const keyDataAttribute = 'data-playpilot-injection-key'
|
|
12
13
|
const keySelector = `[${keyDataAttribute}]`
|
|
@@ -128,7 +129,12 @@ export function injectLinksInDocument(elements: HTMLElement[], injections: LinkI
|
|
|
128
129
|
|
|
129
130
|
const failedMessages: Record<string, string> = {}
|
|
130
131
|
|
|
132
|
+
// Start at -1 so that we can add +1 right at the top of the loop, making it start at 0.
|
|
133
|
+
// This index is used in Option 3 below.
|
|
134
|
+
let injectionIndex = -1
|
|
131
135
|
for (const injection of foundInjections) {
|
|
136
|
+
injectionIndex++
|
|
137
|
+
|
|
132
138
|
const elementIndex = elements.findIndex(element => cleanPhrase(element.innerText).includes(cleanPhrase(injection.sentence)))
|
|
133
139
|
const element = elements[elementIndex]
|
|
134
140
|
|
|
@@ -159,7 +165,7 @@ export function injectLinksInDocument(elements: HTMLElement[], injections: LinkI
|
|
|
159
165
|
if (numberOfMatches === 1) replacementIndex = element.innerHTML.indexOf(injection.title)
|
|
160
166
|
|
|
161
167
|
// !! Option 2 - Replace by phrase_before and phrase_after
|
|
162
|
-
// If multiple or no
|
|
168
|
+
// If multiple or no occurences were found, we use phrase_before and phrase_after to refine the search
|
|
163
169
|
if (replacementIndex === -1 && (phrase_before || phrase_after)) {
|
|
164
170
|
// The before and after phrase are combined to see if the sentence contains the match exactly.
|
|
165
171
|
// This is a fairly simple comparison that will fail on special characters, html tags, or inconsistencies
|
|
@@ -189,15 +195,23 @@ export function injectLinksInDocument(elements: HTMLElement[], injections: LinkI
|
|
|
189
195
|
}
|
|
190
196
|
|
|
191
197
|
// !! Option 3 - Replace by title only, taking previous injections into account
|
|
192
|
-
// If no
|
|
198
|
+
// If no occurences were found previously, we check the element from start to finish only checking for the title,
|
|
193
199
|
// without considering phrase_before and phrase_after
|
|
194
200
|
if (replacementIndex === -1 && nodeContainingText?.nodeValue) {
|
|
195
|
-
// Start searching for injection from either the value or the
|
|
201
|
+
// Start searching for injection from either the value, the sentence, or the occurrence. This prevents injecting into
|
|
196
202
|
// text in an element earlier than the sentence started. A element might contain many sentences, after all.
|
|
197
203
|
const valueIndex = element.innerHTML.indexOf(nodeContainingText.nodeValue)
|
|
198
204
|
const sentenceIndex = element.innerHTML.indexOf(injection.sentence)
|
|
199
205
|
|
|
200
|
-
|
|
206
|
+
// Starting from occurence happens when a sentence might include multiple occurences of the same phrase.
|
|
207
|
+
// We might still prefer the valueIndex if that is higher than this value.
|
|
208
|
+
|
|
209
|
+
// A sentence might include multiple matches for the same phrase. We get the number of previous occurences in order to get the index
|
|
210
|
+
// of the match we actually want to get.
|
|
211
|
+
const indexOfOccurrence = getNumberOfOccurrencesInArray<LinkInjection>(foundInjections.slice(0, injectionIndex + 1), injection, ['title', 'sentence']) - 1
|
|
212
|
+
const indexInSentence = getIndexOfPhraseWithSentenceBoundary(nodeContainingText.nodeValue, element.innerHTML, indexOfOccurrence)
|
|
213
|
+
|
|
214
|
+
replacementIndex = Math.max(valueIndex, indexInSentence, sentenceIndex, 0)
|
|
201
215
|
}
|
|
202
216
|
|
|
203
217
|
if (replacementIndex === -1) continue
|
package/src/lib/text.ts
CHANGED
|
@@ -131,7 +131,7 @@ export function findNumberOfMatchesInString(text: string, phrase: string): numbe
|
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* Finds all matches between two phrases. For example "A sentence with a start and end phrase". Is "start" and "end" are given
|
|
134
|
-
* as the `start` and `end` properties, this will match on ` and `. This does not currently account for multiple
|
|
134
|
+
* as the `start` and `end` properties, this will match on ` and `. This does not currently account for multiple occurrences
|
|
135
135
|
* of the end phrase. For example "A sentence with a start and end phrase and another end" will only return 1 value, despite
|
|
136
136
|
* there being 2 end phrases with content between. While that might make sense, we don't currently need that as we always
|
|
137
137
|
* filter by the shortest length anyway.
|
|
@@ -178,3 +178,29 @@ export function getNumberOfLeadingAndTrailingSpaces(text: string): { leadingSpac
|
|
|
178
178
|
trailingSpaces: text.match(/\s*$/)?.[0].length || 0
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Get the index of a phrase inside of text based on a specific word boundary. Returns either the first match
|
|
184
|
+
* or the index of the given occurrence.
|
|
185
|
+
*/
|
|
186
|
+
export function getIndexOfPhraseWithSentenceBoundary(phrase: string, sentence: string, occurrence = 0): number {
|
|
187
|
+
const disallowedBoundaryCharacters = ['-', '_', '/']
|
|
188
|
+
const matches = []
|
|
189
|
+
|
|
190
|
+
let index = sentence.indexOf(phrase)
|
|
191
|
+
while (index !== -1) {
|
|
192
|
+
const leadingCharacter = sentence[index - 1]
|
|
193
|
+
const disallowedLeadingCharacter = disallowedBoundaryCharacters.includes(leadingCharacter)
|
|
194
|
+
|
|
195
|
+
const trailingCharacter = sentence[index + phrase.length]
|
|
196
|
+
const disallowedTrailingCharacter = disallowedBoundaryCharacters.includes(trailingCharacter)
|
|
197
|
+
|
|
198
|
+
if (!disallowedLeadingCharacter && !disallowedTrailingCharacter) {
|
|
199
|
+
matches.push(index)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
index = sentence.indexOf(phrase, index + 1)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return matches[occurrence] ?? -1
|
|
206
|
+
}
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
<h2>A matching link is already present</h2>
|
|
50
50
|
<p>Following their post-credits scene in <a href="/">John Wick</a>, in a new John Wick spinoff.</p>
|
|
51
51
|
|
|
52
|
+
<h2>Repeat injections <small>(Exact example from DigitalSpy)</small></h2>
|
|
53
|
+
<p>Season 2 is set to star <em>Taskmaster</em> season 2 runner-up Romesh Ranganathan, season 4's Mel Giedroyc, season 16 winner Sam Campbell, and future <em>Taskmaster</em> season 20 star Maisie Adam.</p>
|
|
54
|
+
|
|
52
55
|
<h2>Mixed and breaking elements <small>(DigitalSpy.com tends to do this)</small></h2>
|
|
53
56
|
<p>The following bold word is broken by <strong>multi</strong><strong>ple</strong> elements, but visually looks like one. An element might also only be par<em>tially</em> styled. Or a full title like "The Lord of the Rings: <em>The Two Towers</em>" might only have part styled.</p>
|
|
54
57
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { getLargestValueInArray } from '$lib/array'
|
|
2
|
+
import { getLargestValueInArray, getNumberOfOccurrencesInArray } from '$lib/array'
|
|
3
3
|
|
|
4
4
|
describe('array.js', () => {
|
|
5
5
|
describe('getLargestValueInArray', () => {
|
|
@@ -11,4 +11,54 @@ describe('array.js', () => {
|
|
|
11
11
|
expect(getLargestValueInArray([])).toBe(0)
|
|
12
12
|
})
|
|
13
13
|
})
|
|
14
|
+
|
|
15
|
+
describe('getNumberOfOccurrencesInArray', () => {
|
|
16
|
+
it('Should return 0 if array is empty', () => {
|
|
17
|
+
const item = { id: 1, key: 'value' }
|
|
18
|
+
|
|
19
|
+
expect(getNumberOfOccurrencesInArray([], item, ['key'])).toBe(0)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('Should counts occurrences based on a single key', () => {
|
|
23
|
+
const array = [
|
|
24
|
+
{ id: 1, key: 'value' },
|
|
25
|
+
{ id: 2, key: 'value' },
|
|
26
|
+
{ id: 3, key: 'other' },
|
|
27
|
+
]
|
|
28
|
+
const item = { id: 0, key: 'value' }
|
|
29
|
+
|
|
30
|
+
expect(getNumberOfOccurrencesInArray(array, item, ['key'])).toBe(2)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('Should count occurrences based on multiple keys', () => {
|
|
34
|
+
const array = [
|
|
35
|
+
{ id: 1, key: 'value', thing: 'A' },
|
|
36
|
+
{ id: 2, key: 'value', thing: 'B' },
|
|
37
|
+
{ id: 3, key: 'value', thing: 'A' },
|
|
38
|
+
]
|
|
39
|
+
const item = { id: 0, key: 'value', thing: 'A' }
|
|
40
|
+
|
|
41
|
+
expect(getNumberOfOccurrencesInArray(array, item, ['key', 'thing'])).toBe(2)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('Should return 0 if no items match on given keys', () => {
|
|
45
|
+
const array = [
|
|
46
|
+
{ id: 1, key: 'value', thing: 'A' },
|
|
47
|
+
{ id: 2, key: 'value', thing: 'B' },
|
|
48
|
+
]
|
|
49
|
+
const item = { id: 0, key: 'value', thing: 'C' }
|
|
50
|
+
|
|
51
|
+
expect(getNumberOfOccurrencesInArray(array, item, ['key', 'thing'])).toBe(0)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('Should ignore keys not listed in the keys array', () => {
|
|
55
|
+
const array = [
|
|
56
|
+
{ id: 1, key: 'value', thing: 'A' },
|
|
57
|
+
{ id: 1, key: 'value', thing: 'B' },
|
|
58
|
+
]
|
|
59
|
+
const item = { id: 1, key: 'value', thing: 'C' }
|
|
60
|
+
|
|
61
|
+
expect(getNumberOfOccurrencesInArray(array, item, ['id', 'key'])).toBe(2)
|
|
62
|
+
})
|
|
63
|
+
})
|
|
14
64
|
})
|
|
@@ -505,6 +505,24 @@ describe('linkInjection.js', () => {
|
|
|
505
505
|
expect(links[1].dataset.playpilotInjectionKey).toBe(linkInjections[1].key)
|
|
506
506
|
})
|
|
507
507
|
|
|
508
|
+
it('Should inject links of the same phrase when multiple are present, but ignore injectios into links that contain the same phrase', () => {
|
|
509
|
+
document.body.innerHTML = '<p>First phrase, <a href="/phrase">second</a> phrase</p>'
|
|
510
|
+
|
|
511
|
+
const elements = Array.from(document.querySelectorAll('p'))
|
|
512
|
+
|
|
513
|
+
const sentence = 'First phrase, second phrase'
|
|
514
|
+
const linkInjections = [
|
|
515
|
+
generateInjection(sentence, 'phrase'),
|
|
516
|
+
generateInjection(sentence, 'phrase'),
|
|
517
|
+
]
|
|
518
|
+
|
|
519
|
+
injectLinksInDocument(elements, { aiInjections: linkInjections, manualInjections: [] })
|
|
520
|
+
|
|
521
|
+
const links = /** @type {HTMLAnchorElement[]} */ (Array.from(document.querySelectorAll('a')))
|
|
522
|
+
|
|
523
|
+
expect(links).toHaveLength(3)
|
|
524
|
+
})
|
|
525
|
+
|
|
508
526
|
it('Should not inject injections with in_text set to false', () => {
|
|
509
527
|
document.body.innerHTML = '<p>This is a sentence with an injection.</p>'
|
|
510
528
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from 'vitest'
|
|
2
|
-
import { cleanPhrase, findAllMatchesBetweenPhrases, findShortestMatchBetweenPhrases, findSurroundingPhrases, findTextNodeContaining, getFirstNumberOfWordsInString, getNumberOfLeadingAndTrailingSpaces, isNodeInLink, replaceStartingFrom, reverseString, truncateAroundPhrase } from '$lib/text'
|
|
2
|
+
import { cleanPhrase, findAllMatchesBetweenPhrases, findShortestMatchBetweenPhrases, findSurroundingPhrases, findTextNodeContaining, getFirstNumberOfWordsInString, getIndexOfPhraseWithSentenceBoundary, getNumberOfLeadingAndTrailingSpaces, isNodeInLink, replaceStartingFrom, reverseString, truncateAroundPhrase } from '$lib/text'
|
|
3
3
|
|
|
4
4
|
describe('text.js', () => {
|
|
5
5
|
beforeEach(() => {
|
|
@@ -346,4 +346,49 @@ describe('text.js', () => {
|
|
|
346
346
|
expect(reverseString('')).toBe('')
|
|
347
347
|
})
|
|
348
348
|
})
|
|
349
|
+
|
|
350
|
+
describe('getIndexOfPhraseWithSentenceBoundary', () => {
|
|
351
|
+
it('Should return index of a single phrase occurrence', () => {
|
|
352
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'Some phrase in a sentence')).toBe(5)
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
it('Should return -1 if phrase is not found', () => {
|
|
356
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'Some sentence without a match')).toBe(-1)
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
it('Should return the index of the given occurrence', () => {
|
|
360
|
+
const sentence = 'Some phrase, another phrase, and one more phrase'
|
|
361
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', sentence, 0)).toBe(5)
|
|
362
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', sentence, 1)).toBe(21)
|
|
363
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', sentence, 2)).toBe(42)
|
|
364
|
+
})
|
|
365
|
+
|
|
366
|
+
it('Should not match when phrase is preceded by a disallowed boundary character', () => {
|
|
367
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'pre-phrase test')).toBe(-1)
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
it('Should not match when phrase is followed by a disallowed boundary character', () => {
|
|
371
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'This is phrase_test')).toBe(-1)
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
it('Should match when phrase is at the start of the sentence', () => {
|
|
375
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'phrase at the start')).toBe(0)
|
|
376
|
+
})
|
|
377
|
+
|
|
378
|
+
it('Should match when phrase is at the end of the sentence', () => {
|
|
379
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'This is a phrase')).toBe(10)
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
it('Should match when phrase is surrounded by spaces', () => {
|
|
383
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'A phrase inside')).toBe(2)
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
it('Should handle multiple disallowed boundary characters correctly', () => {
|
|
387
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'phrase/phrase_phrase-phrase phrase')).toBe(28)
|
|
388
|
+
})
|
|
389
|
+
|
|
390
|
+
it('Should return -1 when occurrence index is out of range', () => {
|
|
391
|
+
expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'phrase phrase phrase', 5)).toBe(-1)
|
|
392
|
+
})
|
|
393
|
+
})
|
|
349
394
|
})
|