lido-player 0.0.2-beta-15 → 0.0.2-beta-16-dev

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 (73) hide show
  1. package/dist/cjs/{decode-xNTgi2vl.js → decode-C08Ujimj.js} +1 -1
  2. package/dist/cjs/{index-BFTVvr1n.js → index-BkBqiwe8.js} +134 -8
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/lido-avatar_22.cjs.entry.js +52 -29
  5. package/dist/cjs/lido-player.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/calculator/lido-calculator.css +12 -12
  8. package/dist/collection/components/canvas/lido-canvas.css +32 -32
  9. package/dist/collection/components/canvas/lido-canvas.js +1 -1
  10. package/dist/collection/components/cell/lido-cell.js +1 -1
  11. package/dist/collection/components/column/lido-col.js +1 -1
  12. package/dist/collection/components/container/lido-container.js +2 -2
  13. package/dist/collection/components/float/lido-float.js +1 -1
  14. package/dist/collection/components/position/lido-pos.js +1 -1
  15. package/dist/collection/components/row/lido-row.js +1 -1
  16. package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
  17. package/dist/collection/components/text/lido-text.js +25 -1
  18. package/dist/collection/components/wrap/lido-wrap.js +1 -1
  19. package/dist/collection/utils/constants.js +1 -0
  20. package/dist/collection/utils/utils.js +4 -0
  21. package/dist/collection/utils/utilsHandlers/animationHandler.js +20 -9
  22. package/dist/collection/utils/utilsHandlers/moveHandler.js +111 -0
  23. package/dist/components/index.js +1 -1
  24. package/dist/components/lido-calculator.js +1 -1
  25. package/dist/components/lido-canvas.js +1 -1
  26. package/dist/components/lido-cell.js +1 -1
  27. package/dist/components/lido-col.js +1 -1
  28. package/dist/components/lido-container.js +1 -1
  29. package/dist/components/lido-float.js +1 -1
  30. package/dist/components/lido-home.js +1 -1
  31. package/dist/components/lido-image.js +1 -1
  32. package/dist/components/lido-keyboard.js +1 -1
  33. package/dist/components/lido-pos.js +1 -1
  34. package/dist/components/lido-root.js +1 -1
  35. package/dist/components/lido-row.js +1 -1
  36. package/dist/components/lido-slide-fill.js +1 -1
  37. package/dist/components/lido-text.js +1 -1
  38. package/dist/components/lido-wrap.js +1 -1
  39. package/dist/components/{p-kmKkLN_7.js → p-BE25wHoo.js} +1 -1
  40. package/dist/components/p-BfwUqpXc.js +1 -0
  41. package/dist/components/{p-CDhOF-lb.js → p-Bw-OC9iR.js} +1 -1
  42. package/dist/components/{p-DVn4BL1l.js → p-C2p0KZh4.js} +1 -1
  43. package/dist/components/p-C5jvgiPE.js +1 -0
  44. package/dist/components/{p-CFNRhdZZ.js → p-CPYnt0P-.js} +1 -1
  45. package/dist/components/{p-B8USa8EO.js → p-CS6iRQJh.js} +1 -1
  46. package/dist/components/{p-DflRPD3L.js → p-CyGxEcn7.js} +1 -1
  47. package/dist/components/{p-BP79Al--.js → p-D-IYWSAa.js} +1 -1
  48. package/dist/components/{p-CbZUFX8q.js → p-DGvzMlyn.js} +2 -2
  49. package/dist/components/p-DbR5sNOj.js +1 -0
  50. package/dist/components/{p-D2RiLzSu.js → p-Sl9R-E6h.js} +1 -1
  51. package/dist/components/p-Uluc7jQ7.js +1 -0
  52. package/dist/components/{p-CLX-8DBk.js → p-useuhkjH.js} +1 -1
  53. package/dist/esm/{decode-DyBLrL5N.js → decode-CGJIPA4t.js} +1 -1
  54. package/dist/esm/{index-B7s7KKj1.js → index-C854B63S.js} +134 -8
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/lido-avatar_22.entry.js +52 -29
  57. package/dist/esm/lido-player.js +1 -1
  58. package/dist/esm/loader.js +1 -1
  59. package/dist/lido-player/index.esm.js +1 -1
  60. package/dist/lido-player/lido-player.esm.js +1 -1
  61. package/dist/lido-player/{p-Detap4vV.js → p-Bg5mBsd9.js} +1 -1
  62. package/dist/lido-player/p-C4OTDhbr.js +1 -0
  63. package/dist/lido-player/{p-05fff653.entry.js → p-f0e333c6.entry.js} +2 -2
  64. package/dist/types/components/text/lido-text.d.ts +4 -0
  65. package/dist/types/components.d.ts +11 -0
  66. package/dist/types/utils/constants.d.ts +1 -0
  67. package/dist/types/utils/utilsHandlers/moveHandler.d.ts +1 -0
  68. package/package.json +1 -1
  69. package/dist/components/p-BJ4H1UxZ.js +0 -1
  70. package/dist/components/p-BiNO9454.js +0 -1
  71. package/dist/components/p-DH6lvh19.js +0 -1
  72. package/dist/components/p-DbDgJi-A.js +0 -1
  73. package/dist/lido-player/p-CofY42mG.js +0 -1
@@ -54,6 +54,10 @@ export declare class LidoText {
54
54
  * The ARIA hidden attribute of the container. Used for accessibility to hide the element.
55
55
  */
56
56
  ariaHidden: string;
57
+ /**
58
+ * Allows the text element to be freely moved by pointer/touch and persists the final x/y attributes.
59
+ */
60
+ move: string;
57
61
  /**
58
62
  * X-axis (horizontal) position of the text component (CSS value, e.g., '10px', '5vw').
59
63
  */
@@ -2155,6 +2155,11 @@ export namespace Components {
2155
2155
  * @default 1
2156
2156
  */
2157
2157
  "minDrops": number;
2158
+ /**
2159
+ * Allows the text element to be freely moved by pointer/touch and persists the final x/y attributes.
2160
+ * @default 'false'
2161
+ */
2162
+ "move": string;
2158
2163
  /**
2159
2164
  * Event handler for a Correct matching action, which can be used to hide the column or trigger other custom logic.
2160
2165
  * @default ''
@@ -4869,6 +4874,11 @@ declare namespace LocalJSX {
4869
4874
  * @default 1
4870
4875
  */
4871
4876
  "minDrops"?: number;
4877
+ /**
4878
+ * Allows the text element to be freely moved by pointer/touch and persists the final x/y attributes.
4879
+ * @default 'false'
4880
+ */
4881
+ "move"?: string;
4872
4882
  /**
4873
4883
  * Event handler for a Correct matching action, which can be used to hide the column or trigger other custom logic.
4874
4884
  * @default ''
@@ -5646,6 +5656,7 @@ declare namespace LocalJSX {
5646
5656
  "width": string;
5647
5657
  "ariaLabel": string;
5648
5658
  "ariaHidden": string;
5659
+ "move": string;
5649
5660
  "x": string;
5650
5661
  "y": string;
5651
5662
  "z": string;
@@ -1,6 +1,7 @@
1
1
  export declare const DragSelectedMapKey = "lidoDragSelectedMap";
2
2
  export declare const DragMapKey = "lidoDragMap";
3
3
  export declare const SelectedValuesKey = "lidoSelectedValues";
4
+ export declare const AnimationVanishedValuesKey = "data-animation-vanished-values";
4
5
  export declare const ActivityScoreKey = "lidoActivityScore";
5
6
  export declare const ActivityEndKey = "lidoActivityEnd";
6
7
  export declare const LessonEndKey = "lidoLessonEnd";
@@ -0,0 +1 @@
1
+ export declare function enableFreeMove(element: HTMLElement): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lido-player",
3
- "version": "0.0.2-beta-15",
3
+ "version": "0.0.2-beta-16-dev",
4
4
  "description": "Stencil Component For Lido Player",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{t,p as i,H as e,i as s,l as o,m as n,c as a,a as h,h as r,b as d}from"./index.js";const l=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.margin="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){s(this.el,this.type),o(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&n(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?a(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:h(this.height,i),width:h(this.width,i),backgroundColor:h(this.bgColor,i),top:h(this.y,i),left:h(this.x,i),zIndex:this.z,display:this.visible?"flex":"none",flexDirection:this.direction?h(this.direction,i):"column",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",boxShadow:this.boxShadow?this.boxShadow:"unset",margin:h(this.margin,i)}}render(){return r(d,{key:"cf619b69e4616e83c163479a224ad86079afa927",id:this.id,class:"lido-col",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},r("slot",{key:"2af707c5e7ec75db20c8d7c9cf05c2af9508a590"}))}get el(){return this}static get style(){return".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}"}},[260,"lido-col",{showSpeakIcon:[4,"show-speak-icon"],id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[4],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],childElementsLength:[2,"child-elements-length"],minLength:[2,"min-length"],maxLength:[2,"max-length"],direction:[1],borderImage:[1,"border-image"],boxShadow:[1,"box-shadow"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],margin:[1],style:[32]}]);function c(){"undefined"!=typeof customElements&&["lido-col"].forEach((i=>{"lido-col"===i&&(customElements.get(t(i))||customElements.define(t(i),l))}))}c();export{l as L,c as d}
@@ -1 +0,0 @@
1
- import{t,p as i,H as s,k as o,i as e,u as a,v as l,a as n,h,b as d}from"./index.js";const r=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.id="",this.value="",this.z="0",this.tabIndex=0,this.visible=!1,this.onEntry="",this.delayVisible="",this.floatDirection="bottomToTop",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){o(this.el,this.delayVisible),e(this.el,this.type),this.initializeFloatElement()}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}initializeFloatElement(){let t=0;Array.from(this.el.children).forEach((i=>{const s=i;s.style.visibility="hidden",setTimeout((()=>{s.style.visibility="visible",a(s)}),t),t+=1e3,i.addEventListener("click",(()=>{l(s)}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:"leftToRight"!==this.floatDirection?"100%":n(this.height,t),width:"leftToRight"===this.floatDirection?"100%":n(this.width,t),backgroundColor:n(this.bgColor,t),zIndex:this.z,display:this.visible?"flex":"none"}}render(){return h(d,{key:"5b047b9480951c7741fc20cd7dada79da3cb8bc3",class:"lido-float","float-direction":this.floatDirection,id:this.id,"tab-index":this.tabIndex,style:this.style,onEntry:this.onEntry},h("slot",{key:"4d200251a291484f06f6bc7179c4ac61b8193fc8"}))}get el(){return this}static get style(){return".lido-float{position:relative}.lido-float>*{position:absolute;cursor:pointer}@keyframes float-up{from{top:var(--el-top)}to{top:-500px}}#removeShadow{box-shadow:unset !important}@keyframes float-lr{from{right:var(--el-left)}to{right:-500px}}"}},[260,"lido-float",{id:[1],value:[1],z:[1],tabIndex:[2,"tab-index"],visible:[4],onEntry:[1,"on-entry"],width:[1],height:[1],bgColor:[1,"bg-color"],type:[1],delayVisible:[1,"delay-visible"],floatDirection:[1,"float-direction"],style:[32]}]);function c(){"undefined"!=typeof customElements&&["lido-float"].forEach((i=>{"lido-float"===i&&(customElements.get(t(i))||customElements.define(t(i),r))}))}c();export{r as L,c as d}
@@ -1 +0,0 @@
1
- import{t,p as e,H as i,L as a,T as o,n,c as r,i as s,o as l,q as u,h,b as d,r as c}from"./index.js";import{d as g,i as m}from"./p-DVn4BL1l.js";const p=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.Lang="",this.showDropBorder=!0,this.appendToDropOnCompletion=!1,this.id="",this.objective="",this.customStyle="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="auto",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.bgImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.canplay=!0,this.showCheck=!1,this.isContinueOnCorrect=!1,this.isAllowOnlyCorrect=!1,this.baseUrl="",this.margin="",this.showPrevButton="false",this.showNextButton="false",this.delayVisible="",this.disableSpeak=!1,this.templateId="",this.highlightWordByWord=!1,this.instructName="",this.speakFlag=!1,this.handleWindowResize=()=>this.scaleContainer(this.el),this.handleWindowLoad=()=>this.scaleContainer(this.el)}cleanupInteractionHandlers(){this.el.querySelectorAll('[type="drag"], [type="slide"]').forEach((t=>{t.dispatchEvent(new Event(a))}))}languageChanged(t){const e=t||this.resolveLanguage();this.updateChildTextLanguage(e)}componentWillLoad(){const t=this.resolveLanguage();this.updateChildTextLanguage(t),this.resolveInstructionAudio()}resolveInstructionAudio(){var t;this.instructName=null!==(t={flashcard:"instruction.flashcards",mcq:"instruction.mcq",tracing:"instruction.tracing",dragAndDrop:"instruction.dragAndDrop",arrangeLetters:"arrangeLetters",balancing:"balancing",balloonPop:"balloonPop",blender:"blender",bubbleType:"bubbleType",calculator:"calculator",categorize:"categorize",checkerBlocks:"checkerBlocks",createSentence:"createSentence",fillAnswer:"fillAnswer",fillBlank:"fillBlank",fillUp:"fillUp",flashcardtemplate:"flashcard",foodJar:"foodJar",grid:"grid",imageMatchWithQuestionImageAndMultiOption:"imageMatchWithQuestionImageAndMultiOption",inventedSpelling:"inventedSpelling",jumpSentence:"jumpSentence",letterBoard:"letterBoard",letterIdentification:"letterIdentification",letterPairing:"letterPairing",makeSentence:"makeSentence",matchingCard:"matchingCard",multiplyBeeds:"multiplyBeeds",nimbleTable:"nimbleTable",numberBoardOneTwo:"numberBoardOneTwo",numberPair:"numberPair",openWindow:"openWindow",orderTractor:"orderTractor",phonicTractor:"phonicTractor",pictureMeaningCocos:"pictureMeaningCocos",pictureWordMatch1:"pictureWordMatch1",pictureWordMatch2:"pictureWordMatch2",puzzleGame:"puzzleGame",questionBoard:"questionBoard",quizLiteracySentenceSentence:"quizLiteracySentenceSentence",quizLiteracySoundOnlyImage:"quizLiteracySoundOnlyImage",quizLiteracySoundOnlySentence:"quizLiteracySoundOnlySentence",quizLiteracySoundOnlyWord:"quizLiteracySoundonlyWord",quizLiteracyAndShapes1:"quizLiteracyAndShapes1",quizLiteracyImageWithText:"quizLiteracyImageWithText",quizliteracyImageWord:"quizliteracyImageWord",quizMathBiggerAndSmaller:"quizMathBiggerAndSmaller",quizMathBiggestAndSmallest:"quizMathBiggestAndSmallest",quizmathCustomNumberMagnitude:"quizmathCustomNumberMagnitude",quizMathHowMany:"quizMathHowMany",quizmathMissingnumberDrag:"quizmathMissingnumberDrag",quizMathNumberIdentification:"quizMathNumberIdentification",quizMathOperationWithobjects:"quizMathOperationWithobjects",quizMathoperationWithoutObjects:"quizMathoperationWithoutObjects",quizMathRecognizeNumber:"quizMathRecognizeNumber",quizMathShapes:"quizMathShapes",reorder:"reorder",rocketGame:"rocketGame",rowBlock:"rowBlock",sequenceBox1:"sequenceBox1",shapeTractor:"shapeTractor",spellDoor:"spellDoor",storyMaking:"storyMaking",storyTale:"storyTale",sumTogether:"sumTogether",tag:"tag",total:"total",writeCard:"writeCard",writeLetter:"writeLetter",writeNumber:"writeNumber",writeSet:"writeSet",writeWord:"writeWord",numberIdentification:"numberIdentification",wordBuildingWithAndWithoutImage:"wordBuildingWithAndWithoutImage",subsWithAndWithoutImage:"subsWithAndWithoutImage",sentenceMatchTemplate:"sentenceMatch",pictureClues:"pictureClues",palEgmaCalculateSumAndSumTogether:"palEgmaCalculateSumAndSumTogether",palEgmaPatternMatching:"palEgmaPatternMatchingAudio",palEgmaWordProblem:"palEgmaWordProblem",palEgraArrangePictures:"palEgraArrangePicturesAudio",palEgraBuildWord:"palEgraBuildWordAudio",palEgraMCQWithImage:"palEgraMCQWithImage",palEgraOddOneOut:"palEgraOddOneOutAudio",palEgraOptionWithAudio:"palEgraOptionWithAudio",palEgraWordFormation:"palEgraWordFormationAudio",palEgraWordMatch:"palEgraWordMatch",substractionWithImage:"substractionWithImageAudio",substractionWithoutImage:"substractionWithoutImageAudio",numberIdentificationWithImage:"numberIdentificationWithImageAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageAudio",wordBuildingWithImage:"wordBuildingWithImageAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageAudio",sentenceMatch:"sentenceMatchAudio",imageMatch:"imageMatchAudio",palStoryTale:"palStoryTaleAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickAudio",palInventedSpelling:"palInventedSpellingAudio",palLetterIdentification:"palLetterIdentificationAudio",palStoryMaking:"palStoryMakingAudio",palegmasumtogether:"palegmasumtogetherAudio",palegmamultioption:"palegmamultioptionAudio",palegraoptionaudio:"palegraoptionAudio",palegrawordmatch:"palegrawordmatchAudio",palegramcqimages:"palegramcqimagesAudio",drawShape:"drawshape",drawshape:"drawshape"}[this.templateId])&&void 0!==t?t:"";const e=document.querySelector("lido-home");if(!e)return;const i=e.getAttribute(o)||"";this.speakFlag=i.includes(this.templateId),this.speakFlag||e.setAttribute(o,[i,this.templateId].filter(Boolean).join(","))}resolveLanguage(){var t,e;const i=this.el.closest("lido-root"),a=(null==i?void 0:i.Lang)||"";if(null==a?void 0:a.trim())return a;if(null===(t=this.Lang)||void 0===t?void 0:t.trim())return this.Lang;const o=this.el.getAttribute("Lang");return(null==o?void 0:o.trim())?o:null===(e=this.el.textContent)||void 0===e?void 0:e.trim()}convertToPixels(t,e=document.body){if(!t)return 0;if(t.endsWith("px"))return parseFloat(t);const i=document.createElement("div");i.style.position="absolute",i.style.visibility="hidden",i.style.height=t,e.appendChild(i);const a=i.offsetHeight;return e.removeChild(i),a}scaleContainer(t){const e=this.getClosestParentWithWidth();let i=0;e&&(i=Math.min(e.clientWidth/1600,e.clientHeight/900)),t.style.transform=`translate(-50%, -50%) scale(${0!=i?i:n()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}getClosestParentWithWidth(){let t=this.el.parentElement;for(;t;){if(t.offsetWidth>0)return t;t=t.parentElement}return null}screenOrientation(){window.innerHeight>window.innerWidth?(this.el.style.height="1600px",this.el.style.width="900px"):(this.el.style.height="900px",this.el.style.width="1600px")}updateChildTextLanguage(t){const e=t||m.language||"en";m.changeLanguage(e),this.el.querySelectorAll("lido-text").forEach((t=>{t.Lang=e,t.dispatchEvent(new CustomEvent("languageChanged",{bubbles:!0}))}))}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?r(this.bgImage):"",e=this.el.closest("lido-standalone"),i="true"===(null==e?void 0:e.getAttribute("bg-image"))?e:document.body;if(i.style.backgroundColor=this.bgColor,i.style.backgroundImage=t?`url(${t})`:"none",i.style.backgroundPosition=t?"bottom":"none",document.body.style.pointerEvents="auto",window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.templateId?setTimeout((()=>{this.el.setAttribute("onEntry",`${this.templateId}.speak='${!this.speakFlag}'; `+this.el.getAttribute("onEntry")),s(this.el,this.type)}),100):s(this.el,this.type),this.customStyle){const t=document.createElement("style");t.innerHTML=this.customStyle,document.head.appendChild(t)}const a=this.resolveLanguage();this.updateChildTextLanguage(a),setTimeout((()=>{l()}),100),c(),u.getI().start()}disconnectedCallback(){this.cleanupInteractionHandlers(),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad),document.body.style.backgroundColor="",document.body.style.backgroundImage="",c(),u.getI().stop()}render(){return h(d,{key:"104e6cc49ab78121a9b7e9939e5def1952567a53",id:"lido-container",Lang:this.Lang,"tab-index":0,class:"lido-container",objective:this.objective,baseUrl:this.baseUrl,style:{backgroundColor:this.bgColor,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:this.margin,userSelect:"none"},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,onTouch:this.onTouch,onInCorrect:this.onInCorrect,onCorrect:this.onCorrect,onEntry:this.onEntry,"show-check":`${this.showCheck}`,"is-continue-on-correct":`${this.isContinueOnCorrect}`,"is-allow-only-correct":`${this.isAllowOnlyCorrect}`,canplay:`${this.canplay}`,appendToDropOnCompletion:`${this.appendToDropOnCompletion}`,"show-prev-button":`${this.showPrevButton}`,"show-next-button":`${this.showNextButton}`,"show-drop-border":`${this.showDropBorder}`,"bg-image":this.bgImage,"exit-button-url":this.exitButtonUrl,"prev-button-url":this.prevButtonUrl,"next-button-url":this.nextButtonUrl,"speaker-button-url":this.speakerButtonUrl,"disable-speak":`${this.disableSpeak}`,"template-id":this.templateId,audio:this.audio,"highlight-word-by-word":`${this.highlightWordByWord}`},h("lido-text",{key:"ec5e3d78fbf2b8a0cf4b6f918b41c22dc18b2484",visible:"false",id:this.templateId,audio:"",string:this.instructName}),h("slot",{key:"384172d5224ae11a20983cda82a3761da456ba2a"}))}get el(){return this}static get watchers(){return{Lang:[{languageChanged:0}]}}static get style(){return".lido-container{position:relative;height:100%;width:100%;background-color:var(--bgColor, transparent);display:flex;flex-direction:column;justify-content:center;align-items:center}"}},[260,"lido-container",{Lang:[1,"lang"],showDropBorder:[4,"show-drop-border"],appendToDropOnCompletion:[4,"append-to-drop-on-completion"],id:[1],objective:[1],customStyle:[1,"custom-style"],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],bgImage:[1,"bg-image"],type:[1],tabIndex:[2,"tab-index"],visible:[4],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],canplay:[4],showCheck:[4,"show-check"],isContinueOnCorrect:[4,"is-continue-on-correct"],isAllowOnlyCorrect:[4,"is-allow-only-correct"],baseUrl:[1,"base-url"],margin:[1],exitButtonUrl:[1,"exit-button-url"],prevButtonUrl:[1,"prev-button-url"],nextButtonUrl:[1,"next-button-url"],speakerButtonUrl:[1,"speaker-button-url"],showPrevButton:[1,"show-prev-button"],showNextButton:[1,"show-next-button"],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],templateId:[1,"template-id"],highlightWordByWord:[4,"highlight-word-by-word"],instructName:[32],speakFlag:[32]},void 0,{Lang:[{languageChanged:0}]}]);function b(){"undefined"!=typeof customElements&&["lido-container","lido-text"].forEach((e=>{switch(e){case"lido-container":customElements.get(t(e))||customElements.define(t(e),p);break;case"lido-text":customElements.get(t(e))||g()}}))}b();export{p as L,b as d}
@@ -1 +0,0 @@
1
- import{I as t,t as n,p as e,H as r,k as i,i as o,a4 as s,m as a,c as u,a as c,h as l,b as h}from"./index.js";function f(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var d,g,b={exports:{}},m={},v={},p={};function w(){return d||(d=1,t=p,Object.defineProperty(t,"__esModule",{value:!0}),t.MUST_INSTALL_PUPPETEER=t.DEFAULT_CONVERSION_ERROR_MESSAGE=t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_LINK=t.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,t.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",t.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_PREFIX+t.UNEXPECTED_ERROR_MESSAGE_LINK,t.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",t.MUST_INSTALL_PUPPETEER="To convert filter values to color in Node - you will first need to install 'puppeteer' by running: \n npm install puppeteer"),p;var t}function y(){if(g)return v;g=1,Object.defineProperty(v,"__esModule",{value:!0}),v.ErrorHandling=void 0;const t=w();class n{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,n,e){const r=[`Input ${t} color string could not be parsed.`,`String received: ${n}.`];return e&&r.splice(1,0,`Expected format: ${e}.`),r.join(" ")}static generateUnexpectedError(e){return n.generateErrorResult(`${t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${e.message}`)}static hasError(t){return!!t.errorMessage}}return v.ErrorHandling=n,v}var M,k={};function j(){if(M)return k;M=1,Object.defineProperty(k,"__esModule",{value:!0}),k.SheenUtil=void 0;class t{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}return k.SheenUtil=t,t.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)",k}var x,O={};function P(){return x||(x=1,t=O,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorTypes=void 0,(n=t.ColorTypes||(t.ColorTypes={})).HEX="hex",n.RGB="rgb",n.HSL="hsl",n.KEYWORD="keyword",n.FILTER="filter"),O;var t,n}var T,E,_,$={},S={},I={};function A(){return T||(T=1,Object.defineProperty(I,"__esModule",{value:!0}),I.RgbColor=void 0,I.RgbColor=class{constructor(t=[0,0,0]){this.r=this.clamp(t[0]),this.g=this.clamp(t[1]),this.b=this.clamp(t[2])}clamp(t){return t>255?t=255:t<0&&(t=0),t}setRgb(t,n,e){this.r=this.clamp(t),this.g=this.clamp(n),this.b=this.clamp(e)}multiply(t){const n=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),e=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),r=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=n,this.g=e,this.b=r}hueRotate(t=0){t=t/180*Math.PI;const n=Math.sin(t),e=Math.cos(t);this.multiply([.213+.787*e-.213*n,.715-.715*e-.715*n,.072-.072*e+.928*n,.213-.213*e+.143*n,.715+.285*e+.14*n,.072-.072*e-.283*n,.213-.213*e-.787*n,.715-.715*e+.715*n,.072+.928*e+.072*n])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}linear(t=1,n=0){this.r=this.clamp(this.r*t+255*n),this.g=this.clamp(this.g*t+255*n),this.b=this.clamp(this.b*t+255*n)}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}}),I}var R,C,F,H,q,D,V,L,z,G,B,U,N,W={},X={},J={},K={};function Q(){return F||(F=1,t=K,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorFormats=void 0,(n=t.ColorFormats||(t.ColorFormats={})).HEX="#ffffff or #fff",n.RGB="rgb([0-255], [0-255], [0-255]) or rgb([0-255], [0-255], [0-255], [0-1]) or rgb([0-100%], [0-100%], [0-100%]) or rgb([0-100%], [0-100%], [0-100%], [0-100%]) or [0-255], [0-255], [0-255] or [0-255] [0-255] [0-255]",n.HSL="hsl([0-360], [0-100], [0-100]) or hsl([0-360], [0-100%], [0-100%]) or [0-360], [0-100], [0-100] or [0-360] [0-100] [0-100]",n.FILTER="blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), saturate(), sepia() with each parameter populated with %, px or deg where approriate e.g. contrast(101%)",n.KEYWORD="Generic color string. See the following link for all available colors: https://github.com/colorjs/color-name/blob/master/index.js"),K;var t,n}function Y(){return q?H:(q=1,H={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]})}function Z(){if(L)return V;L=1;const t=Y(),n={};for(const e of Object.keys(t))n[t[e]]=e;const e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};V=e;for(const t of Object.keys(e)){if(!("channels"in e[t]))throw new Error("missing channels property: "+t);if(!("labels"in e[t]))throw new Error("missing channel labels property: "+t);if(e[t].labels.length!==e[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:n,labels:r}=e[t];delete e[t].channels,delete e[t].labels,Object.defineProperty(e[t],"channels",{value:n}),Object.defineProperty(e[t],"labels",{value:r})}return e.rgb.hsl=function(t){const n=t[0]/255,e=t[1]/255,r=t[2]/255,i=Math.min(n,e,r),o=Math.max(n,e,r),s=o-i;let a,u;o===i?a=0:n===o?a=(e-r)/s:e===o?a=2+(r-n)/s:r===o&&(a=4+(n-e)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(i+o)/2;return u=o===i?0:c<=.5?s/(o+i):s/(2-o-i),[a,100*u,100*c]},e.rgb.hsv=function(t){let n,e,r,i,o;const s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),h=function(t){return(c-t)/6/l+.5};return 0===l?(i=0,o=0):(o=l/c,n=h(s),e=h(a),r=h(u),s===c?i=r-e:a===c?i=1/3+n-r:u===c&&(i=2/3+e-n),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},e.rgb.hwb=function(t){const n=t[0],r=t[1];let i=t[2];const o=e.rgb.hsl(t)[0],s=1/255*Math.min(n,Math.min(r,i));return i=1-1/255*Math.max(n,Math.max(r,i)),[o,100*s,100*i]},e.rgb.cmyk=function(t){const n=t[0]/255,e=t[1]/255,r=t[2]/255,i=Math.min(1-n,1-e,1-r);return[100*((1-n-i)/(1-i)||0),100*((1-e-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},e.rgb.keyword=function(e){const r=n[e];if(r)return r;let i,o=1/0;for(const n of Object.keys(t)){const r=((s=e)[0]-(a=t[n])[0])**2+(s[1]-a[1])**2+(s[2]-a[2])**2;r<o&&(o=r,i=n)}var s,a;return i},e.keyword.rgb=function(n){return t[n]},e.rgb.xyz=function(t){let n=t[0]/255,e=t[1]/255,r=t[2]/255;return n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*n+.3576*e+.1805*r),100*(.2126*n+.7152*e+.0722*r),100*(.0193*n+.1192*e+.9505*r)]},e.rgb.lab=function(t){const n=e.rgb.xyz(t);let r=n[0],i=n[1],o=n[2];return r/=95.047,i/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,[116*i-16,500*(r-i),200*(i-o)]},e.hsl.rgb=function(t){const n=t[0]/360,e=t[1]/100,r=t[2]/100;let i,o,s;if(0===e)return s=255*r,[s,s,s];i=r<.5?r*(1+e):r+e-r*e;const a=2*r-i,u=[0,0,0];for(let t=0;t<3;t++)o=n+1/3*-(t-1),o<0&&o++,o>1&&o--,s=6*o<1?a+6*(i-a)*o:2*o<1?i:3*o<2?a+(i-a)*(2/3-o)*6:a,u[t]=255*s;return u},e.hsl.hsv=function(t){const n=t[0];let e=t[1]/100,r=t[2]/100,i=e;const o=Math.max(r,.01);return r*=2,e*=r<=1?r:2-r,i*=o<=1?o:2-o,[n,100*(0===r?2*i/(o+i):2*e/(r+e)),(r+e)/2*100]},e.hsv.rgb=function(t){const n=t[0]/60,e=t[1]/100;let r=t[2]/100;const i=Math.floor(n)%6,o=n-Math.floor(n),s=255*r*(1-e),a=255*r*(1-e*o),u=255*r*(1-e*(1-o));switch(r*=255,i){case 0:return[r,u,s];case 1:return[a,r,s];case 2:return[s,r,u];case 3:return[s,a,r];case 4:return[u,s,r];case 5:return[r,s,a]}},e.hsv.hsl=function(t){const n=t[0],e=t[1]/100,r=t[2]/100,i=Math.max(r,.01);let o,s;s=(2-e)*r;const a=(2-e)*i;return o=e*i,o/=a<=1?a:2-a,o=o||0,s/=2,[n,100*o,100*s]},e.hwb.rgb=function(t){const n=t[0]/360;let e=t[1]/100,r=t[2]/100;const i=e+r;let o;i>1&&(e/=i,r/=i);const s=Math.floor(6*n),a=1-r;o=6*n-s,1&s&&(o=1-o);const u=e+o*(a-e);let c,l,h;switch(s){default:case 6:case 0:c=a,l=u,h=e;break;case 1:c=u,l=a,h=e;break;case 2:c=e,l=a,h=u;break;case 3:c=e,l=u,h=a;break;case 4:c=u,l=e,h=a;break;case 5:c=a,l=e,h=u}return[255*c,255*l,255*h]},e.cmyk.rgb=function(t){const n=t[1]/100,e=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,e*(1-r)+r))]},e.xyz.rgb=function(t){const n=t[0]/100,e=t[1]/100,r=t[2]/100;let i,o,s;return i=3.2406*n+-1.5372*e+-.4986*r,o=-.9689*n+1.8758*e+.0415*r,s=.0557*n+-.204*e+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[255*i,255*o,255*s]},e.xyz.lab=function(t){let n=t[0],e=t[1],r=t[2];return n/=95.047,e/=100,r/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*e-16,500*(n-e),200*(e-r)]},e.lab.xyz=function(t){let n,e,r;e=(t[0]+16)/116,n=t[1]/500+e,r=e-t[2]/200;const i=e**3,o=n**3,s=r**3;return e=i>.008856?i:(e-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,n*=95.047,e*=100,r*=108.883,[n,e,r]},e.lab.lch=function(t){const n=t[0],e=t[1],r=t[2];let i;return i=360*Math.atan2(r,e)/2/Math.PI,i<0&&(i+=360),[n,Math.sqrt(e*e+r*r),i]},e.lch.lab=function(t){const n=t[1],e=t[2]/360*2*Math.PI;return[t[0],n*Math.cos(e),n*Math.sin(e)]},e.rgb.ansi16=function(t,n=null){const[r,i,o]=t;let s=null===n?e.rgb.hsv(t)[2]:n;if(s=Math.round(s/50),0===s)return 30;let a=30+(Math.round(o/255)<<2|Math.round(i/255)<<1|Math.round(r/255));return 2===s&&(a+=60),a},e.hsv.ansi16=function(t){return e.rgb.ansi16(e.hsv.rgb(t),t[2])},e.rgb.ansi256=function(t){const n=t[0],e=t[1],r=t[2];return n===e&&e===r?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},e.ansi16.rgb=function(t){let n=t%10;if(0===n||7===n)return t>50&&(n+=3.5),n=n/10.5*255,[n,n,n];const e=.5*(1+~~(t>50));return[(1&n)*e*255,(n>>1&1)*e*255,(n>>2&1)*e*255]},e.ansi256.rgb=function(t){if(t>=232){const n=10*(t-232)+8;return[n,n,n]}let n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},e.rgb.hex=function(t){const n=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(n.length)+n},e.hex.rgb=function(t){const n=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let e=n[0];3===n[0].length&&(e=e.split("").map((t=>t+t)).join(""));const r=parseInt(e,16);return[r>>16&255,r>>8&255,255&r]},e.rgb.hcg=function(t){const n=t[0]/255,e=t[1]/255,r=t[2]/255,i=Math.max(Math.max(n,e),r),o=Math.min(Math.min(n,e),r),s=i-o;let a,u;return a=s<1?o/(1-s):0,u=s<=0?0:i===n?(e-r)/s%6:i===e?2+(r-n)/s:4+(n-e)/s,u/=6,u%=1,[360*u,100*s,100*a]},e.hsl.hcg=function(t){const n=t[1]/100,e=t[2]/100,r=e<.5?2*n*e:2*n*(1-e);let i=0;return r<1&&(i=(e-.5*r)/(1-r)),[t[0],100*r,100*i]},e.hsv.hcg=function(t){const n=t[2]/100,e=t[1]/100*n;let r=0;return e<1&&(r=(n-e)/(1-e)),[t[0],100*e,100*r]},e.hcg.rgb=function(t){const n=t[1]/100,e=t[2]/100;if(0===n)return[255*e,255*e,255*e];const r=[0,0,0],i=t[0]/360%1*6,o=i%1,s=1-o;let a=0;switch(Math.floor(i)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return a=(1-n)*e,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},e.hcg.hsv=function(t){const n=t[1]/100,e=n+t[2]/100*(1-n);let r=0;return e>0&&(r=n/e),[t[0],100*r,100*e]},e.hcg.hsl=function(t){const n=t[1]/100,e=t[2]/100*(1-n)+.5*n;let r=0;return e>0&&e<.5?r=n/(2*e):e>=.5&&e<1&&(r=n/(2*(1-e))),[t[0],100*r,100*e]},e.hcg.hwb=function(t){const n=t[1]/100,e=n+t[2]/100*(1-n);return[t[0],100*(e-n),100*(1-e)]},e.hwb.hcg=function(t){const n=1-t[2]/100,e=n-t[1]/100;let r=0;return e<1&&(r=(n-e)/(1-e)),[t[0],100*e,100*r]},e.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},e.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},e.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},e.gray.hsl=function(t){return[0,0,t[0]]},e.gray.hsv=e.gray.hsl,e.gray.hwb=function(t){return[0,100,t[0]]},e.gray.cmyk=function(t){return[0,0,0,t[0]]},e.gray.lab=function(t){return[t[0],0,0]},e.gray.hex=function(t){const n=255&Math.round(t[0]/100*255),e=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(e.length)+e},e.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]},V}function tt(){if(G)return z;G=1;const t=Z();function n(t,n){return function(e){return n(t(e))}}function e(e,r){const i=[r[e].parent,e];let o=t[r[e].parent][e],s=r[e].parent;for(;r[s].parent;)i.unshift(r[s].parent),o=n(t[r[s].parent][s],o),s=r[s].parent;return o.conversion=i,o}return z=function(n){const r=function(n){const e=function(){const n={},e=Object.keys(t);for(let t=e.length,r=0;r<t;r++)n[e[r]]={distance:-1,parent:null};return n}(),r=[n];for(e[n].distance=0;r.length;){const n=r.pop(),i=Object.keys(t[n]);for(let t=i.length,o=0;o<t;o++){const t=i[o],s=e[t];-1===s.distance&&(s.distance=e[n].distance+1,s.parent=n,r.unshift(t))}}return e}(n),i={},o=Object.keys(r);for(let t=o.length,n=0;n<t;n++){const t=o[n];null!==r[t].parent&&(i[t]=e(t,r))}return i}}function nt(){if(U)return B;U=1;const t=Z(),n=tt(),e={};return Object.keys(t).forEach((r=>{e[r]={},Object.defineProperty(e[r],"channels",{value:t[r].channels}),Object.defineProperty(e[r],"labels",{value:t[r].labels});const i=n(r);Object.keys(i).forEach((t=>{const n=i[t];e[r][t]=function(t){const n=function(...n){const e=n[0];if(null==e)return e;e.length>1&&(n=e);const r=t(n);if("object"==typeof r)for(let t=r.length,n=0;n<t;n++)r[n]=Math.round(r[n]);return r};return"conversion"in t&&(n.conversion=t.conversion),n}(n),e[r][t].raw=function(t){const n=function(...n){const e=n[0];return null==e?e:(e.length>1&&(n=e),t(n))};return"conversion"in t&&(n.conversion=t.conversion),n}(n)}))})),B=e}var et,rt={},it={},ot={},st={};function at(){if(et)return st;et=1,Object.defineProperty(st,"__esModule",{value:!0}),st.FilterToHexShared=void 0;const t=y(),n=Q(),e=P();return st.FilterToHexShared=class{static generateInputErrorMessage(r){return t.ErrorHandling.generateInputErrorMessage(e.ColorTypes.FILTER,r,n.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,n=1){const e=function(){const t=document.createElement("div");return t.style.height=`${n}px`,t.style.width=`${n}px`,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t}(),r=function(){const e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");r.style.height="inherit",r.style.width="inherit",r.style.float="left",r.style.filter=t;const i=document.createElementNS(e,"rect");return i.setAttributeNS(null,"width",n.toString()),i.setAttributeNS(null,"height",n.toString()),r.appendChild(i),r}();return""===r.style.filter?{errorMessage:"error indicator",svgContainerElement:e}:(e.appendChild(r),document.body.appendChild(e),{svgContainerElement:e})}static async getColorViaImageDataURL(t){return function(t){const n=function(t){const n=t.width;return t.getContext("2d").getImageData(0,0,n,n).data}(t);return`#${`000000${function(t,n,e){if(t>255||n>255||e>255)throw new Error("Invalid color component");return(t<<16|n<<8|e).toString(16)}(n[0],n[1],n[2])}`.slice(-6)}`}(function(t){const n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0,t.width,t.height),n}(await async function(){const n=new Image;return n.src=t,new Promise((t=>{setTimeout((()=>t(n)))}))}()))}},st}var ut,ct,lt={exports:{}};function ht(){return ut||(ut=1,t=lt,function(){var n=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:n,mimeType:function(t){var e,r;return(e="application/font-woff",r="image/jpeg",{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:r,jpeg:r,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n(t).toLowerCase()]||""},dataAsUrl:function(t,n){return"data:"+n+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(n){t.toBlob(n)})):function(t){return new Promise((function(n){for(var e=window.atob(t.toDataURL().split(",")[1]),r=e.length,i=new Uint8Array(r),o=0;o<r;o++)i[o]=e.charCodeAt(o);n(new Blob([i],{type:"image/png"}))}))}(t)},resolveUrl:function(t,n){var e=document.implementation.createHTMLDocument(),r=e.createElement("base");e.head.appendChild(r);var i=e.createElement("a");return e.body.appendChild(i),r.href=n,i.href=t,i.href},getAndEncode:function(t){return a.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(n){var e,r=new XMLHttpRequest;if(r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var i=new FileReader;i.onloadend=function(){var t=i.result.split(/,/)[1];n(t)},i.readAsDataURL(r.response)}else e?n(e):o("cannot fetch resource: "+t+", status: "+r.status)},r.ontimeout=function(){e?n(e):o("timeout of 30000ms occured while fetching resource: "+t)},r.responseType="blob",r.timeout=3e4,r.open("GET",t,!0),r.send(),a.impl.options.imagePlaceholder){var i=a.impl.options.imagePlaceholder.split(/,/);i&&i[1]&&(e=i[1])}function o(t){console.error(t),n("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(n){return new Promise((function(e){setTimeout((function(){e(n)}),t)}))}},asArray:function(t){for(var n=[],e=t.length,r=0;r<e;r++)n.push(t[r]);return n},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(n,e){var r=new Image;r.onload=function(){n(r)},r.onerror=e,r.src=t}))},width:function(t){var n=e(t,"border-left-width"),r=e(t,"border-right-width");return t.scrollWidth+n+r},height:function(t){var n=e(t,"border-top-width"),r=e(t,"border-bottom-width");return t.scrollHeight+n+r}};var t;function n(t){var n=/\.([^\.\/]*?)$/g.exec(t);return n?n[1]:""}function e(t,n){var e=window.getComputedStyle(t).getPropertyValue(n);return parseFloat(e.replace("px",""))}}(),e=function(){var t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,n,o){return e(t)?Promise.resolve(t).then(r).then((function(e){var r=Promise.resolve(t);return e.forEach((function(t){r=r.then((function(e){return i(e,t,n,o)}))})),r})):Promise.resolve(t)},shouldProcess:e,impl:{readUrls:r,inline:i}};function e(n){return-1!==n.search(t)}function r(e){for(var r,i=[];null!==(r=t.exec(e));)i.push(r[1]);return i.filter((function(t){return!n.isDataUrl(t)}))}function i(t,e,r,i){return Promise.resolve(e).then((function(t){return r?n.resolveUrl(t,r):t})).then(i||n.getAndEncode).then((function(t){return n.dataAsUrl(t,n.mimeType(e))})).then((function(r){return t.replace(function(t){return new RegExp("(url\\(['\"]?)("+n.escape(t)+")(['\"]?\\))","g")}(e),"$1"+r+"$3")}))}}(),r=function(){return{resolveAll:function(){return t().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:t}};function t(){return Promise.resolve(n.asArray(document.styleSheets)).then((function(t){var e=[];return t.forEach((function(t){try{n.asArray(t.cssRules||[]).forEach(e.push.bind(e))}catch(n){console.log("Error while reading CSS rules from "+t.href,n.toString())}})),e})).then((function(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return e.shouldProcess(t.style.getPropertyValue("src"))}))})).then((function(n){return n.map(t)}));function t(t){return{resolve:function(){return e.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),i=function(){return{inlineAll:function r(i){return i instanceof Element?function(t){var n=t.style.getPropertyValue("background");return n?e.inlineAll(n).then((function(n){t.style.setProperty("background",n,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(i).then((function(){return i instanceof HTMLImageElement?t(i).inline():Promise.all(n.asArray(i.childNodes).map((function(t){return r(t)})))})):Promise.resolve(i)},impl:{newImage:t}};function t(t){return{inline:function(e){return n.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(e||n.getAndEncode).then((function(e){return n.dataAsUrl(e,n.mimeType(t.src))})).then((function(n){return new Promise((function(e,r){t.onload=e,t.onerror=r,t.src=n}))}))}}}}(),o=void 0,s=!1,a={toSvg:u,toPng:function(t,n){return c(t,n||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,n){return c(t,n=n||{}).then((function(t){return t.toDataURL("image/jpeg",n.quality||1)}))},toBlob:function(t,e){return c(t,e||{}).then(n.canvasToBlob)},toPixelData:function(t,e){return c(t,e||{}).then((function(e){return e.getContext("2d").getImageData(0,0,n.width(t),n.height(t)).data}))},impl:{fontFaces:r,images:i,util:n,inliner:e,options:{}}};function u(t,e){return function(t){a.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?o:t.imagePlaceholder,a.impl.options.cacheBust=void 0===t.cacheBust?s:t.cacheBust}(e=e||{}),Promise.resolve(t).then((function(t){return l(t,e.filter,!0)})).then(h).then(f).then((function(t){return e.bgcolor&&(t.style.backgroundColor=e.bgcolor),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.style&&Object.keys(e.style).forEach((function(n){t.style[n]=e.style[n]})),t})).then((function(r){return function(t,e,r){return Promise.resolve(t).then((function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)})).then(n.escapeXhtml).then((function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"})).then((function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+r+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(r,e.width||n.width(t),e.height||n.height(t))}))}function c(t,e){return u(t,e).then(n.makeImage).then(n.delay(100)).then((function(r){var i=function(t){var r=document.createElement("canvas");if(r.width=e.width||n.width(t),r.height=e.height||n.height(t),e.bgcolor){var i=r.getContext("2d");i.fillStyle=e.bgcolor,i.fillRect(0,0,r.width,r.height)}return r}(t);return i.getContext("2d").drawImage(r,0,0),i}))}function l(t,e,r){return r||!e||e(t)?Promise.resolve(t).then((function(t){return t instanceof HTMLCanvasElement?n.makeImage(t.toDataURL()):t.cloneNode(!1)})).then((function(r){return function(t,e,r){var i=t.childNodes;return 0===i.length?Promise.resolve(e):function(t,n,e){var r=Promise.resolve();return n.forEach((function(n){r=r.then((function(){return l(n,e)})).then((function(n){n&&t.appendChild(n)}))})),r}(e,n.asArray(i),r).then((function(){return e}))}(t,r,e)})).then((function(e){return function(t,e){return e instanceof Element?Promise.resolve().then((function(){r=window.getComputedStyle(t),i=e.style,r.cssText?i.cssText=r.cssText:function(t,e){n.asArray(t).forEach((function(n){e.setProperty(n,t.getPropertyValue(n),t.getPropertyPriority(n))}))}(r,i);var r,i})).then((function(){[":before",":after"].forEach((function(r){!function(r){var i=window.getComputedStyle(t,r),o=i.getPropertyValue("content");if(""!==o&&"none"!==o){var s=n.uid();e.className=e.className+" "+s;var a=document.createElement("style");a.appendChild(function(t,e,r){var i="."+t+":"+e,o=r.cssText?s(r):a(r);return document.createTextNode(i+"{"+o+"}");function s(t){var n=t.getPropertyValue("content");return t.cssText+" content: "+n+";"}function a(t){return n.asArray(t).map(e).join("; ")+";";function e(n){return n+": "+t.getPropertyValue(n)+(t.getPropertyPriority(n)?" !important":"")}}}(s,r,i)),e.appendChild(a)}}(r)}))})).then((function(){t instanceof HTMLTextAreaElement&&(e.innerHTML=t.value),t instanceof HTMLInputElement&&e.setAttribute("value",t.value)})).then((function(){e instanceof SVGElement&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e instanceof SVGRectElement&&["width","height"].forEach((function(t){var n=e.getAttribute(t);n&&e.style.setProperty(t,n)})))})).then((function(){return e})):e}(t,e)})):Promise.resolve()}function h(t){return r.resolveAll().then((function(n){var e=document.createElement("style");return t.appendChild(e),e.appendChild(document.createTextNode(n)),t}))}function f(t){return i.inlineAll(t).then((function(){return t}))}t.exports=a}()),lt.exports;var t}var ft,dt,gt={};var bt,mt,vt,pt,wt={},yt={};var Mt=t((pt||(pt=1,function(t,n){Object.defineProperty(n,"__esModule",{value:!0});const e=function(){if(N)return m;N=1;var t=m&&m.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(m,"__esModule",{value:!0}),m.ColorToFilter=void 0;const n=y(),e=j(),r=P(),i=function(){if(_)return $;_=1,Object.defineProperty($,"__esModule",{value:!0}),$.RgbToFilter=void 0;const t=y(),n=w(),e=function(){if(E)return S;E=1,Object.defineProperty(S,"__esModule",{value:!0}),S.RgbToFilterWorker=void 0;const t=j(),n=A();class e{constructor(t,e){this.targetRgbColor=t,this.reusedRgbColor=new n.RgbColor,this.addSheen=e}static fmt(t,n,e=1){return Math.round(t[n]*e)}generateCss(n){return`${this.addSheen?`${t.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${e.fmt(n,0)}%) sepia(${e.fmt(n,1)}%) saturate(${e.fmt(n,2)}%) hue-rotate(${e.fmt(n,3,3.6)}deg) brightness(${e.fmt(n,4)}%) contrast(${e.fmt(n,5)}%)`}loss(t){return this.reusedRgbColor.setRgb(0,0,0),this.reusedRgbColor.invert(t[0]/100),this.reusedRgbColor.sepia(t[1]/100),this.reusedRgbColor.saturate(t[2]/100),this.reusedRgbColor.hueRotate(3.6*t[3]),this.reusedRgbColor.brightness(t[4]/100),this.reusedRgbColor.contrast(t[5]/100),Math.abs(this.reusedRgbColor.r-this.targetRgbColor.r)+Math.abs(this.reusedRgbColor.g-this.targetRgbColor.g)+Math.abs(this.reusedRgbColor.b-this.targetRgbColor.b)}static fixSpsa(t,n){let e=100;return 2===n?e=7500:4!==n&&5!==n||(e=200),3===n?t>e?t%=e:t<0&&(t=e+t%e):t<0?t=0:t>e&&(t=e),t}spsa(t,n,r,i,o){let s=[],a=1/0;const u=new Array(6),c=new Array(6),l=new Array(6);for(let h=0;h<o;h+=1){const o=r/Math.pow(h+1,.16666666666666666);for(let t=0;t<6;t+=1)u[t]=Math.random()>.5?1:-1,c[t]=i[t]+o*u[t],l[t]=i[t]-o*u[t];const f=this.loss(c)-this.loss(l);for(let r=0;r<6;r+=1){const s=f/(2*o)*u[r],a=n[r]/Math.pow(t+h+1,1);i[r]=e.fixSpsa(i[r]-a*s,r)}const d=this.loss(i);d<a&&(s=i.slice(0),a=d)}return{values:s,loss:a}}solveNarrow(t){const n=t.loss,e=n+1;return this.spsa(n,[.25*e,.25*e,e,.25*e,.2*e,.2*e],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let n={values:[],loss:1/0};for(let e=0;n.loss>25&&e<3;e+=1){const e=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);e.loss<n.loss&&(n=e)}return n}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}return S.RgbToFilterWorker=e,S}(),r=A();class i{static generateConversionError(e){return t.ErrorHandling.generateErrorResult(e||n.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(n){return t.ErrorHandling.generateErrorResult(n)}static execute(t,n){const i=new r.RgbColor(t);return new e.RgbToFilterWorker(i,n).convert()}static convertToRGB(t,n){return t&&n?n(t):null}static convert(n){try{const{colorString:e,validateAndParse:r,convertToRgb:o,conversionErrorMessage:s,addSheen:a}=n,u=e.trim().toLocaleLowerCase(),c=(null==r?void 0:r(u))||{color:u};if(t.ErrorHandling.hasError(c))return i.generateValidateAndParseError(c.errorMessage);const l=i.convertToRGB(c.color,o)||c.color;return l?i.execute(l,a):i.generateConversionError(s)}catch(n){return t.ErrorHandling.generateUnexpectedError(n)}}}return $.RgbToFilter=i,$}(),o=function(){if(D)return W;D=1;var t=W&&W.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0}),W.ColorParser=void 0;const n=(R||(R=1,Object.defineProperty(X,"__esModule",{value:!0}),X.MATCH_HEXADECIMAL=X.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,X.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,X.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i),X),e=y(),r=(C||(C=1,Object.defineProperty(J,"__esModule",{value:!0}),J.MAX_COLOR_INPUT_STRING_LENGTH=void 0,J.MAX_COLOR_INPUT_STRING_LENGTH=25),J),i=Q(),o=P(),s=t(Y());class a{static validateAndParseHex(t){return t.length<r.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(n.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(o.ColorTypes.HEX,t,i.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<r.MAX_COLOR_INPUT_STRING_LENGTH){const e=t.match(n.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(n.MATCH_INTEGER_AND_FLOAT_NUMBERS.lastIndex=0,e&&e.length>=3)return e.slice(0,3).map((t=>Number.parseInt(t)))}return null}static validateAndParseRgb(t){const n=a.parseFirstThreeIntegersFromString(t);return n&&n[0]>=0&&n[0]<=255&&n[1]>=0&&n[1]<=255&&n[2]>=0&&n[2]<=255?{color:n}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(o.ColorTypes.RGB,t,i.ColorFormats.RGB)}}static validateAndParseHsl(t){const n=a.parseFirstThreeIntegersFromString(t);return n&&n[0]>=0&&n[0]<=360&&n[1]>=0&&n[1]<=100&&n[2]>=0&&n[2]<=100?{color:n}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(o.ColorTypes.HSL,t,i.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<r.MAX_COLOR_INPUT_STRING_LENGTH&&s.default[t]?{color:t}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(o.ColorTypes.KEYWORD,t,i.ColorFormats.KEYWORD)}}}return W.ColorParser=a,W}(),s=t(nt());return m.ColorToFilter=class{static rgbToFilter(t,n){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseRgb,addSheen:e.SheenUtil.parseSheenFromOptions(n)})}static hexToFilter(t,n){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseHex,convertToRgb:s.default.hex.rgb,addSheen:e.SheenUtil.parseSheenFromOptions(n)})}static hslToFilter(t,n){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseHsl,convertToRgb:s.default.hsl.rgb,addSheen:e.SheenUtil.parseSheenFromOptions(n)})}static keywordToFilter(t,a){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseKeyword,convertToRgb:s.default.keyword.rgb,conversionErrorMessage:n.ErrorHandling.generateInputErrorMessage(r.ColorTypes.KEYWORD,t),addSheen:e.SheenUtil.parseSheenFromOptions(a)})}},m}(),r=function(){if(vt)return rt;vt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.FilterToColor=void 0;const t=function(){if(dt)return it;dt=1;var t=it&&it.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(n,e);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(t,r,i)}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),n=it&&it.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),e=it&&it.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(it,"__esModule",{value:!0}),it.FilterToHex=void 0;const r=y(),i=function(){if(ct)return ot;ct=1;var t=ot&&ot.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(n,e);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(t,r,i)}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),n=ot&&ot.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),e=ot&&ot.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(ot,"__esModule",{value:!0}),ot.FilterToHexBrowser=void 0;const r=y(),i=at();class o extends i.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,n){const e=i.FilterToHexShared.generateInputErrorMessage(t),s=r.ErrorHandling.generateErrorResult(e);return o.cleanup(n),s}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>e(ht())))).toPng(t)}static async convert(t){const{errorMessage:n,svgContainerElement:e}=i.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(n)return o.returnInputError(t,e);const r=await o.getImageBase64ViaSVG(e),s=await i.FilterToHexShared.getColorViaImageDataURL(r);return o.cleanup(e),{color:s}}}return ot.FilterToHexBrowser=o,ot}();return it.FilterToHex=class{static async convert(t,n,o){try{let r;if("undefined"==typeof window){const{FilterToHexNode:n}=await Promise.resolve().then((()=>e(function(){if(ft)return gt;ft=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.FilterToHexNode=void 0;const t=y(),n=w(),e=Q(),r=P(),i=at();class o extends i.FilterToHexShared{static cleanup(t){o.IS_HEADLESS&&(null==t||t.close())}static returnError(n,e){const r=t.ErrorHandling.generateErrorResult(n);return o.cleanup(e),r}static async getImageBase64ViaSVG(t){const n=await t.screenshot({encoding:o.BASE_64_ENCODING});return`${o.ENCODED_DATA_URL_PREFIX}${n}`}static async openBrowserPage(t){const n=await t.newPage();return await n.setViewport({width:o.SVG_SIDE_LENGTH_PX,height:o.SVG_SIDE_LENGTH_PX}),n}static async addSVGAndValidateFilter(n,s){const a=await n.evaluate(i.FilterToHexShared.addSVGElementsToDOMAndValidateFilter,s,o.SVG_SIDE_LENGTH_PX);return a.errorMessage?{errorMessage:t.ErrorHandling.generateInputErrorMessage(r.ColorTypes.FILTER,s,e.ColorFormats.FILTER)}:a}static async getPuppeteerDependency(){try{return f("puppeteer")}catch(t){return{errorMessage:n.MUST_INSTALL_PUPPETEER}}}static async preparePuppeteerBrowser(){const n=await o.getPuppeteerDependency();return t.ErrorHandling.hasError(n)?n:n.launch({headless:o.IS_HEADLESS})}static async convert(n){const e=await o.preparePuppeteerBrowser();if(t.ErrorHandling.hasError(e))return o.returnError(e.errorMessage);const r=await o.openBrowserPage(e),s=await o.addSVGAndValidateFilter(r,n);if(t.ErrorHandling.hasError(s))return o.returnError(s.errorMessage,e);const a=await o.getImageBase64ViaSVG(r),u=await r.evaluate(i.FilterToHexShared.getColorViaImageDataURL,a);return o.cleanup(e),{color:u}}}return gt.FilterToHexNode=o,o.BASE_64_ENCODING="base64",o.ENCODED_DATA_URL_PREFIX=`data:image/png;${o.BASE_64_ENCODING},`,o.IS_HEADLESS=!0,o.SVG_SIDE_LENGTH_PX=2,gt}())));r=await n.convert(t)}else r=await i.FilterToHexBrowser.convert(t);return r.color&&n&&"string"==typeof r.color&&(r.color=n(r.color,o)),r}catch(t){return r.ErrorHandling.generateUnexpectedError(t)}}},it}(),n=function(){if(mt)return wt;mt=1;var t=wt&&wt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.HexToColor=void 0;const n=(bt||(bt=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.ColorFormatter=void 0,yt.ColorFormatter=class{static arrayToRgbString(t){return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}static arrayToHslString(t){return`hsl(${t[0]}deg, ${t[1]}%, ${t[2]}%)`}}),yt),e=t(nt());return wt.HexToColor=class{static convertToRgb(t,r){const i=e.default.hex.rgb(t);return"string"===(null==r?void 0:r.resultType)?n.ColorFormatter.arrayToRgbString(i):i}static convertToHsl(t,r){const i=e.default.hex.hsl(t);return"string"===(null==r?void 0:r.resultType)?n.ColorFormatter.arrayToHslString(i):i}},wt}();return rt.FilterToColor=class{static async filterToHex(n){const e=await t.FilterToHex.convert(n);return e.color&&(e.color=e.color.toUpperCase()),e}static async filterToRgb(e,r){return t.FilterToHex.convert(e,n.HexToColor.convertToRgb,r)}static async filterToHsl(e,r){return t.FilterToHex.convert(e,n.HexToColor.convertToHsl,r)}},rt}();class i{static rgbToFilter(t,n){return e.ColorToFilter.rgbToFilter(t,n)}static hexToFilter(t,n){return e.ColorToFilter.hexToFilter(t,n)}static hslToFilter(t,n){return e.ColorToFilter.hslToFilter(t,n)}static keywordToFilter(t,n){return e.ColorToFilter.keywordToFilter(t,n)}static async filterToHex(t){return r.FilterToColor.filterToHex(t)}static async filterToRgb(t,n){return r.FilterToColor.filterToRgb(t,n)}static async filterToHsl(t,n){return r.FilterToColor.filterToHsl(t,n)}}n.default=i,t.exports=i}(b,b.exports)),b.exports));const kt=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.sliceWidth="30px",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.filter="",this.borderRadius="0px",this.transform="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(i(this.el,this.delayVisible),o(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${Mt.hexToFilter(s(this.filter).toHexString()).color}`)}this.showSpeakIcon&&a(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:c(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:c(this.margin,t),padding:c(this.padding,t),transform:c(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${u(this.src)})`:"none",borderImageSlice:"true"===this.isSlice?`${parseInt(this.sliceWidth)} fill`:"unset",borderImageRepeat:"true"===this.isSlice?"round":"unset",borderImageWidth:"true"===this.isSlice?`${this.sliceWidth}`:"unset",backgroundImage:"true"===this.isSlice?`url(${u(this.src)})`:"none"}}render(){return"true"===this.isSlice?l(h,{class:"slice",id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry}):l(h,{id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},l("img",{class:"lido-image",src:u(this.src),alt:"",style:this.style}))}get el(){return this}static get style(){return".lido-image{user-select:none;-webkit-user-drag:none;object-fit:contain;width:100% !important;height:100% !important;aspect-ratio:1 / 1;transform:rotate(0) !important;margin:0 !important}.slice{background-repeat:no-repeat;background-position:center;background-size:100% 100%}"}},[0,"lido-image",{showSpeakIcon:[4,"show-speak-icon"],id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[8],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],src:[1],isSlice:[1,"is-slice"],sliceWidth:[1,"slice-width"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],margin:[1],padding:[1],filter:[1],borderRadius:[1,"border-radius"],transform:[1],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],style:[32]}]);function jt(){"undefined"!=typeof customElements&&["lido-image"].forEach((t=>{"lido-image"===t&&(customElements.get(n(t))||customElements.define(n(t),kt))}))}jt();export{kt as L,f as c,jt as d}