Files
mats 193e6c6e39
Build and Publish / Metadata (push) Successful in 4s
Build and Publish / BuildAndPushAmd64 (push) Failing after 1m27s
update rum
2026-11-04 13:04:34 +01:00

2 lines
9.0 KiB
JavaScript

"use strict";(()=>{(function(u){"use strict";var X="https://otel.k6n.net",S=document.currentScript;function i(o){return S&&S.getAttribute(o)||""}function G(o){var k=String(o).toLowerCase().split("+"),p={key:k.pop(),alt:!1,shift:!1,ctrl:!1,meta:!1};return k.forEach(function(l){l==="alt"||l==="option"?p.alt=!0:l==="shift"?p.shift=!0:l==="ctrl"||l==="control"?p.ctrl=!0:(l==="meta"||l==="cmd")&&(p.meta=!0)}),p}function A(o={}){if(o=o||{},u.OtelTodo&&u.OtelTodo.instance)return u.OtelTodo.instance;var k=(o.baseUrl||i("data-base-url")||X).replace(/\/+$/,""),p=o.endpoint||i("data-todo-endpoint")||k+"/v1/todos",l=o.serviceName||i("data-service-name")||i("data-service")||"frontend",K=o.ingestKey||i("data-ingest-key"),h=G(o.shortcut||i("data-shortcut")||"alt+shift+t"),Y=o.hideButton||i("data-hide-button")==="true",M=o.components||i("data-components").split(",");M=M.map(function(e){return e.trim()}).filter(Boolean);var D=(o.consent||i("data-consent"))==="granted"?"granted":"denied";function N(){return o.getConsent?o.getConsent():D}function _(e){D=e==="granted"?"granted":"denied"}var q=document.createElement("style");q.textContent='.otel-todo-btn{position:fixed;right:16px;bottom:16px;z-index:2147483646;width:32px;height:32px;border-radius:50%;border:1px solid #8886;background:#fffd;color:#333;font:16px/1 system-ui,sans-serif;cursor:pointer;opacity:.55;padding:0}.otel-todo-btn:hover,.otel-todo-btn:focus-visible{opacity:1}dialog.otel-todo{position:fixed;inset:auto 16px 60px auto;margin:0;width:min(340px,calc(100vw - 32px));padding:12px;border:1px solid #8886;border-radius:8px;background:Canvas;color:CanvasText;font:13px system-ui,sans-serif}dialog.otel-todo *{box-sizing:border-box;font:inherit}dialog.otel-todo textarea,dialog.otel-todo select{display:block;width:100%;margin:6px 0;padding:6px}dialog.otel-todo textarea{min-height:90px;resize:vertical}dialog.otel-todo .row{display:flex;gap:8px;justify-content:flex-end;align-items:center}dialog.otel-todo .meta{opacity:.65;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}dialog.otel-todo .status{margin-right:auto;font-size:12px}.otel-todo-pick{display:inline-flex;align-items:center;gap:5px;border:1px solid #8886;border-radius:6px;background:transparent;color:inherit;padding:5px 8px;margin:0 0 6px;cursor:pointer;font-size:12px}.otel-todo-pick:hover,.otel-todo-pick:focus-visible{background:#8882}.otel-todo-pick[aria-pressed="true"]{background:#3b82f633;border-color:#3b82f6aa;color:#3b82f6}.otel-todo-ref{display:none;align-items:center;gap:6px;margin:0 0 6px;padding:5px 7px;border:1px solid #8886;border-radius:6px;background:#8881;font:11px/1.3 ui-monospace,monospace}.otel-todo-ref.show{display:flex}.otel-todo-ref span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.otel-todo-ref button{border:0;background:none;cursor:pointer;color:inherit;opacity:.6;font:12px/1 inherit;padding:0 2px}.otel-todo-ref button:hover{opacity:1}.otel-todo-hover-outline{position:fixed;z-index:2147483645;pointer-events:none;border:2px solid #3b82f6;background:#3b82f626;border-radius:3px;transition:all .05s linear}.otel-todo-pick-hint{position:fixed;left:50%;top:16px;transform:translateX(-50%);z-index:2147483647;background:#3b82f6;color:#fff;font:12px/1 system-ui,sans-serif;padding:7px 12px;border-radius:20px;box-shadow:0 4px 14px #0004}',document.head.appendChild(q);var a=document.createElement("dialog");a.className="otel-todo",a.setAttribute("aria-label","Add todo"),a.innerHTML='<form method="dialog"><div class="meta"></div><button type="button" class="otel-todo-pick" aria-pressed="false">\u2316 Reference an element</button><div class="otel-todo-ref"><span></span><button type="button" data-clear-ref aria-label="Remove reference">\u2715</button></div><textarea name="text" placeholder="What needs doing?" required maxlength="4000"></textarea><select name="component" aria-label="Component (optional)"></select><div class="row"><span class="status" role="status"></span><button type="button" data-cancel>Cancel</button><button type="submit">Add</button></div></form>';var s=a.firstElementChild,C=s.elements.namedItem("text"),g=s.elements.namedItem("component"),H=s.querySelector(".status"),J=s.querySelector(".meta"),b=s.querySelector(".otel-todo-pick"),L=s.querySelector(".otel-todo-ref"),O=L.querySelector("span");document.body.appendChild(a);var y=null,f=null,E=!1,m=null;function W(e){if(!(e instanceof Element))return"";for(var n=[],t=e;t&&t.nodeType===1&&n.length<6;){if(t.id){n.unshift("#"+CSS.escape(t.id));break}var r=t.tagName.toLowerCase(),d=(t.getAttribute("class")||"").trim().split(/\s+/).filter(Boolean).slice(0,2);d.length&&(r+="."+d.map(function(B){return CSS.escape(B)}).join("."));var c=t.parentElement;if(c){var Z=t.tagName,U=Array.from(c.children).filter(function(B){return B.tagName===Z});U.length>1&&(r+=":nth-of-type("+(U.indexOf(t)+1)+")")}n.unshift(r),t=c}return n.join(" > ")}function $(e){var n=e.tagName.toLowerCase(),t=(e.getAttribute("aria-label")||e.textContent||"").replace(/\s+/g," ").trim();return t.length>60&&(t=t.slice(0,60)+"\u2026"),{selector:W(e),label:t?n+' \u2013 "'+t+'"':n}}function w(e){y=e,e?(O.textContent=e.label,O.title=e.selector,L.classList.add("show")):L.classList.remove("show")}function z(){return f||(f=document.createElement("div"),f.className="otel-todo-hover-outline",document.body.appendChild(f)),f}function R(e){var n=document.elementFromPoint(e.clientX,e.clientY);if(!n||a.contains(n)){z().style.display="none";return}var t=n.getBoundingClientRect(),r=z();r.style.display="block",r.style.left=t.left+"px",r.style.top=t.top+"px",r.style.width=t.width+"px",r.style.height=t.height+"px"}function I(e){var n=document.elementFromPoint(e.clientX,e.clientY);!n||a.contains(n)||(e.preventDefault(),e.stopPropagation(),w($(n)),T())}function j(e){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())}function Q(){E||(E=!0,b.setAttribute("aria-pressed","true"),b.textContent="\u2316 Click an element\u2026 (Esc to cancel)",m=document.createElement("div"),m.className="otel-todo-pick-hint",m.textContent="Click the element you mean \u2014 Esc to cancel",document.body.appendChild(m),document.addEventListener("mousemove",R,!0),document.addEventListener("click",I,!0),document.addEventListener("keydown",j,!0))}function T(){E&&(E=!1,b.setAttribute("aria-pressed","false"),b.textContent="\u2316 Reference an element",document.removeEventListener("mousemove",R,!0),document.removeEventListener("click",I,!0),document.removeEventListener("keydown",j,!0),f&&(f.style.display="none"),m&&(m.remove(),m=null))}b.addEventListener("click",function(){E?T():Q()}),L.querySelector("[data-clear-ref]").addEventListener("click",function(){w(null)});function V(){var e={},n=[];return M.concat(Array.from(document.querySelectorAll("[data-component]"),function(t){return t.getAttribute("data-component")||""})).forEach(function(t){t&&!e[t]&&(e[t]=!0,n.push(t))}),n}function P(){if(a.open){C.focus();return}g.innerHTML="";var e=document.createElement("option");e.value="",e.textContent="No component",g.appendChild(e);var n=V();n.forEach(function(t){var r=document.createElement("option");r.value=r.textContent=t,g.appendChild(r)}),g.hidden=n.length===0,J.textContent=l+" \xB7 "+location.pathname+location.hash,H.textContent="",w(null),a.show(),C.focus()}function x(){T(),a.open&&a.close()}if(s.querySelector("[data-cancel]").addEventListener("click",x),a.addEventListener("keydown",function(e){e.key==="Escape"?(e.preventDefault(),x()):e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),s.requestSubmit())}),s.addEventListener("submit",function(e){e.preventDefault();var n=C.value.trim();if(n){var t={"Content-Type":"application/json"},r=p;K&&(t["X-Otel-Ingest-Key"]=K);var d=N()==="granted";H.textContent="Sending\u2026",u.fetch(r,{method:"POST",mode:"cors",credentials:"omit",referrerPolicy:"no-referrer",headers:t,body:JSON.stringify({project:l,text:n,component:g.value,path:d?location.pathname:"",hash:d?location.hash:"",url:d?location.href:"",ua:d?navigator.userAgent:"",session:d&&o.getSessionId?o.getSessionId():"",elementSelector:y?y.selector:"",elementLabel:y?y.label:""})}).then(function(c){if(!c.ok)throw new Error("HTTP "+c.status);C.value="",w(null),x()}).catch(function(c){H.textContent="Failed: "+c.message})}}),u.addEventListener("keydown",function(e){var n=e.key.toLowerCase(),t=(e.code||"").replace(/^(Key|Digit)/,"").toLowerCase();(n===h.key||t===h.key)&&e.altKey===h.alt&&e.shiftKey===h.shift&&e.ctrlKey===h.ctrl&&e.metaKey===h.meta&&(e.preventDefault(),a.open?x():P())}),!Y){var v=document.createElement("button");v.type="button",v.className="otel-todo-btn",v.textContent="\u270E",v.title="Add todo ("+(o.shortcut||i("data-shortcut")||"alt+shift+t")+")",v.setAttribute("aria-label","Add todo"),v.addEventListener("click",function(){a.open?x():P()}),document.body.appendChild(v)}var F={open:P,close:x,getConsent:N,setConsent:_};return u.OtelTodo.instance=F,F}u.OtelTodo={init:A,instance:void 0},S&&(i("data-auto-init")==="true"||i("data-service-name")||i("data-service"))&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){A()}):A())})(window);})();