@pictogrammers/components 0.4.6 → 0.4.8
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 +1 -1
- package/pg/app/app.css +1 -1
- package/pg/app/app.ts +8 -2
- package/pg/buttonMenu/README.md +5 -12
- package/pg/tree/README.md +11 -3
- package/pg/tree/__examples__/basic/basic.ts +3 -9
- package/pg/tree/tree.ts +12 -2
- package/pgAnnoy.js +1 -1
- package/pgApp.js +1 -1
- package/pgAvatar.js +1 -1
- package/pgButton.js +1 -1
- package/pgButtonGroup.js +1 -1
- package/pgButtonLink.js +1 -1
- package/pgButtonMenu.js +1 -1
- package/pgButtonToggle.js +1 -1
- package/pgCard.js +1 -1
- package/pgCardUser.js +1 -1
- package/pgColor.js +1 -1
- package/pgDatabase.js +1 -1
- package/pgDropdown.js +1 -1
- package/pgGrid.js +1 -1
- package/pgHeader.js +1 -1
- package/pgIcon.js +1 -1
- package/pgInputCheck.js +1 -1
- package/pgInputCheckList.js +1 -1
- package/pgInputFileLocal.js +1 -1
- package/pgInputHexRgb.js +1 -1
- package/pgInputPixelEditor.js +1 -1
- package/pgInputRange.js +1 -1
- package/pgInputSelect.js +1 -1
- package/pgInputText.js +1 -1
- package/pgInputTextIcon.js +1 -1
- package/pgInputUserSelect.js +1 -1
- package/pgListTag.js +1 -1
- package/pgMarkdown.js +1 -1
- package/pgMenu.js +1 -1
- package/pgMenuDivider.js +1 -1
- package/pgMenuIcon.js +1 -1
- package/pgMenuItem.js +1 -1
- package/pgMenuItemIcon.js +1 -1
- package/pgModalAlert.js +1 -1
- package/pgModification.js +1 -1
- package/pgNav.js +1 -1
- package/pgOverlay.js +1 -1
- package/pgOverlayContextMenu.js +1 -1
- package/pgOverlayMenu.js +1 -1
- package/pgOverlaySelectMenu.js +1 -1
- package/pgOverlaySubMenu.js +1 -1
- package/pgPicker.js +1 -1
- package/pgPreview.js +1 -1
- package/pgScroll.js +1 -1
- package/pgSearch.js +1 -1
- package/pgTab.js +1 -1
- package/pgTabs.js +1 -1
- package/pgToast.js +1 -1
- package/pgToasts.js +1 -1
- package/pgTooltip.js +1 -1
- package/pgTree.js +1 -1
- package/pgTreeButtonIcon.js +1 -1
- package/pgTreeItem.js +1 -1
package/pgMenu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={209:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),i=n.n(r),s=n(314),a=n.n(s)()(i());a.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const l=o},219:(e,t,n)=>{n.d(t,{A:()=>E});var r=n(601),i=n.n(r),s=n(314),a=n.n(s),o=n(417),l=n.n(o),c=new URL(n(662),n.b),d=new URL(n(708),n.b),h=new URL(n(383),n.b),u=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=a()(i()),g=l()(c),v=l()(d),b=l()(h),y=l()(u),w=l()(p),x=l()(m);f.push([e.id,`:host {\n display: contents;\n}\n\n[part=label] {\n outline: none;\n display: flex;\n align-items: center;\n font-family: var(--pg-font-family);\n text-align: var(--pg-menu-item-text-align, left);\n background: var(--pg-menu-item-background, transparent);\n padding: var(--pg-menu-item-padding, 0.25rem 0.5rem 0.25rem 0.5rem);\n border-color: transparent;\n border-width: 0;\n border-style: solid;\n border-top-left-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-top-right-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-bottom-left-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n border-bottom-right-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n color: var(--pg-menu-item-color, #453C4F);\n}\n\n[part=label]:not(:disabled):active,\n[part=label]:not(:disabled):hover {\n background: var(--pg-menu-item-selected-background, #453C4F);\n color: #FFFFFF;\n}\n\n[part=label]:not(:disabled):active {\n background: var(--pg-menu-item-active-background, #5f516e);\n}\n\n[part=label]:disabled {\n color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n}\n\n@container style(--pg-menu-_has-check: true) {\n [part=label] {\n padding-inline-start: 1.5rem;\n }\n\n [part=label].checked::before {\n position: absolute;\n translate: -1.5rem 0;\n content: var(--pg-menu-item-check, url(${g}));\n width: 1.5rem;\n height: 1.5rem;\n }\n\n [part=label].checked:active::before,\n [part=label].checked:hover::before {\n content: var(--pg-menu-item-hover-check, url(${v}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${b}));\n }\n}\n\n[part=label]:focus-visible {\n position: relative;\n}\n\n[part=label]:focus-visible::after {\n pointer-events: none;\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.25rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\n[part=label]:focus-visible:not(:hover)::after {\n background: var(--pg-focus-background-color, rgb(79, 143, 249, 0.1));\n}\n\n[part=label].more {\n padding-right: 1.5rem;\n}\n\n[part=label].more::after {\n position: absolute;\n translate: -0.25rem 0;\n right: 0;\n content: var(--pg-menu-item-check, url(${y}));\n width: 1.5rem;\n height: 1.5rem;\n}\n\n[part=label].more:active::after,\n[part=label].more:hover::after {\n content: var(--pg-menu-item-hover-check, url(${w}));\n}\n\n[part=label].more:disabled::after {\n content: var(--pg-menu-item-disabled-check, url(${x}));\n}\n`,""]);var k=new CSSStyleSheet;k.replaceSync(f.toString());const E=k},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var o=0;o<this.length;o++){var l=this[o][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},383:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},544:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},553:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),i=n.n(r),s=n(314),a=n.n(s)()(i());a.push([e.id,":host {\n display: contents;\n}\n\n[part=items] {\n display: flex;\n flex-direction: column;\n padding: var(--pg-menu-padding, 0.25rem);\n border-width: var(--pg-menu-border-width, 1px);\n border-color: var(--pg-menu-border-color, #453C4F);\n border-style: solid;\n border-radius: 0.5rem;\n background-color: var(--pg-menu-background-color, #FFFFFF);\n box-shadow: var(--pg-menu-box-shadow, none);\n}\n\n[part=items].check {\n --pg-menu-_has-check: true;\n}",""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const l=o},570:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27white%27 /></svg>"},601:e=>{e.exports=function(e){return e[1]}},662:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},708:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27white%27 /></svg>"}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.b="undefined"!=typeof document&&document.baseURI||self.location.href;const r=Symbol("addObserver"),i=Symbol("removeObserver"),s=Symbol("getObservers"),a=Symbol("isProxy"),o=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case o:return t;case s:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case i:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?d(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return d(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;const h="fill",u="pop",p="push",m="reverse",f="shift",g="sort",v="splice",b="unshift";class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const y=Symbol("init"),w=Symbol("template"),x=Symbol("style"),k=Symbol("parent");function E(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function S(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function $(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,i;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[k]||t.prototype[k][t.prototype[k].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[k]=[t.prototype],t.prototype[x]=e.style?[e.style]:[],t.prototype[w]=e.template||""):(t.prototype[k].push(t.prototype),t.prototype[x].push(e.style),t.prototype[w]=(r=t.prototype[w],(i=e.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,r):`${r}${i||""}`));const s=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[y]||void 0!==e.template||void 0!==e.style)if(this[y]){if(this[y]&&e.style);else if(this[y]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[w]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[x].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),i=()=>{this[k].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[S(t)]=!0,e)),{}):{})}))};0===r.length?(this[y]=!0,s.call(this),i()):Promise.all(r).then((()=>{this[y]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));i()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[S(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function L(e){return!!e&&e.constructor===Array}function C(e,t){e[y]&&e[k].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function O(e){return null===e?"null":L(e)?"array":typeof e}function P(e){return function(t,n){const r=n.name,i=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[i][a]?this[i]:d(this[i]):this[i],set:t=>{const n=O(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!L(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[i]===t)throw new Error("Setting an array to itself is not allowed.");const e=d(this[i]);if(e[s]){const n=t[a]?(c=t)[a]&&c[o]:t;e.splice(0,this[i].length,...n)}else this[i]=t}else this[i]=e?e(t):t,C(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=E(r);t[r]||(e.observedAttributes.push(n),t[r]=i)}return this[l]=O(t),"array"===this[l]?(this[i]=t,new Proxy(t,{get:(e,t)=>t===A?this[c]:(console.log("errr???"),Reflect.get(this[i],t)),set:(e,t,n)=>{if(t===A)return this[c]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[i].length===n||C(this,r),this[i]=n,s}})):(this[i]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[i])}}}function j(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const A=Symbol("meta");function R({container:e,items:t,type:n,create:i,connect:s,disconnect:a,update:o}){function l(e,s){const a=n(e),o=document.createElement(E(a.name),a),l=a.observedAttributes??[],c=function(e,t){const n=new Set(e);return t.filter((e=>n.has(e)))}(Object.keys(e),l);return l.includes("index")&&(o.index=s),-1!==c.indexOf("index")&&c.splice(c.indexOf("index"),1),c.forEach((t=>{o[t]=e[t]})),i&&i(o,d(e)),t[s][r](o,((e,t)=>{o[e]=t})),o}t.forEach(((t,n)=>{const r=l(t,n);e.appendChild(r),s&&s(r,d(t))})),t[r](e,((n,r,i)=>{switch(r){case h:const[n,r,o]=i;for(let i=r||0;i<(o||t.length);i++)Object.keys(n).forEach((t=>{e.children[i][t]=n[t]}));break;case u:const c=e.children.length;c>0&&e.children[c-1].remove();break;case p:const y=e.children.length;[...i].forEach(((t,n)=>{const r=l(t,y+n);e.appendChild(r),s&&s(r,d(t))}));break;case m:for(var a=1;a<e.children.length;a++)e.insertBefore(e.children[a],e.children[0]);break;case f:e.children.length&&e.children[0].remove();for(let t=0;t<e.children.length;t++)e.children[t].index=t;break;case g:throw new Error("ToDo... write sort.");case v:const[w,x,...k]=i;if(x>0)for(let t=w;t<x+w;t++)e.children[t].remove();let E=k.length||0;if(E>0){const t=k.map(((e,t)=>l(e,w+t)));0===w?e.prepend(...t):e.children[w-1].after(...t);for(let t=w-x+E;t<e.children.length;t++)e.children[t].index=t;t.forEach((e=>{s&&s(e,k[a])}))}else for(let t=w;t<e.children.length;t++)e.children[t].index=t;break;case b:const S=e.children.length&&e.children[0],$=[...i].length;[...i].forEach(((t,n)=>{S?S.before(l(t,n)):e.appendChild(l(t,n))}));for(let t=$;t<e.children.length;t++)e.children[t].index=t}}))}var T=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},F=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const z=new Set,M=new Map;const D=(()=>{let e,t,n=[$()],r=[],i=HTMLElement;(class extends i{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;T(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),F(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),z.add(t),new Promise((e=>{M.set(t,e)}))}close(e){this.remove(),z.delete(this);const t=M.get(this);t&&t(e),M.delete(this)}});return t})();var I=n(217),U=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},_=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const B=[],H=[];const Z=(()=>{let e,t,n,r,i,s,a,o,l,c,d=[$({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:I.A})],h=[],u=D,p=[],m=[],f=[],g=[],v=[],b=[],y=[],w=[],x=[],k=[],E=[],S=[],L=[],C=[],O=[],A=[];(class extends u{static{t=this}static{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[j()],r=[j()],i=[P()],s=[P()],a=[P()],o=[P()],l=[P()],c=[P()],U(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:$},p,m),U(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:$},f,g),U(null,null,i,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:$},v,b),U(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:$},y,w),U(null,null,a,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:$},x,k),U(null,null,o,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:$},E,S),U(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:$},L,C),U(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:$},O,A),U(null,e={value:t},d,{kind:"class",name:t.name,metadata:$},null,h),t=e.value,$&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),_(t,h)}$overlay=_(this,p,void 0);$menu=(_(this,m),_(this,f,void 0));source=(_(this,g),_(this,v,null));x=(_(this,b),_(this,y,0));y=(_(this,w),_(this,x,0));default=(_(this,k),_(this,E,null));items=(_(this,S),_(this,L,[]));value=(_(this,C),_(this,O,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){B.pop()?.close(),B.push(this),H.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#i.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(_(this,A),!1);#r;#i(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===H.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){H.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}});return t})();var N=n(219),q=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},W=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const Q=(()=>{let e,t,n,r,i,s,a,o,l=[$({selector:"pg-menu-item",style:N.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,h=[],u=[],p=[],m=[],f=[],g=[],v=[],b=[],y=[],w=[],x=[],k=[];(class extends d{static{t=this}static{const E="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[P()],r=[P()],i=[P()],s=[P()],a=[P()],o=[j()],q(null,null,n,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:E},h,u),q(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:E},p,m),q(null,null,i,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:E},f,g),q(null,null,s,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:E},v,b),q(null,null,a,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:E},y,w),q(null,null,o,{kind:"field",name:"$label",static:!1,private:!1,access:{has:e=>"$label"in e,get:e=>e.$label,set:(e,t)=>{e.$label=t}},metadata:E},x,k),q(null,e={value:t},l,{kind:"class",name:t.name,metadata:E},null,c),t=e.value,E&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:E})}static delegatesFocus=!0;index=W(this,h,void 0);label=(W(this,u),W(this,p,""));checked=(W(this,m),W(this,f,!1));disabled=(W(this,g),W(this,v,!1));items=(W(this,b),W(this,y,[]));$label=(W(this,w),W(this,x,void 0));render(e){e.label&&(this.$label.textContent=this.label),e.disabled&&(this.$label.disabled=this.disabled),e.checked&&this.$label.classList.toggle("checked",this.checked),e.checked&&!0===this.checked&&this.dispatchEvent(new CustomEvent("hasCheck",{bubbles:!0})),e.items&&this.$label.classList.toggle("more",this.items.length>0)}connectedCallback(){this.$label.addEventListener("click",(async()=>{if(this.items.length>0){const e=await Z.open({source:this.$label,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}else this.dispatchEvent(new CustomEvent("select",{detail:{index:this.index}}))})),this.$label.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":this.dispatchEvent(new CustomEvent("down",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowUp":this.dispatchEvent(new CustomEvent("up",{detail:{index:this.index}})),e.preventDefault();break;case"Escape":this.dispatchEvent(new CustomEvent("close")),e.preventDefault()}}))}focus(){this.$label.focus()}getHeight(){return this.$label.getBoundingClientRect().height}constructor(){super(...arguments),W(this,k)}static{W(t,c)}});return t})();var V=n(553),Y=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},G=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};(()=>{let e,t,n,r,i=[$({selector:"pg-menu",style:V.A,template:'<div part="items"></div>'})],s=[],a=HTMLElement,o=[],l=[],c=[],d=[];(class extends a{static{t=this}static{const h="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;n=[P()],r=[j()],Y(null,null,n,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:h},o,l),Y(null,null,r,{kind:"field",name:"$items",static:!1,private:!1,access:{has:e=>"$items"in e,get:e=>e.$items,set:(e,t)=>{e.$items=t}},metadata:h},c,d),Y(null,e={value:t},i,{kind:"class",name:t.name,metadata:h},null,s),t=e.value,h&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h}),G(t,s)}items=G(this,o,[]);$items=(G(this,l),G(this,c,void 0));connectedCallback(){R({container:this.$items,items:this.items,type:e=>e.type??Q,create:(e,t)=>{e.addEventListener("close",(e=>{const{depth:t}=e.detail;this.dispatchEvent(new CustomEvent("close",{detail:{depth:t}}))})),e.addEventListener("select",(e=>{const{index:n}=e.detail;this.dispatchEvent(new CustomEvent("select",{detail:{indexes:[n],item:t}}))})),e.addEventListener("up",(e=>{const{index:t}=e.detail;this.#a(t-1,-1,t)})),e.addEventListener("down",(e=>{const{index:t}=e.detail;this.#a(t+1,1,t)}))}}),this.$items.addEventListener("hasCheck",(e=>{e.stopPropagation(),this.$items.classList.toggle("check",!0)}))}#a(e,t,n){if(e===n)return;if(-1===e)return this.#a(this.items.length-1,t,n);if(e>=this.items.length)return this.#a(0,t,n);const r=this.$items.children[e];if(!1===r.focusable||this.items[e].disabled)return this.#a(e+t,t,n);r?.focus()}focus(e){if(-1===e)this.#a(0,1,this.items.length-1);else{const t=this.$items.children[e];t?.focus()}}getItemOffset(e,t){const n=getComputedStyle(this.$items);let r=parseInt(n.getPropertyValue("padding-top"),10);const i=this.items.length;if(e>i||t>i)throw new Error("startIndex or endIndex not within range of items");for(let n=e;n<t;n++){r+=this.$items.children[n].getHeight()}return r}getItemHeight(e){if(e>this.items.length)throw new Error("index outside range of items");return this.$items.children[e].getHeight()}constructor(){super(...arguments),G(this,d)}})})()})();
|
|
1
|
+
(()=>{"use strict";var e={209:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),s=n.n(r),i=n(314),a=n.n(i)()(s());a.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const l=o},219:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),s=n.n(r),i=n(314),a=n.n(i),o=n(417),l=n.n(o),c=new URL(n(662),n.b),d=new URL(n(708),n.b),h=new URL(n(383),n.b),u=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=a()(s()),g=l()(c),v=l()(d),b=l()(h),y=l()(u),w=l()(p),x=l()(m);f.push([e.id,`:host {\n display: contents;\n}\n\n[part=label] {\n outline: none;\n display: flex;\n align-items: center;\n font-family: var(--pg-font-family);\n text-align: var(--pg-menu-item-text-align, left);\n background: var(--pg-menu-item-background, transparent);\n padding: var(--pg-menu-item-padding, 0.25rem 0.5rem 0.25rem 0.5rem);\n border-color: transparent;\n border-width: 0;\n border-style: solid;\n border-top-left-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-top-right-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-bottom-left-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n border-bottom-right-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n color: var(--pg-menu-item-color, #453C4F);\n}\n\n[part=label]:not(:disabled):active,\n[part=label]:not(:disabled):hover {\n background: var(--pg-menu-item-selected-background, #453C4F);\n color: #FFFFFF;\n}\n\n[part=label]:not(:disabled):active {\n background: var(--pg-menu-item-active-background, #5f516e);\n}\n\n[part=label]:disabled {\n color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n}\n\n@container style(--pg-menu-_has-check: true) {\n [part=label] {\n padding-inline-start: 1.5rem;\n }\n\n [part=label].checked::before {\n position: absolute;\n translate: -1.5rem 0;\n content: var(--pg-menu-item-check, url(${g}));\n width: 1.5rem;\n height: 1.5rem;\n }\n\n [part=label].checked:active::before,\n [part=label].checked:hover::before {\n content: var(--pg-menu-item-hover-check, url(${v}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${b}));\n }\n}\n\n[part=label]:focus-visible {\n position: relative;\n}\n\n[part=label]:focus-visible::after {\n pointer-events: none;\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.25rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\n[part=label]:focus-visible:not(:hover)::after {\n background: var(--pg-focus-background-color, rgb(79, 143, 249, 0.1));\n}\n\n[part=label].more {\n padding-right: 1.5rem;\n}\n\n[part=label].more::after {\n position: absolute;\n translate: -0.25rem 0;\n right: 0;\n content: var(--pg-menu-item-check, url(${y}));\n width: 1.5rem;\n height: 1.5rem;\n}\n\n[part=label].more:active::after,\n[part=label].more:hover::after {\n content: var(--pg-menu-item-hover-check, url(${w}));\n}\n\n[part=label].more:disabled::after {\n content: var(--pg-menu-item-disabled-check, url(${x}));\n}\n`,""]);var E=new CSSStyleSheet;E.replaceSync(f.toString());const k=E},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var o=0;o<this.length;o++){var l=this[o][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},383:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},544:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},553:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),s=n.n(r),i=n(314),a=n.n(i)()(s());a.push([e.id,":host {\n display: contents;\n}\n\n[part=items] {\n display: flex;\n flex-direction: column;\n padding: var(--pg-menu-padding, 0.25rem);\n border-width: var(--pg-menu-border-width, 1px);\n border-color: var(--pg-menu-border-color, #453C4F);\n border-style: solid;\n border-radius: 0.5rem;\n background-color: var(--pg-menu-background-color, #FFFFFF);\n box-shadow: var(--pg-menu-box-shadow, none);\n}\n\n[part=items].check {\n --pg-menu-_has-check: true;\n}",""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const l=o},570:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27white%27 /></svg>"},601:e=>{e.exports=function(e){return e[1]}},662:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},708:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27white%27 /></svg>"}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={id:r,exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.b="undefined"!=typeof document&&document.baseURI||self.location.href;const r=Symbol("addObserver"),s=Symbol("removeObserver"),i=Symbol("getObservers"),a=Symbol("swapObserver"),o=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case o:return!0;case l:return t;case i:return d.has(e);case a:return(t,n)=>{const r=d.get(e);r.forEach(((s,i)=>{if(i.getRootNode().host===t){const t=r.get(i);d.has(n)?d.get(n).has(i)?d.get(n).get(i).push(r.get(i)):d.get(n).set(i,r.get(i)):d.set(n,new Map([[i,t]])),d.delete(e),t.forEach((e=>{e(null,u.swap,[n])}))}}))};case r:return(t,n)=>{d.has(e)?d.get(e).has(t)?d.get(e).get(t).push(n):d.get(e).set(t,[n]):d.set(e,new Map([[t,[n]]]))};case s:return t=>{d.has(e)&&(d.get(e).delete(t),0===d.get(e).size&&d.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return d.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return d.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(d.has(e)){d.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=d;const u={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),m=Symbol("template"),f=Symbol("style"),g=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function y(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,s;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[g]||t.prototype[g][t.prototype[g].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[g]=[t.prototype],t.prototype[f]=e.style?[e.style]:[],t.prototype[m]=e.template||""):(t.prototype[g].push(t.prototype),t.prototype[f].push(e.style),t.prototype[m]=(r=t.prototype[m],(s=e.template||null)&&s.match(/<parent\/>/)?s.replace(/<parent\/>/,r):`${r}${s||""}`));const i=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[p]||void 0!==e.template||void 0!==e.style)if(this[p]){if(this[p]&&e.style);else if(this[p]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[m]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[f].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),s=()=>{this[g].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[b(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,i.call(this),s()):Promise.all(r).then((()=>{this[p]=!0,i.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));s()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[b(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function x(e,t){e[p]&&e[g].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function k(e){return function(t,n){const r=n.name,s=Symbol(r),c=Symbol(`${r}:type`),d=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[s][o]?this[s]:h(this[s]):this[s],set:t=>{const n=E(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[s]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[s]);if(e[i]){const n=t[o]?t[l]:t;e[a](this,n),this[s]=t,console.log(">>> trigger render???",this,r)}else this[s]=t}else this[s]=e?e(t):t,x(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=v(r);t[r]||(e.observedAttributes.push(n),t[r]=s)}return this[c]=E(t),"array"===this[c]?(this[s]=t,new Proxy(t,{get:(e,t)=>t===$?this[d]:(console.log("errr???"),Reflect.get(this[s],t)),set:(e,t,n)=>{if(t===$)return this[d]=n,!0;const i=Reflect.set(e,t,n);return"length"===t&&this[s].length===n||x(this,r),this[s]=n,i}})):(this[s]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[s])}}}function S(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const $=Symbol("meta");function L({container:e,items:t,type:n,create:s,connect:i,disconnect:a,update:o}){function l(e,i){const a=n(e),o=document.createElement(v(a.name),a),l=a.observedAttributes??[],c=function(e,t){const n=new Set(e);return t.filter((e=>n.has(e)))}(Object.keys(e),l);return l.includes("index")&&(o.index=i),-1!==c.indexOf("index")&&c.splice(c.indexOf("index"),1),c.forEach((t=>{o[t]=e[t]})),s&&s(o,h(e)),t[i][r](o,((e,t)=>{o[e]=t})),o}t.forEach(((t,n)=>{const r=l(t,n);e.appendChild(r),i&&i(r,h(t))})),t[r](e,((n,r,s)=>{if(r===u.swap){const e=t.length;t=h(s[0]),r=u.splice,s=[0,e,...s[0]]}switch(r){case u.fill:const[n,r,o]=s;for(let s=r||0;s<(o||t.length);s++)Object.keys(n).forEach((t=>{e.children[s][t]=n[t]}));break;case u.pop:const c=e.children.length;c>0&&e.children[c-1].remove();break;case u.push:const d=e.children.length;[...s].forEach(((t,n)=>{const r=l(t,d+n);e.appendChild(r),i&&i(r,h(t))}));break;case u.reverse:for(var a=1;a<e.children.length;a++)e.insertBefore(e.children[a],e.children[0]);break;case u.shift:e.children.length&&e.children[0].remove();for(let t=0;t<e.children.length;t++)e.children[t].index=t;break;case u.sort:throw new Error("ToDo... write sort.");case u.splice:const[p,m,...f]=s;if(m>0)for(let t=p;t<m+p;t++)e.children[t].remove();let g=f.length||0;if(g>0){const t=f.map(((e,t)=>l(e,p+t)));0===p?e.prepend(...t):e.children[p-1].after(...t);for(let t=p-m+g;t<e.children.length;t++)e.children[t].index=t;t.forEach((e=>{i&&i(e,f[a])}))}else for(let t=p;t<e.children.length;t++)e.children[t].index=t;break;case u.unshift:const v=e.children.length&&e.children[0],b=[...s].length;[...s].forEach(((t,n)=>{v?v.before(l(t,n)):e.appendChild(l(t,n))}));for(let t=b;t<e.children.length;t++)e.children[t].index=t}}))}var C=function(e,t,n,r,s,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&s.unshift(o)}else(o=a(g))&&("field"===l?s.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},O=function(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0};const P=new Set,j=new Map;const A=(()=>{let e,t,n=[y()],r=[],s=HTMLElement;(class extends s{static{t=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;C(null,e={value:t},n,{kind:"class",name:t.name,metadata:i},null,r),t=e.value,i&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i}),O(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),P.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),P.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(217),T=function(e,t,n,r,s,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&s.unshift(o)}else(o=a(g))&&("field"===l?s.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},F=function(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0};const z=[],M=[];const D=(()=>{let e,t,n,r,s,i,a,o,l,c,d=[y({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],u=A,p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],E=[],$=[],L=[],C=[],O=[],P=[],j=[],D=[];(class extends u{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[S()],r=[S()],s=[k()],i=[k()],a=[k()],o=[k()],l=[k()],c=[k()],T(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:y},p,m),T(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:y},f,g),T(null,null,s,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:y},v,b),T(null,null,i,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:y},w,x),T(null,null,a,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:y},E,$),T(null,null,o,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:y},L,C),T(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},O,P),T(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:y},j,D),T(null,e={value:t},d,{kind:"class",name:t.name,metadata:y},null,h),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),F(t,h)}$overlay=F(this,p,void 0);$menu=(F(this,m),F(this,f,void 0));source=(F(this,g),F(this,v,null));x=(F(this,b),F(this,w,0));y=(F(this,x),F(this,E,0));default=(F(this,$),F(this,L,null));items=(F(this,C),F(this,O,[]));value=(F(this,P),F(this,j,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){z.pop()?.close(),z.push(this),M.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#s.bind(this),document.addEventListener("pointerdown",this.#r)}#i=(F(this,D),!1);#r;#s(e){this.#i=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===M.length&&this.#i&&(console.log(e),this.source?.focus())}disconnectedCallback(){M.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}});return t})();var I=n(219),U=function(e,t,n,r,s,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&s.unshift(o)}else(o=a(g))&&("field"===l?s.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},_=function(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0};const B=(()=>{let e,t,n,r,s,i,a,o,l=[y({selector:"pg-menu-item",style:I.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,h=[],u=[],p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],E=[],$=[];(class extends d{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[k()],r=[k()],s=[k()],i=[k()],a=[k()],o=[S()],U(null,null,n,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:y},h,u),U(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:y},p,m),U(null,null,s,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:y},f,g),U(null,null,i,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:y},v,b),U(null,null,a,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},w,x),U(null,null,o,{kind:"field",name:"$label",static:!1,private:!1,access:{has:e=>"$label"in e,get:e=>e.$label,set:(e,t)=>{e.$label=t}},metadata:y},E,$),U(null,e={value:t},l,{kind:"class",name:t.name,metadata:y},null,c),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}static delegatesFocus=!0;index=_(this,h,void 0);label=(_(this,u),_(this,p,""));checked=(_(this,m),_(this,f,!1));disabled=(_(this,g),_(this,v,!1));items=(_(this,b),_(this,w,[]));$label=(_(this,x),_(this,E,void 0));render(e){e.label&&(this.$label.textContent=this.label),e.disabled&&(this.$label.disabled=this.disabled),e.checked&&this.$label.classList.toggle("checked",this.checked),e.checked&&!0===this.checked&&this.dispatchEvent(new CustomEvent("hasCheck",{bubbles:!0})),e.items&&this.$label.classList.toggle("more",this.items.length>0)}connectedCallback(){this.$label.addEventListener("click",(async()=>{if(this.items.length>0){const e=await D.open({source:this.$label,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}else this.dispatchEvent(new CustomEvent("select",{detail:{index:this.index}}))})),this.$label.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":this.dispatchEvent(new CustomEvent("down",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowUp":this.dispatchEvent(new CustomEvent("up",{detail:{index:this.index}})),e.preventDefault();break;case"Escape":this.dispatchEvent(new CustomEvent("close")),e.preventDefault()}}))}focus(){this.$label.focus()}getHeight(){return this.$label.getBoundingClientRect().height}constructor(){super(...arguments),_(this,$)}static{_(t,c)}});return t})();var H=n(553),N=function(e,t,n,r,s,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&s.unshift(o)}else(o=a(g))&&("field"===l?s.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},Z=function(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0};(()=>{let e,t,n,r,s=[y({selector:"pg-menu",style:H.A,template:'<div part="items"></div>'})],i=[],a=HTMLElement,o=[],l=[],c=[],d=[];(class extends a{static{t=this}static{const h="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;n=[k()],r=[S()],N(null,null,n,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:h},o,l),N(null,null,r,{kind:"field",name:"$items",static:!1,private:!1,access:{has:e=>"$items"in e,get:e=>e.$items,set:(e,t)=>{e.$items=t}},metadata:h},c,d),N(null,e={value:t},s,{kind:"class",name:t.name,metadata:h},null,i),t=e.value,h&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h}),Z(t,i)}items=Z(this,o,[]);$items=(Z(this,l),Z(this,c,void 0));connectedCallback(){L({container:this.$items,items:this.items,type:e=>e.type??B,create:(e,t)=>{e.addEventListener("close",(e=>{const{depth:t}=e.detail;this.dispatchEvent(new CustomEvent("close",{detail:{depth:t}}))})),e.addEventListener("select",(e=>{const{index:n}=e.detail;this.dispatchEvent(new CustomEvent("select",{detail:{indexes:[n],item:t}}))})),e.addEventListener("up",(e=>{const{index:t}=e.detail;this.#a(t-1,-1,t)})),e.addEventListener("down",(e=>{const{index:t}=e.detail;this.#a(t+1,1,t)}))}}),this.$items.addEventListener("hasCheck",(e=>{e.stopPropagation(),this.$items.classList.toggle("check",!0)}))}#a(e,t,n){if(e===n)return;if(-1===e)return this.#a(this.items.length-1,t,n);if(e>=this.items.length)return this.#a(0,t,n);const r=this.$items.children[e];if(!1===r.focusable||this.items[e].disabled)return this.#a(e+t,t,n);r?.focus()}focus(e){if(-1===e)this.#a(0,1,this.items.length-1);else{const t=this.$items.children[e];t?.focus()}}getItemOffset(e,t){const n=getComputedStyle(this.$items);let r=parseInt(n.getPropertyValue("padding-top"),10);const s=this.items.length;if(e>s||t>s)throw new Error("startIndex or endIndex not within range of items");for(let n=e;n<t;n++){r+=this.$items.children[n].getHeight()}return r}getItemHeight(e){if(e>this.items.length)throw new Error("index outside range of items");return this.$items.children[e].getHeight()}constructor(){super(...arguments),Z(this,d)}})})()})();
|
package/pgMenuDivider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={109:(e,t,r)=>{r.d(t,{A:()=>l});var o=r(601),n=r.n(o),i=r(314),s=r.n(i)()(n());s.push([e.id,":host {\n display: contents;\n}\n\n[part=divider] {\n margin-top: 0.25rem;\n border-top: 1px solid var(--pg-menu-divider-color, rgba(69, 60, 79, 0.5));\n margin-bottom: 0.25rem;\n}\n",""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",o=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),o&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),o&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,o,n,i){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);o&&s[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),n&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=n):p[4]="".concat(n)),t.push(p))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=Symbol("addObserver"),n=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("isProxy"),a=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case s:return!0;case a:return t;case i:return c.has(e);case o:return(t,r)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(r):c.get(e).set(t,[r]):c.set(e,new Map([[t,[r]]]))};case n:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?p(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return c.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return c.get(t).forEach(((e,o)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return p(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(c.has(e)){c.get(e).forEach(((e,o)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),d=Symbol("template"),h=Symbol("style"),f=Symbol("parent");function y(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var o,n;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[f]||t.prototype[f][t.prototype[f].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[f]=[t.prototype],t.prototype[h]=e.style?[e.style]:[],t.prototype[d]=e.template||""):(t.prototype[f].push(t.prototype),t.prototype[h].push(e.style),t.prototype[d]=(o=t.prototype[d],(n=e.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):`${o}${n||""}`));const i=t.prototype.connectedCallback||(()=>{}),s=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[u]||void 0!==e.template||void 0!==e.style)if(this[u]){if(this[u]&&e.style);else if(this[u]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[d]||"";const r=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[h].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),o.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const o=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),n=()=>{this[f].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[m(t)]=!0,e)),{}):{})}))};0===o.length?(this[u]=!0,i.call(this),n()):Promise.all(o).then((()=>{this[u]=!0,i.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));n()}))},t.prototype.disconnectedCallback=function(){s.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[m(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function v(e){return!!e&&e.constructor===Array}function g(e,t){e[u]&&e[f].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":v(e)?"array":typeof e}function S(e){return function(t,r){const o=r.name,n=Symbol(o),l=Symbol(`${o}:type`),c=Symbol(`${o}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[l]||"array"===this[l]?this[n][s]?this[n]:p(this[n]):this[n],set:t=>{const r=w(e?e(t):t);if("index"!==o&&this[l]!==r&&"null"!==this[l]&&"null"!==r)throw new Error(`@Prop() ${o} with type '${this[l]}' cannot be set to ${r}.`);if("array"===this[l]){if(!v(t))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[n]===t)throw new Error("Setting an array to itself is not allowed.");const e=p(this[n]);if(e[i]){const r=t[s]?(c=t)[s]&&c[a]:t;e.splice(0,this[n].length,...r)}else this[n]=t}else this[n]=e?e(t):t,g(this,o);var c}})})),function(t){if(void 0===t&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==t&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=y(o);t[o]||(e.observedAttributes.push(r),t[o]=n)}return this[l]=w(t),"array"===this[l]?(this[n]=t,new Proxy(t,{get:(e,t)=>t===E?this[c]:(console.log("errr???"),Reflect.get(this[n],t)),set:(e,t,r)=>{if(t===E)return this[c]=r,!0;const i=Reflect.set(e,t,r);return"length"===t&&this[n].length===r||g(this,o),this[n]=r,i}})):(this[n]=e?e(this.getAttribute(o)??t):this.getAttribute(o)??t,this[n])}}}Symbol("hasProxy");const E=Symbol("meta");var P=r(109),x=function(e,t,r,o,n,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!t&&e?o.static?e:e.prototype:null,u=t||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),d=!1,h=r.length-1;h>=0;h--){var f={};for(var y in o)f[y]="access"===y?{}:o[y];for(var y in o.access)f.access[y]=o.access[y];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[h])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&n.unshift(a)}else(a=s(m))&&("field"===l?n.unshift(a):u[c]=a)}p&&Object.defineProperty(p,o.name,u),d=!0},$=function(e,t,r){for(var o=arguments.length>2,n=0;n<t.length;n++)r=o?t[n].call(e,r):t[n].call(e);return o?r:void 0};(()=>{let e,t,r,o,n=[b({selector:"pg-menu-divider",style:P.A,template:'<div part="divider"></div>'})],i=[],s=HTMLElement,a=[],l=[],c=[],p=[];(class extends s{static{t=this}static{const u="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;r=[S()],o=[function(e,t){const r=t.name,o=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}],x(null,null,r,{kind:"field",name:"focusable",static:!1,private:!1,access:{has:e=>"focusable"in e,get:e=>e.focusable,set:(e,t)=>{e.focusable=t}},metadata:u},a,l),x(null,null,o,{kind:"field",name:"$divider",static:!1,private:!1,access:{has:e=>"$divider"in e,get:e=>e.$divider,set:(e,t)=>{e.$divider=t}},metadata:u},c,p),x(null,e={value:t},n,{kind:"class",name:t.name,metadata:u},null,i),t=e.value,u&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u}),$(t,i)}focusable=$(this,a,!1);$divider=($(this,l),$(this,c,void 0));getHeight(){const e=window.getComputedStyle(this.$divider),t=parseFloat(e.marginTop),r=parseFloat(e.marginBottom);return this.$divider.getBoundingClientRect().height+t+r}constructor(){super(...arguments),$(this,p)}})})()})();
|
|
1
|
+
(()=>{"use strict";var e={109:(e,t,r)=>{r.d(t,{A:()=>l});var o=r(601),n=r.n(o),s=r(314),i=r.n(s)()(n());i.push([e.id,":host {\n display: contents;\n}\n\n[part=divider] {\n margin-top: 0.25rem;\n border-top: 1px solid var(--pg-menu-divider-color, rgba(69, 60, 79, 0.5));\n margin-bottom: 0.25rem;\n}\n",""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",o=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),o&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),o&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,o,n,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);o&&i[p[0]]||(void 0!==s&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=s),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),n&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=n):p[4]="".concat(n)),t.push(p))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={id:o,exports:{}};return e[o](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=Symbol("addObserver"),n=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function u(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return t;case s:return p.has(e);case i:return(t,r)=>{const o=p.get(e);o.forEach(((n,s)=>{if(s.getRootNode().host===t){const t=o.get(s);p.has(r)?p.get(r).has(s)?p.get(r).get(s).push(o.get(s)):p.get(r).set(s,o.get(s)):p.set(r,new Map([[s,t]])),p.delete(e),t.forEach((e=>{e(null,h.swap,[r])}))}}))};case o:return(t,r)=>{p.has(e)?p.get(e).has(t)?p.get(e).get(t).push(r):p.get(e).set(t,[r]):p.set(e,new Map([[t,[r]]]))};case n:return t=>{p.has(e)&&(p.get(e).delete(t),0===p.get(e).size&&p.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?u(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return p.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return p.get(t).forEach(((e,o)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return u(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(p.has(e)){p.get(e).forEach(((e,o)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=p;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),y=Symbol("style"),m=Symbol("parent");function g(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function v(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var o,n;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[m]||t.prototype[m][t.prototype[m].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[m]=[t.prototype],t.prototype[y]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[m].push(t.prototype),t.prototype[y].push(e.style),t.prototype[f]=(o=t.prototype[f],(n=e.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):`${o}${n||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const r=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[y].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),o.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const o=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),n=()=>{this[m].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[b(t)]=!0,e)),{}):{})}))};0===o.length?(this[d]=!0,s.call(this),n()):Promise.all(o).then((()=>{this[d]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));n()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[b(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[m].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}Symbol("hasProxy");const P=Symbol("meta");var x=r(109),$=function(e,t,r,o,n,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!t&&e?o.static?e:e.prototype:null,u=t||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),h=!1,d=r.length-1;d>=0;d--){var f={};for(var y in o)f[y]="access"===y?{}:o[y];for(var y in o.access)f.access[y]=o.access[y];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var m=(0,r[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=i(m.get))&&(u.get=a),(a=i(m.set))&&(u.set=a),(a=i(m.init))&&n.unshift(a)}else(a=i(m))&&("field"===l?n.unshift(a):u[c]=a)}p&&Object.defineProperty(p,o.name,u),h=!0},A=function(e,t,r){for(var o=arguments.length>2,n=0;n<t.length;n++)r=o?t[n].call(e,r):t[n].call(e);return o?r:void 0};(()=>{let e,t,r,o,n=[v({selector:"pg-menu-divider",style:x.A,template:'<div part="divider"></div>'})],c=[],p=HTMLElement,h=[],d=[],f=[],y=[];(class extends p{static{t=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;var b;r=[function(e,t){const r=t.name,o=Symbol(r),n=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return t.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[n]||"array"===this[n]?this[o][a]?this[o]:u(this[o]):this[o],set:e=>{const t=E(b?b(e):e);if("index"!==r&&this[n]!==t&&"null"!==this[n]&&"null"!==t)throw new Error(`@Prop() ${r} with type '${this[n]}' cannot be set to ${t}.`);if("array"===this[n]){if(!w(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[o]);if(t[s]){const n=e[a]?e[l]:e;t[i](this,n),this[o]=e,console.log(">>> trigger render???",this,r)}else this[o]=e}else this[o]=b?b(e):e,S(this,r)}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!t.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=g(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[n]=E(e),"array"===this[n]?(this[o]=e,new Proxy(e,{get:(e,t)=>t===P?this[c]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===P)return this[c]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=b?b(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}],o=[function(e,t){const r=t.name,o=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}],$(null,null,r,{kind:"field",name:"focusable",static:!1,private:!1,access:{has:e=>"focusable"in e,get:e=>e.focusable,set:(e,t)=>{e.focusable=t}},metadata:m},h,d),$(null,null,o,{kind:"field",name:"$divider",static:!1,private:!1,access:{has:e=>"$divider"in e,get:e=>e.$divider,set:(e,t)=>{e.$divider=t}},metadata:m},f,y),$(null,e={value:t},n,{kind:"class",name:t.name,metadata:m},null,c),t=e.value,m&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:m}),A(t,c)}focusable=A(this,h,!1);$divider=(A(this,d),A(this,f,void 0));getHeight(){const e=window.getComputedStyle(this.$divider),t=parseFloat(e.marginTop),r=parseFloat(e.marginBottom);return this.$divider.getBoundingClientRect().height+t+r}constructor(){super(...arguments),A(this,y)}})})()})();
|
package/pgMenuIcon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(r[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},601:t=>{t.exports=function(t){return t[1]}},915:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([t.id,"\n[part~=contextMenu] {\n position: relative;\n background: #737E9E;\n border-radius: 0.25rem;\n width: 12rem;\n display: flex;\n flex-direction: column;\n padding: 0.25rem 0;\n box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);\n}\n\n[part~=contextMenu] > div.section {\n color: #FFF;\n font-size: 0.875rem;\n padding: 0.25rem 0.5rem;\n cursor: default;\n font-weight: bold;\n}\n\n[part~=contextMenu] > div.section:not(:first-child) {\n border-top: 1px solid rgba(255, 255, 255, 0.3);\n margin-top: 0.5rem;\n}\n\n[part~=contextMenu] > div.group {\n margin: 0 0.5rem;\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 0.25rem;\n display: flex;\n flex-direction: row;\n overflow: hidden;\n}\n[part~=contextMenu] > div.row > div.group {\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 0.25rem;\n display: flex;\n flex-direction: row;\n flex: 1;\n overflow: hidden;\n}\n\n[part~=contextMenu] > div.row > div.group:first-child {\n margin-left: 0.5rem;\n margin-right: 0.25rem;\n}\n\n[part~=contextMenu] > div.row > div.group:last-child {\n margin-right: 0.5rem;\n}\n\n[part~=contextMenu] > div.group > button,\n[part~=contextMenu] > div.row > div.group > button {\n display: flex;\n flex: 1;\n padding: 0.25rem;\n justify-content: center;\n border: 0;\n margin: 0;\n background: transparent;\n color: #FFF;\n font-size: 1rem;\n line-height: 1.25rem;\n align-items: center;\n outline: none;\n}\n\n[part~=contextMenu] > button,\n[part~=contextMenu] > a {\n display: flex;\n border: 0;\n margin: 0;\n padding: 0.125rem 0.5rem;\n background: transparent;\n text-align: left;\n color: #FFF;\n font-size: 1rem;\n text-decoration: none;\n cursor: default;\n outline: none;\n}\n\n[part~=contextMenu] > div.group > button.active,\n[part~=contextMenu] > div.row > div.group > button.active {\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.1);\n}\n\n[part~=contextMenu] > div.group > button.active:hover,\n[part~=contextMenu] > div.row > div.group > button.active:hover {\n background: rgba(0, 0, 0, 0.2);\n}\n\n[part~=contextMenu] > div.group > button:not(:first-child),\n[part~=contextMenu] > div.row > div.group > button:not(:first-child) {\n border-left: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n[part~=contextMenu] > div.row > div.group > button > svg,\n[part~=contextMenu] > div.group > button > svg,\n[part~=contextMenu] > div.row > button > svg,\n[part~=contextMenu] > button > svg {\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n}\n\n[part~=contextMenu] > div.row > div.group > button:hover,\n[part~=contextMenu] > div.group > button:hover,\n[part~=contextMenu] > button:hover,\n[part~=contextMenu] > a:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n[part~=contextMenu] > div.row > div.group > button:active,\n[part~=contextMenu] > div.group > button:active {\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.2);\n}\n[part~=contextMenu] > button:active,\n[part~=contextMenu] > a:active {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.2);\n}\n\n.row {\n display: flex;\n}\n\n.divider {\n border-top: 1px solid rgba(255, 255, 255, 0.3);\n margin-top: 0.5rem;\n height: 0.4375rem;\n}\n\n.black {\n display: inline-flex;\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n background: #000;\n}\n\n.white {\n display: inline-flex;\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n background: #FFF;\n}\n\n.download svg {\n margin-bottom: -0.125rem;\n margin-left: 0.25rem;\n}\n\n[part~=color] {\n visibility: hidden;\n position: absolute;\n padding: 0.25rem;\n background: #737E9E;\n border-radius: 0.25rem;\n box-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);\n}\n\n[part~=colorHexRgb] {\n margin-bottom: 0.25rem;\n}",""]);var a=new CSSStyleSheet;a.replaceSync(r.toString());const c=a}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const o=Symbol("addObserver"),i=Symbol("removeObserver"),s=Symbol("getObservers"),r=Symbol("isProxy"),a=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function d(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case r:return!0;case a:return e;case s:return l.has(t);case o:return(e,n)=>{l.has(t)?l.get(t).has(e)?l.get(t).get(e).push(n):l.get(t).set(e,[n]):l.set(t,new Map([[e,[n]]]))};case i:return e=>{l.has(t)&&(l.get(t).delete(e),0===l.get(t).size&&l.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?d(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return l.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return l.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return d(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(l.has(t)){l.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=l;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const p=Symbol("init"),h=Symbol("template"),u=Symbol("style"),g=Symbol("parent");function v(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function f(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,i;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[g]||e.prototype[g][e.prototype[g].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[g]=[e.prototype],e.prototype[u]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[g].push(e.prototype),e.prototype[u].push(t.style),e.prototype[h]=(o=e.prototype[h],(i=t.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,o):`${o}${i||""}`));const s=e.prototype.connectedCallback||(()=>{}),r=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[p]||void 0!==t.template||void 0!==t.style)if(this[p]){if(this[p]&&t.style);else if(this[p]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[h]||"";const n=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[u].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),o.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const o=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),i=()=>{this[g].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===o.length?(this[p]=!0,s.call(this),i()):Promise.all(o).then((()=>{this[p]=!0,s.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));i()}))},e.prototype.disconnectedCallback=function(){r.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[m(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function b(t){return!!t&&t.constructor===Array}function y(t,e){t[p]&&t[g].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function $(t){return null===t?"null":b(t)?"array":typeof t}function w(t){return function(e,n){const o=n.name,i=Symbol(o),c=Symbol(`${o}:type`),l=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[c]||"array"===this[c]?this[i][r]?this[i]:d(this[i]):this[i],set:e=>{const n=$(t?t(e):e);if("index"!==o&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${o} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!b(e))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[i]===e)throw new Error("Setting an array to itself is not allowed.");const t=d(this[i]);if(t[s]){const n=e[r]?(l=e)[r]&&l[a]:e;t.splice(0,this[i].length,...n)}else this[i]=e}else this[i]=t?t(e):e,y(this,o);var l}})})),function(e){if(void 0===e&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==e&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=v(o);e[o]||(t.observedAttributes.push(n),e[o]=i)}return this[c]=$(e),"array"===this[c]?(this[i]=e,new Proxy(e,{get:(t,e)=>e===k?this[l]:(console.log("errr???"),Reflect.get(this[i],e)),set:(t,e,n)=>{if(e===k)return this[l]=n,!0;const s=Reflect.set(t,e,n);return"length"===e&&this[i].length===n||y(this,o),this[i]=n,s}})):(this[i]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[i])}}}function x(){return function(t,e){const n=e.name,o=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const k=Symbol("meta");var S=n(915);const C=t=>{var e=document.createElement("textarea");e.setAttribute("style","position:fixed;opacity:0;top:100px;left:100px;"),e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),setTimeout((function(){document.body.removeChild(e)}),1500)};const L="pgtoastadd",E="pgtoastremove";function F(t){t.key=t.key||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));const e=new CustomEvent(L,{detail:t});return document.body.dispatchEvent(e),setTimeout((()=>{!function(t){const e=new CustomEvent(E,{detail:{key:t}});document.body.dispatchEvent(e)}(t.key)}),1e3*t.seconds),t.key}function P(t,e=3){return F({type:"info",message:t,seconds:e})}class Alias{id;name;match=!1;constructor(t,e){void 0!==t&&(this.id=t),void 0!==e&&(this.name=e)}from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.name),this}to(){return{name:this.name}}}class User{id=null;github=null;name=null;base64=null;iconCount=null;description=null;website=null;sponsored=!1;sponsorship="";core=!1;from(t){return this.id=t.id,this.github=t.github,this.name=t.name,"string"==typeof t.base64&&(t.base64.match(/^data/)?this.base64=t.base64:this.base64=`data:image/png;base64,${t.base64}`),this.iconCount=t.iconCount,this.description=t.description,this.website=t.website,this.sponsored=t.sponsored,this.sponsorship=`https://github.com/users/${t.github}/sponsorship`,this.core=t.core,this}}class Tag{id;name;url;count;from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.name),void 0!==t.url&&(this.url=t.url),void 0!==t.count&&(this.count=t.count),this}to(){return{name:this.name,url:this.url,count:this.count}}}class Style{id;name;count=null;from(t){return this.id=t.id,this.name=t.name,this.count=t.count,this}}class FontIcon{id;codepoint;font;version;from(t){return this.id=t.id,this.codepoint=t.codepoint,this.font=t.font,this.version=t.version,this}to(){return{id:this.id,codepoint:this.codepoint,font:this.font,version:this.version}}}class Icon{id=null;packageId=null;baseIconId=null;name=null;description=null;data=null;user=null;version=null;aliases=[];tags=[];styles=[];published=!0;deprecated=!1;codepoint=null;fontIcons=[];fontIcon=null;constructor(t,e){this.name=t||null,this.data=e||null}from(t){return this.id=t.id,this.packageId=t.packageId,this.baseIconId=t.baseIconId,this.name=t.name,this.description=t.description,this.data=t.data,t.version&&(this.version=t.version),t.fontIcon&&(this.fontIcon=t.fontIcon),t.user&&(this.user=(new User).from(t.user)),t.aliases&&(this.aliases=t.aliases.map((t=>(new Alias).from(t)))),t.tags&&(this.tags=t.tags.map((t=>(new Tag).from(t)))),t.styles&&(this.styles=t.styles.map((t=>(new Style).from(t)))),"boolean"==typeof t.published&&(this.published=t.published),"boolean"==typeof t.deprecated&&(this.deprecated=t.deprecated),t.codepoint&&(this.codepoint=t.codepoint),t.fontIcons&&(this.fontIcons=t.fontIcons.map((t=>(new FontIcon).from(t)))),this}to(){const{id:t,name:e,description:n,data:o,version:i,fontIcon:s,packageId:r,baseIconId:a,aliases:c,tags:l}=this;return{id:t,name:e,description:n,data:o,version:i,fontIcon:s,packageId:r,baseIconId:a,aliases:c.map((t=>t.to())),tags:l.map((t=>t.to()))}}}var M=function(t,e,n,o,i,s){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",d=!e&&t?o.static?t:t.prototype:null,p=e||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),h=!1,u=n.length-1;u>=0;u--){var g={};for(var v in o)g[v]="access"===v?{}:o[v];for(var v in o.access)g.access[v]=o.access[v];g.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(r(t||null))};var m=(0,n[u])("accessor"===c?{get:p.get,set:p.set}:p[l],g);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=r(m.get))&&(p.get=a),(a=r(m.set))&&(p.set=a),(a=r(m.init))&&i.unshift(a)}else(a=r(m))&&("field"===c?i.unshift(a):p[l]=a)}d&&Object.defineProperty(d,o.name,p),h=!0},I=function(t,e,n){for(var o=arguments.length>2,i=0;i<e.length;i++)n=o?e[i].call(t,n):e[i].call(t);return o?n:void 0};(()=>{let t,e,n,o,i,s,r,a,c,l,d,p,h,u,g,v,m,b,y,$,k,L,E,F,H,R,N,T,A,O=[f({selector:"pg-menu-icon",style:S.A,template:'<div part="contextMenu"> <a part="newTab" href="">Open icon in New Tab</a> <button part="copyIconName">Copy Icon Name</button> <div class="section">Download PNG</div> <div class="group"> <button part="png24">24</button> <button part="png36">36</button> <button part="png48">48</button> <button part="png96">96</button> </div> <div class="row" style="margin-top:.25rem"> <div class="group"> <button part="pngBlack"><span class="black"></span></button> <button part="pngWhite"><span class="white"></span></button> <button part="pngColor"> <svg viewBox="0 0 24 24"> <path fill="#fff" d="M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"/> <path fill="currentColor" d="M12.97 8L15.8 10.85L7.67 19L3.71 20.68L3.15 20.11L4.84 16.15L12.97 8Z"/> </svg> </button> </div> <div class="group"> <button part="pngDownload" class="download"> PNG <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/> </svg> </button> </div> </div> <div class="section">SVG</div> <div class="row" style="margin-bottom:.25rem"> <div class="group"> <button part="svgBlack" class="active"><span class="black"></span></button> <button part="svgWhite"><span class="white"></span></button> <button part="svgColor"> <svg viewBox="0 0 24 24"> <path fill="#fff" d="M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"/> <path fill="currentColor" d="M12.97 8L15.8 10.85L7.67 19L3.71 20.68L3.15 20.11L4.84 16.15L12.97 8Z"/> </svg> </button> </div> <div class="group"> <button part="svgDownload" class="download"> SVG <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/> </svg> </button> </div> </div> <button part="copySvgInline">Copy HTML SVG Inline</button> <button part="copySvgFile">Copy SVG File Contents</button> <button part="copySvgPath">Copy SVG Path Data</button> <div class="section">Desktop Font</div> <button part="copyUnicode">Copy Unicode Character</button> <button part="copyCodepoint">Copy Codepoint</button> <div class="divider"></div> <button part="copyPreview">Copy GitHub Preview</button> <div part="color"> <pg-input-hex-rgb part="colorHexRgb"></pg-input-hex-rgb> <pg-color part="colorPicker"></pg-color> </div> </div>'})],B=[],z=HTMLElement,D=[],W=[],j=[],V=[],U=[],G=[],Z=[],J=[],q=[],_=[],Y=[],K=[],Q=[],X=[],tt=[],et=[],nt=[],ot=[],it=[],st=[],rt=[],at=[],ct=[],lt=[],dt=[],pt=[],ht=[],ut=[],gt=[],vt=[],mt=[],ft=[],bt=[],yt=[],$t=[],wt=[],xt=[],kt=[],St=[],Ct=[],Lt=[],Et=[],Ft=[],Pt=[],Mt=[],It=[],Ht=[],Rt=[],Nt=[],Tt=[],At=[],Ot=[],Bt=[],zt=[];(class extends z{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(z[Symbol.metadata]??null):void 0;var S;n=[x()],o=[x()],i=[x()],s=[x()],r=[x()],a=[x()],c=[x()],l=[x()],d=[x()],p=[x()],h=[x()],u=[x()],g=[x()],v=[x()],m=[x()],b=[x()],y=[x()],$=[x()],k=[x()],L=[x()],E=[x()],F=[x()],H=[x()],R=[x()],N=[(S="store",function(t,e){return e.name,function(t){if(!(t instanceof Map))throw new Error("@Local(key) property must be type Map");return new Proxy(t,{get(e,n){switch(n){case"get":return e=>{if(!t.has(e))throw new Error(`@Local(key) missing key ${e}`);const n=`${S}:${e}`;return null===window.localStorage.getItem(n)?t.get(e):JSON.parse(window.localStorage.getItem(n)??"null")};case"set":return(e,n)=>{if(!t.has(e))throw new Error(`@Local(key) missing key ${e}`);const o=`${S}:${e}`;null===n||JSON.stringify(n)===JSON.stringify(t.get(e))?window.localStorage.removeItem(o):window.localStorage.setItem(o,JSON.stringify(n))};default:throw new Error(`@Local(key) supported method ${n}`)}}})}})],T=[w()],A=[w()],M(null,null,n,{kind:"field",name:"$contextMenu",static:!1,private:!1,access:{has:t=>"$contextMenu"in t,get:t=>t.$contextMenu,set:(t,e)=>{t.$contextMenu=e}},metadata:f},D,W),M(null,null,o,{kind:"field",name:"$newTab",static:!1,private:!1,access:{has:t=>"$newTab"in t,get:t=>t.$newTab,set:(t,e)=>{t.$newTab=e}},metadata:f},j,V),M(null,null,i,{kind:"field",name:"$copyIconName",static:!1,private:!1,access:{has:t=>"$copyIconName"in t,get:t=>t.$copyIconName,set:(t,e)=>{t.$copyIconName=e}},metadata:f},U,G),M(null,null,s,{kind:"field",name:"$pngBlack",static:!1,private:!1,access:{has:t=>"$pngBlack"in t,get:t=>t.$pngBlack,set:(t,e)=>{t.$pngBlack=e}},metadata:f},Z,J),M(null,null,r,{kind:"field",name:"$pngWhite",static:!1,private:!1,access:{has:t=>"$pngWhite"in t,get:t=>t.$pngWhite,set:(t,e)=>{t.$pngWhite=e}},metadata:f},q,_),M(null,null,a,{kind:"field",name:"$pngColor",static:!1,private:!1,access:{has:t=>"$pngColor"in t,get:t=>t.$pngColor,set:(t,e)=>{t.$pngColor=e}},metadata:f},Y,K),M(null,null,c,{kind:"field",name:"$png24",static:!1,private:!1,access:{has:t=>"$png24"in t,get:t=>t.$png24,set:(t,e)=>{t.$png24=e}},metadata:f},Q,X),M(null,null,l,{kind:"field",name:"$png36",static:!1,private:!1,access:{has:t=>"$png36"in t,get:t=>t.$png36,set:(t,e)=>{t.$png36=e}},metadata:f},tt,et),M(null,null,d,{kind:"field",name:"$png48",static:!1,private:!1,access:{has:t=>"$png48"in t,get:t=>t.$png48,set:(t,e)=>{t.$png48=e}},metadata:f},nt,ot),M(null,null,p,{kind:"field",name:"$png96",static:!1,private:!1,access:{has:t=>"$png96"in t,get:t=>t.$png96,set:(t,e)=>{t.$png96=e}},metadata:f},it,st),M(null,null,h,{kind:"field",name:"$pngDownload",static:!1,private:!1,access:{has:t=>"$pngDownload"in t,get:t=>t.$pngDownload,set:(t,e)=>{t.$pngDownload=e}},metadata:f},rt,at),M(null,null,u,{kind:"field",name:"$svgBlack",static:!1,private:!1,access:{has:t=>"$svgBlack"in t,get:t=>t.$svgBlack,set:(t,e)=>{t.$svgBlack=e}},metadata:f},ct,lt),M(null,null,g,{kind:"field",name:"$svgWhite",static:!1,private:!1,access:{has:t=>"$svgWhite"in t,get:t=>t.$svgWhite,set:(t,e)=>{t.$svgWhite=e}},metadata:f},dt,pt),M(null,null,v,{kind:"field",name:"$svgColor",static:!1,private:!1,access:{has:t=>"$svgColor"in t,get:t=>t.$svgColor,set:(t,e)=>{t.$svgColor=e}},metadata:f},ht,ut),M(null,null,m,{kind:"field",name:"$svgDownload",static:!1,private:!1,access:{has:t=>"$svgDownload"in t,get:t=>t.$svgDownload,set:(t,e)=>{t.$svgDownload=e}},metadata:f},gt,vt),M(null,null,b,{kind:"field",name:"$copySvgInline",static:!1,private:!1,access:{has:t=>"$copySvgInline"in t,get:t=>t.$copySvgInline,set:(t,e)=>{t.$copySvgInline=e}},metadata:f},mt,ft),M(null,null,y,{kind:"field",name:"$copySvgFile",static:!1,private:!1,access:{has:t=>"$copySvgFile"in t,get:t=>t.$copySvgFile,set:(t,e)=>{t.$copySvgFile=e}},metadata:f},bt,yt),M(null,null,$,{kind:"field",name:"$copySvgPath",static:!1,private:!1,access:{has:t=>"$copySvgPath"in t,get:t=>t.$copySvgPath,set:(t,e)=>{t.$copySvgPath=e}},metadata:f},$t,wt),M(null,null,k,{kind:"field",name:"$copyUnicode",static:!1,private:!1,access:{has:t=>"$copyUnicode"in t,get:t=>t.$copyUnicode,set:(t,e)=>{t.$copyUnicode=e}},metadata:f},xt,kt),M(null,null,L,{kind:"field",name:"$copyCodepoint",static:!1,private:!1,access:{has:t=>"$copyCodepoint"in t,get:t=>t.$copyCodepoint,set:(t,e)=>{t.$copyCodepoint=e}},metadata:f},St,Ct),M(null,null,E,{kind:"field",name:"$copyPreview",static:!1,private:!1,access:{has:t=>"$copyPreview"in t,get:t=>t.$copyPreview,set:(t,e)=>{t.$copyPreview=e}},metadata:f},Lt,Et),M(null,null,F,{kind:"field",name:"$color",static:!1,private:!1,access:{has:t=>"$color"in t,get:t=>t.$color,set:(t,e)=>{t.$color=e}},metadata:f},Ft,Pt),M(null,null,H,{kind:"field",name:"$colorPicker",static:!1,private:!1,access:{has:t=>"$colorPicker"in t,get:t=>t.$colorPicker,set:(t,e)=>{t.$colorPicker=e}},metadata:f},Mt,It),M(null,null,R,{kind:"field",name:"$colorHexRgb",static:!1,private:!1,access:{has:t=>"$colorHexRgb"in t,get:t=>t.$colorHexRgb,set:(t,e)=>{t.$colorHexRgb=e}},metadata:f},Ht,Rt),M(null,null,N,{kind:"field",name:"store",static:!1,private:!1,access:{has:t=>"store"in t,get:t=>t.store,set:(t,e)=>{t.store=e}},metadata:f},Nt,Tt),M(null,null,T,{kind:"field",name:"currentIndex",static:!1,private:!1,access:{has:t=>"currentIndex"in t,get:t=>t.currentIndex,set:(t,e)=>{t.currentIndex=e}},metadata:f},At,Ot),M(null,null,A,{kind:"field",name:"icon",static:!1,private:!1,access:{has:t=>"icon"in t,get:t=>t.icon,set:(t,e)=>{t.icon=e}},metadata:f},Bt,zt),M(null,t={value:e},O,{kind:"class",name:e.name,metadata:f},null,B),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),I(e,B)}$contextMenu=I(this,D,void 0);$newTab=(I(this,W),I(this,j,void 0));$copyIconName=(I(this,V),I(this,U,void 0));$pngBlack=(I(this,G),I(this,Z,void 0));$pngWhite=(I(this,J),I(this,q,void 0));$pngColor=(I(this,_),I(this,Y,void 0));$png24=(I(this,K),I(this,Q,void 0));$png36=(I(this,X),I(this,tt,void 0));$png48=(I(this,et),I(this,nt,void 0));$png96=(I(this,ot),I(this,it,void 0));$pngDownload=(I(this,st),I(this,rt,void 0));$svgBlack=(I(this,at),I(this,ct,void 0));$svgWhite=(I(this,lt),I(this,dt,void 0));$svgColor=(I(this,pt),I(this,ht,void 0));$svgDownload=(I(this,ut),I(this,gt,void 0));$copySvgInline=(I(this,vt),I(this,mt,void 0));$copySvgFile=(I(this,ft),I(this,bt,void 0));$copySvgPath=(I(this,yt),I(this,$t,void 0));$copyUnicode=(I(this,wt),I(this,xt,void 0));$copyCodepoint=(I(this,kt),I(this,St,void 0));$copyPreview=(I(this,Ct),I(this,Lt,void 0));$color=(I(this,Et),I(this,Ft,void 0));$colorPicker=(I(this,Pt),I(this,Mt,void 0));$colorHexRgb=(I(this,It),I(this,Ht,void 0));store=(I(this,Rt),I(this,Nt,new Map([["cachePngColor","#000000"],["cachePngSize",24],["cacheSvgColor","#000000"]])));color=(I(this,Tt),"svg");currentIndex=I(this,At,0);icon=(I(this,Ot),I(this,Bt,new Icon));connectedCallback(){this.$copyIconName.addEventListener("click",this.handleCopyIconName.bind(this)),this.$svgBlack.addEventListener("click",(()=>{this.store.set("cacheSvgColor","#000000"),this.render()})),this.$svgWhite.addEventListener("click",(()=>{this.store.set("cacheSvgColor","#FFFFFF"),this.render()}));let t=!1;this.$svgColor.addEventListener("click",(()=>{if(t)return void(t=!1);this.color="svg",this.$colorPicker.value=this.store.get("cacheSvgColor"),this.$colorHexRgb.value=this.store.get("cacheSvgColor");const e=this;this.$color.style.visibility="visible";let n=!0;this.$color.addEventListener("mouseenter",(()=>n=!1)),this.$color.addEventListener("mouseleave",(()=>n=!0)),document.addEventListener("mousedown",(function o(i){n&&(e.$color.style.visibility="hidden",document.removeEventListener("mousedown",o),t=!0,e.render(),setTimeout((()=>t=!1),500))}))})),this.$pngBlack.addEventListener("click",(()=>{this.store.set("cachePngColor","#000000"),this.render()})),this.$pngWhite.addEventListener("click",(()=>{this.store.set("cachePngColor","#FFFFFF"),this.render()}));let e=!1;this.$pngColor.addEventListener("click",(()=>{if(e)return void(e=!1);this.color="png",this.$colorPicker.value=this.store.get("cachePngColor"),this.$colorHexRgb.value=this.store.get("cachePngColor");const t=this;this.$color.style.visibility="visible";let n=!0;this.$color.addEventListener("mouseenter",(()=>n=!1)),this.$color.addEventListener("mouseleave",(()=>n=!0)),document.addEventListener("mousedown",(function o(i){n&&(t.$color.style.visibility="hidden",document.removeEventListener("mousedown",o),e=!0,t.render(),setTimeout((()=>e=!1),500))}))})),this.$png24.addEventListener("click",(()=>{this.store.set("cachePngSize",24),this.render()})),this.$png36.addEventListener("click",(()=>{this.store.set("cachePngSize",36),this.render()})),this.$png48.addEventListener("click",(()=>{this.store.set("cachePngSize",48),this.render()})),this.$png96.addEventListener("click",(()=>{this.store.set("cachePngSize",96),this.render()})),this.$svgDownload.addEventListener("click",(()=>{alert(`SVG ${this.store.get("cacheSvgColor")}`)})),this.$pngDownload.addEventListener("click",(()=>{alert(`SVG ${this.store.get("cachePngSize")} ${this.store.get("cachePngColor")}`)})),this.$copySvgInline.addEventListener("click",(()=>{const t=this.icon;C(function(t){return`<svg viewBox="0 0 24 24"><path fill="currentColor" d="${t.data}"/></svg>`}(t)),this.hideContextMenu(),P(`Copied inline SVG "${t.name}" to clipboard.`)})),this.$copySvgFile.addEventListener("click",(()=>{})),this.$copySvgPath.addEventListener("click",(()=>{})),this.$copyUnicode.addEventListener("click",(()=>{})),this.$copyCodepoint.addEventListener("click",(()=>{})),this.$copyPreview.addEventListener("click",(()=>{}))}handleCopyIconName(){const t=this.icon;t&&t.name&&(C(t.name),P(`Copied "${t.name}" to clipboard.`)),this.hideContextMenu()}hideContextMenu(){}showContextMenu(t,e,n){this.dispatchEvent(new CustomEvent("closemenu"))}render(){const t=this.store.get("cacheSvgColor"),e=this.store.get("cachePngColor"),n=this.store.get("cachePngSize");this.$svgBlack.classList.toggle("active","#000000"===t),this.$svgWhite.classList.toggle("active","#FFFFFF"===t),this.$svgColor.classList.toggle("active","#000000"!==t&&"#FFFFFF"!==t),this.$pngBlack.classList.toggle("active","#000000"===e),this.$pngWhite.classList.toggle("active","#FFFFFF"===e),this.$pngColor.classList.toggle("active","#000000"!==e&&"#FFFFFF"!==e),this.$png24.classList.toggle("active",24===n),this.$png36.classList.toggle("active",36===n),this.$png48.classList.toggle("active",48===n),this.$png96.classList.toggle("active",96===n),this.$colorPicker.addEventListener("select",this.handleColorSelect.bind(this)),this.$colorHexRgb.addEventListener("change",this.handleHexRgbChange.bind(this)),this.syncEyedropper()}handleColorSelect(t){switch(this.color){case"svg":this.store.set("cacheSvgColor",t.detail.hex);break;case"png":this.store.set("cachePngColor",t.detail.hex)}this.$colorHexRgb.value=t.detail.hex,this.syncEyedropper()}handleHexRgbChange(t){switch(this.color){case"svg":this.store.set("cacheSvgColor",t.detail.hex);break;case"png":this.store.set("cachePngColor",t.detail.hex)}this.$colorPicker.value=t.detail.hex,this.syncEyedropper()}syncEyedropper(){const t=this.store.get("cachePngColor");this.$pngColor.style.color="#000000"!==t&&"#FFFFFF"!==t?t:"transparent";const e=this.store.get("cacheSvgColor");this.$svgColor.style.color="#000000"!==e&&"#FFFFFF"!==e?e:"transparent"}constructor(){super(...arguments),I(this,zt)}})})()})();
|
|
1
|
+
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(r[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},601:t=>{t.exports=function(t){return t[1]}},915:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([t.id,"\n[part~=contextMenu] {\n position: relative;\n background: #737E9E;\n border-radius: 0.25rem;\n width: 12rem;\n display: flex;\n flex-direction: column;\n padding: 0.25rem 0;\n box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);\n}\n\n[part~=contextMenu] > div.section {\n color: #FFF;\n font-size: 0.875rem;\n padding: 0.25rem 0.5rem;\n cursor: default;\n font-weight: bold;\n}\n\n[part~=contextMenu] > div.section:not(:first-child) {\n border-top: 1px solid rgba(255, 255, 255, 0.3);\n margin-top: 0.5rem;\n}\n\n[part~=contextMenu] > div.group {\n margin: 0 0.5rem;\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 0.25rem;\n display: flex;\n flex-direction: row;\n overflow: hidden;\n}\n[part~=contextMenu] > div.row > div.group {\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 0.25rem;\n display: flex;\n flex-direction: row;\n flex: 1;\n overflow: hidden;\n}\n\n[part~=contextMenu] > div.row > div.group:first-child {\n margin-left: 0.5rem;\n margin-right: 0.25rem;\n}\n\n[part~=contextMenu] > div.row > div.group:last-child {\n margin-right: 0.5rem;\n}\n\n[part~=contextMenu] > div.group > button,\n[part~=contextMenu] > div.row > div.group > button {\n display: flex;\n flex: 1;\n padding: 0.25rem;\n justify-content: center;\n border: 0;\n margin: 0;\n background: transparent;\n color: #FFF;\n font-size: 1rem;\n line-height: 1.25rem;\n align-items: center;\n outline: none;\n}\n\n[part~=contextMenu] > button,\n[part~=contextMenu] > a {\n display: flex;\n border: 0;\n margin: 0;\n padding: 0.125rem 0.5rem;\n background: transparent;\n text-align: left;\n color: #FFF;\n font-size: 1rem;\n text-decoration: none;\n cursor: default;\n outline: none;\n}\n\n[part~=contextMenu] > div.group > button.active,\n[part~=contextMenu] > div.row > div.group > button.active {\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.1);\n}\n\n[part~=contextMenu] > div.group > button.active:hover,\n[part~=contextMenu] > div.row > div.group > button.active:hover {\n background: rgba(0, 0, 0, 0.2);\n}\n\n[part~=contextMenu] > div.group > button:not(:first-child),\n[part~=contextMenu] > div.row > div.group > button:not(:first-child) {\n border-left: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n[part~=contextMenu] > div.row > div.group > button > svg,\n[part~=contextMenu] > div.group > button > svg,\n[part~=contextMenu] > div.row > button > svg,\n[part~=contextMenu] > button > svg {\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n}\n\n[part~=contextMenu] > div.row > div.group > button:hover,\n[part~=contextMenu] > div.group > button:hover,\n[part~=contextMenu] > button:hover,\n[part~=contextMenu] > a:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n[part~=contextMenu] > div.row > div.group > button:active,\n[part~=contextMenu] > div.group > button:active {\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.2);\n}\n[part~=contextMenu] > button:active,\n[part~=contextMenu] > a:active {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.2);\n}\n\n.row {\n display: flex;\n}\n\n.divider {\n border-top: 1px solid rgba(255, 255, 255, 0.3);\n margin-top: 0.5rem;\n height: 0.4375rem;\n}\n\n.black {\n display: inline-flex;\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n background: #000;\n}\n\n.white {\n display: inline-flex;\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n background: #FFF;\n}\n\n.download svg {\n margin-bottom: -0.125rem;\n margin-left: 0.25rem;\n}\n\n[part~=color] {\n visibility: hidden;\n position: absolute;\n padding: 0.25rem;\n background: #737E9E;\n border-radius: 0.25rem;\n box-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);\n}\n\n[part~=colorHexRgb] {\n margin-bottom: 0.25rem;\n}",""]);var a=new CSSStyleSheet;a.replaceSync(r.toString());const c=a}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const o=Symbol("addObserver"),i=Symbol("removeObserver"),s=Symbol("getObservers"),r=Symbol("swapObserver"),a=Symbol("isProxy"),c=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case a:return!0;case c:return e;case s:return d.has(t);case r:return(e,n)=>{const o=d.get(t);o.forEach(((i,s)=>{if(s.getRootNode().host===e){const e=o.get(s);d.has(n)?d.get(n).has(s)?d.get(n).get(s).push(o.get(s)):d.get(n).set(s,o.get(s)):d.set(n,new Map([[s,e]])),d.delete(t),e.forEach((t=>{t(null,h.swap,[n])}))}}))};case o:return(e,n)=>{d.has(t)?d.get(t).has(e)?d.get(t).get(e).push(n):d.get(t).set(e,[n]):d.set(t,new Map([[e,[n]]]))};case i:return e=>{d.has(t)&&(d.get(t).delete(e),0===d.get(t).size&&d.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?p(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return d.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return d.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return p(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(d.has(t)){d.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=d;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),g=Symbol("template"),v=Symbol("style"),m=Symbol("parent");function f(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function y(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,i;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[m]||e.prototype[m][e.prototype[m].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[m]=[e.prototype],e.prototype[v]=t.style?[t.style]:[],e.prototype[g]=t.template||""):(e.prototype[m].push(e.prototype),e.prototype[v].push(t.style),e.prototype[g]=(o=e.prototype[g],(i=t.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,o):`${o}${i||""}`));const s=e.prototype.connectedCallback||(()=>{}),r=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[g]||"";const n=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[v].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),o.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const o=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),i=()=>{this[m].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[b(e)]=!0,t)),{}):{})}))};0===o.length?(this[u]=!0,s.call(this),i()):Promise.all(o).then((()=>{this[u]=!0,s.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));i()}))},e.prototype.disconnectedCallback=function(){r.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[b(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function $(t){return!!t&&t.constructor===Array}function w(t,e){t[u]&&t[m].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function x(t){return null===t?"null":$(t)?"array":typeof t}function k(t){return function(e,n){const o=n.name,i=Symbol(o),l=Symbol(`${o}:type`),d=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[l]||"array"===this[l]?this[i][a]?this[i]:p(this[i]):this[i],set:e=>{const n=x(t?t(e):e);if("index"!==o&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${o} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!$(e))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[i]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[i]);if(t[s]){const n=e[a]?e[c]:e;t[r](this,n),this[i]=e,console.log(">>> trigger render???",this,o)}else this[i]=e}else this[i]=t?t(e):e,w(this,o)}})})),function(e){if(void 0===e&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==e&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=f(o);e[o]||(t.observedAttributes.push(n),e[o]=i)}return this[l]=x(e),"array"===this[l]?(this[i]=e,new Proxy(e,{get:(t,e)=>e===C?this[d]:(console.log("errr???"),Reflect.get(this[i],e)),set:(t,e,n)=>{if(e===C)return this[d]=n,!0;const s=Reflect.set(t,e,n);return"length"===e&&this[i].length===n||w(this,o),this[i]=n,s}})):(this[i]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[i])}}}function S(){return function(t,e){const n=e.name,o=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const C=Symbol("meta");var L=n(915);const E=t=>{var e=document.createElement("textarea");e.setAttribute("style","position:fixed;opacity:0;top:100px;left:100px;"),e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),setTimeout((function(){document.body.removeChild(e)}),1500)};const F="pgtoastadd",P="pgtoastremove";function M(t){t.key=t.key||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));const e=new CustomEvent(F,{detail:t});return document.body.dispatchEvent(e),setTimeout((()=>{!function(t){const e=new CustomEvent(P,{detail:{key:t}});document.body.dispatchEvent(e)}(t.key)}),1e3*t.seconds),t.key}function I(t,e=3){return M({type:"info",message:t,seconds:e})}class Alias{id;name;match=!1;constructor(t,e){void 0!==t&&(this.id=t),void 0!==e&&(this.name=e)}from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.name),this}to(){return{name:this.name}}}class User{id=null;github=null;name=null;base64=null;iconCount=null;description=null;website=null;sponsored=!1;sponsorship="";core=!1;from(t){return this.id=t.id,this.github=t.github,this.name=t.name,"string"==typeof t.base64&&(t.base64.match(/^data/)?this.base64=t.base64:this.base64=`data:image/png;base64,${t.base64}`),this.iconCount=t.iconCount,this.description=t.description,this.website=t.website,this.sponsored=t.sponsored,this.sponsorship=`https://github.com/users/${t.github}/sponsorship`,this.core=t.core,this}}class Tag{id;name;url;count;from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.name),void 0!==t.url&&(this.url=t.url),void 0!==t.count&&(this.count=t.count),this}to(){return{name:this.name,url:this.url,count:this.count}}}class Style{id;name;count=null;from(t){return this.id=t.id,this.name=t.name,this.count=t.count,this}}class FontIcon{id;codepoint;font;version;from(t){return this.id=t.id,this.codepoint=t.codepoint,this.font=t.font,this.version=t.version,this}to(){return{id:this.id,codepoint:this.codepoint,font:this.font,version:this.version}}}class Icon{id=null;packageId=null;baseIconId=null;name=null;description=null;data=null;user=null;version=null;aliases=[];tags=[];styles=[];published=!0;deprecated=!1;codepoint=null;fontIcons=[];fontIcon=null;constructor(t,e){this.name=t||null,this.data=e||null}from(t){return this.id=t.id,this.packageId=t.packageId,this.baseIconId=t.baseIconId,this.name=t.name,this.description=t.description,this.data=t.data,t.version&&(this.version=t.version),t.fontIcon&&(this.fontIcon=t.fontIcon),t.user&&(this.user=(new User).from(t.user)),t.aliases&&(this.aliases=t.aliases.map((t=>(new Alias).from(t)))),t.tags&&(this.tags=t.tags.map((t=>(new Tag).from(t)))),t.styles&&(this.styles=t.styles.map((t=>(new Style).from(t)))),"boolean"==typeof t.published&&(this.published=t.published),"boolean"==typeof t.deprecated&&(this.deprecated=t.deprecated),t.codepoint&&(this.codepoint=t.codepoint),t.fontIcons&&(this.fontIcons=t.fontIcons.map((t=>(new FontIcon).from(t)))),this}to(){const{id:t,name:e,description:n,data:o,version:i,fontIcon:s,packageId:r,baseIconId:a,aliases:c,tags:l}=this;return{id:t,name:e,description:n,data:o,version:i,fontIcon:s,packageId:r,baseIconId:a,aliases:c.map((t=>t.to())),tags:l.map((t=>t.to()))}}}var H=function(t,e,n,o,i,s){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",d=!e&&t?o.static?t:t.prototype:null,p=e||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),h=!1,u=n.length-1;u>=0;u--){var g={};for(var v in o)g[v]="access"===v?{}:o[v];for(var v in o.access)g.access[v]=o.access[v];g.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(r(t||null))};var m=(0,n[u])("accessor"===c?{get:p.get,set:p.set}:p[l],g);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=r(m.get))&&(p.get=a),(a=r(m.set))&&(p.set=a),(a=r(m.init))&&i.unshift(a)}else(a=r(m))&&("field"===c?i.unshift(a):p[l]=a)}d&&Object.defineProperty(d,o.name,p),h=!0},R=function(t,e,n){for(var o=arguments.length>2,i=0;i<e.length;i++)n=o?e[i].call(t,n):e[i].call(t);return o?n:void 0};(()=>{let t,e,n,o,i,s,r,a,c,l,d,p,h,u,g,v,m,f,b,$,w,x,C,F,P,M,N,T,O,A=[y({selector:"pg-menu-icon",style:L.A,template:'<div part="contextMenu"> <a part="newTab" href="">Open icon in New Tab</a> <button part="copyIconName">Copy Icon Name</button> <div class="section">Download PNG</div> <div class="group"> <button part="png24">24</button> <button part="png36">36</button> <button part="png48">48</button> <button part="png96">96</button> </div> <div class="row" style="margin-top:.25rem"> <div class="group"> <button part="pngBlack"><span class="black"></span></button> <button part="pngWhite"><span class="white"></span></button> <button part="pngColor"> <svg viewBox="0 0 24 24"> <path fill="#fff" d="M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"/> <path fill="currentColor" d="M12.97 8L15.8 10.85L7.67 19L3.71 20.68L3.15 20.11L4.84 16.15L12.97 8Z"/> </svg> </button> </div> <div class="group"> <button part="pngDownload" class="download"> PNG <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/> </svg> </button> </div> </div> <div class="section">SVG</div> <div class="row" style="margin-bottom:.25rem"> <div class="group"> <button part="svgBlack" class="active"><span class="black"></span></button> <button part="svgWhite"><span class="white"></span></button> <button part="svgColor"> <svg viewBox="0 0 24 24"> <path fill="#fff" d="M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"/> <path fill="currentColor" d="M12.97 8L15.8 10.85L7.67 19L3.71 20.68L3.15 20.11L4.84 16.15L12.97 8Z"/> </svg> </button> </div> <div class="group"> <button part="svgDownload" class="download"> SVG <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/> </svg> </button> </div> </div> <button part="copySvgInline">Copy HTML SVG Inline</button> <button part="copySvgFile">Copy SVG File Contents</button> <button part="copySvgPath">Copy SVG Path Data</button> <div class="section">Desktop Font</div> <button part="copyUnicode">Copy Unicode Character</button> <button part="copyCodepoint">Copy Codepoint</button> <div class="divider"></div> <button part="copyPreview">Copy GitHub Preview</button> <div part="color"> <pg-input-hex-rgb part="colorHexRgb"></pg-input-hex-rgb> <pg-color part="colorPicker"></pg-color> </div> </div>'})],B=[],z=HTMLElement,D=[],W=[],j=[],V=[],U=[],G=[],Z=[],J=[],q=[],_=[],Y=[],K=[],Q=[],X=[],tt=[],et=[],nt=[],ot=[],it=[],st=[],rt=[],at=[],ct=[],lt=[],dt=[],pt=[],ht=[],ut=[],gt=[],vt=[],mt=[],ft=[],bt=[],yt=[],$t=[],wt=[],xt=[],kt=[],St=[],Ct=[],Lt=[],Et=[],Ft=[],Pt=[],Mt=[],It=[],Ht=[],Rt=[],Nt=[],Tt=[],Ot=[],At=[],Bt=[],zt=[];(class extends z{static{e=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(z[Symbol.metadata]??null):void 0;var L;n=[S()],o=[S()],i=[S()],s=[S()],r=[S()],a=[S()],c=[S()],l=[S()],d=[S()],p=[S()],h=[S()],u=[S()],g=[S()],v=[S()],m=[S()],f=[S()],b=[S()],$=[S()],w=[S()],x=[S()],C=[S()],F=[S()],P=[S()],M=[S()],N=[(L="store",function(t,e){return e.name,function(t){if(!(t instanceof Map))throw new Error("@Local(key) property must be type Map");return new Proxy(t,{get(e,n){switch(n){case"get":return e=>{if(!t.has(e))throw new Error(`@Local(key) missing key ${e}`);const n=`${L}:${e}`;return null===window.localStorage.getItem(n)?t.get(e):JSON.parse(window.localStorage.getItem(n)??"null")};case"set":return(e,n)=>{if(!t.has(e))throw new Error(`@Local(key) missing key ${e}`);const o=`${L}:${e}`;null===n||JSON.stringify(n)===JSON.stringify(t.get(e))?window.localStorage.removeItem(o):window.localStorage.setItem(o,JSON.stringify(n))};default:throw new Error(`@Local(key) supported method ${n}`)}}})}})],T=[k()],O=[k()],H(null,null,n,{kind:"field",name:"$contextMenu",static:!1,private:!1,access:{has:t=>"$contextMenu"in t,get:t=>t.$contextMenu,set:(t,e)=>{t.$contextMenu=e}},metadata:y},D,W),H(null,null,o,{kind:"field",name:"$newTab",static:!1,private:!1,access:{has:t=>"$newTab"in t,get:t=>t.$newTab,set:(t,e)=>{t.$newTab=e}},metadata:y},j,V),H(null,null,i,{kind:"field",name:"$copyIconName",static:!1,private:!1,access:{has:t=>"$copyIconName"in t,get:t=>t.$copyIconName,set:(t,e)=>{t.$copyIconName=e}},metadata:y},U,G),H(null,null,s,{kind:"field",name:"$pngBlack",static:!1,private:!1,access:{has:t=>"$pngBlack"in t,get:t=>t.$pngBlack,set:(t,e)=>{t.$pngBlack=e}},metadata:y},Z,J),H(null,null,r,{kind:"field",name:"$pngWhite",static:!1,private:!1,access:{has:t=>"$pngWhite"in t,get:t=>t.$pngWhite,set:(t,e)=>{t.$pngWhite=e}},metadata:y},q,_),H(null,null,a,{kind:"field",name:"$pngColor",static:!1,private:!1,access:{has:t=>"$pngColor"in t,get:t=>t.$pngColor,set:(t,e)=>{t.$pngColor=e}},metadata:y},Y,K),H(null,null,c,{kind:"field",name:"$png24",static:!1,private:!1,access:{has:t=>"$png24"in t,get:t=>t.$png24,set:(t,e)=>{t.$png24=e}},metadata:y},Q,X),H(null,null,l,{kind:"field",name:"$png36",static:!1,private:!1,access:{has:t=>"$png36"in t,get:t=>t.$png36,set:(t,e)=>{t.$png36=e}},metadata:y},tt,et),H(null,null,d,{kind:"field",name:"$png48",static:!1,private:!1,access:{has:t=>"$png48"in t,get:t=>t.$png48,set:(t,e)=>{t.$png48=e}},metadata:y},nt,ot),H(null,null,p,{kind:"field",name:"$png96",static:!1,private:!1,access:{has:t=>"$png96"in t,get:t=>t.$png96,set:(t,e)=>{t.$png96=e}},metadata:y},it,st),H(null,null,h,{kind:"field",name:"$pngDownload",static:!1,private:!1,access:{has:t=>"$pngDownload"in t,get:t=>t.$pngDownload,set:(t,e)=>{t.$pngDownload=e}},metadata:y},rt,at),H(null,null,u,{kind:"field",name:"$svgBlack",static:!1,private:!1,access:{has:t=>"$svgBlack"in t,get:t=>t.$svgBlack,set:(t,e)=>{t.$svgBlack=e}},metadata:y},ct,lt),H(null,null,g,{kind:"field",name:"$svgWhite",static:!1,private:!1,access:{has:t=>"$svgWhite"in t,get:t=>t.$svgWhite,set:(t,e)=>{t.$svgWhite=e}},metadata:y},dt,pt),H(null,null,v,{kind:"field",name:"$svgColor",static:!1,private:!1,access:{has:t=>"$svgColor"in t,get:t=>t.$svgColor,set:(t,e)=>{t.$svgColor=e}},metadata:y},ht,ut),H(null,null,m,{kind:"field",name:"$svgDownload",static:!1,private:!1,access:{has:t=>"$svgDownload"in t,get:t=>t.$svgDownload,set:(t,e)=>{t.$svgDownload=e}},metadata:y},gt,vt),H(null,null,f,{kind:"field",name:"$copySvgInline",static:!1,private:!1,access:{has:t=>"$copySvgInline"in t,get:t=>t.$copySvgInline,set:(t,e)=>{t.$copySvgInline=e}},metadata:y},mt,ft),H(null,null,b,{kind:"field",name:"$copySvgFile",static:!1,private:!1,access:{has:t=>"$copySvgFile"in t,get:t=>t.$copySvgFile,set:(t,e)=>{t.$copySvgFile=e}},metadata:y},bt,yt),H(null,null,$,{kind:"field",name:"$copySvgPath",static:!1,private:!1,access:{has:t=>"$copySvgPath"in t,get:t=>t.$copySvgPath,set:(t,e)=>{t.$copySvgPath=e}},metadata:y},$t,wt),H(null,null,w,{kind:"field",name:"$copyUnicode",static:!1,private:!1,access:{has:t=>"$copyUnicode"in t,get:t=>t.$copyUnicode,set:(t,e)=>{t.$copyUnicode=e}},metadata:y},xt,kt),H(null,null,x,{kind:"field",name:"$copyCodepoint",static:!1,private:!1,access:{has:t=>"$copyCodepoint"in t,get:t=>t.$copyCodepoint,set:(t,e)=>{t.$copyCodepoint=e}},metadata:y},St,Ct),H(null,null,C,{kind:"field",name:"$copyPreview",static:!1,private:!1,access:{has:t=>"$copyPreview"in t,get:t=>t.$copyPreview,set:(t,e)=>{t.$copyPreview=e}},metadata:y},Lt,Et),H(null,null,F,{kind:"field",name:"$color",static:!1,private:!1,access:{has:t=>"$color"in t,get:t=>t.$color,set:(t,e)=>{t.$color=e}},metadata:y},Ft,Pt),H(null,null,P,{kind:"field",name:"$colorPicker",static:!1,private:!1,access:{has:t=>"$colorPicker"in t,get:t=>t.$colorPicker,set:(t,e)=>{t.$colorPicker=e}},metadata:y},Mt,It),H(null,null,M,{kind:"field",name:"$colorHexRgb",static:!1,private:!1,access:{has:t=>"$colorHexRgb"in t,get:t=>t.$colorHexRgb,set:(t,e)=>{t.$colorHexRgb=e}},metadata:y},Ht,Rt),H(null,null,N,{kind:"field",name:"store",static:!1,private:!1,access:{has:t=>"store"in t,get:t=>t.store,set:(t,e)=>{t.store=e}},metadata:y},Nt,Tt),H(null,null,T,{kind:"field",name:"currentIndex",static:!1,private:!1,access:{has:t=>"currentIndex"in t,get:t=>t.currentIndex,set:(t,e)=>{t.currentIndex=e}},metadata:y},Ot,At),H(null,null,O,{kind:"field",name:"icon",static:!1,private:!1,access:{has:t=>"icon"in t,get:t=>t.icon,set:(t,e)=>{t.icon=e}},metadata:y},Bt,zt),H(null,t={value:e},A,{kind:"class",name:e.name,metadata:y},null,B),e=t.value,y&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),R(e,B)}$contextMenu=R(this,D,void 0);$newTab=(R(this,W),R(this,j,void 0));$copyIconName=(R(this,V),R(this,U,void 0));$pngBlack=(R(this,G),R(this,Z,void 0));$pngWhite=(R(this,J),R(this,q,void 0));$pngColor=(R(this,_),R(this,Y,void 0));$png24=(R(this,K),R(this,Q,void 0));$png36=(R(this,X),R(this,tt,void 0));$png48=(R(this,et),R(this,nt,void 0));$png96=(R(this,ot),R(this,it,void 0));$pngDownload=(R(this,st),R(this,rt,void 0));$svgBlack=(R(this,at),R(this,ct,void 0));$svgWhite=(R(this,lt),R(this,dt,void 0));$svgColor=(R(this,pt),R(this,ht,void 0));$svgDownload=(R(this,ut),R(this,gt,void 0));$copySvgInline=(R(this,vt),R(this,mt,void 0));$copySvgFile=(R(this,ft),R(this,bt,void 0));$copySvgPath=(R(this,yt),R(this,$t,void 0));$copyUnicode=(R(this,wt),R(this,xt,void 0));$copyCodepoint=(R(this,kt),R(this,St,void 0));$copyPreview=(R(this,Ct),R(this,Lt,void 0));$color=(R(this,Et),R(this,Ft,void 0));$colorPicker=(R(this,Pt),R(this,Mt,void 0));$colorHexRgb=(R(this,It),R(this,Ht,void 0));store=(R(this,Rt),R(this,Nt,new Map([["cachePngColor","#000000"],["cachePngSize",24],["cacheSvgColor","#000000"]])));color=(R(this,Tt),"svg");currentIndex=R(this,Ot,0);icon=(R(this,At),R(this,Bt,new Icon));connectedCallback(){this.$copyIconName.addEventListener("click",this.handleCopyIconName.bind(this)),this.$svgBlack.addEventListener("click",(()=>{this.store.set("cacheSvgColor","#000000"),this.render()})),this.$svgWhite.addEventListener("click",(()=>{this.store.set("cacheSvgColor","#FFFFFF"),this.render()}));let t=!1;this.$svgColor.addEventListener("click",(()=>{if(t)return void(t=!1);this.color="svg",this.$colorPicker.value=this.store.get("cacheSvgColor"),this.$colorHexRgb.value=this.store.get("cacheSvgColor");const e=this;this.$color.style.visibility="visible";let n=!0;this.$color.addEventListener("mouseenter",(()=>n=!1)),this.$color.addEventListener("mouseleave",(()=>n=!0)),document.addEventListener("mousedown",(function o(i){n&&(e.$color.style.visibility="hidden",document.removeEventListener("mousedown",o),t=!0,e.render(),setTimeout((()=>t=!1),500))}))})),this.$pngBlack.addEventListener("click",(()=>{this.store.set("cachePngColor","#000000"),this.render()})),this.$pngWhite.addEventListener("click",(()=>{this.store.set("cachePngColor","#FFFFFF"),this.render()}));let e=!1;this.$pngColor.addEventListener("click",(()=>{if(e)return void(e=!1);this.color="png",this.$colorPicker.value=this.store.get("cachePngColor"),this.$colorHexRgb.value=this.store.get("cachePngColor");const t=this;this.$color.style.visibility="visible";let n=!0;this.$color.addEventListener("mouseenter",(()=>n=!1)),this.$color.addEventListener("mouseleave",(()=>n=!0)),document.addEventListener("mousedown",(function o(i){n&&(t.$color.style.visibility="hidden",document.removeEventListener("mousedown",o),e=!0,t.render(),setTimeout((()=>e=!1),500))}))})),this.$png24.addEventListener("click",(()=>{this.store.set("cachePngSize",24),this.render()})),this.$png36.addEventListener("click",(()=>{this.store.set("cachePngSize",36),this.render()})),this.$png48.addEventListener("click",(()=>{this.store.set("cachePngSize",48),this.render()})),this.$png96.addEventListener("click",(()=>{this.store.set("cachePngSize",96),this.render()})),this.$svgDownload.addEventListener("click",(()=>{alert(`SVG ${this.store.get("cacheSvgColor")}`)})),this.$pngDownload.addEventListener("click",(()=>{alert(`SVG ${this.store.get("cachePngSize")} ${this.store.get("cachePngColor")}`)})),this.$copySvgInline.addEventListener("click",(()=>{const t=this.icon;E(function(t){return`<svg viewBox="0 0 24 24"><path fill="currentColor" d="${t.data}"/></svg>`}(t)),this.hideContextMenu(),I(`Copied inline SVG "${t.name}" to clipboard.`)})),this.$copySvgFile.addEventListener("click",(()=>{})),this.$copySvgPath.addEventListener("click",(()=>{})),this.$copyUnicode.addEventListener("click",(()=>{})),this.$copyCodepoint.addEventListener("click",(()=>{})),this.$copyPreview.addEventListener("click",(()=>{}))}handleCopyIconName(){const t=this.icon;t&&t.name&&(E(t.name),I(`Copied "${t.name}" to clipboard.`)),this.hideContextMenu()}hideContextMenu(){}showContextMenu(t,e,n){this.dispatchEvent(new CustomEvent("closemenu"))}render(){const t=this.store.get("cacheSvgColor"),e=this.store.get("cachePngColor"),n=this.store.get("cachePngSize");this.$svgBlack.classList.toggle("active","#000000"===t),this.$svgWhite.classList.toggle("active","#FFFFFF"===t),this.$svgColor.classList.toggle("active","#000000"!==t&&"#FFFFFF"!==t),this.$pngBlack.classList.toggle("active","#000000"===e),this.$pngWhite.classList.toggle("active","#FFFFFF"===e),this.$pngColor.classList.toggle("active","#000000"!==e&&"#FFFFFF"!==e),this.$png24.classList.toggle("active",24===n),this.$png36.classList.toggle("active",36===n),this.$png48.classList.toggle("active",48===n),this.$png96.classList.toggle("active",96===n),this.$colorPicker.addEventListener("select",this.handleColorSelect.bind(this)),this.$colorHexRgb.addEventListener("change",this.handleHexRgbChange.bind(this)),this.syncEyedropper()}handleColorSelect(t){switch(this.color){case"svg":this.store.set("cacheSvgColor",t.detail.hex);break;case"png":this.store.set("cachePngColor",t.detail.hex)}this.$colorHexRgb.value=t.detail.hex,this.syncEyedropper()}handleHexRgbChange(t){switch(this.color){case"svg":this.store.set("cacheSvgColor",t.detail.hex);break;case"png":this.store.set("cachePngColor",t.detail.hex)}this.$colorPicker.value=t.detail.hex,this.syncEyedropper()}syncEyedropper(){const t=this.store.get("cachePngColor");this.$pngColor.style.color="#000000"!==t&&"#FFFFFF"!==t?t:"transparent";const e=this.store.get("cacheSvgColor");this.$svgColor.style.color="#000000"!==e&&"#FFFFFF"!==e?e:"transparent"}constructor(){super(...arguments),R(this,zt)}})})()})();
|
package/pgMenuItem.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={209:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),s=n.n(o)()(a());s.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var i=new CSSStyleSheet;i.replaceSync(s.toString());const l=i},219:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),a=n.n(r),o=n(314),s=n.n(o),i=n(417),l=n.n(i),c=new URL(n(662),n.b),d=new URL(n(708),n.b),u=new URL(n(383),n.b),h=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=s()(a()),v=l()(c),g=l()(d),b=l()(u),y=l()(h),w=l()(p),x=l()(m);f.push([e.id,`:host {\n display: contents;\n}\n\n[part=label] {\n outline: none;\n display: flex;\n align-items: center;\n font-family: var(--pg-font-family);\n text-align: var(--pg-menu-item-text-align, left);\n background: var(--pg-menu-item-background, transparent);\n padding: var(--pg-menu-item-padding, 0.25rem 0.5rem 0.25rem 0.5rem);\n border-color: transparent;\n border-width: 0;\n border-style: solid;\n border-top-left-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-top-right-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-bottom-left-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n border-bottom-right-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n color: var(--pg-menu-item-color, #453C4F);\n}\n\n[part=label]:not(:disabled):active,\n[part=label]:not(:disabled):hover {\n background: var(--pg-menu-item-selected-background, #453C4F);\n color: #FFFFFF;\n}\n\n[part=label]:not(:disabled):active {\n background: var(--pg-menu-item-active-background, #5f516e);\n}\n\n[part=label]:disabled {\n color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n}\n\n@container style(--pg-menu-_has-check: true) {\n [part=label] {\n padding-inline-start: 1.5rem;\n }\n\n [part=label].checked::before {\n position: absolute;\n translate: -1.5rem 0;\n content: var(--pg-menu-item-check, url(${v}));\n width: 1.5rem;\n height: 1.5rem;\n }\n\n [part=label].checked:active::before,\n [part=label].checked:hover::before {\n content: var(--pg-menu-item-hover-check, url(${g}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${b}));\n }\n}\n\n[part=label]:focus-visible {\n position: relative;\n}\n\n[part=label]:focus-visible::after {\n pointer-events: none;\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.25rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\n[part=label]:focus-visible:not(:hover)::after {\n background: var(--pg-focus-background-color, rgb(79, 143, 249, 0.1));\n}\n\n[part=label].more {\n padding-right: 1.5rem;\n}\n\n[part=label].more::after {\n position: absolute;\n translate: -0.25rem 0;\n right: 0;\n content: var(--pg-menu-item-check, url(${y}));\n width: 1.5rem;\n height: 1.5rem;\n}\n\n[part=label].more:active::after,\n[part=label].more:hover::after {\n content: var(--pg-menu-item-hover-check, url(${w}));\n}\n\n[part=label].more:disabled::after {\n content: var(--pg-menu-item-disabled-check, url(${x}));\n}\n`,""]);var S=new CSSStyleSheet;S.replaceSync(f.toString());const k=S},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,a,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&s[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),a&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=a):d[4]="".concat(a)),t.push(d))}},t}},383:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},544:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},570:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27white%27 /></svg>"},601:e=>{e.exports=function(e){return e[1]}},662:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},708:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27white%27 /></svg>"}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.b="undefined"!=typeof document&&document.baseURI||self.location.href;const r=Symbol("addObserver"),a=Symbol("removeObserver"),o=Symbol("getObservers"),s=Symbol("isProxy"),i=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case s:return!0;case i:return t;case o:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case a:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?d(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return d(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),p=Symbol("style"),m=Symbol("parent");function f(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function g(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[m]||t.prototype[m][t.prototype[m].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[m]=[t.prototype],t.prototype[p]=e.style?[e.style]:[],t.prototype[h]=e.template||""):(t.prototype[m].push(t.prototype),t.prototype[p].push(e.style),t.prototype[h]=(r=t.prototype[h],(a=e.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));const o=t.prototype.connectedCallback||(()=>{}),s=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[u]||void 0!==e.template||void 0!==e.style)if(this[u]){if(this[u]&&e.style);else if(this[u]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[h]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[p].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),a=()=>{this[m].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[v(t)]=!0,e)),{}):{})}))};0===r.length?(this[u]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[u]=!0,o.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));a()}))},t.prototype.disconnectedCallback=function(){s.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[v(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function b(e){return!!e&&e.constructor===Array}function y(e,t){e[u]&&e[m].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":b(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,a=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[a][s]?this[a]:d(this[a]):this[a],set:t=>{const n=w(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!b(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===t)throw new Error("Setting an array to itself is not allowed.");const e=d(this[a]);if(e[o]){const n=t[s]?(c=t)[s]&&c[i]:t;e.splice(0,this[a].length,...n)}else this[a]=t}else this[a]=e?e(t):t,y(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=f(r);t[r]||(e.observedAttributes.push(n),t[r]=a)}return this[l]=w(t),"array"===this[l]?(this[a]=t,new Proxy(t,{get:(e,t)=>t===k?this[c]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===k)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||y(this,r),this[a]=n,o}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function S(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const k=Symbol("meta");var E=function(e,t,n,r,a,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(u.get=i),(i=s(v.set))&&(u.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},L=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};const $=new Set,C=new Map;const P=(()=>{let e,t,n=[g()],r=[],a=HTMLElement;(class extends a{static{t=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;E(null,e={value:t},n,{kind:"class",name:t.name,metadata:o},null,r),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),L(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),$.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),$.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var O=n(217),j=function(e,t,n,r,a,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(u.get=i),(i=s(v.set))&&(u.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},A=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};const R=[],T=[];const z=(()=>{let e,t,n,r,a,o,s,i,l,c,d=[g({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:O.A})],u=[],h=P,p=[],m=[],f=[],v=[],b=[],y=[],w=[],k=[],E=[],L=[],$=[],C=[],z=[],M=[],D=[],F=[];(class extends h{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;n=[S()],r=[S()],a=[x()],o=[x()],s=[x()],i=[x()],l=[x()],c=[x()],j(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:g},p,m),j(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:g},f,v),j(null,null,a,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:g},b,y),j(null,null,o,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:g},w,k),j(null,null,s,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:g},E,L),j(null,null,i,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:g},$,C),j(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:g},z,M),j(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:g},D,F),j(null,e={value:t},d,{kind:"class",name:t.name,metadata:g},null,u),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),A(t,u)}$overlay=A(this,p,void 0);$menu=(A(this,m),A(this,f,void 0));source=(A(this,v),A(this,b,null));x=(A(this,y),A(this,w,0));y=(A(this,k),A(this,E,0));default=(A(this,L),A(this,$,null));items=(A(this,C),A(this,z,[]));value=(A(this,M),A(this,D,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){R.pop()?.close(),R.push(this),T.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#a.bind(this),document.addEventListener("pointerdown",this.#r)}#o=(A(this,F),!1);#r;#a(e){this.#o=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===T.length&&this.#o&&(console.log(e),this.source?.focus())}disconnectedCallback(){T.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}});return t})();var M=n(219),D=function(e,t,n,r,a,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(u.get=i),(i=s(v.set))&&(u.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},F=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};(()=>{let e,t,n,r,a,o,s,i,l=[g({selector:"pg-menu-item",style:M.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,u=[],h=[],p=[],m=[],f=[],v=[],b=[],y=[],w=[],k=[],E=[],L=[];(class extends d{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[x()],r=[x()],a=[x()],o=[x()],s=[x()],i=[S()],D(null,null,n,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:g},u,h),D(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:g},p,m),D(null,null,a,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:g},f,v),D(null,null,o,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:g},b,y),D(null,null,s,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:g},w,k),D(null,null,i,{kind:"field",name:"$label",static:!1,private:!1,access:{has:e=>"$label"in e,get:e=>e.$label,set:(e,t)=>{e.$label=t}},metadata:g},E,L),D(null,e={value:t},l,{kind:"class",name:t.name,metadata:g},null,c),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})}static delegatesFocus=!0;index=F(this,u,void 0);label=(F(this,h),F(this,p,""));checked=(F(this,m),F(this,f,!1));disabled=(F(this,v),F(this,b,!1));items=(F(this,y),F(this,w,[]));$label=(F(this,k),F(this,E,void 0));render(e){e.label&&(this.$label.textContent=this.label),e.disabled&&(this.$label.disabled=this.disabled),e.checked&&this.$label.classList.toggle("checked",this.checked),e.checked&&!0===this.checked&&this.dispatchEvent(new CustomEvent("hasCheck",{bubbles:!0})),e.items&&this.$label.classList.toggle("more",this.items.length>0)}connectedCallback(){this.$label.addEventListener("click",(async()=>{if(this.items.length>0){const e=await z.open({source:this.$label,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}else this.dispatchEvent(new CustomEvent("select",{detail:{index:this.index}}))})),this.$label.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":this.dispatchEvent(new CustomEvent("down",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowUp":this.dispatchEvent(new CustomEvent("up",{detail:{index:this.index}})),e.preventDefault();break;case"Escape":this.dispatchEvent(new CustomEvent("close")),e.preventDefault()}}))}focus(){this.$label.focus()}getHeight(){return this.$label.getBoundingClientRect().height}constructor(){super(...arguments),F(this,L)}static{F(t,c)}})})()})();
|
|
1
|
+
(()=>{"use strict";var e={209:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),s=n(314),o=n.n(s)()(a());o.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var i=new CSSStyleSheet;i.replaceSync(o.toString());const l=i},219:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),a=n.n(r),s=n(314),o=n.n(s),i=n(417),l=n.n(i),c=new URL(n(662),n.b),d=new URL(n(708),n.b),u=new URL(n(383),n.b),h=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=o()(a()),g=l()(c),v=l()(d),b=l()(u),y=l()(h),w=l()(p),x=l()(m);f.push([e.id,`:host {\n display: contents;\n}\n\n[part=label] {\n outline: none;\n display: flex;\n align-items: center;\n font-family: var(--pg-font-family);\n text-align: var(--pg-menu-item-text-align, left);\n background: var(--pg-menu-item-background, transparent);\n padding: var(--pg-menu-item-padding, 0.25rem 0.5rem 0.25rem 0.5rem);\n border-color: transparent;\n border-width: 0;\n border-style: solid;\n border-top-left-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-top-right-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-bottom-left-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n border-bottom-right-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n color: var(--pg-menu-item-color, #453C4F);\n}\n\n[part=label]:not(:disabled):active,\n[part=label]:not(:disabled):hover {\n background: var(--pg-menu-item-selected-background, #453C4F);\n color: #FFFFFF;\n}\n\n[part=label]:not(:disabled):active {\n background: var(--pg-menu-item-active-background, #5f516e);\n}\n\n[part=label]:disabled {\n color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n}\n\n@container style(--pg-menu-_has-check: true) {\n [part=label] {\n padding-inline-start: 1.5rem;\n }\n\n [part=label].checked::before {\n position: absolute;\n translate: -1.5rem 0;\n content: var(--pg-menu-item-check, url(${g}));\n width: 1.5rem;\n height: 1.5rem;\n }\n\n [part=label].checked:active::before,\n [part=label].checked:hover::before {\n content: var(--pg-menu-item-hover-check, url(${v}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${b}));\n }\n}\n\n[part=label]:focus-visible {\n position: relative;\n}\n\n[part=label]:focus-visible::after {\n pointer-events: none;\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.25rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\n[part=label]:focus-visible:not(:hover)::after {\n background: var(--pg-focus-background-color, rgb(79, 143, 249, 0.1));\n}\n\n[part=label].more {\n padding-right: 1.5rem;\n}\n\n[part=label].more::after {\n position: absolute;\n translate: -0.25rem 0;\n right: 0;\n content: var(--pg-menu-item-check, url(${y}));\n width: 1.5rem;\n height: 1.5rem;\n}\n\n[part=label].more:active::after,\n[part=label].more:hover::after {\n content: var(--pg-menu-item-hover-check, url(${w}));\n}\n\n[part=label].more:disabled::after {\n content: var(--pg-menu-item-disabled-check, url(${x}));\n}\n`,""]);var S=new CSSStyleSheet;S.replaceSync(f.toString());const k=S},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,a,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&o[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),a&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=a):d[4]="".concat(a)),t.push(d))}},t}},383:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},544:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},570:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27white%27 /></svg>"},601:e=>{e.exports=function(e){return e[1]}},662:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},708:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27white%27 /></svg>"}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.b="undefined"!=typeof document&&document.baseURI||self.location.href;const r=Symbol("addObserver"),a=Symbol("removeObserver"),s=Symbol("getObservers"),o=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function u(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case l:return t;case s:return d.has(e);case o:return(t,n)=>{const r=d.get(e);r.forEach(((a,s)=>{if(s.getRootNode().host===t){const t=r.get(s);d.has(n)?d.get(n).has(s)?d.get(n).get(s).push(r.get(s)):d.get(n).set(s,r.get(s)):d.set(n,new Map([[s,t]])),d.delete(e),t.forEach((e=>{e(null,h.swap,[n])}))}}))};case r:return(t,n)=>{d.has(e)?d.get(e).has(t)?d.get(e).get(t).push(n):d.get(e).set(t,[n]):d.set(e,new Map([[t,[n]]]))};case a:return t=>{d.has(e)&&(d.get(e).delete(t),0===d.get(e).size&&d.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?u(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return d.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return d.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return u(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(d.has(e)){d.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=d;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),m=Symbol("template"),f=Symbol("style"),g=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function y(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[g]||t.prototype[g][t.prototype[g].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[g]=[t.prototype],t.prototype[f]=e.style?[e.style]:[],t.prototype[m]=e.template||""):(t.prototype[g].push(t.prototype),t.prototype[f].push(e.style),t.prototype[m]=(r=t.prototype[m],(a=e.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));const s=t.prototype.connectedCallback||(()=>{}),o=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[p]||void 0!==e.template||void 0!==e.style)if(this[p]){if(this[p]&&e.style);else if(this[p]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[m]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[f].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),a=()=>{this[g].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[b(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,s.call(this),a()):Promise.all(r).then((()=>{this[p]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));a()}))},t.prototype.disconnectedCallback=function(){o.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[b(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function x(e,t){e[p]&&e[g].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function S(e){return null===e?"null":w(e)?"array":typeof e}function k(e){return function(t,n){const r=n.name,a=Symbol(r),c=Symbol(`${r}:type`),d=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[a][i]?this[a]:u(this[a]):this[a],set:t=>{const n=S(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[a]);if(e[s]){const n=t[i]?t[l]:t;e[o](this,n),this[a]=t,console.log(">>> trigger render???",this,r)}else this[a]=t}else this[a]=e?e(t):t,x(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=v(r);t[r]||(e.observedAttributes.push(n),t[r]=a)}return this[c]=S(t),"array"===this[c]?(this[a]=t,new Proxy(t,{get:(e,t)=>t===L?this[d]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===L)return this[d]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||x(this,r),this[a]=n,s}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function E(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const L=Symbol("meta");var $=function(e,t,n,r,a,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(i=o(g.get))&&(u.get=i),(i=o(g.set))&&(u.set=i),(i=o(g.init))&&a.unshift(i)}else(i=o(g))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},C=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};const P=new Set,O=new Map;const j=(()=>{let e,t,n=[y()],r=[],a=HTMLElement;(class extends a{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;$(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),C(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),P.add(t),new Promise((e=>{O.set(t,e)}))}close(e){this.remove(),P.delete(this);const t=O.get(this);t&&t(e),O.delete(this)}});return t})();var R=n(217),A=function(e,t,n,r,a,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(i=o(g.get))&&(u.get=i),(i=o(g.set))&&(u.set=i),(i=o(g.init))&&a.unshift(i)}else(i=o(g))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},T=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};const M=[],z=[];const D=(()=>{let e,t,n,r,a,s,o,i,l,c,d=[y({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],u=[],h=j,p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],S=[],L=[],$=[],C=[],P=[],O=[],D=[],F=[];(class extends h{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;n=[E()],r=[E()],a=[k()],s=[k()],o=[k()],i=[k()],l=[k()],c=[k()],A(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:y},p,m),A(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:y},f,g),A(null,null,a,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:y},v,b),A(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:y},w,x),A(null,null,o,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:y},S,L),A(null,null,i,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:y},$,C),A(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},P,O),A(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:y},D,F),A(null,e={value:t},d,{kind:"class",name:t.name,metadata:y},null,u),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),T(t,u)}$overlay=T(this,p,void 0);$menu=(T(this,m),T(this,f,void 0));source=(T(this,g),T(this,v,null));x=(T(this,b),T(this,w,0));y=(T(this,x),T(this,S,0));default=(T(this,L),T(this,$,null));items=(T(this,C),T(this,P,[]));value=(T(this,O),T(this,D,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){M.pop()?.close(),M.push(this),z.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#a.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(T(this,F),!1);#r;#a(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===z.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){z.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}});return t})();var F=n(219),U=function(e,t,n,r,a,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(i=o(g.get))&&(u.get=i),(i=o(g.set))&&(u.set=i),(i=o(g.init))&&a.unshift(i)}else(i=o(g))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},_=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};(()=>{let e,t,n,r,a,s,o,i,l=[y({selector:"pg-menu-item",style:F.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,u=[],h=[],p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],S=[],L=[];(class extends d{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[k()],r=[k()],a=[k()],s=[k()],o=[k()],i=[E()],U(null,null,n,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:y},u,h),U(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:y},p,m),U(null,null,a,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:y},f,g),U(null,null,s,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:y},v,b),U(null,null,o,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},w,x),U(null,null,i,{kind:"field",name:"$label",static:!1,private:!1,access:{has:e=>"$label"in e,get:e=>e.$label,set:(e,t)=>{e.$label=t}},metadata:y},S,L),U(null,e={value:t},l,{kind:"class",name:t.name,metadata:y},null,c),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}static delegatesFocus=!0;index=_(this,u,void 0);label=(_(this,h),_(this,p,""));checked=(_(this,m),_(this,f,!1));disabled=(_(this,g),_(this,v,!1));items=(_(this,b),_(this,w,[]));$label=(_(this,x),_(this,S,void 0));render(e){e.label&&(this.$label.textContent=this.label),e.disabled&&(this.$label.disabled=this.disabled),e.checked&&this.$label.classList.toggle("checked",this.checked),e.checked&&!0===this.checked&&this.dispatchEvent(new CustomEvent("hasCheck",{bubbles:!0})),e.items&&this.$label.classList.toggle("more",this.items.length>0)}connectedCallback(){this.$label.addEventListener("click",(async()=>{if(this.items.length>0){const e=await D.open({source:this.$label,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}else this.dispatchEvent(new CustomEvent("select",{detail:{index:this.index}}))})),this.$label.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":this.dispatchEvent(new CustomEvent("down",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowUp":this.dispatchEvent(new CustomEvent("up",{detail:{index:this.index}})),e.preventDefault();break;case"Escape":this.dispatchEvent(new CustomEvent("close")),e.preventDefault()}}))}focus(){this.$label.focus()}getHeight(){return this.$label.getBoundingClientRect().height}constructor(){super(...arguments),_(this,L)}static{_(t,c)}})})()})();
|