PageSourceSearch

https://invoke.ai/_astro/page.C1cGRR7s.js

js invoke.ai collected 2026-10-03 21:31:54 UTC 13,576 bytes, 133 lines download raw bytes

1const M={},y=new Set,h=new WeakSet;let g=!0,C,x=!1;function E(e){x||(x=!0,g??=!1,C??="hover",T(),z(),H(),$())}function T(){for(const e of["touchstart","mousedown"])document.addEventListener(e,t=>{const n=t.target.closest("a");p(n,"tap")&&m(n.href,{ignoreSlowConnection:!0})},{passive:!0})}function z(){let e;document.body.addEventListener("focusin",o=>{const r=o.target.closest("a");p(r,"hover")&&t(r.href)},{passive:!0}),document.body.addEventListener("focusout",n,{passive:!0}),v(()=>{for(const o of document.getElementsByTagName("a"))h.has(o)||p(o,"hover")&&(h.add(o),o.addEventListener("mouseenter",r=>t(r.currentTarget.href),{passive:!0}),o.addEventListener("mouseleave",n,{passive:!0}))});function t(o){e&&clearTimeout(e),e=setTimeout(()=>{m(o)},80)}function n(){e&&(clearTimeout(e),e=0)}}function H(){let e;v(()=>{for(const t of document.getElementsByTagName("a"))h.has(t)||p(t,"viewport")&&(h.add(t),e??=S(),e.observe(t))})}function S(){const e=new WeakMap;return new IntersectionObserver((t,n)=>{for(const o of t){const r=o.target,i=e.get(r);o.isIntersecting?(i&&clearTimeout(i),e.set(r,setTimeout(()=>{n.unobserve(r),e.delete(r),m(r.href)},300))):i&&(clearTimeout(i),e.delete(r))}})}function $(){v(()=>{for(const e of document.getElementsByTagName("a"))p(e,"load")&&m(e.href)})}function m(e,t){e=e.replace(/#.*/,"");const n=t?.ignoreSlowConnection??!1;if(I(e,n))if(y.add(e),document.createElement("link").relList?.supports?.("prefetch")){const o=document.createElement("link");o.rel="prefetch",o.setAttribute("href",e),document.head.append(o)}else{const o=new Headers;for(const[r,i]of Object.entries(M))o.set(r,i);fetch(e,{priority:"low",headers:o})}}function I(e,t){if(!navigator.onLine||!t&&k())return!1;try{const n=new URL(e,location.href);return location.origin===n.origin&&(location.pathname!==n.pathname||location.search!==n.search)&&!y.has(e)}catch{}return!1}function p(e,t){if(e?.tagName!=="A")return!1;const n=e.dataset.astroPrefetch;return n==="false"?!1:t==="tap"&&(n!=null||g)&&k()?!0:n==null&&g||n===""?t===C:n===t}function k(){if("connection"in navigator){const e=navigator.connection;return e.saveData||/2g/.test(e.effectiveType)}return!1}function v(e){e();let t=!1;document.addEventListener("astro:page-load",()=>{if(!t){t=!0;return}e()})}const b={copy:{label:"Copy page",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',className:"copy-action",action:async()=>{const e=new URL("index.md",window.location.href.replace(/\/?$/,"/")).toString();try{const t=new ClipboardItem({"text/plain":fetch(e).then(i=>i.text()).then(i=>new Blob([i],{type:"text/plain"})).catch(i=>{throw new Error(`Received ${i.message} for ${e}`)})});await navigator.clipboard.write([t]);const n=document.querySelector(".copy-action"),o=n.innerHTML,r=n.querySelector("span");r&&(r.textContent="Copied!"),setTimeout(()=>{n.innerHTML=o},2e3)}catch(t){console.error("Failed to copy Markdown:",t)}}},view:{label:"View as Markdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="208" height="128" viewBox="0 0 208 128"><rect width="198" height="118" x="5" y="5" ry="10" stroke="currentColor" stroke-width="10" fill="transparent"/><path stroke="currentColor" fill="currentColor" d="M30 98V30h20l20 25 20-25h20v68H90V59L70 84 50 59v39zm125 0l-30-33h20V30h20v35h20z"/></svg>',action:()=>{window.open(new URL("index.md",window.location.href.replace(/\/?$/,"/")),"_blank")}},chatgpt:{label:"Open in ChatGPT",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320" stroke="transparent" fill="currentColor"><path d="m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm
114.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"/></svg>',action:()=>{const e=`Read from ${window.location.href} so I can ask questions about it.`;window.open(`https://chat.openai.com/?q=${e}`,"_blank")}},claude:{label:"Open in Claude",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 92.2 65" stroke="transparent" fill="currentColor"><path class="st0" d="M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0zM24.3,39.3l8.8-22.8l8.8,22.8H24.3z"></path></svg>',action:()=>{const e=`Read from ${window.location.href} so I can ask questions about it.`;window.open(`https://claude.ai/new?q=${e}`,"_blank")}},lechat:{label:"Open in Le Chat",icon:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><title>Mistral AI</title><path d="M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"/></svg>',action:()=>{const e=`Read from ${window.location.href} so I can ask questions about it.`;window.open(`https://chat.mistral.ai/chat?q=${e}`,"_blank")}},grok:{label:"Open in Grok",icon:'<svg viewBox="0 0 1024 1024" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916"/><path d="M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339"/></svg>',action:()=>{const e=`Read from ${window.location.href} so I can ask questions about it.`;window.open(`https://grok.com/?q=${e}`,"_blank")}}};function N(e){return e.map(t=>{if(typeof t=="string"){const n=b[t];return n?{...n}:(console.warn(`Unknown action: ${t}. Available actions: ${Object.keys(b).join(", ")}`),null)}else if(typeof t=="object"&&t!==null)return{...t};return null}).filter(Boolean)}function B(e){const t=N(e.actions);document.addEventListener("DOMContentLoaded",()=>{const n=document.querySelector(".sl-container>h1");if(!n){console.warn("Contextual menu: Could not find page title element");return}const o=n.parentElement;if(!o){console.warn("Contextual menu: Could not find parent element of title");return}const r=document.createElement("div");
1r.id="contextual-menu-container",r.className="contextual-menu-container";let i=null;if(t.length>0){const a=t[0];i=document.createElement("button"),i.className=`contextual-main-action ${a.className||""}`.trim(),i.addEventListener("click",f=>{f.preventDefault(),a.action&&typeof a.action=="function"&&a.action()});let c="";a.icon&&(c+=a.icon),e.hideMainActionLabel||(c+=`<span>${a.label}</span>`),i.innerHTML=c}const l=document.createElement("button");l.id="contextual-menu-trigger",l.className="contextual-menu-trigger",l.ariaLabel="Open contextual menu",l.innerHTML=`
2      <svg xmlns="http://www.w3.org/2000/svg" 
3           width="16" 
4           height="16" 
5           viewBox="0 0 24 24"
6           fill="none" 
7           stroke="currentColor" 
8           stroke-width="2" 
9           stroke-linecap="round" 
10           stroke-linejoin="round">
11        <path d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zM12 13a1 1 0 110-2 1 1 0 010 2zM12 20a1 1 0 110-2 1 1 0 010 2z"/>
12      </svg>
13    `;const s=document.createElement("div");s.id="contextual-dropdown-menu",s.className="contextual-dropdown-menu",t.forEach(a=>{const c=document.createElement("button");
13c.className=`contextual-menu-item ${a.className||""}`.trim(),c.textContent=a.label,c.addEventListener("click",f=>{f.preventDefault(),a.action&&typeof a.action=="function"&&a.action(),w()}),a.icon&&(c.innerHTML=`${a.icon}<span>${a.label}</span>`),s.appendChild(c)}),i&&r.appendChild(i),r.appendChild(l),r.appendChild(s),o.style.display="flex",o.style.justifyContent="space-between",o.style.alignItems="flex-start",o.classList.add("contextual-menu-parent"),o.appendChild(r);const d=document.createElement("style");d.textContent=`
14      .contextual-menu-container {
15        position: relative;
16        display: inline-flex;
17        align-items: center;
18        margin-left: auto;
19      }
20      
21      .contextual-main-action {
22        background: var(--sl-color-bg);
23        color: var(--sl-color-text);
24        border: 1px solid var(--sl-color-gray-5);
25        border-right: none;
26        border-radius: 0.5rem 0 0 0.5rem;
27        padding: 8px;
28        cursor: pointer;
29        display: flex;
30        align-items: center;
31        justify-content: center;
32        gap: 8px;
33        text-decoration: none;
34        height: 2rem;
35        font-size: 14px;
36        line-height: 1.5;
37        font-family: inherit;
38      }
39      
40      .contextual-main-action:hover {
41        background: var(--sl-color-hairline-light);
42      }
43      
44      .contextual-main-action svg {
45        width: 16px;
46        height: 16px;
47        flex-shrink: 0;
48      }
49      
50      .contextual-menu-trigger {
51        background: var(--sl-color-bg);
52        border: 1px solid var(--sl-color-gray-5);
53        border-radius: 0 0.5rem 0.5rem 0;
54        padding: 8px;
55        cursor: pointer;
56        display: flex;
57        align-items: center;
58        justify-content: center;
59        height: 2rem;
60        color: var(--sl-color-text);
61      }
62      
63      .contextual-menu-trigger:hover {
64        background: var(--sl-color-hairline-light);
65      }
66      
67      .contextual-dropdown-menu {
68        position: absolute;
69        top: calc(100% + 10px);
70        right: 0;
71        background: var(--sl-color-bg);
72        border: 1px solid var(--sl-color-gray-5);
73        border-radius: 0.5rem;
74        box-shadow: var(--sl-shadow-md);
75        min-width: 180px;
76        opacity: 0;
77        visibility: hidden;
78        transform: translateY(-10px);
79        transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
80        z-index: 1000;
81        padding: 4px;
82      }
83      
84      .contextual-dropdown-menu.show {
85        opacity: 1;
86        visibility: visible;
87        transform: translateY(0);
88      }
89      
90      .contextual-menu-item {
91        display: flex;
92        align-items: center;
93        padding: 8px 12px;
94        color: var(--sl-color-text);
95        text-decoration: none;
96        font-size: 14px;
97        line-height: 1.5;
98        gap: 8px;
99        border-radius: 0.5rem;
100        border: none;
101        background: transparent;
102        width: 100%;
103        text-align: left;
104        cursor: pointer;
105        font-family: inherit;
106      }
107      
108      .contextual-menu-item:hover {
109        background: var(--sl-color-hairline-light);
110      }
111      
112      .contextual-menu-item svg {
113        width: 16px;
114        height: 16px;
115        flex-shrink: 0;
116      }
117      
118        /* Mobile responsive */
119        @media (max-width: 72rem) {
120          .contextual-menu-parent {
121            flex-direction: column;
122          }
123
124          .contextual-menu-container {
125            margin-left: 0;
126          }
127          
128          .contextual-dropdown-menu {
129            left: 0;
130            right: auto;
131          }
132        }
133    `,document.head.appendChild(d);let u=!1;const L=()=>{u=!u,s.classList.toggle("show",u),l.ariaExpanded=u.toString()},w=()=>{u=!1,s.classList.remove("show"),l.ariaExpanded="false"};return l.addEventListener("click",a=>{a.stopPropagation(),L()}),document.addEventListener("click",a=>{r.contains(a.target)||w()}),()=>{r.parentNode&&r.parentNode.removeChild(r),d.parentNode&&d.parentNode.removeChild(d)}})}B({actions:["copy","view","chatgpt","claude"]});E();export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.