{"version":3,"sources":["jsdelivr-header.js","/npm/@simplr-wc/router@7.0.0-rc19/simplr-router.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,WAAc,6BACd,WAAc,6BACd,0BAA6B,8CAC7B,uBAA0B,2CAC1B,6BAAgC,6BAChC,+BAAkC,iCAKpC,MAAM,aAIT,WAAA,CAAY,GACR,QAAgB,IAAZ,EACA,MAAM,MAAM,mDAGhB,KAAK,OAAS,IAAI,OAAO,GACzB,KAAK,OAAS,IAAI,OAAO,KAAK,QAC9B,KAAK,OAAS,GAEd,aAAa,UAAY,IAC7B,CAEA,IAAA,GACI,sBAAsB,WAAW,KAAK,OAAO,iBAC7C,mBAAmB,WAAW,KAAK,OAAO,iBAE1C,KAAK,OAAO,mBACZ,2BAA2B,KAAK,OACpC,CAKA,UAAA,EAAW,KAAE,EAAI,KAAE,EAAI,KAAE,IAErB,IAAI,EAAY,EACZ,EAAY,GAAQ,IACnB,GAAQ,IACT,EAAY,KAAK,OAAO,gBAAgB,GAAM,MAElD,MAAM,EAAe,KAAK,OAAO,iBAAiB,GAClD,KAAK,OAAO,WAAW,yBAAyB,KAAK,GAAe,EAAa,SAAW,EAChG,CAKA,GAAA,CAAI,GACA,KAAK,OAAO,cAAc,EAC9B,CAEA,cAAA,GACI,OAAO,KAAK,OAAO,gBACvB,CAEA,cAAA,GACI,OAAO,KAAK,OAAO,WACvB,EAGJ,aAAa,eAAY,SAElB,MAAM,WAA0E,GACnF,aAAa,UAAU,WAAW,UAC/B,MAAM,eAAiB,IAAM,aAAa,UAAU,wBACpD,MAAM,eAAiB,IAAM,aAAa,UAAU,uBAElD,KAAK,uCACL,KAAK,+BACL,KAAK","file":"/npm/@simplr-wc/router@7.0.0-rc19/simplr-router.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@simplr-wc/router@7.0.0-rc19/simplr-router.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { Config } from './modules/config.js';\nimport { Router } from './modules/router.js';\nimport { SimplrRouterContainer } from './modules/simplr-router-container.js';\nimport { SimplrRouterOutlet } from './modules/simplr-router-outlet.js';\nimport { ForwardsTransitionObject } from './modules/helper.js';\nimport { sendRouterInitializedEvent } from './modules/dispatcher.js';\n\n/**\n * @class SimplrRouter\n * */\nexport class SimplrRouter {\n    /**\n     * @param {import('./types/SimplrRouterOptions.js').SimplrRouterOptions} options\n     */\n    constructor(options) {\n        if (options === undefined) {\n            throw Error('Cannot initialize SimplrRouter without options.');\n        }\n\n        this.config = new Config(options);\n        this.router = new Router(this.config);\n        this.routes = [];\n\n        SimplrRouter._instance = this;\n    }\n\n    init() {\n        SimplrRouterContainer.initialize(this.config.transitionSpeed);\n        SimplrRouterOutlet.initialize(this.config.transitionSpeed);\n\n        this.router.handleUrlPathing();\n        sendRouterInitializedEvent(this.routes);\n    }\n\n    /**\n     * @param {import('./types/Shared.js').ChangeViewObject} changeViewObject\n     * */\n    changeView({ path, name, hash }) {\n        // If name provided instead of path\n        let routePath = path;\n        let routeHash = hash ?? '';\n        if (!path && name) {\n            routePath = this.router.findRouteByName(name).path;\n        }\n        const viewForRoute = this.router.findViewForRoute(routePath);\n        this.router.changeView(ForwardsTransitionObject.from(viewForRoute), viewForRoute.realPath + routeHash);\n    }\n\n    /**\n     * @param {any} middlewareClass\n     */\n    use(middlewareClass) {\n        this.router.addMiddleware(middlewareClass);\n    }\n\n    getBreadcrumbs() {\n        return this.router.getBreadcrumbs();\n    }\n\n    getCurrentView() {\n        return this.router.currentView;\n    }\n}\n\nSimplrRouter._instance = undefined;\n\nexport const changeView = (/** @type {import('./types/Shared.js').ChangeViewObject} */ changeViewObject) =>\n    SimplrRouter._instance.changeView(changeViewObject);\nexport const getBreadcrumbs = () => SimplrRouter._instance.getBreadcrumbs();\nexport const getCurrentView = () => SimplrRouter._instance.getCurrentView();\n\nexport * from './types/SimplrRouterOptions.js';\nexport * from './types/SimplrRoute.js';\nexport * from './types/Shared.js';\n"]}