{"version":3,"file":"dom-rp69_0Cu-chunk.js","sources":["../../../src/utils/dom.js"],"sourcesContent":["export const isDescendant = (parent, child) => {\n\tif (parent === null || child === null) {\n\t\treturn false;\n\t}\n\tlet node = child.parentNode;\n\twhile (node !== null) {\n\t\tif (node === parent) {\n\t\t\treturn true;\n\t\t}\n\t\tnode = node.parentNode;\n\t}\n\treturn false;\n};\n\nexport const triggerEvent = (el, type) => {\n\tlet e;\n\tif (\"createEvent\" in document) {\n\t\t// modern browsers, IE9+\n\t\te = document.createEvent(\"HTMLEvents\");\n\t\te.initEvent(type, false, true);\n\t\tel.dispatchEvent(e);\n\t} else {\n\t\t// IE 8\n\t\te = document.createEventObject();\n\t\te.eventType = type;\n\t\tel.fireEvent(\"on\" + e.eventType, e);\n\t}\n};\n\nexport const setBodyPositionFixed = () => {\n\tif (document.body.style.position) {\n\t\tconst windowScroll = document.body.style.top;\n\t\tdocument.body.style.position = null;\n\t\tdocument.body.style.top = null;\n\t\tdocument.body.style.width = null;\n\t\twindow.scrollTo(0, parseInt(windowScroll || \"0\") * -1);\n\t} else {\n\t\tconst bodyScrollY = window.scrollY;\n\t\tdocument.body.style.position = \"fixed\";\n\t\tdocument.body.style.top = `-${bodyScrollY}px`;\n\t\tdocument.body.style.width = `${window.innerWidth}px`;\n\t}\n};\n"],"names":["isDescendant","parent","child","node","setBodyPositionFixed","windowScroll","bodyScrollY"],"mappings":"AAAY,MAACA,EAAe,CAACC,EAAQC,IAAU,CAC9C,GAAID,IAAW,MAAQC,IAAU,KAChC,MAAO,GAER,IAAIC,EAAOD,EAAM,WACjB,KAAOC,IAAS,MAAM,CACrB,GAAIA,IAASF,EACZ,MAAO,GAERE,EAAOA,EAAK,UACd,CACC,MAAO,EACR,EAiBaC,EAAuB,IAAM,CACzC,GAAI,SAAS,KAAK,MAAM,SAAU,CACjC,MAAMC,EAAe,SAAS,KAAK,MAAM,IACzC,SAAS,KAAK,MAAM,SAAW,KAC/B,SAAS,KAAK,MAAM,IAAM,KAC1B,SAAS,KAAK,MAAM,MAAQ,KAC5B,OAAO,SAAS,EAAG,SAASA,GAAgB,GAAG,EAAI,EAAE,CACvD,KAAQ,CACN,MAAMC,EAAc,OAAO,QAC3B,SAAS,KAAK,MAAM,SAAW,QAC/B,SAAS,KAAK,MAAM,IAAM,IAAIA,CAAW,KACzC,SAAS,KAAK,MAAM,MAAQ,GAAG,OAAO,UAAU,IAClD,CACA"}