PageSourceSearch

https://billingsapp.io/chunk-SZA4BPA4.js

js billingsapp.io collected 2026-09-24 14:03:25 UTC 5,056 bytes, 1 lines download raw bytes

1import{j as n,o as d}from"./chunk-62Y3KQEK.js";var a=class extends d{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!("Notification"in window)||!Notification.requestPermission)return!1;if(Notification.permission!=="granted")try{new Notification("")}catch(i){if(i instanceof Error&&i.name==="TypeError")return!1}return!0}}getDeliveredNotifications(){return n(this,null,function*(){let i=[];for(let t of this.deliveredNotifications){let e={title:t.title,id:parseInt(t.tag),body:t.body};i.push(e)}return{notifications:i}})}removeDeliveredNotifications(i){return n(this,null,function*(){for(let t of i.notifications){let e=this.deliveredNotifications.find(o=>o.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}})}removeDeliveredNotificationsById(i){return n(this,null,function*(){for(let t of i.ids){let e=this.deliveredNotifications.find(o=>o.tag===String(t));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(o=>o!==e)}})}removeAllDeliveredNotifications(){return n(this,null,function*(){for(let i of this.deliveredNotifications)i.close();this.deliveredNotifications=[]})}getByIds(i){return n(this,null,function*(){let t=i.ids.map(s=>String(s)),e=this.pending.filter(s=>t.includes(String(s.id))),o=this.deliveredNotifications.filter(s=>t.includes(s.tag)).map(s=>this.deliveredToSchema(s));return{notifications:[...e,...o]}})}getAll(i){return n(this,null,function*(){let t=[...this.pending],e=this.deliveredNotifications.map(o=>this.deliveredToSchema(o));return i?.state==="SCHEDULED"?{notifications:t}:i?.state==="TRIGGERED"?{notifications:e}:{notifications:[...t,...e]}})}deliveredToSchema(i){return{title:i.title,id:parseInt(i.tag),body:i.body}}createChannel(){return n(this,null,function*(){throw this.unimplemented("Not implemented on web.")})}deleteChannel(){return n(this,null,function*(){throw this.unimplemented("Not implemented on web.")})}listChannels(){return n(this,null,function*(){throw this.unimplemented("Not implemented on web.")})}schedule(i){return n(this,null,function*(){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");for(let t of i.notifications)this.sendNotification(t);return{notifications:i.notifications.map(t=>({id:t.id}))}})}update(i){return n(this,null,function*(){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");let t=[];for(let e of i.notifications){let o=this.pending.findIndex(s=>s.id===e.id);o!==-1&&(this.pending.splice(o,1),this.sendNotification(e),t.push(e))}return{notifications:t.map(e=>({id:e.id}))}})}getPending(){return n(this,null,function*(){return{notifications:this.pending}})}cancelAll(){return n(this,null,function*(){this.pending=[]})}registerActionTypes(){return n(this,null,function*(){throw this.unimplemented("Not implemented on web.")})}cancel(i){return n(this,null,function*(){this.pending=this.pending.filter(t=>!i.notifications.find(e=>e.id===t.id))})}areEnabled(){return n(this,null,function*(){let{display:i}=yield this.checkPermissions();return{value:i==="granted"}})}changeExactNotificationSetting(){return n(this,null,function*(){throw this.unimplemented("Not implemented on web.")})}checkExactNotificationSetting(){return n(this,null,function*(){throw this.unimplemented("Not implemented on web.")})}requestPermissions(){return n(this,null,function*(){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");return{display:this.transformNotificationPermission(yield Notification.requestPermission())}})}checkPermissions(){return n(this,null,function*(){if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser.");return{display:this.transformNotificationPermission(Notification.permission)}})}transformNotificationPermission(i){switch(i){case"granted":return"granted";case"denied":return"denied";default:return"prompt"}}sendPending(){var i;let t=[],e=new Date().getTime();for(let o of this.pending)!((i=o.schedule)===null||i===void 0)&&i.at&&o.schedule.at.getTime()<=e&&(this.buildNotification(o),t.push(o));this.pending=this.pending.filter(o=>!t.find(s=>
1s===o))}sendNotification(i){var t;if(!((t=i.schedule)===null||t===void 0)&&t.at){let e=i.schedule.at.getTime()-new Date().getTime();this.pending.push(i),setTimeout(()=>{this.sendPending()},e);return}this.buildNotification(i)}buildNotification(i){let t=new Notification(i.title,{body:i.body,tag:String(i.id)});return t.addEventListener("click",this.onClick.bind(this,i),!1),t.addEventListener("show",this.onShow.bind(this,i),!1),t.addEventListener("close",()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(i){let t={actionId:"tap",notification:i};this.notifyListeners("localNotificationActionPerformed",t)}onShow(i){this.notifyListeners("localNotificationReceived",i)}};export{a as LocalNotificationsWeb};

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.