{"version":3,"sources":["node_modules/@sydle/sydle-ui/dist/collection/utils/elements-interface.js"],"names":["generateAnchorAttributes","component","attributes","href","Object","assign","target","rel","download","keys","length","async","openURL","url","event","router","document","querySelector","preventDefault","push"],"mappings":"AAWO,SAASA,EAAyBC,GACvC,IAAIC,EAAa,GACjBA,EAAaD,EAAUE,KAAOC,OAAOC,OAAOD,OAAOC,OAAO,GAAIH,GAAa,CAAEC,KAAMF,EAAUE,OAAUD,EACvGA,EAAaD,EAAUK,OAASF,OAAOC,OAAOD,OAAOC,OAAO,GAAIH,GAAa,CAAEI,OAAQL,EAAUK,SAAYJ,EAC7GA,EAAaD,EAAUM,IAAMH,OAAOC,OAAOD,OAAOC,OAAO,GAAIH,GAAa,CAAEK,IAAKN,EAAUM,MAASL,EACpGA,EAAaD,EAAUO,SAAWJ,OAAOC,OAAOD,OAAOC,OAAO,GAAIH,GAAa,CAAEM,SAAUP,EAAUO,WAAcN,EACnH,OAAOE,OAAOK,KAAKP,GAAYQ,OAAS,EAAIR,EAAa,KAEpDS,eAAeC,EAAQC,EAAKC,GACjC,GAAID,GAAO,MAAQA,EAAI,KAAO,IAAK,CACjC,MAAME,EAASC,SAASC,cAAc,aACtC,GAAIF,EAAQ,CACV,GAAID,GAAS,KAAM,CACjBA,EAAMI,iBAER,OAAOH,EAAOI,KAAKN,EAAKC,IAG5B,OAAO","sourcesContent":["/**\n * The interfaces in this file are used to make sure our components\n * have the correct properties defined that are needed to pass to\n * the native HTML elements they render\n *\n * Add this @Props\n */\n// /**\n// HTML download attribute\n// */\n// @Prop() download: string | undefined;\nexport function generateAnchorAttributes(component) {\n let attributes = {};\n attributes = component.href ? Object.assign(Object.assign({}, attributes), { href: component.href }) : attributes;\n attributes = component.target ? Object.assign(Object.assign({}, attributes), { target: component.target }) : attributes;\n attributes = component.rel ? Object.assign(Object.assign({}, attributes), { rel: component.rel }) : attributes;\n attributes = component.download ? Object.assign(Object.assign({}, attributes), { download: component.download }) : attributes;\n return Object.keys(attributes).length > 0 ? attributes : null;\n}\nexport async function openURL(url, event) {\n if (url != null && url[0] !== '#') {\n const router = document.querySelector('sy-router');\n if (router) {\n if (event != null) {\n event.preventDefault();\n }\n return router.push(url, event);\n }\n }\n return false;\n}\n"]}