@playpilot/tpi 5.3.1 → 5.3.2

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.
@@ -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 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&gt)&&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&gt&&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&gt)!==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&gt)!==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});
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 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,je=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,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 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&je&&!(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&(je|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(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&ba();var f=r.get(c);return f===void 0?(f=Ee(d.value),r.set(c,f)):P(f,X(d.value,l)),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&r.set(c,Ee(ke));else{if(a&&typeof c=="string"){var f=r.get("length"),v=Number(c);Number.isInteger(v)&&v<f.v&&P(f,v)}P(d,ke),ki(o)}return!0},get(s,c,d){var g;if(c===ze)return e;var f=r.get(c),v=c in s;if(f===void 0&&(!v||(g=nt(s,c))!=null&&g.writable)&&(f=Ee(X(v?s[c]:ke,l)),r.set(c,f)),f!==void 0){var m=u(f);return m===ke?void 0:m}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var f=r.get(c);f&&(d.value=u(f))}else if(d===void 0){var v=r.get(c),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(s,c){var m;if(c===ze)return!0;var d=r.get(c),f=d!==void 0&&d.v!==ke||Reflect.has(s,c);if(d!==void 0||Z!==null&&(!f||(m=nt(s,c))!=null&&m.writable)){d===void 0&&(d=Ee(f?X(s[c],l):ke),r.set(c,d));var v=u(d);if(v===ke)return!1}return f},set(s,c,d,f){var S;var v=r.get(c),m=c in s;if(a&&c==="length")for(var g=d;g<v.v;g+=1){var _=r.get(g+"");_!==void 0?P(_,ke):g in s&&(_=Ee(ke),r.set(g+"",_))}v===void 0?(!m||(S=nt(s,c))!=null&&S.writable)&&(v=Ee(void 0),P(v,X(d,l)),r.set(c,v)):(m=v.v!==ke,P(v,X(d,l)));var p=Reflect.getOwnPropertyDescriptor(s,c);if(p!=null&&p.set&&p.set.call(f,d),!m){if(a&&typeof c=="string"){var y=r.get("length"),w=Number(c);Number.isInteger(w)&&w>=y.v&&P(y,w+1)}ki(o)}return!0},ownKeys(s){u(o);var c=Reflect.ownKeys(s).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 s)&&c.push(d);return c},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 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;Te(Wa(e));try{ir(e),t=mr(e)}finally{Te(n)}return t}function ar(e){var t=rr(e),n=(tt||e.f&gt)&&e.deps!==null?gn:je;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&gt&&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 s=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&Yi)===0;if(!s&&!r&&i&&(a!==null&&Ya(o,a),$!==null&&$.f&He)){var c=$;(c.children??(c.children=[])).push(o)}return o}function Za(){return $===null?!1:!tt}function Ga(e){const t=At(Kt,null,!1);return Ye(t,je),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 s of o)s.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 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 Te(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 c;var t=e.f;if(t&rt)return!0;if(t&gn){var n=e.deps,i=(t&gt)!==0;if(n!==null){var r,a,o=(t&un)!==0,l=i&&Z!==null&&!tt,s=n.length;if(o||l){for(r=0;r<s;r++)a=n[r],(o||!((c=a==null?void 0:a.reactions)!=null&&c.includes(e)))&&(a.reactions??(a.reactions=[])).push(e);o&&(e.f^=un)}for(r=0;r<s;r++)if(a=n[r],Gt(a)&&ar(a),a.wv>e.wv)return!0}(!i||Z!==null&&!tt)&&Ye(e,je)}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,s=e.f;ye=null,Pe=0,it=null,$=s&(Ve|Yt)?null:e,tt=!kt&&(s&gt)!==0,We=null,ie=e.ctx,Hn++;try{var c=(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 c}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,je);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&je||(r.f^=je);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&je))return;t.f^=je}}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&je)!==0,l=n.next;if(!o&&!(r&Ue))if(r&Kt){if(a)n.f^=je;else try{Gt(n)&&wn(n)}catch(f){Xt(f,n,null,n.ctx)}var s=n.first;if(s!==null){n=s;continue}}else r&zi&&i.push(n);if(l===null){let f=n.parent;for(;f!==null;){if(e===f)break e;var c=f.next;if(c!==null){n=c;continue e}f=f.parent}}n=l}for(var d=0;d<i.length;d++)s=i[d],t.push(s),wr(s,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&je&&!(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 s=o;l=s,o=s.parent}else{var c=o;(d=c.deriveds)!=null&&d.includes(l)||(c.deriveds??(c.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];Te(a.effect),qe(a.reaction),pt(a.fn)}}finally{Te(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),Te(null);try{return e()}finally{qe(t),Te(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,l=e.__root;if(l){var s=r.indexOf(l);if(s!==-1&&(t===document||t===window)){e.__root=t;return}var c=r.indexOf(t);if(c===-1)return;s<=c&&(o=s)}if(a=r[o]||e.target,a!==t){ua(e,"currentTarget",{configurable:!0,get(){return a||n}});var d=$,f=Z;qe(null),Te(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),Te(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),s=o.lastChild;_t(l,s)}else _t(o,o);return o}}function Me(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 s=a.cloneNode(!0);return _t(s,s),s}}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,s=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)}}};s(Zn(Tr)),Vn.add(s);var c=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,c=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(s),f!==n&&((g=f.parentNode)==null||g.removeChild(f))}});return Un.set(c,d),c}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,s=!1;const c=(f,v=!0)=>{s=!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(()=>{s=!1,t(c),s||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 s=n.parentNode;Ua(s),s.append(n),i.clear(),et(e,t[0].prev,t[a-1].next)}ur(r,()=>{for(var c=0;c<a;c++){var d=t[c];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},s=(t&Xi)!==0;if(s){var c=e;o=c.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 s=(r&Aa)!==0,c=(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(s)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(c&&To(b,S,T,r),b.e.f&Ue&&(Rt(b.e),s&&((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],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,D.prev,C.next),et(t,_,D),et(t,C,M),m=M,_=C,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(s){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)}}s&&Pt(()=>{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,s,c){var d=(s&Qn)!==0,f=(s&Pa)===0,v=d?f?Qi(r):Ee(r):r,m=s&$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 s=o+"",c=ri(s);_t(ft(c),c.lastChild),a.before(c)})))})}function Ct(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 Po(e,t,n,i,r,a){var o,l,s=null,c=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(()=>{s=v?document.createElementNS(v,f):document.createElement(f),_t(s,s);{var m=s.appendChild(It());i(s,m)}Z.nodes_end=s,c.before(s)})),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 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 l=t||{},s=e.tagName==="OPTION";for(var c in t)c in n||(n[c]=null);n.class&&(n.class=jo(n.class)),n.class=n.class?n.class+" "+i:i;var d=Pr(e),f=e.__attributes??(e.__attributes={});for(const w in n){let S=n[w];if(s&&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"&&s)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 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=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 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 Ce(e,t,n,i){var r=(e&Oa)!==0,a=(e&Da)!==0,o=r&&a,l=(e&Ra)!==0,s=o?"both":r?"in":"out",c,d=t.inert,f,v;function m(){var w=$,S=Z;qe(null),Te(null);try{return c??(c=n()(t,(i==null?void 0:i())??{},{direction:s}))}finally{qe(w),Te(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=c=void 0})},out(w){if(!a){w==null||w(),c=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 Pt(()=>{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:s=0,css:c,tick:d,easing:f=Ho}=t;var v=[];if(a&&n===void 0&&(d&&d(0,1),c)){var m=Ci(c(0,1));v.push(m,m)}var g=()=>1-i,_=e.animate(v,{duration:s});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(c)for(var j=Math.ceil(w/16.666666666666668),b=0;b<=j;b+=1){var T=p+y*f(b/j),R=c(T,1-T);S.push(Ci(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))})}),()=>{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 Te(t),e()}finally{Te(n)}}function L(e,t,n,i){var R;var r=(n&Ca)!==0,a=!Tt||(n&ja)!==0,o=(n&La)!==0,l=(n&Na)!==0,s=!1,c;o?[c,s]=zo(()=>e[t]):c=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);c===void 0&&i!==void 0&&(f&&a&&ka(),c=_(),f&&f(c));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||s)&&f(A?p():M),M):p()}}var S=!1,j=!1,b=Qi(c),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,P(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;Te(e),qe(e),Ei(e.ctx);try{t()}finally{Te(n),qe(i),Ei(r)}}function Go(e,t,n){var i=e,r;Je(()=>{var a=Z,o=!1;a.fn=l=>{var s=t.onerror;let c=t.failed;if(!s&&!c||o)throw l;var d=()=>{vt(r),Li(a,()=>{o=!1,r=De(()=>n(i)),Mn()})};s==null||s(l,d),r&&Re(r),Pt(()=>{Li(a,()=>{o=!0;try{r=De(()=>{c(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),s=+l.opacity,c=l.transform==="none"?"":l.transform,d=s*(1-o),[f,v]=Ni(r),[m,g]=Ni(a);return{delay:t,duration:n,easing:i,css:(_,p)=>`
4
+ transform: ${c} translate(${(1-_)*f}${v}, ${(1-_)*m}${g});
5
+ opacity: ${s-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",s=parseFloat(a[l]),c=r==="y"?["top","bottom"]:["left","right"],d=c.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*s}px;padding-${c[0]}: ${y*f}px;padding-${c[1]}: ${y*v}px;margin-${c[0]}: ${y*m}px;margin-${c[1]}: ${y*g}px;border-${c[0]}-width: ${y*_}px;border-${c[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,s=o.transform==="none"?"":o.transform,c=1-r,d=l*(1-a);return{delay:t,duration:n,easing:i,css:(f,v)=>`
6
+ transform: ${s} scale(${1-c*v});
7
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(`
8
+ `}}Ia();var cl=Me('<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,(l,s)=>{let c;N(()=>{c=Lo(l,c,{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);Ct(f,()=>t.children??st),k(s,d)}),k(e,a),oe()}function ul(e){P(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){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=x(a),l=x(o),s=x(l);ci(s,{onclick:()=>n()(),children:(f,v)=>{Br(f)},$$slots:{default:!0}});var c=E(l,2);Ct(c,()=>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)}),Ce(7,o,()=>r),Ce(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(()=>u(n)?t.genres:[t.genres[0]]);var r=kl(),a=ne(r);at(a,17,()=>u(i),xt,(s,c)=>{var d=Fe();const f=K(()=>{var g;return(g=ml.find(_=>_.slug===u(c)))==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(s,d)});var o=E(a,2);{var l=s=>{var c=wl();c.__click=[yl,n];var d=x(c);N(()=>G(d,`+${t.genres.length-1}`)),k(s,c)};H(o,s=>{!u(n)&&t.genres.length>1&&s(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=Me('<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(_=>!!_.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 s=Cl(),c=ne(s),d=x(c);N(()=>G(d,be("Where To Stream Online"))),Qt(c,(_,p)=>xe==null?void 0:xe(_,p),()=>3);var f=E(c,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),C=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(C,y())}),k(_,R)});var m=E(v,2);{var g=_=>{var p=Pl(),y=x(p);N(()=>G(y,be("Title Unavailable"))),k(_,p)};H(m,_=>{t.playlinks.length||_(g)})}N(()=>se(f,"list",n())),k(e,s),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>'),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),s=x(l),c=E(s);{var d=_=>{var p=Be("...");k(_,p)};H(c,_=>{!u(r)&&t.text.length>i()&&_(d)})}var f=E(c,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(s,u(r)?t.text:u(a))),k(e,o),oe()}fe(["click"]);var Rl=Me('<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(),s=ne(l),c=x(s),d=x(c);{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,()=>P(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(c,2),D=x(A);jl(D,{get playlinks(){return t.title.providers},get title(){return t.title},list:!0});var C=E(D,2);{var B=F=>{Dl(F,{get text(){return t.title.description},get blurb(){return t.title.blurb}})};H(C,F=>{n()||F(B)})}var O=E(s,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,()=>P(a,!0)),ce("error",V,()=>P(o,!0)),k(F,V)}),N(()=>{se(s,"small",n()),se(s,"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();P(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 s=Ul(),c=x(s),d=x(c);Ct(d,()=>t.children),$t(s,f=>P(i,f),()=>u(i)),N(()=>{se(s,"flip",u(r)),xn(s,"--max-height",n()?n()+"px":null)}),Ce(7,c,()=>En,()=>({duration:ui.current?0:100,y:10})),k(e,s),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 s=Array.from(l.getClientRects()),d=s.map(v=>v.x).map(v=>Math.abs(v-t.event.clientX)),f=s[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){P(n,X(l))},children:(l,s)=>{var c=K(()=>!!u(n)&&u(n)<250);Ur(l,{get title(){return t.title},small:!0,get compact(){return u(c)}})},$$slots:{default:!0}}),$t(a,l=>P(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(s,c){pe(he.AfterArticlePlaylinkClick,s,{playlink:c})}function r(s,c,d){pe(he.AfterArticleModalButtonClick,c),n()(s,d)}var a=Fe(),o=ne(a);{var l=s=>{var c=ns();at(c,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 C=x(D);C.__click=[Zl,r,m,f];var B=x(C);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,(C,B,O)=>{let z=()=>u(B).name,F=()=>u(B).url;var V=Jl(),W=ne(V);{var J=de=>{var Ie=Be();N(()=>G(Ie,O===u(g).length-1?`, ${be("And")}`:",")),k(de,Ie)};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(C,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(s,c)};H(o,s=>{t.linkInjections.length&&s(l)})}k(e,a),oe()}fe(["click"]);function rs(e,t,n){return e.filter(i=>n.every(r=>i[r]===t[r])).length}function as(e,t){return t.some(n=>e>=n.start&&e<n.end)}function os(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 ls(e,t,n,i){const r=os(t),a=di(t),o=e.slice(0,i),l=e.slice(i),s=/[-/\\^$*+?.()|[\]{}]/g,c=new RegExp(`${a.replace(s,"\\$&")}|${r.replace(s,"\\$&")}`),d=l.replace(c,n);return o+d}function ss(e,t,n,i){return e.substring(0,n)+t+e.substring(i)}function Oe(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 s=e.slice(o,l).trim();return o>0&&(s="…"+s),l<e.length&&(s+="…"),s}function cs(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)),s=qi(o,2);return{before:l,after:s}}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 us(e,t){let n=0,i=0;for(;(i=e.indexOf(t,i))!==-1;)n++,i+=t.length;return n}function ds(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 s=e.slice(o,l);i.push({match:s,index:o}),r=n?l+n.length:e.length+1}return i}function fs(e,t,n,i){const a=ds(e,n,i).filter(({match:l})=>di(l).includes(t));return a.length?a.reduce((l,s)=>!l||s.match.length<l.match.length?s:l):null}function vs(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 _s(e,t,n=0){const i=t.innerHTML,r=[],a=hs(t);let o=i.indexOf(e);for(;o!==-1;)as(o,a)&&r.push(o),o=i.indexOf(e,o+e.length);return r[n]??-1}function hs(e){const t=[],n=e.innerHTML;let i=!1,r=!1,a=!1,o=0;for(let l=0;l<n.length;l++){const s=n[l];if(!r&&!i&&s==="<"){i=!0,a&&(t.push({start:o,end:l}),a=!1);continue}if(i&&s==='"'&&(r=!r),i&&!r&&s===">"){i=!1;continue}!i&&!r&&!a&&(o=l,a=!0)}return!t.length&&e.textContent.length&&t.push({start:o,end:e.innerHTML.length}),t}function Wr(e){return e.ctrlKey||e.metaKey||e.button!==0}function gs(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,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(s=>{var c;return s.nodeType===Node.TEXT_NODE&&((c=s.nodeValue)==null?void 0:c.trim())!==""});if(a&&r.tagName==="LI"){const s=r.closest("ul, ol");s&&!n.includes(s)&&n.push(s);continue}const o=r.tagName==="P"&&!!r.textContent;if(a||o){n.push(r);continue}const l=Array.from(r.children);for(let s=l.length-1;s>=0;s--)i.push(l[s])}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 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()}};
10
+ `)}function ms(e,t={aiInjections:[],manualInjections:[]}){vi();const n=Es(t);if(!n)return[];const i=Oe(e.map(c=>c.innerText).join(" ")),r=Ts(n),a=r.filter(c=>i.includes(Oe(c.sentence))),o={};let l=-1;for(const c of a){l++;const d=e.findIndex(j=>Oe(j.innerText).includes(Oe(c.sentence))),f=e[d];if(!f)continue;const v=Oi(c.title,f,["A"]);if(!(v!=null&&v.nodeValue)||Di(v)){const j=Oi(c.title,f);if(j&&Di(j)){o[c.key]="Given text is already inside of a link.";continue}}const{injectionElement:m,linkElement:g}=ps(c),{phrase_before:_,phrase_after:p}=c;let y=-1,w=!1;if(us(f.innerHTML,c.title)===1&&(y=f.innerHTML.indexOf(c.title)),y===-1&&(_||p)){const j=[_,c.title,p].filter(Boolean).join(" ");if(y=f.innerHTML.indexOf(j),y===-1){const b=fs(f.innerHTML,c.title,_||"",p||"");if(b){const{leadingSpaces:T,trailingSpaces:R}=vs(b.match);g.innerHTML=b.match.trim();const M=b.index+T,A=b.index+b.match.length-R;f.innerHTML=ss(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(c.sentence),T=rs(a.slice(0,l+1),c,["title","sentence"])-1,R=_s(v.nodeValue,f,T);y=Math.max(j,R,b,0)}y!==-1&&(w||(f.innerHTML=ls(f.innerHTML,c.title,m.outerHTML,y)))}ws(r),ys();const s=Is(n);return s.length&&bs(e,s),n.filter(c=>c.title_details).map((c,d)=>{const f=c.duplicate??(!c.manual&&As(c,d,n)),v=document.querySelector(`[${ut}="${c.key}"]`),m=Tn(c)&&!c.inactive&&!c.after_article&&!v,g=!!e.find(p=>Oe(p.innerText).includes(Oe(c.sentence))),_=m?o[c.key]||(g?"The link failed to inject for unknown reasons.":"Given sentence was not found in the article."):"";return{...c,inactive:c.inactive??!1,duplicate:f,failed:m,failed_message:_}})}function ps(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 ys(){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 ws(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(),gs(()=>{_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||ks(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 ks(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 bs(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:(s,c)=>Yr(s,c)}})}function xs(){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=>Ss(t.getAttribute(ut)||"")),xs(),Zr(!1),_n(!1)}function Ss(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 Es({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 Ts(e){return Jr(e).filter(t=>t.in_text!==!1&&Xr(t))}function Is(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 As(e,t,n){return n.some((i,r)=>t!==r&&i.manual&&Qr(i,e))}function Qr(e,t){return e.title===t.title&&Oe(e.sentence)===Oe(t.sentence)}function $r(){return document.querySelector("[data-playpilot-link-injections]")||document.body}function _i(){const e=St();return{content_heading:Ps(e),content_modified_time:Cs(e),content_published_time:js(e)}}function Ps(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function Cs(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 js(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 s=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(!s.ok)throw s;const c=await s.json();return window.PlayPilotLinkInjections.last_successful_fetch=c,c}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(s,c)=>{let d;try{if(d=await en(e),n&&(d=await Ms(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||[]),s(d);return}catch{if(o++,o>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),s();return}d&&a(d),On=setTimeout(()=>l(s),i)}};return new Promise(l)}async function Ms(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 Ls(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 Ns(){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 Os(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}var Ds=Me('<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 Rs(e,t){const n=L(t,"expanded",3,!1);var i=Ds();N(()=>se(i,"expanded",n())),k(e,i)}var qs=Me('<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 Hs(e){var t=qs();k(e,t)}function Bs(e,t,n){t(!t()),n()(t())}var Fs=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=Fs();o.__click=[Bs,n,a];var l=x(o),s=x(l);Ct(s,()=>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 Vs=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=Vs();l.__input=function(...s){var c;(c=o())==null||c.apply(this,s)},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 Us=Me('<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>'),zs=Me('<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>'),Ws=Me('<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=Ws(),r=x(i);{var a=l=>{var s=Us();k(l,s)},o=l=>{var s=Fe(),c=ne(s);{var d=f=>{var v=zs();k(f,v)};H(c,f=>{n()==="center"&&f(d)},!0)}k(l,s)};H(r,l=>{n()==="bottom"?l(a):l(o,!1)})}k(e,i)}var Ks=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=Ks(),a=x(r);Ct(a,()=>t.children),N(()=>{No(r,`alert ${n()??""} svelte-df5n87`),se(r,"fixed",i())}),k(e,r),oe()}var Ys=I("<!> In-text Playlink",1),Zs=I("<!> Bottom Playlink",1),Gs=I('<div class="alert svelte-1shw34x"><!></div>'),Xs=(e,t)=>t().after_article_style="playlinks",Js=(e,t)=>t().after_article_style="modal_button",Qs=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>'),$s=I('<div class="switches svelte-1shw34x"><!> <!></div> <!> <!>',1);function ec(e,t){ae(t,!0);const n=L(t,"linkInjection",7),i=K(()=>n().after_article_style==="modal_button");var r=$s(),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=Ys(),y=ne(p);Fi(y,{align:"center"}),k(g,p)},$$slots:{default:!0}});var s=E(o,2),c=K(()=>n().after_article??!1);Wn(s,{fullwidth:!0,get active(){return u(c)},onclick:g=>{n().after_article=g,n().manual=!0},label:"Bottom Playlink",children:(g,_)=>{var p=Zs(),y=ne(p);Fi(y,{align:"bottom"}),k(g,p)},$$slots:{default:!0}});var d=E(a,2);{var f=g=>{var _=Gs(),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}}),Ce(3,_,()=>Vt,()=>({duration:200})),k(g,_)};H(d,g=>{Tn(n())||g(f)})}var v=E(d,2);{var m=g=>{var _=Qs(),p=E(x(_),2),y=x(p);y.__click=[Xs,n];var w=E(y,2);w.__click=[Js,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))}),Ce(3,_,()=>Vt,()=>({duration:100})),k(g,_)};H(v,g=>{n().after_article&&g(m)})}k(e,r),oe()}fe(["click"]);var tc=Me('<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 nc(e){var t=tc();k(e,t)}var ic=(e,t)=>P(t,!u(t)),rc=I('<div class="content svelte-zpsd2z"><!></div>'),ac=I('<div class="context-menu svelte-zpsd2z"><button class="svelte-zpsd2z"><!></button> <!></div>');function oc(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)||P(n,!1)}var a=ac();ce("click",we,r);var o=x(a);o.__click=[ic,n];var l=x(o);nc(l),$t(o,d=>P(i,d),()=>u(i));var s=E(o,2);{var c=d=>{var f=rc(),v=x(f);Ct(v,()=>t.children),Ce(1,f,()=>En,()=>({duration:150,y:5})),k(d,f)};H(s,d=>{u(n)&&d(c)})}N(()=>{ue(o,"aria-label",t.ariaLabel),ue(o,"aria-expanded",u(n))}),k(e,a),oe()}fe(["click"]);function lc(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()}),P(i,!0),setTimeout(n.onclose,3e3))}var sc=(e,t,n)=>P(t,X(n())),cc=I('<option class="svelte-o5qkco"> </option>'),uc=I('<div class="sent svelte-o5qkco">Report has been sent, thank you! Closing window...</div>'),dc=I('<button class="submit svelte-o5qkco">Send report</button>'),fc=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 vc(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=fc(),s=x(l);Qt(s,(b,T)=>xe==null?void 0:xe(b,T),()=>2);var c=E(s,2),d=x(c),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(c,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=cc(),D={};A.__click=[sc,i,R];var C=x(A);N(()=>{D!==(D=R())&&(A.value=(A.__value=R())==null?"":R()),G(C,M())}),k(b,A)});var y=E(g,2),w=x(y);{var S=b=>{var T=uc();Ce(1,T,()=>Ft,()=>({duration:200})),k(b,T)},j=b=>{var T=dc();T.__click=[lc,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=>P(i,b)),k(a,l)},$$slots:{default:!0}}),oe()}fe(["click"]);function _c(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 hc(e,t){const n=Jt(vc,{target:document.body,props:{linkInjection:t(),onclose:()=>bn(n)}})}var gc=(e,t)=>P(t,!u(t)),mc=I('<button class="expand-sentence svelte-lo6h85"> </button>'),pc=I('<button class="context-menu-action svelte-lo6h85">Remove</button> <button class="context-menu-action svelte-lo6h85">Report issue</button>',1),yc=(e,t)=>P(t,!u(t)),wc=I('<div class="warning svelte-lo6h85" aria-label="Invalid playlink settings"><!></div>'),kc=I('<div class="actions svelte-lo6h85"><button class="expand svelte-lo6h85" aria-label="Expand"><!></button> <!> <!></div>'),bc=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>'),xc=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 Sc(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),s=K(()=>u(a).title_details),c=K(()=>u(a).failed),d=K(()=>u(a).failed_message),f=K(()=>u(a).inactive),v=K(()=>u(s)),m=K(()=>zr(n().sentence,n().title,60));let g=U(!1),_=U(!1),p=U(!1),y=U(null);Ze(()=>{u(c)&&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),P(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=>Oe(te.innerText).includes(Oe(n().sentence)))||[]}var b=xc();ce("mouseover",we,S),b.__click=[_c,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),C=E(A,2),B=x(C);Ao(B,()=>(u(_)?u(l):u(m)).replace(n().title,`<em>${n().title}</em>`));var O=E(B,2);{var z=Q=>{var te=mc();te.__click=[gc,_];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);oc(V,{ariaLabel:"More options",children:(Q,te)=>{var le=pc(),Ae=ne(le);Ae.__click=function(...ot){var q;(q=i())==null||q.apply(this,ot)};var Qe=E(Ae,2);Qe.__click=[hc,n],k(Q,le)},$$slots:{default:!0}});var W=E(T,2),J=x(W);{var ee=Q=>{ht(Q,{children:(te,le)=>{var Ae=Be();N(()=>G(Ae,u(d))),k(te,Ae)},$$slots:{default:!0}})},re=Q=>{var te=kc(),le=x(te);le.__click=[yc,g];var Ae=x(le);Rs(Ae,{get expanded(){return u(g)}});var Qe=E(le,2);{var ot=ve=>{var Se=wc(),Le=x(Se);Hs(Le),Ce(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 Le=Be();N(()=>G(Le,u(f)?"Inactive":"Visible")),k(ve,Le)},$$slots:{default:!0}}),N(()=>ue(le,"aria-expanded",u(g))),k(Q,te)};H(J,Q=>{u(c)?Q(ee):Q(re,!1)})}var de=E(J,2);{var Ie=Q=>{var te=bc(),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 Ae=E(le,4),Qe=x(Ae);ec(Qe,{get linkInjection(){return n()}}),Ce(3,te,()=>Vt,()=>({duration:100})),k(Q,te)};H(de,Q=>{u(g)&&Q(Ie)})}$t(b,Q=>P(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),Ce(6,b,()=>Vt,()=>({duration:200})),k(e,b),oe()}fe(["click"]);var Ec=I('<button class="drag-handle svelte-19mcc5g" aria-label="Move editor"></button>');function Tc(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},s=i();Ze(()=>{c(i().x,i().y)});function c(_,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(_),s=i()}function v(_){if(!o)return;const p=d(_),y=p.x-l.x,w=p.y-l.y,S=s.x-y,j=s.y-w;c(S,j)}function m(){o&&(o=!1)}var g=Ec();ce("mousemove",we,v),ce("touchmove",we,v,void 0,!0),ce("mouseup",we,m),ce("touchend",we,m),ce("resize",we,()=>c(i().x,i().y)),g.__mousedown=f,g.__touchstart=f,k(e,g),oe()}fe(["mousedown","touchstart"]);var Ic=I('<button class="resize-handle svelte-sxkuxk" aria-label="Move editor"></button>');function Ac(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,s=i();Ze(()=>{i()&&c(i())});function c(_){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,s=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=s+y;c(w)}function v(){o=!1}function m(){const _=window.innerHeight-n().getBoundingClientRect().bottom;return Math.max(window.innerHeight-a*2-_,0)}var g=Ic();ce("mousemove",we,f),ce("touchmove",we,f,void 0,!0),ce("mouseup",we,v),ce("touchend",we,v),ce("resize",we,()=>{i()&&c(i())}),g.__mousedown=d,g.__touchstart=d,k(e,g),oe()}fe(["mousedown","touchstart"]);var Pc=Me('<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 Cc(e){var t=Pc();k(e,t)}async function jc(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 Mc=Me('<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 Lc(e){var t=Mc();k(e,t)}var Nc=I("<div> </div>"),Oc=e=>e.stopImmediatePropagation(),Dc=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=Dc();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),s=x(l),c=E(l,2),d=x(c),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=Nc(),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=[Oc];var j=x(S);Lc(j),N(()=>{se(r,"hoverable",n()),G(s,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 Rc=I('<em class="empty svelte-1olb8n0">No results found</em>'),qc=I('<div class="results svelte-1olb8n0" data-testid="search-results"></div>'),Hc=I('<div class="selected svelte-1olb8n0"><!></div>'),Bc=I('<div class="search svelte-1olb8n0"><!> <!> <!></div>');function Fc(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(_){P(o,!0);try{P(r,X(await jc(_)))}finally{P(o,!1)}}function s(_){i(_.title),P(a,X(_)),n()(_)}var c=Bc(),d=x(c);gi(d,{oninput:()=>P(a,null),name:"search",label:"Search...",get value(){return i()},set value(_){i(_)}});var f=E(d,2);{var v=_=>{var p=qc();at(p,21,()=>u(r),y=>y.sid,(y,w)=>{Vi(y,{get title(){return u(w)},onclick:()=>s(u(w))})},y=>{var w=Fe(),S=ne(w);{var j=b=>{var T=Rc();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=Hc(),y=x(p);Vi(y,{get title(){return u(a)},hoverable:!1}),k(_,p)};H(m,_=>{u(a)&&_(g)})}k(e,c),oe()}function Vc(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 c=Math.min(e.anchorOffset,e.focusOffset)+i;return{start:c,end:c+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,s=l+n.length;return{start:l,end:s}}function Uc(e,t,n,i,r,a,o,l){if(!u(t)||!u(n))return;const s=u(n).type==="movie"?"movie":"show",c=Mr+`/${s}/${u(n).slug}`,d={sid:u(n).sid,title:u(t),sentence:u(i),phrase_before:u(r),phrase_after:u(a),playpilot_url:c,key:ea(u(n).sid),title_details:u(n),manual:!0};o.onsave(d),l()()}var zc=I('<div class="error svelte-1i8p6op"><!></div>'),Wc=I('<label for="text" class="svelte-1i8p6op">Paired title</label> <!>',1),Kc=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 Yc(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(""),s=U(""),c=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;P(c,""),P(r,X(D));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(c,"Selection is or contains a link. Injections can not be created around already existing links.");return}P(d,X(u(r)));const{node:O,sentence:z}=v(A,D);if(!O)return;P(a,X(z));const{start:F,end:V}=Vc(A,O);(ee=>(P(s,X(ee.before)),P(l,X(ee.after))))(cs(O,F,V)),z.includes(u(s))||P(s,""),z.includes(u(l))||P(l,"");const W=A.getRangeAt(0).commonAncestorContainer.textContent,J=Oe(n());(!W||!J.includes(Oe(W)))&&P(c,"Selection was not inside of given content")}function v(A,D){const C=A.getRangeAt(0),B=St();let O=C.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,C.startContainer,C.startOffset),V=m(O,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,Ie=z.slice(re,de+1).trim();return{node:O,sentence:Ie}}function m(A,D,C){let B=0;const O=A,z=F=>{var V;if(F===D)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(O),B}function g(A){var D,C;P(o,X(A)),(C=(D=window.getSelection())==null?void 0:D.removeAllRanges)==null||C.call(D)}var _=Kc();ce("mouseup",we,f);var p=x(_),y=x(p);ci(y,{get onclick(){return i()},size:"24px",children:(A,D)=>{Cc(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=zc(),C=x(D);ht(C,{children:(B,O)=>{var z=Be();N(()=>G(z,u(c))),k(B,z)},$$slots:{default:!0}}),k(A,D)};H(j,A=>{u(c)&&A(b)})}var T=E(j,2);{var R=A=>{var D=Wc(),C=E(ne(D),2);Ir(C,()=>u(a)+u(r),B=>{Fc(B,{onselect:g,get query(){return u(d)},set query(O){P(d,X(O))}})}),k(A,D)};H(T,A=>{u(c)||A(R)})}var M=E(T,2);M.__click=[Uc,r,o,a,s,l,t,i],N(()=>M.disabled=!u(r)||!u(o)),k(e,_),oe()}fe(["click"]);const Kn="PlayPilotEditorialSessionId",ta=5e3,Zc=ta*2;async function Gc(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()>Zc?!0:r===e}function ra(){return sessionStorage.getItem(Kn)||Xc()}function Xc(){const e=sessionStorage.getItem(Kn)||qr();return sessionStorage.setItem(Kn,e),e}function Jc(e,t,n){na(t()),n()()}var Qc=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),$c=I('<div class="alert svelte-2m2urs"><!></div>');function eu(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,s=U(!0);Ze(()=>(c(),()=>{l&&clearInterval(l)}));function c(){d(),l=setInterval(d,ta)}async function d(){const g=await Gc(n());g&&(P(s,X(ia(g.session_id||null,g.session_last_ping||null))),u(s)?r()():a()(),i()({injectionsEnabled:!!g.injections_enabled,aiEnabled:!!g.ai_enabled}))}var f=Fe(),v=ne(f);{var m=g=>{var _=$c(),p=x(_);ht(p,{type:"warning",children:(y,w)=>{var S=Qc(),j=E(ne(S),2);j.__click=[Jc,n,o],k(y,S)},$$slots:{default:!0}}),k(g,_)};H(v,g=>{u(s)||g(m)})}k(e,f),oe()}fe(["click"]);var tu=Me('<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 nu(e){var t=tu();k(e,t)}var iu=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),ru=I('<span class="svelte-1kpafo0">.</span>'),au=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),ou=(e,t)=>P(t,!0),lu=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),su=I('<div class="animator svelte-1kpafo0" data-test-id="animator"></div>'),cu=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 uu(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 s=U(!1);var c=Fe(),d=ne(c);{var f=v=>{var m=cu(),g=x(m),_=x(g),p=x(_);nu(p);var y=E(_,2),w=x(y);{var S=M=>{var A=iu();k(M,A)},j=M=>{var A=Fe(),D=ne(A);{var C=O=>{var z=au(),F=E(ne(z),2),V=x(F),W=E(V);at(W,20,()=>({length:3}),xt,(te,le)=>{var Ae=ru();k(te,Ae)});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 Ie=E(ee,2),Q=x(Ie);N(()=>G(Q,`${Math.floor(a())??""}%`)),N(()=>G(V,`${r()??""} `)),k(O,z)},B=O=>{var z=lu(),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=[ou,s],k(O,z)};H(D,O=>{n()?O(C):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=su();k(M,A)};H(T,M=>{n()&&M(R)})}N(()=>se(m,"running",n())),k(v,m)};H(d,v=>{u(s)||v(f)})}k(e,c)}fe(["click"]);async function du(e,t,n,i,r,a,o){try{P(t,!0),P(n,!1),i(await Ls(i(),r())),P(a,X(u(o)))}catch{P(n,!0)}finally{P(t,!1)}}var fu=I('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:400,600,700">'),vu=I('<div class="handles svelte-11aj6xq"><div class="handle svelte-11aj6xq"><!></div> <div class="handle svelte-11aj6xq"><!></div></div>'),_u=I('<div class="loading svelte-11aj6xq">Loading...</div>'),hu=I('<div class="bubble svelte-11aj6xq"> </div> <!>',1),gu=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),mu=I('<div class="alert svelte-11aj6xq"><!></div>'),pu=I('<div class="error svelte-11aj6xq"><!></div>'),yu=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>'),wu=I('<button class="save svelte-11aj6xq"> </button>'),ku=I('<!> <!> <div class="items svelte-11aj6xq"></div> <!>',1),bu=I("<!> <!> <!>",1),xu=I('<div class="panel playpilot-styled-scrollbar svelte-11aj6xq"><!></div>'),Su=I('<section class="editor playpilot-styled-scrollbar svelte-11aj6xq"><!> <header class="header svelte-11aj6xq"><div class="heading svelte-11aj6xq">Playlinks</div> <!></header> <!> <!></section>');function Eu(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 s="editor-position",c="editor-height",d=JSON.parse(localStorage.getItem(s)||'{ "x": 0, "y": 0 }'),f=parseInt(localStorage.getItem(c)||"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(()=>C(u(M))),D=K(()=>!r()&&Ke(()=>o().aiRunning));pn(()=>{r()||Ke(()=>{requestAnimationFrame(()=>P(w,X(u(b)))),V()})});function C(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;P(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=Su();bo(q=>{var Y=fu();k(q,Y)});var J=x(W);{var ee=q=>{var Y=vu(),_e=x(Y),ve=x(_e);Ac(ve,{get element(){return u(v)},height:f,onchange:Ge=>B(c,JSON.stringify(Ge))});var Se=E(_e,2),Le=x(Se);Tc(Le,{get element(){return u(v)},position:d,limit:{x:16,y:16},onchange:Ge=>B(s,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 Ie=E(de,2);{var Q=q=>{var Y=_u();k(q,Y)},te=q=>{var Y=Fe(),_e=ne(Y);{var ve=Se=>{var Le=hu(),Ge=ne(Le),Ne=x(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",`${u(M).length??""} found playlinks`),G(Ne,u(M).length)}),k(Se,Le)};H(_e,Se=>{u(T)&&Se(ve)},!0)}k(q,Y)};H(Ie,q=>{r()?q(Q):q(te,!1)})}var le=E(re,2);{var Ae=q=>{var Y=bu(),_e=ne(Y);eu(_e,{get pageText(){return i()},onallow:()=>P(p,!0),ondisallow:()=>P(p,!1),get ontakeover(){return l()},onpoll:Ne=>{a(Ne.injectionsEnabled),o({...o(),aiEnabled:Ne.aiEnabled})}});var ve=E(_e,2);{var Se=Ne=>{uu(Ne,Zo(o,{get aiInjectionsCount(){return Gr(n()).aiInjections.length}}))};H(ve,Ne=>{u(p)&&(u(D)||!u(S))&&Ne(Se)})}var Le=E(ve,2);{var Ge=Ne=>{var tn=ku(),nn=ne(tn);{var mi=ge=>{var me=mu(),$e=x(me);ht($e,{type:"warning",children:(lt,sa)=>{var An=gu();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=pu(),$e=x(me);ht($e,{children:(lt,sa)=>{var An=Be("Something went wrong, check your links below.");k(lt,An)},$$slots:{default:!0}}),Ce(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));Sc(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=yu();k(ge,me)});var oa=E(pi,2);{var la=ge=>{var me=wu();me.__click=[du,g,_,n,i,w,b];var $e=x(me);N(()=>{me.disabled=u(g),G($e,u(g)?"Saving...":"Save links")}),Ce(1,me,()=>Ft,()=>({duration:100})),k(ge,me)};H(oa,ge=>{u(R)&&n().length&&u(p)&&ge(la)})}k(Ne,tn)};H(Le,Ne=>{u(T)&&Ne(Ge)})}k(q,Y)};H(le,q=>{r()||q(Ae)})}var Qe=E(le,2);{var ot=q=>{var Y=xu(),_e=x(Y);Yc(_e,{get pageText(){return i()},onclose:()=>P(m,!1),onsave:ve=>n().push(ve)}),N(()=>xn(Y,"top",`${u(y)??""}px`)),Ce(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=>P(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 Tu=Me('<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 Iu(e){var t=Tu();k(e,t)}var Au=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 Pu(e,t){var n=Au(),i=x(n);i.__click=function(...l){var s;(s=t.onclick)==null||s.apply(this,l)};var r=x(i);Iu(r);var a=E(i,2);a.__click=function(...l){var s;(s=t.onclose)==null||s.apply(this,l)};var o=x(a);Br(o),k(e,n)}fe(["click"]);var Cu=I('<div class="playpilot-link-injections svelte-13rmd3g" data-playpilot-link-injections=""><!> <!></div>');function ju(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),s=U(!0),c=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(s)&&p()}),Ze(()=>{if(!Os())return(async()=>(await _(),pe(he.ArticlePageView)))(),()=>vi()});async function _(){P(s,!0),u(a)&&P(l,X(await Dr()));try{const C=await Ns(),B=ai();if(P(c,!!(C!=null&&C.exclude_urls_pattern&&B.match(new RegExp(C.exclude_urls_pattern)))),u(c))return;C!=null&&C.custom_style&&b(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(u(g),{maxTries:1,runAiWhenRelevant:!0}))),P(s,!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;P(r,X(await Hi(u(g),{requireCompletedResult:!0,onpoll:C=>P(r,X(C))}))),w({aiInjections:u(v),manualInjections:u(m)})}catch(C){console.error(C),pe(he.InjectionError,null,{message:C.message})}}function p(){w(Gr(u(d)))}function y(){P(a,!1),requestAnimationFrame(()=>{P(a,!0),_()})}function w(C={aiInjections:u(v),manualInjections:u(m)}){const B=ms(u(i),C);JSON.stringify(B)!==JSON.stringify(u(d))&&P(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(C,B){C&&(window.PlayPilotLinkInjections.selector=C),P(n,X(St())),P(i,X(fi(u(n),B)))}function j(){P(a,!0),il(),_()}function b(C){const B="playpilot-custom-style",O=document.getElementById(B),z=O||document.createElement("style");z.textContent=`[data-playpilot-link-injections] { ${C} }`,z.id=B,O||document.body.appendChild(z)}var T=Cu(),R=x(T);{var M=C=>{Pu(C,{onclick:j,onclose:()=>{P(o,!1),nl()}})};H(R,C=>{!u(c)&&u(o)&&!u(a)&&C(M)})}var A=E(R,2);{var D=C=>{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,Ie;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:(Ie=u(r))==null?void 0:Ie.ai_progress_percentage}});Eu(F,{get pageText(){return u(g)},get loading(){return u(s)},onreinitialize:y,get injectionsEnabled(){return u(V)},get aiStatus(){return u(W)},get linkInjections(){return u(d)},set linkInjections(J){P(d,X(J))}})}),k(C,B)};H(A,C=>{!u(c)&&u(a)&&u(l)&&C(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(ju,{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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
package/src/lib/array.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Range } from "./types/range"
1
2
 
2
3
  /**
3
4
  * Returns the largest number in an array of numbers. Returns 0 if the array has no entries.
@@ -22,3 +23,7 @@ export function getNumberOfOccurrencesInArray<T>(array: T[], item: T, keys: stri
22
23
  // @ts-ignore The key here used is a bit ambiguous
23
24
  return array.filter(i => keys.every(key => i[key] === item[key])).length
24
25
  }
26
+
27
+ export function isIndexInAnyRange(index: number, ranges: Range[]) {
28
+ return ranges.some(range => index >= range.start && index < range.end)
29
+ }
@@ -2,7 +2,7 @@ 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, getIndexOfPhraseWithSentenceBoundary, getNumberOfLeadingAndTrailingSpaces, isNodeInLink, replaceBetween, replaceStartingFrom } from './text'
5
+ import { cleanPhrase, findNumberOfMatchesInString, findShortestMatchBetweenPhrases, findTextNodeContaining, getIndexOfPhraseInElement, 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'
@@ -161,7 +161,9 @@ export function injectLinksInDocument(elements: HTMLElement[], injections: LinkI
161
161
 
162
162
  // !! Option 1 - Simple replacements
163
163
  // Check if there is only one occurance in the element, in which case the replacement is simple
164
- const numberOfMatches = findNumberOfMatchesInString(cleanPhrase(element.innerText), cleanPhrase(injection.title))
164
+ // It's important that we check against the phrase without cleanPhrase(), as we need to check if an
165
+ // element might contain attributes that contain the phrase.
166
+ const numberOfMatches = findNumberOfMatchesInString(element.innerHTML, injection.title)
165
167
  if (numberOfMatches === 1) replacementIndex = element.innerHTML.indexOf(injection.title)
166
168
 
167
169
  // !! Option 2 - Replace by phrase_before and phrase_after
@@ -209,7 +211,7 @@ export function injectLinksInDocument(elements: HTMLElement[], injections: LinkI
209
211
  // A sentence might include multiple matches for the same phrase. We get the number of previous occurences in order to get the index
210
212
  // of the match we actually want to get.
211
213
  const indexOfOccurrence = getNumberOfOccurrencesInArray<LinkInjection>(foundInjections.slice(0, injectionIndex + 1), injection, ['title', 'sentence']) - 1
212
- const indexInSentence = getIndexOfPhraseWithSentenceBoundary(nodeContainingText.nodeValue, element.innerHTML, indexOfOccurrence)
214
+ const indexInSentence = getIndexOfPhraseInElement(nodeContainingText.nodeValue, element, indexOfOccurrence)
213
215
 
214
216
  replacementIndex = Math.max(valueIndex, indexInSentence, sentenceIndex, 0)
215
217
  }
package/src/lib/text.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import { isIndexInAnyRange } from './array'
1
2
  import { decodeHtmlEntities, encodeHtmlEntities } from './html'
3
+ import type { Range } from './types/range'
2
4
 
3
5
  /**
4
6
  * Find the node that a particular string is in. For example:
@@ -180,27 +182,76 @@ export function getNumberOfLeadingAndTrailingSpaces(text: string): { leadingSpac
180
182
  }
181
183
 
182
184
  /**
183
- * Get the index of a phrase inside of text based on a specific word boundary. Returns either the first match
185
+ * Get the index of a phrase inside of an element based on a specific word boundary. Returns either the first match
184
186
  * or the index of the given occurrence.
185
187
  */
186
- export function getIndexOfPhraseWithSentenceBoundary(phrase: string, sentence: string, occurrence = 0): number {
187
- const disallowedBoundaryCharacters = ['-', '_', '/']
188
+ export function getIndexOfPhraseInElement(phrase: string, element: Element, occurrence = 0): number {
189
+ const sentence = element.innerHTML
188
190
  const matches = []
191
+ const rangesOfTextNodes = getRangesOfTextNodesInElement(element)
189
192
 
190
193
  let index = sentence.indexOf(phrase)
191
194
  while (index !== -1) {
192
- const leadingCharacter = sentence[index - 1]
193
- const disallowedLeadingCharacter = disallowedBoundaryCharacters.includes(leadingCharacter)
195
+ // Only add to matches if the given match is inside of a text node
196
+ if (isIndexInAnyRange(index, rangesOfTextNodes)) matches.push(index)
194
197
 
195
- const trailingCharacter = sentence[index + phrase.length]
196
- const disallowedTrailingCharacter = disallowedBoundaryCharacters.includes(trailingCharacter)
198
+ index = sentence.indexOf(phrase, index + phrase.length)
199
+ }
200
+
201
+ return matches[occurrence] ?? -1
202
+ }
203
+
204
+ /**
205
+ * Get the ranges for all text nodes inside of an element. This is done by iterating over each character and determening
206
+ * where a text node might start.
207
+ */
208
+ export function getRangesOfTextNodesInElement(element: Element): Range[] {
209
+ const ranges: Range[] = []
210
+ const html = element.innerHTML
211
+
212
+ let isInsideElement = false
213
+ let isInsideAttribute = false
214
+ let isInsideTextNode = false
215
+ let startIndexOfTextNode = 0
216
+
217
+ for (let i = 0; i < html.length; i++) {
218
+ const character = html[i]
219
+
220
+ // The start of an element
221
+ if (!isInsideAttribute && !isInsideElement && character === '<') {
222
+ isInsideElement = true
197
223
 
198
- if (!disallowedLeadingCharacter && !disallowedTrailingCharacter) {
199
- matches.push(index)
224
+ // We were previously inside of a text node, we add the current range
225
+ if (isInsideTextNode) {
226
+ ranges.push({ start: startIndexOfTextNode, end: i })
227
+ isInsideTextNode = false
228
+ }
229
+
230
+ continue
231
+ }
232
+
233
+
234
+ // We are inside of an element and a qoute was given, signaling that we're either opening or closing and attribute.
235
+ // We need to keep track of this in case an attribute value contains ">" or "<"
236
+ if (isInsideElement && character === '"') isInsideAttribute = !isInsideAttribute
237
+
238
+ // End of an element. We're sure this > is the end because we're checking if we're not inside of an attribute
239
+ if (isInsideElement && !isInsideAttribute && character === '>') {
240
+ isInsideElement = false
241
+ continue
200
242
  }
201
243
 
202
- index = sentence.indexOf(phrase, index + 1)
244
+ // We're outside of an element and have entered a text node, meaning this is the first character of a text node.
245
+ if (!isInsideElement && !isInsideAttribute && !isInsideTextNode) {
246
+ startIndexOfTextNode = i
247
+ isInsideTextNode = true
248
+ }
203
249
  }
204
250
 
205
- return matches[occurrence] ?? -1
251
+ // No ranges were found and the element contained no child nodes but it does have text, so the entire element is text.
252
+ if (!ranges.length && element.textContent.length) {
253
+ ranges.push({ start: startIndexOfTextNode, end: element.innerHTML.length })
254
+ }
255
+
256
+ return ranges
206
257
  }
@@ -0,0 +1,4 @@
1
+ export type Range = {
2
+ start: number
3
+ end: number
4
+ }
@@ -52,6 +52,9 @@
52
52
  <h2>Repeat injections <small>(Exact example from DigitalSpy)</small></h2>
53
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
54
 
55
+ <h2>Matching phrase in attribute <small>(Exact example from DigitalSpy)</small></h2>
56
+ <p data-node-id="29">Cast for the series includes Warren Brown (<em data-node-id="29.1"><a href="https://www.playpilot.com/show/luther-2010" target="_blank" data-link="https://www.playpilot.com/show/luther-2010" data-action="Luther" data-node-id="29.1.0">Luther</a></em>, <em data-node-id="29.3"><span data-action="The Responder">The Responder</span></em>), Vinette Robinson (<em data-node-id="29.5"><a href="https://www.playpilot.com/show/six-four-2023" target="_blank" data-link="https://www.playpilot.com/show/six-four-2023" data-action="Six Four" data-node-id="29.5.0">Six Four</a></em>, <em data-node-id="29.7"><a href="https://www.playpilot.com/movie/boiling-point-2021-2021-4" target="_blank" data-link="https://www.playpilot.com/movie/boiling-point-2021-2021-4" data-action="Boiling Point" data-node-id="29.7.0">Boiling Point</a></em>), Christine Tremarco (<em data-node-id="29.9"><a href="https://www.playpilot.com/movie/adolescence-2018" target="_blank" data-link="https://www.playpilot.com/movie/adolescence-2018" data-action="Adolescence" data-node-id="29.9.0">Adolescence</a></em>,<em data-node-id="29.11"> <a href="https://www.playpilot.com/show/little-boy-blue-2017" target="_blank" data-link="https://www.playpilot.com/show/little-boy-blue-2017" data-action="Little Boy Blue" data-node-id="29.11.1">Little Boy Blue</a></em>), Eva Morgan (<em data-node-id="29.13"><a href="https://www.playpilot.com/show/this-city-is-ours-2025-series" target="_blank" data-link="https://www.playpilot.com/show/this-city-is-ours-2025-series" data-action="This City Is Ours" data-node-id="29.13.0">This City Is Ours</a></em>), Sadie Soverall (<em data-node-id="29.15"><a href="https://www.playpilot.com/show/fate-the-winx-saga-2020" target="_blank" data-link="https://www.playpilot.com/show/fate-the-winx-saga-2020" data-action="Fate: The Winx Saga" data-node-id="29.15.0">Fate: The Winx Saga</a></em>) and Sonny Walker (<em data-node-id="29.17">The Responder</em>).</p>
57
+
55
58
  <h2>Mixed and breaking elements <small>(DigitalSpy.com tends to do this)</small></h2>
56
59
  <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>
57
60
 
@@ -1,5 +1,5 @@
1
1
  import { describe, it, expect } from 'vitest'
2
- import { getLargestValueInArray, getNumberOfOccurrencesInArray } from '$lib/array'
2
+ import { getLargestValueInArray, getNumberOfOccurrencesInArray, isIndexInAnyRange } from '$lib/array'
3
3
 
4
4
  describe('array.js', () => {
5
5
  describe('getLargestValueInArray', () => {
@@ -61,4 +61,46 @@ describe('array.js', () => {
61
61
  expect(getNumberOfOccurrencesInArray(array, item, ['id', 'key'])).toBe(2)
62
62
  })
63
63
  })
64
+
65
+ describe('isIndexInAnyRange', () => {
66
+ it('Should return true when index is inside a single range', () => {
67
+ const ranges = [{ start: 2, end: 6 }]
68
+
69
+ expect(isIndexInAnyRange(3, ranges)).toBe(true)
70
+ expect(isIndexInAnyRange(5, ranges)).toBe(true)
71
+ })
72
+
73
+ it('Should return false when index is before a range', () => {
74
+ const ranges = [{ start: 2, end: 6 }]
75
+
76
+ expect(isIndexInAnyRange(1, ranges)).toBe(false)
77
+ })
78
+
79
+ it('Should return false when index is after a range', () => {
80
+ const ranges = [{ start: 2, end: 6 }]
81
+
82
+ expect(isIndexInAnyRange(6, ranges)).toBe(false)
83
+ })
84
+
85
+ it('Should return true if index falls inside any of multiple ranges', () => {
86
+ const ranges = [
87
+ { start: 0, end: 3 },
88
+ { start: 10, end: 15 },
89
+ { start: 20, end: 25 },
90
+ ]
91
+
92
+ expect(isIndexInAnyRange(11, ranges)).toBe(true)
93
+ expect(isIndexInAnyRange(22, ranges)).toBe(true)
94
+ })
95
+
96
+ it('Should return false if index is not in any of multiple ranges', () => {
97
+ const ranges = [
98
+ { start: 0, end: 3 },
99
+ { start: 10, end: 15 },
100
+ ]
101
+
102
+ expect(isIndexInAnyRange(5, ranges)).toBe(false)
103
+ expect(isIndexInAnyRange(16, ranges)).toBe(false)
104
+ })
105
+ })
64
106
  })
@@ -523,6 +523,25 @@ describe('linkInjection.js', () => {
523
523
  expect(links).toHaveLength(3)
524
524
  })
525
525
 
526
+ it('Should not inject links into element attributes', () => {
527
+ document.body.innerHTML = '<p><span data-thing="phrase">Some</span> phrase</p>'
528
+
529
+ const elements = Array.from(document.querySelectorAll('p'))
530
+
531
+ const sentence = 'Some phrase'
532
+ const linkInjections = [
533
+ generateInjection(sentence, 'phrase'),
534
+ generateInjection(sentence, 'phrase'),
535
+ ]
536
+
537
+ injectLinksInDocument(elements, { aiInjections: linkInjections, manualInjections: [] })
538
+
539
+ const links = /** @type {HTMLAnchorElement[]} */ (Array.from(document.querySelectorAll('[data-playpilot-injection-key]')))
540
+
541
+ expect(links).toHaveLength(1)
542
+ expect(document.body.innerText).toBe(sentence)
543
+ })
544
+
526
545
  it('Should not inject injections with in_text set to false', () => {
527
546
  document.body.innerHTML = '<p>This is a sentence with an injection.</p>'
528
547
 
@@ -1,5 +1,5 @@
1
1
  import { describe, it, expect, beforeEach } from 'vitest'
2
- import { cleanPhrase, findAllMatchesBetweenPhrases, findShortestMatchBetweenPhrases, findSurroundingPhrases, findTextNodeContaining, getFirstNumberOfWordsInString, getIndexOfPhraseWithSentenceBoundary, getNumberOfLeadingAndTrailingSpaces, isNodeInLink, replaceStartingFrom, reverseString, truncateAroundPhrase } from '$lib/text'
2
+ import { cleanPhrase, findAllMatchesBetweenPhrases, findShortestMatchBetweenPhrases, findSurroundingPhrases, findTextNodeContaining, getFirstNumberOfWordsInString, getIndexOfPhraseInElement, getNumberOfLeadingAndTrailingSpaces, getRangesOfTextNodesInElement, isNodeInLink, replaceStartingFrom, reverseString, truncateAroundPhrase } from '$lib/text'
3
3
 
4
4
  describe('text.js', () => {
5
5
  beforeEach(() => {
@@ -347,48 +347,77 @@ describe('text.js', () => {
347
347
  })
348
348
  })
349
349
 
350
- describe('getIndexOfPhraseWithSentenceBoundary', () => {
350
+ describe('getIndexOfPhraseInElement', () => {
351
+ const element = document.createElement('p')
352
+
351
353
  it('Should return index of a single phrase occurrence', () => {
352
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'Some phrase in a sentence')).toBe(5)
354
+ element.innerText = 'Some phrase in a sentence'
355
+ expect(getIndexOfPhraseInElement('phrase', element)).toBe(5)
353
356
  })
354
357
 
355
358
  it('Should return -1 if phrase is not found', () => {
356
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'Some sentence without a match')).toBe(-1)
359
+ element.innerText = 'Some sentence without a match'
360
+ expect(getIndexOfPhraseInElement('phrase', element)).toBe(-1)
357
361
  })
358
362
 
359
363
  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
- })
364
+ element.innerText = 'Some phrase, another phrase, and one more phrase'
365
365
 
366
- it('Should not match when phrase is preceded by a disallowed boundary character', () => {
367
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'pre-phrase test')).toBe(-1)
366
+ expect(getIndexOfPhraseInElement('phrase', element, 0)).toBe(5)
367
+ expect(getIndexOfPhraseInElement('phrase', element, 1)).toBe(21)
368
+ expect(getIndexOfPhraseInElement('phrase', element, 2)).toBe(42)
368
369
  })
370
+ })
371
+
372
+
373
+ describe('getRangesOfTextNodesInElement', () => {
374
+ const element = document.createElement('div')
375
+
376
+ it('Should return full range for plain text with no tags', () => {
377
+ element.innerHTML = 'Some phrase'
378
+ const ranges = getRangesOfTextNodesInElement(element)
369
379
 
370
- it('Should not match when phrase is followed by a disallowed boundary character', () => {
371
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'This is phrase_test')).toBe(-1)
380
+ expect(ranges).toEqual([{ start: 0, end: 11 }])
372
381
  })
373
382
 
374
- it('Should match when phrase is at the start of the sentence', () => {
375
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'phrase at the start')).toBe(0)
383
+ it('Should ignores tags and finds text inside nested tags', () => {
384
+ element.innerHTML = '<p><span>Nested</span> text</p>'
385
+ const ranges = getRangesOfTextNodesInElement(element)
386
+
387
+ expect(ranges).toEqual([
388
+ { start: 9, end: 15 },
389
+ { start: 22, end: 27 },
390
+ ])
376
391
  })
377
392
 
378
- it('Should match when phrase is at the end of the sentence', () => {
379
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'This is a phrase')).toBe(10)
393
+ it('Should ignore text inside attributes', () => {
394
+ element.innerHTML = '<span data-test="Some text">Phrase</span>'
395
+ const ranges = getRangesOfTextNodesInElement(element)
396
+
397
+ expect(ranges).toEqual([{ start: 28, end: 34 }])
398
+ expect(element.innerHTML.slice(ranges[0].start, ranges[0].end)).toBe('Phrase')
380
399
  })
381
400
 
382
- it('Should match when phrase is surrounded by spaces', () => {
383
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'A phrase inside')).toBe(2)
401
+ it('Should ignore attributes containing < and >', () => {
402
+ element.innerHTML = '<span data-test="<Phrase>">Phrase</span>'
403
+ const ranges = getRangesOfTextNodesInElement(element)
404
+
405
+ expect(ranges).toEqual([{ start: 27, end: 33 }])
406
+ expect(element.innerHTML.slice(ranges[0].start, ranges[0].end)).toBe('Phrase')
384
407
  })
385
408
 
386
- it('Should handle multiple disallowed boundary characters correctly', () => {
387
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'phrase/phrase_phrase-phrase phrase')).toBe(28)
409
+ it('Should return empty array for element with only child elements', () => {
410
+ element.innerHTML = '<p><b></b></p>'
411
+
412
+ const ranges = getRangesOfTextNodesInElement(element)
413
+ expect(ranges).toEqual([])
388
414
  })
389
415
 
390
- it('Should return -1 when occurrence index is out of range', () => {
391
- expect(getIndexOfPhraseWithSentenceBoundary('phrase', 'phrase phrase phrase', 5)).toBe(-1)
416
+ it('Should returns empty array for completely empty element', () => {
417
+ element.innerHTML = ''
418
+
419
+ const ranges = getRangesOfTextNodesInElement(element)
420
+ expect(ranges).toEqual([])
392
421
  })
393
422
  })
394
423
  })