"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=a,exports.unregister=b;function a(){"production"===process.env.NODE_ENV&&"serviceWorker"in navigator&&window.addEventListener("load",function(){var a="".concat(process.env.PUBLIC_URL,"/service-worker.js");window.drupalSettings&&window.drupalSettings.api&&window.drupalSettings.api.explorer&&window.drupalSettings.api.explorer.options&&window.drupalSettings.api.explorer.options.explorerDir?a=window.drupalSettings.api.explorer.options.explorerDir+"service-worker.js":window.Drupal.settings&&window.Drupal.settings.api&&window.Drupal.settings.api.explorer&&window.Drupal.settings.api.explorer.options&&window.Drupal.settings.api.explorer.options.explorerDir?a=window.Drupal.settings.api.explorer.options.explorerDir+"service-worker.js":window.apiConnectExplorer&&window.apiConnectExplorer.options&&window.apiConnectExplorer.options.explorerDir&&(a=window.apiConnectExplorer.options.explorerDir+"service-worker.js"),navigator.serviceWorker.register(a).then(function(a){a.onupdatefound=function(){var b=a.installing;b.onstatechange=function(){"installed"===b.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}})["catch"](function(a){console.error("Error during service worker registration:",a)})})}function b(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(a){a.unregister()})}