PageSourceSearch

https://hackers.pub/_build/assets/bell-4dOx4qhn.js

js hackers.pub collected 2026-09-25 14:27:29 UTC 3,785 bytes, 2 lines download raw bytes

1import{k as l,e as d,n as p,t as f}from"./routing-DovmCt9U.js";import{r as y}from"./index-C-O8dVjx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.2.0+ab862c4f062287bff017225cca17f40dc8eb2888"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fa703c63-38c8-46a6-83b4-a333d2f8fe60",e._sentryDebugIdIdentifier="sentry-dbid-fa703c63-38c8-46a6-83b4-a333d2f8fe60")}catch{}})();var m=f('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><g fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"></path><path d="m9 12l2 2l4-4">');const k=(e={})=>(()=>{var n=l(m);return d(n,e,!0,!0),p(),n})(),v="loadNotificationsPageQuery";function C(){y(v)}class r extends Error{code;constructor(n,t){super(n,t),this.code=n,this.name="WebPushError"}}const E="hackerspub:web-push-permission-change";function s(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&window.isSecureContext}function I(){return typeof window>"u"||!("Notification"in window)?null:Notification.permission}async function a(){if(!s())throw new r("unsupported");return await navigator.serviceWorker.register("/web-push-sw.js",{scope:"/"})}async function S(){return s()?await(await a()).pushManager.getSubscription():null}async function A(e){if(!s())return null;const t=await(await a()).pushManager.getSubscription();if(t==null)return null;const i=w(e);return b(t,i)?h(t):(await t.unsubscribe(),null)}async function W(e){if(!s())throw new r("unsupported");if(Notification.permission==="denied")throw c(),new r("permission-denied");if(Notification.permission!=="granted"){const o=await Notification.requestPermission();if(c(),o!=="granted")throw new r("permission-dismissed")}const n=await a(),t=w(e);let i=await n.pushManager.getSubscription();return i!=null&&!b(i,t)&&(await i.unsubscribe(),i=null),i=i??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),h(i)}async function T(){const e=await S();if(e==null)return null;const n=e.endpoint;return await e.unsubscribe(),n}function h(e){const n=e.toJSON(),t=n.keys?.p256dh??u(e.getKey("p256dh")),i=n.keys?.auth??u(e.getKey("auth"));if(n.endpoint==null||t==null||i==null)throw new r("incomplete-subscription");return{endpoint:n.endpoint,p256dh:t,auth:i,expirationTime:e.expirationTime==null?null:new Date(e.expirationTime).toISOString()}}function w(e){try{const n="=".repeat((4-e.length%4)%4),t=(e+n).replace(/-/g,"+").replace(/_/g,"/"),i=atob(t);return Uint8Array.from(i,o=>o.charCodeAt(0))}catch(n){throw new r("invalid-vapid-public-key",{cause:n})}}function u(e){if(e==null)return;const n=new Uint8Array(e);let t="";for(const i of n)t+=String.fromCharCode(i);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function b(e,n){const t=e.options.applicationServerKey;if(t==null)return!1;const i=new Uint8Array(t);return i.byteLength!==n.byteLength?!1:i.every((o,g)=>o===n[g])}function c(){window.dispatchEvent(new CustomEvent(E))}var _=f('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M10.268 21a2 2 0 0 0 3.464 0m-10.47-5.674A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326">');const x=(e={})=>(()=>{var n=l(_);return d(n,e,!0,!0),p(),n})();export{k as I,v as N,E as W,s as a,A as b,x as c,r as d,I as g,C as i,W as s,T as u};
2//# sourceMappingURL=bell-4dOx4qhn.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.