const PersistentStorage={COUNTER_KEY:"eytd_download_counter",HIGH_QUALITY_COUNTER_KEY:"eytd_hq_download_counter",async getDownloadCounter(){try{const o=parseInt(localStorage.getItem(this.COUNTER_KEY))||0;return console.log(`Retrieved download counter from YouTube localStorage: ${o}`),o}catch(o){return console.error("Error getting download counter from localStorage:",o),0}},async setDownloadCounter(o){try{localStorage.setItem(this.COUNTER_KEY,o.toString())}catch(o){throw console.error("Failed to save download counter to localStorage:",o),o}},async incrementDownloadCounter(){try{const o=await this.getDownloadCounter()+1;return await this.setDownloadCounter(o),o}catch(o){throw console.error("Failed to increment download counter:",o),o}},async getHighQualityDownloadCounter(){try{const o=parseInt(localStorage.getItem(this.HIGH_QUALITY_COUNTER_KEY))||0;return console.log(`Retrieved high-quality download counter from YouTube localStorage: ${o}`),o}catch(o){return console.error("Error getting high-quality download counter from localStorage:",o),0}},async setHighQualityDownloadCounter(o){try{localStorage.setItem(this.HIGH_QUALITY_COUNTER_KEY,o.toString())}catch(o){throw console.error("Failed to save high-quality download counter to localStorage:",o),o}},async incrementHighQualityDownloadCounter(){try{const o=await this.getHighQualityDownloadCounter()+1;return await this.setHighQualityDownloadCounter(o),await this.incrementDownloadCounter(),o}catch(o){throw console.error("Failed to increment high-quality download counter:",o),o}},async isHighQualityLimitExceeded(){try{return await this.getHighQualityDownloadCounter()>=51}catch(o){return console.error("Error checking high-quality download limit:",o),!1}}};