vendor: 6,656 bytes, line 1
1(()=>{function b(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function g(){document.addEventListener("invoke",t=>{t.type=="invoke"&&t.isTrusted&&(t.stopImmediatePropagation(),t.preventDefault())},!0),document.addEventListener("command",t=>{t.type=="command"&&t.isTrusted&&(t.stopImmediatePropagation(),t.preventDefault())},!0);function v(t,o,e=!0){Object.defineProperty(t,o,{...Object.getOwnPropertyDescriptor(t,o),enumerable:e})}function s(t){return t&&typeof t.getRootNode=="function"?t.getRootNode():t&&t.parentNode?s(t.parentNode):t}let u=new WeakMap,l=new WeakMap;class m extends Event{constructor(o,e={}){super(o,e);let{source:n,command:r}=e;if(n!=null&&!(n instanceof Element))throw new TypeError("source must be an element");u.set(this,n||null),l.set(this,r!==void 0?String(r):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!u.has(this))throw new TypeError("illegal invocation");let o=u.get(this);if(!(o instanceof Element))return null;let e=s(o);return e!==s(this.target||document)?e.host:o}get command(){if(!l.has(this))throw new TypeError("illegal invocation");return l.get(this)}get action(){throw new Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw new Error("CommandEvent#invoker was renamed to CommandEvent#source")}}v(m.prototype,"source"),v(m.prototype,"command");class E extends Event{constructor(o,e={}){throw super(o,e),new Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}let c=new WeakMap;function y(t){Object.defineProperties(t.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(o){if(this.hasAttribute("invokeaction"))throw new TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw new TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(o===null)this.removeAttribute("commandfor"),c.delete(this);else if(o instanceof Element){this.setAttribute("commandfor","");let e=s(o);s(this)===e||e===this.ownerDocument?c.set(this,o):c.delete(this)}else throw new TypeError("commandForElement must be an element or null")},get(){if(this.localName!=="button")return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute("type")!=="button")return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let o=c.get(this);if(o)return o.isConnected?o:(c.delete(this),null);let e=s(this),n=this.getAttribute("commandfor");return(e instanceof Document||e instanceof ShadowRoot)&&n&&e.getElementById(n)||null}},command:{enumerable:!0,configurable:!0,get(){let o=this.getAttribute("command")||"";if(o.startsWith("--"))return o;let e=o.toLowerCase();switch(e){case"show-modal":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return e}return""},set(o){this.setAttribute("command",o)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw new Error("invokeAction is deprecated. It has been renamed to command")},set(o){throw new Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")},set(o){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")}}})}let h=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return p.takeRecords(),h.get(this)||null},set(t){let o=h.get(this)||null;o&&this.removeEventListener("command",o),h.set(this,typeof t=="object"||typeof t=="function"?t:null),typeof t=="function"&&this.addEventListener("command",t)}}});function d(t){for(let o of t)o.oncommand=new Function("event",o.getAttribute("oncommand"))}let p=new MutationObserver(t=>{for(let o of t){let{target:e}=o;o.type==="childList"?d(e.querySelectorAll("[oncommand]")):d([e])}});p.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),d(document.querySelectorAll("[oncommand]"));function k(t){if(t.defaultPrevented||t.type!=="click")return;let o=t.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(o&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),o.matches("input")))throw new Error("Input elements no longer support `commandfor`");let e=t.target.closest("button[commandfor], button[command]");if(!e)return;if(e.form&&e.getAttribute("type")!=="button")throw t.preventDefault(),new Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(e.hasAttribute("command")!==e.hasAttribute("commandfor")){let i=e.hasAttribute("command")?"command":"commandfor",f=e.hasAttribute("command")?"commandfor":"command";throw new Error(`Element with ${i} attribute must also have a ${f} attribute to function.`)}if(e.command!=="show-popover"&&e.command!=="hide-popover"&&e.command!=="toggle-popover"&&e.command!=="show-modal"&&e.command!=="close"&&!e.command.startsWith("--")){console.warn(`"${e.command}" is not a valid command value. Custom commands must begin with --`);return}let n=e.commandForElement;if(!n)return;let r=new m("command",{command:e.command,source:e,cancelable:!0});if(n.dispatchEvent(r),r.defaultPrevented)return;let a=r.command.toLowerCase();if(n.popover){let i=!n.matches(":popover-open");i&&(a==="toggle-popover"||a==="show-popover")?n.showPopover({source:e}):!i&&a==="hide-popover"&&n.hidePopover()}else if(n.localName==="dialog"){let i=!n.hasAttribute("open");i&&a==="show-modal"?n.showModal():!i&&a==="close"&&n.close()}}function w(t){t.addEventListener("click",k,!0)}function A(t,o){let e=t.prototype.attachShadow;t.prototype.attachShadow=function(r){let a=e.call(this,r);return o(a),a};let n=t.prototype.attachInternals;t.prototype.attachInternals=function(){let r=n.call(this);return r.shadowRoot&&o(r.shadowRoot),r}}y(HTMLButtonElement),A(HTMLElement,t=>{w(t),p.observe(t,{attributeFilter:["oncommand"]}),d(t.querySelectorAll("[oncommand]"))}),w(document),Object.assign(globalThis,{CommandEvent:m,InvokeEvent:E})}b()||g();})();
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.