Files
USB4VC/resources/IBM PC AT Keyboard Protocol · tmk_tmk_keyboard Wiki_files/2734-65217094b11f.js
2022-05-18 23:34:29 +01:00

3 lines
8.0 KiB
JavaScript

"use strict";(()=>{var H=Object.defineProperty;var n=(C,_)=>H(C,"name",{value:_,configurable:!0});(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[2734],{3447:(C,_,A)=>{A.d(_,{D:()=>b,P:()=>k});var y=A(46263);function k(d=0,i={}){return(l,g,u)=>{if(!u||typeof u.value!="function")throw new Error("debounce can only decorate functions");const m=u.value;u.value=(0,y.P)(m,d,i),Object.defineProperty(l,g,u)}}n(k,"throttle");function b(d=0,i={}){return(l,g,u)=>{if(!u||typeof u.value!="function")throw new Error("debounce can only decorate functions");const m=u.value;u.value=(0,y.D)(m,d,i),Object.defineProperty(l,g,u)}}n(b,"debounce")},46263:(C,_,A)=>{A.d(_,{D:()=>k,P:()=>y});function y(b,d=0,{start:i=!0,middle:l=!0,once:g=!1}={}){let u=0,m,E=!1;function T(...L){if(E)return;const M=Date.now()-u;u=Date.now(),i?(i=!1,b.apply(this,L),g&&T.cancel()):(l&&M<d||!l)&&(clearTimeout(m),m=setTimeout(()=>{u=Date.now(),b.apply(this,L),g&&T.cancel()},l?d-M:d))}return n(T,"fn"),T.cancel=()=>{clearTimeout(m),E=!0},T}n(y,"throttle");function k(b,d=0,{start:i=!1,middle:l=!1,once:g=!1}={}){return y(b,d,{start:i,middle:l,once:g})}n(k,"debounce")},65935:(C,_,A)=>{A.d(_,{AC:()=>E,rK:()=>m,uT:()=>u});function y(r,o){const a=r.createElement("template");return a.innerHTML=o,r.importNode(a.content,!0)}n(y,"parseHTML");function k(r){const o=new URLSearchParams,a=new FormData(r).entries();for(const[p,h]of[...a])o.append(p,h.toString());return o.toString()}n(k,"serialize");class b extends Error{constructor(o,a){super(o);this.response=a}}n(b,"ErrorWithResponse");function d(){let r,o;return[new Promise(function(p,h){r=p,o=h}),r,o]}n(d,"makeDeferred");let i;const l=[],g=[];function u(r){l.push(r)}n(u,"afterRemote");function m(r){g.push(r)}n(m,"beforeRemote");function E(r,o){i||(i=new Map,document.addEventListener("submit",M));const a=i.get(r)||[];i.set(r,[...a,o])}n(E,"remoteForm");function T(r,o){if(i){const a=i.get(r)||[];i.set(r,a.filter(p=>p!==o))}}n(T,"remoteUninstall");function L(r){const o=[];for(const a of i.keys())if(r.matches(a)){const p=i.get(a)||[];o.push(...p)}return o}n(L,"getMatches");function M(r){if(!(r.target instanceof HTMLFormElement))return;const o=r.target,a=L(o);if(a.length===0)return;const p=N(o),[h,S,$]=d();r.preventDefault(),D(a,o,p,h).then(async P=>{if(P){for(const R of g)await R(o);x(p).then(S,$).catch(()=>{}).then(()=>{for(const R of l)R(o)})}else o.submit()},P=>{o.submit(),setTimeout(()=>{throw P})})}n(M,"handleSubmit");async function D(r,o,a,p){let h=!1;for(const S of r){const[$,P]=d(),R=n(()=>(h=!0,P(),p),"kick"),O={text:R,json:()=>(a.headers.set("Accept","application/json"),R()),html:()=>(a.headers.set("Accept","text/html"),R())};await Promise.race([$,S(o,O,a)])}return h}n(D,"processHandlers");function N(r){const o={method:r.method||"GET",url:r.action,headers:new Headers({"X-Requested-With":"XMLHttpRequest"}),body:null};if(o.method.toUpperCase()==="GET"){const a=k(r);a&&(o.url+=(~o.url.indexOf("?")?"&":"?")+a)}else o.body=new FormData(r);return o}n(N,"buildRequest");async function x(r){const o=await window.fetch(r.url,{method:r.method,body:r.body!==null?r.body:void 0,headers:r.headers,credentials:"same-origin"}),a={url:o.url,status:o.status,statusText:o.statusText,headers:o.headers,text:"",get json(){const h=this,S=JSON.parse(h.text);return delete h.json,h.json=S,h.json},get html(){const h=this;return delete h.html,h.html=y(document,h.text),h.html}},p=await o.text();if(a.text=p,o.ok)return a;throw new b("request failed",a)}n(x,"remoteSubmit")},90420:(C,_,A)=>{A.d(_,{Lj:()=>r,Ih:()=>O,P4:()=>E,fA:()=>L,GO:()=>M});const y=new WeakSet;function k(t){y.add(t),t.shadowRoot&&b(t.shadowRoot),l(t),i(t.ownerDocument)}n(k,"bind");function b(t){l(t),i(t)}n(b,"bindShadow");const d=new WeakMap;function i(t=document){if(d.has(t))return d.get(t);let e=!1;const s=new MutationObserver(f=>{for(const w of f)if(w.type==="attributes"&&w.target instanceof Element)m(w.target);else if(w.type==="childList"&&w.addedNodes.length)for(const v of w.addedNodes)v instanceof Element&&l(v)});s.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const c={get closed(){return e},unsubscribe(){e=!0,d.delete(t),s.disconnect()}};return d.set(t,c),c}n(i,"listenForBind");function l(t){for(const e of t.querySelectorAll("[data-action]"))m(e);t instanceof Element&&t.hasAttribute("data-action")&&m(t)}n(l,"bindElements");function g(t){const e=t.currentTarget;for(const s of u(e))if(t.type===s.type){const c=e.closest(s.tag);y.has(c)&&typeof c[s.method]=="function"&&c[s.method](t);const f=e.getRootNode();if(f instanceof ShadowRoot&&y.has(f.host)&&f.host.matches(s.tag)){const w=f.host;typeof w[s.method]=="function"&&w[s.method](t)}}}n(g,"handleEvent");function*u(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const s=e.lastIndexOf(":"),c=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,s),tag:e.slice(s+1,c),method:e.slice(c+1)||"handleEvent"}}}n(u,"bindings");function m(t){for(const e of u(t))t.addEventListener(e.type,g)}n(m,"bindActions");function E(t,e){const s=t.tagName.toLowerCase();if(t.shadowRoot){for(const c of t.shadowRoot.querySelectorAll(`[data-target~="${s}.${e}"]`))if(!c.closest(s))return c}for(const c of t.querySelectorAll(`[data-target~="${s}.${e}"]`))if(c.closest(s)===t)return c}n(E,"findTarget");function T(t,e){const s=t.tagName.toLowerCase(),c=[];if(t.shadowRoot)for(const f of t.shadowRoot.querySelectorAll(`[data-targets~="${s}.${e}"]`))f.closest(s)||c.push(f);for(const f of t.querySelectorAll(`[data-targets~="${s}.${e}"]`))f.closest(s)===t&&c.push(f);return c}n(T,"findTargets");function L(t,e){return Object.defineProperty(t,e,{configurable:!0,get(){return E(this,e)}})}n(L,"target");function M(t,e){return Object.defineProperty(t,e,{configurable:!0,get(){return T(this,e)}})}n(M,"targets");function D(t){const e=t.name.replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/(^-|-Element$)/g,"").toLowerCase();window.customElements.get(e)||(window[t.name]=t,window.customElements.define(e,t))}n(D,"register");function N(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:e.getAttribute("data-shadowroot")==="closed"?"closed":"open"}).append(e.content.cloneNode(!0))}n(N,"autoShadowRoot");const x=new WeakMap;function r(t,e){x.has(t)||x.set(t,[]),x.get(t).push(e)}n(r,"attr");function o(t,e){e||(e=a(Object.getPrototypeOf(t)));for(const s of e){const c=t[s],f=p(s);let w={configurable:!0,get(){return this.getAttribute(f)||""},set(v){this.setAttribute(f,v||"")}};typeof c=="number"?w={configurable:!0,get(){return Number(this.getAttribute(f)||0)},set(v){this.setAttribute(f,v)}}:typeof c=="boolean"&&(w={configurable:!0,get(){return this.hasAttribute(f)},set(v){this.toggleAttribute(f,v)}}),Object.defineProperty(t,s,w),s in t&&!t.hasAttribute(f)&&w.set.call(t,c)}}n(o,"initializeAttrs");function a(t){const e=new Set;let s=t;for(;s&&s!==HTMLElement;){const c=x.get(s)||[];for(const f of c)e.add(f);s=Object.getPrototypeOf(s)}return e}n(a,"getAttrNames");function p(t){return`data-${t.replace(/([A-Z]($|[a-z]))/g,"-$1")}`.replace(/--/g,"-").toLowerCase()}n(p,"attrToAttributeName");function h(t){let e=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return[...a(t.prototype)].map(p).concat(e)},set(s){e=s}})}n(h,"defineObservedAttributes");const S=new WeakSet;function $(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),S.add(t),N(t),o(t),k(t),e&&e.call(t),t.shadowRoot&&b(t.shadowRoot)}n($,"initializeInstance");function P(t){h(t),D(t)}n(P,"initializeClass");function R(t){return S.has(t)}n(R,"initialized");function O(t){const e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){$(this,e)},P(t)}n(O,"controller")},15205:(C,_,A)=>{A.d(_,{Z:()=>k});function y(...b){return JSON.stringify(b,(d,i)=>typeof i=="object"?i:String(i))}n(y,"defaultHash");function k(b,d={}){const{hash:i=y,cache:l=new Map}=d;return function(...g){const u=i.apply(this,g);if(l.has(u))return l.get(u);let m=b.apply(this,g);return m instanceof Promise&&(m=m.catch(E=>{throw l.delete(u),E})),l.set(u,m),m}}n(k,"memoize")}}]);})();
//# sourceMappingURL=2734-6de2ef0b9f96.js.map