@descope/web-components-ui 3.11.4 → 3.11.6

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 (49) hide show
  1. package/dist/cjs/index.cjs.js +37 -16
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +37 -16
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/DescopeDev.js +1 -1
  6. package/dist/umd/DescopeDev.js.map +1 -1
  7. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  8. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  9. package/dist/umd/descope-button.js +1 -1
  10. package/dist/umd/descope-button.js.map +1 -1
  11. package/dist/umd/descope-code-snippet-index-js.js +1 -1
  12. package/dist/umd/descope-code-snippet-index-js.js.map +1 -1
  13. package/dist/umd/descope-collapsible-container.js +1 -1
  14. package/dist/umd/descope-collapsible-container.js.map +1 -1
  15. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  16. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  17. package/dist/umd/descope-grid-index-js.js +1 -1
  18. package/dist/umd/descope-grid-index-js.js.map +1 -1
  19. package/dist/umd/descope-icon.js +1 -1
  20. package/dist/umd/descope-icon.js.map +1 -1
  21. package/dist/umd/descope-image.js.map +1 -1
  22. package/dist/umd/descope-multi-line-mappings.js +1 -1
  23. package/dist/umd/descope-multi-line-mappings.js.map +1 -1
  24. package/dist/umd/descope-outbound-app-button.js +1 -1
  25. package/dist/umd/descope-outbound-app-button.js.map +1 -1
  26. package/dist/umd/descope-outbound-apps.js +1 -1
  27. package/dist/umd/descope-outbound-apps.js.map +1 -1
  28. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
  29. package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
  30. package/dist/umd/descope-timer-button.js +1 -1
  31. package/dist/umd/descope-timer-button.js.map +1 -1
  32. package/dist/umd/descope-timer.js +1 -1
  33. package/dist/umd/descope-timer.js.map +1 -1
  34. package/dist/umd/descope-trusted-devices.js +1 -1
  35. package/dist/umd/descope-trusted-devices.js.map +1 -1
  36. package/dist/umd/descope-upload-file-index-js.js +2 -2
  37. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  38. package/dist/umd/descope-user-attribute-index-js.js +4 -4
  39. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  40. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  41. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  42. package/dist/umd/descope-user-passkeys.js +1 -1
  43. package/dist/umd/descope-user-passkeys.js.map +1 -1
  44. package/dist/umd/index.js +1 -1
  45. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  46. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  47. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  48. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  49. package/package.json +36 -36
@@ -1 +1 @@
1
- {"version":3,"file":"descope-grid-index-js.js","mappings":"oIAAAA,EAAOC,QAAU,gX,WCAjBD,EAAOC,QAAU,gd,oGCUV,MAAMC,GAAgB,QAAiB,QAEjCC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,KAAM,CAAC,CAAC,EAAG,CAAEC,SAAU,IAAWC,WAAWF,UAGjD,KACA,KAPuB,EASvB,QAAY,CACVG,MAAO,GACPC,eAAgB,gBAChBC,MAAO,IAAM,6FAMbC,iBAAkB,CAAC,WAAY,QAAS,SACxCT,kB,4GC3BJU,eAAeC,OAAO,IAAe,I,+GCQ9B,MAAMX,GAAgB,QAAiB,SAExCY,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrCb,gBACAc,aAAc,UAEd,6BAAWC,GACT,OAAOH,CACT,CAEA,WAAAI,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KA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8W,gBAAgB,EAChBxY,MAAO,CAAC,IACRC,eAAgB,cAChBC,MAAO,IAAM,6lBAqBqE8S,EAAUjT,WAAW8U,szBA8BvG1U,iBAAkB,CAAC,UAAW,WAAY,SAC1CT,mBCnXJU,eAAeC,OAAOX,EAAesT,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-code-snippet/check-icon.svg","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/copy-icon.svg","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/CodeSnippetClass.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-custom-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-item-details-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-selection-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-text-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-grid/GridClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/index.js"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iY2hlY2staWNvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4gPHBvbHlsaW5lIHBvaW50cz0iMjAgNiA5IDE3IDQgMTIiPjwvcG9seWxpbmU+IDwvc3ZnPiA=\"","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPiA8cmVjdCB4PSI5IiB5PSI5IiB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHJ4PSIyIiByeT0iMiI+PC9yZWN0PiA8cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+IDwvc3ZnPiA=\"","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n","/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","export const decode = (input) => {\n const txt = document.createElement('textarea');\n txt.innerHTML = input;\n return txt.value;\n};\n\nexport const tpl = (input, inline) => (inline ? input : `<pre>${input}</pre>`);\n","import hljs from 'highlight.js';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { decode, tpl } from './helpers';\nimport copyIconSrc from './copy-icon.svg';\nimport checkIconSrc from './check-icon.svg';\n\nexport const componentName = getComponentName('code-snippet');\n\nclass CodeSnippet extends createBaseClass({ componentName, baseSelector: ':host > .wrapper' }) {\n static get observedAttributes() {\n return ['lang', 'inline', 'copy-button'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <code class=\"hljs\"></code>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n width: 100%;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n code {\n grid-area: 1 / 1;\n display: block;\n width: 100%;\n min-height: 1em;\n overflow-x: auto;\n }\n pre {\n margin: 0;\n }\n .copy-btn {\n grid-area: 1 / 1;\n place-self: start end;\n margin: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border-style: solid;\n cursor: pointer;\n opacity: 0;\n transition: opacity 150ms ease, background 150ms ease;\n }\n .wrapper:hover .copy-btn,\n .copy-btn:focus-visible {\n opacity: 1;\n }\n .copy-btn descope-icon {\n width: 16px;\n height: 16px;\n pointer-events: none;\n flex-shrink: 0;\n }\n .copy-btn .check-icon {\n display: none;\n }\n .copy-btn.copied .check-icon {\n display: block;\n }\n .copy-btn.copied descope-icon:not(.check-icon) {\n display: none;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.lang = this.getAttribute('lang');\n this.isInline = this.getAttribute('inline') === 'true';\n\n if (this.getAttribute('copy-button') === 'true') {\n this.#initCopyButton();\n }\n\n observeChildren(this, this.#renderSnippet.bind(this));\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('code');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'inline') {\n this.isInline = newValue;\n }\n\n if (attrName === 'lang') {\n this.lang = newValue;\n }\n\n if (attrName === 'copy-button') {\n if (newValue === 'true') {\n this.#initCopyButton();\n } else {\n this.#destroyCopyButton();\n }\n }\n\n this.#renderSnippet();\n }\n }\n\n // ── Copy button ────────────────────────────────────────────────────────────\n\n #initCopyButton() {\n if (this.shadowRoot.querySelector('.copy-btn')) return;\n\n const btn = document.createElement('button');\n btn.className = 'copy-btn';\n btn.type = 'button';\n btn.setAttribute('aria-label', 'Copy code');\n const copyIcon = document.createElement('descope-icon');\n copyIcon.setAttribute('src', copyIconSrc);\n\n const checkIcon = document.createElement('descope-icon');\n checkIcon.setAttribute('src', checkIconSrc);\n checkIcon.classList.add('check-icon');\n\n btn.appendChild(copyIcon);\n btn.appendChild(checkIcon);\n btn.addEventListener('click', () => this.#handleCopyClick());\n\n this.shadowRoot.querySelector('.wrapper').appendChild(btn);\n }\n\n #destroyCopyButton() {\n this.shadowRoot.querySelector('.copy-btn')?.remove();\n }\n\n #handleCopyClick() {\n const btn = this.shadowRoot.querySelector('.copy-btn');\n navigator.clipboard\n .writeText(decode(this.textContent))\n .then(() => {\n btn.classList.add('copied');\n setTimeout(() => btn.classList.remove('copied'), 2000);\n })\n .catch(() => {});\n }\n\n // ── Snippet rendering ──────────────────────────────────────────────────────\n\n #renderSnippet() {\n const sanitized = decode(this.textContent);\n const language = this.lang;\n\n if (!language) {\n this.contentNode.textContent = sanitized;\n return;\n }\n\n const { value: highlighted } = hljs.highlight(sanitized, { language });\n\n this.contentNode.innerHTML = tpl(highlighted, this.isInline);\n }\n}\n\nconst copyBtn = { selector: () => '.copy-btn' };\n\nconst {\n root,\n docTag,\n keyword,\n metaKeyword,\n templateTag,\n templateVariable,\n type,\n variableLanguage,\n title,\n titleClass,\n titleClassInherited,\n titleFunction,\n attr,\n attribute,\n literal,\n meta,\n number,\n operator,\n variable,\n selectorAttr,\n selectorClass,\n selectorId,\n regexp,\n string,\n metaString,\n builtIn,\n symbol,\n comment,\n code,\n formula,\n name,\n quote,\n selectorTag,\n selectorPseudo,\n subst,\n section,\n bullet,\n emphasis,\n strong,\n addition,\n deletion,\n charEscape,\n link,\n params,\n property,\n punctuation,\n tag,\n} = {\n root: { selector: () => '.hljs' },\n docTag: { selector: () => '.hljs-doctag' },\n keyword: { selector: () => '.hljs-keyword' },\n metaKeyword: { selector: () => '.hljs-meta .hljs-keyword' },\n templateTag: { selector: () => '.hljs-template-tag' },\n templateVariable: { selector: () => '.hljs-template-variable' },\n type: { selector: () => '.hljs-type' },\n variableLanguage: { selector: () => '.hljs-variable.language' },\n title: { selector: () => '.hljs-title' },\n titleClass: { selector: () => '.hljs-title.class_' },\n titleClassInherited: { selector: () => '.hljs-title.class_.inherited__' },\n titleFunction: { selector: () => '.hljs-title.function_' },\n attr: { selector: () => '.hljs-attr' },\n attribute: { selector: () => '.hljs-attribute' },\n literal: { selector: () => '.hljs-literal' },\n meta: { selector: () => '.hljs-meta' },\n number: { selector: () => '.hljs-number' },\n operator: { selector: () => '.hljs-operator' },\n variable: { selector: () => '.hljs-variable' },\n selectorAttr: { selector: () => '.hljs-selector-attr' },\n selectorClass: { selector: () => '.hljs-selector-class' },\n selectorId: { selector: () => '.hljs-selector-id' },\n regexp: { selector: () => '.hljs-regexp' },\n string: { selector: () => '.hljs-string' },\n metaString: { selector: () => '.hljs-meta .hljs-string' },\n builtIn: { selector: () => '.hljs-built_in' },\n symbol: { selector: () => '.hljs-symbol' },\n comment: { selector: () => '.hljs-comment' },\n code: { selector: () => '.hljs-code' },\n formula: { selector: () => '.hljs-formula' },\n name: { selector: () => '.hljs-name' },\n quote: { selector: () => '.hljs-quote' },\n selectorTag: { selector: () => '.hljs-selector-tag' },\n selectorPseudo: { selector: () => '.hljs-selector-pseudo' },\n subst: { selector: () => '.hljs-subst' },\n section: { selector: () => '.hljs-section' },\n bullet: { selector: () => '.hljs-bullet' },\n emphasis: { selector: () => '.hljs-emphasis' },\n strong: { selector: () => '.hljs-strong' },\n addition: { selector: () => '.hljs-addition' },\n deletion: { selector: () => '.hljs-deletion' },\n charEscape: { selector: () => '.hljs-char.escape' },\n link: { selector: () => '.hljs-link' },\n params: { selector: () => '.hljs-params' },\n property: { selector: () => '.hljs-property' },\n punctuation: { selector: () => '.hljs-punctuation' },\n tag: { selector: () => '.hljs-tag' },\n};\n\nexport const CodeSnippetClass = compose(\n createStyleMixin({\n mappings: {\n rootBgColor: { ...root, property: 'background-color' },\n rootTextColor: { ...root, property: 'color' },\n docTagTextColor: { ...docTag, property: 'color' },\n keywordTextColor: { ...keyword, property: 'color' },\n metaKeywordTextColor: { ...metaKeyword, property: 'color' },\n templateTagTextColor: { ...templateTag, property: 'color' },\n templateVariableTextColor: { ...templateVariable, property: 'color' },\n typeTextColor: { ...type, property: 'color' },\n variableLanguageTextColor: { ...variableLanguage, property: 'color' },\n titleTextColor: { ...title, property: 'color' },\n titleClassTextColor: { ...titleClass, property: 'color' },\n titleClassInheritedTextColor: { ...titleClassInherited, property: 'color' },\n titleFunctionTextColor: { ...titleFunction, property: 'color' },\n attrTextColor: { ...attr, property: 'color' },\n attributeTextColor: { ...attribute, property: 'color' },\n literalTextColor: { ...literal, property: 'color' },\n metaTextColor: { ...meta, property: 'color' },\n numberTextColor: { ...number, property: 'color' },\n operatorTextColor: { ...operator, property: 'color' },\n variableTextColor: { ...variable, property: 'color' },\n selectorAttrTextColor: { ...selectorAttr, property: 'color' },\n selectorClassTextColor: { ...selectorClass, property: 'color' },\n selectorIdTextColor: { ...selectorId, property: 'color' },\n regexpTextColor: { ...regexp, property: 'color' },\n stringTextColor: { ...string, property: 'color' },\n metaStringTextColor: { ...metaString, property: 'color' },\n builtInTextColor: { ...builtIn, property: 'color' },\n symbolTextColor: { ...symbol, property: 'color' },\n commentTextColor: { ...comment, property: 'color' },\n codeTextColor: { ...code, property: 'color' },\n formulaTextColor: { ...formula, property: 'color' },\n nameTextColor: { ...name, property: 'color' },\n quoteTextColor: { ...quote, property: 'color' },\n selectorTagTextColor: { ...selectorTag, property: 'color' },\n selectorPseudoTextColor: { ...selectorPseudo, property: 'color' },\n substTextColor: { ...subst, property: 'color' },\n sectionTextColor: { ...section, property: 'color' },\n bulletTextColor: { ...bullet, property: 'color' },\n emphasisTextColor: { ...emphasis, property: 'color' },\n strongTextColor: { ...strong, property: 'color' },\n additionTextColor: { ...addition, property: 'color' },\n additionBgColor: { ...addition, property: 'background-color' },\n deletionTextColor: { ...deletion, property: 'color' },\n deletionBgColor: { ...deletion, property: 'background-color' },\n charEscapeTextColor: { ...charEscape, property: 'color' },\n linkTextColor: { ...link, property: 'color' },\n paramsTextColor: { ...params, property: 'color' },\n propertyTextColor: { ...property, property: 'color' },\n punctuationTextColor: { ...punctuation, property: 'color' },\n tagTextColor: { ...tag, property: 'color' },\n copyButtonSize: [\n { ...copyBtn, property: 'width' },\n { ...copyBtn, property: 'height' },\n ],\n copyButtonBorderRadius: { ...copyBtn, property: 'border-radius' },\n copyButtonBorderWidth: { ...copyBtn, property: 'border-width' },\n copyButtonBorderColor: { ...copyBtn, property: 'border-color' },\n copyButtonBgColor: { ...copyBtn, property: 'background-color' },\n copyButtonHoverBgColor: { selector: () => '.copy-btn:hover', property: 'background-color' },\n copyButtonColor: { ...copyBtn, property: 'color' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(CodeSnippet);\n","import '@descope-ui/descope-icon';\nimport { componentName, CodeSnippetClass } from './CodeSnippetClass';\n\ncustomElements.define(componentName, CodeSnippetClass);\n\nexport { CodeSnippetClass, componentName };\n","import { GridTextColumnClass } from '../descope-grid-text-column/GridTextColumnClass';\n\nexport class GridCustomColumnClass extends GridTextColumnClass {\n _defaultRenderer(cell, _col, model) {\n const content = model.item[this.path] || '';\n\n // we get a list of elements that can be used to render the content\n // each element can have a \"pattern\" attribute which contains regex expression\n // we are going over the elements, and when finding an element which is pattern matches the data,\n // we are cloning this element, and injecting the data as its child\n const contentEle = Array.from(this.children).find((child) => {\n const pattern = child.getAttribute('data-pattern');\n if (!pattern) return true;\n\n const regEx = new RegExp(pattern);\n return regEx.test(content);\n });\n\n if (!contentEle) {\n this.__setTextContent(cell, model.item[this.path] || '');\n\n return;\n }\n\n const newEle = contentEle.cloneNode(true);\n newEle.textContent = content || '';\n cell.innerHTML = '';\n cell.append(newEle);\n }\n}\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridCustomColumnClass } from './GridCustomColumnClass';\n\nexport const componentName = getComponentName('grid-custom-column');\n\ncustomElements.define(componentName, GridCustomColumnClass);\n","import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';\n\nexport class GridItemDetailsColumnClass extends GridSortColumn {\n get sortable() {\n return this.getAttribute('sortable') === 'true';\n }\n\n _defaultRenderer(cell, _col, model) {\n const grid = _col._gridValue;\n const itemIdx = grid.detailsOpenedItems?.indexOf(model.item) ?? -1;\n const isOpened = itemIdx !== -1;\n\n const toggleIcon = document.createElement('vaadin-icon');\n toggleIcon.icon = isOpened ? 'vaadin:angle-up' : 'vaadin:angle-down';\n toggleIcon.classList.add('toggle-details-button', isOpened ? 'opened' : 'closed');\n cell.innerHTML = '';\n cell.append(toggleIcon);\n\n toggleIcon.onclick = () => {\n grid.detailsOpenedItems = isOpened\n ? grid.detailsOpenedItems.toSpliced(itemIdx, 1)\n : [...grid.detailsOpenedItems, model.item];\n };\n }\n\n _defaultHeaderRenderer(root, _column) {\n if (this.sortable) {\n super._defaultHeaderRenderer(root, _column);\n\n return;\n }\n\n this.__setTextContent(root, this.__getHeader(this.header, this.path));\n }\n}\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridItemDetailsColumnClass } from './GridItemDetailsColumnClass';\nimport '@vaadin/icon';\nimport '@vaadin/icons';\n\nexport const componentName = getComponentName('grid-item-details-column');\n\ncustomElements.define(componentName, GridItemDetailsColumnClass);\n","import { GridSelectionColumn } from '@vaadin/grid/vaadin-grid-selection-column';\n\nconst createCheckboxEle = () => {\n const checkbox = document.createElement('descope-checkbox');\n\n checkbox.setAttribute('bordered', 'true');\n checkbox.setAttribute('size', 'xs');\n\n return checkbox;\n};\n\nconst getIsAllItemsSelected = (grid) =>\n !!grid.items?.length && grid.selectedItems.length === grid.items.length;\n\nexport class GridSelectionColumnClass extends GridSelectionColumn {\n _onHeaderRendererOrBindingChanged() {}\n\n _headerRenderer(cell) {\n const grid = cell.parentNode;\n\n let checkbox = cell.querySelector('descope-checkbox');\n if (!checkbox) {\n checkbox = createCheckboxEle();\n\n checkbox.addEventListener('input', () => {\n const isAllItemsSelected = getIsAllItemsSelected(grid);\n if (isAllItemsSelected) {\n grid.selectedItems = [];\n } else {\n grid.selectedItems = grid.items;\n }\n });\n\n cell.appendChild(checkbox);\n }\n\n checkbox.setAttribute('checked', getIsAllItemsSelected(grid));\n }\n\n _defaultRenderer(cell, col, model) {\n const grid = cell.parentNode;\n\n let checkbox = cell.querySelector('descope-checkbox');\n if (!checkbox) {\n checkbox = createCheckboxEle();\n cell.appendChild(checkbox);\n }\n\n checkbox.onchange = () => {\n checkbox.checked ? grid.selectItem(model.item) : grid.deselectItem(model.item);\n };\n\n checkbox.setAttribute('checked', model.selected);\n }\n}\n","import '../../boolean-fields/descope-checkbox';\nimport { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridSelectionColumnClass } from './GridSelectionColumnClass';\n\nexport const componentName = getComponentName('grid-selection-column');\n\ncustomElements.define(componentName, GridSelectionColumnClass);\n","import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';\n\nexport class GridTextColumnClass extends GridSortColumn {\n get sortable() {\n return this.getAttribute('sortable') === 'true';\n }\n\n _defaultRenderer(cell, _col, model) {\n const data = model.item[this.path] || '';\n const content = Array.isArray(data) ? data.join(', ') : data;\n\n this.__setTextContent(cell, content);\n cell.title = content;\n }\n\n _defaultHeaderRenderer(root, _column) {\n if (this.sortable) {\n super._defaultHeaderRenderer(root, _column);\n\n return;\n }\n\n this.__setTextContent(root, this.__getHeader(this.header, this.path));\n }\n}\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridTextColumnClass } from './GridTextColumnClass';\n\nexport const componentName = getComponentName('grid-text-column');\n\ncustomElements.define(componentName, GridTextColumnClass);\n","import { toTitle } from '../../helpers';\n\nexport const isValidDataType = (data) => {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data must be an array, received:', data);\n }\n\n return isValid;\n};\n\nexport const isPlainObject = (value) => value?.constructor === Object;\n\nconst isXml = (str) => /^\\s*<[\\s\\S]*>/.test(str);\n\nconst escapeXML = (s) => {\n const dom = document.createElement('div');\n dom.textContent = s;\n return dom.innerHTML;\n};\n\nexport const getValueType = (value) => {\n if (isPlainObject(value)) return 'object';\n if (Array.isArray(value)) return 'array';\n if (isXml(value)) return 'xml';\n\n return 'text';\n};\n\nexport const renderCodeSnippet = (value, lang) =>\n `<descope-code-snippet copy-button=\"true\" lang=\"${lang}\" class=\"row-details__value code\">${escapeXML(value)}</descope-code-snippet>`;\n\nexport const renderText = (text) =>\n `<div class=\"row-details__value text\" title=\"${text}\">${escapeXML(text)}</div>`;\nconst renderJson = (value) => renderCodeSnippet(JSON.stringify(value, null, 2), 'json');\nconst renderXml = (value) => renderCodeSnippet(value, 'xml');\n\nconst defaultRowDetailsValueRenderer = (value) => {\n const valueType = getValueType(value);\n\n if (valueType === 'object') {\n return renderJson(value);\n }\n\n if (valueType === 'xml') {\n return renderXml(value);\n }\n\n if (valueType === 'array') {\n if (value.some((v) => getValueType(v) === 'object')) {\n return renderJson(value);\n }\n return renderText(value.join(',\\n'));\n }\n\n return renderText(value);\n};\n\nconst isCodeSnippetValue = (value) => {\n const type = getValueType(value);\n return (\n type === 'object' ||\n type === 'xml' ||\n (type === 'array' && value.some((v) => getValueType(v) === 'object'))\n );\n};\n\nexport const defaultRowDetailsRenderer = (item, itemLabelsMapping) => `\n <div class=\"row-details\">\n ${Object.entries(item)\n .map(([key, value]) => {\n const label = itemLabelsMapping[key] || toTitle(key);\n if (isCodeSnippetValue(value)) {\n return `<details class=\"row-details__item\">\n <summary class=\"row-details__label\">${label}</summary>\n ${defaultRowDetailsValueRenderer(value)}\n </details>`;\n }\n return `<div class=\"row-details__item\">\n <div class=\"row-details__label\">${label}</div>\n ${defaultRowDetailsValueRenderer(value)}\n </div>`;\n })\n .join('\\n')}\n</div>\n `;\n","import { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '../../mixins';\n\nimport { defaultRowDetailsRenderer, isValidDataType } from './helpers';\n\nexport const componentName = getComponentName('grid');\n\nconst GridMixin = (superclass) =>\n class GridMixinClass extends superclass {\n #columns;\n\n init() {\n super.init?.();\n this.handleColumns();\n this.forwardSelectedItemsChange();\n\n // disable the grid sort\n this.baseElement._mapSorters = () => {};\n\n // there is an issue in vaadin that on some cases when trying to render the details panel, the row is null and this fn throwing\n // so we override it to prevent the error\n const origUpdateDetailsCellHeight = this.baseElement._updateDetailsCellHeight;\n this.baseElement._updateDetailsCellHeight = (row) => {\n if (!row) return;\n origUpdateDetailsCellHeight.call(this.baseElement, row);\n };\n\n this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);\n\n // Stop wheel events from propagating to vaadin-grid when scrolling\n // inside code snippets, so touchpad horizontal scroll works\n this.baseElement.addEventListener(\n 'wheel',\n (e) => {\n if (e.target.closest('descope-code-snippet')) {\n e.stopPropagation();\n }\n },\n true\n );\n }\n\n // this renders the details panel content\n // in order to open it, the descope-grid-item-details-column should be used\n #rowDetailsRenderer = async (cell, _col, model) => {\n // prevent details panel from being scrolled into view when clicked\n cell.addEventListener('mousedown', (e) => e.stopImmediatePropagation(), true);\n\n const template = this.getRowDetailsTemplate(model.item);\n\n cell.innerHTML = '';\n cell.append(template.content.cloneNode(true));\n };\n\n getRowDetailsTemplate(item) {\n const itemLabelsMapping = this.#columns.reduce(\n (acc, { path, header }) => (!path || !header ? acc : { ...acc, [path]: header }),\n {}\n );\n const template =\n this.rowDetailsRenderer?.(item, itemLabelsMapping) ??\n defaultRowDetailsRenderer(item, itemLabelsMapping);\n\n switch (true) {\n case template instanceof HTMLTemplateElement:\n return template;\n case typeof template === 'string':\n return Object.assign(document.createElement('template'), { innerHTML: template });\n default:\n throw new Error('rowDetailsRenderer should return a string or a template');\n }\n }\n\n forwardSelectedItemsChange() {\n this.baseElement.addEventListener('selected-items-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent('selected-items-changed', {\n bubbles: true,\n composed: true,\n detail: e.detail,\n })\n );\n });\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'columns') {\n this.setColumnsDataFromAttr();\n }\n }\n\n handleColumns() {\n if (this.columnsAttr) {\n this.setColumnsDataFromAttr();\n } else if (this.children.length) {\n this.setColumnsFromChildren();\n }\n }\n\n setColumnsFromChildren() {\n this.#columns = Array.from(this.children).map((child) => ({\n path: child.getAttribute('path'),\n header: child.getAttribute('header'),\n type: child.localName.match('^descope-grid-(\\\\w+)-column$')?.[1] || 'text',\n\n attrs: ['frozen', 'resizable', 'auto-width', 'status'].reduce((acc, attrName) => {\n const attrVal = child.getAttribute(attrName);\n\n if (attrVal) {\n acc[attrName] = attrVal;\n }\n\n return acc;\n }, {}),\n }));\n }\n\n get columnsAttr() {\n return this.getAttribute('columns');\n }\n\n setColumnsDataFromAttr() {\n try {\n const data = JSON.parse(this.columnsAttr);\n if (isValidDataType(data)) {\n this.columns = data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"columns\" -', e.message);\n }\n }\n\n #renderColumn = ({ path, header, type, attrs }) => {\n const colAttrs = Object.entries(attrs)\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ');\n\n const tagName = `descope-grid-${type}-column`;\n\n return `<${tagName} header=\"${header}\" path=\"${path}\" ${colAttrs}></${tagName}>`;\n };\n\n get renderColumn() {\n return this.#renderColumn;\n }\n\n set renderColumn(renderFn) {\n this.#renderColumn = renderFn;\n this.renderColumns();\n }\n\n getColumnsTemplate() {\n return this.#columns?.reduce?.(\n (acc, item) => acc + (this.renderColumn?.(item || {}) || ''),\n ''\n );\n }\n\n // there is an issue in vaadin-grid, when rowDetailsRenderer is set, it renders an empty details panel\n reassignRowDetailsRenderer() {\n this.baseElement.rowDetailsRenderer = null;\n setTimeout(() => {\n this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);\n }, 0);\n }\n\n renderColumns() {\n const template = this.getColumnsTemplate();\n if (template) {\n this.reassignRowDetailsRenderer();\n this.innerHTML = template;\n }\n }\n\n get grid() {\n return this.shadowRoot.querySelector('vaadin-grid');\n }\n\n get data() {\n return this.grid.items;\n }\n\n set data(data) {\n if (isValidDataType(data) && this.grid.items !== data) {\n this.grid.items = data;\n\n if (this.grid.selectedItems) {\n const itemsIds = new Set(\n this.grid.items.map((item) => item[this.uniqueColumnId] ?? item)\n );\n\n const newSelectedItems = this.grid.selectedItems.filter((selectedItem) =>\n itemsIds.has(selectedItem[this.uniqueColumnId] ?? selectedItem)\n );\n\n // we want to update the selected items only if there is a reason,\n // to prevent redundant notifications\n if (this.grid.selectedItems.length !== newSelectedItems.length) {\n this.grid.selectedItems = newSelectedItems;\n }\n }\n }\n }\n\n get columns() {\n return this.#columns;\n }\n\n set columns(data) {\n this.#columns = data;\n this.renderColumns();\n }\n\n get paths() {\n return this.columns.map((col) => col.path);\n }\n\n get uniqueColumnId() {\n return this.getAttribute('unique-column-id');\n }\n };\n\nconst {\n host,\n headerRow,\n headerRowCell,\n contentRow,\n firstRow,\n sortIndicators,\n activeSortIndicator,\n selectedRow,\n rowSeparator,\n resizeHandle,\n toggleDetailsPanelButton,\n toggleDetailsPanelButtonOpened,\n toggleDetailsPanelButtonClosed,\n detailsPanel,\n detailsPanelLabels,\n selectedRowCell,\n detailsPanelContent,\n} = {\n host: { selector: () => 'vaadin-grid' },\n headerRow: { selector: () => '::part(header-cell)' },\n headerRowCell: { selector: () => 'vaadin-grid::part(header-cell)' },\n contentRow: { selector: () => '::part(cell)' },\n firstRow: { selector: () => '::part(first-header-row-cell)' },\n selectedRow: { selector: () => '::part(selected-row)' },\n selectedRowCell: { selector: () => '::part(selected-row-cell)' },\n sortIndicators: { selector: () => 'vaadin-grid-sorter::part(indicators)' },\n activeSortIndicator: { selector: () => 'vaadin-grid-sorter[direction]' },\n rowSeparator: { selector: () => 'vaadin-grid::part(body-cell)' },\n resizeHandle: { selector: () => '::part(resize-handle)' },\n toggleDetailsPanelButton: { selector: () => 'vaadin-grid vaadin-icon.toggle-details-button' },\n toggleDetailsPanelButtonOpened: {\n selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.opened',\n },\n toggleDetailsPanelButtonClosed: {\n selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.closed',\n },\n detailsPanel: { selector: () => 'vaadin-grid::part(details-cell)' },\n detailsPanelLabels: { selector: () => 'vaadin-grid .row-details__label' },\n detailsPanelContent: { selector: () => 'vaadin-grid .row-details' },\n};\n\nexport const GridClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostHeight: { selector: () => ':host', property: 'height' },\n hostMinHeight: { selector: () => ':host', property: 'min-height' },\n fontFamily: [{ ...headerRow }, { ...contentRow }],\n fontSize: [{ ...headerRow }, { ...contentRow }],\n fontWeight: { ...contentRow },\n valueTextColor: { ...contentRow, property: 'color' },\n backgroundColor: [\n { ...host, property: 'background-color' },\n { ...contentRow, property: 'background-color' },\n ],\n sortIndicatorsColor: { ...sortIndicators, property: 'color' },\n activeSortIndicator: { ...activeSortIndicator, property: 'color' },\n borderColor: { ...host, property: 'border-color' },\n borderWidth: { ...host, property: 'border-width' },\n borderStyle: { ...host, property: 'border-style' },\n borderRadius: { ...host, property: 'border-radius' },\n selectedBackgroundColor: [\n { ...selectedRow, property: 'background-color' },\n { ...selectedRowCell, property: 'background-color' },\n ],\n headerRowTextColor: { ...headerRowCell, property: 'color' },\n separatorColor: [\n { ...firstRow, property: 'border-bottom-color' },\n { ...rowSeparator, property: 'border-top-color' },\n ],\n resizeHandleColor: { ...resizeHandle, property: 'background-color' },\n hostDirection: { ...host, property: 'direction', fallback: 'ltr' },\n toggleDetailsPanelButtonSize: [\n { ...toggleDetailsPanelButton, property: 'width' },\n { ...toggleDetailsPanelButton, property: 'height' },\n ],\n toggleDetailsPanelButtonOpenedColor: { ...toggleDetailsPanelButtonOpened, property: 'color' },\n toggleDetailsPanelButtonClosedColor: { ...toggleDetailsPanelButtonClosed, property: 'color' },\n toggleDetailsPanelButtonCursor: { ...toggleDetailsPanelButton, property: 'cursor' },\n detailsPanelBackgroundColor: { ...detailsPanel, property: 'background-color' },\n detailsPanelBorderTopColor: { ...detailsPanel, property: 'border-top-color' },\n detailsPanelLabelsColor: { ...detailsPanelLabels, property: 'color' },\n detailsPanelLabelsFontSize: { ...detailsPanelLabels, property: 'font-size' },\n detailsPanelItemsGap: { ...detailsPanelContent, property: 'grid-gap' },\n detailsPanelPadding: { ...detailsPanelContent, property: 'padding' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n GridMixin\n)(\n createProxy({\n delegatesFocus: false,\n slots: [''],\n wrappedEleName: 'vaadin-grid',\n style: () => `\n /*css*/\n vaadin-grid {\n overflow: hidden;\n height: 100%;\n min-height: 300px;\n }\n vaadin-grid-cell-content {\n display: flex;\n }\n vaadin-grid::part(selected-row-cell) {\n background-image: none;\n box-shadow: none;\n background-color: inherit;\n }\n vaadin-grid::part(details-cell) {\n border-top-style: dashed;\n border-top-width: 1px;\n }\n vaadin-grid .row-details {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(max(200px, calc(100%/4 - var(${GridClass.cssVarList.detailsPanelItemsGap}))), 1fr));\n width: 100%;\n }\n vaadin-grid .row-details__item:has(.row-details__value.code) {\n grid-column: 1 / -1;\n order: 2;\n }\n vaadin-grid details.row-details__item {\n padding: 0;\n }\n vaadin-grid details.row-details__item > summary.row-details__label {\n cursor: pointer;\n list-style: revert;\n display: revert;\n }\n vaadin-grid .row-details__value.text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n vaadin-grid .row-details__value.code {\n margin-top: 5px;\n overflow-x: auto;\n font-size: 0.85em;\n }\n vaadin-grid vaadin-icon.toggle-details-button {\n margin: auto;\n }\n /*!css*/\n\t\t`,\n excludeAttrsSync: ['columns', 'tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/grid';\nimport './descope-grid-text-column';\nimport './descope-grid-custom-column';\nimport './descope-grid-selection-column';\nimport './descope-grid-item-details-column';\nimport '../descope-code-snippet'; // this is needed for the details panel\n\nimport { componentName, GridClass } from './GridClass';\n\ncustomElements.define(componentName, GridClass);\n\nexport { GridClass, componentName };\n"],"names":["module","exports","componentName","IconClass","mappings","fill","property","cssVarList","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","decode","input","txt","value","CodeSnippet","createBaseClass","lang","isInline","bind","contentNode","shadowRoot","btn","className","type","copyIcon","checkIcon","addEventListener","navigator","clipboard","writeText","textContent","setTimeout","catch","sanitized","language","highlighted","highlight","copyBtn","root","docTag","keyword","metaKeyword","templateTag","templateVariable","variableLanguage","title","titleClass","titleClassInherited","titleFunction","attr","attribute","literal","meta","number","operator","variable","selectorAttr","selectorClass","selectorId","regexp","string","metaString","builtIn","symbol","comment","code","formula","name","quote","selectorTag","selectorPseudo","subst","section","bullet","emphasis","strong","addition","deletion","charEscape","link","params","punctuation","tag","CodeSnippetClass","rootBgColor","rootTextColor","docTagTextColor","keywordTextColor","metaKeywordTextColor","templateTagTextColor","templateVariableTextColor","typeTextColor","variableLanguageTextColor","titleTextColor","titleClassTextColor","titleClassInheritedTextColor","titleFunctionTextColor","attrTextColor","attributeTextColor","literalTextColor","metaTextColor","numberTextColor","operatorTextColor","variableTextColor","selectorAttrTextColor","selectorClassTextColor","selectorIdTextColor","regexpTextColor","stringTextColor","metaStringTextColor","builtInTextColor","symbolTextColor","commentTextColor","codeTextColor","formulaTextColor","nameTextColor","quoteTextColor","selectorTagTextColor","selectorPseudoTextColor","substTextColor","sectionTextColor","bulletTextColor","emphasisTextColor","strongTextColor","additionTextColor","additionBgColor","deletionTextColor","deletionBgColor","charEscapeTextColor","linkTextColor","paramsTextColor","propertyTextColor","punctuationTextColor","tagTextColor","copyButtonSize","copyButtonBorderRadius","copyButtonBorderWidth","copyButtonBorderColor","copyButtonBgColor","copyButtonHoverBgColor","copyButtonColor","GridCustomColumnClass","GridTextColumnClass","_defaultRenderer","cell","_col","model","content","item","contentEle","Array","from","children","find","child","pattern","RegExp","test","__setTextContent","newEle","cloneNode","append","GridItemDetailsColumnClass","sortable","grid","_gridValue","itemIdx","detailsOpenedItems","indexOf","isOpened","toggleIcon","icon","onclick","toSpliced","_defaultHeaderRenderer","_column","__getHeader","header","createCheckboxEle","checkbox","getIsAllItemsSelected","items","length","selectedItems","GridSelectionColumnClass","_onHeaderRendererOrBindingChanged","_headerRenderer","parentNode","isAllItemsSelected","col","onchange","checked","selectItem","deselectItem","selected","data","isArray","join","isValidDataType","isValid","console","error","escapeXML","s","dom","getValueType","Object","isPlainObject","renderCodeSnippet","renderText","renderJson","JSON","stringify","defaultRowDetailsValueRenderer","valueType","renderXml","some","v","host","headerRow","headerRowCell","contentRow","firstRow","sortIndicators","activeSortIndicator","selectedRow","rowSeparator","resizeHandle","toggleDetailsPanelButton","toggleDetailsPanelButtonOpened","toggleDetailsPanelButtonClosed","detailsPanel","detailsPanelLabels","selectedRowCell","detailsPanelContent","GridClass","componentNameOverride","hostWidth","hostHeight","hostMinHeight","fontFamily","fontSize","fontWeight","valueTextColor","backgroundColor","sortIndicatorsColor","borderColor","borderWidth","borderStyle","borderRadius","selectedBackgroundColor","headerRowTextColor","separatorColor","resizeHandleColor","hostDirection","fallback","toggleDetailsPanelButtonSize","toggleDetailsPanelButtonOpenedColor","toggleDetailsPanelButtonClosedColor","toggleDetailsPanelButtonCursor","detailsPanelBackgroundColor","detailsPanelBorderTopColor","detailsPanelLabelsColor","detailsPanelLabelsFontSize","detailsPanelItemsGap","detailsPanelPadding","superclass","handleColumns","forwardSelectedItemsChange","baseElement","_mapSorters","origUpdateDetailsCellHeight","_updateDetailsCellHeight","row","call","rowDetailsRenderer","e","target","closest","stopPropagation","stopImmediatePropagation","template","getRowDetailsTemplate","itemLabelsMapping","reduce","acc","entries","map","key","label","isCodeSnippetValue","defaultRowDetailsRenderer","HTMLTemplateElement","assign","Error","dispatchEvent","CustomEvent","bubbles","composed","detail","setColumnsDataFromAttr","columnsAttr","setColumnsFromChildren","localName","attrs","attrVal","parse","columns","message","tagName","renderColumn","renderFn","renderColumns","getColumnsTemplate","reassignRowDetailsRenderer","itemsIds","Set","uniqueColumnId","newSelectedItems","filter","selectedItem","has","paths","delegatesFocus"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-grid-index-js.js","mappings":"oIAAAA,EAAOC,QAAU,gX,WCAjBD,EAAOC,QAAU,gd,oGCUV,MAAMC,GAAgB,QAAiB,QAEjCC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,KAAM,CAAC,CAAC,EAAG,CAAEC,SAAU,IAAWC,WAAWF,OAC7CG,OAAQ,CAAEC,SAAU,IAAM,SAC1BC,MAAO,CAAED,SAAU,IAAM,YAG7B,KACA,KATuB,EAWvB,QAAY,CACVE,MAAO,GACPC,eAAgB,gBAChBC,MAAO,IAAM,6JAQbC,iBAAkB,CAAC,WAAY,QAAS,QAAS,YAAa,YAC9DZ,kB,4GC/BJa,eAAeC,OAAO,IAAe,I,+GCQ9B,MAAMd,GAAgB,QAAiB,SAExCe,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrChB,gBACAiB,aAAc,UAEd,6BAAWC,GACT,OAAOH,CACT,CAEA,WAAAI,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2BAIhD,QACE,6UAoBAH,KAEJ,CAEA,IAAAI,GACEL,MAAMK,SACNJ,KAAKK,iBAAiBL,KAAKM,OAC7B,CAEA,aAAAC,GACEP,KAAKQ,aACP,CAEA,gBAAAH,CAAiBI,GACXA,EACFT,KAAKU,UAAUC,OAAO,UAEtBX,K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ope-code-snippet/check-icon.svg","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/copy-icon.svg","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/CodeSnippetClass.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-custom-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-item-details-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-selection-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/descope-grid-text-column/index.js","webpack://@descope/web-components-ui/./src/components/descope-grid/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-grid/GridClass.js","webpack://@descope/web-components-ui/./src/components/descope-grid/index.js"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iY2hlY2staWNvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4gPHBvbHlsaW5lIHBvaW50cz0iMjAgNiA5IDE3IDQgMTIiPjwvcG9seWxpbmU+IDwvc3ZnPiA=\"","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPiA8cmVjdCB4PSI5IiB5PSI5IiB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHJ4PSIyIiByeT0iMiI+PC9yZWN0PiA8cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+IDwvc3ZnPiA=\"","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n"," \nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n \n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","export const decode = (input) => {\n const txt = document.createElement('textarea');\n txt.innerHTML = input;\n return txt.value;\n};\n\nexport const tpl = (input, inline) => (inline ? input : `<pre>${input}</pre>`);\n","import hljs from 'highlight.js';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { decode, tpl } from './helpers';\nimport copyIconSrc from './copy-icon.svg';\nimport checkIconSrc from './check-icon.svg';\n\nexport const componentName = getComponentName('code-snippet');\n\nclass CodeSnippet extends createBaseClass({ componentName, baseSelector: ':host > .wrapper' }) {\n static get observedAttributes() {\n return ['lang', 'inline', 'copy-button'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <code class=\"hljs\"></code>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n width: 100%;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n code {\n grid-area: 1 / 1;\n display: block;\n width: 100%;\n min-height: 1em;\n overflow-x: auto;\n }\n pre {\n margin: 0;\n }\n .copy-btn {\n grid-area: 1 / 1;\n place-self: start end;\n margin: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border-style: solid;\n cursor: pointer;\n opacity: 0;\n transition: opacity 150ms ease, background 150ms ease;\n }\n .wrapper:hover .copy-btn,\n .copy-btn:focus-visible {\n opacity: 1;\n }\n .copy-btn descope-icon {\n width: 16px;\n height: 16px;\n pointer-events: none;\n flex-shrink: 0;\n }\n .copy-btn .check-icon {\n display: none;\n }\n .copy-btn.copied .check-icon {\n display: block;\n }\n .copy-btn.copied descope-icon:not(.check-icon) {\n display: none;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.lang = this.getAttribute('lang');\n this.isInline = this.getAttribute('inline') === 'true';\n\n if (this.getAttribute('copy-button') === 'true') {\n this.#initCopyButton();\n }\n\n observeChildren(this, this.#renderSnippet.bind(this));\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('code');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'inline') {\n this.isInline = newValue;\n }\n\n if (attrName === 'lang') {\n this.lang = newValue;\n }\n\n if (attrName === 'copy-button') {\n if (newValue === 'true') {\n this.#initCopyButton();\n } else {\n this.#destroyCopyButton();\n }\n }\n\n this.#renderSnippet();\n }\n }\n\n // ── Copy button ────────────────────────────────────────────────────────────\n\n #initCopyButton() {\n if (this.shadowRoot.querySelector('.copy-btn')) return;\n\n const btn = document.createElement('button');\n btn.className = 'copy-btn';\n btn.type = 'button';\n btn.setAttribute('aria-label', 'Copy code');\n const copyIcon = document.createElement('descope-icon');\n copyIcon.setAttribute('src', copyIconSrc);\n\n const checkIcon = document.createElement('descope-icon');\n checkIcon.setAttribute('src', checkIconSrc);\n checkIcon.classList.add('check-icon');\n\n btn.appendChild(copyIcon);\n btn.appendChild(checkIcon);\n btn.addEventListener('click', () => this.#handleCopyClick());\n\n this.shadowRoot.querySelector('.wrapper').appendChild(btn);\n }\n\n #destroyCopyButton() {\n this.shadowRoot.querySelector('.copy-btn')?.remove();\n }\n\n #handleCopyClick() {\n const btn = this.shadowRoot.querySelector('.copy-btn');\n navigator.clipboard\n .writeText(decode(this.textContent))\n .then(() => {\n btn.classList.add('copied');\n setTimeout(() => btn.classList.remove('copied'), 2000);\n })\n .catch(() => {});\n }\n\n // ── Snippet rendering ──────────────────────────────────────────────────────\n\n #renderSnippet() {\n const sanitized = decode(this.textContent);\n const language = this.lang;\n\n if (!language) {\n this.contentNode.textContent = sanitized;\n return;\n }\n\n const { value: highlighted } = hljs.highlight(sanitized, { language });\n\n this.contentNode.innerHTML = tpl(highlighted, this.isInline);\n }\n}\n\nconst copyBtn = { selector: () => '.copy-btn' };\n\nconst {\n root,\n docTag,\n keyword,\n metaKeyword,\n templateTag,\n templateVariable,\n type,\n variableLanguage,\n title,\n titleClass,\n titleClassInherited,\n titleFunction,\n attr,\n attribute,\n literal,\n meta,\n number,\n operator,\n variable,\n selectorAttr,\n selectorClass,\n selectorId,\n regexp,\n string,\n metaString,\n builtIn,\n symbol,\n comment,\n code,\n formula,\n name,\n quote,\n selectorTag,\n selectorPseudo,\n subst,\n section,\n bullet,\n emphasis,\n strong,\n addition,\n deletion,\n charEscape,\n link,\n params,\n property,\n punctuation,\n tag,\n} = {\n root: { selector: () => '.hljs' },\n docTag: { selector: () => '.hljs-doctag' },\n keyword: { selector: () => '.hljs-keyword' },\n metaKeyword: { selector: () => '.hljs-meta .hljs-keyword' },\n templateTag: { selector: () => '.hljs-template-tag' },\n templateVariable: { selector: () => '.hljs-template-variable' },\n type: { selector: () => '.hljs-type' },\n variableLanguage: { selector: () => '.hljs-variable.language' },\n title: { selector: () => '.hljs-title' },\n titleClass: { selector: () => '.hljs-title.class_' },\n titleClassInherited: { selector: () => '.hljs-title.class_.inherited__' },\n titleFunction: { selector: () => '.hljs-title.function_' },\n attr: { selector: () => '.hljs-attr' },\n attribute: { selector: () => '.hljs-attribute' },\n literal: { selector: () => '.hljs-literal' },\n meta: { selector: () => '.hljs-meta' },\n number: { selector: () => '.hljs-number' },\n operator: { selector: () => '.hljs-operator' },\n variable: { selector: () => '.hljs-variable' },\n selectorAttr: { selector: () => '.hljs-selector-attr' },\n selectorClass: { selector: () => '.hljs-selector-class' },\n selectorId: { selector: () => '.hljs-selector-id' },\n regexp: { selector: () => '.hljs-regexp' },\n string: { selector: () => '.hljs-string' },\n metaString: { selector: () => '.hljs-meta .hljs-string' },\n builtIn: { selector: () => '.hljs-built_in' },\n symbol: { selector: () => '.hljs-symbol' },\n comment: { selector: () => '.hljs-comment' },\n code: { selector: () => '.hljs-code' },\n formula: { selector: () => '.hljs-formula' },\n name: { selector: () => '.hljs-name' },\n quote: { selector: () => '.hljs-quote' },\n selectorTag: { selector: () => '.hljs-selector-tag' },\n selectorPseudo: { selector: () => '.hljs-selector-pseudo' },\n subst: { selector: () => '.hljs-subst' },\n section: { selector: () => '.hljs-section' },\n bullet: { selector: () => '.hljs-bullet' },\n emphasis: { selector: () => '.hljs-emphasis' },\n strong: { selector: () => '.hljs-strong' },\n addition: { selector: () => '.hljs-addition' },\n deletion: { selector: () => '.hljs-deletion' },\n charEscape: { selector: () => '.hljs-char.escape' },\n link: { selector: () => '.hljs-link' },\n params: { selector: () => '.hljs-params' },\n property: { selector: () => '.hljs-property' },\n punctuation: { selector: () => '.hljs-punctuation' },\n tag: { selector: () => '.hljs-tag' },\n};\n\nexport const CodeSnippetClass = compose(\n createStyleMixin({\n mappings: {\n rootBgColor: { ...root, property: 'background-color' },\n rootTextColor: { ...root, property: 'color' },\n docTagTextColor: { ...docTag, property: 'color' },\n keywordTextColor: { ...keyword, property: 'color' },\n metaKeywordTextColor: { ...metaKeyword, property: 'color' },\n templateTagTextColor: { ...templateTag, property: 'color' },\n templateVariableTextColor: { ...templateVariable, property: 'color' },\n typeTextColor: { ...type, property: 'color' },\n variableLanguageTextColor: { ...variableLanguage, property: 'color' },\n titleTextColor: { ...title, property: 'color' },\n titleClassTextColor: { ...titleClass, property: 'color' },\n titleClassInheritedTextColor: { ...titleClassInherited, property: 'color' },\n titleFunctionTextColor: { ...titleFunction, property: 'color' },\n attrTextColor: { ...attr, property: 'color' },\n attributeTextColor: { ...attribute, property: 'color' },\n literalTextColor: { ...literal, property: 'color' },\n metaTextColor: { ...meta, property: 'color' },\n numberTextColor: { ...number, property: 'color' },\n operatorTextColor: { ...operator, property: 'color' },\n variableTextColor: { ...variable, property: 'color' },\n selectorAttrTextColor: { ...selectorAttr, property: 'color' },\n selectorClassTextColor: { ...selectorClass, property: 'color' },\n selectorIdTextColor: { ...selectorId, property: 'color' },\n regexpTextColor: { ...regexp, property: 'color' },\n stringTextColor: { ...string, property: 'color' },\n metaStringTextColor: { ...metaString, property: 'color' },\n builtInTextColor: { ...builtIn, property: 'color' },\n symbolTextColor: { ...symbol, property: 'color' },\n commentTextColor: { ...comment, property: 'color' },\n codeTextColor: { ...code, property: 'color' },\n formulaTextColor: { ...formula, property: 'color' },\n nameTextColor: { ...name, property: 'color' },\n quoteTextColor: { ...quote, property: 'color' },\n selectorTagTextColor: { ...selectorTag, property: 'color' },\n selectorPseudoTextColor: { ...selectorPseudo, property: 'color' },\n substTextColor: { ...subst, property: 'color' },\n sectionTextColor: { ...section, property: 'color' },\n bulletTextColor: { ...bullet, property: 'color' },\n emphasisTextColor: { ...emphasis, property: 'color' },\n strongTextColor: { ...strong, property: 'color' },\n additionTextColor: { ...addition, property: 'color' },\n additionBgColor: { ...addition, property: 'background-color' },\n deletionTextColor: { ...deletion, property: 'color' },\n deletionBgColor: { ...deletion, property: 'background-color' },\n charEscapeTextColor: { ...charEscape, property: 'color' },\n linkTextColor: { ...link, property: 'color' },\n paramsTextColor: { ...params, property: 'color' },\n propertyTextColor: { ...property, property: 'color' },\n punctuationTextColor: { ...punctuation, property: 'color' },\n tagTextColor: { ...tag, property: 'color' },\n copyButtonSize: [\n { ...copyBtn, property: 'width' },\n { ...copyBtn, property: 'height' },\n ],\n copyButtonBorderRadius: { ...copyBtn, property: 'border-radius' },\n copyButtonBorderWidth: { ...copyBtn, property: 'border-width' },\n copyButtonBorderColor: { ...copyBtn, property: 'border-color' },\n copyButtonBgColor: { ...copyBtn, property: 'background-color' },\n copyButtonHoverBgColor: { selector: () => '.copy-btn:hover', property: 'background-color' },\n copyButtonColor: { ...copyBtn, property: 'color' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(CodeSnippet);\n","import '@descope-ui/descope-icon';\nimport { componentName, CodeSnippetClass } from './CodeSnippetClass';\n\ncustomElements.define(componentName, CodeSnippetClass);\n\nexport { CodeSnippetClass, componentName };\n","import { GridTextColumnClass } from '../descope-grid-text-column/GridTextColumnClass';\n\nexport class GridCustomColumnClass extends GridTextColumnClass {\n _defaultRenderer(cell, _col, model) {\n const content = model.item[this.path] || '';\n\n // we get a list of elements that can be used to render the content\n // each element can have a \"pattern\" attribute which contains regex expression\n // we are going over the elements, and when finding an element which is pattern matches the data,\n // we are cloning this element, and injecting the data as its child\n const contentEle = Array.from(this.children).find((child) => {\n const pattern = child.getAttribute('data-pattern');\n if (!pattern) return true;\n\n const regEx = new RegExp(pattern);\n return regEx.test(content);\n });\n\n if (!contentEle) {\n this.__setTextContent(cell, model.item[this.path] || '');\n\n return;\n }\n\n const newEle = contentEle.cloneNode(true);\n newEle.textContent = content || '';\n cell.innerHTML = '';\n cell.append(newEle);\n }\n}\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridCustomColumnClass } from './GridCustomColumnClass';\n\nexport const componentName = getComponentName('grid-custom-column');\n\ncustomElements.define(componentName, GridCustomColumnClass);\n","import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';\n\nexport class GridItemDetailsColumnClass extends GridSortColumn {\n get sortable() {\n return this.getAttribute('sortable') === 'true';\n }\n\n _defaultRenderer(cell, _col, model) {\n const grid = _col._gridValue;\n const itemIdx = grid.detailsOpenedItems?.indexOf(model.item) ?? -1;\n const isOpened = itemIdx !== -1;\n\n const toggleIcon = document.createElement('vaadin-icon');\n toggleIcon.icon = isOpened ? 'vaadin:angle-up' : 'vaadin:angle-down';\n toggleIcon.classList.add('toggle-details-button', isOpened ? 'opened' : 'closed');\n cell.innerHTML = '';\n cell.append(toggleIcon);\n\n toggleIcon.onclick = () => {\n grid.detailsOpenedItems = isOpened\n ? grid.detailsOpenedItems.toSpliced(itemIdx, 1)\n : [...grid.detailsOpenedItems, model.item];\n };\n }\n\n _defaultHeaderRenderer(root, _column) {\n if (this.sortable) {\n super._defaultHeaderRenderer(root, _column);\n\n return;\n }\n\n this.__setTextContent(root, this.__getHeader(this.header, this.path));\n }\n}\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridItemDetailsColumnClass } from './GridItemDetailsColumnClass';\nimport '@vaadin/icon';\nimport '@vaadin/icons';\n\nexport const componentName = getComponentName('grid-item-details-column');\n\ncustomElements.define(componentName, GridItemDetailsColumnClass);\n","import { GridSelectionColumn } from '@vaadin/grid/vaadin-grid-selection-column';\n\nconst createCheckboxEle = () => {\n const checkbox = document.createElement('descope-checkbox');\n\n checkbox.setAttribute('bordered', 'true');\n checkbox.setAttribute('size', 'xs');\n\n return checkbox;\n};\n\nconst getIsAllItemsSelected = (grid) =>\n !!grid.items?.length && grid.selectedItems.length === grid.items.length;\n\nexport class GridSelectionColumnClass extends GridSelectionColumn {\n _onHeaderRendererOrBindingChanged() {}\n\n _headerRenderer(cell) {\n const grid = cell.parentNode;\n\n let checkbox = cell.querySelector('descope-checkbox');\n if (!checkbox) {\n checkbox = createCheckboxEle();\n\n checkbox.addEventListener('input', () => {\n const isAllItemsSelected = getIsAllItemsSelected(grid);\n if (isAllItemsSelected) {\n grid.selectedItems = [];\n } else {\n grid.selectedItems = grid.items;\n }\n });\n\n cell.appendChild(checkbox);\n }\n\n checkbox.setAttribute('checked', getIsAllItemsSelected(grid));\n }\n\n _defaultRenderer(cell, col, model) {\n const grid = cell.parentNode;\n\n let checkbox = cell.querySelector('descope-checkbox');\n if (!checkbox) {\n checkbox = createCheckboxEle();\n cell.appendChild(checkbox);\n }\n\n checkbox.onchange = () => {\n checkbox.checked ? grid.selectItem(model.item) : grid.deselectItem(model.item);\n };\n\n checkbox.setAttribute('checked', model.selected);\n }\n}\n","import '../../boolean-fields/descope-checkbox';\nimport { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridSelectionColumnClass } from './GridSelectionColumnClass';\n\nexport const componentName = getComponentName('grid-selection-column');\n\ncustomElements.define(componentName, GridSelectionColumnClass);\n","import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';\n\nexport class GridTextColumnClass extends GridSortColumn {\n get sortable() {\n return this.getAttribute('sortable') === 'true';\n }\n\n _defaultRenderer(cell, _col, model) {\n const data = model.item[this.path] || '';\n const content = Array.isArray(data) ? data.join(', ') : data;\n\n this.__setTextContent(cell, content);\n cell.title = content;\n }\n\n _defaultHeaderRenderer(root, _column) {\n if (this.sortable) {\n super._defaultHeaderRenderer(root, _column);\n\n return;\n }\n\n this.__setTextContent(root, this.__getHeader(this.header, this.path));\n }\n}\n","import { getComponentName } from '../../../helpers/componentHelpers';\nimport { GridTextColumnClass } from './GridTextColumnClass';\n\nexport const componentName = getComponentName('grid-text-column');\n\ncustomElements.define(componentName, GridTextColumnClass);\n","import { toTitle } from '../../helpers';\n\nexport const isValidDataType = (data) => {\n const isValid = Array.isArray(data);\n if (!isValid) {\n // eslint-disable-next-line no-console\n console.error('data must be an array, received:', data);\n }\n\n return isValid;\n};\n\nexport const isPlainObject = (value) => value?.constructor === Object;\n\nconst isXml = (str) => /^\\s*<[\\s\\S]*>/.test(str);\n\nconst escapeXML = (s) => {\n const dom = document.createElement('div');\n dom.textContent = s;\n return dom.innerHTML;\n};\n\nexport const getValueType = (value) => {\n if (isPlainObject(value)) return 'object';\n if (Array.isArray(value)) return 'array';\n if (isXml(value)) return 'xml';\n\n return 'text';\n};\n\nexport const renderCodeSnippet = (value, lang) =>\n `<descope-code-snippet copy-button=\"true\" lang=\"${lang}\" class=\"row-details__value code\">${escapeXML(value)}</descope-code-snippet>`;\n\nexport const renderText = (text) =>\n `<div class=\"row-details__value text\" title=\"${text}\">${escapeXML(text)}</div>`;\nconst renderJson = (value) => renderCodeSnippet(JSON.stringify(value, null, 2), 'json');\nconst renderXml = (value) => renderCodeSnippet(value, 'xml');\n\nconst defaultRowDetailsValueRenderer = (value) => {\n const valueType = getValueType(value);\n\n if (valueType === 'object') {\n return renderJson(value);\n }\n\n if (valueType === 'xml') {\n return renderXml(value);\n }\n\n if (valueType === 'array') {\n if (value.some((v) => getValueType(v) === 'object')) {\n return renderJson(value);\n }\n return renderText(value.join(',\\n'));\n }\n\n return renderText(value);\n};\n\nconst isCodeSnippetValue = (value) => {\n const type = getValueType(value);\n return (\n type === 'object' ||\n type === 'xml' ||\n (type === 'array' && value.some((v) => getValueType(v) === 'object'))\n );\n};\n\nexport const defaultRowDetailsRenderer = (item, itemLabelsMapping) => `\n <div class=\"row-details\">\n ${Object.entries(item)\n .map(([key, value]) => {\n const label = itemLabelsMapping[key] || toTitle(key);\n if (isCodeSnippetValue(value)) {\n return `<details class=\"row-details__item\">\n <summary class=\"row-details__label\">${label}</summary>\n ${defaultRowDetailsValueRenderer(value)}\n </details>`;\n }\n return `<div class=\"row-details__item\">\n <div class=\"row-details__label\">${label}</div>\n ${defaultRowDetailsValueRenderer(value)}\n </div>`;\n })\n .join('\\n')}\n</div>\n `;\n","import { compose } from '../../helpers';\nimport { getComponentName } from '../../helpers/componentHelpers';\nimport {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '../../mixins';\n\nimport { defaultRowDetailsRenderer, isValidDataType } from './helpers';\n\nexport const componentName = getComponentName('grid');\n\nconst GridMixin = (superclass) =>\n class GridMixinClass extends superclass {\n #columns;\n\n init() {\n super.init?.();\n this.handleColumns();\n this.forwardSelectedItemsChange();\n\n // disable the grid sort\n this.baseElement._mapSorters = () => {};\n\n // there is an issue in vaadin that on some cases when trying to render the details panel, the row is null and this fn throwing\n // so we override it to prevent the error\n const origUpdateDetailsCellHeight = this.baseElement._updateDetailsCellHeight;\n this.baseElement._updateDetailsCellHeight = (row) => {\n if (!row) return;\n origUpdateDetailsCellHeight.call(this.baseElement, row);\n };\n\n this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);\n\n // Stop wheel events from propagating to vaadin-grid when scrolling\n // inside code snippets, so touchpad horizontal scroll works\n this.baseElement.addEventListener(\n 'wheel',\n (e) => {\n if (e.target.closest('descope-code-snippet')) {\n e.stopPropagation();\n }\n },\n true\n );\n }\n\n // this renders the details panel content\n // in order to open it, the descope-grid-item-details-column should be used\n #rowDetailsRenderer = async (cell, _col, model) => {\n // prevent details panel from being scrolled into view when clicked\n cell.addEventListener('mousedown', (e) => e.stopImmediatePropagation(), true);\n\n const template = this.getRowDetailsTemplate(model.item);\n\n cell.innerHTML = '';\n cell.append(template.content.cloneNode(true));\n };\n\n getRowDetailsTemplate(item) {\n const itemLabelsMapping = this.#columns.reduce(\n (acc, { path, header }) => (!path || !header ? acc : { ...acc, [path]: header }),\n {}\n );\n const template =\n this.rowDetailsRenderer?.(item, itemLabelsMapping) ??\n defaultRowDetailsRenderer(item, itemLabelsMapping);\n\n switch (true) {\n case template instanceof HTMLTemplateElement:\n return template;\n case typeof template === 'string':\n return Object.assign(document.createElement('template'), { innerHTML: template });\n default:\n throw new Error('rowDetailsRenderer should return a string or a template');\n }\n }\n\n forwardSelectedItemsChange() {\n this.baseElement.addEventListener('selected-items-changed', (e) => {\n this.dispatchEvent(\n new CustomEvent('selected-items-changed', {\n bubbles: true,\n composed: true,\n detail: e.detail,\n })\n );\n });\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'columns') {\n this.setColumnsDataFromAttr();\n }\n }\n\n handleColumns() {\n if (this.columnsAttr) {\n this.setColumnsDataFromAttr();\n } else if (this.children.length) {\n this.setColumnsFromChildren();\n }\n }\n\n setColumnsFromChildren() {\n this.#columns = Array.from(this.children).map((child) => ({\n path: child.getAttribute('path'),\n header: child.getAttribute('header'),\n type: child.localName.match('^descope-grid-(\\\\w+)-column$')?.[1] || 'text',\n\n attrs: ['frozen', 'resizable', 'auto-width', 'status'].reduce((acc, attrName) => {\n const attrVal = child.getAttribute(attrName);\n\n if (attrVal) {\n acc[attrName] = attrVal;\n }\n\n return acc;\n }, {}),\n }));\n }\n\n get columnsAttr() {\n return this.getAttribute('columns');\n }\n\n setColumnsDataFromAttr() {\n try {\n const data = JSON.parse(this.columnsAttr);\n if (isValidDataType(data)) {\n this.columns = data;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('could not parse data string from attribute \"columns\" -', e.message);\n }\n }\n\n #renderColumn = ({ path, header, type, attrs }) => {\n const colAttrs = Object.entries(attrs)\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ');\n\n const tagName = `descope-grid-${type}-column`;\n\n return `<${tagName} header=\"${header}\" path=\"${path}\" ${colAttrs}></${tagName}>`;\n };\n\n get renderColumn() {\n return this.#renderColumn;\n }\n\n set renderColumn(renderFn) {\n this.#renderColumn = renderFn;\n this.renderColumns();\n }\n\n getColumnsTemplate() {\n return this.#columns?.reduce?.(\n (acc, item) => acc + (this.renderColumn?.(item || {}) || ''),\n ''\n );\n }\n\n // there is an issue in vaadin-grid, when rowDetailsRenderer is set, it renders an empty details panel\n reassignRowDetailsRenderer() {\n this.baseElement.rowDetailsRenderer = null;\n setTimeout(() => {\n this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);\n }, 0);\n }\n\n renderColumns() {\n const template = this.getColumnsTemplate();\n if (template) {\n this.reassignRowDetailsRenderer();\n this.innerHTML = template;\n }\n }\n\n get grid() {\n return this.shadowRoot.querySelector('vaadin-grid');\n }\n\n get data() {\n return this.grid.items;\n }\n\n set data(data) {\n if (isValidDataType(data) && this.grid.items !== data) {\n this.grid.items = data;\n\n if (this.grid.selectedItems) {\n const itemsIds = new Set(\n this.grid.items.map((item) => item[this.uniqueColumnId] ?? item)\n );\n\n const newSelectedItems = this.grid.selectedItems.filter((selectedItem) =>\n itemsIds.has(selectedItem[this.uniqueColumnId] ?? selectedItem)\n );\n\n // we want to update the selected items only if there is a reason,\n // to prevent redundant notifications\n if (this.grid.selectedItems.length !== newSelectedItems.length) {\n this.grid.selectedItems = newSelectedItems;\n }\n }\n }\n }\n\n get columns() {\n return this.#columns;\n }\n\n set columns(data) {\n this.#columns = data;\n this.renderColumns();\n }\n\n get paths() {\n return this.columns.map((col) => col.path);\n }\n\n get uniqueColumnId() {\n return this.getAttribute('unique-column-id');\n }\n };\n\nconst {\n host,\n headerRow,\n headerRowCell,\n contentRow,\n firstRow,\n sortIndicators,\n activeSortIndicator,\n selectedRow,\n rowSeparator,\n resizeHandle,\n toggleDetailsPanelButton,\n toggleDetailsPanelButtonOpened,\n toggleDetailsPanelButtonClosed,\n detailsPanel,\n detailsPanelLabels,\n selectedRowCell,\n detailsPanelContent,\n} = {\n host: { selector: () => 'vaadin-grid' },\n headerRow: { selector: () => '::part(header-cell)' },\n headerRowCell: { selector: () => 'vaadin-grid::part(header-cell)' },\n contentRow: { selector: () => '::part(cell)' },\n firstRow: { selector: () => '::part(first-header-row-cell)' },\n selectedRow: { selector: () => '::part(selected-row)' },\n selectedRowCell: { selector: () => '::part(selected-row-cell)' },\n sortIndicators: { selector: () => 'vaadin-grid-sorter::part(indicators)' },\n activeSortIndicator: { selector: () => 'vaadin-grid-sorter[direction]' },\n rowSeparator: { selector: () => 'vaadin-grid::part(body-cell)' },\n resizeHandle: { selector: () => '::part(resize-handle)' },\n toggleDetailsPanelButton: { selector: () => 'vaadin-grid vaadin-icon.toggle-details-button' },\n toggleDetailsPanelButtonOpened: {\n selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.opened',\n },\n toggleDetailsPanelButtonClosed: {\n selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.closed',\n },\n detailsPanel: { selector: () => 'vaadin-grid::part(details-cell)' },\n detailsPanelLabels: { selector: () => 'vaadin-grid .row-details__label' },\n detailsPanelContent: { selector: () => 'vaadin-grid .row-details' },\n};\n\nexport const GridClass = compose(\n createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }),\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostHeight: { selector: () => ':host', property: 'height' },\n hostMinHeight: { selector: () => ':host', property: 'min-height' },\n fontFamily: [{ ...headerRow }, { ...contentRow }],\n fontSize: [{ ...headerRow }, { ...contentRow }],\n fontWeight: { ...contentRow },\n valueTextColor: { ...contentRow, property: 'color' },\n backgroundColor: [\n { ...host, property: 'background-color' },\n { ...contentRow, property: 'background-color' },\n ],\n sortIndicatorsColor: { ...sortIndicators, property: 'color' },\n activeSortIndicator: { ...activeSortIndicator, property: 'color' },\n borderColor: { ...host, property: 'border-color' },\n borderWidth: { ...host, property: 'border-width' },\n borderStyle: { ...host, property: 'border-style' },\n borderRadius: { ...host, property: 'border-radius' },\n selectedBackgroundColor: [\n { ...selectedRow, property: 'background-color' },\n { ...selectedRowCell, property: 'background-color' },\n ],\n headerRowTextColor: { ...headerRowCell, property: 'color' },\n separatorColor: [\n { ...firstRow, property: 'border-bottom-color' },\n { ...rowSeparator, property: 'border-top-color' },\n ],\n resizeHandleColor: { ...resizeHandle, property: 'background-color' },\n hostDirection: { ...host, property: 'direction', fallback: 'ltr' },\n toggleDetailsPanelButtonSize: [\n { ...toggleDetailsPanelButton, property: 'width' },\n { ...toggleDetailsPanelButton, property: 'height' },\n ],\n toggleDetailsPanelButtonOpenedColor: { ...toggleDetailsPanelButtonOpened, property: 'color' },\n toggleDetailsPanelButtonClosedColor: { ...toggleDetailsPanelButtonClosed, property: 'color' },\n toggleDetailsPanelButtonCursor: { ...toggleDetailsPanelButton, property: 'cursor' },\n detailsPanelBackgroundColor: { ...detailsPanel, property: 'background-color' },\n detailsPanelBorderTopColor: { ...detailsPanel, property: 'border-top-color' },\n detailsPanelLabelsColor: { ...detailsPanelLabels, property: 'color' },\n detailsPanelLabelsFontSize: { ...detailsPanelLabels, property: 'font-size' },\n detailsPanelItemsGap: { ...detailsPanelContent, property: 'grid-gap' },\n detailsPanelPadding: { ...detailsPanelContent, property: 'padding' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n GridMixin\n)(\n createProxy({\n delegatesFocus: false,\n slots: [''],\n wrappedEleName: 'vaadin-grid',\n style: () => `\n /*css*/\n vaadin-grid {\n overflow: hidden;\n height: 100%;\n min-height: 300px;\n }\n vaadin-grid-cell-content {\n display: flex;\n }\n vaadin-grid::part(selected-row-cell) {\n background-image: none;\n box-shadow: none;\n background-color: inherit;\n }\n vaadin-grid::part(details-cell) {\n border-top-style: dashed;\n border-top-width: 1px;\n }\n vaadin-grid .row-details {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(max(200px, calc(100%/4 - var(${GridClass.cssVarList.detailsPanelItemsGap}))), 1fr));\n width: 100%;\n }\n vaadin-grid .row-details__item:has(.row-details__value.code) {\n grid-column: 1 / -1;\n order: 2;\n }\n vaadin-grid details.row-details__item {\n padding: 0;\n }\n vaadin-grid details.row-details__item > summary.row-details__label {\n cursor: pointer;\n list-style: revert;\n display: revert;\n }\n vaadin-grid .row-details__value.text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n vaadin-grid .row-details__value.code {\n margin-top: 5px;\n overflow-x: auto;\n font-size: 0.85em;\n }\n vaadin-grid vaadin-icon.toggle-details-button {\n margin: auto;\n }\n /*!css*/\n\t\t`,\n excludeAttrsSync: ['columns', 'tabindex', 'style'],\n componentName,\n })\n);\n","import '@vaadin/grid';\nimport './descope-grid-text-column';\nimport './descope-grid-custom-column';\nimport './descope-grid-selection-column';\nimport './descope-grid-item-details-column';\nimport '../descope-code-snippet'; // this is needed for the details panel\n\nimport { componentName, GridClass } from './GridClass';\n\ncustomElements.define(componentName, GridClass);\n\nexport { GridClass, componentName };\n"],"names":["module","exports","componentName","IconClass","mappings","fill","property","cssVarList","height","selector","width","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","decode","input","txt","value","CodeSnippet","createBaseClass","lang","isInline","bind","contentNode","shadowRoot","btn","className","type","copyIcon","checkIcon","addEventListener","navigator","clipboard","writeText","textContent","setTimeout","catch","sanitized","language","highlighted","highlight","copyBtn","root","docTag","keyword","metaKeyword","templateTag","templateVariable","variableLanguage","title","titleClass","titleClassInherited","titleFunction","attr","attribute","literal","meta","number","operator","variable","selectorAttr","selectorClass","selectorId","regexp","string","metaString","builtIn","symbol","comment","code","formula","name","quote","selectorTag","selectorPseudo","subst","section","bullet","emphasis","strong","addition","deletion","charEscape","link","params","punctuation","tag","CodeSnippetClass","rootBgColor","rootTextColor","docTagTextColor","keywordTextColor","metaKeywordTextColor","templateTagTextColor","templateVariableTextColor","typeTextColor","variableLanguageTextColor","titleTextColor","titleClassTextColor","titleClassInheritedTextColor","titleFunctionTextColor","attrTextColor","attributeTextColor","literalTextColor","metaTextColor","numberTextColor","operatorTextColor","variableTextColor","selectorAttrTextColor","selectorClassTextColor","selectorIdTextColor","regexpTextColor","stringTextColor","metaStringTextColor","builtInTextColor","symbolTextColor","commentTextColor","codeTextColor","formulaTextColor","nameTextColor","quoteTextColor","selectorTagTextColor","selectorPseudoTextColor","substTextColor","sectionTextColor","bulletTextColor","emphasisTextColor","strongTextColor","additionTextColor","additionBgColor","deletionTextColor","deletionBgColor","charEscapeTextColor","linkTextColor","paramsTextColor","propertyTextColor","punctuationTextColor","tagTextColor","copyButtonSize","copyButtonBorderRadius","copyButtonBorderWidth","copyButtonBorderColor","copyButtonBgColor","copyButtonHoverBgColor","copyButtonColor","GridCustomColumnClass","GridTextColumnClass","_defaultRenderer","cell","_col","model","content","item","contentEle","Array","from","children","find","child","pattern","RegExp","test","__setTextContent","newEle","cloneNode","append","GridItemDetailsColumnClass","sortable","grid","_gridValue","itemIdx","detailsOpenedItems","indexOf","isOpened","toggleIcon","icon","onclick","toSpliced","_defaultHeaderRenderer","_column","__getHeader","header","createCheckboxEle","checkbox","getIsAllItemsSelected","items","length","selectedItems","GridSelectionColumnClass","_onHeaderRendererOrBindingChanged","_headerRenderer","parentNode","isAllItemsSelected","col","onchange","checked","selectItem","deselectItem","selected","data","isArray","join","isValidDataType","isValid","console","error","escapeXML","s","dom","getValueType","Object","isPlainObject","renderCodeSnippet","renderText","renderJson","JSON","stringify","defaultRowDetailsValueRenderer","valueType","renderXml","some","v","host","headerRow","headerRowCell","contentRow","firstRow","sortIndicators","activeSortIndicator","selectedRow","rowSeparator","resizeHandle","toggleDetailsPanelButton","toggleDetailsPanelButtonOpened","toggleDetailsPanelButtonClosed","detailsPanel","detailsPanelLabels","selectedRowCell","detailsPanelContent","GridClass","componentNameOverride","hostWidth","hostHeight","hostMinHeight","fontFamily","fontSize","fontWeight","valueTextColor","backgroundColor","sortIndicatorsColor","borderColor","borderWidth","borderStyle","borderRadius","selectedBackgroundColor","headerRowTextColor","separatorColor","resizeHandleColor","hostDirection","fallback","toggleDetailsPanelButtonSize","toggleDetailsPanelButtonOpenedColor","toggleDetailsPanelButtonClosedColor","toggleDetailsPanelButtonCursor","detailsPanelBackgroundColor","detailsPanelBorderTopColor","detailsPanelLabelsColor","detailsPanelLabelsFontSize","detailsPanelItemsGap","detailsPanelPadding","superclass","handleColumns","forwardSelectedItemsChange","baseElement","_mapSorters","origUpdateDetailsCellHeight","_updateDetailsCellHeight","row","call","rowDetailsRenderer","e","target","closest","stopPropagation","stopImmediatePropagation","template","getRowDetailsTemplate","itemLabelsMapping","reduce","acc","entries","map","key","label","isCodeSnippetValue","defaultRowDetailsRenderer","HTMLTemplateElement","assign","Error","dispatchEvent","CustomEvent","bubbles","composed","detail","setColumnsDataFromAttr","columnsAttr","setColumnsFromChildren","localName","attrs","attrVal","parse","columns","message","tagName","renderColumn","renderFn","renderColumns","getColumnsTemplate","reassignRowDetailsRenderer","itemsIds","Set","uniqueColumnId","newSelectedItems","filter","selectedItem","has","paths","delegatesFocus"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,6724],{98538(t,e,s){s.d(e,{S:()=>o,T:()=>a});var i=s(88961),n=s(25964),r=s(8512),l=s(63200);const a=(0,n.xE)("icon"),o=(0,l.Zz)((0,i.RF)({mappings:{fill:[{},{property:r.q.cssVarList.fill}]}}),i.VO,i.tQ)((0,i.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style"],componentName:a}))},56737(t,e,s){s.r(e),s.d(e,{IconClass:()=>i.S,componentName:()=>i.T}),s(53455);var i=s(98538);customElements.define(i.T,i.S)},8512(t,e,s){s.d(e,{T:()=>o,q:()=>d});var i=s(88961),n=s(72270),r=s(63200),l=s(25964),a=s(18782);const o=(0,l.xE)("image"),c=["src","src-dark"];class h extends((0,n.qu)({componentName:o,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,l.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&this.shouldRender(t)&&this.renderImage()}}const d=(0,r.Zz)((0,i.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),i.VO,i.tQ)(h)},18782(t,e,s){s.d(e,{m:()=>r});var i=s(25414);const n=t=>{const e=i.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},r=async(t,e)=>{try{let s;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));s=n(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),i=await e.text();s=n(i)}else s=((t,e)=>{const s=document.createElement("img");return s.setAttribute("src",t),s.setAttribute("alt",e),s})(t,e);return s.style.setProperty("max-width","100%"),s.style.setProperty("max-height","100%"),s}catch{return null}}},53455(t,e,s){s.r(e),s.d(e,{ImageClass:()=>i.q,componentName:()=>i.T});var i=s(8512);customElements.define(i.T,i.q)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,6724],{98538(t,e,s){s.d(e,{S:()=>o,T:()=>a});var i=s(88961),n=s(25964),r=s(8512),l=s(63200);const a=(0,n.xE)("icon"),o=(0,l.Zz)((0,i.RF)({mappings:{fill:[{},{property:r.q.cssVarList.fill}],height:{selector:()=>":host"},width:{selector:()=>":host"}}}),i.VO,i.tQ)((0,i.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style","st-height","st-width"],componentName:a}))},56737(t,e,s){s.r(e),s.d(e,{IconClass:()=>i.S,componentName:()=>i.T}),s(53455);var i=s(98538);customElements.define(i.T,i.S)},8512(t,e,s){s.d(e,{T:()=>o,q:()=>d});var i=s(88961),n=s(72270),r=s(63200),l=s(25964),a=s(18782);const o=(0,l.xE)("image"),c=["src","src-dark"];class h extends((0,n.qu)({componentName:o,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,l.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&this.shouldRender(t)&&this.renderImage()}}const d=(0,r.Zz)((0,i.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),i.VO,i.tQ)(h)},18782(t,e,s){s.d(e,{m:()=>r});var i=s(25414);const n=t=>{const e=i.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},r=async(t,e)=>{try{let s;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));s=n(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),i=await e.text();s=n(i)}else s=((t,e)=>{const s=document.createElement("img");return s.setAttribute("src",t),s.setAttribute("alt",e),s})(t,e);return s.style.setProperty("max-width","100%"),s.style.setProperty("max-height","100%"),s}catch{return null}}},53455(t,e,s){s.r(e),s.d(e,{ImageClass:()=>i.q,componentName:()=>i.T});var i=s(8512);customElements.define(i.T,i.q)}}]);
2
2
  //# sourceMappingURL=descope-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-icon.js","mappings":"mNAUO,MAAMA,GAAgB,QAAiB,QAEjCC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,KAAM,CAAC,CAAC,EAAG,CAAEC,SAAU,IAAWC,WAAWF,UAGjD,KACA,KAPuB,EASvB,QAAY,CACVG,MAAO,GACPC,eAAgB,gBAChBC,MAAO,IAAM,6FAMbC,iBAAkB,CAAC,WAAY,QAAS,SACxCT,kB,+FC3BJU,eAAeC,OAAO,IAAe,I,kGCQ9B,MAAMX,GAAgB,QAAiB,SAExCY,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrCb,gBACAc,aAAc,UAEd,6BAA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BzC,E,+CC7IF,MAgBM2C,EAAgBC,IAEpB,MAAMC,EAAQ,IAAUC,SAASF,EAAM,CACrCG,aAAc,CAAEC,KAAK,EAAMC,YAAY,GAEvCC,SAAU,CAAC,SAEXC,YAAa,CAAC,UAOhB,OAJe,IAAIC,WAEhBC,gBAAgBR,EAAO,iBACvBS,cAAc,QAINC,EAAcC,MAAOtB,EAAKhB,KACrC,IACE,IAAIS,EACJ,GA7BgB,CAACO,GAAQA,EAAIuB,WAFZ,8BA+BbC,CAAYxB,GAAM,CAEpB,MAAMyB,EAASC,KAAK1B,EAAI2B,MAAMC,KAC9BnC,EAAMgB,EAAagB,EACrB,MAAO,GAA8B,QAxChB,CAACI,IACxB,MAAMC,EAAQD,EAAKC,MAAM,8BACzB,OAAOA,EAAQA,EAAM,GAAK,MAsCbC,CAAiB/B,GAAgB,CAE1C,MAAMgC,QAAmBC,MAAMjC,GACzBU,QAAasB,EAAWtB,OAC9BjB,EAAMgB,EAAaC,EACrB,MAEEjB,EAtCe,EAACO,EAAKhB,KACzB,MAAMS,EAAMyC,SAASC,cAAc,OAGnC,OAFA1C,EAAIC,aAAa,MAAOM,GACxBP,EAAIC,aAAa,MAAOV,GACjBS,GAkCG2C,CAAapC,EAAKhB,GAM1B,OAHAS,EAAIhC,MAAM4E,YAAY,YAAa,QACnC5C,EAAIhC,MAAM4E,YAAY,aAAc,QAE7B5C,CACT,CAAE,MACA,OAAO,IACT,E,sFCxDF9B,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js"],"sourcesContent":["import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n","/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n"],"names":["componentName","IconClass","mappings","fill","property","cssVarList","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-icon.js","mappings":"mNAUO,MAAMA,GAAgB,Q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HAS,EAAIhC,MAAMyE,YAAY,YAAa,QACnCzC,EAAIhC,MAAMyE,YAAY,aAAc,QAE7BzC,CACT,CAAE,MACA,OAAO,IACT,E,sFCxDF9B,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js"],"sourcesContent":["import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n"," \nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n \n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n"],"names":["componentName","IconClass","mappings","fill","property","cssVarList","height","selector","width","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"descope-image.js","mappings":"yNAYO,MAAMA,GAAgB,QAAiB,SAExCC,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrCF,gBACAG,aAAc,UAEd,6BAAWC,GACT,OAAOH,CACT,CAEA,WAAAI,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2BAIhD,QACE,6UAoBAH,KAEJ,CAEA,IAAAI,GACEL,MAAMK,SACNJ,KAAKK,iBAAiBL,KAAKM,OAC7B,CAEA,aAAAC,GACEP,KAAKQ,aACP,CAEA,gBAAAH,CAAiBI,GACXA,EACFT,KAAKU,UAAUC,OAAO,UAEtBX,KAAKU,UAAUE,IAAI,SAEvB,CAEA,WAAIC,GACF,OAAOb,KAAKc,aAAa,QAAU,EACrC,CAEA,aAAIC,GACF,OAAOf,KAAKc,aAAa,MAC3B,CAEA,YAAIE,GACF,OAAOhB,KAAKc,aAAa,OAAOd,KAAKiB,mBACvC,CAEA,UAAIX,GACF,OAAON,KAAKgB,UAAYhB,KAAKe,SAC/B,CAKA,eAAAG,CAAgBC,GAEY,CAACA,KAASA,EAAKC,iBAAiB,YAExCC,QAASC,IACzBA,EAAIC,aACF,OACA,OAAOC,EAAWC,WAAWC,SAASJ,EAAIR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AMS,EAAM4C,SAASC,cAAc,OAGnC,OAFA7C,EAAIC,aAAa,MAAOQ,GACxBT,EAAIC,aAAa,MAAOV,GACjBS,GAkCG8C,CAAarC,EAAKlB,GAM1B,OAHAS,EAAI+C,MAAMC,YAAY,YAAa,QACnChD,EAAI+C,MAAMC,YAAY,aAAc,QAE7BhD,CACT,CAAE,MACA,OAAO,IACT,E,sFCxDFiD,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n"],"names":["componentName","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","cssVarList","fill","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","mappings","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","style","setProperty","customElements","define"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-image.js","mappings":"yNAYO,MAAMA,GAAgB,QAAiB,SAExCC,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrCF,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AG7B,KACA,KATwB,CAUxB5C,E,+CC7IF,MAgBM8C,EAAgBC,IAEpB,MAAMC,EAAQ,IAAUC,SAASF,EAAM,CACrCG,aAAc,CAAEC,KAAK,EAAMC,YAAY,GAEvCC,SAAU,CAAC,SAEXC,YAAa,CAAC,UAOhB,OAJe,IAAIC,WAEhBC,gBAAgBR,EAAO,iBACvBS,cAAc,QAINC,EAAcC,MAAOvB,EAAKlB,KACrC,IACE,IAAIS,EACJ,GA7BgB,CAACS,GAAQA,EAAIwB,WAFZ,8BA+BbC,CAAYzB,GAAM,CAEpB,MAAM0B,EAASC,KAAK3B,EAAI4B,MAAMC,KAC9BtC,EAAMmB,EAAagB,EACrB,MAAO,GAA8B,QAxChB,CAACI,IACxB,MAAMC,EAAQD,EAAKC,MAAM,8BACzB,OAAOA,EAAQA,EAAM,GAAK,MAsCbC,CAAiBhC,GAAgB,CAE1C,MAAMiC,QAAmBC,MAAMlC,GACzBW,QAAasB,EAAWtB,OAC9BpB,EAAMmB,EAAaC,EACrB,MAEEpB,EAtCe,EAACS,EAAKlB,KACzB,MAAMS,EAAM4C,SAASC,cAAc,OAGnC,OAFA7C,EAAIC,aAAa,MAAOQ,GACxBT,EAAIC,aAAa,MAAOV,GACjBS,GAkCG8C,CAAarC,EAAKlB,GAM1B,OAHAS,EAAI+C,MAAMC,YAAY,YAAa,QACnChD,EAAI+C,MAAMC,YAAY,aAAc,QAE7BhD,CACT,CAAE,MACA,OAAO,IACT,E,sFCxDFiD,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js"],"sourcesContent":[" \nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n \n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n"],"names":["componentName","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","cssVarList","fill","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","mappings","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","style","setProperty","customElements","define"],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see descope-multi-line-mappings.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5087,5375],{19624(t,e,r){r.d(e,{J:()=>m,T:()=>l});var o=r(63200),i=r(25964),n=r(88961),s=r(98538),a=r(10767);const l=(0,i.xE)("button"),{host:d,label:c,slottedIcon:u}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let h;const m=(0,o.Zz)((0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),(0,n.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...d,property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>"::slotted(*)",property:s.S.cssVarList.fill},labelTextDecoration:{...c,property:"text-decoration"},labelSpacing:{...c,property:"gap"},textAlign:{...c,property:"justify-content",fallback:"center"},iconSize:[{...u,property:"width"},{...u,property:"height"}]}}),a.G,n.VO,n.tQ)((0,n.tz)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${h}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${m.cssVarList.outlineWidth}) + var(${m.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${m.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${m.cssVarList.hostHeight}) - var(${m.cssVarList.outlineWidth}) - var(${m.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${m.cssVarList.hostWidth}) - var(${m.cssVarList.outlineWidth}) - var(${m.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex","class","style"],componentName:l})),{color:p,fontSize:b}=m.cssVarList;h=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${p});\n\t\ttop: calc(50% - (var(${b}) / 2));\n\t\tleft: calc(50% - (var(${b}) / 2));\n\t\tborder-width: calc(var(${b}) / 10);\n\t\twidth: var(${b});\n\t\theight: var(${b});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"]) ::part(prefix),\n\t:host([loading="true"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},10767(t,e,r){r.d(e,{G:()=>o});const o=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},30576(t,e,r){r.r(e),r.d(e,{ButtonClass:()=>o.J,componentName:()=>o.T});var o=r(19624);r(83799),customElements.define(o.T,o.J)},98538(t,e,r){r.d(e,{S:()=>l,T:()=>a});var o=r(88961),i=r(25964),n=r(8512),s=r(63200);const a=(0,i.xE)("icon"),l=(0,s.Zz)((0,o.RF)({mappings:{fill:[{},{property:n.q.cssVarList.fill}]}}),o.VO,o.tQ)((0,o.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style"],componentName:a}))},8512(t,e,r){r.d(e,{T:()=>l,q:()=>u});var o=r(88961),i=r(72270),n=r(63200),s=r(25964),a=r(18782);const l=(0,s.xE)("image"),d=["src","src-dark"];class c extends((0,i.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return d}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,s.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${u.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&this.shouldRender(t)&&this.renderImage()}}const u=(0,n.Zz)((0,o.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),o.VO,o.tQ)(c)},18782(t,e,r){r.d(e,{m:()=>n});var o=r(25414);const i=t=>{const e=o.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},n=async(t,e)=>{try{let r;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));r=i(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),o=await e.text();r=i(o)}else r=((t,e)=>{const r=document.createElement("img");return r.setAttribute("src",t),r.setAttribute("alt",e),r})(t,e);return r.style.setProperty("max-width","100%"),r.style.setProperty("max-height","100%"),r}catch{return null}}},22931(t,e,r){r.r(e),r.d(e,{MultiLineMappingsClass:()=>y,componentName:()=>d}),r(30576),r(70067);var o=r(63200),i=r(25964),n=r(88961),s=r(72270),a=r(94681),l=r(19624);const d=(0,i.xE)("multi-line-mappings"),c=(0,s.qu)({componentName:d}),u=t=>null==t?"":String("object"==typeof t?t.value??t.id??t.label??"":t),h=t=>[...new Set(t.map(u).filter(Boolean))],m=t=>{const e=u(t);return"object"==typeof t&&null!==t?{...t,value:e,label:String(t.label??t.displayName??e)}:{value:e,label:e}},p=t=>{if(!Array.isArray(t))return[];const e=new Set;return t.map(m).filter(t=>!(!t.value||e.has(t.value)||(e.add(t.value),0)))},b=(t=[],e=[])=>t.length===e.length&&t.every((t,r)=>t===e[r]),g={selector:()=>":host"},f={selector:".row"},v={selector:".add-action"},y=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...g,property:"width"},hostDirection:[{...g,property:"direction"},{selector:a.t.componentName,property:a.t.cssVarList.hostDirection},{selector:l.J.componentName,property:l.J.cssVarList.hostDirection}],rowsGap:{selector:".rows",property:"gap"},rowGap:{...f,property:"gap"},rowAlignItems:{...f,property:"align-items"},rowWrap:{...f,property:"flex-wrap"},addActionJustifyContent:{...v,property:"justify-content"},addActionMarginTop:{...v,property:"margin-top"}}}),n.VO)(class extends c{static get observedAttributes(){return["data","max-rows","size","disabled","readonly","first-value-key","second-value-key","first-label","second-label","first-placeholder","second-placeholder","full-width","merge-rows"]}#t=[{firstValues:[],secondValues:[]}];#e=null;#r=[];#o={};constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <div class="rows"></div>\n <div class="add-action">\n <descope-button\n class="add-button"\n variant="link"\n mode="primary"\n >\n <slot name="add-button-content">Add line</slot>\n </descope-button>\n </div>\n </div>\n ',(0,i.fz)("\n :host {\n display: inline-flex;\n box-sizing: border-box;\n max-width: 100%;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows > .row {\n display: flex;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n align-items: flex-end;\n }\n\n .row descope-multi-select-combo-box {\n flex: 1 1 0;\n box-sizing: border-box;\n }\n\n .row .remove-button {\n flex: 0 0 auto;\n align-self: flex-end;\n }\n\n .row:only-child .remove-button {\n display: none;\n pointer-events: none;\n }\n\n .add-action {\n display: flex;\n }\n ",this),this.rowsElement=this.shadowRoot.querySelector(".rows"),this.addButtonElement=this.shadowRoot.querySelector(".add-button")}get size(){return this.getAttribute("size")||"md"}get firstValueKey(){return this.getAttribute("first-value-key")||"firstValues"}get secondValueKey(){return this.getAttribute("second-value-key")||"secondValues"}get firstLabel(){return this.getAttribute("first-label")||""}get secondLabel(){return this.getAttribute("second-label")||""}get firstPlaceholder(){return this.getAttribute("first-placeholder")||""}get secondPlaceholder(){return this.getAttribute("second-placeholder")||""}get disabled(){return"true"===this.getAttribute("disabled")}get readonly(){return"true"===this.getAttribute("readonly")}get mergeRows(){return"true"===this.getAttribute("merge-rows")}get maxRows(){const t=Number(this.getAttribute("max-rows"));return Number.isFinite(t)&&t>0?t:void 0}get data(){return this.#o}get value(){return this.#t.filter(t=>t.firstValues.length>0||t.secondValues.length>0).flatMap(t=>(t.firstValues.length?t.firstValues:[""]).map(e=>({[this.firstValueKey]:e,[this.secondValueKey]:[...t.secondValues]})))}set value(t){this.#e=t,this.#t=this.#i(t),this.#n(),this.#s()}#a(t){const e=((t,e,r="unknown")=>{if("string"!=typeof t||!t?.trim())return e;try{return JSON.parse(t)}catch(t){return console.error(`[descope-multi-line-mappings] Failed to parse JSON from "${r}"`,t),e}})(t,{},"data attribute"),r=e&&"object"==typeof e&&!Array.isArray(e)?e:{};this.#r=Object.entries(r).map(([t,e])=>{const r=String(t),o=null!=e&&"object"==typeof e&&!Array.isArray(e),i=o?e.options??[]:e;return{value:r,label:o&&null!=e.label?String(e.label):r,options:p(i)}}),this.#o=Object.fromEntries(this.#r.map(({value:t,options:e})=>[t,e]))}init(){super.init?.(),this.#l(),this.addButtonElement.addEventListener("click",()=>this.#d()),this.#s()}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback?.(t,e,r),e!==r){if("data"===t)return this.#a(r),this.#n(),void this.#s();if("size"===t)return[...this.#c(),...this.#u()].forEach(t=>t.setAttribute("size",this.size)),this.#l(),void this.#h();if(["disabled","readonly"].includes(t))return this.#c().forEach(t=>{t[this.disabled?"setAttribute":"removeAttribute"]("disabled","true"),t[this.readonly?"setAttribute":"removeAttribute"]("readonly","true")}),this.#u().forEach(t=>t[this.disabled||this.readonly?"setAttribute":"removeAttribute"]("disabled","true")),void this.#h();if(["first-label","second-label"].includes(t)){const e="first-label"===t?"first":"second";return void Array.from(this.rowsElement.children).forEach(t=>{const o=t.querySelector(`.${e}-combo`);r?o?.setAttribute("label",r):o?.removeAttribute("label")})}if(["first-placeholder","second-placeholder"].includes(t)){const e="first-placeholder"===t?"first":"second";return void Array.from(this.rowsElement.children).forEach(t=>{const o=t.querySelector(`.${e}-combo`);r?o?.setAttribute("placeholder",r):o?.removeAttribute("placeholder")})}"max-rows"===t&&this.#h(),"merge-rows"===t&&null!==this.#e&&(this.#t=this.#i(this.#e),this.#n(),this.#s())}}#c(){return Array.from(this.rowsElement.querySelectorAll("descope-multi-select-combo-box"))}#u(){return Array.from(this.rowsElement.querySelectorAll(".remove-button"))}#d(){if(this.disabled||this.readonly||this.#m())return;const t={firstValues:[],secondValues:[]};this.#t=[...this.#t,t],this.rowsElement.append(this.#p(t)),this.#h()}#i(t){if(!Array.isArray(t)||!t.length)return[{firstValues:[],secondValues:[]}];let e=t.map(t=>{const e=t?.[this.firstValueKey];return{firstValues:null!=e&&""!==String(e)?[String(e)]:[],secondValues:h(t?.[this.secondValueKey]??[])}});if(this.mergeRows){const t=new Map;for(const r of e){const e=[...r.secondValues].sort().join("\0");t.has(e)?t.get(e).firstValues.push(...r.firstValues):t.set(e,{firstValues:[...r.firstValues],secondValues:r.secondValues})}e=[...t.values()]}return e}#n(){const t=new Set(this.#r.map(t=>t.value));this.#t=this.#t.map(e=>{const r=e.firstValues.filter(e=>t.has(e)),o=this.#b(r),i=new Set(o.map(t=>t.value));return{firstValues:r,secondValues:e.secondValues.filter(t=>i.has(t))}})}#b(t){const e=t.length?t.map(t=>this.#o[t]||[]).filter(t=>t.length):Object.values(this.#o).filter(t=>t.length);if(!e.length||t.length&&e.length!==t.length)return[];if(1===e.length)return e[0];const[r,...o]=e,i=new Set(r.map(t=>t.value));for(const t of o){const e=new Set(t.map(t=>t.value));for(const t of i)e.has(t)||i.delete(t)}return r.filter(t=>i.has(t.value))}#g({getRowIndex:t,type:e,label:r,placeholder:o,options:i,selectedValues:n}){const s=document.createElement("descope-multi-select-combo-box");return s.className=`combo ${e}-combo`,s.setAttribute("size",this.size),s.setAttribute("bordered","true"),s.setAttribute("item-label-path","data-name"),s.setAttribute("item-value-path","data-id"),r&&s.setAttribute("label",r),o&&s.setAttribute("placeholder",o),this.disabled&&s.setAttribute("disabled","true"),this.readonly&&s.setAttribute("readonly","true"),s.data=i,this.#f(s,n),s.addEventListener("input",()=>{if(s.__descopeSyncingSelection)return;const r=t();-1!==r&&this.#v({rowIndex:r,type:e,selectedValues:h(s.value||[])})}),s}#f(t,e){t.__descopeSyncingSelection=!0,Promise.resolve().then(()=>{const r=new Set(e||[]);t.selectedItems=(t.items||[]).filter(t=>r.has(t["data-id"]||t.getAttribute?.("data-id"))),t.__descopeSyncingSelection=!1})}#y(t){const e=document.createElement("descope-button");return e.className="remove-button",e.setAttribute("variant","link"),e.setAttribute("mode","primary"),e.setAttribute("size",this.size),e.setAttribute("aria-label","Remove row"),e.innerHTML='<vaadin-icon icon="vaadin:minus"></vaadin-icon>',(this.disabled||this.readonly)&&e.setAttribute("disabled","true"),e.addEventListener("click",()=>{const e=t();-1!==e&&this.#w(e)}),e}#s(){this.rowsElement.innerHTML="",this.#t.forEach(t=>{this.rowsElement.append(this.#p(t))}),this.#h()}#p(t){const e=document.createElement("div");e.className="row";const r=()=>Array.from(this.rowsElement.children).indexOf(e),o=this.#g({getRowIndex:r,type:"first",label:this.firstLabel,placeholder:this.firstPlaceholder,options:this.#r.map(({value:t,label:e})=>({value:t,label:e})),selectedValues:t.firstValues}),i=this.#b(t.firstValues),n=this.#g({getRowIndex:r,type:"second",label:this.secondLabel,placeholder:this.secondPlaceholder,options:i,selectedValues:t.secondValues});return e.append(o,n,this.#y(r)),e}#x(t){const e=this.#t[t];if(!e)return;const r=this.rowsElement.children[t],o=r?.querySelector(".second-combo");if(!o)return void this.#s();const i=this.#b(e.firstValues);o.data=i,this.#f(o,e.secondValues)}#l(){this.addButtonElement.setAttribute("size",this.size)}#h(){this.disabled||this.readonly||this.#m()?this.addButtonElement.setAttribute("disabled","true"):this.addButtonElement.removeAttribute("disabled")}#m(){return Number.isFinite(this.maxRows)&&this.#t.length>=this.maxRows}#A(t){this.rowsElement.children[t]?.remove()}#v({rowIndex:t,type:e,selectedValues:r}){if(this.disabled||this.readonly)return;const o=this.#t[t];if(o){if("first"===e){const e=this.#b(r),i=new Set(e.map(t=>t.value)),n=o.secondValues.filter(t=>i.has(t));if(b(o.firstValues,r)&&b(o.secondValues,n))return;return this.#t[t]={firstValues:r,secondValues:n},this.#x(t),void this.#V()}b(o.secondValues,r)||(this.#t[t]={...o,secondValues:r},this.#V())}}#w(t){if(this.disabled||this.readonly||this.#t.length<=1)return;const e=this.#t[t];this.#t=this.#t.filter((e,r)=>r!==t),this.#A(t),this.#h(),(e.firstValues.length>0||e.secondValues.length>0)&&this.#V()}#V(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}});customElements.define(d,y)},89389(t,e,r){r.d(e,{$:()=>p});var o=r(13256),i=r(55774),n=r(82901),s=r(72562),a=r(81488),l=r(87550);const d=r(51450).AH`
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5087,5375],{19624(t,e,r){r.d(e,{J:()=>m,T:()=>l});var o=r(63200),i=r(25964),n=r(88961),s=r(98538),a=r(10767);const l=(0,i.xE)("button"),{host:d,label:c,slottedIcon:u}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let h;const m=(0,o.Zz)((0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),(0,n.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...d,property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>"::slotted(*)",property:s.S.cssVarList.fill},labelTextDecoration:{...c,property:"text-decoration"},labelSpacing:{...c,property:"gap"},textAlign:{...c,property:"justify-content",fallback:"center"},iconSize:[{...u,property:"width"},{...u,property:"height"}]}}),a.G,n.VO,n.tQ)((0,n.tz)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${h}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${m.cssVarList.outlineWidth}) + var(${m.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${m.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${m.cssVarList.hostHeight}) - var(${m.cssVarList.outlineWidth}) - var(${m.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${m.cssVarList.hostWidth}) - var(${m.cssVarList.outlineWidth}) - var(${m.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex","class","style"],componentName:l})),{color:p,fontSize:b}=m.cssVarList;h=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${p});\n\t\ttop: calc(50% - (var(${b}) / 2));\n\t\tleft: calc(50% - (var(${b}) / 2));\n\t\tborder-width: calc(var(${b}) / 10);\n\t\twidth: var(${b});\n\t\theight: var(${b});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"]) ::part(prefix),\n\t:host([loading="true"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},10767(t,e,r){r.d(e,{G:()=>o});const o=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},30576(t,e,r){r.r(e),r.d(e,{ButtonClass:()=>o.J,componentName:()=>o.T});var o=r(19624);r(83799),customElements.define(o.T,o.J)},98538(t,e,r){r.d(e,{S:()=>l,T:()=>a});var o=r(88961),i=r(25964),n=r(8512),s=r(63200);const a=(0,i.xE)("icon"),l=(0,s.Zz)((0,o.RF)({mappings:{fill:[{},{property:n.q.cssVarList.fill}],height:{selector:()=>":host"},width:{selector:()=>":host"}}}),o.VO,o.tQ)((0,o.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style","st-height","st-width"],componentName:a}))},8512(t,e,r){r.d(e,{T:()=>l,q:()=>u});var o=r(88961),i=r(72270),n=r(63200),s=r(25964),a=r(18782);const l=(0,s.xE)("image"),d=["src","src-dark"];class c extends((0,i.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return d}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,s.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${u.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),e!==r&&this.shouldRender(t)&&this.renderImage()}}const u=(0,n.Zz)((0,o.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),o.VO,o.tQ)(c)},18782(t,e,r){r.d(e,{m:()=>n});var o=r(25414);const i=t=>{const e=o.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},n=async(t,e)=>{try{let r;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));r=i(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),o=await e.text();r=i(o)}else r=((t,e)=>{const r=document.createElement("img");return r.setAttribute("src",t),r.setAttribute("alt",e),r})(t,e);return r.style.setProperty("max-width","100%"),r.style.setProperty("max-height","100%"),r}catch{return null}}},22931(t,e,r){r.r(e),r.d(e,{MultiLineMappingsClass:()=>y,componentName:()=>d}),r(30576),r(70067);var o=r(63200),i=r(25964),n=r(88961),s=r(72270),a=r(94681),l=r(19624);const d=(0,i.xE)("multi-line-mappings"),c=(0,s.qu)({componentName:d}),u=t=>null==t?"":String("object"==typeof t?t.value??t.id??t.label??"":t),h=t=>[...new Set(t.map(u).filter(Boolean))],m=t=>{const e=u(t);return"object"==typeof t&&null!==t?{...t,value:e,label:String(t.label??t.displayName??e)}:{value:e,label:e}},p=t=>{if(!Array.isArray(t))return[];const e=new Set;return t.map(m).filter(t=>!(!t.value||e.has(t.value)||(e.add(t.value),0)))},b=(t=[],e=[])=>t.length===e.length&&t.every((t,r)=>t===e[r]),g={selector:()=>":host"},f={selector:".row"},v={selector:".add-action"},y=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...g,property:"width"},hostDirection:[{...g,property:"direction"},{selector:a.t.componentName,property:a.t.cssVarList.hostDirection},{selector:l.J.componentName,property:l.J.cssVarList.hostDirection}],rowsGap:{selector:".rows",property:"gap"},rowGap:{...f,property:"gap"},rowAlignItems:{...f,property:"align-items"},rowWrap:{...f,property:"flex-wrap"},addActionJustifyContent:{...v,property:"justify-content"},addActionMarginTop:{...v,property:"margin-top"}}}),n.VO)(class extends c{static get observedAttributes(){return["data","max-rows","size","disabled","readonly","first-value-key","second-value-key","first-label","second-label","first-placeholder","second-placeholder","full-width","merge-rows"]}#t=[{firstValues:[],secondValues:[]}];#e=null;#r=[];#o={};constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <div class="rows"></div>\n <div class="add-action">\n <descope-button\n class="add-button"\n variant="link"\n mode="primary"\n >\n <slot name="add-button-content">Add line</slot>\n </descope-button>\n </div>\n </div>\n ',(0,i.fz)("\n :host {\n display: inline-flex;\n box-sizing: border-box;\n max-width: 100%;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .rows > .row {\n display: flex;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n align-items: flex-end;\n }\n\n .row descope-multi-select-combo-box {\n flex: 1 1 0;\n box-sizing: border-box;\n }\n\n .row .remove-button {\n flex: 0 0 auto;\n align-self: flex-end;\n }\n\n .row:only-child .remove-button {\n display: none;\n pointer-events: none;\n }\n\n .add-action {\n display: flex;\n }\n ",this),this.rowsElement=this.shadowRoot.querySelector(".rows"),this.addButtonElement=this.shadowRoot.querySelector(".add-button")}get size(){return this.getAttribute("size")||"md"}get firstValueKey(){return this.getAttribute("first-value-key")||"firstValues"}get secondValueKey(){return this.getAttribute("second-value-key")||"secondValues"}get firstLabel(){return this.getAttribute("first-label")||""}get secondLabel(){return this.getAttribute("second-label")||""}get firstPlaceholder(){return this.getAttribute("first-placeholder")||""}get secondPlaceholder(){return this.getAttribute("second-placeholder")||""}get disabled(){return"true"===this.getAttribute("disabled")}get readonly(){return"true"===this.getAttribute("readonly")}get mergeRows(){return"true"===this.getAttribute("merge-rows")}get maxRows(){const t=Number(this.getAttribute("max-rows"));return Number.isFinite(t)&&t>0?t:void 0}get data(){return this.#o}get value(){return this.#t.filter(t=>t.firstValues.length>0||t.secondValues.length>0).flatMap(t=>(t.firstValues.length?t.firstValues:[""]).map(e=>({[this.firstValueKey]:e,[this.secondValueKey]:[...t.secondValues]})))}set value(t){this.#e=t,this.#t=this.#i(t),this.#n(),this.#s()}#a(t){const e=((t,e,r="unknown")=>{if("string"!=typeof t||!t?.trim())return e;try{return JSON.parse(t)}catch(t){return console.error(`[descope-multi-line-mappings] Failed to parse JSON from "${r}"`,t),e}})(t,{},"data attribute"),r=e&&"object"==typeof e&&!Array.isArray(e)?e:{};this.#r=Object.entries(r).map(([t,e])=>{const r=String(t),o=null!=e&&"object"==typeof e&&!Array.isArray(e),i=o?e.options??[]:e;return{value:r,label:o&&null!=e.label?String(e.label):r,options:p(i)}}),this.#o=Object.fromEntries(this.#r.map(({value:t,options:e})=>[t,e]))}init(){super.init?.(),this.#l(),this.addButtonElement.addEventListener("click",()=>this.#d()),this.#s()}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback?.(t,e,r),e!==r){if("data"===t)return this.#a(r),this.#n(),void this.#s();if("size"===t)return[...this.#c(),...this.#u()].forEach(t=>t.setAttribute("size",this.size)),this.#l(),void this.#h();if(["disabled","readonly"].includes(t))return this.#c().forEach(t=>{t[this.disabled?"setAttribute":"removeAttribute"]("disabled","true"),t[this.readonly?"setAttribute":"removeAttribute"]("readonly","true")}),this.#u().forEach(t=>t[this.disabled||this.readonly?"setAttribute":"removeAttribute"]("disabled","true")),void this.#h();if(["first-label","second-label"].includes(t)){const e="first-label"===t?"first":"second";return void Array.from(this.rowsElement.children).forEach(t=>{const o=t.querySelector(`.${e}-combo`);r?o?.setAttribute("label",r):o?.removeAttribute("label")})}if(["first-placeholder","second-placeholder"].includes(t)){const e="first-placeholder"===t?"first":"second";return void Array.from(this.rowsElement.children).forEach(t=>{const o=t.querySelector(`.${e}-combo`);r?o?.setAttribute("placeholder",r):o?.removeAttribute("placeholder")})}"max-rows"===t&&this.#h(),"merge-rows"===t&&null!==this.#e&&(this.#t=this.#i(this.#e),this.#n(),this.#s())}}#c(){return Array.from(this.rowsElement.querySelectorAll("descope-multi-select-combo-box"))}#u(){return Array.from(this.rowsElement.querySelectorAll(".remove-button"))}#d(){if(this.disabled||this.readonly||this.#m())return;const t={firstValues:[],secondValues:[]};this.#t=[...this.#t,t],this.rowsElement.append(this.#p(t)),this.#h()}#i(t){if(!Array.isArray(t)||!t.length)return[{firstValues:[],secondValues:[]}];let e=t.map(t=>{const e=t?.[this.firstValueKey];return{firstValues:null!=e&&""!==String(e)?[String(e)]:[],secondValues:h(t?.[this.secondValueKey]??[])}});if(this.mergeRows){const t=new Map;for(const r of e){const e=[...r.secondValues].sort().join("\0");t.has(e)?t.get(e).firstValues.push(...r.firstValues):t.set(e,{firstValues:[...r.firstValues],secondValues:r.secondValues})}e=[...t.values()]}return e}#n(){const t=new Set(this.#r.map(t=>t.value));this.#t=this.#t.map(e=>{const r=e.firstValues.filter(e=>t.has(e)),o=this.#b(r),i=new Set(o.map(t=>t.value));return{firstValues:r,secondValues:e.secondValues.filter(t=>i.has(t))}})}#b(t){const e=t.length?t.map(t=>this.#o[t]||[]).filter(t=>t.length):Object.values(this.#o).filter(t=>t.length);if(!e.length||t.length&&e.length!==t.length)return[];if(1===e.length)return e[0];const[r,...o]=e,i=new Set(r.map(t=>t.value));for(const t of o){const e=new Set(t.map(t=>t.value));for(const t of i)e.has(t)||i.delete(t)}return r.filter(t=>i.has(t.value))}#g({getRowIndex:t,type:e,label:r,placeholder:o,options:i,selectedValues:n}){const s=document.createElement("descope-multi-select-combo-box");return s.className=`combo ${e}-combo`,s.setAttribute("size",this.size),s.setAttribute("bordered","true"),s.setAttribute("item-label-path","data-name"),s.setAttribute("item-value-path","data-id"),r&&s.setAttribute("label",r),o&&s.setAttribute("placeholder",o),this.disabled&&s.setAttribute("disabled","true"),this.readonly&&s.setAttribute("readonly","true"),s.data=i,this.#f(s,n),s.addEventListener("input",()=>{if(s.__descopeSyncingSelection)return;const r=t();-1!==r&&this.#v({rowIndex:r,type:e,selectedValues:h(s.value||[])})}),s}#f(t,e){t.__descopeSyncingSelection=!0,Promise.resolve().then(()=>{const r=new Set(e||[]);t.selectedItems=(t.items||[]).filter(t=>r.has(t["data-id"]||t.getAttribute?.("data-id"))),t.__descopeSyncingSelection=!1})}#y(t){const e=document.createElement("descope-button");return e.className="remove-button",e.setAttribute("variant","link"),e.setAttribute("mode","primary"),e.setAttribute("size",this.size),e.setAttribute("aria-label","Remove row"),e.innerHTML='<vaadin-icon icon="vaadin:minus"></vaadin-icon>',(this.disabled||this.readonly)&&e.setAttribute("disabled","true"),e.addEventListener("click",()=>{const e=t();-1!==e&&this.#w(e)}),e}#s(){this.rowsElement.innerHTML="",this.#t.forEach(t=>{this.rowsElement.append(this.#p(t))}),this.#h()}#p(t){const e=document.createElement("div");e.className="row";const r=()=>Array.from(this.rowsElement.children).indexOf(e),o=this.#g({getRowIndex:r,type:"first",label:this.firstLabel,placeholder:this.firstPlaceholder,options:this.#r.map(({value:t,label:e})=>({value:t,label:e})),selectedValues:t.firstValues}),i=this.#b(t.firstValues),n=this.#g({getRowIndex:r,type:"second",label:this.secondLabel,placeholder:this.secondPlaceholder,options:i,selectedValues:t.secondValues});return e.append(o,n,this.#y(r)),e}#x(t){const e=this.#t[t];if(!e)return;const r=this.rowsElement.children[t],o=r?.querySelector(".second-combo");if(!o)return void this.#s();const i=this.#b(e.firstValues);o.data=i,this.#f(o,e.secondValues)}#l(){this.addButtonElement.setAttribute("size",this.size)}#h(){this.disabled||this.readonly||this.#m()?this.addButtonElement.setAttribute("disabled","true"):this.addButtonElement.removeAttribute("disabled")}#m(){return Number.isFinite(this.maxRows)&&this.#t.length>=this.maxRows}#A(t){this.rowsElement.children[t]?.remove()}#v({rowIndex:t,type:e,selectedValues:r}){if(this.disabled||this.readonly)return;const o=this.#t[t];if(o){if("first"===e){const e=this.#b(r),i=new Set(e.map(t=>t.value)),n=o.secondValues.filter(t=>i.has(t));if(b(o.firstValues,r)&&b(o.secondValues,n))return;return this.#t[t]={firstValues:r,secondValues:n},this.#x(t),void this.#V()}b(o.secondValues,r)||(this.#t[t]={...o,secondValues:r},this.#V())}}#w(t){if(this.disabled||this.readonly||this.#t.length<=1)return;const e=this.#t[t];this.#t=this.#t.filter((e,r)=>r!==t),this.#A(t),this.#h(),(e.firstValues.length>0||e.secondValues.length>0)&&this.#V()}#V(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}});customElements.define(d,y)},89389(t,e,r){r.d(e,{$:()=>p});var o=r(13256),i=r(55774),n=r(82901),s=r(72562),a=r(81488),l=r(87550);const d=r(51450).AH`
3
3
  :host {
4
4
  display: inline-block;
5
5
  position: relative;