/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
vBulletin.createStorageTools=function(f,l){function g(a){if(!a.loaded){a.loaded=!0;try{var b=localStorage.getItem(f+a.name);if(b)if(b=JSON.parse(b),a.istimed){a.cache.values=b.values||a.cache.values;a.cache.times=b.times||a.cache.times;b=!1;var c=a.cache.values,d=a.cache.times,e;for(e in c)d[e]<a.latest&&(delete c[e],delete d[e],b=!0);b&&h(a)}else a.cache.values=b}catch(n){}}}function h(a){try{var b=f+a.name,c=a.cache;a.istimed||(c=c.values);localStorage.removeItem(b);localStorage.setItem(b,JSON.stringify(c))}catch(d){}}
function k(a,b,c,d){this.loaded=!1;this.name=a;this.cache={values:{},times:{}};if(this.istimed=!!b)this.latest=c,this.current=d}function m(a,b,c=!1,d=!0){let e={};c&&(!0===c&&(c=365),e.expires=c);l.set((d?f:"")+a,b,e)}try{localStorage.removeItem("vbcache-")}catch(a){}k.prototype={get:function(a){g(this);var b=this.cache.values;return b.hasOwnProperty(a)?b[a]:null},getAll:function(){g(this);return this.cache.values},isSet:function(a){g(this);return this.cache.values.hasOwnProperty(a)},set:function(a,
b){g(this);var c=a;$.isPlainObject(a)||(c={},c[a]=b);for(_key in c)this.cache.values[_key]=c[_key],this.istimed&&(this.cache.times[_key]=this.current);h(this)},unset:function(a){g(this);delete this.cache.values[a];delete this.cache.times[a];h(this)},unsetAll:function(){this.cache={values:{},times:{}};localStorage.removeItem(f+this.name)}};return{createStorage:a=>new k(a),createStorageTimed:(a,b,c)=>new k(a,!0,b,c),setCookie:m,getCookie:function(a,b=!0){return l.get((b?f:"")+a)},deleteCookie:(a,b=
!0)=>m(a,"",-1,b)}};
