@web-applets/inspector 0.1.3 → 0.2.0-alpha.9
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.
- package/package.json +6 -4
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -41
- package/dist/web/assets/index-BMFi0b0p.css +0 -1
- package/dist/web/assets/index-BdJJtosA.js +0 -266
- package/dist/web/assets/index-DspZGt9g.js +0 -105
- package/dist/web/assets/index-jnfTLibk.js +0 -105
- package/dist/web/assets/index-nmk_tQAS.css +0 -1
- package/dist/web/assets/index-yhX0n5W9.css +0 -1
- package/dist/web/index.html +0 -13
@@ -1,105 +0,0 @@
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function e(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=e(i);fetch(i.href,r)}})();/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2019 Google LLC
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
-
*/const W=globalThis,ct=W.ShadowRoot&&(W.ShadyCSS===void 0||W.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xt=Symbol(),ft=new WeakMap;let It=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==xt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ct&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=ft.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&ft.set(e,t))}return t}toString(){return this.cssText}};const Ft=n=>new It(typeof n=="string"?n:n+"",void 0,xt),Wt=(n,t)=>{if(ct)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=W.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},mt=ct?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Ft(e)})(n):n;/**
|
6
|
-
* @license
|
7
|
-
* Copyright 2017 Google LLC
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
-
*/const{is:qt,defineProperty:Bt,getOwnPropertyDescriptor:Jt,getOwnPropertyNames:Vt,getOwnPropertySymbols:Gt,getPrototypeOf:Kt}=Object,v=globalThis,$t=v.trustedTypes,Zt=$t?$t.emptyScript:"",tt=v.reactiveElementPolyfillSupport,T=(n,t)=>n,K={toAttribute(n,t){switch(t){case Boolean:n=n?Zt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},ht=(n,t)=>!qt(n,t),yt={attribute:!0,type:String,converter:K,reflect:!1,hasChanged:ht};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=yt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Bt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=Jt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const l=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yt}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Kt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...Vt(e),...Gt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(mt(i))}else t!==void 0&&e.push(mt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:K).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:K;this._$Em=i,this[i]=l.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??ht)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[T("elementProperties")]=new Map,S[T("finalized")]=new Map,tt==null||tt({ReactiveElement:S}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.0.4");/**
|
10
|
-
* @license
|
11
|
-
* Copyright 2017 Google LLC
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
13
|
-
*/const M=globalThis,Z=M.trustedTypes,_t=Z?Z.createPolicy("lit-html",{createHTML:n=>n}):void 0,Rt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,Ut="?"+_,Qt=`<${Ut}>`,A=document,H=()=>A.createComment(""),D=n=>n===null||typeof n!="object"&&typeof n!="function",dt=Array.isArray,Xt=n=>dt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",et=`[
|
14
|
-
\f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,gt=/>/g,g=RegExp(`>|${et}(?:([^\\s"'>=/]+)(${et}*=${et}*(?:[^
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),wt=/'/g,bt=/"/g,Tt=/^(?:script|style|textarea|title)$/i,Yt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),$=Yt(1),P=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),At=new WeakMap,w=A.createTreeWalker(A,129);function Mt(n,t){if(!dt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return _t!==void 0?_t.createHTML(t):t}const kt=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":t===3?"<math>":"",o=R;for(let l=0;l<e;l++){const a=n[l];let d,h,c=-1,m=0;for(;m<a.length&&(o.lastIndex=m,h=o.exec(a),h!==null);)m=o.lastIndex,o===R?h[1]==="!--"?o=vt:h[1]!==void 0?o=gt:h[2]!==void 0?(Tt.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=g):h[3]!==void 0&&(o=g):o===g?h[0]===">"?(o=i??R,c=-1):h[1]===void 0?c=-2:(c=o.lastIndex-h[2].length,d=h[1],o=h[3]===void 0?g:h[3]==='"'?bt:wt):o===bt||o===wt?o=g:o===vt||o===gt?o=R:(o=g,i=void 0);const y=o===g&&n[l+1].startsWith("/>")?" ":"";r+=o===R?a+Qt:c>=0?(s.push(d),a.slice(0,c)+Rt+a.slice(c)+_+y):a+_+(c===-2?l:y)}return[Mt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class L{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const l=t.length-1,a=this.parts,[d,h]=kt(t,e);if(this.el=L.createElement(d,s),w.currentNode=this.el.content,e===2||e===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=w.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const c of i.getAttributeNames())if(c.endsWith(Rt)){const m=h[o++],y=i.getAttribute(c).split(_),F=/([.?@])?(.*)/.exec(m);a.push({type:1,index:r,name:F[2],strings:y,ctor:F[1]==="."?ee:F[1]==="?"?se:F[1]==="@"?ie:Y}),i.removeAttribute(c)}else c.startsWith(_)&&(a.push({type:6,index:r}),i.removeAttribute(c));if(Tt.test(i.tagName)){const c=i.textContent.split(_),m=c.length-1;if(m>0){i.textContent=Z?Z.emptyScript:"";for(let y=0;y<m;y++)i.append(c[y],H()),w.nextNode(),a.push({type:2,index:++r});i.append(c[m],H())}}}else if(i.nodeType===8)if(i.data===Ut)a.push({type:2,index:r});else{let c=-1;for(;(c=i.data.indexOf(_,c+1))!==-1;)a.push({type:7,index:r}),c+=_.length-1}r++}}static createElement(t,e){const s=A.createElement("template");return s.innerHTML=t,s}}function C(n,t,e=n,s){var o,l;if(t===P)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=D(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=C(n,i._$AS(n,t.values),i,s)),t}class te{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??A).importNode(e,!0);w.currentNode=i;let r=w.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new I(r,r.nextSibling,this,t):a.type===1?d=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(d=new ne(r,this,t)),this._$AV.push(d),a=s[++l]}o!==(a==null?void 0:a.index)&&(r=w.nextNode(),o++)}return w.currentNode=A,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class I{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),D(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Xt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=L.createElement(Mt(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(e);else{const o=new te(i,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=At.get(t.strings);return e===void 0&&At.set(t.strings,e=new L(t)),e}k(t){dt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new I(this.O(H()),this.O(H()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Y{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=C(this,t,e,0),o=!D(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const l=t;let a,d;for(t=r[0],a=0;a<r.length-1;a++)d=C(this,l[s+a],e,a),d===P&&(d=this._$AH[a]),o||(o=!D(d)||d!==this._$AH[a]),d===p?t=p:t!==p&&(t+=(d??"")+r[a+1]),this._$AH[a]=d}o&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ee extends Y{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class se extends Y{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class ie extends Y{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??p)===P)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ne{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}}const st=M.litHtmlPolyfillSupport;st==null||st(L,I),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.2.1");const re=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new I(t.insertBefore(H(),r),r,void 0,e??{})}return i._$AI(n),i};/**
|
16
|
-
* @license
|
17
|
-
* Copyright 2017 Google LLC
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
19
|
-
*/let u=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=re(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}};var Ot;u._$litElement$=!0,u.finalized=!0,(Ot=globalThis.litElementHydrateSupport)==null||Ot.call(globalThis,{LitElement:u});const it=globalThis.litElementPolyfillSupport;it==null||it({LitElement:u});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
20
|
-
* @license
|
21
|
-
* Copyright 2017 Google LLC
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
23
|
-
*/const O=n=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(n,t)}):customElements.define(n,t)};/**
|
24
|
-
* @license
|
25
|
-
* Copyright 2017 Google LLC
|
26
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
27
|
-
*/const oe={attribute:!0,type:String,converter:K,reflect:!1,hasChanged:ht},ae=(n=oe,t,e)=>{const{kind:s,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(e.name,n),s==="accessor"){const{name:o}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(o,a,n)},init(l){return l!==void 0&&this.P(o,void 0,n),l}}}if(s==="setter"){const{name:o}=e;return function(l){const a=this[o];t.call(this,l),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+s)};function E(n){return(t,e)=>typeof e=="object"?ae(n,t,e):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,t,e)}let b={appletUrl:""};localStorage.getItem("data")&&(b=JSON.parse(localStorage.getItem("data")));const pt=new Set;function le(n){b={...b,...n},localStorage.setItem("data",JSON.stringify({appletUrl:b.appletUrl})),pt.forEach(t=>t(b))}function ce(){return b}function he(n){return n(b),pt.add(n),()=>Nt(n)}function Nt(n){pt.delete(n)}const j={get:ce,update:le,subscribe:he,unsubscribe:Nt};var de=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,ue=(n,t,e,s)=>{for(var i=s>1?void 0:s?pe(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&de(t,e,i),i};let Et=class extends u{createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}handleKeyDown(t){if(t.key==="Enter"){const e=t.target;e.value&&!e.value.startsWith("http://")&&!e.value.startsWith("https://")&&(e.value=`http://${e.value}`),j.update({appletUrl:e.value})}}render(){return $`<input
|
28
|
-
value=${j.get().appletUrl}
|
29
|
-
type="text"
|
30
|
-
placeholder="Enter an applet URL to inspect..."
|
31
|
-
@keydown=${this.handleKeyDown.bind(this)}
|
32
|
-
/>`}};Et=ue([O("url-input")],Et);var fe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,$e=(n,t,e,s)=>{for(var i=s>1?void 0:s?me(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&fe(t,e,i),i};let St=class extends u{createRenderRoot(){return this}render(){return $`
|
33
|
-
<h1>Applet Inspector</h1>
|
34
|
-
<url-input></url-input>
|
35
|
-
`}};St=$e([O("app-header")],St);function q(n,t){if(!n)return"";try{t&&(t.match(/\.[a-zA-Z0-9]+$/)||(t=t.endsWith("/")?t:t+"/"));const e=new URL(n,t??window.location.href);return ye(e.href)}catch(e){return console.warn("Failed to parse URL:",e),n}}function ye(n){return n.endsWith("/")?n.slice(0,-1):n}async function _e(n){n=q(n);let t;try{const s=await(await fetch(n)).text(),l=new DOMParser().parseFromString(s,"text/html").querySelector('link[rel="manifest"]').getAttribute("href"),a=q(l,n);t=await(await fetch(a)).json(),t.icons=t.icons.map(h=>(h.src=q(h.src,n),h))}catch{return}return t}class Ht{constructor(t){this.target=t}async send(t,e){if(this.target.postMessage(t.toJson(),"*"),!(e&&e.resolves===!1))return new Promise(s=>{const i=r=>{const o=new f(r.data.type,r.data);o.type==="resolve"&&o.id===t.id&&(window.removeEventListener("message",i),s(o))};window.addEventListener("message",i)})}async on(t,e){const s=async i=>{if(i.source===window.self||i.data.type!==t||i.source!==this.target)return;const r=new f(i.data.type,i.data);await e(r);const o=new ve({id:r.id});this.send(o,{resolves:!1})};window.addEventListener("message",s)}}class f{constructor(t,e){this.timeStamp=Date.now(),this.type=t,this.id=crypto.randomUUID(),e&&Object.assign(this,e)}toJson(){return Object.fromEntries(Object.entries(this).filter(([t,e])=>{try{return JSON.stringify(e),!0}catch{return!1}}))}}class ve extends f{constructor({id:t}){super("resolve"),this.id=t}}class ge extends f{constructor({actions:t}){super("actions"),this.actions=t}}class we extends f{constructor({data:t}){super("data"),this.data=t}}class be extends f{constructor(){super("ready")}}class Ae extends f{constructor({actionId:t,params:e}){super("action"),this.actionId=t,this.params=e}}class Ee extends f{constructor(){super("init")}}class Dt extends Event{constructor({data:t}){super("data",{bubbles:!1,cancelable:!1,composed:!1}),this.data=t}}class Lt extends Event{constructor(){super("ready",{bubbles:!1,cancelable:!1,composed:!1})}}class Se extends Event{constructor(){super("load",{bubbles:!1,cancelable:!1,composed:!1})}}class Pe extends Event{constructor({actions:t}){super("actions",{bubbles:!1,cancelable:!1,composed:!1}),this.actions=t}}class Ce extends Event{constructor({dimensions:t}){super("resize",{bubbles:!1,cancelable:!1,composed:!1}),this.dimensions=t}}var at=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},nt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},lt,B,N,jt;const ut=document.createElement("iframe");ut.style.display="none";document.body.appendChild(ut);async function Oe(n,t){t||(t=ut),n=q(n);const e=await _e(n);t.setAttribute("sandbox","allow-scripts allow-forms allow-same-origin"),t.src=n;const s=new xe(e,t.contentWindow);return new Promise(i=>{s.onready=()=>i(s)})}class xe extends EventTarget{constructor(t,e){super(),lt.add(this),this.actions=[],B.set(this,void 0),N.set(this,void 0),this.messageRelay=new Ht(e),at(this,B,t,"f"),nt(this,lt,"m",jt).call(this),this.messageRelay.on("ready",()=>{this.messageRelay.send(new Ee)})}async dispatchAction(t,e){const s=new Ae({actionId:t,params:e});return await this.messageRelay.send(s)}get data(){return nt(this,N,"f")}set data(t){at(this,N,t,"f"),this.messageRelay.send(new we({data:t}))}get manifest(){return nt(this,B,"f")}onready(t){}onresize(t){}onactions(t){}ondata(t){}}B=new WeakMap,N=new WeakMap,lt=new WeakSet,jt=function(){this.messageRelay.on("ready",t=>{const e=new Lt;typeof this.onready=="function"&&this.onready(e),this.dispatchEvent(e)}),this.messageRelay.on("data",t=>{at(this,N,t.data,"f");const e=new Dt({data:t.data});typeof this.ondata=="function"&&this.ondata(e),this.dispatchEvent(e)}),this.messageRelay.on("resize",t=>{const e=new Ce({dimensions:t.dimensions});typeof this.onresize=="function"&&this.onresize(e),this.dispatchEvent(e)}),this.messageRelay.on("actions",t=>{this.actions=t.actions;const e=new Pe({actions:t.actions});typeof this.onactions=="function"&&this.onactions(e),this.dispatchEvent(e)})};var rt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Re=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},J,V;class Ue extends EventTarget{constructor(){super(),this.actionHandlers={},J.set(this,{}),V.set(this,void 0),this.connect()}connect(){this.messageRelay=new Ht(window.parent),document.readyState==="complete"||document.readyState==="interactive"?setTimeout(this.initialize.bind(this),1):window.addEventListener("DOMContentLoaded",this.initialize.bind(this)),this.attachListeners()}async initialize(){const t=document.querySelector('link[rel="manifest"]');if(!t)return;try{const r=await(await fetch(t.href)).json();this.manifest=r,this.actions=r.actions??[]}catch{return}const e=new Se;this.dispatchEvent(e),typeof this.onload=="function"&&await this.onload(e),this.messageRelay.send(new be);const s=new Lt;this.dispatchEvent(s),typeof this.onready=="function"&&this.onready(s),this.createResizeObserver()}createResizeObserver(){new ResizeObserver(e=>{for(let s of e){const i=new f("resize",{dimensions:{width:s.contentRect.width,height:s.contentRect.height}});this.messageRelay.send(i)}}).observe(document.querySelector("html"))}attachListeners(){this.messageRelay.on("init",t=>{var e;this.manifest=t.manifest,this.actions=((e=this.manifest)==null?void 0:e.actions)||[]}),this.messageRelay.on("data",t=>{this.setData(t.data)}),this.messageRelay.on("action",async t=>{Object.keys(this.actionHandlers).includes(t.actionId)&&await this.actionHandlers[t.actionId](t.params)})}setActionHandler(t,e){this.actionHandlers[t]=e}defineAction(t,e){const{handler:s,...i}=e;this.actions=[...this.actions,{id:t,...i}],this.setActionHandler(t,s)}set actions(t){if(t){for(let e of t)rt(this,J,"f")[e.id]=e;this.messageRelay.send(new ge({actions:this.actions}))}}get actions(){return Object.values(rt(this,J,"f"))}set data(t){this.setData(t)}get data(){return rt(this,V,"f")}async setData(t){const e=new f("data",{data:t});await this.messageRelay.send(e),Re(this,V,t,"f");const s=new Dt({data:t});this.dispatchEvent(s),this.ondata(s)}onload(t){}onready(t){}ondata(t){}}J=new WeakMap,V=new WeakMap;function Te(){return new Ue}const Me={load:Oe,getContext:Te};var Pt=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},ot=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},U,G;class zt extends HTMLElement{constructor(){super(...arguments),U.set(this,void 0),G.set(this,void 0)}connectedCallback(){Pt(this,U,this.attachShadow({mode:"open"}),"f"),this.container=document.createElement("iframe"),ot(this,U,"f").appendChild(this.container);const t=document.createElement("style");t.textContent=this.styles,ot(this,U,"f").appendChild(t);const e=this.getAttribute("src");e&&this.loadApplet(e)}set src(t){Pt(this,G,t,"f"),this.loadApplet(t)}get src(){return ot(this,G,"f")}attributeChangedCallback(t,e,s){t==="src"&&(this.src=s)}async loadApplet(t){this.container&&(this.applet=await Me.load(t,this.container),this.applet.ondata=e=>{this.dispatchEvent(e)},this.applet.onresize=e=>{this.resizeContainer(e.dimensions)},this.applet.onactions=e=>{},this.dispatchEvent(new Event("load")),this.loaded=!0)}set data(t){if(this.applet&&this.loaded)this.applet.data=t;else{const e=()=>{this.applet.data=t,this.removeEventListener("load",e)};this.addEventListener("load",e)}}resizeContainer(t){this.container.style.height=`${t.height+2}px`}get styles(){return`
|
36
|
-
:host {
|
37
|
-
display: flex;
|
38
|
-
flex-direction: column;
|
39
|
-
}
|
40
|
-
|
41
|
-
iframe {
|
42
|
-
border: none;
|
43
|
-
height: 100%;
|
44
|
-
width: 100%;
|
45
|
-
}
|
46
|
-
`}}U=new WeakMap,G=new WeakMap;zt.observedAttributes=["src"];customElements.define("applet-frame",zt);var Ne=Object.defineProperty,He=Object.getOwnPropertyDescriptor,k=(n,t,e,s)=>{for(var i=s>1?void 0:s?He(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&Ne(t,e,i),i};let z=class extends u{constructor(){super(...arguments),this.renderRoot=this,this.appletUrl="",this.mode="gui",this.data={}}connectedCallback(){j.subscribe(n=>{this.appletUrl=n.appletUrl}),super.connectedCallback()}updated(){const n=document.querySelector("applet-frame");n&&(n.onload=()=>{var t;console.log("onload",(t=window.applet)==null?void 0:t.data,this.data),j.update({applet:n.applet}),window.applet=n.applet,window.applet.ondata=e=>this.data=e.data})}render(){const n=$`<div class="applet-footer">
|
47
|
-
<label>View as:</label>
|
48
|
-
<div class="toggle">
|
49
|
-
<button
|
50
|
-
data-selected=${this.mode==="gui"}
|
51
|
-
@mousedown=${()=>this.mode="gui"}
|
52
|
-
>
|
53
|
-
GUI
|
54
|
-
</button>
|
55
|
-
<button
|
56
|
-
data-selected=${this.mode==="data"}
|
57
|
-
@mousedown=${()=>this.mode="data"}
|
58
|
-
>
|
59
|
-
Data
|
60
|
-
</button>
|
61
|
-
</div>
|
62
|
-
</div>`;return $`
|
63
|
-
<div class="container">
|
64
|
-
<applet-frame
|
65
|
-
src=${this.appletUrl}
|
66
|
-
class=${this.mode==="gui"?"":"hidden"}
|
67
|
-
></applet-frame>
|
68
|
-
<pre class=${this.mode==="gui"?"hidden":"data-view"}>
|
69
|
-
${JSON.stringify(this.data,null,2)}</pre
|
70
|
-
>
|
71
|
-
${n}
|
72
|
-
</div>
|
73
|
-
`}};k([E()],z.prototype,"appletUrl",2);k([E()],z.prototype,"mode",2);k([E({attribute:!1})],z.prototype,"data",2);z=k([O("app-viewer")],z);var De=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,x=(n,t,e,s)=>{for(var i=s>1?void 0:s?Le(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&De(t,e,i),i};let Q=class extends u{constructor(){super(...arguments),this.renderRoot=this,this.selected=0,this.actions=[]}connectedCallback(){j.subscribe(n=>{n.applet&&(this.actions=n.applet.actions)}),super.connectedCallback()}handleSelect(n){const t=n.target;this.selected=t.selectedIndex}handleSubmit(n){n.preventDefault();const t=n.target,e=new FormData(t);console.log(e.get("action-id"));const s=e.get("action-id"),i=e.get("params");window.applet.dispatchAction(s,JSON.parse(i))}render(){if(!this.actions.length)return $`<p class="status-message">No actions available.</p>`;const n=JSON.stringify(this.actions[this.selected].parameters,null,2)??"None";return $`
|
74
|
-
<form @submit=${this.handleSubmit.bind(this)}>
|
75
|
-
<fieldset>
|
76
|
-
<label>Action ID</label>
|
77
|
-
<action-select
|
78
|
-
.actions=${this.actions}
|
79
|
-
name="action-id"
|
80
|
-
@change=${this.handleSelect.bind(this)}
|
81
|
-
></action-select>
|
82
|
-
</fieldset>
|
83
|
-
<fieldset>
|
84
|
-
<label>Schema</label>
|
85
|
-
<pre class="schema">${n}</pre>
|
86
|
-
</fieldset>
|
87
|
-
<fieldset>
|
88
|
-
<label>Params</label>
|
89
|
-
<textarea rows=${6} name="params">{}</textarea>
|
90
|
-
</fieldset>
|
91
|
-
<fieldset>
|
92
|
-
<input type="submit" value="Dispatch action" />
|
93
|
-
</fieldset>
|
94
|
-
</form>
|
95
|
-
`}};x([E({type:Number})],Q.prototype,"selected",2);x([E({attribute:!1})],Q.prototype,"actions",2);Q=x([O("app-sidebar")],Q);let X=class extends u{constructor(){super(...arguments),this.renderRoot=this,this.actions=[]}render(){return $`
|
96
|
-
<select name=${this.name}>
|
97
|
-
${this.actions.map(n=>$`<option id="action">${n.id}</option>`)}
|
98
|
-
</select>
|
99
|
-
`}};x([E({type:String})],X.prototype,"name",2);x([E({attribute:!1})],X.prototype,"actions",2);X=x([O("action-select")],X);var je=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,Ie=(n,t,e,s)=>{for(var i=s>1?void 0:s?ze(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&je(t,e,i),i};let Ct=class extends u{createRenderRoot(){return this}render(){return $`
|
100
|
-
<app-header></app-header>
|
101
|
-
<main>
|
102
|
-
<app-sidebar></app-sidebar>
|
103
|
-
<app-viewer></app-viewer>
|
104
|
-
</main>
|
105
|
-
`}};Ct=Ie([O("app-root")],Ct);
|
@@ -1,105 +0,0 @@
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function e(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=e(i);fetch(i.href,r)}})();/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2019 Google LLC
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
-
*/const W=globalThis,ct=W.ShadowRoot&&(W.ShadyCSS===void 0||W.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xt=Symbol(),ft=new WeakMap;let It=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==xt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ct&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=ft.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&ft.set(e,t))}return t}toString(){return this.cssText}};const Ft=n=>new It(typeof n=="string"?n:n+"",void 0,xt),Wt=(n,t)=>{if(ct)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=W.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},mt=ct?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Ft(e)})(n):n;/**
|
6
|
-
* @license
|
7
|
-
* Copyright 2017 Google LLC
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
-
*/const{is:qt,defineProperty:Bt,getOwnPropertyDescriptor:Jt,getOwnPropertyNames:Vt,getOwnPropertySymbols:Gt,getPrototypeOf:Kt}=Object,v=globalThis,$t=v.trustedTypes,Zt=$t?$t.emptyScript:"",k=v.reactiveElementPolyfillSupport,T=(n,t)=>n,G={toAttribute(n,t){switch(t){case Boolean:n=n?Zt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},ht=(n,t)=>!qt(n,t),yt={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:ht};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=yt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Bt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=Jt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const l=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yt}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Kt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...Vt(e),...Gt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(mt(i))}else t!==void 0&&e.push(mt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:G).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:G;this._$Em=i,this[i]=l.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??ht)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[T("elementProperties")]=new Map,S[T("finalized")]=new Map,k==null||k({ReactiveElement:S}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.0.4");/**
|
10
|
-
* @license
|
11
|
-
* Copyright 2017 Google LLC
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
13
|
-
*/const M=globalThis,K=M.trustedTypes,_t=K?K.createPolicy("lit-html",{createHTML:n=>n}):void 0,Rt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,Ut="?"+_,Qt=`<${Ut}>`,A=document,H=()=>A.createComment(""),D=n=>n===null||typeof n!="object"&&typeof n!="function",dt=Array.isArray,Xt=n=>dt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",tt=`[
|
14
|
-
\f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,gt=/>/g,g=RegExp(`>|${tt}(?:([^\\s"'>=/]+)(${tt}*=${tt}*(?:[^
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),wt=/'/g,bt=/"/g,Tt=/^(?:script|style|textarea|title)$/i,Yt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),$=Yt(1),P=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),At=new WeakMap,w=A.createTreeWalker(A,129);function Mt(n,t){if(!dt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return _t!==void 0?_t.createHTML(t):t}const kt=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":t===3?"<math>":"",o=R;for(let l=0;l<e;l++){const a=n[l];let h,p,c=-1,m=0;for(;m<a.length&&(o.lastIndex=m,p=o.exec(a),p!==null);)m=o.lastIndex,o===R?p[1]==="!--"?o=vt:p[1]!==void 0?o=gt:p[2]!==void 0?(Tt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=g):p[3]!==void 0&&(o=g):o===g?p[0]===">"?(o=i??R,c=-1):p[1]===void 0?c=-2:(c=o.lastIndex-p[2].length,h=p[1],o=p[3]===void 0?g:p[3]==='"'?bt:wt):o===bt||o===wt?o=g:o===vt||o===gt?o=R:(o=g,i=void 0);const y=o===g&&n[l+1].startsWith("/>")?" ":"";r+=o===R?a+Qt:c>=0?(s.push(h),a.slice(0,c)+Rt+a.slice(c)+_+y):a+_+(c===-2?l:y)}return[Mt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class j{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const l=t.length-1,a=this.parts,[h,p]=kt(t,e);if(this.el=j.createElement(h,s),w.currentNode=this.el.content,e===2||e===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=w.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const c of i.getAttributeNames())if(c.endsWith(Rt)){const m=p[o++],y=i.getAttribute(c).split(_),F=/([.?@])?(.*)/.exec(m);a.push({type:1,index:r,name:F[2],strings:y,ctor:F[1]==="."?ee:F[1]==="?"?se:F[1]==="@"?ie:X}),i.removeAttribute(c)}else c.startsWith(_)&&(a.push({type:6,index:r}),i.removeAttribute(c));if(Tt.test(i.tagName)){const c=i.textContent.split(_),m=c.length-1;if(m>0){i.textContent=K?K.emptyScript:"";for(let y=0;y<m;y++)i.append(c[y],H()),w.nextNode(),a.push({type:2,index:++r});i.append(c[m],H())}}}else if(i.nodeType===8)if(i.data===Ut)a.push({type:2,index:r});else{let c=-1;for(;(c=i.data.indexOf(_,c+1))!==-1;)a.push({type:7,index:r}),c+=_.length-1}r++}}static createElement(t,e){const s=A.createElement("template");return s.innerHTML=t,s}}function C(n,t,e=n,s){var o,l;if(t===P)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=D(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=C(n,i._$AS(n,t.values),i,s)),t}class te{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??A).importNode(e,!0);w.currentNode=i;let r=w.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new I(r,r.nextSibling,this,t):a.type===1?h=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(h=new ne(r,this,t)),this._$AV.push(h),a=s[++l]}o!==(a==null?void 0:a.index)&&(r=w.nextNode(),o++)}return w.currentNode=A,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class I{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),D(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Xt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=j.createElement(Mt(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(e);else{const o=new te(i,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=At.get(t.strings);return e===void 0&&At.set(t.strings,e=new j(t)),e}k(t){dt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new I(this.O(H()),this.O(H()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=C(this,t,e,0),o=!D(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const l=t;let a,h;for(t=r[0],a=0;a<r.length-1;a++)h=C(this,l[s+a],e,a),h===P&&(h=this._$AH[a]),o||(o=!D(h)||h!==this._$AH[a]),h===d?t=d:t!==d&&(t+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ee extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class se extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class ie extends X{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??d)===P)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ne{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}}const et=M.litHtmlPolyfillSupport;et==null||et(j,I),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.2.1");const re=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new I(t.insertBefore(H(),r),r,void 0,e??{})}return i._$AI(n),i};/**
|
16
|
-
* @license
|
17
|
-
* Copyright 2017 Google LLC
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
19
|
-
*/let u=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=re(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}};var Ot;u._$litElement$=!0,u.finalized=!0,(Ot=globalThis.litElementHydrateSupport)==null||Ot.call(globalThis,{LitElement:u});const st=globalThis.litElementPolyfillSupport;st==null||st({LitElement:u});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
20
|
-
* @license
|
21
|
-
* Copyright 2017 Google LLC
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
23
|
-
*/const O=n=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(n,t)}):customElements.define(n,t)};/**
|
24
|
-
* @license
|
25
|
-
* Copyright 2017 Google LLC
|
26
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
27
|
-
*/const oe={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:ht},ae=(n=oe,t,e)=>{const{kind:s,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(e.name,n),s==="accessor"){const{name:o}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(o,a,n)},init(l){return l!==void 0&&this.P(o,void 0,n),l}}}if(s==="setter"){const{name:o}=e;return function(l){const a=this[o];t.call(this,l),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+s)};function E(n){return(t,e)=>typeof e=="object"?ae(n,t,e):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,t,e)}let b={appletUrl:""};localStorage.getItem("data")&&(b=JSON.parse(localStorage.getItem("data")));const pt=new Set;function le(n){b={...b,...n},localStorage.setItem("data",JSON.stringify({appletUrl:b.appletUrl})),pt.forEach(t=>t(b))}function ce(){return b}function he(n){return n(b),pt.add(n),()=>Nt(n)}function Nt(n){pt.delete(n)}const L={get:ce,update:le,subscribe:he,unsubscribe:Nt};var de=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,ue=(n,t,e,s)=>{for(var i=s>1?void 0:s?pe(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&de(t,e,i),i};let Et=class extends u{createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}handleKeyDown(t){if(t.key==="Enter"){const e=t.target;e.value&&!e.value.startsWith("http://")&&!e.value.startsWith("https://")&&(e.value=`http://${e.value}`),L.update({appletUrl:e.value})}}render(){return $`<input
|
28
|
-
value=${L.get().appletUrl}
|
29
|
-
type="text"
|
30
|
-
placeholder="Enter an applet URL to inspect..."
|
31
|
-
@keydown=${this.handleKeyDown.bind(this)}
|
32
|
-
/>`}};Et=ue([O("url-input")],Et);var fe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,$e=(n,t,e,s)=>{for(var i=s>1?void 0:s?me(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&fe(t,e,i),i};let St=class extends u{createRenderRoot(){return this}render(){return $`
|
33
|
-
<h1>Applet Inspector</h1>
|
34
|
-
<url-input></url-input>
|
35
|
-
`}};St=$e([O("app-header")],St);function ot(n,t){return n&&(n=URL.parse(n,window.location.href).href),ye(n)}function ye(n){return n.endsWith("/")?n.slice(0,-1):n}async function _e(n){n=ot(n);let t;try{const s=await(await fetch(n)).text(),o=new DOMParser().parseFromString(s,"text/html").querySelector('link[rel="manifest"]'),l=ot(o.href);t=await(await fetch(l)).json()}catch{return}return t}class Ht{constructor(t){this.target=t}async send(t,e){if(this.target.postMessage(t.toJson(),"*"),!(e&&e.resolves===!1))return new Promise(s=>{const i=r=>{const o=new f(r.data.type,r.data);o.type==="resolve"&&o.id===t.id&&(window.removeEventListener("message",i),s(o))};window.addEventListener("message",i)})}async on(t,e){const s=async i=>{if(i.source===window.self||i.data.type!==t)return;const r=new f(i.data.type,i.data);await e(r);const o=new ve({id:r.id});this.send(o,{resolves:!1})};window.addEventListener("message",s)}}class f{constructor(t,e){this.timeStamp=Date.now(),this.type=t,this.id=crypto.randomUUID(),e&&Object.assign(this,e)}toJson(){return Object.fromEntries(Object.entries(this).filter(([t,e])=>{try{return JSON.stringify(e),!0}catch{return!1}}))}}class ve extends f{constructor({id:t}){super("resolve"),this.id=t}}class ge extends f{constructor({actions:t}){super("actions"),this.actions=t}}class we extends f{constructor({data:t}){super("data"),this.data=t}}class be extends f{constructor(){super("ready")}}class Ae extends f{constructor({actionId:t,params:e}){super("action"),this.actionId=t,this.params=e}}class Ee extends f{constructor(){super("init")}}class Dt extends Event{constructor({data:t}){super("data",{bubbles:!1,cancelable:!1,composed:!1}),this.data=t}}class jt extends Event{constructor(){super("ready",{bubbles:!1,cancelable:!1,composed:!1})}}class Se extends Event{constructor(){super("load",{bubbles:!1,cancelable:!1,composed:!1})}}class Pe extends Event{constructor({actions:t}){super("actions",{bubbles:!1,cancelable:!1,composed:!1}),this.actions=t}}class Ce extends Event{constructor({dimensions:t}){super("resize",{bubbles:!1,cancelable:!1,composed:!1}),this.dimensions=t}}var at=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},it=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},lt,q,N,Lt;const ut=document.createElement("iframe");ut.style.display="none";document.body.appendChild(ut);async function Oe(n,t){t||(t=ut),n=ot(n);const e=await _e(n);t.setAttribute("sandbox","allow-scripts allow-forms"),t.src=n;const s=new xe(e,t.contentWindow);return new Promise(i=>{s.onready=()=>i(s)})}class xe extends EventTarget{constructor(t,e){super(),lt.add(this),this.actions=[],q.set(this,void 0),N.set(this,void 0),this.messageRelay=new Ht(e),at(this,q,t,"f"),it(this,lt,"m",Lt).call(this),this.messageRelay.on("ready",()=>{this.messageRelay.send(new Ee)})}async dispatchAction(t,e){const s=new Ae({actionId:t,params:e});return await this.messageRelay.send(s)}get data(){return it(this,N,"f")}set data(t){at(this,N,t,"f"),this.messageRelay.send(new we({data:t}))}get manifest(){return it(this,q,"f")}onready(t){}onresize(t){}onactions(t){}ondata(t){}}q=new WeakMap,N=new WeakMap,lt=new WeakSet,Lt=function(){this.messageRelay.on("ready",t=>{const e=new jt;typeof this.onready=="function"&&this.onready(e),this.dispatchEvent(e)}),this.messageRelay.on("data",t=>{at(this,N,t.data,"f");const e=new Dt({data:t.data});typeof this.ondata=="function"&&this.ondata(e),this.dispatchEvent(e)}),this.messageRelay.on("resize",t=>{const e=new Ce({dimensions:t.dimensions});typeof this.onresize=="function"&&this.onresize(e),this.dispatchEvent(e)}),this.messageRelay.on("actions",t=>{this.actions=t.actions;const e=new Pe({actions:t.actions});typeof this.onactions=="function"&&this.onactions(e),this.dispatchEvent(e)})};var nt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Re=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},B,J;class Ue extends EventTarget{constructor(){super(),this.actionHandlers={},B.set(this,{}),J.set(this,void 0),this.connect()}connect(){this.messageRelay=new Ht(window.parent),document.readyState==="complete"||document.readyState==="interactive"?setTimeout(this.initialize.bind(this),1):window.addEventListener("DOMContentLoaded",this.initialize.bind(this)),this.createResizeObserver(),this.attachListeners()}async initialize(){const t=document.querySelector('link[rel="manifest"]');if(!t)return;try{const r=await(await fetch(t.href)).json();this.manifest=r,this.actions=r.actions??[]}catch{return}const e=new Se;this.dispatchEvent(e),typeof this.onload=="function"&&await this.onload(e),this.messageRelay.send(new be);const s=new jt;this.dispatchEvent(s),typeof this.onready=="function"&&this.onready(s)}createResizeObserver(){new ResizeObserver(e=>{for(let s of e){const i=new f("resize",{dimensions:{width:s.contentRect.width,height:s.contentRect.height}});this.messageRelay.send(i)}}).observe(document.querySelector("html"))}attachListeners(){this.messageRelay.on("init",t=>{var e;this.manifest=t.manifest,this.actions=((e=this.manifest)==null?void 0:e.actions)||[]}),this.messageRelay.on("data",t=>{this.setData(t.data)}),this.messageRelay.on("action",async t=>{Object.keys(this.actionHandlers).includes(t.actionId)&&await this.actionHandlers[t.actionId](t.params)})}setActionHandler(t,e){this.actionHandlers[t]=e}defineAction(t,e){const{handler:s,...i}=e;this.actions=[...this.actions,{id:t,...i}],this.setActionHandler(t,s)}set actions(t){if(t){for(let e of t)nt(this,B,"f")[e.id]=e;this.messageRelay.send(new ge({actions:this.actions}))}}get actions(){return Object.values(nt(this,B,"f"))}set data(t){this.setData(t)}get data(){return nt(this,J,"f")}async setData(t){const e=new f("data",{data:t});await this.messageRelay.send(e),Re(this,J,t,"f");const s=new Dt({data:t});this.dispatchEvent(s),this.ondata(s)}onload(t){}onready(t){}ondata(t){}}B=new WeakMap,J=new WeakMap;function Te(){return new Ue}const Me={load:Oe,getContext:Te};var Pt=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},rt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},U,V;class zt extends HTMLElement{constructor(){super(...arguments),U.set(this,void 0),V.set(this,void 0)}connectedCallback(){Pt(this,U,this.attachShadow({mode:"open"}),"f"),this.container=document.createElement("iframe"),rt(this,U,"f").appendChild(this.container);const t=document.createElement("style");t.textContent=this.styles,rt(this,U,"f").appendChild(t);const e=this.getAttribute("src");e&&this.loadApplet(e)}set src(t){Pt(this,V,t,"f"),this.loadApplet(t)}get src(){return rt(this,V,"f")}attributeChangedCallback(t,e,s){t==="src"&&(this.src=s)}async loadApplet(t){this.container&&(this.applet=await Me.load(t,this.container),this.applet.ondata=e=>{this.dispatchEvent(e)},this.applet.onresize=e=>{this.resizeContainer(e.dimensions)},this.applet.onactions=e=>{},this.dispatchEvent(new Event("load")),this.loaded=!0)}set data(t){this.applet&&this.loaded?this.applet.data=t:this.addEventListener("load",()=>{this.applet.data=t})}resizeContainer(t){this.container.style.height=`${t.height+2}px`}get styles(){return`
|
36
|
-
:host {
|
37
|
-
display: flex;
|
38
|
-
flex-direction: column;
|
39
|
-
}
|
40
|
-
|
41
|
-
iframe {
|
42
|
-
border: none;
|
43
|
-
height: 100%;
|
44
|
-
width: 100%;
|
45
|
-
}
|
46
|
-
`}}U=new WeakMap,V=new WeakMap;zt.observedAttributes=["src"];customElements.define("applet-frame",zt);var Ne=Object.defineProperty,He=Object.getOwnPropertyDescriptor,Y=(n,t,e,s)=>{for(var i=s>1?void 0:s?He(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&Ne(t,e,i),i};let z=class extends u{constructor(){super(...arguments),this.renderRoot=this,this.appletUrl="",this.mode="gui",this.data={}}connectedCallback(){L.subscribe(n=>{this.appletUrl=n.appletUrl}),super.connectedCallback()}updated(){const n=document.querySelector("applet-frame");n&&(n.onload=()=>{var t;console.log("onload",(t=window.applet)==null?void 0:t.data,this.data),L.update({applet:n.applet}),window.applet=n.applet,window.applet.ondata=e=>this.data=e.data})}render(){const n=$`<div class="applet-footer">
|
47
|
-
<label>View as:</label>
|
48
|
-
<div class="toggle">
|
49
|
-
<button
|
50
|
-
data-selected=${this.mode==="gui"}
|
51
|
-
@mousedown=${()=>this.mode="gui"}
|
52
|
-
>
|
53
|
-
GUI
|
54
|
-
</button>
|
55
|
-
<button
|
56
|
-
data-selected=${this.mode==="data"}
|
57
|
-
@mousedown=${()=>this.mode="data"}
|
58
|
-
>
|
59
|
-
Data
|
60
|
-
</button>
|
61
|
-
</div>
|
62
|
-
</div>`;return $`
|
63
|
-
<div class="container">
|
64
|
-
<applet-frame
|
65
|
-
src=${this.appletUrl}
|
66
|
-
class=${this.mode==="gui"?"":"hidden"}
|
67
|
-
></applet-frame>
|
68
|
-
<pre class=${this.mode==="gui"?"hidden":"data-view"}>
|
69
|
-
${JSON.stringify(this.data,null,2)}</pre
|
70
|
-
>
|
71
|
-
${n}
|
72
|
-
</div>
|
73
|
-
`}};Y([E()],z.prototype,"appletUrl",2);Y([E()],z.prototype,"mode",2);Y([E({attribute:!1})],z.prototype,"data",2);z=Y([O("app-viewer")],z);var De=Object.defineProperty,je=Object.getOwnPropertyDescriptor,x=(n,t,e,s)=>{for(var i=s>1?void 0:s?je(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&De(t,e,i),i};let Z=class extends u{constructor(){super(...arguments),this.renderRoot=this,this.selected=0,this.actions=[]}connectedCallback(){L.subscribe(n=>{n.applet&&(this.actions=n.applet.actions)}),super.connectedCallback()}handleSelect(n){const t=n.target;this.selected=t.selectedIndex}handleSubmit(n){n.preventDefault();const t=n.target,e=new FormData(t);console.log(e.get("action-id"));const s=e.get("action-id"),i=e.get("params");window.applet.dispatchAction(s,JSON.parse(i))}render(){if(console.log(this.selected),!this.actions.length)return $`<p class="status-message">No actions available.</p>`;const n=JSON.stringify(this.actions[this.selected].params,null,2)??"None";return $`
|
74
|
-
<form @submit=${this.handleSubmit.bind(this)}>
|
75
|
-
<fieldset>
|
76
|
-
<label>Action ID</label>
|
77
|
-
<action-select
|
78
|
-
.actions=${this.actions}
|
79
|
-
name="action-id"
|
80
|
-
@change=${this.handleSelect.bind(this)}
|
81
|
-
></action-select>
|
82
|
-
</fieldset>
|
83
|
-
<fieldset>
|
84
|
-
<label>Schema</label>
|
85
|
-
<pre class="schema">${n}</pre>
|
86
|
-
</fieldset>
|
87
|
-
<fieldset>
|
88
|
-
<label>Params</label>
|
89
|
-
<textarea rows=${6} name="params">{}</textarea>
|
90
|
-
</fieldset>
|
91
|
-
<fieldset>
|
92
|
-
<input type="submit" value="Dispatch action" />
|
93
|
-
</fieldset>
|
94
|
-
</form>
|
95
|
-
`}};x([E({type:Number})],Z.prototype,"selected",2);x([E({attribute:!1})],Z.prototype,"actions",2);Z=x([O("app-sidebar")],Z);let Q=class extends u{constructor(){super(...arguments),this.renderRoot=this,this.actions=[]}render(){return $`
|
96
|
-
<select name=${this.name}>
|
97
|
-
${this.actions.map(n=>$`<option id="action">${n.id}</option>`)}
|
98
|
-
</select>
|
99
|
-
`}};x([E({type:String})],Q.prototype,"name",2);x([E({attribute:!1})],Q.prototype,"actions",2);Q=x([O("action-select")],Q);var Le=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,Ie=(n,t,e,s)=>{for(var i=s>1?void 0:s?ze(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&Le(t,e,i),i};let Ct=class extends u{createRenderRoot(){return this}render(){return $`
|
100
|
-
<app-header></app-header>
|
101
|
-
<main>
|
102
|
-
<app-sidebar></app-sidebar>
|
103
|
-
<app-viewer></app-viewer>
|
104
|
-
</main>
|
105
|
-
`}};Ct=Ie([O("app-root")],Ct);
|
@@ -1 +0,0 @@
|
|
1
|
-
app-root{width:100%;height:100%;display:flex;flex-direction:column}app-root main{flex-grow:1;display:flex;height:100%}app-root .column{display:flex;flex-direction:column;flex-grow:1}app-header{display:flex;align-items:center;border-bottom:1px solid var(--color-border);padding:var(--space-xs) var(--space-md);gap:var(--space-xs);height:40px;flex-shrink:0}app-header h1{font-size:var(--text-lg);display:flex;flex-shrink:0;margin-inline-end:auto}url-input{align-self:stretch;max-width:600px;width:100%}url-input input{border:1px solid var(--color-border);background:var(--color-raised);border-radius:var(--rounded-sm);padding:0 var(--space-sm);height:100%;width:100%}settings-button .menu-button{display:flex;cursor:pointer;border:none;color:#555;border-radius:2px;padding-block:2px;padding-inline:6px;font-weight:500;border:1px solid transparent}settings-button .menu-button:hover{background:#ddd}app-viewer{flex-grow:1;background:#f4f4f4;padding:16px;display:flex}app-viewer .hidden{display:none}app-viewer .container{display:flex;flex-direction:column;background:#fff;border:none;flex-grow:1;border:1px solid var(--color-border);border-radius:6px;overflow:hidden}applet-frame{flex-grow:1}app-viewer .data-view{flex-grow:1;background:#eee;padding:8px;margin:0;white-space:pre-wrap}app-viewer .applet-footer{border-top:1px solid var(--color-border);padding:4px 8px;display:flex;align-items:center;gap:8px}app-viewer .applet-footer label{font-size:13px}app-viewer .applet-footer .toggle{background:#eee;border:1px solid var(--color-border);display:flex;padding:1px;border-radius:4px;gap:2px}app-viewer .applet-footer button{cursor:pointer;border:none;color:#555;border-radius:2px;padding:2px 6px;font-weight:500;border:1px solid transparent}app-viewer .applet-footer button:hover{background:#ddd}app-viewer .applet-footer button[data-selected=true]{background:#fff;color:#000;border-color:var(--color-border)}app-sidebar{width:400px;border-right:1px solid var(--color-border);padding:13px;height:100%;flex-shrink:0}app-sidebar form{width:100%;height:100%;display:flex;gap:15px;flex-direction:column}app-sidebar label{font-weight:500}app-sidebar fieldset{display:flex;flex-direction:column;gap:6px;border:none;padding:0;margin:0;min-width:0}app-sidebar .status-message{display:flex;align-items:center;justify-content:center;flex-grow:1;color:#666;font-style:italic;padding:0;margin:0}app-sidebar select{width:100%;padding:7px;border:1px solid var(--color-border);border-radius:4px;font-weight:500}.schema{margin:0;background:#eee;padding:12px;font-size:12px;border-radius:4px;border:1px solid var(--color-border);overflow:auto}app-sidebar textarea{resize:none;border:1px solid var(--color-border);font-size:12px;border-radius:4px}app-sidebar input[type=submit]{padding:8px;font-weight:500;cursor:pointer;border:1px solid var(--color-border);border-radius:4px}app-sidebar input[type=submit]:hover{background:var(--color-border)}app-sidebar .error-message{padding:4px;border-radius:3px;color:#f44336;border:solid 1px #f44336}app-prompt{background:#f4f4f4;padding-inline:16px;padding-block-end:16px}app-prompt form{position:relative}app-prompt input{width:100%;padding-block:var(--space-md);padding-inline:var(--space-sm);border:1px solid var(--color-border);border-radius:6px}app-prompt .loader{position:absolute;inset-block-start:var(--space-sm);inset-inline-end:var(--space-sm);stroke-dasharray:40 56;stroke-dashoffset:0;animation:spin 1.5s linear infinite,dashOffset 2s ease-in-out infinite;transform-origin:center}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes dashOffset{0%{stroke-dashoffset:0}to{stroke-dashoffset:-96}}settings-dialog dialog{display:none;flex-direction:column;border:1px solid var(--color-border);padding:0;border-radius:6px;pointer-events:none;width:400px;min-height:200px}settings-dialog dialog[open]{display:flex;pointer-events:auto}settings-dialog .dialog-header,settings-dialog .dialog-content,settings-dialog .dialog-footer{padding-block:var(--space-xs);padding-inline:var(--space-md)}settings-dialog .dialog-header{border-block-end:1px solid var(--color-border);position:relative}settings-dialog .close-dialog-button{display:flex;position:absolute;inset-block-start:2px;inset-inline-end:2px;background-color:transparent;padding:0;border:none}settings-dialog .close-dialog-button:hover{background:#ddd;border:solid 1x var(--color-border);border-radius:6px}settings-dialog .dialog-content{flex-grow:1}settings-dialog .dialog-footer{border-block-start:1px solid var(--color-border);display:flex;flex-direction:row-reverse;gap:6px}settings-dialog .dialog-footer button{display:flex;cursor:pointer;border:none;color:#555;border-radius:2px;padding-block:6px;padding-inline:6px;font-weight:500;border:1px solid transparent}settings-dialog .dialog-footer button:hover{background:#ddd}settings-dialog .dialog-header h2{font-size:var(--text-lg);margin-block:var(--space-md);margin-inline-end:var(--space-md)}settings-dialog form{display:flex;flex-direction:row;gap:var(--space-xs);padding-block:var(--space-sm)}settings-dialog fieldset{border:none;margin:0;padding:0;display:flex;flex-direction:column;flex-grow:1;gap:var(--space-sm)}settings-dialog label{font-weight:500}settings-dialog input{border:1px solid var(--color-border);background:var(--color-raised);border-radius:var(--rounded-sm);padding-block:var(--space-sm);padding-inline:var(--space-sm);width:100%}settings-dialog .clear-button{align-self:end;display:flex;align-items:center;cursor:pointer;border:none;color:#555;border-radius:var(--rounded-sm);padding-block:var(--space-sm);padding-inline:var(--space-sm);font-weight:500;border:1px solid var(--color-border)}settings-dialog .clear-button:hover{background:#ddd}:root{--color-neutral-7: #fff;--color-neutral-6: #eee;--color-neutral-5: #ddd;--color-neutral-1: #111;--color-background: #fff;--color-border: #ddd;--color-raised: #eee;--space-unit: 4px;--space-xxs: calc(var(--space-unit) * .5);--space-xs: var(--space-unit);--space-sm: calc(var(--space-unit) * 2);--space-md: calc(var(--space-unit) * 3);--space-lg: calc(var(--space-unit) * 4);--space-xl: calc(var(--space-unit) * 6);--space-2xl: calc(var(--space-unit) * 8);--space-3xl: calc(var(--space-unit) * 12);--space-4xl: calc(var(--space-unit) * 16);--rounded-sm: 4px;--text-base: 14px;--text-md: 16px;--text-lg: 18px}*{box-sizing:border-box}html,body{width:100%;height:100%;padding:0;margin:0}body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:var(--text-base);background:var(--color-background)}header{display:flex}h1,h2,h3,h4,h5{padding:0;margin:0}
|
@@ -1 +0,0 @@
|
|
1
|
-
app-root{width:100%;height:100%;display:flex;flex-direction:column}app-root main{flex-grow:1;display:flex;height:100%}app-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--color-border);padding:var(--space-xs) var(--space-md);height:40px;flex-shrink:0}app-header h1{font-size:var(--text-lg);display:flex}url-input{align-self:stretch;max-width:600px;width:100%}url-input input{border:1px solid var(--color-border);background:var(--color-raised);border-radius:var(--rounded-sm);padding:0 var(--space-sm);height:100%;width:100%}app-viewer{flex-grow:1;background:#f4f4f4;padding:16px;display:flex}app-viewer .hidden{display:none}app-viewer .container{display:flex;flex-direction:column;background:#fff;border:none;flex-grow:1;border:1px solid var(--color-border);border-radius:6px;overflow:hidden}applet-frame{flex-grow:1}app-viewer .data-view{flex-grow:1;background:#eee;padding:8px;margin:0;white-space:pre-wrap}app-viewer .applet-footer{border-top:1px solid var(--color-border);padding:4px 8px;display:flex;align-items:center;gap:8px}app-viewer .applet-footer label{font-size:13px}app-viewer .applet-footer .toggle{background:#eee;border:1px solid var(--color-border);display:flex;padding:1px;border-radius:4px;gap:2px}app-viewer .applet-footer button{cursor:pointer;border:none;color:#555;border-radius:2px;padding:2px 6px;font-weight:500;border:1px solid transparent}app-viewer .applet-footer button:hover{background:#ddd}app-viewer .applet-footer button[data-selected=true]{background:#fff;color:#000;border-color:var(--color-border)}app-sidebar{width:400px;border-right:1px solid var(--color-border);padding:13px;height:100%;flex-shrink:0}app-sidebar form{width:100%;height:100%;display:flex;gap:15px;flex-direction:column}app-sidebar label{font-weight:500}app-sidebar fieldset{display:flex;flex-direction:column;gap:6px;border:none;padding:0;margin:0}app-sidebar .status-message{display:flex;align-items:center;justify-content:center;flex-grow:1;color:#666;font-style:italic;padding:0;margin:0}app-sidebar select{width:100%;padding:7px;border:1px solid var(--color-border);border-radius:4px;font-weight:500}.schema{margin:0;background:#eee;padding:12px;font-size:12px;border-radius:4px;border:1px solid var(--color-border)}app-sidebar textarea{resize:none;border:1px solid var(--color-border);font-size:12px;border-radius:4px}app-sidebar input[type=submit]{padding:8px;font-weight:500;cursor:pointer;border:1px solid var(--color-border);border-radius:4px}app-sidebar input[type=submit]:hover{background:var(--color-border)}:root{--color-neutral-7: #fff;--color-neutral-6: #eee;--color-neutral-5: #ddd;--color-neutral-1: #111;--color-background: #fff;--color-border: #ddd;--color-raised: #eee;--space-unit: 4px;--space-xxs: calc(var(--space-unit) * .5);--space-xs: var(--space-unit);--space-sm: calc(var(--space-unit) * 2);--space-md: calc(var(--space-unit) * 3);--space-lg: calc(var(--space-unit) * 4);--space-xl: calc(var(--space-unit) * 6);--space-2xl: calc(var(--space-unit) * 8);--space-3xl: calc(var(--space-unit) * 12);--space-4xl: calc(var(--space-unit) * 16);--rounded-sm: 4px;--text-base: 14px;--text-md: 16px}*{box-sizing:border-box}html,body{width:100%;height:100%;padding:0;margin:0}body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:var(--text-base);background:var(--color-background)}header{display:flex}h1,h2,h3,h4,h5{padding:0;margin:0}
|
package/dist/web/index.html
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8" />
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
-
<title>Web Applets Inspector</title>
|
7
|
-
<script type="module" crossorigin src="/assets/index-BdJJtosA.js"></script>
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-nmk_tQAS.css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<app-root></app-root>
|
12
|
-
</body>
|
13
|
-
</html>
|