@pictogrammers/components 0.3.2 → 0.4.0

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.
Files changed (294) hide show
  1. package/README.md +11 -12
  2. package/favicon.svg +20 -0
  3. package/index.html +67 -49
  4. package/main.js +2 -0
  5. package/main.js.LICENSE.txt +10 -0
  6. package/package.json +6 -6
  7. package/pg/annoy/README.md +0 -5
  8. package/pg/annoy/__examples__/basic/basic.css +3 -0
  9. package/pg/annoy/__examples__/basic/basic.html +4 -7
  10. package/pg/annoy/__examples__/basic/basic.ts +3 -1
  11. package/pg/annoy/annoy.css +29 -198
  12. package/pg/annoy/annoy.html +5 -56
  13. package/pg/annoy/annoy.ts +4 -25
  14. package/pg/app/README.md +11 -0
  15. package/pg/app/__examples__/basic/basic.css +8 -0
  16. package/pg/app/__examples__/basic/basic.html +15 -0
  17. package/pg/app/__examples__/basic/basic.ts +13 -0
  18. package/pg/app/app.css +108 -0
  19. package/pg/app/app.html +16 -0
  20. package/pg/app/app.ts +45 -0
  21. package/pg/app/index.ts +3 -0
  22. package/pg/avatar/__examples__/basic/basic.ts +5 -3
  23. package/pg/button/README.md +3 -0
  24. package/pg/button/button.css +13 -12
  25. package/pg/button/button.spec.ts +35 -0
  26. package/pg/button/button.ts +17 -12
  27. package/pg/buttonLink/buttonLink.css +3 -2
  28. package/pg/buttonMenu/README.md +54 -0
  29. package/pg/buttonMenu/__examples__/basic/basic.html +6 -0
  30. package/pg/buttonMenu/__examples__/basic/basic.ts +43 -0
  31. package/pg/buttonMenu/buttonMenu.css +12 -0
  32. package/pg/buttonMenu/buttonMenu.html +4 -0
  33. package/pg/buttonMenu/buttonMenu.ts +63 -0
  34. package/pg/buttonMenu/index.ts +3 -0
  35. package/pg/buttonToggle/__examples__/basic/basic.ts +2 -2
  36. package/pg/buttonToggle/__examples__/persist/persist.html +10 -0
  37. package/pg/buttonToggle/__examples__/persist/persist.ts +35 -0
  38. package/pg/cardUser/__examples__/basic/basic.ts +0 -1
  39. package/pg/cardUser/cardUser.css +2 -10
  40. package/pg/cardUser/cardUser.html +0 -5
  41. package/pg/cardUser/cardUser.ts +0 -6
  42. package/pg/database/README.md +1 -1
  43. package/pg/database/__examples__/basic/basic.html +2 -1
  44. package/pg/database/__examples__/basic/basic.ts +3 -3
  45. package/pg/dropdown/dropdown.ts +0 -19
  46. package/pg/grid/__examples__/basic/basic.html +2 -2
  47. package/pg/grid/__examples__/basic/basic.ts +3 -2
  48. package/pg/grid/grid.ts +0 -1
  49. package/pg/icon/README.md +6 -5
  50. package/pg/icon/__examples__/basic/basic.html +2 -2
  51. package/pg/icon/__examples__/basic/basic.ts +1 -1
  52. package/pg/icon/icon.ts +6 -0
  53. package/pg/inputCheckList/__examples__/basic/basic.ts +5 -5
  54. package/pg/inputCheckList/inputCheckList.ts +2 -0
  55. package/pg/inputFileLocal/inputFileLocal.css +3 -2
  56. package/pg/inputPixelEditor/README.md +132 -0
  57. package/pg/inputPixelEditor/__examples__/basic/basic.css +29 -0
  58. package/pg/inputPixelEditor/__examples__/basic/basic.html +63 -0
  59. package/pg/inputPixelEditor/__examples__/basic/basic.ts +200 -0
  60. package/pg/inputPixelEditor/__examples__/basic/openUtils.ts +41 -0
  61. package/pg/inputPixelEditor/__examples__/basic/saveUtil.ts +35 -0
  62. package/pg/inputPixelEditor/index.ts +3 -0
  63. package/pg/inputPixelEditor/inputPixelEditor.css +27 -0
  64. package/pg/inputPixelEditor/inputPixelEditor.html +3 -0
  65. package/pg/inputPixelEditor/inputPixelEditor.ts +839 -0
  66. package/pg/inputPixelEditor/utils/bitmapToMask.ts +202 -0
  67. package/pg/inputPixelEditor/utils/cloneGrid.ts +17 -0
  68. package/pg/inputPixelEditor/utils/constants.ts +1 -0
  69. package/pg/inputPixelEditor/utils/createLayer.ts +8 -0
  70. package/pg/inputPixelEditor/utils/debounce.ts +5 -0
  71. package/pg/inputPixelEditor/utils/diffGrid.ts +26 -0
  72. package/pg/inputPixelEditor/utils/fillGrid.ts +11 -0
  73. package/pg/inputPixelEditor/utils/getEllipseOutlinePixels.ts +105 -0
  74. package/pg/inputPixelEditor/utils/getEllipsePixels.ts +28 -0
  75. package/pg/inputPixelEditor/utils/getGuides.ts +232 -0
  76. package/pg/inputPixelEditor/utils/getLinePixels.ts +18 -0
  77. package/pg/inputPixelEditor/utils/getRectangleOutlinePixels.ts +20 -0
  78. package/pg/inputPixelEditor/utils/getRectanglePixels.ts +15 -0
  79. package/pg/inputPixelEditor/utils/inputMode.ts +8 -0
  80. package/pg/inputPixelEditor/utils/interateGrid.ts +7 -0
  81. package/pg/inputPixelEditor/utils/isEmptyGrid.ts +3 -0
  82. package/pg/inputPixelEditor/utils/maskToBitmap.ts +66 -0
  83. package/pg/inputRange/__examples__/basic/basic.ts +4 -4
  84. package/pg/inputRange/inputRange.ts +6 -4
  85. package/pg/inputSelect/README.md +1 -1
  86. package/pg/inputSelect/__examples__/basic/basic.ts +7 -5
  87. package/pg/inputSelect/inputSelect.css +15 -12
  88. package/pg/inputSelect/inputSelect.html +3 -3
  89. package/pg/inputSelect/inputSelect.ts +33 -30
  90. package/pg/inputText/__examples__/basic/basic.ts +6 -6
  91. package/pg/inputText/inputText.css +1 -0
  92. package/pg/inputUserSelect/README.md +1 -1
  93. package/pg/inputUserSelect/inputUserSelect.ts +1 -1
  94. package/pg/listTag/__examples__/basic/basic.ts +4 -5
  95. package/pg/markdown/README.md +17 -3
  96. package/pg/markdown/__examples__/basic/basic.ts +2 -2
  97. package/pg/markdown/__examples__/basic/constants.ts +1 -1
  98. package/pg/markdown/markdown.css +11 -0
  99. package/pg/menu/README.md +46 -0
  100. package/pg/menu/__examples__/basic/basic.html +6 -0
  101. package/pg/menu/__examples__/basic/basic.ts +46 -0
  102. package/pg/menu/index.ts +3 -0
  103. package/pg/menu/menu.css +19 -0
  104. package/pg/menu/menu.html +1 -0
  105. package/pg/menu/menu.ts +119 -0
  106. package/pg/menuDivider/README.md +7 -0
  107. package/pg/menuDivider/__examples__/basic/basic.html +3 -0
  108. package/pg/menuDivider/__examples__/basic/basic.ts +28 -0
  109. package/pg/menuDivider/index.ts +3 -0
  110. package/pg/menuDivider/menuDivider.css +9 -0
  111. package/pg/menuDivider/menuDivider.html +1 -0
  112. package/pg/menuDivider/menuDivider.ts +22 -0
  113. package/pg/menuIcon/menuIcon.ts +43 -36
  114. package/pg/menuItem/README.md +32 -0
  115. package/pg/menuItem/__examples__/basic/basic.html +26 -0
  116. package/pg/menuItem/__examples__/basic/basic.ts +41 -0
  117. package/pg/menuItem/index.ts +3 -0
  118. package/pg/menuItem/menuItem.css +97 -0
  119. package/pg/menuItem/menuItem.html +1 -0
  120. package/pg/menuItem/menuItem.ts +77 -0
  121. package/pg/menuItemIcon/README.md +32 -0
  122. package/pg/menuItemIcon/__examples__/basic/basic.html +34 -0
  123. package/pg/menuItemIcon/__examples__/basic/basic.ts +55 -0
  124. package/pg/menuItemIcon/index.ts +3 -0
  125. package/pg/menuItemIcon/menuItemIcon.css +106 -0
  126. package/pg/menuItemIcon/menuItemIcon.html +4 -0
  127. package/pg/menuItemIcon/menuItemIcon.ts +156 -0
  128. package/pg/modalAlert/__examples__/basic/basic.ts +1 -1
  129. package/pg/modalAlert/modalAlert.css +1 -4
  130. package/pg/modalAlert/modalAlert.ts +18 -4
  131. package/pg/modification/__examples__/basic/basic.ts +1 -2
  132. package/pg/modification/__examples__/basic/constants.ts +25 -50
  133. package/pg/modification/modification.ts +1 -1
  134. package/pg/overlay/overlay.ts +13 -12
  135. package/pg/overlayContextMenu/README.md +35 -0
  136. package/pg/overlayContextMenu/__examples__/basic/basic.css +23 -0
  137. package/pg/overlayContextMenu/__examples__/basic/basic.html +7 -0
  138. package/pg/overlayContextMenu/__examples__/basic/basic.ts +87 -0
  139. package/pg/overlayContextMenu/index.ts +3 -0
  140. package/pg/overlayContextMenu/overlayContextMenu.css +16 -0
  141. package/pg/overlayContextMenu/overlayContextMenu.html +3 -0
  142. package/pg/overlayContextMenu/overlayContextMenu.ts +98 -0
  143. package/pg/overlayMenu/README.md +33 -0
  144. package/pg/overlayMenu/__examples__/basic/basic.css +3 -0
  145. package/pg/overlayMenu/__examples__/basic/basic.html +5 -0
  146. package/pg/overlayMenu/__examples__/basic/basic.ts +62 -0
  147. package/pg/overlayMenu/index.ts +3 -0
  148. package/pg/overlayMenu/overlayMenu.css +16 -0
  149. package/pg/overlayMenu/overlayMenu.html +3 -0
  150. package/pg/overlayMenu/overlayMenu.ts +67 -0
  151. package/pg/overlaySelectMenu/README.md +33 -0
  152. package/pg/overlaySelectMenu/__examples__/basic/basic.css +3 -0
  153. package/pg/overlaySelectMenu/__examples__/basic/basic.html +5 -0
  154. package/pg/overlaySelectMenu/__examples__/basic/basic.ts +62 -0
  155. package/pg/overlaySelectMenu/index.ts +3 -0
  156. package/pg/overlaySelectMenu/overlaySelectMenu.css +17 -0
  157. package/pg/overlaySelectMenu/overlaySelectMenu.html +3 -0
  158. package/pg/overlaySelectMenu/overlaySelectMenu.ts +96 -0
  159. package/pg/overlaySubMenu/README.md +35 -0
  160. package/pg/overlaySubMenu/index.ts +3 -0
  161. package/pg/overlaySubMenu/overlaySubMenu.css +27 -0
  162. package/pg/overlaySubMenu/overlaySubMenu.html +3 -0
  163. package/pg/overlaySubMenu/overlaySubMenu.ts +103 -0
  164. package/pg/picker/picker.ts +1 -19
  165. package/pg/scroll/__examples__/basic/basic.ts +1 -1
  166. package/pg/search/__examples__/basic/basic.ts +10 -7
  167. package/pg/search/search.css +2 -2
  168. package/pg/shared/models/user.ts +0 -2
  169. package/pg/tab/tab.ts +0 -10
  170. package/pg/tabs/partials/tab.css +42 -0
  171. package/pg/tabs/partials/tab.ts +70 -0
  172. package/pg/tabs/tabs.css +0 -53
  173. package/pg/tabs/tabs.ts +54 -70
  174. package/pg/toast/README.md +35 -6
  175. package/pg/toast/__examples__/basic/basic.html +7 -0
  176. package/pg/toast/__examples__/basic/basic.ts +76 -0
  177. package/pg/toast/toast.css +3 -0
  178. package/pg/toast/toast.ts +20 -4
  179. package/pg/tooltip/addTooltip.ts +3 -1
  180. package/pg/tooltip/tooltip.ts +1 -1
  181. package/pg/tree/README.md +67 -0
  182. package/pg/tree/__examples__/basic/basic.html +10 -0
  183. package/pg/tree/__examples__/basic/basic.ts +162 -0
  184. package/pg/tree/index.ts +3 -0
  185. package/pg/tree/tree.css +28 -0
  186. package/pg/tree/tree.html +1 -0
  187. package/pg/tree/tree.ts +217 -0
  188. package/pg/treeButtonIcon/README.md +39 -0
  189. package/pg/treeButtonIcon/index.ts +3 -0
  190. package/pg/treeButtonIcon/treeButtonIcon.css +18 -0
  191. package/pg/treeButtonIcon/treeButtonIcon.html +3 -0
  192. package/pg/treeButtonIcon/treeButtonIcon.ts +42 -0
  193. package/pg/treeItem/README.md +3 -0
  194. package/pg/treeItem/index.ts +3 -0
  195. package/pg/treeItem/treeItem.css +263 -0
  196. package/pg/treeItem/treeItem.html +16 -0
  197. package/pg/treeItem/treeItem.ts +558 -0
  198. package/pgAnnoy.js +1 -0
  199. package/pgApp.js +1 -0
  200. package/pgAvatar.js +1 -0
  201. package/pgButton.js +1 -0
  202. package/pgButtonGroup.js +1 -0
  203. package/pgButtonLink.js +1 -0
  204. package/pgButtonMenu.js +1 -0
  205. package/pgButtonToggle.js +1 -0
  206. package/pgCard.js +1 -0
  207. package/pgCardUser.js +1 -0
  208. package/pgColor.js +1 -0
  209. package/pgDatabase.js +1 -0
  210. package/pgDropdown.js +1 -0
  211. package/pgGrid.js +1 -0
  212. package/pgHeader.js +1 -0
  213. package/pgIcon.js +1 -0
  214. package/pgInputCheck.js +1 -0
  215. package/pgInputCheckList.js +1 -0
  216. package/pgInputFileLocal.js +1 -0
  217. package/pgInputHexRgb.js +1 -0
  218. package/pgInputPixelEditor.js +1 -0
  219. package/pgInputRange.js +1 -0
  220. package/pgInputSelect.js +1 -0
  221. package/pgInputText.js +1 -0
  222. package/pgInputTextIcon.js +1 -0
  223. package/pgInputUserSelect.js +1 -0
  224. package/pgListTag.js +1 -0
  225. package/pgMarkdown.js +2 -0
  226. package/pgMarkdown.js.LICENSE.txt +10 -0
  227. package/pgMenu.js +1 -0
  228. package/pgMenuDivider.js +1 -0
  229. package/pgMenuIcon.js +1 -0
  230. package/pgMenuItem.js +1 -0
  231. package/pgMenuItemIcon.js +1 -0
  232. package/pgModalAlert.js +1 -0
  233. package/pgModification.js +1 -0
  234. package/pgNav.js +1 -0
  235. package/pgOverlay.js +1 -0
  236. package/pgOverlayContextMenu.js +1 -0
  237. package/pgOverlayMenu.js +1 -0
  238. package/pgOverlaySelectMenu.js +1 -0
  239. package/pgOverlaySubMenu.js +1 -0
  240. package/pgPicker.js +1 -0
  241. package/pgPreview.js +1 -0
  242. package/pgScroll.js +1 -0
  243. package/pgSearch.js +1 -0
  244. package/pgTab.js +1 -0
  245. package/pgTabs.js +1 -0
  246. package/pgToast.js +1 -0
  247. package/pgToasts.js +1 -0
  248. package/pgTooltip.js +1 -0
  249. package/pgTree.js +1 -0
  250. package/pgTreeButtonIcon.js +1 -0
  251. package/pgTreeItem.js +1 -0
  252. package/theme-ui3.css +31 -0
  253. package/@types/css.d.ts +0 -4
  254. package/@types/html.d.ts +0 -4
  255. package/dist/main.js +0 -3819
  256. package/dist/pgAnnoy.js +0 -116
  257. package/dist/pgAvatar.js +0 -136
  258. package/dist/pgButton.js +0 -116
  259. package/dist/pgButtonGroup.js +0 -116
  260. package/dist/pgButtonLink.js +0 -116
  261. package/dist/pgButtonToggle.js +0 -146
  262. package/dist/pgCard.js +0 -116
  263. package/dist/pgCardUser.js +0 -196
  264. package/dist/pgColor.js +0 -136
  265. package/dist/pgDatabase.js +0 -236
  266. package/dist/pgDropdown.js +0 -686
  267. package/dist/pgGrid.js +0 -126
  268. package/dist/pgHeader.js +0 -116
  269. package/dist/pgIcon.js +0 -116
  270. package/dist/pgInputCheck.js +0 -116
  271. package/dist/pgInputCheckList.js +0 -126
  272. package/dist/pgInputFileLocal.js +0 -116
  273. package/dist/pgInputHexRgb.js +0 -126
  274. package/dist/pgInputRange.js +0 -116
  275. package/dist/pgInputSelect.js +0 -116
  276. package/dist/pgInputText.js +0 -116
  277. package/dist/pgInputTextIcon.js +0 -176
  278. package/dist/pgInputUserSelect.js +0 -116
  279. package/dist/pgListTag.js +0 -136
  280. package/dist/pgMarkdown.js +0 -346
  281. package/dist/pgMenuIcon.js +0 -206
  282. package/dist/pgModalAlert.js +0 -126
  283. package/dist/pgModification.js +0 -396
  284. package/dist/pgNav.js +0 -116
  285. package/dist/pgOverlay.js +0 -96
  286. package/dist/pgPicker.js +0 -116
  287. package/dist/pgPreview.js +0 -116
  288. package/dist/pgScroll.js +0 -266
  289. package/dist/pgSearch.js +0 -146
  290. package/dist/pgTab.js +0 -116
  291. package/dist/pgTabs.js +0 -136
  292. package/dist/pgToast.js +0 -136
  293. package/dist/pgToasts.js +0 -136
  294. package/dist/pgTooltip.js +0 -126
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",s=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),s&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),s&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,s,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var n={};if(s)for(var o=0;o<this.length;o++){var h=this[o][0];null!=h&&(n[h]=!0)}for(var l=0;l<t.length;l++){var c=[].concat(t[l]);s&&n[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),e.push(c))}},e}},601:t=>{t.exports=function(t){return t[1]}},713:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(601),r=i.n(s),a=i(314),n=i.n(a)()(r());n.push([t.id,':host {\n display: inline-flex;\n}\n\n[part="wrapper"] {\n display: flex;\n position: relative;\n outline: 0;\n}\n\n[part="wrapper"]:focus-visible::before {\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.125rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\ncanvas {\n touch-action: none;\n user-select: none;\n outline: 0;\n}',""]);var o=new CSSStyleSheet;o.replaceSync(n.toString());const h=o}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var a=e[s]={id:s,exports:{}};return t[s](a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const s=Symbol("addObserver"),r=Symbol("removeObserver"),a=Symbol("getObservers"),n=Symbol("isProxy"),o=Symbol("getTarget"),h=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function c(t){return new Proxy(t,{get(e,i){if("symbol"==typeof i){switch(i){case n:return!0;case o:return e;case a:return l.has(t);case s:return(e,i)=>{l.has(t)?l.get(t).has(e)?l.get(t).get(e).push(i):l.get(t).set(e,[i]):l.set(t,new Map([[e,[i]]]))};case r: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,i)}throw new Error("Unsupported symbol")}if(i in e){if(!Number.isNaN(Number(i)))return"object"==typeof e[i]?c(e[i]):e[i];if("copyWithin"===i)throw new Error("Unsupported array method copyWithin");if(h.includes(i))return l.has(e)?function(){const t=Array.prototype[i].apply(e,arguments);return l.get(e).forEach(((t,s)=>{t.forEach((t=>{t(e,i,arguments)}))})),t}:Reflect.get(e,i);if(e[i]instanceof Array)return c(e[i])}return Reflect.get(e,i)},set(t,e,i){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,i);if(l.has(t)){l.get(t).forEach(((t,s)=>{t.forEach((t=>{t(e,i)}))}))}return Reflect.set(t,e,i)}})}window.observers=l;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),p=Symbol("template"),y=Symbol("style"),u=Symbol("parent");function f(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function m(t={}){return function(e,i){if("class"!==i.kind)throw new Error("@Component() can only decorate a class");var s,r;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[u]||e.prototype[u][e.prototype[u].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[u]=[e.prototype],e.prototype[y]=t.style?[t.style]:[],e.prototype[p]=t.template||""):(e.prototype[u].push(e.prototype),e.prototype[y].push(t.style),e.prototype[p]=(s=e.prototype[p],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,s):`${s}${r||""}`));const a=e.prototype.connectedCallback||(()=>{}),n=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[d]||void 0!==t.template||void 0!==t.style)if(this[d]){if(this[d]&&t.style);else if(this[d]&&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[p]||"";const i=document.importNode(t.content,!0),s=this.attachShadow({mode:"open"});s.adoptedStyleSheets=e.prototype[y].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),s.appendChild(i)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const i=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&i.add(t.localName);const s=Array.from(i.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),r=()=>{this[u].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[g(e)]=!0,t)),{}):{})}))};0===s.length?(this[d]=!0,a.call(this),r()):Promise.all(s).then((()=>{this[d]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){n.call(this)},e.prototype.attributeChangedCallback=function(t,e,i){this[g(t)]=i},i.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${i.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function x(t){return!!t&&t.constructor===Array}function w(t,e){t[d]&&t[u].map((i=>{i.render&&i.render.call(t,{[e]:!0})}))}function v(t){return null===t?"null":x(t)?"array":typeof t}function b(t){return function(e,i){const s=i.name,r=Symbol(s),h=Symbol(`${s}:type`),l=Symbol(`${s}:meta`);return i.addInitializer((function(){Reflect.defineProperty(this,s,{get:()=>"object"===this[h]||"array"===this[h]?this[r][n]?this[r]:c(this[r]):this[r],set:e=>{const i=v(t?t(e):e);if("index"!==s&&this[h]!==i&&"null"!==this[h]&&"null"!==i)throw new Error(`@Prop() ${s} with type '${this[h]}' cannot be set to ${i}.`);if("array"===this[h]){if(!x(e))throw new PropError(`Array "${s}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,s)?.set);if(this[r]===e)throw new Error("Setting an array to itself is not allowed.");const t=c(this[r]);if(t[a]){const i=e[n]?(l=e)[n]&&l[o]:e;t.splice(0,this[r].length,...i)}else this[r]=e}else this[r]=t?t(e):e,w(this,s);var l}})})),function(e){if(void 0===e&&"index"!==s)throw new Error(`@Prop() ${s} must have an initial value defined.`);if(void 0!==e&&"index"===s)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${s} boolean must initialize to false.`);if(!i.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,i=f(s);e[s]||(t.observedAttributes.push(i),e[s]=r)}return this[h]=v(e),"array"===this[h]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===S?this[l]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,i)=>{if(e===S)return this[l]=i,!0;const a=Reflect.set(t,e,i);return"length"===e&&this[r].length===i||w(this,s),this[r]=i,a}})):(this[r]=t?t(this.getAttribute(s)??e):this.getAttribute(s)??e,this[r])}}}function L(t){return parseInt(`${t}`,10)}function E(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const S=Symbol("meta");var C=i(713);function M(t){const e=[];for(let i=0;i<t.length;i++){e.push([]);for(let s=0;s<t[0].length;s++)e[i].push(t[i][s])}return e}function z(t,e,i,s){return function(t,e,i){return Math.sqrt(Math.pow(e*i,2)+Math.pow(t,2))}(t,e,s)<=i}function P(t,e,i,s){return function(t,e,i,s){return z(t,e,i,s)&&!(z(t+1,e,i,s)&&z(t-1,e,i,s)&&z(t,e+1,i,s)&&z(t,e-1,i,s))}(t=-.5*(i-2*(t+.5)),e=-.5*(s-2*(e+.5)),i/2,i/s)}function $(t,e,i,s){return Math.abs(t-i)===Math.abs(e-s)&&Math.abs(t-i)?(console.log("circle",Math.abs(t-i),Math.abs(e-s)),function(t,e,i,s){const r=Math.abs(t-i),a=Math.abs(e-s),n=Math.min(t,i),o=Math.min(e,s),h=[];for(let t=0;t<a;t++)for(let e=0;e<r;e++)P(e,t,r,a)&&h.push({x:e+n,y:t+o});return h}(t,e,i+1,s+1)):function(t,e,i,s){const r=[];var a,n=Math.abs(i-t),o=Math.abs(s-e),h=1&o,l=4*(1-n)*o*o,c=4*(h+1)*n*n,d=l+c+h*n*n;t>i&&(t=i,i+=n),e>s&&(e=s),s=(e+=o+1>>1)-h,n*=8*n,h=8*o*o;do{r.push({x:i,y:e}),r.push({x:t,y:e}),r.push({x:t,y:s}),r.push({x:i,y:s}),(a=2*d)<=c&&(e++,s--,d+=c+=n),(a>=l||2*d>c)&&(t++,i--,d+=l+=h)}while(t<=i);for(;e-s<=o;)r.push({x:t-1,y:e}),r.push({x:i+1,y:e++}),r.push({x:t-1,y:s}),r.push({x:i+1,y:s--});return r}(t,e,i,s)}const k="#FFFFFF";function R(t,e,i,s){const r=[],a=Math.abs(i-t),n=Math.abs(s-e),o=t<i?1:-1,h=e<s?1:-1;let l=a-n;for(;r.push({x:t,y:e}),t!==i||e!==s;){var c=2*l;c>-n&&(l-=n,t+=o),c<a&&(l+=a,e+=h)}return r}function A(t,e,i,s){const r=[],a=Math.min(t,i),n=Math.min(e,s);for(var o=Math.abs(i-t)+1,h=Math.abs(s-e)+1,l=n;l<n+h;l++)for(var c=a;c<a+o;c++)r.push({x:c,y:l});return r}function I(t,e,i,s){const r=[],a=Math.min(t,i),n=Math.min(e,s);for(var o=Math.abs(i-t),h=Math.abs(s-e),l=n;l<=n+h;l++)r.push({x:a,y:l}),r.push({x:a+o,y:l});for(var c=a+1;c<=a+o-1;c++)r.push({x:c,y:n}),r.push({x:c,y:n+h});return r}function O(t,e){let i=[];for(let s=0;s<e;s++){const e=[];for(let i=0;i<t;i++)e.push(0);i.push(e)}return i}function H(t,e){for(let i=0;i<t.length;i++)for(let s=0;s<t[0].length;s++)e(s,i,t[i][s])}function Y(t,e,i){return e*i+t}function X(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,[i,i.getContext("2d")]}const j=[{name:"Circle Outer",width:22,height:22,color:"#F00",opacity:1,lines:[[7,1],[15,1],[15,2],[17,2],[17,3],[18,3],[18,4],[19,4],[19,5],[20,5],[20,7],[21,7],[21,15],[20,15],[20,17],[19,17],[19,18],[18,18],[18,19],[17,19],[17,20],[15,20],[15,21],[7,21],[7,20],[5,20],[5,19],[4,19],[4,18],[3,18],[3,17],[2,17],[2,15],[1,15],[1,7],[2,7],[2,5],[3,5],[3,4],[4,4],[4,3],[5,3],[5,2],[7,2],[7,1]]},{name:"Circle Inner",width:22,height:22,color:"#00F",opacity:1,lines:[[8,3],[14,3],[14,4],[16,4],[16,5],[17,5],[17,6],[18,6],[18,8],[19,8],[19,14],[18,14],[18,16],[17,16],[17,17],[16,17],[16,18],[14,18],[14,19],[8,19],[8,18],[6,18],[6,17],[5,17],[5,16],[4,16],[4,14],[3,14],[3,8],[4,8],[4,6],[5,6],[5,5],[6,5],[6,4],[8,4],[8,3]]},{name:"Square",width:22,height:22,color:"#9932cc",opacity:1,dashed:[4,4],lines:[[2,2],[20,2],[20,20],[2,20],[2,2]]},{name:"Square",width:22,height:22,color:"#9932cc",opacity:.1,dashed:[4,4],dashOffset:4,lines:[[2,2],[20,2],[20,20],[2,20],[2,2]]}],D=new Map;function T(t,e,i,s){const r=`${t}:${e}:${i}:${s}`;if(D.has(r))return D.get(r);let a=j.filter((i=>i.width===t&&i.height===e));0===a.length&&t%2==0&&e%2==0&&(a=[{name:"Horizontal",color:"#00F",opacity:1,lines:[[0,e/2],[t,e/2]]},{name:"Vertical",color:"#00F",opacity:1,lines:[[t/2,0],[t/2,e]]}]);const n=i+s,o=t*n-s,h=e*n-s,l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o,l.height=h,0!==s){c.fillStyle="#BBB";for(let e=1;e<t;e++)c.fillRect(e*n-s,0,1,h);for(let t=1;t<e;t++)c.fillRect(0,t*n-s,o,1)}return a.forEach((t=>{c.lineDashOffset=t.dashOffset||0,c.setLineDash(t.dashed||[1]),c.strokeStyle=t.color,c.globalAlpha=t.opacity,c.lineWidth=1,c.fillStyle="transparent",c.beginPath(),t.lines.forEach(((t,e)=>{0===e?c.moveTo(t[0]*(i+s)-.5,t[1]*(i+s)-.5):c.lineTo(t[0]*(i+s)-.5,t[1]*(i+s)-.5)})),c.stroke()})),D.set(r,l),l}var K,U=function(t,e,i,s,r,a){function n(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,h=s.kind,l="getter"===h?"get":"setter"===h?"set":"value",c=!e&&t?s.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,s.name):{}),p=!1,y=i.length-1;y>=0;y--){var u={};for(var f in s)u[f]="access"===f?{}:s[f];for(var f in s.access)u.access[f]=s.access[f];u.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(n(t||null))};var g=(0,i[y])("accessor"===h?{get:d.get,set:d.set}:d[l],u);if("accessor"===h){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=n(g.get))&&(d.get=o),(o=n(g.set))&&(d.set=o),(o=n(g.init))&&r.unshift(o)}else(o=n(g))&&("field"===h?r.unshift(o):d[l]=o)}c&&Object.defineProperty(c,s.name,d),p=!0},F=function(t,e,i){for(var s=arguments.length>2,r=0;r<e.length;r++)i=s?e[r].call(t,i):e[r].call(t);return s?i:void 0};function N([t,e,i,s]){return`rgba(${t}, ${e}, ${i}, ${s})`}!function(t){t[t.Group=0]="Group",t[t.Pixel=1]="Pixel",t[t.ColorUpdate=2]="ColorUpdate",t[t.ColorAdd=3]="ColorAdd",t[t.ColorRemove=4]="ColorRemove",t[t.LayerAdd=5]="LayerAdd",t[t.LayerRemove=6]="LayerRemove",t[t.LayerName=7]="LayerName",t[t.LayerLock=8]="LayerLock",t[t.LayerUnlock=9]="LayerUnlock",t[t.LayerExport=10]="LayerExport",t[t.LayerVisible=11]="LayerVisible",t[t.LayerOpacity=12]="LayerOpacity"}(K||(K={}));(()=>{let t,e,i,s,r,a,n,o,h,l=[m({selector:"pg-input-pixel-editor",style:C.A,template:'<div part="wrapper" tabindex="0"> <canvas part="canvas" draggable="false"></canvas> </div>'})],c=[],d=HTMLElement,p=[],y=[],u=[],f=[],g=[],x=[],w=[],v=[],S=[],z=[],P=[],j=[],D=[],q=[];(class extends d{static{e=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;i=[b(L)],s=[b(L)],r=[b(L)],a=[b(L)],n=[b(E)],o=[b()],h=[function(t,e){const i=e.name,s=i.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,i,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${s}]`))}})}))}],U(null,null,i,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:m},p,y),U(null,null,s,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:m},u,f),U(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:m},g,x),U(null,null,a,{kind:"field",name:"gridSize",static:!1,private:!1,access:{has:t=>"gridSize"in t,get:t=>t.gridSize,set:(t,e)=>{t.gridSize=e}},metadata:m},w,v),U(null,null,n,{kind:"field",name:"transparent",static:!1,private:!1,access:{has:t=>"transparent"in t,get:t=>t.transparent,set:(t,e)=>{t.transparent=e}},metadata:m},S,z),U(null,null,o,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:m},P,j),U(null,null,h,{kind:"field",name:"$canvas",static:!1,private:!1,access:{has:t=>"$canvas"in t,get:t=>t.$canvas,set:(t,e)=>{t.$canvas=e}},metadata:m},D,q),U(null,t={value:e},l,{kind:"class",name:e.name,metadata:m},null,c),e=t.value,m&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:m}),F(e,c)}width=F(this,p,10);height=(F(this,y),F(this,u,10));size=(F(this,f),F(this,g,10));gridSize=(F(this,x),F(this,w,1));transparent=(F(this,v),F(this,S,!1));placeholder=(F(this,z),F(this,P,""));$canvas=(F(this,j),F(this,D,void 0));#t=(F(this,q),0);#e=!1;#i=!1;#s=-1;#r=-1;#a=-1;#n=-1;#o=-1;#h=0;#l=[];#c=!1;#d=!1;#p=!1;#y=[];#u=[];#f=[];#g;#m=[[0,0,0,0],[0,0,0,1]];#x;#w;#v;#b;#L;#E;#S;#C;connectedCallback(){const t=this.$canvas.getContext("2d");null!==t&&(this.#g=t,this.$canvas.addEventListener("contextmenu",this.handleContextMenu.bind(this)),this.$canvas.addEventListener("doubleclick",this.handleDoubleClick.bind(this)),this.$canvas.addEventListener("pointerdown",this.handlePointerDown.bind(this)),this.$canvas.addEventListener("pointerup",this.handlePointerUp.bind(this)),this.$canvas.addEventListener("pointermove",this.handlePointerMove.bind(this)),this.$canvas.addEventListener("pointerenter",this.handlePointerEnter.bind(this)),this.$canvas.addEventListener("pointerleave",this.handlePointerLeave.bind(this)),this.$canvas.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$canvas.addEventListener("keyup",this.handleKeyUp.bind(this)))}render(t){(t.width||t.height||t.size||t.transparent)&&this.#M()}#z=!0;#M(){const t=this.size+this.gridSize,e=this.width*t-this.gridSize,i=this.height*t-this.gridSize;if(this.$canvas.width=e,this.$canvas.height=i,this.#g.clearRect(0,0,e,i),[this.#x,this.#w]=X(e,i),[this.#v,this.#b]=X(e,i),[this.#L,this.#E]=X(e,i),[this.#S,this.#C]=X(e,i),this.transparent)for(let e=0;e<this.height;e++)for(let i=0;i<this.width;i++)this.#w.fillStyle=k,this.#w.fillRect(i*t,e*t,this.size+1,this.size+1),this.#w.fillStyle="#DDD",this.#w.fillRect(i*t+Math.ceil(this.size/2),e*t,Math.floor(this.size/2),Math.floor(this.size/2)),this.#w.fillRect(i*t,e*t+Math.floor(this.size/2),Math.ceil(this.size/2),Math.ceil(this.size/2));else this.#w.clearRect(0,0,e,i);this.#z?(this.#h=0,this.#l=[{name:"Layer 1",export:!0,locked:!1,visible:!0,opacity:1}],this.#y=[O(this.width,this.height)],this.#z=!1,this.#u=[],this.#f=[]):this.#P(),this.#$()}#P(){const t=this.#y.toReversed(),e=t.length;for(let i=0;i<this.height;i++){if(i>=t[0].length)for(let i=0;i<e;i++)t[i].push(new Array(this.width).fill(0));for(let s=0;s<this.width;s++){if(s>=t[0][i].length)for(let s=0;s<e;s++)t[s][i].push(0);for(let r=0;r<e;r++)if(0!==t[r][i][s]){this.#k(s,i,t[r][i][s]);break}}}}#R(){const t=this.#y.map((t=>function(t,e={}){let i,s,r,a=1,n=0,o=0;if(e.width){if(i=t,s=e.width,r=i.length/s,r%1!=0)throw new Error(`Invalid bitmask width. ${r} = ${i.length} / ${s}`)}else{if(!(t[0]instanceof Array))throw new Error("options.width is required for 1 dimensional array.");i=t.flat(),s=t[0].length,r=t.length}e.scale&&(a=e.scale),e.offsetX&&(n=e.offsetX),e.offsetY&&(o=e.offsetY);const h=s+2,l=Array(h*(r+2)).fill(0);function c(t,e){return(e+1)*h+(t+1)}for(let t=0;t<r;++t)for(let e=0;e<s;++e)l[c(e,t)]=i[Y(e,t,s)];const d=s*(r+1),p=Array(d+(s+1)*r).fill(0).map((()=>({x:0,y:0,next:void 0})));function y(t,e){return e*s+t}function u(t,e){return d+e*(s+1)+t}const f=new Set;function g(t,e,i){t.x=e,t.y=i,f.add(t)}function m(t){for(var e=t.next;void 0!==e&&e!==t;e=e.next)f.delete(e);void 0!==e&&f.add(t)}for(let t=0;t<r;++t)for(let e=0;e<s;++e)if(1==l[c(e,t)]){if(0==l[c(e-1,t)]){const i=p[u(e,t)];g(i,e,t+1),l[c(e-1,t-1)]?i.next=p[y(e-1,t)]:l[c(e,t-1)]?i.next=p[u(e,t-1)]:i.next=p[y(e,t)],m(i)}if(0==l[c(e+1,t)]){const i=p[u(e+1,t)];g(i,e+1,t),l[c(e+1,t+1)]?i.next=p[y(e+1,t+1)]:l[c(e,t+1)]?i.next=p[u(e+1,t+1)]:i.next=p[y(e,t+1)],m(i)}if(0==l[c(e,t-1)]){const i=p[y(e,t)];g(i,e,t),l[c(e+1,t-1)]?i.next=p[u(e+1,t-1)]:l[c(e+1,t)]?i.next=p[y(e+1,t)]:i.next=p[u(e+1,t)],m(i)}if(0==l[c(e,t+1)]){const i=p[y(e,t+1)];g(i,e+1,t+1),l[c(e-1,t+1)]?i.next=p[u(e,t+1)]:l[c(e-1,t)]?i.next=p[y(e-1,t+1)]:i.next=p[u(e,t)],m(i)}}for(const t of f){let e=t;do{e.next&&(e.next.type=e.x==e?.next?.x?"V":"H",e=e.next)}while(e!==t)}for(let t of f){let e=t;do{if(e.type!=e.next?.type)for(;e.next?.type==e.next?.next?.type;)e.next===t&&(f.delete(t),t=e.next.next,f.add(t)),e.next=e.next?.next;e=e.next}while(e!==t)}let x="";for(const t of f){x+=`M${t.x*a},${t.y*a}`;for(var w=t.next;w!=t;w=w?.next)"H"==w?.type?x+=`H${w?.x*a+n}`:"V"==w?.type&&(x+=`V${w?.y*a+o}`);x+="Z"}return x}(t,{scale:1})));console.log("change:",t),this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))}#A=0;#I(){clearInterval(this.#A),this.#A=window.setTimeout(this.#R.bind(this),1e3)}#k(t,e,i){if(t>this.width)throw new Error(`Invalid x; ${t} > ${this.width}`);if(e>this.height)throw new Error(`Invalid y; ${e} > ${this.height}`);const s=this.size+this.gridSize;this.#g.clearRect(t*s,e*s,this.size,this.size),this.#b.clearRect(t*s,e*s,this.size,this.size),this.#E.clearRect(t*s,e*s,this.size,this.size),0!==this.#m[i][3]&&(this.#b.fillStyle=k,this.#b.fillRect(t*s-this.gridSize+1,e*s-this.gridSize+1,this.size+2*this.gridSize-2,this.size+2*this.gridSize-2),this.#b.fillStyle=N(this.#m[i]),this.#b.fillRect(t*s+1,e*s+1,this.size-2,this.size-2)),0!==this.#m[i][3]&&(this.#E.fillStyle=N(this.#m[i]),this.#E.fillRect(t*s,e*s,this.size,this.size)),this.#g.drawImage(this.#x,t*s,e*s,this.size+2,this.size+2,t*s,e*s,this.size+2,this.size+2),this.#g.drawImage(this.#i?this.#v:this.#L,t*s,e*s,this.size+2,this.size+2,t*s,e*s,this.size+2,this.size+2),console.log("draw pixel(x, y, color, data):",t,e,i,this.#y[this.#h][e][t]),this.#y[this.#h][e][t]=i,this.#I()}#O(){for(let t=0;t<this.height;t++)for(let e=0;e<this.width;e++)this.#k(e,t,this.#y[this.#h][t][e])}#H(t,e,i){const s=this.size+this.gridSize,r=this.width*s-this.gridSize,a=this.height*s-this.gridSize,{minX:n,maxX:o,minY:h,maxY:l}=t.reduce(((t,s)=>({minX:Math.min(t.minX,s.x,e),maxX:Math.max(t.maxX,s.x,e),minY:Math.min(t.minY,s.y,i),maxY:Math.max(t.maxY,s.y,i)})),{minX:this.width,maxX:0,minY:this.height,maxY:0}),c=n*s,d=h*s,p=(o-n+1)*s,y=(l-h+1)*s;this.#g.clearRect(c,d,p,y),this.#g.drawImage(this.#x,c,d,p,y,c,d,p,y),this.#g.drawImage(this.#v,c,d,p,y,c,d,p,y),this.#C.clearRect(0,0,r,a),t.forEach((({x:t,y:e})=>{this.#C.fillStyle=k,this.#C.beginPath(),this.#C.arc(t*s+5,e*s+5,3,0,2*Math.PI),this.#C.closePath(),this.#C.fill(),this.#C.fillStyle="#1B79C8",this.#C.beginPath(),this.#C.arc(t*s+5,e*s+5,2,0,2*Math.PI),this.#C.closePath(),this.#C.fill()})),this.#g.drawImage(this.#S,c,d,p,y,c,d,p,y),this.dispatchEvent(new CustomEvent("debug",{detail:{x:c,y:d,width:p,height:y,canvas:this.$canvas,context:this.#g,editLayer:this.#v,noEditLayer:this.#L,baseLayer:this.#x,previewLayer:this.#S}}))}handleKeyDown(t){switch(console.log(t.shiftKey,t.ctrlKey,t.altKey,t.key),t.key){case" ":console.log("space");break;case"Escape":console.log("escape")}}handleKeyUp(t){}handleContextMenu(t){t?.preventDefault()}handleDoubleClick(t){t?.preventDefault()}handlePointerDown(t){if(1!==t.buttons&&32!==t.buttons)return t.preventDefault(),void t.stopPropagation();this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;const e=this.$canvas.getBoundingClientRect(),i=this.size+this.gridSize;let s=Math.floor((t.clientX-e.left)/i),r=Math.floor((t.clientY-e.top)/i);if(s===this.#n&&r===this.#o)return;s>=this.width&&(s=this.width-1),r>=this.height&&(r=this.height-1),this.#e=!0,this.#s=this.#y[this.#h][r][s],this.#r=s,this.#a=r,this.#n=s,this.#o=r;const a=32===t.buttons?0:1;if(0===this.#t)this.#k(s,r,a),this.#y[this.#h][r][s]=a;console.log(this.#t,s,r)}handlePointerUp(t){const e=this.$canvas.getBoundingClientRect(),i=this.size+this.gridSize;let s=Math.floor((t.clientX-e.left)/i),r=Math.floor((t.clientY-e.top)/i);if(s>=this.width&&(s=this.width-1),r>=this.height&&(r=this.height-1),-1!==this.#r||-1!==this.#a){if(s===this.#r&&r===this.#a&&1===this.#s){if(0===this.#t)this.#k(s,r,0),this.#y[this.#h][r][s]=0}else switch(this.#t){case 1:R(this.#r,this.#a,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 2:A(this.#r,this.#a,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 3:I(this.#r,this.#a,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 4:case 5:$(this.#r,this.#a,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}))}this.#n=-1,this.#o=-1,this.#e=!1}}handlePointerMove(t){const e=this.$canvas;if(this.#e){this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;const s=this.#y,r=e.getBoundingClientRect(),a=this.size+this.gridSize,n=[],o=this.#r,h=this.#a,l=this.#n,c=this.#o;if("function"==typeof t.getCoalescedEvents){const e=t.getCoalescedEvents();for(const t of e){let e=Math.floor((t.clientX-r.left)/a),i=Math.floor((t.clientY-r.top)/a);e>=this.width||i>=this.height||e===l&&i===c||n.push([e,i])}}else{let e=Math.floor((t.clientX-r.left)/a),i=Math.floor((t.clientY-r.top)/a);if(e===l&&i===c)return;e>=this.width&&(e=this.width-1),i>=this.height&&(i=this.height-1),n.push([e,i])}const d=32===t.buttons?0:1;if(0===n.length)return;const[p,y]=n.at(-1);switch(this.#n=p,this.#o=y,this.#t){case 0:for(var i of n)this.#k(i[0],i[1],d),s[this.#h][i[1]][i[0]]=d;break;case 1:this.#H(R(o,h,p,y),l,c);break;case 2:this.#H(A(o,h,p,y),l,c);break;case 3:this.#H(I(o,h,p,y),l,c);break;case 4:case 5:this.#H($(o,h,p,y),l,c)}}}handlePointerEnter(t){this.#e||this.#i||(this.#i=!0,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#v:this.#L,0,0))}handlePointerLeave(t){this.#e||(this.#i=!1,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#v:this.#L,0,0))}#$(){this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#L,0,0)}mergeColor(t,e){}clear(){const t=O(this.width,this.height);!function(t,e){const i=[],s=t[0].length,r=t.length,a=e[0].length,n=e.length,o=Math.max(s,a),h=Math.max(r,n);for(let s=0;s<h;s++)for(let r=0;r<o;r++){const a=e&&e[s]&&e[s][r],n=t&&t[s]&&t[s][r];a!==n&&i.push([r,s,n,a])}}(this.#y[this.#h],t);this.#u.push({type:K.Group,data:{name:"Clear"}}),this.#u.push({type:K.Pixel,data:{pixels:[],layer:this.#h}}),this.#y=[O(this.width,this.height)],this.#$()}reset(){this.#z=!0,this.#M()}clearHistory(){this.#u=[],this.#f=[]}applyTemplate(t){this.#y=[t],this.#O()}flipHorizontal(){const t=M(this.#y[this.#h]),e=t[0].length-1;H(this.#y[this.#h],((i,s)=>{t[s][i]=this.#y[this.#h][s][e-i]})),this.#y[this.#h]=t}flipVertical(){const t=M(this.#y[this.#h]),e=t.length-1;H(this.#y[this.#h],((i,s)=>{t[this.#h][s][i]=this.#y[e-s][i]})),this.#y[this.#h]=t}move(t,e){const i=O(this.width,this.height);for(let t=0;t<this.height;t++)i[t].fill(0);H(this.#y[this.#h],((s,r)=>{r-e<0||s-t<0||r-e>=this.height||s-t>=this.width||(i[r][s]=this.#y[this.#h][r-e][s-t])})),this.#y[this.#h]=i}invert(){this.#m.length>2||(H(this.#y[this.#h],((t,e)=>{this.#y[this.#h][e][t]=0===this.#y[this.#h][e][t]?1:0})),this.#O())}applyGuides(){const t=T(this.width,this.height,this.size,this.gridSize);this.#w.drawImage(t,0,0)}clearGuides(){}undo(){const t=this.#u.pop();if(t&&t.type===K.Pixel)this.#f.push(t),t.data.pixels.forEach((t=>{const[e,i]=t;this.#y[this.#h][i][e]=t[2]}))}redo(){}rotateClockwise(){this.#Y(!1)}rotateCounterclockwise(){this.#Y(!0)}#Y(t=!1){const e=M(this.#y[this.#h]);if(t){const t=this.#y[0].map(((t,e)=>this.#y.map((t=>t[t.length-1-e]))));for(let i=0;i<this.height;i++)for(let s=0;s<this.width;s++)e[i][s]=t[this.#h][i][s]}else{const t=this.#y[0].map(((t,e)=>this.#y.map((t=>t[e])).reverse()));for(let i=0;i<this.height;i++)for(let s=0;s<this.width;s++)e[i][s]=t[this.#h][i][s]}this.#y[this.#h]=e}hasUndo(){return 0!==this.#u.length}hasRedo(){return 0!==this.#f.length}inputModePixel(){this.#t=0}inputModeLine(){this.#t=1}inputModeRectangle(){this.#t=2}inputModeRectangleOutline(){this.#t=3}inputModeEllipse(){this.#t=4}inputModeEllipseOutline(){this.#t=5}async save(t={}){const e={width:this.width,height:this.height,transparent:this.transparent,colors:this.#m,layers:this.#l,data:this.#y};!0===t.history&&(e.undo=this.#u,e.redo=this.#f);for(let t=0;t<e.data.length;t++)for(let i=e.data[t].length-1;i>=0;i--)if(i>=this.height)e.data[t].pop();else for(let s=e.data[t][i].length-1;s>=0;s--)s>=this.width&&e.data[t][i].pop();return e}async open(t){if("object"!=typeof t)return["json must be type object"];const e=[],i=Object.keys(t);["width","height","transparent","colors","layers","data"].forEach((t=>{i.includes(t)||e.push(`JSON key '${t}' required.`)})),this.width=t.width,this.height=t.height,this.transparent=t.transparent,this.#m=t.colors,this.#l=t.layers,this.#y=t.data,t.undo&&(this.#u=t.undo),t.redo&&(this.#f=t.redo),this.#M()}})})()})();
@@ -0,0 +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="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);r&&a[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),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},593:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),o=n.n(r),i=n(314),a=n.n(i)()(o());a.push([t.id,"",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.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 r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),a=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case a:return!0;case s:return e;case i:return c.has(t);case r:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case o:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.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 c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{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(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(r=e.prototype[h],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const i=e.prototype.connectedCallback||(()=>{}),a=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[h]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.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 r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===r.length?(this[u]=!0,i.call(this),o()):Promise.all(r).then((()=>{this[u]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){a.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[y(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 g(t){return!!t&&t.constructor===Array}function b(t,e){t[u]&&t[f].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,n){const r=n.name,o=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[o][a]?this[o]:p(this[o]):this[o],set:e=>{const n=w(t?t(e):e);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(!g(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=p(this[o]);if(t[i]){const n=e[a]?(c=e)[a]&&c[s]:e;t.splice(0,this[o].length,...n)}else this[o]=e}else this[o]=t?t(e):e,b(this,r);var c}})})),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(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=m(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===E?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===E)return this[c]=n,!0;const i=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||b(this,r),this[o]=n,i}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}Symbol("hasProxy");const E=Symbol("meta");var x=n(593),P=function(t,e,n,r,o,i){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=a(y.get))&&(u.get=s),(s=a(y.set))&&(u.set=s),(s=a(y.init))&&o.unshift(s)}else(s=a(y))&&("field"===l?o.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},$=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,i,a,s=[v({selector:"pg-input-range",style:x.A,template:'<input part="input" type="range"/>'})],l=[],c=HTMLElement,p=[],u=[],h=[],d=[],f=[],m=[],y=[],g=[],b=[],w=[];(class extends c{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[S()],r=[S()],o=[S()],i=[S()],a=[function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}],P(null,null,n,{kind:"field",name:"min",static:!1,private:!1,access:{has:t=>"min"in t,get:t=>t.min,set:(t,e)=>{t.min=e}},metadata:v},p,u),P(null,null,r,{kind:"field",name:"max",static:!1,private:!1,access:{has:t=>"max"in t,get:t=>t.max,set:(t,e)=>{t.max=e}},metadata:v},h,d),P(null,null,o,{kind:"field",name:"step",static:!1,private:!1,access:{has:t=>"step"in t,get:t=>t.step,set:(t,e)=>{t.step=e}},metadata:v},f,m),P(null,null,i,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},y,g),P(null,null,a,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},b,w),P(null,t={value:e},s,{kind:"class",name:e.name,metadata:v},null,l),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),$(e,l)}min=$(this,p,"0");max=($(this,u),$(this,h,"100"));step=($(this,d),$(this,f,"1"));name=($(this,m),$(this,y,""));$input=($(this,g),$(this,b,void 0));render(){this.$input.min=this.min,this.$input.max=this.max,this.$input.step=this.step}connectedCallback(){this.$input.addEventListener("change",this.#t.bind(this)),this.$input.addEventListener("input",this.#e.bind(this))}#t(t){t.stopPropagation();const{value:e}=t.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:e,name:this.name}}))}#e(t){t.stopPropagation();const{value:e}=t.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:e,name:this.name}}))}constructor(){super(...arguments),$(this,w)}})})()})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={97:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.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: anchor(top);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n overflow: visible;\n}\n',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=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 i={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},529:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([e.id,":host {\n display: contents;\n}\n\n[part=button] {\n font-family: var(--pg-font-family);\n background: var(--pg-input-select-background, #FFFFFF);\n text-align: left;\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: 100% 0;\n border: 1px solid var(--pg-input-select-border-color, #453C4F);\n border-radius: 0.25rem;\n padding: 0;\n width: 100%;\n font-size: 1rem;\n outline: 0;\n}\n\n[part=button]:focus {\n box-shadow: 0 0 0 3px rgba(79, 143, 249, 0.5);\n}\n\n[part=label] {\n grid-row: 1;\n grid-column: 1;\n padding: 0.5rem 0.75rem;\n font-size: var(--pg-input-select-font-size, 1rem);\n}\n\n[part=chevron] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n transform: translate(-2rem, 0);\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:e=>{e.exports=function(e){return e[1]}}},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.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);const r=Symbol("addObserver"),a=Symbol("removeObserver"),o=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case s: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]?u(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 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(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 d=Symbol("init"),h=Symbol("template"),p=Symbol("style"),f=Symbol("parent");function m(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 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[f]||t.prototype[f][t.prototype[f].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[f]=[t.prototype],t.prototype[p]=e.style?[e.style]:[],t.prototype[h]=e.template||""):(t.prototype[f].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||(()=>{}),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[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[f].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[v(t)]=!0,e)),{}):{})}))};0===r.length?(this[d]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[d]=!0,o.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));a()}))},t.prototype.disconnectedCallback=function(){i.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 g(e){return!!e&&e.constructor===Array}function b(e,t){e[d]&&e[f].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":g(e)?"array":typeof e}function S(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][i]?this[a]:u(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(!g(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[o]){const n=t[i]?(c=t)[i]&&c[s]:t;e.splice(0,this[a].length,...n)}else this[a]=t}else this[a]=e?e(t):t,b(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=m(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===E?this[c]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===E)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||b(this,r),this[a]=n,o}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function $(){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 E=Symbol("meta");var x=function(e,t,n,r,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var v=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=i(v.get))&&(d.get=s),(s=i(v.set))&&(d.set=s),(s=i(v.init))&&a.unshift(s)}else(s=i(v))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),h=!0},k=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 O=new Set,P=new Map;const C=(()=>{let e,t,n=[y()],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;x(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}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),O.add(t),new Promise((e=>{P.set(t,e)}))}close(e){this.remove(),O.delete(this);const t=P.get(this);t&&t(e),P.delete(this)}});return t})();var j=n(97),A=function(e,t,n,r,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var v=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=i(v.get))&&(d.get=s),(s=i(v.set))&&(d.set=s),(s=i(v.init))&&a.unshift(s)}else(s=i(v))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),h=!0},z=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 T=(()=>{let e,t,n,r,a,o,i,s,l=[y({selector:"pg-overlay-select-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:j.A})],c=[],u=C,d=[],h=[],p=[],f=[],m=[],v=[],g=[],b=[],w=[],E=[],x=[],k=[];(class extends u{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[$()],r=[$()],a=[S()],o=[S()],i=[S()],s=[S()],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},d,h),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},p,f),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},m,v),A(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},g,b),A(null,null,i,{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,E),A(null,null,s,{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},x,k),A(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}),z(t,c)}$overlay=z(this,d,void 0);$menu=(z(this,h),z(this,p,void 0));source=(z(this,f),z(this,m,null));default=(z(this,v),z(this,g,null));items=(z(this,b),z(this,w,[]));value=(z(this,E),z(this,x,null));render(e){e.items&&null!==this.value&&(this.items.forEach((e=>e.checked=!1)),this.items.find((e=>e.value===this.value.value)).checked=!0)}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));const e=this.source?.getBoundingClientRect();let t=0;const n=null===this.value||"object"!=typeof this.value?this.value:this.value.value,r=null===this.value?-1:this.items.findIndex((e=>e.value===n));if(-1!==r){const n=this.$menu.getItemHeight(r);t-=this.$menu.getItemOffset(0,r),e?.height!==n&&e?.height&&(t+=(e.height-n)/2)}else if(this.items.length>0){this.default&&(this.default.checked=!0,this.$menu.items.unshift(this.default));const n=this.$menu.getItemHeight(0);t-=this.$menu.getItemOffset(0,0),e?.height!==n&&e?.height&&(t+=(e.height-n)/2)}this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${t}px`),this.$menu.focus(r)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),z(this,k)}});return t})();const R=T;var L=n(529),I=function(e,t,n,r,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var v=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=i(v.get))&&(d.get=s),(s=i(v.set))&&(d.set=s),(s=i(v.init))&&a.unshift(s)}else(s=i(v))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),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,i,s,l=[y({selector:"pg-input-select",style:L.A,template:'<button part="button"> <span part="label"></span> <svg part="chevron" viewBox="0 0 24 24"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"/></svg> </button>'})],c=[],u=HTMLElement,d=[],h=[],p=[],f=[],m=[],v=[],g=[],b=[],w=[],E=[],x=[],k=[];(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()],a=[S()],o=[S()],i=[$()],s=[$()],I(null,null,n,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:y},d,h),I(null,null,r,{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},p,f),I(null,null,a,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:y},m,v),I(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},g,b),I(null,null,i,{kind:"field",name:"$button",static:!1,private:!1,access:{has:e=>"$button"in e,get:e=>e.$button,set:(e,t)=>{e.$button=t}},metadata:y},w,E),I(null,null,s,{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},x,k),I(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}),F(t,c)}options=F(this,d,[]);value=(F(this,h),F(this,p,""));name=(F(this,f),F(this,m,""));default=(F(this,v),F(this,g,null));$button=(F(this,b),F(this,w,void 0));$label=(F(this,E),F(this,x,void 0));connectedCallback(){this.$button.addEventListener("click",this.#n.bind(this))}render(e){(e.value||e.default)&&(this.$label.textContent=this.value?this.value:this.default?this.default.label:" ")}#r=(F(this,k),!1);async#n(){if(this.#r)return;this.#r=!0;const e=await R.open({source:this.$button,default:this.default,value:this.options.find((e=>e.value===this.value))??null,items:this.options});void 0!==e&&(this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value}})),this.$label.textContent=e.label),this.#r=!1}})})()})();
package/pgInputText.js ADDED
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);n&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},569:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),o=r.n(n),a=r(314),i=r.n(a)()(o());i.push([t.id,':host {\n display: block;\n font-family: var(--pg-font-family);\n}\n\n[part="input"] {\n border: 1px solid var(--pg-input-text-border-color, #453C4F);\n border-radius: 0.125rem;\n padding: calc(0.5rem - 1px) 0.75rem;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n outline: none;\n width: calc(100% - 1.5rem - 2px);\n}\n\n[part="input"]:active {\n box-shadow: 0 0 0 3px var(--pg-input-text-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="input"]:focus {\n box-shadow: 0 0 0 3px var(--pg-input-text-focus-glow, rgb(79, 143, 249, 0.5));\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={id:n,exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case i:return!0;case s:return e;case a:return c.has(t);case n:return(e,r)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(r):c.get(t).set(e,[r]):c.set(t,new Map([[e,[r]]]))};case o:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?p(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return c.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return c.get(e).forEach(((t,n)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return p(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(c.has(t)){c.get(t).forEach(((t,n)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(n=e.prototype[h],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=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[h]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===n.length?(this[u]=!0,a.call(this),o()):Promise.all(n).then((()=>{this[u]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[y(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function b(t,e){t[u]&&t[f].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,r){const n=r.name,o=Symbol(n),l=Symbol(`${n}:type`),c=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[l]||"array"===this[l]?this[o][i]?this[o]:p(this[o]):this[o],set:e=>{const r=w(t?t(e):e);if("index"!==n&&this[l]!==r&&"null"!==this[l]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[l]}' cannot be set to ${r}.`);if("array"===this[l]){if(!g(e))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[o]);if(t[a]){const r=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[o].length,...r)}else this[o]=e}else this[o]=t?t(e):e,b(this,n);var c}})})),function(e){if(void 0===e&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==e&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=m(n);e[n]||(t.observedAttributes.push(r),e[n]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===E?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,r)=>{if(e===E)return this[c]=r,!0;const a=Reflect.set(t,e,r);return"length"===e&&this[o].length===r||b(this,n),this[o]=r,a}})):(this[o]=t?t(this.getAttribute(n)??e):this.getAttribute(n)??e,this[o])}}}Symbol("hasProxy");const E=Symbol("meta");var x=r(569),P=function(t,e,r,n,o,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?n.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),h=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var y=(0,r[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&o.unshift(s)}else(s=i(y))&&("field"===l?o.unshift(s):u[c]=s)}p&&Object.defineProperty(p,n.name,u),h=!0},$=function(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0};(()=>{let t,e,r,n,o,a,i=[v({selector:"pg-input-text",style:x.A,template:'<input part="input" type="text"/>'})],s=[],l=HTMLElement,c=[],p=[],u=[],h=[],d=[],f=[],m=[],y=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;r=[S()],n=[S()],o=[S()],a=[function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],P(null,null,r,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},c,p),P(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},u,h),P(null,null,o,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:v},d,f),P(null,null,a,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},m,y),P(null,t={value:e},i,{kind:"class",name:e.name,metadata:v},null,s),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),$(e,s)}name=$(this,c,"");value=($(this,p),$(this,u,""));placeholder=($(this,h),$(this,d,""));$input=($(this,f),$(this,m,void 0));connectedCallback(){this.$input.addEventListener("input",this.handleInput.bind(this)),this.$input.addEventListener("change",this.handleChange.bind(this))}skipValue=($(this,y),!1);render(t){t.value&&!this.skipValue&&(this.$input.value=this.value),t.placeholder&&(this.$input.placeholder=this.placeholder),this.skipValue=!1}handleInput(t){t.stopPropagation(),this.skipValue=!0,this.value=t.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:t.target.value,name:t.name}}))}handleChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value,name:t.name}}))}})})()})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={277:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: block;\n}\n\n[part="grid"] {\n display: grid;\n grid-template-columns: auto 1.5rem;\n}\n\n[part="icon"] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n transform: translate(calc(-0.35rem + 1px), calc(0.25rem + 1px));\n}\n\n[part="input"] {\n grid-row: 1;\n grid-column: 1 / span 2;\n}\n\n[part="input"]:focus + [part="icon"] {\n --pg-icon-color: #4f8ff9;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,a,o){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);r&&i[p[0]]||(void 0!==o&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=o),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),a&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=a):p[4]="".concat(a)),e.push(p))}},e}},441:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #453C4F);\n}\n\n[part="svg"] {\n width: var(--pg-icon-width, 1.5rem);\n height: var(--pg-icon-height, 1.5rem);\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},569:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: block;\n font-family: var(--pg-font-family);\n}\n\n[part="input"] {\n border: 1px solid var(--pg-input-text-border-color, #453C4F);\n border-radius: 0.125rem;\n padding: calc(0.5rem - 1px) 0.75rem;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n outline: none;\n width: calc(100% - 1.5rem - 2px);\n}\n\n[part="input"]:active {\n box-shadow: 0 0 0 3px var(--pg-input-text-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="input"]:focus {\n box-shadow: 0 0 0 3px var(--pg-input-text-focus-glow, rgb(79, 143, 249, 0.5));\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={id:r,exports:{}};return t[r](o,o.exports,n),o.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 r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),a=Symbol("removeObserver"),o=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case o:return c.has(t);case r:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case a:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.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 c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{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(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(r=e.prototype[h],(a=t.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));const o=e.prototype.connectedCallback||(()=>{}),i=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[h]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.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 r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),a=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===r.length?(this[u]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[u]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));a()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[y(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 g(t){return!!t&&t.constructor===Array}function b(t,e){t[u]&&t[f].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,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][i]?this[a]:p(this[a]):this[a],set:e=>{const n=w(t?t(e):e);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(!g(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[a]);if(t[o]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[a].length,...n)}else this[a]=e}else this[a]=t?t(e):e,b(this,r);var c}})})),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(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=m(r);e[r]||(t.observedAttributes.push(n),e[r]=a)}return this[l]=w(e),"array"===this[l]?(this[a]=e,new Proxy(e,{get:(t,e)=>e===x?this[c]:(console.log("errr???"),Reflect.get(this[a],e)),set:(t,e,n)=>{if(e===x)return this[c]=n,!0;const o=Reflect.set(t,e,n);return"length"===e&&this[a].length===n||b(this,r),this[a]=n,o}})):(this[a]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[a])}}}function E(){return function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const x=Symbol("meta");var $=n(277);var P=n(569),k=function(t,e,n,r,a,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},C=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};const O=(()=>{let t,e,n,r,a,o,i=[v({selector:"pg-input-text",style:P.A,template:'<input part="input" type="text"/>'})],s=[],l=HTMLElement,c=[],p=[],u=[],h=[],d=[],f=[],m=[],y=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[S()],r=[S()],a=[S()],o=[E()],k(null,null,n,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},c,p),k(null,null,r,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},u,h),k(null,null,a,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:v},d,f),k(null,null,o,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},m,y),k(null,t={value:e},i,{kind:"class",name:e.name,metadata:v},null,s),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),C(e,s)}name=C(this,c,"");value=(C(this,p),C(this,u,""));placeholder=(C(this,h),C(this,d,""));$input=(C(this,f),C(this,m,void 0));connectedCallback(){this.$input.addEventListener("input",this.handleInput.bind(this)),this.$input.addEventListener("change",this.handleChange.bind(this))}skipValue=(C(this,y),!1);render(t){t.value&&!this.skipValue&&(this.$input.value=this.value),t.placeholder&&(this.$input.placeholder=this.placeholder),this.skipValue=!1}handleInput(t){t.stopPropagation(),this.skipValue=!0,this.value=t.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:t.target.value,name:t.name}}))}handleChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value,name:t.name}}))}});return e})();var j=n(441),A=function(t,e,n,r,a,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},z=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};(()=>{let t,e,n,r,a,o=[v({selector:"pg-icon",style:j.A,template:'<svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/> </svg>'})],i=[],s=HTMLElement,l=[],c=[],p=[],u=[],h=[],d=[];(class extends s{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;n=[S()],r=[E()],a=[E()],A(null,null,n,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:f},l,c),A(null,null,r,{kind:"field",name:"$svg",static:!1,private:!1,access:{has:t=>"$svg"in t,get:t=>t.$svg,set:(t,e)=>{t.$svg=e}},metadata:f},p,u),A(null,null,a,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:f},h,d),A(null,t={value:e},o,{kind:"class",name:e.name,metadata:f},null,i),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),z(e,i)}path=z(this,l,"M0 0h24v24H0V0zm2 2v20h20V2H2z");$svg=(z(this,c),z(this,p,void 0));$path=(z(this,u),z(this,h,void 0));render(t){if(t.path){const t=getComputedStyle(this).getPropertyValue("--pg-icon-viewbox");if(this.$svg.setAttribute("viewBox",t||"0 0 24 24"),!this.path)throw new Error("invalid path set on pg-icon");this.$path.setAttribute("d",this.path)}}constructor(){super(...arguments),z(this,d)}})})();var T=function(t,e,n,r,a,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},R=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};(()=>{let t,e,n,r,a=[v({selector:"pg-input-text-icon",style:$.A,template:'<div part="grid"> <parent/> <pg-icon part="icon"></pg-icon> </div>'})],o=[],i=O,s=[],l=[],c=[],p=[];(class extends i{static{e=this}static{const u="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;n=[S()],r=[E()],T(null,null,n,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:u},s,l),T(null,null,r,{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:u},c,p),T(null,t={value:e},a,{kind:"class",name:e.name,metadata:u},null,o),e=t.value,u&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u}),R(e,o)}path=R(this,s,"M3,3V21H21V3");$icon=(R(this,l),R(this,c,void 0));render(t){t.path&&(this.$icon.path=this.path)}constructor(){super(...arguments),R(this,p)}})})()})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={25:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(601),s=n.n(i),o=n(314),a=n.n(o)()(s());a.push([e.id,':host {\n display: block;\n}\n\n[part="wrapper"] {\n display: grid;\n grid-template-rows: auto 0;\n grid-template-columns: 100%;\n}\n\n[part="select"] {\n display: grid;\n grid-template-columns: 3.5rem 1.75rem auto 2.75rem 1fr 1.5rem;\n grid-template-rows: 1.5rem 1.5rem;\n grid-row: 1;\n grid-column: 1;\n border: 1px solid var(--pg-input-select-border-color, #453C4F);\n border-radius: 0.25rem;\n padding: 0.5rem 0.5rem 0.5rem 0.75rem;\n width: 100%;\n font-size: 1rem;\n outline: 0;\n text-align: left;\n background: var(--pg-input-select-background, #fff);\n}\n\n[part="select"]:focus {\n box-shadow: 0 0 0 3px rgba(79, 143, 249, 0.5);\n}\n\n[part="select"]:disabled {\n border: 1px solid var(--pg-input-select-disabled-border-color, rgba(69, 60, 79, 0.6));\n color: var(--pg-input-select-disabled-color, rgba(69, 60, 79, 0.6));\n}\n\n[part="chevron"] {\n grid-row: 1 / span 2;\n grid-column: 6;\n pointer-events: none;\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n}\n\n.githubIcon,\n[part="githubIcon"] {\n grid-row: 2;\n grid-column: 2;\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n color: var(--pg-input-select-border-color, #453C4F);\n}\n\n.avatar,\n[part="selectedAvatar"] {\n grid-row: 1 / span 2;\n grid-column: 1;\n width: 3rem;\n height: 3rem;\n border-radius: 50%;\n border: 1px solid var(--pg-input-select-border-color, #453C4F);\n}\n\n.name,\n[part="selectedName"] {\n grid-row: 1;\n grid-column: 2 / span 4;\n align-self: center;\n}\n\n.github,\n[part="selectedGithub"] {\n grid-row: 2;\n grid-column: 3;\n align-self: center;\n}\n\n.countIcon,\n[part="countIcon"] {\n grid-row: 2;\n grid-column: 4;\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n margin-left: 1rem;\n color: var(--pg-input-select-border-color, #453C4F);\n}\n\n.iconCount,\n[part="selectedCount"] {\n grid-row: 2;\n grid-column: 5;\n align-self: center;\n font-weight: bold;\n}\n\n[part="dropdown"].open {\n display: flex;\n}\n\n[part="dropdown"] {\n grid-row: 2;\n grid-column: 1;\n display: none;\n flex-direction: column;\n border: 1px solid var(--pg-input-select-border-color, #453C4F);\n border-radius: 0.25rem;\n background: #fff;\n z-index: 1;\n position: absolute;\n max-height: 16.5rem;\n overflow: auto;\n}\n\n[part="dropdown"] button {\n display: grid;\n grid-template-columns: 3.5rem 1.75rem auto 2.75rem 1fr;\n grid-template-rows: auto;\n border: 0;\n padding: 0.5rem 0.75rem;\n text-align: left;\n background: #fff;\n}\n\n[part="dropdown"] button:hover,\n[part="dropdown"] button:focus {\n color: #fff;\n background: #1E90FF;\n}\n\n[part="dropdown"] button:hover .githubIcon,\n[part="dropdown"] button:hover .countIcon,\n[part="dropdown"] button:focus .githubIcon,\n[part="dropdown"] button:focus .countIcon {\n color: #fff;\n}\n\n[part="loading"] {\n width: 3rem;\n height: 3rem;\n animation: spin 2s infinite linear;\n grid-row: 1 / span 2;;\n grid-column: 1;\n pointer-events: none;\n align-self: center;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(359deg);\n }\n}\n\n[part="loadingText"] {\n grid-row: 1 / span 2;\n grid-column: 2 / span 3;\n align-self: center;\n}\n\n[part="noData"] {\n grid-row: 1 / span 2;\n grid-column: 1 / span 4;\n align-self: center;\n}\n\n[part="noSelection"] {\n grid-row: 1 / span 2;\n grid-column: 1 / span 4;\n align-self: center;\n}',""]);var r=new CSSStyleSheet;r.replaceSync(a.toString());const l=r},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var r=0;r<this.length;r++){var l=this[r][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&a[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),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={id:i,exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const i=Symbol("addObserver"),s=Symbol("removeObserver"),o=Symbol("getObservers"),a=Symbol("isProxy"),r=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 r:return t;case o:return c.has(e);case i: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 s: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,i)=>{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,i)=>{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 p=Symbol("init"),h=Symbol("template"),u=Symbol("style"),m=Symbol("parent");function g(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function f(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var i,s;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[u]=e.style?[e.style]:[],t.prototype[h]=e.template||""):(t.prototype[m].push(t.prototype),t.prototype[u].push(e.style),t.prototype[h]=(i=t.prototype[h],(s=e.template||null)&&s.match(/<parent\/>/)?s.replace(/<parent\/>/,i):`${i}${s||""}`));const o=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[h]||"";const n=document.importNode(e.content,!0),i=this.attachShadow({mode:"open"});i.adoptedStyleSheets=t.prototype[u].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),i.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 i=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),s=()=>{this[m].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[y(t)]=!0,e)),{}):{})}))};0===i.length?(this[p]=!0,o.call(this),s()):Promise.all(i).then((()=>{this[p]=!0,o.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[y(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 v(e){return!!e&&e.constructor===Array}function b(e,t){e[p]&&e[m].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function $(e){return null===e?"null":v(e)?"array":typeof e}function w(e){return function(t,n){const i=n.name,s=Symbol(i),l=Symbol(`${i}:type`),c=Symbol(`${i}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,i,{get:()=>"object"===this[l]||"array"===this[l]?this[s][a]?this[s]:d(this[s]):this[s],set:t=>{const n=$(e?e(t):t);if("index"!==i&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${i} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!v(t))throw new PropError(`Array "${i}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,i)?.set);if(this[s]===t)throw new Error("Setting an array to itself is not allowed.");const e=d(this[s]);if(e[o]){const n=t[a]?(c=t)[a]&&c[r]:t;e.splice(0,this[s].length,...n)}else this[s]=t}else this[s]=e?e(t):t,b(this,i);var c}})})),function(t){if(void 0===t&&"index"!==i)throw new Error(`@Prop() ${i} must have an initial value defined.`);if(void 0!==t&&"index"===i)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${i} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=g(i);t[i]||(e.observedAttributes.push(n),t[i]=s)}return this[l]=$(t),"array"===this[l]?(this[s]=t,new Proxy(t,{get:(e,t)=>t===S?this[c]:(console.log("errr???"),Reflect.get(this[s],t)),set:(e,t,n)=>{if(t===S)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[s].length===n||b(this,i),this[s]=n,o}})):(this[s]=e?e(this.getAttribute(i)??t):this.getAttribute(i)??t,this[s])}}}function C(){return function(e,t){const n=t.name,i=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${i}]`))}})}))}}Symbol("hasProxy");const S=Symbol("meta");var x=n(25),E=function(e,t,n,i,s,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!1,u=n.length-1;u>=0;u--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var y=(0,n[u])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(r=a(y.get))&&(p.get=r),(r=a(y.set))&&(p.set=r),(r=a(y.init))&&s.unshift(r)}else(r=a(y))&&("field"===l?s.unshift(r):p[c]=r)}d&&Object.defineProperty(d,i.name,p),h=!0},k=function(e,t,n){for(var i=arguments.length>2,s=0;s<t.length;s++)n=i?t[s].call(e,n):t[s].call(e);return i?n:void 0};function T(e,t){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("viewBox","0 0 24 24");const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),i.setAttribute("fill","currentColor"),n.appendChild(i),n.classList.add(t),n}const A="ArrowUp",I="ArrowDown",L="Escape",M="Tab";(()=>{let e,t,n,i,s,o,a,r,l,c,d,p,h,u,m,g,y,v,b,$,S=[f({selector:"pg-input-user-select",style:x.A,template:'<div part="wrapper"> <button part="select"> <img part="selectedAvatar"/> <span part="selectedName">First Last</span> <svg part="githubIcon" viewBox="0 0 24 24"><path fill="currentColor" d="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z"/></svg> <span part="selectedGithub">GitHub</span> <svg part="countIcon" viewBox="0 0 24 24"><path fill="currentColor" d="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z"/></svg> <span part="selectedCount">9999</span> <svg part="loading" viewBox="0 0 24 24"><path fill="currentColor" d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"/></svg> <span part="loadingText">Loading...</span> <svg part="chevron" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"/></svg> <span part="noData">Empty Users List</span> <span part="noSelection">Select a User</span> </button> <div part="dropdownContainer"> <div part="dropdown"></div> </div> </div>'})],D=[],P=HTMLElement,N=[],O=[],R=[],j=[],G=[],z=[],H=[],B=[],F=[],U=[],Z=[],V=[],W=[],q=[],K=[],_=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ne=[],ie=[],se=[],oe=[],ae=[],re=[],le=[],ce=[],de=[],pe=[],he=[],ue=[],me=[],ge=[];(class extends P{static{t=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(P[Symbol.metadata]??null):void 0;n=[w()],i=[w()],s=[w()],o=[w()],a=[w()],r=[w()],l=[C()],c=[C()],d=[C()],p=[C()],h=[C()],u=[C()],m=[C()],g=[C()],y=[C()],v=[C()],b=[C()],$=[C()],E(null,null,n,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:f},N,O),E(null,null,i,{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:f},R,j),E(null,null,s,{kind:"field",name:"clear",static:!1,private:!1,access:{has:e=>"clear"in e,get:e=>e.clear,set:(e,t)=>{e.clear=t}},metadata:f},G,z),E(null,null,o,{kind:"field",name:"noDataText",static:!1,private:!1,access:{has:e=>"noDataText"in e,get:e=>e.noDataText,set:(e,t)=>{e.noDataText=t}},metadata:f},H,B),E(null,null,a,{kind:"field",name:"noSelectionText",static:!1,private:!1,access:{has:e=>"noSelectionText"in e,get:e=>e.noSelectionText,set:(e,t)=>{e.noSelectionText=t}},metadata:f},F,U),E(null,null,r,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:f},Z,V),E(null,null,l,{kind:"field",name:"$select",static:!1,private:!1,access:{has:e=>"$select"in e,get:e=>e.$select,set:(e,t)=>{e.$select=t}},metadata:f},W,q),E(null,null,c,{kind:"field",name:"$selectedAvatar",static:!1,private:!1,access:{has:e=>"$selectedAvatar"in e,get:e=>e.$selectedAvatar,set:(e,t)=>{e.$selectedAvatar=t}},metadata:f},K,_),E(null,null,d,{kind:"field",name:"$selectedName",static:!1,private:!1,access:{has:e=>"$selectedName"in e,get:e=>e.$selectedName,set:(e,t)=>{e.$selectedName=t}},metadata:f},Y,J),E(null,null,p,{kind:"field",name:"$githubIcon",static:!1,private:!1,access:{has:e=>"$githubIcon"in e,get:e=>e.$githubIcon,set:(e,t)=>{e.$githubIcon=t}},metadata:f},Q,X),E(null,null,h,{kind:"field",name:"$selectedGithub",static:!1,private:!1,access:{has:e=>"$selectedGithub"in e,get:e=>e.$selectedGithub,set:(e,t)=>{e.$selectedGithub=t}},metadata:f},ee,te),E(null,null,u,{kind:"field",name:"$countIcon",static:!1,private:!1,access:{has:e=>"$countIcon"in e,get:e=>e.$countIcon,set:(e,t)=>{e.$countIcon=t}},metadata:f},ne,ie),E(null,null,m,{kind:"field",name:"$selectedCount",static:!1,private:!1,access:{has:e=>"$selectedCount"in e,get:e=>e.$selectedCount,set:(e,t)=>{e.$selectedCount=t}},metadata:f},se,oe),E(null,null,g,{kind:"field",name:"$dropdown",static:!1,private:!1,access:{has:e=>"$dropdown"in e,get:e=>e.$dropdown,set:(e,t)=>{e.$dropdown=t}},metadata:f},ae,re),E(null,null,y,{kind:"field",name:"$loading",static:!1,private:!1,access:{has:e=>"$loading"in e,get:e=>e.$loading,set:(e,t)=>{e.$loading=t}},metadata:f},le,ce),E(null,null,v,{kind:"field",name:"$loadingText",static:!1,private:!1,access:{has:e=>"$loadingText"in e,get:e=>e.$loadingText,set:(e,t)=>{e.$loadingText=t}},metadata:f},de,pe),E(null,null,b,{kind:"field",name:"$noData",static:!1,private:!1,access:{has:e=>"$noData"in e,get:e=>e.$noData,set:(e,t)=>{e.$noData=t}},metadata:f},he,ue),E(null,null,$,{kind:"field",name:"$noSelection",static:!1,private:!1,access:{has:e=>"$noSelection"in e,get:e=>e.$noSelection,set:(e,t)=>{e.$noSelection=t}},metadata:f},me,ge),E(null,e={value:t},S,{kind:"class",name:t.name,metadata:f},null,D),t=e.value,f&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),k(t,D)}options=k(this,N,[]);value=(k(this,O),k(this,R,null));clear=(k(this,j),k(this,G,!1));noDataText=(k(this,z),k(this,H,"Empty Users List"));noSelectionText=(k(this,B),k(this,F,"Select a User"));name=(k(this,U),k(this,Z,""));$select=(k(this,V),k(this,W,void 0));$selectedAvatar=(k(this,q),k(this,K,void 0));$selectedName=(k(this,_),k(this,Y,void 0));$githubIcon=(k(this,J),k(this,Q,void 0));$selectedGithub=(k(this,X),k(this,ee,void 0));$countIcon=(k(this,te),k(this,ne,void 0));$selectedCount=(k(this,ie),k(this,se,void 0));$dropdown=(k(this,oe),k(this,ae,void 0));$loading=(k(this,re),k(this,le,void 0));$loadingText=(k(this,ce),k(this,de,void 0));$noData=(k(this,pe),k(this,he,void 0));$noSelection=(k(this,ue),k(this,me,void 0));connectedCallback(){this.$select.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeys.bind(this))}isOpen=(k(this,ge),!1);handleCloseBind;optionsElements=[];close(){this.isOpen=!1,this.$dropdown.classList.remove("open"),document.removeEventListener("mousedown",this.handleCloseBind)}handleClose(e){const t=e.target;t.nodeName===this.nodeName&&t.isOpen||this.close()}handleClick(){this.isOpen=!this.isOpen,this.$dropdown.classList.toggle("open",this.isOpen),this.handleCloseBind=this.handleClose.bind(this),document.addEventListener("mousedown",this.handleCloseBind),this.focusSelected()}focusSelected(){const e=this.options?.findIndex((e=>e===this.value));e&&-1!==e?(this.optionsElements[e].focus(),this.index=e):this.optionsElements.length&&this.optionsElements[0].focus()}handleSelect(e){console.log("clicked");const{id:t}=e.currentTarget.dataset,n=this.options?.find((e=>e.id===t));this.value=n||null,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,name:this.name}})),this.close()}loadingMode(){this.$selectedAvatar.style.display="none",this.$selectedName.style.display="none",this.$githubIcon.style.display="none",this.$selectedGithub.style.display="none",this.$countIcon.style.display="none",this.$selectedCount.style.display="none",this.$noData.style.display="none",this.$noSelection.style.display="none",this.$loading.style.display="flex",this.$loadingText.style.display="initial",this.$select.disabled=!0}noDataMode(){this.$selectedAvatar.style.display="none",this.$selectedName.style.display="none",this.$githubIcon.style.display="none",this.$selectedGithub.style.display="none",this.$countIcon.style.display="none",this.$selectedCount.style.display="none",this.$noData.style.display="initial",this.$noSelection.style.display="none",this.$loading.style.display="none",this.$loadingText.style.display="none",this.$select.disabled=!0}noSelectionMode(){this.$selectedAvatar.style.display="none",this.$selectedName.style.display="none",this.$githubIcon.style.display="none",this.$selectedGithub.style.display="none",this.$countIcon.style.display="none",this.$selectedCount.style.display="none",this.$noData.style.display="none",this.$noSelection.style.display="initial",this.$loading.style.display="none",this.$loadingText.style.display="none",this.$select.disabled=!1}selectMode(){this.$selectedAvatar.style.display="initial",this.$selectedName.style.display="initial",this.$githubIcon.style.display="initial",this.$selectedGithub.style.display="initial",this.$countIcon.style.display="initial",this.$selectedCount.style.display="initial",this.$noData.style.display="none",this.$noSelection.style.display="none",this.$loading.style.display="none",this.$loadingText.style.display="none",this.$select.disabled=!1}render(e){e.options&&(null===this.options?this.loadingMode():0===this.options.length?this.noDataMode():(this.selectMode(),this.calculateMinWidth(),this.optionsElements=this.options.map((e=>{const t=document.createElement("button"),n=document.createElement("img");n.src=`${e.base64}`,n.classList.add("avatar"),t.appendChild(n);const i=document.createElement("span");i.innerText=`${e.name}`,i.classList.add("name"),t.appendChild(i);const s=document.createElement("span");s.innerText=`${e.github}`,s.classList.add("github"),t.appendChild(s);const o=document.createElement("span");return o.innerText=`${e.iconCount}`,o.classList.add("iconCount"),t.appendChild(o),t.dataset.id=`${e.id}`,t.appendChild(T("M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z","githubIcon")),t.appendChild(T("M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z","countIcon")),t.addEventListener("click",this.handleSelect.bind(this)),this.$dropdown.appendChild(t),t})),null===this.value&&this.noSelectionMode())),e.value&&e.value&&this.value&&(this.$selectedAvatar.src=this.value.base64||"",this.$selectedCount.innerText=`${this.value.iconCount}`,this.$selectedName.innerText=`${this.value.name}`,this.$selectedGithub.innerText=`${this.value.github}`,this.selectMode()),e.noDataText&&(this.$noData.innerText=this.noDataText),e.noSelectionText&&(this.$noSelection.innerText=this.noSelectionText)}calculateMinWidth(){const{width:e}=this.$select.getBoundingClientRect();this.$dropdown.style.minWidth=e-2+"px"}index=-1;handleKeys(e){const t=this.optionsElements;let n=this.index;switch(e.key){case A:0===n?n=t.length-1:n>=0&&(n-=1);break;case I:n<t.length-1?n+=1:n===t.length-1&&(n=0);break;case M:case L:this.close()}n!=this.index&&(this.index=n,t[n].focus(),e.preventDefault())}})})()})();
package/pgListTag.js ADDED
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",o=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),o&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),o&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,o,n,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);o&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),n&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=n):u[4]="".concat(n)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}},833:(t,e,r)=>{r.d(e,{A:()=>c});var o=r(601),n=r.n(o),i=r(314),s=r.n(i)()(n());s.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #453C4F);\n}\n\n[part="svg"] {\n width: var(--pg-icon-width, 1.5rem);\n height: var(--pg-icon-height, 1.5rem);\n}',""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const c=a}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const o=Symbol("addObserver"),n=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("isProxy"),a=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function u(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case s:return!0;case a:return e;case i:return l.has(t);case o:return(e,r)=>{l.has(t)?l.get(t).has(e)?l.get(t).get(e).push(r):l.get(t).set(e,[r]):l.set(t,new Map([[e,[r]]]))};case n: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,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?u(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return l.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return l.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return u(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(l.has(t)){l.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}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"),d=Symbol("template"),h=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var o,n;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[h].push(t.style),e.prototype[d]=(o=e.prototype[d],(n=t.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):`${o}${n||""}`));const i=e.prototype.connectedCallback||(()=>{}),s=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[d]||"";const r=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[h].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),o.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const o=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),n=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===o.length?(this[p]=!0,i.call(this),n()):Promise.all(o).then((()=>{this[p]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));n()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[y(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function v(t){return!!t&&t.constructor===Array}function g(t,e){t[p]&&t[f].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":v(t)?"array":typeof t}function S(t){return function(e,r){const o=r.name,n=Symbol(o),c=Symbol(`${o}:type`),l=Symbol(`${o}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[c]||"array"===this[c]?this[n][s]?this[n]:u(this[n]):this[n],set:e=>{const r=w(t?t(e):e);if("index"!==o&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${o} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!v(e))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[n]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[n]);if(t[i]){const r=e[s]?(l=e)[s]&&l[a]:e;t.splice(0,this[n].length,...r)}else this[n]=e}else this[n]=t?t(e):e,g(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(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=m(o);e[o]||(t.observedAttributes.push(r),e[o]=n)}return this[c]=w(e),"array"===this[c]?(this[n]=e,new Proxy(e,{get:(t,e)=>e===E?this[l]:(console.log("errr???"),Reflect.get(this[n],e)),set:(t,e,r)=>{if(e===E)return this[l]=r,!0;const i=Reflect.set(t,e,r);return"length"===e&&this[n].length===r||g(this,o),this[n]=r,i}})):(this[n]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[n])}}}Symbol("hasProxy");const E=Symbol("meta");var P=r(833),x=function(t,e,r,o,n,i){function s(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",u=!e&&t?o.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d=!1,h=r.length-1;h>=0;h--){var f={};for(var m in o)f[m]="access"===m?{}:o[m];for(var m in o.access)f.access[m]=o.access[m];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var y=(0,r[h])("accessor"===c?{get:p.get,set:p.set}:p[l],f);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=s(y.get))&&(p.get=a),(a=s(y.set))&&(p.set=a),(a=s(y.init))&&n.unshift(a)}else(a=s(y))&&("field"===c?n.unshift(a):p[l]=a)}u&&Object.defineProperty(u,o.name,p),d=!0},A=function(t,e,r){for(var o=arguments.length>2,n=0;n<e.length;n++)r=o?e[n].call(t,r):e[n].call(t);return o?r:void 0};(()=>{let t,e,r,o,n,i=[b({selector:"pg-list-tag",style:P.A,template:'<div part="items"></div>'})],s=[],a=HTMLElement,c=[],l=[],u=[],p=[],d=[],h=[];(class extends a{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;r=[S()],o=[S()],n=[function(t,e){const r=e.name,o=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}],x(null,null,r,{kind:"field",name:"items",static:!1,private:!1,access:{has:t=>"items"in t,get:t=>t.items,set:(t,e)=>{t.items=e}},metadata:f},c,l),x(null,null,o,{kind:"field",name:"edit",static:!1,private:!1,access:{has:t=>"edit"in t,get:t=>t.edit,set:(t,e)=>{t.edit=e}},metadata:f},u,p),x(null,null,n,{kind:"field",name:"$items",static:!1,private:!1,access:{has:t=>"$items"in t,get:t=>t.$items,set:(t,e)=>{t.$items=e}},metadata:f},d,h),x(null,t={value:e},i,{kind:"class",name:e.name,metadata:f},null,s),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),A(e,s)}items=A(this,c,[]);edit=(A(this,l),A(this,u,!1));$items=(A(this,p),A(this,d,void 0));render(t){t.items&&function(t,e,r,o,n){const i=Array.from(t.children),s=i.map((t=>t.dataset.key)),a=e.map((t=>t[r]));e.forEach((e=>{if(!s.includes(e[r])){const n=o(e);return n instanceof DocumentFragment?n.children[0].dataset.key=e[r]:n.dataset.key=e[r],void t.appendChild(n)}{const t=i.find((t=>t.dataset.key===s[r]));if(e[r]===s[r])return void n(e,t)}})),i.forEach((t=>{a.includes(t.dataset.key)||t.remove()}))}(this.$items,this.items,"id",(t=>{const e=function(t,e){const r=document.createElement("template");r.innerHTML=t;const o=document.importNode(r.content,!0);for(const[t,r]of Object.entries(e)){const e=o.querySelector(`[part~="${t}"]`);if(e)for(const[t,o]of Object.entries(r))o instanceof Function?null===o()?e.removeAttribute(t):e.setAttribute(t,o()):e[t]=o}return o}('<button part="name"> </button>',{name:{innerText:t.name}}),r=e.querySelector('[part="name"]');return r?.addEventListener("click",(e=>{console.log(t)})),e}),((t,e)=>{})),t.edit}constructor(){super(...arguments),A(this,h)}})})()})();