@bbn/bbn 2.0.21 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/fn/object/range.d.ts +26 -0
- package/dist/fn/object/range.js +28 -0
- package/dist/fn.d.ts +2 -0
- package/dist/fn.js +2 -0
- package/package.json +1 -1
package/dist/bbn.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var bbn=function(e){"use strict";function t(e,...t){let n=bbn.lng[e]||e;if(t.length){let e=0;return n.replace(/\%([d|s])/g,(n,r)=>{let o=t[e++];o||(o="d"===r?0:"");const i=typeof o;return"d"===r&&"number"!==i?(o=parseFloat(o),isNaN(o)&&(o=0)):"s"===r&&"string"!==i&&(o=""+o),o})}return n}var n={loggers:{_num:0},datatypes:["xml","html","script","json","jsonp","text","blob"],shortenLen:30,keys:{upDown:[33,34,35,36,38,40],leftRight:[36,35,37,39],dels:[8,46,45],confirm:[13,9],alt:[20,16,17,18,144],numbers:[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105],numsigns:[109,110,189,190]},comparators:[">=","<=",">","<","="],operators:["+","-","/","*"],tags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],colors:{darkgrey:"#5a6a62",black:"#000000",anthracite:"#454545",grey:"#d3d3d3",white:"#ffffff",beige:"#fdfdfd",lightgrey:"#dcdcdc",pastelblue:"#ddebf6",cyan:"#00c8f8",blue:"#6e9ecf",indigo:"#3f51b5",navy:"#354458",webblue:"#2196f3",teal:"#009688",turquoise:"#1fda9a",pastelgreen:"#e2efda",palegreen:"#ccffcc",green:"#00a03e",olive:"#92b06a",pastelorange:"#fff2cc",yellow:"#fdf200",orange:"#ff9900",pink:"#eb65a0",purple:"#a333c8",red:"#db3340",brown:"#8c6954"},reserved:["abstract","boolean","break","byte","case","catch","char","class","continue","const","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","new","null","package","return","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","while","with"],mockText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",regexp:{url:new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),ip:/^((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/,hostname:/^[a-z\d]([a-z\d-]{0,61}[a-z\d])?(\.[a-z\d]([a-z\d-]{0,61}[a-z\d])?)*$/i}},r={siteTitle:window.document.title,logging:!1,cdn:"",lang:"en",host:window.location.protocol+"//"+window.location.hostname,url:window.location.href,old_path:null,loading:!1,_enumerated:[],get isEnumerating(){return this._enumerated.length>0},width:0,height:0,focused:!1,last_focus:(new Date).getTime(),sleep:!1,theme:"dark",loaders:[],loadersHistory:[],maxLoadersHistory:50,resizeTimer:!1,hashChanged:0,params:[],isInit:!1,isFocused:!1,timeoff:Math.round((new Date).getTime()/1e3),loggingLevel:5,ignoreUnload:!1,historyDisabled:!1,nav:"ajax",online:window.navigator.onLine},o=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};class i extends Error{constructor(e){super(e||"Request canceled"),this.name="Cancel",this.__BBN_CANCEL__=!0}}const s=["POST","PUT","PATCH","DELETE"],a=(e,t,n={},r)=>{const o=new XMLHttpRequest,a=s.includes(e.toUpperCase()),l=new Promise((r,s)=>{o.open(e,t,!0);const{body:l,headers:u}=((e,t)=>{const n=new Headers(t||{});let r=e;return null==e||e instanceof FormData||"object"!=typeof e||(n.set("Content-Type","application/json"),r=JSON.stringify(e)),{body:r,headers:n}})(n.data,n.headers);u.forEach((e,t)=>{o.setRequestHeader(t,e)}),"function"==typeof n.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e=>{const t=e.lengthComputable?e.total:void 0;n.onUploadProgress({loaded:e.loaded,total:t,progress:t?e.loaded/t:void 0})}),o.onreadystatechange=()=>{if(4!==o.readyState)return;const e=(e=>{const t={};return e?(e.trim().split(/[\r\n]+/).forEach(e=>{const n=e.split(": "),r=n.shift(),o=n.join(": ");r&&(t[r.toLowerCase()]=o)}),t):t})(o.getAllResponseHeaders()),t=1223===o.status?204:o.status,i=o.statusText||"";let a=o.responseText;if((e["content-type"]||"").includes("application/json"))try{a=JSON.parse(o.responseText)}catch(e){}const l={data:a,status:t,statusText:i,headers:e,config:n,request:o};if(t>=200&&t<300)r(l);else{const e=new Error("Request failed with status code "+t);e.response=l,e.config=n,e.request=o,s(e)}},o.onerror=()=>{const e=new Error("Network Error");e.config=n,e.request=o,s(e)},o.onabort=()=>{s(new i("Request canceled"))},a?o.send(l):o.send()});return l.cancel=()=>o.abort(),l};var l={isCancel:e=>!(!e||!0!==e.__BBN_CANCEL__),run:(e,t,n={},r)=>{n.baseURL&&!/^https?:\/\//i.test(t)&&(t=n.baseURL.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")),t=((e,t)=>{if(!t)return e;const n=new URLSearchParams(t).toString();return n?e+(e.includes("?")?"&":"?")+n:e})(t,n.params);return"function"==typeof n.onUploadProgress&&s.includes(e.toUpperCase())?a(e,t,n):((e,t,n={},r)=>{const a={method:e,headers:new Headers(n.headers||{}),signal:null==r?void 0:r.signal},l=s.includes(e.toUpperCase());if(null!=n.data&&l&&(bbn.fn.log("DATA",n.data),"object"!=typeof n.data||n.data instanceof FormData?a.body=n.data:(a.headers.set("Content-Type","application/json"),a.body=JSON.stringify(n.data))),n.params){const e=new URLSearchParams(n.params).toString();t+=(t.includes("?")?"&":"?")+e}const u=fetch(t,a).then(e=>o(void 0,void 0,void 0,function*(){let t;t=(e.headers.get("content-type")||"").includes("application/json")?yield e.json():yield e.text();const r={data:t,status:e.status,statusText:e.statusText,headers:Object.fromEntries(e.headers.entries()),config:n,request:e};if(!e.ok){const t=new Error("Request failed with status code "+e.status);throw t.response=r,t.config=n,t.request=e,t}return r})).catch(e=>{if("AbortError"===e.name)throw new i("Request canceled");throw e});return u.cancel=()=>r.abort(),u})(e,t,n,r)}};function u(...e){if(!e.length)return!1;for(let t of e)if(["boolean","object","symbol"].includes(typeof t)||""===t||isNaN(t))return!1;return!0}function c(...e){if(!e.length)return!1;for(let t of e)if(!t||"object"!=typeof t||!(Symbol.iterator in Object(t)))return!1;return!0}function f(...e){if(!e.length)return!1;for(let t of e)if("[object String]"!=={}.toString.apply(t))return!1;return!0}function d(...e){if(!e.length)return!1;for(let t of e)if(!Number.isInteger(t))return!1;return!0}function h(...e){if(!e.length)return!1;for(let t of e)if(!(t&&t.constructor&&t.call&&t.apply))return!1;return!0}function b(...e){var t,n,r;if((null===(t=bbn.env)||void 0===t?void 0:t.isDev)&&void 0!==(null===window||void 0===window?void 0:window.console)){let t,o=5,i="log";e[0]&&"object"==typeof e[0]&&e[0]._bbn_console_style&&(e[0]._bbn_console_mode&&h(console[e[0]._bbn_console_mode])?i=e[0]._bbn_console_mode:(t=e[0]._bbn_console_style,o=e[0]._bbn_console_level),e.shift());const s=window.console[i];if((null===(r=null===(n=window.bbn)||void 0===n?void 0:n.env)||void 0===r?void 0:r.loggingLevel)>=o){let n=0;for(;n<e.length;){let r=typeof e[n],o=[e[n]];"string"!==r&&"number"!==r||o.unshift("%c %s ",t),s.apply(window.console,o),n++}}}return this}function m(e,t,n){if(!f(e)||!d(t))throw b(arguments),new Error(bbn._("The substr function should be applied to a string and at least a `from` argument should be given"));return t<0&&(t=e.length+t),d(n)?e.substring(t,(n<0?e.length:t)+n):e.substring(t)}function p(e,t=!1){let n=null;if("object"==typeof e)for(var r in n={},e)m(r,0,1).match(/^[A-z0-9]$/)&&r in e&&(t&&"object"==typeof e[r]?n[r]=p(e[r],!0):n[r]=e[r]);return n||!1}function g(e,t,n=!1,r=!1){if(null!==e&&"object"==typeof e){let o=Object.keys(n?p(e):e);r&&o.reverse();for(let n of o)if(!1===t(e[n],n))break}return e}function y(e,t){if(!(u(e)&&e>0)){if(c(e)){for(let n=0;n<e.length;n++)if(!1===t(e[n],n))return;return e}return g(e,t)}for(let n=0;n<e;n++)if(!1===t(n,n))return}function w(...e){if(!e.length)return!1;for(let t of e)if("[object Object]"!=={}.toString.apply(t))return!1;return!0}function v(...e){if(!e.length)return!1;for(let t of e)if(!Array.isArray(t))return!1;return!0}function _(...e){let t=!1,n=[];for(let r=0;r<e.length;r++)if(!0===e[r])t=!0;else{if(!e[r])continue;if("object"!=typeof e[r])throw new Error(bbn._("Error in extend: all arguments should be object, you have given ")+typeof e[r]);n.push(e[r])}if(!n.length)throw new Error("No argument given");let r,o=n[0];for(let e=1;e<n.length;e++)g(n[e],(e,n)=>{t?v(e)?(o[n]=v(o[n])?o[n]:[],y(e,(e,t)=>{if(e&&"object"==typeof e){let r=o[n][t];v(e)?v(r)||(r=[]):w(r)||(r={}),o[n][t]=_(!0,r,e)}else o[n][t]=e})):w(e)?o[n]=_(!0,o[n]&&"object"==typeof o[n]?o[n]:Object.create(Object.getPrototypeOf(e)),e):o[n]=e:(o[n]!==e||void 0===e&&!Object.prototype.hasOwnProperty.apply(o,[n]))&&(o[n]=e)}),r||(r=!!n[e].__bbnNoData);return r&&"bbnData"in window&&(o.__bbnData&&o.__bbnData.unset(),Object.defineProperty(o,"__bbnNoData",{value:!0,enumerable:!1,configurable:!1,writable:!1})),o}const E=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB,S=(e,t)=>{if(null==t?void 0:t.length){let n={};return g(e,(e,r)=>{t.indexOf(r)>-1&&(n[r]=e)}),n}return e},x=function(e){const n=k._connections[e],r=k._structures[e];let o=null;const i=(e,t)=>{e.onerror=()=>{o=e.error,b(e.error),t(e.error)}},s=(e,t)=>{const r=n.transaction([e],0===t.toLowerCase().indexOf("r")?"readonly":"readwrite");return r.onabort=()=>{throw o=r.error,new Error(r.error)},[r,r.objectStore(e)]};this.lastError=()=>o,this.insert=(e,t)=>(Array.isArray(t)||(t=[t]),new Promise(n=>{const[r,o]=s(e,"w");let i=t.length;y(t,e=>{const t=o.put(e);t.onerror=()=>{b(t.error),i--}}),r.oncomplete=()=>{n(i)}})),this.update=(e,n,o,a)=>new Promise(l=>{this.selectAll(e,[],o).then(o=>{if(!o.length)return void l(0);const[u,c]=s(e,"w"),f=r[e],d=f.keys.PRIMARY.columns.length>1?f.keys.PRIMARY.columns:f.keys.PRIMARY.columns[0];let h=0;for(let e=0;e<o.length;e++){const r=_({},a?{[d]:o[e][d]}:o[e],n);if(!r[d])throw new Error(t("No primary key in the data"));const s=c.put(r);i(s,l),s.onsuccess=()=>{h++}}u.oncomplete=()=>{l(h)}})}),this.delete=(e,n)=>new Promise(o=>{const[a,l]=s(e,"w"),u=r[e],c=u.keys.PRIMARY.columns.length>1?u.keys.PRIMARY.columns:u.keys.PRIMARY.columns[0];if(!n[c])throw new Error(t("No "));const f=l.delete(n[c]);i(f,o),a.oncomplete=()=>{o(1)}}),this.selectOne=(e,t,n,r,o,i)=>new Promise(i=>{this.selectAll(e,[t],n,r,o,1).then(e=>{var n,r;i(null!==(r=null===(n=null==e?void 0:e[0])||void 0===n?void 0:n[t])&&void 0!==r?r:void 0)})}),this.select=(e,t,n,r,o)=>new Promise(i=>{this.selectAll(e,t,n,r,o,1).then(e=>{i(e.length?e[0]:null)})}),this.selectAll=(e,t=[],n=null,o=null,a=0,l=null)=>new Promise(o=>{const[u,c]=s(e,"r"),f=r[e],d=f.keys.PRIMARY.columns.length>1?f.keys.PRIMARY.columns:f.keys.PRIMARY.columns[0],h=w(n)?Object.keys(n)[0]:!n||v(n)?null:d,b=[];if(h===d)if(bbn.fn.isArray(null==n?void 0:n[d])){const e=Math.min(n[d].length,l||9999999);for(let r=a||0;r<e;r++){let s=c.get(n[d][r]);s.onsuccess=()=>{let n=s.result;b.push(S(n,t)),b.length===e&&o(b)},i(s,o)}}else{let e=c.get((null==n?void 0:n[d])||n);e.onsuccess=()=>{let n=e.result;b.push(S(n,t)),o(b)},i(e,o)}else{const e=c.openCursor();let r=0;e.onsuccess=e=>{const i=e.target.result;i?(n&&bbn.fn.search([i.value],n)||(r>=a&&(b.push(S(i.value,t)),b.length===l&&o(b)),r++),i.continue()):o(b)},i(e,o)}}),this.getColumnValues=(e,t,r,o,i,s)=>new Promise(t=>{n.transaction([e],"read").objectStore(e)}),this.copyTable=(o,i,s=[],a=null,l=null,u=0,c=null)=>new Promise(f=>{if(n.objectStoreNames.contains(o)||k.add(e,o,r[i]),!n.objectStoreNames.contains(o))throw f(0),new Error(t("The target table %s does not exist",o));this.selectAll(i,s,a,l,u,c).then(e=>{e.length?this.insert(o,e).then(e=>{f(e)}):f(0)})}),this.deleteTable=e=>new Promise(t=>{n.deleteObjectStore(e),t(!0)})},k={_structures:{},_connections:{},_stores:{},ok:void 0!==E,updateStructure(e,t,n){const r=t.keys.PRIMARY.columns.length>1?t.keys.PRIMARY.columns:t.keys.PRIMARY.columns[0];if(!n.objectStoreNames.contains(e)){const o=n.createObjectStore(e,{keyPath:r});g(t.keys,(e,t)=>{"PRIMARY"!==t&&o.createIndex(t,e.columns.length>1?e.columns:e.columns[0],{unique:!!e.unique})})}},open(e){return new Promise(n=>{if(k._connections[e])n(new x(e));else{if(!k._structures[e])throw new Error(t("Impossible to find a structure for the database %s",e));let r=Math.max.apply(this,[1].concat(Object.keys(k._structures[e]).map(t=>k._structures[e][t].num||1)));const o=E.open(e,r);o.onupgradeneeded=()=>{const t=o.result;g(k._structures[e],(e,n)=>{this.updateStructure(n,e,t)})},o.onsuccess=()=>{k._connections[e]=o.result;let t=new x(e);n(t)}}})},add(e,n,r){var o;if(!(null===(o=null==r?void 0:r.keys)||void 0===o?void 0:o.PRIMARY)||!(null==r?void 0:r.fields))throw new Error(t("The database structure for %s is not valid (are there keys and field? Is there a primary?",n));k._structures[e]||(k._structures[e]={}),k._structures[e][n]=r,k._connections[e]&&this.updateStructure(n,r,k._connections[e])}};function A(e,t,n){let r=(new Date).getTime(),o={key:e,url:m(e,0,e.length-33),loader:t,aborter:n,loading:!0,error:!1,abort:!1,errorMessage:!1,success:!1,start:r};bbn.env.loaders.push(o),bbn.env.loadersHistory.unshift(o);let i=bbn.env.loadersHistory.length;for(;i&&bbn.env.loadersHistory.length>bbn.env.maxLoadersHistory;)i--,bbn.env.loading||bbn.env.loadersHistory.splice(i,1);return r}function I(e,...t){if("object"==typeof e){const n=[];return 1===t.length&&"string"==typeof t[0]?n.push(...t[0].split(".")):n.push(...t),n.reduce((e,t)=>{if(e)return e[e instanceof Array?parseInt(t):t]},e)}}function O(e){if(!f(e)){if(!e.toString)throw b(e),new Error(bbn._("removeAccent expects a string"));e=e.toString()}return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function T(...e){if(!e.length)return!1;for(let t of e)if("[object Date]"!=={}.toString.apply(t))return!1;return!0}function j(e,t,n,r="asc"){let o=I(e,n),i=I(t,n),s=(typeof o).toLowerCase(),a=(typeof i).toLowerCase();if("asc"!==r&&f(r)&&"desc"===r.toLowerCase()&&(r="desc"),s!==a)o=s,i=a;else switch(s){case"string":o=O(o).toLowerCase(),i=O(i).toLowerCase();break;case"boolean":o=o?1:0,i=i?1:0;break;case"object":T(o)&&(o=o.getTime(),i=T(i)?i.getTime():0)}return o<i?"desc"===r?1:-1:o>i?"desc"===r?-1:1:0}function D(e){return e&&"object"==typeof e?Object.keys(e).length:0}function C(e){return!e||(v(e)?!e.length:"object"==typeof e&&!D(e))}function M(...e){if(!e.length)return!1;for(let t of e)if("[object Null]"!=={}.toString.apply(t))return!1;return!0}function L(e){let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return Math.abs(t).toString(16)}function F(e){let t=0;for(let n=0;n<e.length;n++){t=e.charCodeAt(n)+(t<<6)+(t<<16)-t,t|=0}return Math.abs(t).toString(16)}function R(e){return L(e).padStart(8,"0")+F(e).padStart(8,"0")}function N(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof HTMLElement))return!1;return!0}function P(e){let t="",n=e;if(e.id)return"#"+e.id;for(;n&&n!==document.body;){let e=n,r=e.localName,o=0;if(!r)break;if(e===document.body)break;e.id&&(t="#"+e.id+">"+t,o=1);let i=n.parentNode,s=Array.from(i.children).filter(t=>t.tagName===e.tagName);if(!o&&s.length>1){let t=Array.from(i.children).indexOf(e)+1;t>1&&(r+=":nth-child("+t+")")}t=r+(t?">"+t:""),n=i}return t}function B(...e){var t;if(!e.length)return!1;if(!("cp"in bbn)||!("isComponent"in bbn.cp)||"function"!=typeof bbn.cp.isComponent)return!1;for(let n of e){if(!bbn.cp.isComponent(n)||N(n)||!(null===(t=n.$el)||void 0===t?void 0:t.bbnCid))return!1}return!0}function H(e,t=null,n=0,r=null,o=null){if(n||r||(r=new WeakSet),void 0===e)e="__BBN_UNDEFINED__";else if(null===e)e="__BBN_NULL__";else if(null===e)e="__BBN_NULL__";else if("function"==typeof e)e="__BBN_FUNCTION__"+e.toString();else if("symbol"==typeof e)e="__BBN_SYMBOL__"+e.toString();else if("string"==typeof e)e="__BBN_STRING__"+e;else if("number"==typeof e)e="__BBN_NUMBER__"+e.toString();else if("boolean"==typeof e)e="__BBN_BOOLEAN__"+e.toString();else if([void 0,Object,Array,null].includes(null==e?void 0:e.constructor)){if(bbn.fn.isArray(e))if(r.has(e)||t&&t<n)e="__BBN_ARRAY__"+e.constructor.toString();else{r.add(e);let i="";for(let s=0;s<e.length;s++)i+="__BBN_ITEM"+s.toString()+"__"+o(e[s],t,n+1,r,o);e="__BBN_ARRAY__"+i}else if("object"==typeof e)if(r.has(e)||t&&t<n)e="__BBN_OBJECT__"+(e.constructor?e.constructor.toString():"");else{r.add(e);let i="";for(let s in e){let a=s;"string"!=typeof a&&(a=o(a,o,1,1)),i+="__BBN_PROP_"+a+"__"+o(e[s],t,n+1,r,o)}e="__BBN_OBJECT__"+i}}else e=N(e)?B(e)?"__BBN_CP__"+e.$cid:e.bbnId?"__BBN_DOM__"+e.tagName+"/"+e.bbnId+e.bbnHash:"__BBN_DOM__"+P(e):"__BBN_UNKNOWN_OBJECT__"+e.constructor.toString();return e}function Y(...e){let t="",n=null;2===e.length&&"number"==typeof e[1]&&(n=e[1],e=[e[0]]);for(let r in e)t+=H(e[r],n,0,null,H);return R(t)}function U(e){var t="0123456789abcdef";function n(e){var n,r="";for(n=0;n<=3;n++)r+=t.charAt(e>>8*n+4&15)+t.charAt(e>>8*n&15);return r}function r(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t,n,o,i,s){return r(function(e,t){return e<<t|e>>>32-t}(r(r(t,e),r(o,s)),i),n)}function i(e,t,n,r,i,s,a){return o(t&n|~t&r,e,t,i,s,a)}function s(e,t,n,r,i,s,a){return o(t&r|n&~r,e,t,i,s,a)}function a(e,t,n,r,i,s,a){return o(t^n^r,e,t,i,s,a)}function l(e,t,n,r,i,s,a){return o(n^(t|~r),e,t,i,s,a)}var u,c,f,d,h,b=function(e){var t,n=1+(e.length+8>>6),r=new Array(16*n);for(t=0;t<16*n;t++)r[t]=0;for(t=0;t<e.length;t++)r[t>>2]|=e.charCodeAt(t)<<t%4*8;return r[t>>2]|=128<<t%4*8,r[16*n-2]=8*e.length,r}(e),m=1732584193,p=-271733879,g=-1732584194,y=271733878;for(u=0;u<b.length;u+=16)c=m,f=p,d=g,h=y,m=i(m,p,g,y,b[u+0],7,-680876936),y=i(y,m,p,g,b[u+1],12,-389564586),g=i(g,y,m,p,b[u+2],17,606105819),p=i(p,g,y,m,b[u+3],22,-1044525330),m=i(m,p,g,y,b[u+4],7,-176418897),y=i(y,m,p,g,b[u+5],12,1200080426),g=i(g,y,m,p,b[u+6],17,-1473231341),p=i(p,g,y,m,b[u+7],22,-45705983),m=i(m,p,g,y,b[u+8],7,1770035416),y=i(y,m,p,g,b[u+9],12,-1958414417),g=i(g,y,m,p,b[u+10],17,-42063),p=i(p,g,y,m,b[u+11],22,-1990404162),m=i(m,p,g,y,b[u+12],7,1804603682),y=i(y,m,p,g,b[u+13],12,-40341101),g=i(g,y,m,p,b[u+14],17,-1502002290),m=s(m,p=i(p,g,y,m,b[u+15],22,1236535329),g,y,b[u+1],5,-165796510),y=s(y,m,p,g,b[u+6],9,-1069501632),g=s(g,y,m,p,b[u+11],14,643717713),p=s(p,g,y,m,b[u+0],20,-373897302),m=s(m,p,g,y,b[u+5],5,-701558691),y=s(y,m,p,g,b[u+10],9,38016083),g=s(g,y,m,p,b[u+15],14,-660478335),p=s(p,g,y,m,b[u+4],20,-405537848),m=s(m,p,g,y,b[u+9],5,568446438),y=s(y,m,p,g,b[u+14],9,-1019803690),g=s(g,y,m,p,b[u+3],14,-187363961),p=s(p,g,y,m,b[u+8],20,1163531501),m=s(m,p,g,y,b[u+13],5,-1444681467),y=s(y,m,p,g,b[u+2],9,-51403784),g=s(g,y,m,p,b[u+7],14,1735328473),m=a(m,p=s(p,g,y,m,b[u+12],20,-1926607734),g,y,b[u+5],4,-378558),y=a(y,m,p,g,b[u+8],11,-2022574463),g=a(g,y,m,p,b[u+11],16,1839030562),p=a(p,g,y,m,b[u+14],23,-35309556),m=a(m,p,g,y,b[u+1],4,-1530992060),y=a(y,m,p,g,b[u+4],11,1272893353),g=a(g,y,m,p,b[u+7],16,-155497632),p=a(p,g,y,m,b[u+10],23,-1094730640),m=a(m,p,g,y,b[u+13],4,681279174),y=a(y,m,p,g,b[u+0],11,-358537222),g=a(g,y,m,p,b[u+3],16,-722521979),p=a(p,g,y,m,b[u+6],23,76029189),m=a(m,p,g,y,b[u+9],4,-640364487),y=a(y,m,p,g,b[u+12],11,-421815835),g=a(g,y,m,p,b[u+15],16,530742520),m=l(m,p=a(p,g,y,m,b[u+2],23,-995338651),g,y,b[u+0],6,-198630844),y=l(y,m,p,g,b[u+7],10,1126891415),g=l(g,y,m,p,b[u+14],15,-1416354905),p=l(p,g,y,m,b[u+5],21,-57434055),m=l(m,p,g,y,b[u+12],6,1700485571),y=l(y,m,p,g,b[u+3],10,-1894986606),g=l(g,y,m,p,b[u+10],15,-1051523),p=l(p,g,y,m,b[u+1],21,-2054922799),m=l(m,p,g,y,b[u+8],6,1873313359),y=l(y,m,p,g,b[u+15],10,-30611744),g=l(g,y,m,p,b[u+6],15,-1560198380),p=l(p,g,y,m,b[u+13],21,1309151649),m=l(m,p,g,y,b[u+4],6,-145523070),y=l(y,m,p,g,b[u+11],10,-1120210379),g=l(g,y,m,p,b[u+2],15,718787259),p=l(p,g,y,m,b[u+9],21,-343485551),m=r(m,c),p=r(p,f),g=r(g,d),y=r(y,h);return n(m)+n(p)+n(g)+n(y)}function W(e){const t="function"==typeof e?e.toString():e;if("string"!=typeof t)throw Error("Unexpected type "+typeof e+" while parsing function");let n,r="",o=!1,i=!1,s=!1,a="",l=0,u=0,c=[],f={},d="",h=['"',"'","`"],b=!1,m=!1,p=!1,g=!1,y=!1,w=!1,v="";for(let e=0;e<t.length;e++)if(p||"/"!==t[e]||"*"!==t[e+1])if("/"===t[e]&&"*"===t[e-1])p=!1;else if(g||"/"!==t[e]||"/"!==t[e+1])if("\n"===t[e])g=!1;else{if(p||g)continue;if(t[e]===d&&!b&&d)d="",r+=t[e];else if(d)b="\\"===t[e]&&!b,r+=t[e];else if(h.includes(t[e])&&!b)d=t[e],r+=t[e];else if("("===t[e]){if(l++,""!==r.trim()){if("function"===r.trim())s=!0;else if("async"!==r.trim()){a=r.trim();let e=a.match(/^([a-zA-Z0-9_]+)<[a-zA-Z0-9_]+>$/);e&&(a=e[1])}r=""}}else if(")"===t[e])l===u+1&&(m?(f.default=r.trim(),m=!1):r&&(f.name=r.trim()),(f.name||f.default)&&(c.push(f),f={}),r=""),u++;else if(y&&"}"!==t[e])r+=t[e];else{if(l&&l===u&&":"===t[e]){const r=t.substring(e+1).trim().match(/^\s*([a-zA-Z0-9_]+)\s*\{/);if(!r)throw Error("Unexpected ':' while parsing function");v=r[1],n=t.substring(e+r[0].length).trim();break}if(!(r||"="!==t[e]||">"!==t[e+1]||l!==u||u||o)){f.name=t.slice(0,e).trim(),c.push(f),f={},o=!0,n=bbn.fn.substr(t,e+2).trim();break}if(l===u&&"="===t[e]&&">"===t[e+1]){""!==r.trim()&&(f.name=r.trim(),c.push(f),f={},r=""),o=!0,e++;continue}if("="===t[e]&&l>u&&!m)f.name=r.trim(),r="",m=!0;else if(","===t[e])if(y)r+=t[e];else{if(!(l>u))throw Error("Unexpected ',' while parsing function");m?(f.default=r.trim(),m=!1):r&&(f.name=r.trim()),(f.name||f.default)&&(c.push(f),f={}),r=""}else if("{"===t[e]||"}"===t[e]){if(l===u){n=t.substring(e).trim();break}l>u?"{"!==t[e]||y?"}"===t[e]&&y&&(y=!1,r+=t[e]):(y=!0,r=t[e]):r=""}else{if(o){n=t.substring(t.indexOf("=>")+2).trim();break}" "===t[e]?""!==r.trim()&&("async"===r.trim()&&(i=!0),l>u?r+=t[e]:r=""):r+=t[e]}}}else g=!0,r="";else p=!0,r="";if(!n){if(!o)throw Error("Unexpected end of function while parsing function");n=r}n.substr(0,25).indexOf("[native code]")>-1&&(w=!0);const _=c.map(e=>e.name+(e.default?" = "+e.default:"")).join(", ");return{body:n,args:c,argString:_,isArrow:o,hasFunction:s,name:a,isAsync:i,isBinary:w,hash:U(n+(a?"-"+a:"")+(_?"-"+_:"")),returnType:v}}function q(e,t,n){if(n||(n=[]),e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(![void 0,Object,Array,null].includes(null==e?void 0:e.constructor)||![void 0,Object,Array,null].includes(null==t?void 0:t.constructor))return!1;let r=Object.keys(e).sort(),o=Object.keys(t).sort();if(Y(r)!==Y(o))return!1;let i=!0;if(e&&"object"==typeof e){if(n.includes(e))return i;n.push(e)}return y(r,n=>{if(!q(e[n],t[n]))return i=!1,!1}),i}if(e&&t&&"function"==typeof e&&"function"==typeof t){let n=W(e),r=W(t),o=n.hash===r.hash;return o&&n.isBinary&&(o=!1),o}return!1}function z(e,t,n){switch(n){case"===":case"=":case"equal":case"eq":case"is":return e===t;case"!==":case"notequal":case"neq":case"isnot":return e!==t;case"!=":case"different":return e!=t;case"contains":case"contain":case"icontains":case"icontain":return!C(e)&&!C(t)&&-1!==O(e).toLowerCase().indexOf(O(t).toLowerCase());case"doesnotcontain":case"donotcontain":return!(!M(e)&&!M(t))||-1===O(e.toLowerCase()).indexOf(O(t.toLowerCase()));case"starts":case"start":return!M(e)&&!M(t)&&("string"!=typeof e&&(e=e.toString()||""),"string"!=typeof t&&(t=t.toString()||""),0===e.indexOf(t));case"startswith":case"startsi":case"starti":case"istarts":case"istart":return!M(e)&&!M(t)&&0===O(e).toLowerCase().indexOf(O(t).toLowerCase());case"endswith":case"endsi":case"endi":case"iends":case"iend":return!M(e)&&!M(t)&&e.lastIndexOf(t)===e.length-t.length;case"like":return!M(e)&&!M(t)&&O(e).toLowerCase()===O(t).toLowerCase();case"gt":case">":return e>t;case"gte":case">=":return e>=t;case"lt":case"<":return e<t;case"lte":case"<=":return e<=t;case"isnull":return null===e;case"isnotnull":return null!==e;case"isempty":return""===e;case"isnotempty":return""!==e;case"==":if(w(e,t))return q(e,t);default:return e==t}}function $(e,t){if(!t.conditions||!t.logic||!v(t.conditions))throw new Error("Error in compareConditions: the filter should an abject with conditions and logic properties and conditions should be an array of objects");let n="AND"===t.logic;return y(t.conditions,r=>{let o;if(r.conditions&&v(r.conditions))o=$(e,r);else if(o=z(I(e,r.field),r.value,r.operator),o){let t=r.field.split("."),n=t.pop();t.length&&y(t,t=>e=e[t]),void 0===I(e,n)&&void 0!==r.value&&(o=!1)}if(o){if("OR"===t.logic)return n=!0,!1}else if("AND"===t.logic)return n=!1,!1}),n}function V(e,t="="){if(!w(e))throw new Error("Error in filterToCondition: filter must be an object");if(!e.conditions||!v(e.conditions)){let n=[];g(e,(e,r)=>{w(e)&&"object"==typeof e.conditions?n.push(V(e)):n.push({field:r,operator:t,value:e})}),e={conditions:n}}return e.logic||(e.logic="AND"),e}function J(e,t,n=null,r="=",o=0,i=!1){if(!c(e))throw new Error(bbn._("The first argument for a search should be iterable")+" "+typeof e+" "+bbn._("given"));if(!e.length)return-1;let s,a,l=!1;if(t)if("string"==typeof t)s={conditions:[{field:t,value:n,operator:r||"="}]};else if(i=!0===r,o="number"==typeof n?n:i?e.length-1:0,"function"==typeof t)l=!0,a=t;else if(w(t))if("field"in t&&"value"in t)s={conditions:[t],logic:"AND"};else if("conditions"in t)s=t;else{const e=[];for(let n in t)e.push({field:n,value:t[n],operator:"="});s={conditions:e,logic:"AND"}}else v(t)&&(s={conditions:t,logic:"AND"});else l=!0,a=e=>$({value:e},V({logic:"AND",conditions:[{field:"value",operator:r||"=",value:n}]}));if(l||s){if("number"!=typeof o&&(o=i?e.length-1:0),!a){const e=V(s);a=t=>$(t,e)}if(i)for(let t=o;t>=0;t--){if(bbn.env._enumerated.push(!0),a(e[t]))return bbn.env._enumerated.pop(),e[t],t;bbn.env._enumerated.pop()}else for(let t=o;t<e.length;t++){if(bbn.env._enumerated.push(!0),a(e[t]))return bbn.env._enumerated.pop(),e[t],t;bbn.env._enumerated.pop()}}return-1}function Z(e,t,n=null,r="=",o=0,i=!1,s=!1){let a=J(e,t,n,r,o,i);return a>-1?e[a]:t&&["object","function"].includes(typeof t)&&5 in arguments?i:s}function K(e,t=null,n=!1){let r=J(bbn.env.loaders,{key:e});if(r>-1){let o=bbn.env.loaders.splice(r,1)[0],i=Z(bbn.env.loadersHistory,{key:e,start:o.start});return i&&(i.loading=!1,i.duration=(new Date).getTime()-o.start,"string"==typeof t?(i.errorMessage=t,i.error=!n,i.abort=n):w(t)&&(i.success=!0)),!0}return!1}function X(e){let t=J(bbn.env.loaders,{key:e});return t>-1?bbn.env.loaders[t]:null}function G(e,t,n=null,r="=",o=0){if(!v(e))try{e=Array.from(e)}catch(t){throw bbn.fn.log("NOT ARRAY",e),new Error("Error in filter: The first argument must be an array")}let i={};const s=[],a="function"==typeof t;if(!t||!e.length)return e;if("object"==typeof t)i=t;else if("string"==typeof t)i[t]=n;else if(!a)throw new Error("Search function error: The prop argument should be a string or an object");let l;l="function"==typeof t?t:(e,t)=>$(e,i);for(let t=0;t<e.length&&(bbn.env._enumerated.push(!0),!(l(e[t],t)&&(bbn.env._enumerated.pop(),s.push(e[t]),bbn.env._enumerated.push(!0),o&&s.length>=o)));t++)bbn.env._enumerated.pop();return s}function Q(e){if(D(e)){bbn.var.colors||(bbn.var.colors={});let t=document.createElement("style");document.head.appendChild(t);let n=t.sheet,r=0;g(e,(e,t)=>{bbn.var.colors[t]=e,n.insertRule(".bbn-"+t+", .bbn-color-text-"+t+" {color: "+e+" !important;}",r),n.insertRule("svg.bbn-"+t+", .bbn-"+t+" svg, svg.bbn-color-text-"+t+", .bbn-color-text-"+t+" svg {fill: "+e+";}",r),n.insertRule(".bbn-bg-"+t+", .bbn-color-bg-"+t+", .bbn-color-background-"+t+" {background-color: "+e+" !important;}",r),n.insertRule(".bbn-border-"+t+", .bbn-color-border-"+t+" {border-color: "+e+" !important;}",r),n.insertRule(".bbn-color-"+t+" {border-color: "+e+"; background-color: "+e+"; color: "+e+";}",r)})}}function ee(e,t=null,n=""){if(e&&"FORM"===e.tagName){let r=(t,n)=>{let r=document.createElement("input");r.setAttribute("type","hidden"),r.setAttribute("name",t),r.setAttribute("value",n),e.appendChild(r)};t=JSON.parse(JSON.stringify(t||{})),n=n||"",t&&g(t,(t,o)=>{let i=n?`${n}[${o}]`:o;t instanceof Date?r(i,t.toISOString()):t instanceof Array?t.forEach((t,n)=>{const o=`${i}[${n}]`;"object"==typeof t?ee(e,t,o):r(o,t.toString())}):"object"!=typeof t||t instanceof File?r(i,t.toString()):ee(e,t,i)})}}function te(e,t){let n=0;y(t,t=>{t.style[e]="auto"}),y(t,(t,r)=>{let o=t.getBoundingClientRect(),i=o[e]%1?o[e]-o[e]%1+1:o[e];i>n&&(n=i)}),y(t,(t,r)=>{n&&(t.style[e]=n+"px")})}function ne(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function re(e,t,n,r=""){return n.toString().replace(w(e)?e:new RegExp(ne(e),"g"+r),t)}function oe(e,t,n){let r={};return t&&g(t,(e,t)=>{-1===t.indexOf("_bbn")&&(r[t]=e)}),e+":"+U((n||"json")+JSON.stringify(r))}function ie(e,t=null,n=null,r=null,o=null,i=null){if(null===t&&e&&"object"==typeof e&&e.url&&(e.abort&&(i=e.abort),e.failure&&(o=e.failure),e.success&&(r=e.success),e.data&&(n=e.data),e.datatype&&(t=e.datatype),e=e.url),e&&e&&"string"==typeof e){-1===e.indexOf("://")&&(e=re("//","/",e)),t||(t="json");let s=oe(e,n,t),a=X(s);if(null==a?void 0:a.loader)return a.loader;bbn.env.token&&_(n||{},{_bbn_token:bbn.env.token});const u=new AbortController;let c={responseType:t,signal:u.signal};"text"===t?c.headers={accept:"text/javascript","Content-Type":"text/javascript"}:"json"===t?c.headers={accept:"application/json","Content-Type":"application/json"}:"html"===t&&(c.headers={accept:"text/html","Content-Type":"text/html"});let f="get";w(n)&&D(n)>0&&(c.data=n,f="post");let d=l.run(f,e,c).then(t=>{if(K(s,t),bbn.fn.defaultEndLoadingFunction(e,b,n,t),200===t.status)h(r)&&r(t.data,t.headers);else{let e=1;h(o)&&(e=o(d,t.message,t)),e&&bbn.fn.defaultAjaxErrorFunction(d,t.message,t)}return t}).catch(t=>{let r=l.isCancel(t);if(K(s,t.message||t.response.data,r),bbn.fn.defaultEndLoadingFunction(e,b,n,t),r){let n=1;h(i)&&(n=i(t.message,e)),n&&bbn.fn.defaultAjaxAbortFunction(t.message,e)}else{let e=1;h(o)&&(e=o(d,t.message,t)),e&&bbn.fn.defaultAjaxErrorFunction(d,t.message,t.response)}return t.response}),b=A(s,d,u);return bbn.fn.defaultStartLoadingFunction(e,b,n,s),d}}const se=new TextDecoder;function ae(e){return se.decode(e)}function le(e,t){if(e&&f(e)){let n=e.split("/").pop();if(!t)return n;let r=t.length;if(n&&m(n,-r)===t)return m(n,0,n.length-r)}return""}function ue(...e){if(!e.length)return!1;for(let t of e)if(null!==t&&("object"==typeof t||"function"==typeof t))return!1;return!0}var ce,fe,de,he,be,me,pe,ge=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},ye=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const we=[{name:"mariadb-datetime",re:/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:+e[4],minute:+e[5],second:+e[6]})},{name:"mariadb-datetime-no-sec",re:/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:+e[4],minute:+e[5],second:0})},{name:"mariadb-date",re:/^(\d{4})-(\d{2})-(\d{2})$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:0,minute:0,second:0})},{name:"iso-datetime",re:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?(?:Z|[+\-]\d{2}:?\d{2})?$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:+e[4],minute:+e[5],second:void 0!==e[6]?+e[6]:0})},{name:"slash-date",re:/^(\d{2})\/(\d{2})\/(\d{4})$/,map:e=>({year:+e[3],month:+e[2],day:+e[1],hour:0,minute:0,second:0})},{name:"slash-datetime",re:/^(\d{2})\/(\d{2})\/(\d{4})[ T](\d{2}):(\d{2}):(\d{2})$/,map:e=>({year:+e[3],month:+e[2],day:+e[1],hour:+e[4],minute:+e[5],second:+e[6]})}],ve=[["y","year",31536e6],["m","month",2592e6],["w","week",6048e5],["d","day",864e5],["h","hour",36e5],["i","minute",6e4],["s","second",1e3]],_e={y:"Year",m:"Month",d:"Date",w:"Week",h:"Hours",i:"Minutes",s:"Seconds"},Ee={y:"YYYY",m:"MM",d:"DD",e:"EE",w:"WW",h:"HH",i:"II",s:"SS"},Se={years:"y",year:"y",YEARS:"y",YEAR:"y",Years:"y",Year:"y",YYYY:"y",YY:"y",yyyy:"y",yy:"y",months:"m",month:"m",Months:"m",Month:"m",MONTHS:"m",MONTH:"m",MMMM:"m",MMM:"m",MM:"m",weekday:"e",WEEKDAY:"e",ee:"e",EE:"e",ddd:"e",days:"d",day:"d",Days:"d",Day:"d",DAYS:"d",DAY:"d",DD:"d",dd:"d",hours:"h",hour:"h",Hours:"h",Hour:"h",HOURS:"h",HOUR:"h",HH:"h",hr:"h",hh:"h",minutes:"i",minute:"i",Minutes:"i",Minute:"i",MINUTES:"i",MINUTE:"i",II:"i",ii:"i",mn:"i",mm:"i",min:"i",SS:"s",ss:"s",seconds:"s",second:"s",Seconds:"s",Second:"s",SECONDS:"s",SECOND:"s",sec:"s",WW:"w",Y:"y",y:"y",M:"m",m:"m",e:"e",E:"e",D:"d",d:"d",H:"h",h:"h",n:"i",i:"i",s:"s",S:"s",W:"w",w:"w"},xe={};class ke{constructor(e,t,n=!1){ce.add(this),fe.set(this,0),de.set(this,"");const r=Se[t]||t;if(!r)throw new Error("Invalid unit for duration: "+t);ge(this,de,r,"f");const o=Z(ve,e=>e[0]===r);if(!o)throw new Error("Invalid unit for duration: "+r);const i=o[2];ge(this,fe,n?e:e*i,"f")}years(e=!1){return ye(this,ce,"m",be).call(this,"year",e)}months(e=!1){return ye(this,ce,"m",be).call(this,"month",e)}weeks(e=!1){return ye(this,ce,"m",be).call(this,"week",e)}days(e=!1){return ye(this,ce,"m",be).call(this,"day",e)}hours(e=!1){return ye(this,ce,"m",be).call(this,"hour",e)}minutes(e=!1){return ye(this,ce,"m",be).call(this,"minute",e)}seconds(e=!1){return ye(this,ce,"m",be).call(this,"second",e)}toJSON(){return{years:this.years(!0),months:this.months(!0),days:this.days(!0),hours:this.hours(!0),minutes:this.minutes(!0),seconds:this.seconds(!0),milliseconds:this.toMilliseconds()}}asYears(){const[,,e]=ye(this,ce,"m",he).call(this,"year");return ye(this,fe,"f")/e}asMonths(){const[,,e]=ye(this,ce,"m",he).call(this,"month");return ye(this,fe,"f")/e}asWeeks(){const[,,e]=ye(this,ce,"m",he).call(this,"week");return ye(this,fe,"f")/e}asDays(){const[,,e]=ye(this,ce,"m",he).call(this,"day");return ye(this,fe,"f")/e}asHours(){const[,,e]=ye(this,ce,"m",he).call(this,"hour");return ye(this,fe,"f")/e}asMinutes(){const[,,e]=ye(this,ce,"m",he).call(this,"minute");return ye(this,fe,"f")/e}asSeconds(){const[,,e]=ye(this,ce,"m",he).call(this,"second");return ye(this,fe,"f")/e}add(e,t){const n=t?Se[t]||t:ye(this,de,"f"),r=Z(ve,e=>e[0]===n);if(!r)throw new Error("Invalid unit for duration: "+(null!=t?t:n));return new ke(ye(this,fe,"f")+e*r[2],ye(this,de,"f"),!0)}subtract(e,t){return this.add(-e,t)}toMilliseconds(){return ye(this,fe,"f")}}fe=new WeakMap,de=new WeakMap,ce=new WeakSet,he=function(e){const t=Z(ve,t=>t[1]===e);if(!t)throw new Error("Unit name not found: "+e);return t},be=function(e,t){const n=ve.findIndex(([,t])=>t===e);if(-1===n)throw new Error("Unit not found: "+e);const r=ve[n][2];if(!t)return Math.floor(ye(this,fe,"f")/r);let o=ye(this,fe,"f");for(let e=0;e<n;e++){const[,,t]=ve[e];o-=Math.floor(o/t)*t}return Math.floor(o/r)};class Ae{static parse(e,t,n){var r,o,i,s;"monthsLong"in xe||_(xe,(()=>{const e=[bbn.env.lang,...navigator.languages],t=new Intl.DateTimeFormat(e,{month:"long"}),n=new Intl.DateTimeFormat(e,{month:"short"}),r=new Intl.DateTimeFormat(e,{weekday:"long"}),o=new Intl.DateTimeFormat(e,{weekday:"short"}),i=[],s=[];for(let e=0;e<12;e++){const r=new Date(2020,e,1);i.push(t.format(r)),s.push(n.format(r))}const a=new Date(2020,1,2),l=[],u=[];for(let e=0;e<7;e++){const t=new Date(a.getTime()+864e5*e);l.push(r.format(t)),u.push(o.format(t))}return{monthsLong:i,monthsShort:s,weekdaysLong:l,weekdaysShort:u}})());const a={monthsLong:null!==(r=null==n?void 0:n.monthsLong)&&void 0!==r?r:xe.monthsLong,monthsShort:null!==(o=null==n?void 0:n.monthsShort)&&void 0!==o?o:xe.monthsShort,weekdaysLong:null!==(i=null==n?void 0:n.weekdaysLong)&&void 0!==i?i:xe.weekdaysLong,weekdaysShort:null!==(s=null==n?void 0:n.weekdaysShort)&&void 0!==s?s:xe.weekdaysShort},l={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0},u=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=[...[{token:"YYYY",regex:"\\d{4}",apply:e=>{l.year=parseInt(e,10)}},{token:"YY",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);l.year=t>=70?1900+t:2e3+t}},{token:"Y",regex:"[+-]?\\d{1,6}",apply:e=>{l.year=parseInt(e,10)}},{token:"MMMM",regex:"[^\\d\\s]+",apply:e=>{const t=a.monthsLong.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid month name: "+e);l.month=t+1}},{token:"MMM",regex:"[^\\d\\s]+",apply:e=>{const t=a.monthsShort.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid short month name: "+e);l.month=t+1}},{token:"MM",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>12)throw new Error("Invalid month: "+t);l.month=t}},{token:"mm",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.month=t}},{token:"M",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>12)throw new Error("Invalid month: "+t);l.month=t}},{token:"m",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>12)throw new Error("Invalid month: "+t);l.month=t}},{token:"DD",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>31)throw new Error("Invalid day of month: "+t);l.day=t}},{token:"D",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>31)throw new Error("Invalid day of month: "+t);l.day=t}},{token:"d",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>31)throw new Error("Invalid day of month: "+t);l.day=t}},{token:"dddd",regex:"[^\\d\\s]+",apply:e=>{const t=a.weekdaysLong.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid weekday name: "+e);l.weekday=t}},{token:"ddd",regex:"[^\\d\\s]+",apply:e=>{const t=a.weekdaysShort.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid short weekday name: "+e);l.weekday=t}},{token:"EE",regex:"\\d{1}",apply:e=>{const t=parseInt(e,10);if(t<0||t>7)throw new Error("Invalid weekday number: "+t);l.weekday=t}},{token:"HH",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>23)throw new Error("Invalid hour: "+t);l.hour=t}},{token:"H",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>23)throw new Error("Invalid hour: "+t);l.hour=t}},{token:"h",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>23)throw new Error("Invalid hour: "+t);l.hour=t}},{token:"II",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.minute=t}},{token:"I",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.minute=t}},{token:"i",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.minute=t}},{token:"SS",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid second: "+t);l.second=t}},{token:"S",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid second: "+t);l.second=t}},{token:"s",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid second: "+t);l.second=t}},{token:"ms",regex:"\\d{1,3}",apply:e=>{const t=parseInt(e,10);if(t<0||t>999)throw new Error("Invalid millisecond: "+t);l.ms=t}},{token:"WWWW",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}},{token:"WWW",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}},{token:"WW",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}},{token:"W",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}}]].sort((e,t)=>t.token.length-e.token.length);let f="";const d=[];let h=0;for(;h<t.length;){let e=null;for(const n of c)if(t.startsWith(n.token,h)){e=n;break}e?(f+=`(${e.regex})`,e.apply?d.push(e.apply):d.push(()=>{}),h+=e.token.length):(f+=u(t[h]),h+=1)}const b=new RegExp("^"+f+"$").exec(e);if(!b)throw new Error(`Date string "${e}" does not match format "${t}"`);for(let e=1;e<b.length;e++){const t=b[e],n=d[e-1];null!=t&&n&&n(t)}const m=new Date(l.year,l.month-1,l.day,l.hour,l.minute,l.second,l.ms);if(m.getFullYear()!==l.year||m.getMonth()!==l.month-1||m.getDate()!==l.day||m.getHours()!==l.hour||m.getMinutes()!==l.minute||m.getSeconds()!==l.second||m.getMilliseconds()!==l.ms)throw new Error("Invalid date produced from components");return void 0!==l.weekday&&m.getDay(),m}constructor(e,t=null){me.set(this,void 0),pe.set(this,!1);let n=typeof e;if(e)if(t)this.matchFormat(e,t)&&ge(this,me,Ae.parse(e,t),"f");else if(("number"===n||u(e)&&""!==e)&&(e<5e3&&u(t)?e=Array.from(arguments):e<1e10&&(e*=1e3),Array.isArray(e)||ge(this,me,new Date(e),"f")),"string"===n){for(const t of we){const n=e.match(t.re);if(n){const{year:e,month:r,day:o,hour:i,minute:s,second:a}=t.map(n);ge(this,me,new Date(e,r-1,o,i,s,a,0),"f")}}if(!ye(this,me,"f"))throw new Error("Invalid date string format: "+e)}else T(e)?ge(this,me,e,"f"):Array.isArray(e)&&ge(this,me,new Date(...e),"f");else ge(this,me,new Date,"f")}parse(e,t){const n=Ae.parse(e,t);return new Ae(n)}matchFormat(e,t){try{return Ae.parse(e,t),!0}catch(e){return!1}}toString(){return ye(this,me,"f")?this.format():""}year(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setFullYear(e),new Ae(t)}return ye(this,me,"f").getFullYear()}}month(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setMonth(e-1),new Ae(t)}return ye(this,me,"f").getMonth()+1}}day(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setDate(e),new Ae(t)}return ye(this,me,"f").getDate()}}hour(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setHours(e),new Ae(t)}return ye(this,me,"f").getHours()}}minute(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setMinutes(e),new Ae(t)}return ye(this,me,"f").getMinutes()}}second(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setSeconds(e),new Ae(t)}return ye(this,me,"f").getSeconds()}}weekday(e,t=!1){if(ye(this,me,"f"))return!(0 in arguments)||void 0===e||e instanceof Event?ye(this,me,"f").getDay():this.setWeekday(e,t)}week(){const e=new Date(Date.UTC(this.year(),this.month()-1,this.day())),t=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+(4-t));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}get tst(){return Math.ceil(ye(this,me,"f").getTime()/1e3)}get mtst(){return ye(this,me,"f").getTime()}get YYYY(){return this.year().toString()}get YY(){return m(this.year().toString(),2,2)}get MMMM(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{month:"long"}).format(ye(this,me,"f"))}get MMM(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{month:"short"}).format(ye(this,me,"f"))}get MM(){const e=parseInt(this.month().toString());return e<10?"0"+e.toString():e.toString()}get M(){return this.month().toString()}get EE(){return this.weekday().toString()}get DD(){const e=parseInt(this.day().toString());return e<10?"0"+e.toString():e.toString()}get d(){return this.day().toString()}get dddd(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{weekday:"long"}).format(ye(this,me,"f"))}get ddd(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{weekday:"short"}).format(ye(this,me,"f"))}get D(){return this.day().toString()}get HH(){const e=parseInt(this.hour().toString());return e<10?"0"+e.toString():e.toString()}get H(){return this.hour().toString()}get II(){const e=parseInt(this.minute().toString());return e<10?"0"+e.toString():e.toString()}get mm(){const e=parseInt(this.minute().toString());return e<10?"0"+e.toString():e.toString()}get I(){return this.minute().toString()}get SS(){const e=parseInt(this.second().toString());return e<10?"0"+e.toString():e.toString()}get S(){return this.second().toString()}get WW(){const e=parseInt(this.year().toString()),t=new Date(e,0,1),n=(ye(this,me,"f").getTime()-t.getTime())/864e5;return String(Math.ceil((n+t.getDay()+1)/7)).padStart(2,"0")}get isValid(){return void 0!==ye(this,me,"f")}inLeapYear(){if(this.isValid){const e=ye(this,me,"f").getFullYear();return e%4==0&&e%100!=0||e%400==0}return!1}daysInMonth(){if(this.isValid)switch(ye(this,me,"f").getMonth()){case 1:return ye(this,me,"f").getFullYear()%4==0?29:28;case 0:case 3:case 5:case 8:case 10:return 30;default:return 31}}valueOf(){return this.mtst}add(e,t="d"){const n=ye(this,me,"f")?new Date(ye(this,me,"f").getTime()):new Date;if(Se[t]){const r=Se[t],o="y"===r?"FullYear":_e[r],i="get"+o;return n["set"+o](n[i]()+e),new Ae(n)}return null}subtract(e,t){return this.add(-e,t)}dateFromFormat(e,t){return new Date}date(e){return!(0 in arguments)||void 0===e||e instanceof Event?this.format("Y-m-d"):this.parse(e,"Y-m-d")}datetime(e){return!(0 in arguments)||void 0===e||e instanceof Event?this.format("Y-m-d H:i:s"):this.parse(e,"Y-m-d H:i:s")}time(e){return!(0 in arguments)||void 0===e||e instanceof Event?this.format("H:i:s"):this.parse(e,"H:i:s")}fdate(e=!1,t=!1,n=!1){if(!ye(this,me,"f"))return"";const r=Object.assign(Object.assign({year:"numeric",month:e?"long":"numeric",day:"numeric"},n?{weekday:e?"long":"short"}:{}),t?{hour:e?"2-digit":"numeric",minute:"2-digit"}:{});return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],r).format(ye(this,me,"f"))}ftime(e=!1){if(!ye(this,me,"f"))return"";const t={hour:"2-digit",minute:"2-digit"};e&&(t.second="2-digit");return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],t).format(ye(this,me,"f"))}format(e="YYYY-MM-DD HH:II:SS"){let t="";if(e){const n=new RegExp("([|]|"+Object.keys(Se).join("|")+")","g");let r=0;y(e.split(n),e=>{if("["!==e)if("]"!==e)if(r>0)t+=e;else if(e in Se)if(e in this&&ue(this[e]))t+=this[e];else{t+=this[Ee[Se[e]]]}else t+=e;else r--;else r++})}return t}unix(e=!1){if("number"==typeof e){const t=this.copy();return t.setTime(1e3*e),new Ae(t)}return ye(this,me,"f")?e?ye(this,me,"f").getTime():Math.floor(ye(this,me,"f").getTime()/1e3):0}sql(e=!1){return ye(this,me,"f")?e?this.format("YYYY-MM-DD"):this.format("YYYY-MM-DD HH:II:SS"):""}compare(e,t=""){var n;const r=e instanceof Ae?e:new Ae(e),o=Se[t]||null;if(!o)return this.mtst<r.mtst?-1:this.mtst>r.mtst?1:0;const i=["y","m","d","h","i","s"];for(const e of i){const t=null===(n=Z(ve,t=>t[0]===e))||void 0===n?void 0:n[1],i=this[t](),s=r[t]();if(i<s)return-1;if(i>s)return 1;if(e===o)break}return 0}isBefore(e,t=""){return-1===this.compare(e,t)}isAfter(e,t="day"){return 1===this.compare(e,t)}isSame(e,t="day"){return 0===this.compare(e,t)}isAfterOrSame(e,t=""){return[0,1].includes(this.compare(e,t))}isBeforeOrSame(e,t=""){return[-1,0].includes(this.compare(e,t))}fromNow(e=""){const t=new Date,n=Se[e]||this.guessUnit(this.diff(t)),r=this.diff(t,n),o=new Intl.RelativeTimeFormat([bbn.env.lang,...navigator.languages],{numeric:"auto"}),i=Z(ve,e=>e[0]===n);if(!i)throw new Error("Invalid unit for fromDate: "+e);return o.format(r,i[1])}fromDate(e,n=""){const r=Se[n]||this.guessUnit(this.diff(e)),o=this.diff(e,r);return o>0?t("%d %s before",o,n):o<0?t("%d %s after",-o,n):t("The same %s",n)}guessUnit(e){const t=Math.abs(e);for(const[e,n,r]of ve)if(t>=r||"second"===n)return e}diff(e,t="",n=!1){const r=e instanceof Ae?e.mtst:new Date(e).getTime();let o=this.mtst-r;if(n&&(o=Math.abs(o)),!t)return o;const i=Se[t],s=Z(ve,e=>e[0]===i);if(!s)throw new Error("Invalid unit for diff: "+t);const[a,l,u]=s;return Math.round(o/u)}calendar(e){return""}getWeekday(e,t="long",n){if(!t){const t=this.getWeekday(e,"narrow",n),r=this.getWeekday(e,"short",n),o=this.getWeekday(e,"long",n);return{letter:t,abbr:r,full:o,long:o,short:r,narrow:t}}let r;if("letter"===t)r="narrow";else if("abbr"===t)r="short";else if("full"===t)r="long";else{if(!["long","short","narrow"].includes(t))throw new Error("Invalid mode for getWeekDay: "+t+'. Allowed values are "long", "short", "narrow", "letter", "abbr", "full".');r=t}return new Date(2023,0,1+e).toLocaleDateString([n||bbn.env.lang,...navigator.languages],{weekday:r})}getWeekdayIndex(e,t){const n=t||bbn.env.lang,r=e.trim().toLowerCase(),o=[n,...navigator.languages];for(let e=0;e<o.length;e++){if(!o[e])continue;const t=new Intl.DateTimeFormat(o[e],{weekday:"long"});for(let e=0;e<7;e++){const n=new Date(2023,0,1+e);if(t.format(n).toLowerCase()===r)return e}}throw new Error(`Unknown weekday name '${e}' for locale '${n}'`)}setWeekday(e,t=!1,n){let r;if("string"==typeof e&&(e=this.getWeekdayIndex(e,n)),"number"!=typeof e)throw new TypeError("weekday must be a number (0–6) or a string");if(e<0||e>6)throw new RangeError("weekday number must be between 0 and 6");r=e;const o=this.weekday();let i;t?(i=(o-r+7)%7,0===i&&(i=7),i=-i):(i=(r-o+7)%7,0===i&&(i=7));const s=this.copy();return s.setDate(s.getDate()+i),new Ae(s)}copy(){return new Date(ye(this,me,"f").getTime())}clone(){return new Ae(ye(this,me,"f")?new Date(ye(this,me,"f").getTime()):void 0)}startOf(e="d"){const t=Se[e];if(!t)throw new Error("Invalid unit for startOf: "+e);let n;switch(t){case"y":n=new Date(this.year(),0,1,0,0,0,0);break;case"m":n=new Date(this.year(),this.month()-1,1,0,0,0,0);break;case"w":{const e=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),this.second(),0),t=(e.getDay()+6)%7;n=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t,0,0,0,0);break}case"d":n=new Date(this.year(),this.month()-1,this.day(),0,0,0,0);break;case"h":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),0,0,0);break;case"i":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),0,0);break;case"s":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),this.second(),0);break;default:throw new Error("Invalid unit for startOf: "+e)}return new Ae(n)}endOf(e="d"){const t=Se[e];if(!t)throw new Error("Invalid unit for endOf: "+e);let n;switch(t){case"y":n=new Date(this.year(),11,31,23,59,59,999);break;case"m":n=new Date(this.year(),this.month(),0,23,59,59,999);break;case"w":{const e=this.startOf("w"),t=new Date(e.year(),e.month()-1,e.day(),23,59,59,999);t.setDate(t.getDate()+6),n=t;break}case"day":n=new Date(this.year(),this.month()-1,this.day(),23,59,59,999);break;case"hour":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),59,59,999);break;case"minute":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),59,999);break;case"second":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),this.second(),999);break;default:n=new Date(this.mtst)}return new Ae(n)}duration(e,t="s"){return new ke(e,t)}}function Ie(e,t=null){return e instanceof Ae?e:new Ae(e,t)}function Oe(e){if(arguments.length>1){const e=[];for(let t=1;t<arguments.length;t++)e.push(arguments[t]);e.unshift({_bbn_console_mode:"error",_bbn_console_level:1,_bbn_console_style:"color: #E64141; background: #F7E195; font-size: 14px"}),b.apply(this,e)}throw new Error(e)}function Te(e,t=null,n=null,r=null,o=null){let i=!1;if(t){i=!0;let s,a="object"===(typeof t).toLowerCase();if(a&&t.prescript)try{new Function(t.prescript)()}catch(e){Oe(e.message||"")}if(a&&void 0===t.url&&(t.url=e),i=n&&h(n)?n(t,o):bbn.fn.defaultLinkFunction(t,o),o&&a&&void 0!==t.content&&("value"in o?o.value=t.content:o.innerHTML=t.content),i&&a&&t.script&&(i="function"==typeof t.script?t.script(t.data?t.data:{},o||null):((e,n)=>{let r=null;try{r=new Function(t.script)(),h(r)&&(r=r(e,n))}catch(e){b(e,t),Oe(h(e.getMessage)?e.getMessage():null)}return r})(t.data?t.data:{},o||!1)),i&&r&&h(r)?r(t):a&&bbn.fn.defaultPostLinkFunction&&bbn.fn.defaultPostLinkFunction(t,o),i&&a&&t.postscript){new Function(t.postscript)(t.postscript)}a&&t.error&&(s=t.errorTitle||bbn.lng.server_response,bbn.fn.defaultErrorFunction(t.error,s))}else bbn.fn.defaultErrorFunction(bbn.lng.errorText,bbn.lng.error);return i}function je(e,t,n=!1){let r={error:!1,result:!0};if("string"==typeof t&&(t=[t]),v(t)||(r.error=bbn._("checkProps must receive a string or an array as props argument")),w(e)||(r.error=bbn._("checkProps must receive an object as obj argument")),!r.error){let o;y(t,t=>{let i=(t=t.trim().split(":"))[1]||!1;if(t=t[0],void 0===e[t]?r.error=t+" "+bbn._("is not defined"):i?(o="is"+m(i,0,1).toUpperCase()+m(i,1).toLowerCase(),void 0===bbn.fn[o]?r.error=i+" "+bbn._("is not a valid type"):bbn.fn[o](e[t])||(r.error=t+" "+bbn._("is not a")+" "+i)):n&&!e[t]&&(r.error=t+" "+bbn._("is empty")),r.error)return!1})}return r.error&&(r.result=!1),r}function De(e){return e.replace(/[A-z]{1}/,e=>e.toUpperCase())}function Ce(e,t,n,...r){let o=!1;v(t)||(t=[t]);const i=[];if(y(t,t=>{var n;if(t===String?t="string":t===Number?t="number":t===Array?t="array":t===Boolean?t="boolean":t===Object?t="object":t===Function&&(t="function"),h(t)){if(i.push(t.name||(null===(n=t.constructor)||void 0===n?void 0:n.name)||t.toString()),e instanceof t)return o=!0,!1}else if(f(t)&&h(bbn.fn["is"+De(t)])){if(bbn.fn["is"+De(t)](e))return o=!0,!1;i.push(t)}else Oe(`The type ${t} is not recognized`)}),!o)throw b(["Value given",e,"type",typeof e,"expected",i.join(" or ")]),r.length&&b(r),new Error((n?n+" - ":"")+bbn._("The value should be a %s",i.join(" "+bbn._("or a")+" ")))}function Me(e){if(v(e))return e.slice().map(e=>"object"==typeof e?Me(e):e);if(w(e)){return _(!0,Object.create(Object.getPrototypeOf(e)),e)}return e}me=new WeakMap,pe=new WeakMap;const Le=(e,t="text/plain")=>{const n=new DataTransfer;n.setData(t,e);const r=new ClipboardEvent("copy",{bubbles:!0,cancelable:!0,clipboardData:n});document.dispatchEvent(r)};function Fe(e,t,n=null,r="="){if(!v(e))throw bbn.fn.log("NOT ARRAY",e),new Error("Error in filter: The first argument must be an array");let o={};const i=[],s="function"==typeof t;if(!t||!e.length)return e;if("object"==typeof t)r=n,o=t;else if("string"==typeof t)o[t]=n;else if(!s)throw new Error("Search function error: The prop argument should be a string or an object");if("function"==typeof t)for(let n=0;n<e.length;n++)t(e[n],n)&&i.push(e[n]);else if(o=V(o,r),o.conditions&&o.logic)for(let t=0;t<e.length;t++)$(e[t],o)&&i.push(e[t]);return i}const Re=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;Re.push(t)}function Ne(...e){const t=Object.create(null);return e.length&&_(t,...e),t}function Pe(e){let t=typeof e;if(void 0===e)return new Date;if("number"===t||u(e)&&""!==e)return e<1e10&&(e*=1e3),new Date(e);if("string"===t){if(10===e.length)return new Date(parseInt(m(e,0,4)),parseInt(m(e,5,2))-1,parseInt(m(e,8,2)),12);if(19===e.length)return new Date(parseInt(m(e,0,4)),parseInt(m(e,5,2))-1,parseInt(m(e,8,2)),parseInt(m(e,11,2)),parseInt(m(e,14,2)),parseInt(m(e,17,2)))}else if(T(e))return e;return!1}function Be(e,t=""){b(e)}function He(e,t=null,n=null){b(t,n)}function Ye(e,t,n=null,r=null){return!0}function Ue(...e){if(!e.length)return!1;for(let t of e)if("object"==typeof t&&!M(t))return!1;return!0}let We=[];function qe(e){if(f(e)&&e){for(;"/"===m(e,e.length-1);)e=m(e,0,e.length-1);let t=e.lastIndexOf("/");if(t>0)return m(e,0,t);if(0===t)return"/"}return""}function ze(...e){if(!e.length)return!1;for(let t of e)if("[object Blob]"!=={}.toString.apply(t))return!1;return!0}function $e(e){if(e&&f(e)){let t=e.split(".");if(t[0]&&t.length>1)return t[t.length-1].toLowerCase()}return""}function Ve(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof HTMLCanvasElement))return!1;return!0}function Je(e,t,n=null){if(Ve(t))return void t.toBlob(t=>{let n=document.createElement("a");n.download=e,n.href=window.URL.createObjectURL(t),n.className="bbn-no",n.click(),window.URL.revokeObjectURL(n.href)},n||"image/png");n?-1===n.indexOf("/")&&(n="text/"+n):n=w(t)&&t.type?t.type:"octet/stream";let r=window.document.createElement("a");r.className="bbn-no";let o=null;if(f(t))o=new Blob([t],{type:n});else try{o=t}catch(e){b(e)}r.href=window.URL.createObjectURL(o),r.download=e,document.body.appendChild(r),r.click(),window.URL.revokeObjectURL(r.href),document.body.removeChild(r)}var Ze=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};function Ke(){return Ze(this,void 0,void 0,function*(){var e;(null===(e=window.scheduler)||void 0===e?void 0:e.yield)?yield window.scheduler.yield():yield new Promise(requestAnimationFrame)})}var Xe=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};function Ge(e){let t;return"checkbox"===e.type?e.checked?(t=e.value,t||(t=1)):t=0:"radio"===e.type?e.checked&&(t=e.value):t=e.value,t}function Qe(e){let t,n,r=e.querySelectorAll("input[name],select[name],textarea[name],button[name]"),o={};return y(r,(e,r)=>{if(n=Ge(e),void 0!==n&&!e.disabled){let r=e.name;if(-1===r.indexOf("[]")&&r.indexOf("[")>-1&&r.indexOf("]")>-1&&r.lastIndexOf("]")===r.length-1&&(r=re("][",".",r),r=re("[",".",r),r=re("]","",r)),r.length>2&&r.indexOf("[]")===r.length-2)t=m(r,0,r.length-2),void 0===o[t]&&(o[t]=[]),o[t].push(n);else if(r.indexOf(".")>-1){let e,t=r.split(".");e=o;for(let r=0;r<t.length;r++)void 0===o[t[r]]&&(r<t.length-1?e[t[r]]={}:e[t[r]]=n),e=e[t[r]]}else o[r]=n}}),o}function et(e){return e.filter((e,t,n)=>t===n.indexOf(e))}function tt(e,t=null){let n=[];if("string"==typeof e&&(e=document.querySelector(e)),e instanceof HTMLElement&&e.parentElement)if("string"==typeof t)for(;e=e.parentElement.closest(t);)n.push(e);else for(!0===t&&n.push(e);e=e.parentElement;)n.push(e);return n}function nt(e){0!==e.indexOf("--")&&(e="--"+e);let t=getComputedStyle(document.documentElement).getPropertyValue(e);return"string"==typeof t&&(t=t.trim()),t}function rt(){const e=navigator.userAgent.toLowerCase();return/iPhone|Android/i.test(navigator.userAgent)?"mobile":/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(e)?"tablet":"desktop"}function ot(){let e,t=window.getSelection();if(t.rangeCount>0){e=t.getRangeAt(0),b("RANGE",e);let n=e.cloneContents();b("clonedSelection",n);let r=document.createElement("div");return r.appendChild(n),r.innerHTML}return""}function it(e){return f(e)?e.replace(/<!--[\s\S]*?-->/g,""):e}function st(e){let t=document.createElement("div");return t.innerHTML=e,e=t.innerText}function at(e){let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t}function lt(e){let t,n,r={};if(w(e[0])&&1===e.length)return e[0];for(n=0;n<e.length;n++)t=typeof e[n],t=t.toLowerCase(),h(e[n])?(r.errorFn&&!r.abortFn&&(r.abortFn=e[n]),r.successFn&&!r.errorFn?r.errorFn=e[n]:r.successFn||(r.successFn=e[n])):1===e[n]||!0===e[n]?r.force=!0:"string"===t?r.url?r.datatype=e[n]:0===e[n].indexOf("#")||0===e[n].indexOf(bbn.env.root+"#")?r.url=m(e[n],bbn.env.root.length):(r.url=e[n],0===r.url.indexOf(bbn.env.root)&&(r.url=m(r.url,bbn.env.root.length))):e[n]&&"object"===t&&(e[n]instanceof Event?r.e=e[n]:r.ele||1!==e[n].nodeType?"object"===t.toLowerCase()&&(r.obj=e[n]):r.ele=e[n]);return!r.url&&D(r)&&(r.url=bbn.env.path),void 0===r.obj&&(r.obj={_bbn:"public"}),r.datatype||(r.datatype="json"),r}function ut(e,t,n=null,r=!1){bbn.env.old_path=bbn.env.path,bbn.env.url=["https:/","http://"].includes(m(e,0,7))?e:bbn.env.root+e,bbn.env.path=m(bbn.env.url,bbn.env.root.length),bbn.env.params=bbn.env.path.split("/").filter(e=>""!==e);let o=window.history;if(o){let e=o.state,i={url:bbn.env.path,old_path:bbn.env.old_path||null,data:n||{},reload:!1};e&&e.url===bbn.env.path&&(e.data&&_(i.data,e.data),e.title&&!t&&(t=e.title),r=!0),t=t?st(t):bbn.env.siteTitle,r?(i.reload=!0,o.replaceState(i,t,bbn.env.url)):o.pushState(i,t,bbn.env.url)}}function ct(...e){let t=lt(e),n=1;if(!0===t)return!0;if(!t)return ct(window.location.href);if(0===t.url.indexOf("javascript:"))return!0;if(0===t.url.indexOf("data:"))return!0;if(0===t.url.indexOf("#"))return location.href=bbn.env.url+t.url,!0;if(0===t.url.indexOf("mailto:"))return bbn.env.ignoreUnload=!0,window.location.href=t.url,setTimeout(()=>{bbn.env.ignoreUnload=!1},0),!1;if(X(t.url))return!1;if((0===t.url.indexOf("http://")||0===t.url.indexOf("https://"))&&0!==t.url.indexOf(bbn.env.host))return t.e&&t.e.preventDefault(),window.open(t.url),!1;if(t.url!==bbn.env.params.join("/")||1===t.force){if(t.successFn)n=t.successFn(t.url);else if(bbn.fn.defaultPreLinkFunction){let e=bbn.fn.defaultPreLinkFunction(t.url,t.force,t.ele);void 0!==e.data?(_(t.obj,e.data),n=1):n=e}if(n){1!==n&&"string"==typeof n&&(t.url=n);let e=bbn._("The Ajax call to")+" "+t.url+" ";return ie(t.url,t.datatype,t.obj,n=>{n||b(e+bbn._("returned no answer")),w(n)&&(0===Object.keys(n).length&&b(e+bbn._("returned an empty object")),n.new_url?(n.old_path=t.url,t.url=n.new_url):n.url&&t.url!==n.url&&(n.old_path=t.url)),Te(t.url,n,t.successFn,null,t.ele)&&void 0===n.noNav&&0!==bbn.env.path.indexOf(t.url)&&ut(t.url,(n.title?n.title+" - ":"")+bbn.env.siteTitle)},t.errorFn||null)}}return!0}function ft(...e){let t=lt(e);if(t.url)return ie(t.url,t.datatype,t.obj,e=>{Te(t.url,e,t.successFn,t.errorFn,t.ele)},t.errorFn,t.abortFn)}function dt(e,t,n){let r,o=e.getAttribute("action")||bbn.env.path;if(""===o&&(o="."),"string"==typeof o&&(0!==o.indexOf("http")||-1!==o.indexOf(window.document.location.hostname))&&!e.getAttribute("target")&&(t&&t.preventDefault(),r=Qe(e),r)){e.setAttribute("action",null);const t=[o,r];!n&&e.getAttribute("data-script")&&(n=(n=new Function(e.getAttribute("data-script")))()),n&&t.push(n),ft(...t)}}function ht(){let e=bbn.env.width!==window.innerWidth,t=bbn.env.height!==window.innerHeight;if(e||t){e&&(bbn.env.width=window.innerWidth||window.document.documentElement.clientWidth||window.document.body.clientWidth,document.documentElement.style.setProperty("--vw",.01*bbn.env.width+"px")),t&&(bbn.env.height=window.innerHeight||window.document.documentElement.clientHeight||window.document.body.clientHeight,document.documentElement.style.setProperty("--vh",.01*bbn.env.height+"px"));let n=parseInt(nt("mobile-limit"))||650,r="bbn-screen-"+(bbn.env.width<n?"small":"regular"),o=(document.body.className||"").split(" "),i=!1;y(o,(e,t)=>{if(3===e.split("-").length&&0===e.indexOf("bbn-screen-"))return i=!0,e!==r&&o.splice(t,1,r),!1}),i||o.push(r),bbn.fn.defaultResizeFunction(),document.body.className=o.join(" ")}}function bt(){return"mobile"===rt()}function mt(){return"tablet"===rt()}function pt(){return bt()||mt()}function gt(e=!1){let t=(new Date).getTime();return e?Math.round(t/1e3):t}function yt(e){if("string"==typeof e&&e.length>0&&(0===e.indexOf("calc")||u(m(e,0,1)))){let t=document.createElement("div");t.style.width=e;let n=!!t.style.width.length;return t.remove(),n}return!1}function wt(...e){if(!e.length)return!1;for(let t of e)if(!f(t)||!bbn.var.regexp.ip.test(t))return!1;return!0}function vt(...e){if(!e.length)return!1;for(let t of e)if("[object Symbol]"!=={}.toString.apply(t))return!1;return!0}function _t(e){const t=["BBN: "+e];t.unshift({_bbn_console_mode:"warn",_bbn_console_level:2,_bbn_console_style:"color: #E64141; background: #F7E195; font-size: 14px"}),b.apply(this,t)}function Et(e,t="",n=null){let r=new FormData,o=(e,t="")=>{(!n||v(n)&&!n.includes(t))&&(e instanceof File?r.append(t,e):v(e)?y(e,(e,n)=>{o(e,t+"["+n+"]")}):w(e)&&Object.keys(e).length?g(e,(n,r)=>{r in e&&o(n,t?t+"["+r+"]":r)}):M(e)||void 0===e||r.append(t,e))};return o(e,t),r}function St(e){return"string"==typeof e?document.querySelector(e):e}function xt(e,t,n,r){if("object"==typeof e&&"string"==typeof t){let o=e;const i=t.split(".");y(i,(e,t)=>{if(!o){if(!r)throw new Error(bbn._("The object is invalid"));o={}}i.length-1===t?o[e]=n:o=o[e]})}}function kt(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function At(e,t=" "){if(" "===t)return e.trim();if(!t)return e;if(t===e)return"";for(;0===e.indexOf(t);)e=m(e,t.length);for(;e.lastIndexOf(t)===e.length-t.length;)e=m(e,0,e.length-t.length);return e}function It(e,t,n){return"string"==typeof e.toLowerCase()&&(t||(t=bbn.var.shortenLen),void 0!==n&&f(n)||(n="..."),e.length>t&&(e=m(e,0,t)+n)),e}var Ot={_addLoader:A,_compareValues:j,_deleteLoader:K,abort:function(e){let t=X(e);(null==t?void 0:t.aborter)&&t.aborter.abort("Operation canceled by the user.")},abortURL:function(e){y(G(bbn.env.loaders,{url:e}),t=>{if(!t||!t.source)throw new Error("Impossible to find the loader with URL "+e);t.source.cancel("Operation canceled by the user.")})},addColors:Q,addInputs:ee,addStyle:function(e,t){w(t)&&g(t,(t,n)=>{e.style[n]=t})},adjustHeight:function(){let e=arguments;return 1===e.length&&c(e[0])&&(e=e[0]),te("height",e)},adjustSize:te,adjustWidth:function(){let e=arguments;return 1===e.length&&c(e[0])&&(e=e[0]),te("width",e)},ajax:ie,analyzeFunction:W,animateCss:function(e,t,n){e.classList.add("animated"),e.classList.add(t),e.addEventListener("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function e(r){r.target.removeEventListener(r.type,e),"function"==typeof n&&n.call(this),r.target.classList.remove(t)})},arrayBuffer2String:ae,arrayFromProp:function(e,t){let n=[];return y(e,(e,r)=>{n.push(I(e,t))}),n},autoExtend:function(e,t){bbn[e]||(bbn[e]={}),_(bbn[e],t)},baseName:le,br2nl:function(e){return re("<br />","\n",re("<br/>","\n",re("<br>","\n",e)))},calendar:function(e,t=!1){let n=Ie(e);return n.isValid?n.fdate():t&&f(t)?t:""},callback:Te,camelize:function(e){return e.replace(/^([A-Z])|[\s-](\w)/g,function(e,t,n,r){return n?n.toUpperCase():t.toLowerCase()})},camelToCss:function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}).replace("/^./",function(e){return e.toLowerCase()})},canvasToImage:function(e){let t=new Image;return t.src=e.toDataURL("image/png"),t},cast:function(e){var t;return e?"object"==typeof e?bbn.fn.isArray(e)?"Array ("+e.length+")":(null===(t=e.constructor)||void 0===t?void 0:t.name)||"{}":e.toString?e.toString():"string"==typeof e?e:"":""},center:function(e){let t=e.parentNode,n=t.clientWidth,r=t.clientHeight;for(;t&&(!n||!r);)t=e.parentNode,n=t.clientWidth,r=t.clientHeight;return e.style.position="absolute",e.style.top=Math.max(0,(r-e.offsetHeight)/2+t.scrollTop)+"px",e.style.left=Math.max(0,(r-e.offsetWidth)/2+t.scrollLeft)+"px",e},checkProps:function(e,t,n=!1){return je(e,t,n).result},checkPropsDetails:je,checkPropsOrDie:function(e,t,n=!1){let r=je(e,t,n);if(r.error)throw new Error(r.error);return!0},checkType:Ce,circularReplacer:function(){const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n),[void 0,Object,Array,null].includes(n.constructor)||(n=N(n)?n.bbnId?"__BBN_DOM__"+n.tagName+"/"+n.bbnId+n.bbnHash:"__BBN_DOM__"+n.tagName+"/"+n.className:B(n)?"__BBN_CP__"+n.$options.name+"/"+n.$cid:n.constructor.toString())}return n}},clone:Me,colorToHex:function(e){let t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,t.fillStyle},compare:z,compareConditions:$,copy:function(e,t){return new Promise(n=>{if(e){if(navigator&&navigator.clipboard)return void(e instanceof Blob?(navigator.clipboard.write([new ClipboardItem({[e.type.toString()]:e})]).then(()=>{n(!0)}),t||Le(e,e.type.toString())):w(e)&&h(e.toBlob)?e.toBlob(r=>{const o=new ClipboardItem({[r.type.toString()]:r});navigator.clipboard.write([o]).then(()=>{t||Le(e,r.type.toString()),n(!0)})}):(navigator.clipboard.writeText(e),t||Le(e),n(!0)));let r=document.createElement("textarea");r.style.opacity="0",r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),t||Le(e),n(!0)}n(!1)})},correctCase:De,count:function(e,t,n=null,r="="){return Fe(e,t,n,r).length||0},crc32:function(e){let t=~0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=t>>>8^Re[255&(t^r)]}return(-1^t)>>>0},createObject:Ne,cssExists:function(e){let t,n,r=document.styleSheets;for(let o=0;o<r.length;o++){t=1;try{n=r[o].rules||r[o].cssRules}catch(e){if(t=!1,"SecurityError"!==e.name)throw e}if(t)for(let t=0;t<n.length;t++)if(new RegExp("(^|\\s)"+ne(e)+"(\\{|\\s)","g").test(n[t].selectorText))return!0}return!1},data2Html:function e(t,n=""){const r=!v(t);let o='<ul class="bbn-bottom-xspadding '+(n||"bbn-ul")+'">';for(let i in t)o+="<li>",r&&(o+="<em>"+i+"</em>: "),t[i]&&(v(t[i])||w(t[i]))?o+=e(t[i],n):o+=null===t[i]?"<em>null</em>":t[i].toString?t[i].toString():t[i],o+="</li>";return o+='</ul><div class="bbn-bottom-xspadding '+(n||"bbn-div")+'"></div>',o},date:Pe,dateSQL:function(e,t){let n=Ie(e);if(n)return n.format("YYYY-MM-DD"+(t?"":" HH:mm:ss"))},deepPath:function e(t,n,r,o=[]){let i;return(i=J(t,n,0))>-1?(o.push(i),o):(y(t,(t,i)=>{if(v(t[r])){let s=o.slice();s.push(i);let a=e(t[r],n,r,s);if(!1!==a)return a}}),!1)},defaultAjaxAbortFunction:Be,defaultAjaxErrorFunction:He,defaultAlertFunction:function(e,t=null){alert(e)},defaultConfirmFunction:function(e,t,n=null){let r=0;confirm(e)&&h(t)&&(t(),r=1),!r&&h(n)&&n()},defaultEndLoadingFunction:Ye,defaultErrorFunction:function(e){b(e)},defaultHistoryFunction:function(e){return!0},defaultLinkFunction:function(e,t){return!0},defaultPostLinkFunction:function(e,t=null){return!0},defaultPreLinkFunction:function(e,t=!1,n=null){return b("defaultPreLinkFunction",e,t,n),!0},defaultResizeFunction:function(){return!0},defaultStartLoadingFunction:function(e,t,n,r){return!0},deleteProp:function(e,t){Ce(e,"object",bbn._("The obj must be an object in setProp")),Ce(t,"string",bbn._("The prop must be a string in setProp")),delete e[t]},diffObj:function e(t,n,r=!1,o=!1){o||(We=[]);let i="unchanged";void 0===o&&(o=!1);let s=Ne();if(!h(t)&&!h(n)){if(Ue(t)||Ue(n)){let e=(a=t)===(l=n)||T(a)&&T(l)&&a.getTime()===l.getTime()?i:void 0===a?"created":void 0===l?"deleted":"updated";if(r||e!==i){let r=Ne();return Object.defineProperty(r,"type",{value:e,enumerable:!1}),Object.defineProperty(r,"data",{value:void 0===t?n:t,enumerable:!1}),Object.defineProperty(r,"_bbnDiffObjProof",{value:!0,enumerable:!1}),void 0!==t&&Object.defineProperty(r,"newData",{value:n,enumerable:!1}),r}return!1}if(N(t)||N(n))return!1;if(We.includes(t)||We.includes(n))return!1;We.push(t,n);for(let o in t){if(h(t[o]))continue;let i;void 0!==n[o]&&(i=n[o]);let a=e(t[o],i,r,!0);a&&(s[o]=a)}for(let o in n){if(h(n[o])||void 0!==t[o])continue;let i=e(void 0,n[o],r,!0);i&&(s[o]=i)}}var a,l;return!(o&&!r&&!D(s))&&s},dirName:qe,download:function(e,t="",n=null){return t&&"object"==typeof t&&(n=t,t=""),ie(e,"blob",n||{_bbn_download:1},(n,r)=>{if(!t){let n="content-disposition",o="attachment; filename=";t=(null==r?void 0:r[n])&&0===r[n].indexOf(o)?m(r[n],o.length+1,r[n].length-o.length-2):le(e)}if(ze(n)){let e=$e(t),r=["php","html"];if("string"==typeof t&&("type"in n&&"text/html"!==n.type||r.includes(e)))return void Je(t,n)}},e=>{bbn.fn.defaultAjaxErrorFunction(e)})},downloadContent:Je,each:y,eraseCookie:function(e){document.cookie=e+"=; Max-Age=-99999999;"},error:Oe,escapeDquotes:function(e){return f(e)?e.replace(/"/g,'\\"'):e},escapeRegExp:ne,escapeSquotes:function(e){return f(e)?e.replace(/'/g,"\\'"):e},escapeTicks:function(e){return f(e)?e.replace(/`/g,"\\`"):e},escapeUrl:function(e,t){let n="";e.match("^(http|https)://")&&(n+="http","s"===(e=e.substring(4)).substr(0,1)&&(n+="s",e=e.substring(1)),n+="://",e=e.substring(3)),y(qe(e).split("/"),e=>{n+=encodeURIComponent(e)+"/"});let r=le(e),o="?",i="";if(r.indexOf(o)){let e=r.split("?");o="&",i="?"+e[1],r=e[0]}return t&&f(t)?(t.match("^(\\&|\\?)")&&(t=t.substring(1)),t=o+t):t="",n+encodeURIComponent(r)+i+t},executeSlowly:function(e,t){return Xe(this,void 0,void 0,function*(){for(let n=0;n<e.length;n++){yield Ke();let r=t(e[n],n);if(r instanceof Promise&&(r=yield r),!1===r)return!1}return!0})},extend:_,extendOut:function e(...t){let n=null;for(let r of t){if(!w(r))throw new Error("Each argument for extendOut must be an object, "+typeof r+" given");if(null===n)n=r;else for(let t in r)w(n[t],r[t])?e(n[t],r[t]):void 0===n[t]&&(n[t]=r[t])}return n},fdate:function(e,t=!1){let n=Ie(e),r=!1;return!0===t&&(r=!0),n.isValid?n.fdate(!1,r):t&&f(t)?t:""},fdatetime:function(e,t=!1){let n=Ie(e);return n.isValid?n.fdate(!1,!0):t&&f(t)?t:""},fieldValue:Ge,fileExt:$e,filter:Fe,filterToConditions:V,findAll:function e(t,n,r,o=[]){let i,s=0;for(;(i=J(t,n,s))>-1;)o.push(t[i]),s=i+1;return y(t,t=>{v(t[r])&&e(t[r],n,r,o)}),o},firstVarElement:function(e){const t=e.indexOf("["),n=e.indexOf(".");return-1===t&&-1===n?e:-1===t?e.substring(0,n):-1===n?e.substring(0,t):e.substring(0,Math.min(t,n))},fori:function(e,t,n=e.length-1,r=0){if(v(e)){let o=e.length-1;u(n)&&0<n&&n<=o||(n=o),(!u(r)||!(0<=r&&r<o)||r>n)&&(r=0);for(let o=r;o<=n;o++)if(!1===t(e[o],o))return}},forir:function(e,t,n=e.length-1,r=0){if(v(e)){let o=e.length-1;u(n)&&0<n&&n<=o||(n=o),(!u(r)||!(0<=r&&r<o)||r>n)&&(r=0);for(let o=n;o>=r;o--)if(!1===t(e[o],o))return}},format:function(e){let t=Array.prototype.slice.call(arguments,1);if(t.length){let n=0;return e.replace(/\%([d|s])/g,(e,r)=>{let o=t[n++];return Ce(o,"d"===r?"number":"string",bbn._("The value doesn't correspond to the format")),o})}return e},formatBytes:function(e,t=2){if(!e)return"0 B";const n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(t<0?0:t))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},formatDate:function(e,t){const n=Ie(e);return n.isValid?n.format(t):""},formatSize:function(e,t){return u(e)?e+"px":f(e)?e:!t&&"auto"},formdata:Qe,fphone:function(e){var t;if(u(e)&&(e=e.toString()),f(e)){const n=(null===(t=bbn.var)||void 0===t?void 0:t.phoneCodes)||[];let r="",o="",i="";if(n.length&&y(n,t=>{e.startsWith(t.prefix)&&t.prefix.length>o.length&&(o=t.prefix,i=t.mask||"")}),!i.length&&e.startsWith("+")){o.length||(o=e.substr(0,3));const t=e.slice(o.length);for(let e=0;e<t.length;e++)e+1<=t.length&&e%2==0&&(i+="0"+(t[e+1]?"0":"")+" ");i=i.trim()}if(i.length){o.length&&(r=o+" ",e=e.slice(o.length));let t=0;return r+=i.replace(/[0-9]/g,()=>e[t++]||""),r}}return e},fromXml:function(e,t){let n=null;if(window.DOMParser)n=(new DOMParser).parseFromString(e,"text/xml");else{if(!window.ActiveXObject)throw new Error("cannot parse xml string!");if(n=new window.ActiveXObject("Microsoft.XMLDOM"),n.async=!1,!n.loadXML(e))throw n.parseError.reason+" "+n.parseError.srcText}function r(e,n){if("#text"==e.nodeName){let t=e.nodeValue;return void(t.trim()&&(n["#text"]=t))}let o={},i=n[e.nodeName];if(i?Array.isArray(i)?n[e.nodeName].push(o):n[e.nodeName]=[i,o]:t&&-1!=t.indexOf(e.nodeName)?n[e.nodeName]=[o]:n[e.nodeName]=o,e.attributes)for(let t of e.attributes)o[t.nodeName]=t.nodeValue;for(let t of e.childNodes)r(t,o)}let o={};for(let e of n.childNodes)r(e,o);return o},ftime:function(e,t){let n=Ie(e);return n.isValid?n.ftime():t&&f(t)?t:""},getAllTags:function(){return et(Array.prototype.map.apply(document.all,[e=>e.tagName.toLowerCase()]))},getAncestors:tt,getAttributes:function(e){e.getAttributeNames||Oe("The element is not a proper HTML Element");let t=Object.create(null);return e.getAttributeNames().forEach(n=>{t[n]=e.getAttribute(n)}),t},getBrowserName:function(){const e=navigator.userAgent.toLowerCase();switch(!0){case e.includes("edge"):case e.includes("edg/"):return"Edge";case e.includes("opr")&&!!window.opr:return"Opera";case e.includes("chrome")&&!!window.chrome:return"Chrome";case e.includes("trident"):return"Internet Explorer";case e.includes("firefox"):return"Firefox";case e.includes("safari"):return"Safari";default:return"Other"}},getBrowserVersion:function(){const e=navigator.userAgent.toLowerCase();switch(!0){case e.includes("edge/"):return e.split("edge/")[1].split(" ")[0];case e.includes("edg/"):return e.split("edg/")[1].split(" ")[0];case e.includes("opr/")&&!!window.opr:return e.split("opr/")[1].split(" ")[0];case e.includes("chrome/")&&!!window.chrome:return e.split("chrome/")[1].split(" ")[0];case e.includes("trident/"):return e.split("trident/")[1].split(" ")[0];case e.includes("firefox/"):return e.split("firefox/")[1].split(" ")[0];case e.includes("safari/"):return e.split("version/")[1].split(" ")[0];default:return""}},getChrono:function(e="default"){return bbn.fn.microtimestamp()-this.constructor.chronos[e]},getCookie:function(e){let t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){let r=n[e];for(;" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t)){let e=r.substring(t.length,r.length);if(e)return JSON.parse(unescape(e)).value}}return null},getCssVar:nt,getDay:function(e){let t=Pe(e);if(t){let e=t.getTime(),r=t.getYear(),o=365*(r-1970);t.getMonth()<2&&r--;for(var n=1972;n<=r;n+=4)o++;return o+Math.floor(e/864e5)}return!1},getDeviceType:rt,getEventData:function(e){let t=e.dataTransfer||e.clipboardData,n=t.getData("Text"),r={raw:n,files:[],str:[]};return new Promise((o,i)=>{let s=!(t instanceof DataTransfer);if(!n&&"copy"===e.type){let e=window.getSelection();r.raw=e.toString();let t=ot();r.str.push({type:"text/plain",data:r.raw}),t!==r.raw?r.str.push({type:"text/html",data:t}):0===r.raw.trim().indexOf("<")&&r.str.push({type:"text/html",data:"<meta charset='utf-8'><code style=\"white-space: pre; font-family: 'Courier New', sans-serif\">\n"+r.raw+"\n</code>"}),s=!0,o(r)}if(!s){let e=[],n=t.items.length;y(t.items,(i,a)=>{let l=i.kind,u=i.type;if("file"===l){let l=t.files[a];if(!u&&l.name){let e=l.name.split(".");u=e[e.length-1]}let c=l?l.name:bbn._("untitled"),f=l?l.size:null,d=l?l.lastModified:null,h=i.getAsFile();h?(s=!0,n--,r.files.push({type:u,data:h,name:c,size:f,mdate:d}),e.push(c),n||(r.raw||(r.raw=e.join(", ")),o(r))):bbn.fn.defaultErrorFunction(bbn._("Impossible to read the file")+" "+c)}else s=!0,i.getAsString(t=>{n--,r.str.push({type:u,data:t}),"text/plain"===u&&e.push(name),n||(r.raw||(r.raw=e.join(", ")),o(r))})})}s||setTimeout(()=>{o(r)})})},getField:function(e,t,n="",r=null,o="=",i=0,s=!1,a=void 0){let l;return n&&["object","function"].includes(typeof n)&&6 in arguments&&(a=s),t?(l=Z(e,n,r,o,i,s,void 0),void 0===l?a:l[t]):a},getFieldValues:function(e,t,n,r,o){Ce(t,"string"),n&&(e=G(e,n,r,o));let i=[];return y(e,e=>-1===i.indexOf(e[t])?i.push(e[t]):null),i},getIndex:function(e,t=""){return e.parentElement?(t||Array.from(e.parentElement.children).indexOf(e),Array.from(e.parentElement.children).filter(e=>e.matches(t)).indexOf(e)):-1},getHtml:function(e,t=!1){let n=e.innerHTML();return t&&(n=it(n)),n.trim()},getHTMLOfSelection:ot,getLoader:X,getPath:P,getProp:function(e,t){return Ce(e,"object",bbn._("The obj must be an object in setProp")),Ce(t,"string",bbn._("The prop must be a string in setProp")),e[t]},getProperty:I,getRequestId:oe,getRow:Z,getScrollBarSize:function(){if(void 0===bbn.env.scrollBarSize){let e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px","msOverflowStyle"in e.style&&(e.style.msOverflowStyle="scrollbar"),document.body.appendChild(e);let t=e.offsetWidth;e.style.overflow="scroll";let n=document.createElement("div");n.style.width="100%",e.appendChild(n);let r=n.offsetWidth;e.parentNode.removeChild(e);let o=t-r;bbn.env.scrollBarSize=o?o+1:0}return bbn.env.scrollBarSize},getSortingMoves:function(e,t){if(e.length!==t.length)throw new Error("Lengths must match.");const n=new Set(t);if(n.size!==t.length)throw new Error("dst has duplicates.");const r=new Set(e);if(r.size!==e.length)throw new Error("src has duplicates.");if(e.length!==n.size||Array.from(r).some(e=>!n.has(e)))throw new Error("Arrays must contain the same unique values.");const o=new Map(t.map((e,t)=>[e,t])),i=(e=>{const t=e.length,n=[],r=Array(t).fill(-1);for(let o=0;o<t;o++){let t=e[o],i=0,s=n.length;for(;i<s;){const r=i+s>>1;e[n[r]]<t?i=r+1:s=r}i>0&&(r[o]=n[i-1]),n[i]=o}const o=[];for(let e=n.length?n[n.length-1]:-1;-1!==e;e=r[e])o.push(e);return o.reverse()})(e.map(e=>o.get(e))),s=new Set(i.map(t=>e[t])),a=Array(t.length).fill(-1);for(let e=t.length-2;e>=0;e--)a[e]=a[e+1],s.has(t[e+1])&&(a[e]=e+1);const l=e.slice(),u=new Map(l.map((e,t)=>[e,t])),c=[];for(let e=0;e<t.length;e++){const n=t[e];if(s.has(n))continue;const r=u.get(n);if(void 0===r)throw new Error("Inconsistent state");const o=a[e],i=-1!==o?u.get(t[o]):l.length;if(void 0===i)throw new Error("Inconsistent state");const f=r<i?i-1:i;if(r!==f){const[e]=l.splice(r,1);l.splice(f,0,e),c.push({from:r,to:f,value:n}),u.clear();for(let e=0;e<l.length;e++)u.set(l[e],e)}}return c},getText:function(e){return e.innerText().trim()},getTimeoff:function(){return bbn.env.isFocused?0:Math.round((new Date).getTime()/1e3-bbn.env.timeoff)},happy:function(...e){return e.unshift({_bbn_console_level:3,_bbn_console_style:"color: white; background: green; font-size: 18px;"}),b.apply(this,e),this},hash:Y,hex2rgb:function(e){"#"!==e.charAt(0)&&(e="#"+e),4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},history:function(){return window.history||!1},html2text:st,imageToCanvas:at,imgToBase64:function(e,t="image/png"){return at(e).toDataURL(t)},info:function(...e){return e.unshift({_bbn_console_level:4,_bbn_console_style:"color: #EEE; background: blue; font-size: 12px;"}),b.apply(this,e),this},init:function(e,t){let n;bbn.env.isInit||(bbn.env.root=document.baseURI.length>0?document.baseURI:bbn.env.host,bbn.env.root.length&&"/"!==m(bbn.env.root,-1)&&(bbn.env.root+="/"),"object"==typeof e&&_(!0,bbn,e),bbn.env.path=m(bbn.env.url,bbn.env.root.length),n=bbn.env.path.split("/"),y(n,(e,t)=>{""!==(e=decodeURI(e.trim()))&&bbn.env.params.push(e)}),bbn.var.colors&&Q(bbn.var.colors),document.addEventListener("visibilitychange",()=>{document.hidden&&bbn.env.isFocused?bbn.env.isFocused=!1:document.hidden||bbn.env.isFocused||(bbn.env.isFocused=!0)}),document.addEventListener("focusin",e=>{e.target instanceof HTMLElement&&!e.target.classList.contains("bbn-no")&&(bbn.env.focused=e.target),bbn.env.last_focus=gt()}),document.addEventListener("click",e=>{if(bbn.env.last_focus=gt(),"ajax"!==bbn.env.nav)return;let t=e.target;if(t instanceof HTMLElement&&"A"!==t.tagName){let e=t;for(;e&&"A"!==e.tagName&&"BODY"!==e.tagName;)e=e.parentElement;t=e&&"A"===e.tagName?e:null}return t instanceof HTMLElement&&t.hasAttribute("href")&&!t.hasAttribute("target")&&!t.classList.contains("bbn-no")?(e.preventDefault(),e.stopPropagation(),ct(t.getAttribute("href")),!1):void 0}),y(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"),e=>{e.addEventListener("submit",t=>{dt(e,t)})}),window.addEventListener("hashchange",()=>{bbn.env.hashChanged=(new Date).getTime()},!1),window.addEventListener("resize",()=>{ht()}),window.addEventListener("orientationchange",()=>{ht()}),ht(),pt()&&(document.body.classList.add("bbn-mobile"),mt()&&document.body.classList.add("bbn-tablet")),window.history&&(window.onpopstate=function(e){let t=window.history;if(!bbn.env.historyDisabled&&t&&bbn.fn.defaultHistoryFunction(t.state)){let e=t.state;e?ct(e.url,_({title:e.title||bbn.env.siteTitle},e.data||{})):e&&e.data&&h(e.data.script)&&e.data.script()}}),window.addEventListener("online",()=>{bbn.env.online=!0}),window.addEventListener("offline",()=>{bbn.env.online=!1}),bbn.env.isInit=!0,document.dispatchEvent(new Event("bbninit")),bbn.env.logging&&b("Logging in bbn is enabled"))},isActiveInterface:function(e=600){return!!bbn.env.last_focus&&(new Date).getTime()-bbn.env.last_focus<1e3*e},isArray:v,isBlob:ze,isBoolean:function(...e){if(!e.length)return!1;for(let t of e)if(![!0,!1].includes(t))return!1;return!0},isCanvas:Ve,isColor:function(...e){if(!e.length)return!1;var t=new RegExp("^(#[a-f0-9]{6}|#[a-f0-9]{3}|rgb *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|rgba *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|black|green|silver|gray|olive|white|yellow|maroon|navy|red|blue|purple|teal|fuchsia|aqua)$","i");for(let n of e){if(!f(n))return!1;if(!t.test(n))return!1}return!0},isComment:function(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof Comment))return!1;return!0},isCp:B,isDataURL:function(...e){if(!e.length)return!1;for(let t of e)if(!/^data:([a-z]+\/[a-z0-9\-\+\.]+(;[a-z\-]+\=[a-z0-9\-\.]+)?)?(;base64)?,/i.test(t))return!1;return!0},isDate:T,isDesktopDevice:function(){return"desktop"===rt()},isDimension:function(...e){if(!e.length)return!1;for(let t of e){if("number"!=typeof t||t<0)return!1;if(!yt(t))return!1}return!0},isDom:N,isEmail:function(...e){if(!e.length)return!1;let t=/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;for(let n of e){if(!f(n))return!1;if(!t.test(n))return!1}return!0},isEmpty:C,isEvent:function(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof Event))return!1;return!0},isFocused:function(e,t=!1){return e===document.activeElement||t&&e.contains&&e.contains(document.activeElement)},isFunction:h,isHex:function(e){return Boolean(e.match(/^(0x)?[0-9a-f]+$/i))},isHostname:function(...e){if(!e.length)return!1;for(let t of e){if(!f(t))return!1;if(!wt(t)&&!bbn.var.regexp.hostname.test(t))return!1}return!0},isInside:function(e,t){let n=tt(e);if(n.length){if(f(t)){let e=!1;return y(n,n=>{if(n.matches&&n.matches(t))return e=!0,!1}),e}if(t instanceof HTMLElement)return n.indexOf(t)>-1}return!1},isInt:d,isInViewport:function(e,t=!1){const n=e.getBoundingClientRect();if(t)return n.top>=0&&n.left>=0&&n.right<=(window.innerWidth||document.documentElement.clientWidth)&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight);const r=e.offsetHeight,o=e.offsetWidth;return n.top>=-r&&n.left>=-o&&n.right<=(window.innerWidth||document.documentElement.clientWidth)+o&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)+r},isIP:wt,isIterable:c,isMobile:pt,isMobileDevice:bt,isNotObject:Ue,isNull:M,isNumber:u,isObject:w,isPercent:function(...e){if(!e.length)return!1;for(let t of e)if("string"!=typeof t||!t.match(/^\d+(?:\.\d+)?%$/))return!1;return!0},isPrimitive:ue,isPromise:function(...e){if(!e.length)return!1;for(let t of e)if("[object Promise]"!=={}.toString.apply(t))return!1;return!0},isPropSize:function(e){let t=!1;return y(["width","height","gap","margin","padding","top","left","right","bottom"],n=>{if(-1!==e.indexOf(n))return t=!0,!1}),t},isSame:q,isSQLDate:function(...e){if(!e.length)return!1;for(let t of e)if("string"!=typeof t||!t.match(/^([1-2]\d{3})-((0\d)|(1[12]))-(([0-2]\d)|(3[01]))(?:( [0-2]\d):([0-5]\d):([0-5]\d))?$/))return!1;return!0},isString:f,isSymbol:vt,isTabletDevice:mt,isURL:function(...e){if(!e.length)return!1;for(let t of e)if(!bbn.var.regexp.url.test(t))return!1;return!0},isUid:function(...e){if(!e.length)return!1;for(let t of e)if("string"!=typeof t||!t.match(/^[0-9a-f]{32}$/i))return!1;return!0},isValidDimension:yt,isValidName:function(...e){if(!e.length)return!1;for(let t of e)if(!f(t)||!/^[$A-Z_][0-9A-Z_$]*$/i.test(t))return!1;return!0},isVue:function(...e){if(!e.length)return!1;if("vue"in bbn&&window.Vue)if("app"in bbn.vue){for(let t of e)if(!t||"function"!=typeof t.render)return!1}else for(let t of e)if(!(t instanceof window.Vue))return!1;return!("cp"in bbn)||!("isComponent"in bbn.cp)||"function"!=typeof bbn.cp.isComponent||bbn.cp.isComponent(...e)},isWritable:function(e,t){let n;for(;e&&(n=Object.getOwnPropertyDescriptor(e,t),!n);)e=Object.getPrototypeOf(e);return!n||Boolean(n.writable||n.set)},iterate:g,lightenDarkenHex:function(e,t){if(e&&t){let n="#"===e[0];e=n?e.slice(1):e;let r=parseInt(e,16),o=(r>>16)+t,i=(r>>8&255)+t,s=(255&r)+t;return o>255?o=255:o<0&&(o=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0),(n?"#":"")+(s|i<<8|o<<16).toString(16)}},link:ct,log:b,makeReactive:function e(t,n,r,o){const i=(null==r?void 0:r.$cid)||"",s="__bbn_"+(i?i+"_":"");if(t&&"object"==typeof t&&[void 0,Object,Array].includes(t.constructor)){if(t.__bbnIsProxy&&t.__bbnParent===r)return t;r&&r.$options&&"bbn-loadbar"===r.$options.name&&b(["MAKING bbn-loadbar",t]),t.__bbnWatchers||Reflect.defineProperty(t,"__bbnWatchers",{value:Ne(),writable:!0,configurable:!0,enumerable:!1});return new Proxy(t,{get(a,l){const c=Reflect.get(a,l),f=a.__bbnRoot||a;if(vt(l))return Reflect.get(f,l);const d=o?o+"."+l:l,m=s+(u(l)?l.toString():l);if(["fill","pop","push","reverse","shift","sort","splice","unshift"].includes(l)&&v(a))return function(...e){let t=f[l](...e);return _t("DOING ARRAY STUFF"),b(a.__bbnParent),n(a,"length",r),t};if(h(c))return c;if("__bbnRoot"===l){let e=t;for(;e&&(null==e?void 0:e.__bbnTarget);)e=e.__bbnTarget;return e}return"__bbnIsProxy"===l||("__bbnTarget"===l?a:"__bbnParent"===l?r:"__bbnWatchers"===l?a.__bbnWatchers:0===l.indexOf("__bbn_")?Reflect.get(a,l):"length"===l&&v(a.__bbnRoot||a)?f.length:l in a&&c&&"object"==typeof c&&[void 0,Object,Array].includes(c.constructor)?(c.__bbnIsProxy&&c.__bbnParent===r||(m in f||Reflect.defineProperty(f,m,{value:e(c,n,r,d),writable:!0,configurable:!0,enumerable:!1}),f[m].__bbnIsProxy&&!f.__bbnWatchers[i]&&(f.__bbnWatchers[i]=d)),f[m]):c)},set(t,a,l){if(vt(a))return Reflect.get(t,a,l);const c=t.__bbnRoot||t,f=o?o+"."+a:a;if(vt(a))return Reflect.get(t,a);if(r&&r.$options&&"bbn-loadbar"===r.$options.name&&b(["Setting proxy prop in "+r.$options.name,t,a,l]),!q(c[a],l)){if(0===a.indexOf("__bbn_"))Reflect.defineProperty(c,a,{value:e(l,n,r,f),writable:!0,configurable:!0,enumerable:!1});else if(l&&"object"==typeof l&&[void 0,Object,Array].includes(l.constructor)){const t=s+(u(a)?a.toString():a);Reflect.defineProperty(c,t,{value:e(l,n,r,f),writable:!0,configurable:!0,enumerable:!1}),c[t].__bbnIsProxy&&!c.__bbnWatchers[i]&&(c.__bbnWatchers[i]=f)}r&&r.$options&&"bbn-loadbar"===r.$options.name&&b(["Setting proxy prop in "+r.$options.name+" "+(u(a)?a.toString():a),l,t]),Reflect.set(c,a,l),n(t,a,r)}return!0},defineProperty(t,i,a){const l=t,c=o?o+"."+i:i;if("__bbnWatchers"===i||vt(i)||0===i.indexOf("__bbn_"))Reflect.defineProperty(l,i,a);else{const t=s+(u(i)?i.toString():i);Reflect.defineProperty(l,t,{value:e(a.value,n,r,c),writable:!0,configurable:!0,enumerable:!1})}return n(t,i,r),!0},deleteProperty(e,t){const n=e;if(0===t.indexOf("__bbn_"))Reflect.deleteProperty(n,t);else{const r=s+(u(t)?t.toString():t);Reflect.deleteProperty(n,r),Reflect.deleteProperty(e,t)}return!0}})}return t},map:function e(t,n,r,o=0){return t.map((t,i)=>(t=n(t,i,o),r&&t[r]&&v(t[r])&&(t[r]=e(t[r],n,r,o+1)),t))},md5:U,microtimestamp:function(){return window.performance.now()+performance.timeOrigin},money:function(e,t,n,r,o,i,s){if(o||(o=void 0===o&&bbn.env.money&&void 0!==bbn.env.money.decimal?bbn.env.money.decimal:"."),n||(n=void 0===n&&bbn.env.money&&void 0!==bbn.env.money.currency?bbn.env.money.currency:""),i||(i=void 0===i&&bbn.env.money&&void 0!==bbn.env.money.thousands?bbn.env.money.thousands:" "),s||(s=void 0===s&&bbn.env.money&&void 0!==bbn.env.money.precision?bbn.env.money.precision:0),t||(t=!(void 0!==t||!bbn.env.money||void 0===bbn.env.money.kilo)&&bbn.env.money.kilo),r||(r=!(void 0!==r||!bbn.env.money||void 0===bbn.env.money.novalue)&&bbn.env.money.novalue),u(s)||(s=t?3:0),0===e&&"number"==typeof s&&s>0){let r=e.toFixed(s).replace(".",o);return n&&(r+=" "+(t?"K"+n:n)),r}if((isNaN(e)||!e)&&r)return r;if(isNaN(e)||!e)return 0+(n?" "+n:"");if("string"==typeof e&&(e=Number(e)),"number"!=typeof e)throw new Error("The value must be a number");t&&e&&(e/=1e3,n&&(n="K"+n));let a=e.toFixed(s),l=0,c=1e4;return a&&(c=a.indexOf("."),c<=0?c=1e4:l=a.length-c),a.replace(/./g,function(e,t,n){return"."===e?o:t&&(n.length-t-l)%3==0&&t<c?i+e:e})+(n?" "+n:"")},move:function(e,t,n){if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}return e.splice(n,0,e.splice(t,1)[0]),e},multiorder:function(e,t){if(!t)return e;let n;if(Array.isArray(t)||"object"!=typeof t)n=t;else for(var r in n=[],t)n.push({field:r,dir:t[r]});if(!Array.isArray(n))throw new Error("The orders argument must be an array");return e.slice().sort((e,t)=>{let r;for(let o of n)if(r=j(e,t,o.field,o.dir),0!==r)return r;return 0})},mutateArray:function(e,t,n=null){if(!v(e,t))throw new TypeError("mutateArray can only be called with arrays");n?Ce(n,"function","The hash function must be a function"):n=Y;const r=new Map(t.map(e=>[n(e),e]));let o=[];t.forEach(e=>{o.push(e)});let i=e.length;for(;i--;)r.has(n(e[i]))||e.splice(i,1);for(let t=0;t<o.length;t++)if(t>=e.length||!q(e[t],o[t])){const n=J(e,o[t]);if(-1!==n){const[r]=e.splice(n,1);e.splice(t,0,r)}else e.splice(t,0,o[t])}return e.length>o.length&&e.splice(o.length,e.length-o.length),e},mutateObject:function(e,t,n){if(!w(e,t))throw new TypeError("mutateObject can only be called with arrays");n?Ce(n,"function","The hash function must be a function"):n=Y;const r=Object.keys(t);for(let t in e)r.includes(t)||delete e[t];return r.forEach(n=>{q(e[n],t[n])||(e[n]=t[n])}),e},nl2br:function(e,t){return re("\n","<br>"+(t?"\n":""),e)},numProperties:D,objectToFormData:Et,order:function(e,t,n="asc"){return e?e.sort(function(e,r){return j(e,r,t,n)}):e},outerHeight:function(e){if((e=St(e))&&"offsetHeight"in e){let t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom);return Math.ceil(e.offsetHeight+n)}},outerWidth:function(e){e=St(e);let t=window.getComputedStyle(e),n=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return Math.ceil(e.offsetWidth+n)},percent:function(e,t){return t/100*e},pickValue:function(e){if(Array.isArray(e)&&e.length)return e[Math.floor(Math.random()*e.length)]},post:ft,postOut:function(e,t,n=null,r=""){let o=document.body.querySelector("form#bbn-form_out");o||(o=document.createElement("form"),o.classList.add("bbn-no"),o.setAttribute("id","bbn-form_out"),o.setAttribute("method","post"),o.setAttribute("enctype","multipart/form-data-encoded"),xt(o,"style.display","none"),document.body.appendChild(o)),o instanceof HTMLFormElement&&(o.innerHTML="",o.setAttribute("action",e),o.setAttribute("target",r||"_blank"),t||(t={}),(t=Ne(t)).bbn||(t.bbn="public"),ee(o,t),o.submit(),n&&n())},printf:function(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,n){return void 0!==t[n]?t[n]:e})},quotes2html:function(e,t){return t&&0!==t.toLowerCase().indexOf("s")||(e=re("'","'",e)),t&&0!==t.toLowerCase().indexOf("d")||(e=re('"',""",e)),e},randomInt:kt,randomString:function(e,t,n){let r,o,i={n:"0123456789",l:"abcdefghijklmnopqrstuvwxyz",u:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};n||(n="nlu"),e||(r=kt(8,14)),"string"==typeof t?(n="n",delete i.l,delete i.u,i.n=t,r||(r=e)):"number"==typeof t&&e<t?r=kt(e,t):e&&(r=e);let s="";for(let e=0;e<r;e++)0===e?"n"!==n&&(o=-1===n.indexOf("u")?"l":"u"):o=n[Math.floor(Math.random()*n.length)],s+=i[o][Math.floor(Math.random()*i[o].length)];return s},removeAccents:O,removeEmpty:function(e){var t=[];if(v(e))for(let n=0;n<e.length;n++){let r=!1;e[n]&&(v(e[n])?e[n].length&&(r=!0):w(e[n])?D(e[n])&&(r=!0):r=!0),r&&t.push(e[n])}return t},removeExtraSpaces:function(e){return e.replace(/\s+/g," ").trim()},removeHtmlComments:it,removePrivateProp:p,removeTrailingChars:function(e,t){if(t||(t=" "),t.length){for(;m(e,-t.length)===t;)e=m(e,0,e.length-t.length);for(;m(e,0,t.length)===t;)e=m(e,t.length)}return e},repeat:function(e,t){return e.repeat(t)},replaceAll:re,replaceSelection:function(e,t){let n,r,o;if(n=window.getSelection(),n.getRangeAt&&n.rangeCount){if(r=window.getSelection().getRangeAt(0),r.deleteContents(),r.createContextualFragment)o=r.createContextualFragment(e);else{const t=document.createElement("div");let n;for(t.innerHTML=e,o=document.createDocumentFragment();n=t.firstChild;)o.appendChild(n)}const i=o.firstChild,s=o.lastChild;r.insertNode(o),n.removeAllRanges(),t?(i&&(r.setStartBefore(i),r.setEndAfter(s)),n.addRange(r)):(r.setStartAfter(s),n.addRange(r))}},resize:ht,rgb2hex:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""},riterate:function(e,t,n=!1){return g(e,t,n,!0)},roundDecimal:function(e,t){return Number(Math.round(parseFloat(e+"e"+t+"e-"+t)))},sanitize:function(e,t="_"){let n=["[","]","{","}","(",")","-","+","*","/"],r="[";for(let e=0;e<t.length;e++)n.includes(t[e])&&(r+="\\"),r+=t[e];r+="]+";let o=new RegExp(r,"g");return At(O(e).replace(/[^a-z0-9]/gi,t).replace(o,t),t)},search:J,selectElementText:function(e,t=null){if(t=t||window,e instanceof HTMLInputElement)return void e.select();let n,r,o=t.document;t.getSelection&&o.createRange?(n=t.getSelection(),r=o.createRange(),r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r)):"createTextRange"in o.body&&"function"==typeof o.body.createTextRange&&(r=o.body.createTextRange(),r.moveToElementText(e),r.select())},selector:St,setCookie:function(e,t,n){let r="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),r="; expires="+e.toUTCString()}let o=escape(JSON.stringify({value:t}));document.cookie=e+"="+o+r+"; path=/"},setCssVar:function(e,t){0!==e.indexOf("--")&&(e="--"+e),document.documentElement.style.setProperty(e,t)},setNavigationVars:ut,setProp:function(e,t,n,r=!0,o=!0){Object.defineProperty(e,t,{value:n,writable:r,configurable:o})},setProperty:xt,shorten:It,shortenObj:function e(t,n=100){let r=Me(t);return y(r,(t,o)=>{f(t)&&t.length>n?r[o]=It(t,n):t&&"object"==typeof t&&(r[o]=e(t))}),r},shuffle:function(e){let t,n=e.length;for(;0!=n;)t=Math.floor(Math.random()*n),n--,[e[n],e[t]]=[e[t],e[n]];return e},simpleHash:R,simpleHash1:L,simpleHash2:F,startChrono:function(e){let t=bbn.fn.microtimestamp();return this.constructor.chronos||Object.defineProperty(this.constructor,"chronos",{value:Object.create(null),writable:!1,configurable:!1}),this.constructor.chronos[e||"default"]=t,e},stopChrono:function(e,t){if(this.constructor.chronos[e||"default"]){let n=bbn.fn.microtimestamp()-this.constructor.chronos[e||"default"];return delete this.constructor.chronos[e||"default"],t&&(n=Math.round(n)/1e3),n}throw Error("No chrono with name "+(e||"default"))},stream:function(e,t,n,r,o,i){const s=oe(e,n,"json"),a=X(s);if(null==a?void 0:a.loader)return a.loader;n||(n={}),bbn.env.token&&(n._bbn_token=bbn.env.token);const l=new AbortController;let u="";const c=e=>{if(e.length){e=e.indexOf("\n")>-1?bbn.fn.removeEmpty(e.split("\n")):[e];for(let n in e)try{t(JSON.parse(e[n]))}catch(e){throw e}}},f=bbn.fn.startChrono(),d=fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",signal:l.signal,body:JSON.stringify(n||{})}).then(e=>{if(bbn.fn.log("RESPONSE IN "+bbn.fn.stopChrono(f,!0)+" SECS"),e.body){const r=e.body.getReader(),o=h(t);r.read().then(function e({done:a,value:l}){if(a)return K(s,n),u&&c(u),void(i&&i());if(o)if(u+=ae(l).trim(),bbn.fn.log(["STREAM RESULT",u.length,u]),u)try{c(u),u=""}catch(e){}else t();else bbn.fn.log(["STREAM SUCCESS IS FN? "+o]);return r.read().then(e)})}}).catch(t=>{let i=!(!(a=t)||!0!==a.__BBN_CANCEL__);var a;if(K(s,n,i),i){let n=1;h(o)&&(n=o(t.message,e)),n&&Be(t.message,e)}else{let e=1;h(r)&&(e=r(t.request,t)),e&&He(t.request,t.response?t.response.data:"",t.response?t.response.status:t)}});return A(s,d,l),d},string2ArrayBuffer:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,o=e.length;r<o;r++)n[r]=e.charCodeAt(r);return t},submit:dt,substr:m,sum:function(e,t,n,r,o){let i=0;return y(Fe(e,n,r,o),e=>{let n="function"==typeof t?t(e):e[t];n&&(i+=parseFloat(n)||0)}),i},timestamp:gt,toCSV:function(e,t=",",n="",r='"'){t||(t=","),r||(r='"');let o="",i=e.length;return y(e,(e,s)=>{let a=v(e)?e.length:Object.values(e).length,l=0;y(e,e=>{o+="string"==typeof e?r+re(r,"\\"+r,e)+r:0===e?"0":e&&e.toString?e.toString():r+r,l++,l<a&&(o+=t)}),s<i-1&&(o+=n+"\n")}),o},toggleFullScreen:function(){"mozRequestFullScreen"in window.document.documentElement?window.document.mozFullScreen?window.document.mozCancelFullScreen():"function"==typeof window.document.documentElement.mozRequestFullScreen&&window.document.documentElement.mozRequestFullScreen():"webkitRequestFullScreen"in window.document.documentElement?window.document.webkitIsFullScreen?window.document.webkitCancelFullScreen():"function"==typeof window.document.documentElement.webkitRequestFullScreen&&window.document.documentElement.webkitRequestFullScreen():"msRequestFullScreen"in window.document.documentElement?window.document.msFullscreenEnabled?window.document.msExitFullscreen():"function"==typeof window.document.documentElement.msRequestFullScreen&&window.document.documentElement.msRequestFullScreen():"requestFullscreen"in window.document&&(window.document.fullscreenEnabled?window.document.exitFullscreen():window.document.documentElement.requestFullscreen()),setTimeout(function(){ht()},0)},translate:function(e,t){let n=t?bbn.lng[0===t.indexOf("_")?t:"_"+t]:bbn.lng;g(e,(e,t)=>{n[t]=e})},treatAjaxArguments:lt,treatForHash:H,trim:At,uniqString:function(...e){for(var t="",n=0;n<e.length;n++)if(e[n])if("object"==typeof e[n])if(v(e[n]))t+=JSON.stringify(e[n]);else{let r={};y(Object.keys(e[n]).sort(),t=>{r[t]=e[n][t]}),t+=JSON.stringify(r)}else"string"!=typeof e[n]?t+=e[n].toString():t+=e[n];else t+="__bbn_empty__";return U(t)},unique:et,upload:function(e,t,n=null,r=null,o=null){const i=()=>l.run("post",e||bbn.env.path,{data:Et({file:t}),headers:{"Content-Type":"multipart/form-data"},onUploadProgress(e){if(o){let t=Math.round(100*e.loaded/e.total);o(t,e.loaded,e.total)}}});return n||r?i().then(e=>{n&&(b("SUCCESS",e),n(e))}).catch(e=>{r&&(b("ERROR",e),r(e))}):i()},warning:_t,yieldToBrowser:Ke};const Tt={version:"1.0.1",opt:{_cat:{}},app:{},_:t,$:function(e,t){if(null==t?void 0:t.querySelectorAll)return t.querySelectorAll(e);if(t)throw new Error("Invalid context");return document.body.querySelectorAll(e)},lng:{select_unselect_all:"Select/Clear all",select_all:"Select all",search:"Search",loading:"Loading...",choose:"Choose",error:"Error",server_response:"Server response",reload:"Reload",errorText:"Something went wrong",closeAll:"Close all",closeOthers:"Close others",pin:"Pin",arrange:"Arrange",cancel:"Cancel",unpin:"Unpin",yes:"Yes",no:"No",unknown:"Unknown",untitled:"Untitled",confirmation:"Confirmation",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},var:n,date:Ie,com:l,env:r,db:k,fn:Ot,info:[{value:"ajax",label:"Loading and streaming",description:"Functions related to Ajax requests",icon:"nf nf-fa-rocket"},{value:"browser",label:"Browser-only",description:"Functions that can only be run in the browser",icon:"nf nf-fa-desktop"},{value:"convert",label:"Conversion",description:"Functions related to data conversion",icon:"nf nf-fa-exchange"},{value:"datetime",label:"Date and time",description:"Functions related to dates and times",icon:"nf nf-fa-calendar"},{value:"form",label:"Form manipulation",description:"Functions related to form manipulation and validation",icon:"nf nf-fa-edit"},{value:"html",label:"HTML manipulation",description:"Functions related to HTML manipulation and DOM interaction",icon:"nf nf-fa-html5"},{value:"loop",label:"Looping",description:"Functions related to looping through arrays and objects",icon:"nf nf-fa-repeat"},{value:"misc",label:"Miscellaneous",description:"Miscellaneous functions that do not fit into other categories",icon:"nf nf-fa-cubes"},{value:"object",label:"Object manipulation",description:"Functions related to object manipulation and inspection",icon:"nf nf-fa-object_group"},{value:"phone",label:"Phone and contact",description:"Functions related to phone numbers and contact information",icon:"nf nf-fa-phone"},{value:"string",label:"String manipulation",description:"Functions related to string manipulation and formatting",icon:"nf nf-fa-text_height"},{value:"style",label:"Styling and layout",description:"Functions related to styling and layout management",icon:"nf nf-fa-paint_brush"},{value:"type",label:"Type checking",description:"Functions related to type checking and validation",icon:"nf nf-fa-check_square"}]};return"undefined"!=typeof window&&(window.bbn=Tt),e.bbn=Tt,e.default=Tt,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
1
|
+
var bbn=function(e){"use strict";function t(e,...t){let n=bbn.lng[e]||e;if(t.length){let e=0;return n.replace(/\%([d|s])/g,(n,r)=>{let o=t[e++];o||(o="d"===r?0:"");const i=typeof o;return"d"===r&&"number"!==i?(o=parseFloat(o),isNaN(o)&&(o=0)):"s"===r&&"string"!==i&&(o=""+o),o})}return n}var n={loggers:{_num:0},datatypes:["xml","html","script","json","jsonp","text","blob"],shortenLen:30,keys:{upDown:[33,34,35,36,38,40],leftRight:[36,35,37,39],dels:[8,46,45],confirm:[13,9],alt:[20,16,17,18,144],numbers:[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105],numsigns:[109,110,189,190]},comparators:[">=","<=",">","<","="],operators:["+","-","/","*"],tags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],colors:{darkgrey:"#5a6a62",black:"#000000",anthracite:"#454545",grey:"#d3d3d3",white:"#ffffff",beige:"#fdfdfd",lightgrey:"#dcdcdc",pastelblue:"#ddebf6",cyan:"#00c8f8",blue:"#6e9ecf",indigo:"#3f51b5",navy:"#354458",webblue:"#2196f3",teal:"#009688",turquoise:"#1fda9a",pastelgreen:"#e2efda",palegreen:"#ccffcc",green:"#00a03e",olive:"#92b06a",pastelorange:"#fff2cc",yellow:"#fdf200",orange:"#ff9900",pink:"#eb65a0",purple:"#a333c8",red:"#db3340",brown:"#8c6954"},reserved:["abstract","boolean","break","byte","case","catch","char","class","continue","const","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","new","null","package","return","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","while","with"],mockText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",regexp:{url:new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),ip:/^((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/,hostname:/^[a-z\d]([a-z\d-]{0,61}[a-z\d])?(\.[a-z\d]([a-z\d-]{0,61}[a-z\d])?)*$/i}},r={siteTitle:window.document.title,logging:!1,cdn:"",lang:"en",host:window.location.protocol+"//"+window.location.hostname,url:window.location.href,old_path:null,loading:!1,_enumerated:[],get isEnumerating(){return this._enumerated.length>0},width:0,height:0,focused:!1,last_focus:(new Date).getTime(),sleep:!1,theme:"dark",loaders:[],loadersHistory:[],maxLoadersHistory:50,resizeTimer:!1,hashChanged:0,params:[],isInit:!1,isFocused:!1,timeoff:Math.round((new Date).getTime()/1e3),loggingLevel:5,ignoreUnload:!1,historyDisabled:!1,nav:"ajax",online:window.navigator.onLine},o=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};class i extends Error{constructor(e){super(e||"Request canceled"),this.name="Cancel",this.__BBN_CANCEL__=!0}}const s=["POST","PUT","PATCH","DELETE"],a=(e,t,n={},r)=>{const o=new XMLHttpRequest,a=s.includes(e.toUpperCase()),l=new Promise((r,s)=>{o.open(e,t,!0);const{body:l,headers:u}=((e,t)=>{const n=new Headers(t||{});let r=e;return null==e||e instanceof FormData||"object"!=typeof e||(n.set("Content-Type","application/json"),r=JSON.stringify(e)),{body:r,headers:n}})(n.data,n.headers);u.forEach((e,t)=>{o.setRequestHeader(t,e)}),"function"==typeof n.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e=>{const t=e.lengthComputable?e.total:void 0;n.onUploadProgress({loaded:e.loaded,total:t,progress:t?e.loaded/t:void 0})}),o.onreadystatechange=()=>{if(4!==o.readyState)return;const e=(e=>{const t={};return e?(e.trim().split(/[\r\n]+/).forEach(e=>{const n=e.split(": "),r=n.shift(),o=n.join(": ");r&&(t[r.toLowerCase()]=o)}),t):t})(o.getAllResponseHeaders()),t=1223===o.status?204:o.status,i=o.statusText||"";let a=o.responseText;if((e["content-type"]||"").includes("application/json"))try{a=JSON.parse(o.responseText)}catch(e){}const l={data:a,status:t,statusText:i,headers:e,config:n,request:o};if(t>=200&&t<300)r(l);else{const e=new Error("Request failed with status code "+t);e.response=l,e.config=n,e.request=o,s(e)}},o.onerror=()=>{const e=new Error("Network Error");e.config=n,e.request=o,s(e)},o.onabort=()=>{s(new i("Request canceled"))},a?o.send(l):o.send()});return l.cancel=()=>o.abort(),l};var l={isCancel:e=>!(!e||!0!==e.__BBN_CANCEL__),run:(e,t,n={},r)=>{n.baseURL&&!/^https?:\/\//i.test(t)&&(t=n.baseURL.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")),t=((e,t)=>{if(!t)return e;const n=new URLSearchParams(t).toString();return n?e+(e.includes("?")?"&":"?")+n:e})(t,n.params);return"function"==typeof n.onUploadProgress&&s.includes(e.toUpperCase())?a(e,t,n):((e,t,n={},r)=>{const a={method:e,headers:new Headers(n.headers||{}),signal:null==r?void 0:r.signal},l=s.includes(e.toUpperCase());if(null!=n.data&&l&&(bbn.fn.log("DATA",n.data),"object"!=typeof n.data||n.data instanceof FormData?a.body=n.data:(a.headers.set("Content-Type","application/json"),a.body=JSON.stringify(n.data))),n.params){const e=new URLSearchParams(n.params).toString();t+=(t.includes("?")?"&":"?")+e}const u=fetch(t,a).then(e=>o(void 0,void 0,void 0,function*(){let t;t=(e.headers.get("content-type")||"").includes("application/json")?yield e.json():yield e.text();const r={data:t,status:e.status,statusText:e.statusText,headers:Object.fromEntries(e.headers.entries()),config:n,request:e};if(!e.ok){const t=new Error("Request failed with status code "+e.status);throw t.response=r,t.config=n,t.request=e,t}return r})).catch(e=>{if("AbortError"===e.name)throw new i("Request canceled");throw e});return u.cancel=()=>r.abort(),u})(e,t,n,r)}};function u(...e){if(!e.length)return!1;for(let t of e)if(["boolean","object","symbol"].includes(typeof t)||""===t||isNaN(t))return!1;return!0}function c(...e){if(!e.length)return!1;for(let t of e)if(!t||"object"!=typeof t||!(Symbol.iterator in Object(t)))return!1;return!0}function f(...e){if(!e.length)return!1;for(let t of e)if("[object String]"!=={}.toString.apply(t))return!1;return!0}function d(...e){if(!e.length)return!1;for(let t of e)if(!Number.isInteger(t))return!1;return!0}function h(...e){if(!e.length)return!1;for(let t of e)if(!(t&&t.constructor&&t.call&&t.apply))return!1;return!0}function b(...e){var t,n,r;if((null===(t=bbn.env)||void 0===t?void 0:t.isDev)&&void 0!==(null===window||void 0===window?void 0:window.console)){let t,o=5,i="log";e[0]&&"object"==typeof e[0]&&e[0]._bbn_console_style&&(e[0]._bbn_console_mode&&h(console[e[0]._bbn_console_mode])?i=e[0]._bbn_console_mode:(t=e[0]._bbn_console_style,o=e[0]._bbn_console_level),e.shift());const s=window.console[i];if((null===(r=null===(n=window.bbn)||void 0===n?void 0:n.env)||void 0===r?void 0:r.loggingLevel)>=o){let n=0;for(;n<e.length;){let r=typeof e[n],o=[e[n]];"string"!==r&&"number"!==r||o.unshift("%c %s ",t),s.apply(window.console,o),n++}}}return this}function m(e,t,n){if(!f(e)||!d(t))throw b(arguments),new Error(bbn._("The substr function should be applied to a string and at least a `from` argument should be given"));return t<0&&(t=e.length+t),d(n)?e.substring(t,(n<0?e.length:t)+n):e.substring(t)}function p(e,t=!1){let n=null;if("object"==typeof e)for(var r in n={},e)m(r,0,1).match(/^[A-z0-9]$/)&&r in e&&(t&&"object"==typeof e[r]?n[r]=p(e[r],!0):n[r]=e[r]);return n||!1}function g(e,t,n=!1,r=!1){if(null!==e&&"object"==typeof e){let o=Object.keys(n?p(e):e);r&&o.reverse();for(let n of o)if(!1===t(e[n],n))break}return e}function y(e,t){if(!(u(e)&&e>0)){if(c(e)){for(let n=0;n<e.length;n++)if(!1===t(e[n],n))return;return e}return g(e,t)}for(let n=0;n<e;n++)if(!1===t(n,n))return}function w(...e){if(!e.length)return!1;for(let t of e)if("[object Object]"!=={}.toString.apply(t))return!1;return!0}function v(...e){if(!e.length)return!1;for(let t of e)if(!Array.isArray(t))return!1;return!0}function _(...e){let t=!1,n=[];for(let r=0;r<e.length;r++)if(!0===e[r])t=!0;else{if(!e[r])continue;if("object"!=typeof e[r])throw new Error(bbn._("Error in extend: all arguments should be object, you have given ")+typeof e[r]);n.push(e[r])}if(!n.length)throw new Error("No argument given");let r,o=n[0];for(let e=1;e<n.length;e++)g(n[e],(e,n)=>{t?v(e)?(o[n]=v(o[n])?o[n]:[],y(e,(e,t)=>{if(e&&"object"==typeof e){let r=o[n][t];v(e)?v(r)||(r=[]):w(r)||(r={}),o[n][t]=_(!0,r,e)}else o[n][t]=e})):w(e)?o[n]=_(!0,o[n]&&"object"==typeof o[n]?o[n]:Object.create(Object.getPrototypeOf(e)),e):o[n]=e:(o[n]!==e||void 0===e&&!Object.prototype.hasOwnProperty.apply(o,[n]))&&(o[n]=e)}),r||(r=!!n[e].__bbnNoData);return r&&"bbnData"in window&&(o.__bbnData&&o.__bbnData.unset(),Object.defineProperty(o,"__bbnNoData",{value:!0,enumerable:!1,configurable:!1,writable:!1})),o}const E=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB,S=(e,t)=>{if(null==t?void 0:t.length){let n={};return g(e,(e,r)=>{t.indexOf(r)>-1&&(n[r]=e)}),n}return e},x=function(e){const n=k._connections[e],r=k._structures[e];let o=null;const i=(e,t)=>{e.onerror=()=>{o=e.error,b(e.error),t(e.error)}},s=(e,t)=>{const r=n.transaction([e],0===t.toLowerCase().indexOf("r")?"readonly":"readwrite");return r.onabort=()=>{throw o=r.error,new Error(r.error)},[r,r.objectStore(e)]};this.lastError=()=>o,this.insert=(e,t)=>(Array.isArray(t)||(t=[t]),new Promise(n=>{const[r,o]=s(e,"w");let i=t.length;y(t,e=>{const t=o.put(e);t.onerror=()=>{b(t.error),i--}}),r.oncomplete=()=>{n(i)}})),this.update=(e,n,o,a)=>new Promise(l=>{this.selectAll(e,[],o).then(o=>{if(!o.length)return void l(0);const[u,c]=s(e,"w"),f=r[e],d=f.keys.PRIMARY.columns.length>1?f.keys.PRIMARY.columns:f.keys.PRIMARY.columns[0];let h=0;for(let e=0;e<o.length;e++){const r=_({},a?{[d]:o[e][d]}:o[e],n);if(!r[d])throw new Error(t("No primary key in the data"));const s=c.put(r);i(s,l),s.onsuccess=()=>{h++}}u.oncomplete=()=>{l(h)}})}),this.delete=(e,n)=>new Promise(o=>{const[a,l]=s(e,"w"),u=r[e],c=u.keys.PRIMARY.columns.length>1?u.keys.PRIMARY.columns:u.keys.PRIMARY.columns[0];if(!n[c])throw new Error(t("No "));const f=l.delete(n[c]);i(f,o),a.oncomplete=()=>{o(1)}}),this.selectOne=(e,t,n,r,o,i)=>new Promise(i=>{this.selectAll(e,[t],n,r,o,1).then(e=>{var n,r;i(null!==(r=null===(n=null==e?void 0:e[0])||void 0===n?void 0:n[t])&&void 0!==r?r:void 0)})}),this.select=(e,t,n,r,o)=>new Promise(i=>{this.selectAll(e,t,n,r,o,1).then(e=>{i(e.length?e[0]:null)})}),this.selectAll=(e,t=[],n=null,o=null,a=0,l=null)=>new Promise(o=>{const[u,c]=s(e,"r"),f=r[e],d=f.keys.PRIMARY.columns.length>1?f.keys.PRIMARY.columns:f.keys.PRIMARY.columns[0],h=w(n)?Object.keys(n)[0]:!n||v(n)?null:d,b=[];if(h===d)if(bbn.fn.isArray(null==n?void 0:n[d])){const e=Math.min(n[d].length,l||9999999);for(let r=a||0;r<e;r++){let s=c.get(n[d][r]);s.onsuccess=()=>{let n=s.result;b.push(S(n,t)),b.length===e&&o(b)},i(s,o)}}else{let e=c.get((null==n?void 0:n[d])||n);e.onsuccess=()=>{let n=e.result;b.push(S(n,t)),o(b)},i(e,o)}else{const e=c.openCursor();let r=0;e.onsuccess=e=>{const i=e.target.result;i?(n&&bbn.fn.search([i.value],n)||(r>=a&&(b.push(S(i.value,t)),b.length===l&&o(b)),r++),i.continue()):o(b)},i(e,o)}}),this.getColumnValues=(e,t,r,o,i,s)=>new Promise(t=>{n.transaction([e],"read").objectStore(e)}),this.copyTable=(o,i,s=[],a=null,l=null,u=0,c=null)=>new Promise(f=>{if(n.objectStoreNames.contains(o)||k.add(e,o,r[i]),!n.objectStoreNames.contains(o))throw f(0),new Error(t("The target table %s does not exist",o));this.selectAll(i,s,a,l,u,c).then(e=>{e.length?this.insert(o,e).then(e=>{f(e)}):f(0)})}),this.deleteTable=e=>new Promise(t=>{n.deleteObjectStore(e),t(!0)})},k={_structures:{},_connections:{},_stores:{},ok:void 0!==E,updateStructure(e,t,n){const r=t.keys.PRIMARY.columns.length>1?t.keys.PRIMARY.columns:t.keys.PRIMARY.columns[0];if(!n.objectStoreNames.contains(e)){const o=n.createObjectStore(e,{keyPath:r});g(t.keys,(e,t)=>{"PRIMARY"!==t&&o.createIndex(t,e.columns.length>1?e.columns:e.columns[0],{unique:!!e.unique})})}},open(e){return new Promise(n=>{if(k._connections[e])n(new x(e));else{if(!k._structures[e])throw new Error(t("Impossible to find a structure for the database %s",e));let r=Math.max.apply(this,[1].concat(Object.keys(k._structures[e]).map(t=>k._structures[e][t].num||1)));const o=E.open(e,r);o.onupgradeneeded=()=>{const t=o.result;g(k._structures[e],(e,n)=>{this.updateStructure(n,e,t)})},o.onsuccess=()=>{k._connections[e]=o.result;let t=new x(e);n(t)}}})},add(e,n,r){var o;if(!(null===(o=null==r?void 0:r.keys)||void 0===o?void 0:o.PRIMARY)||!(null==r?void 0:r.fields))throw new Error(t("The database structure for %s is not valid (are there keys and field? Is there a primary?",n));k._structures[e]||(k._structures[e]={}),k._structures[e][n]=r,k._connections[e]&&this.updateStructure(n,r,k._connections[e])}};function A(e,t,n){let r=(new Date).getTime(),o={key:e,url:m(e,0,e.length-33),loader:t,aborter:n,loading:!0,error:!1,abort:!1,errorMessage:!1,success:!1,start:r};bbn.env.loaders.push(o),bbn.env.loadersHistory.unshift(o);let i=bbn.env.loadersHistory.length;for(;i&&bbn.env.loadersHistory.length>bbn.env.maxLoadersHistory;)i--,bbn.env.loading||bbn.env.loadersHistory.splice(i,1);return r}function I(e,...t){if("object"==typeof e){const n=[];return 1===t.length&&"string"==typeof t[0]?n.push(...t[0].split(".")):n.push(...t),n.reduce((e,t)=>{if(e)return e[e instanceof Array?parseInt(t):t]},e)}}function O(e){if(!f(e)){if(!e.toString)throw b(e),new Error(bbn._("removeAccent expects a string"));e=e.toString()}return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function T(...e){if(!e.length)return!1;for(let t of e)if("[object Date]"!=={}.toString.apply(t))return!1;return!0}function j(e,t,n,r="asc"){let o=I(e,n),i=I(t,n),s=(typeof o).toLowerCase(),a=(typeof i).toLowerCase();if("asc"!==r&&f(r)&&"desc"===r.toLowerCase()&&(r="desc"),s!==a)o=s,i=a;else switch(s){case"string":o=O(o).toLowerCase(),i=O(i).toLowerCase();break;case"boolean":o=o?1:0,i=i?1:0;break;case"object":T(o)&&(o=o.getTime(),i=T(i)?i.getTime():0)}return o<i?"desc"===r?1:-1:o>i?"desc"===r?-1:1:0}function D(e){return e&&"object"==typeof e?Object.keys(e).length:0}function C(e){return!e||(v(e)?!e.length:"object"==typeof e&&!D(e))}function M(...e){if(!e.length)return!1;for(let t of e)if("[object Null]"!=={}.toString.apply(t))return!1;return!0}function L(e){let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return Math.abs(t).toString(16)}function F(e){let t=0;for(let n=0;n<e.length;n++){t=e.charCodeAt(n)+(t<<6)+(t<<16)-t,t|=0}return Math.abs(t).toString(16)}function R(e){return L(e).padStart(8,"0")+F(e).padStart(8,"0")}function N(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof HTMLElement))return!1;return!0}function P(e){let t="",n=e;if(e.id)return"#"+e.id;for(;n&&n!==document.body;){let e=n,r=e.localName,o=0;if(!r)break;if(e===document.body)break;e.id&&(t="#"+e.id+">"+t,o=1);let i=n.parentNode,s=Array.from(i.children).filter(t=>t.tagName===e.tagName);if(!o&&s.length>1){let t=Array.from(i.children).indexOf(e)+1;t>1&&(r+=":nth-child("+t+")")}t=r+(t?">"+t:""),n=i}return t}function B(...e){var t;if(!e.length)return!1;if(!("cp"in bbn)||!("isComponent"in bbn.cp)||"function"!=typeof bbn.cp.isComponent)return!1;for(let n of e){if(!bbn.cp.isComponent(n)||N(n)||!(null===(t=n.$el)||void 0===t?void 0:t.bbnCid))return!1}return!0}function H(e,t=null,n=0,r=null,o=null){if(n||r||(r=new WeakSet),void 0===e)e="__BBN_UNDEFINED__";else if(null===e)e="__BBN_NULL__";else if(null===e)e="__BBN_NULL__";else if("function"==typeof e)e="__BBN_FUNCTION__"+e.toString();else if("symbol"==typeof e)e="__BBN_SYMBOL__"+e.toString();else if("string"==typeof e)e="__BBN_STRING__"+e;else if("number"==typeof e)e="__BBN_NUMBER__"+e.toString();else if("boolean"==typeof e)e="__BBN_BOOLEAN__"+e.toString();else if([void 0,Object,Array,null].includes(null==e?void 0:e.constructor)){if(bbn.fn.isArray(e))if(r.has(e)||t&&t<n)e="__BBN_ARRAY__"+e.constructor.toString();else{r.add(e);let i="";for(let s=0;s<e.length;s++)i+="__BBN_ITEM"+s.toString()+"__"+o(e[s],t,n+1,r,o);e="__BBN_ARRAY__"+i}else if("object"==typeof e)if(r.has(e)||t&&t<n)e="__BBN_OBJECT__"+(e.constructor?e.constructor.toString():"");else{r.add(e);let i="";for(let s in e){let a=s;"string"!=typeof a&&(a=o(a,o,1,1)),i+="__BBN_PROP_"+a+"__"+o(e[s],t,n+1,r,o)}e="__BBN_OBJECT__"+i}}else e=N(e)?B(e)?"__BBN_CP__"+e.$cid:e.bbnId?"__BBN_DOM__"+e.tagName+"/"+e.bbnId+e.bbnHash:"__BBN_DOM__"+P(e):"__BBN_UNKNOWN_OBJECT__"+e.constructor.toString();return e}function Y(...e){let t="",n=null;2===e.length&&"number"==typeof e[1]&&(n=e[1],e=[e[0]]);for(let r in e)t+=H(e[r],n,0,null,H);return R(t)}function U(e){var t="0123456789abcdef";function n(e){var n,r="";for(n=0;n<=3;n++)r+=t.charAt(e>>8*n+4&15)+t.charAt(e>>8*n&15);return r}function r(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t,n,o,i,s){return r(function(e,t){return e<<t|e>>>32-t}(r(r(t,e),r(o,s)),i),n)}function i(e,t,n,r,i,s,a){return o(t&n|~t&r,e,t,i,s,a)}function s(e,t,n,r,i,s,a){return o(t&r|n&~r,e,t,i,s,a)}function a(e,t,n,r,i,s,a){return o(t^n^r,e,t,i,s,a)}function l(e,t,n,r,i,s,a){return o(n^(t|~r),e,t,i,s,a)}var u,c,f,d,h,b=function(e){var t,n=1+(e.length+8>>6),r=new Array(16*n);for(t=0;t<16*n;t++)r[t]=0;for(t=0;t<e.length;t++)r[t>>2]|=e.charCodeAt(t)<<t%4*8;return r[t>>2]|=128<<t%4*8,r[16*n-2]=8*e.length,r}(e),m=1732584193,p=-271733879,g=-1732584194,y=271733878;for(u=0;u<b.length;u+=16)c=m,f=p,d=g,h=y,m=i(m,p,g,y,b[u+0],7,-680876936),y=i(y,m,p,g,b[u+1],12,-389564586),g=i(g,y,m,p,b[u+2],17,606105819),p=i(p,g,y,m,b[u+3],22,-1044525330),m=i(m,p,g,y,b[u+4],7,-176418897),y=i(y,m,p,g,b[u+5],12,1200080426),g=i(g,y,m,p,b[u+6],17,-1473231341),p=i(p,g,y,m,b[u+7],22,-45705983),m=i(m,p,g,y,b[u+8],7,1770035416),y=i(y,m,p,g,b[u+9],12,-1958414417),g=i(g,y,m,p,b[u+10],17,-42063),p=i(p,g,y,m,b[u+11],22,-1990404162),m=i(m,p,g,y,b[u+12],7,1804603682),y=i(y,m,p,g,b[u+13],12,-40341101),g=i(g,y,m,p,b[u+14],17,-1502002290),m=s(m,p=i(p,g,y,m,b[u+15],22,1236535329),g,y,b[u+1],5,-165796510),y=s(y,m,p,g,b[u+6],9,-1069501632),g=s(g,y,m,p,b[u+11],14,643717713),p=s(p,g,y,m,b[u+0],20,-373897302),m=s(m,p,g,y,b[u+5],5,-701558691),y=s(y,m,p,g,b[u+10],9,38016083),g=s(g,y,m,p,b[u+15],14,-660478335),p=s(p,g,y,m,b[u+4],20,-405537848),m=s(m,p,g,y,b[u+9],5,568446438),y=s(y,m,p,g,b[u+14],9,-1019803690),g=s(g,y,m,p,b[u+3],14,-187363961),p=s(p,g,y,m,b[u+8],20,1163531501),m=s(m,p,g,y,b[u+13],5,-1444681467),y=s(y,m,p,g,b[u+2],9,-51403784),g=s(g,y,m,p,b[u+7],14,1735328473),m=a(m,p=s(p,g,y,m,b[u+12],20,-1926607734),g,y,b[u+5],4,-378558),y=a(y,m,p,g,b[u+8],11,-2022574463),g=a(g,y,m,p,b[u+11],16,1839030562),p=a(p,g,y,m,b[u+14],23,-35309556),m=a(m,p,g,y,b[u+1],4,-1530992060),y=a(y,m,p,g,b[u+4],11,1272893353),g=a(g,y,m,p,b[u+7],16,-155497632),p=a(p,g,y,m,b[u+10],23,-1094730640),m=a(m,p,g,y,b[u+13],4,681279174),y=a(y,m,p,g,b[u+0],11,-358537222),g=a(g,y,m,p,b[u+3],16,-722521979),p=a(p,g,y,m,b[u+6],23,76029189),m=a(m,p,g,y,b[u+9],4,-640364487),y=a(y,m,p,g,b[u+12],11,-421815835),g=a(g,y,m,p,b[u+15],16,530742520),m=l(m,p=a(p,g,y,m,b[u+2],23,-995338651),g,y,b[u+0],6,-198630844),y=l(y,m,p,g,b[u+7],10,1126891415),g=l(g,y,m,p,b[u+14],15,-1416354905),p=l(p,g,y,m,b[u+5],21,-57434055),m=l(m,p,g,y,b[u+12],6,1700485571),y=l(y,m,p,g,b[u+3],10,-1894986606),g=l(g,y,m,p,b[u+10],15,-1051523),p=l(p,g,y,m,b[u+1],21,-2054922799),m=l(m,p,g,y,b[u+8],6,1873313359),y=l(y,m,p,g,b[u+15],10,-30611744),g=l(g,y,m,p,b[u+6],15,-1560198380),p=l(p,g,y,m,b[u+13],21,1309151649),m=l(m,p,g,y,b[u+4],6,-145523070),y=l(y,m,p,g,b[u+11],10,-1120210379),g=l(g,y,m,p,b[u+2],15,718787259),p=l(p,g,y,m,b[u+9],21,-343485551),m=r(m,c),p=r(p,f),g=r(g,d),y=r(y,h);return n(m)+n(p)+n(g)+n(y)}function W(e){const t="function"==typeof e?e.toString():e;if("string"!=typeof t)throw Error("Unexpected type "+typeof e+" while parsing function");let n,r="",o=!1,i=!1,s=!1,a="",l=0,u=0,c=[],f={},d="",h=['"',"'","`"],b=!1,m=!1,p=!1,g=!1,y=!1,w=!1,v="";for(let e=0;e<t.length;e++)if(p||"/"!==t[e]||"*"!==t[e+1])if("/"===t[e]&&"*"===t[e-1])p=!1;else if(g||"/"!==t[e]||"/"!==t[e+1])if("\n"===t[e])g=!1;else{if(p||g)continue;if(t[e]===d&&!b&&d)d="",r+=t[e];else if(d)b="\\"===t[e]&&!b,r+=t[e];else if(h.includes(t[e])&&!b)d=t[e],r+=t[e];else if("("===t[e]){if(l++,""!==r.trim()){if("function"===r.trim())s=!0;else if("async"!==r.trim()){a=r.trim();let e=a.match(/^([a-zA-Z0-9_]+)<[a-zA-Z0-9_]+>$/);e&&(a=e[1])}r=""}}else if(")"===t[e])l===u+1&&(m?(f.default=r.trim(),m=!1):r&&(f.name=r.trim()),(f.name||f.default)&&(c.push(f),f={}),r=""),u++;else if(y&&"}"!==t[e])r+=t[e];else{if(l&&l===u&&":"===t[e]){const r=t.substring(e+1).trim().match(/^\s*([a-zA-Z0-9_]+)\s*\{/);if(!r)throw Error("Unexpected ':' while parsing function");v=r[1],n=t.substring(e+r[0].length).trim();break}if(!(r||"="!==t[e]||">"!==t[e+1]||l!==u||u||o)){f.name=t.slice(0,e).trim(),c.push(f),f={},o=!0,n=bbn.fn.substr(t,e+2).trim();break}if(l===u&&"="===t[e]&&">"===t[e+1]){""!==r.trim()&&(f.name=r.trim(),c.push(f),f={},r=""),o=!0,e++;continue}if("="===t[e]&&l>u&&!m)f.name=r.trim(),r="",m=!0;else if(","===t[e])if(y)r+=t[e];else{if(!(l>u))throw Error("Unexpected ',' while parsing function");m?(f.default=r.trim(),m=!1):r&&(f.name=r.trim()),(f.name||f.default)&&(c.push(f),f={}),r=""}else if("{"===t[e]||"}"===t[e]){if(l===u){n=t.substring(e).trim();break}l>u?"{"!==t[e]||y?"}"===t[e]&&y&&(y=!1,r+=t[e]):(y=!0,r=t[e]):r=""}else{if(o){n=t.substring(t.indexOf("=>")+2).trim();break}" "===t[e]?""!==r.trim()&&("async"===r.trim()&&(i=!0),l>u?r+=t[e]:r=""):r+=t[e]}}}else g=!0,r="";else p=!0,r="";if(!n){if(!o)throw Error("Unexpected end of function while parsing function");n=r}n.substr(0,25).indexOf("[native code]")>-1&&(w=!0);const _=c.map(e=>e.name+(e.default?" = "+e.default:"")).join(", ");return{body:n,args:c,argString:_,isArrow:o,hasFunction:s,name:a,isAsync:i,isBinary:w,hash:U(n+(a?"-"+a:"")+(_?"-"+_:"")),returnType:v}}function q(e,t,n){if(n||(n=[]),e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(![void 0,Object,Array,null].includes(null==e?void 0:e.constructor)||![void 0,Object,Array,null].includes(null==t?void 0:t.constructor))return!1;let r=Object.keys(e).sort(),o=Object.keys(t).sort();if(Y(r)!==Y(o))return!1;let i=!0;if(e&&"object"==typeof e){if(n.includes(e))return i;n.push(e)}return y(r,n=>{if(!q(e[n],t[n]))return i=!1,!1}),i}if(e&&t&&"function"==typeof e&&"function"==typeof t){let n=W(e),r=W(t),o=n.hash===r.hash;return o&&n.isBinary&&(o=!1),o}return!1}function z(e,t,n){switch(n){case"===":case"=":case"equal":case"eq":case"is":return e===t;case"!==":case"notequal":case"neq":case"isnot":return e!==t;case"!=":case"different":return e!=t;case"contains":case"contain":case"icontains":case"icontain":return!C(e)&&!C(t)&&-1!==O(e).toLowerCase().indexOf(O(t).toLowerCase());case"doesnotcontain":case"donotcontain":return!(!M(e)&&!M(t))||-1===O(e.toLowerCase()).indexOf(O(t.toLowerCase()));case"starts":case"start":return!M(e)&&!M(t)&&("string"!=typeof e&&(e=e.toString()||""),"string"!=typeof t&&(t=t.toString()||""),0===e.indexOf(t));case"startswith":case"startsi":case"starti":case"istarts":case"istart":return!M(e)&&!M(t)&&0===O(e).toLowerCase().indexOf(O(t).toLowerCase());case"endswith":case"endsi":case"endi":case"iends":case"iend":return!M(e)&&!M(t)&&e.lastIndexOf(t)===e.length-t.length;case"like":return!M(e)&&!M(t)&&O(e).toLowerCase()===O(t).toLowerCase();case"gt":case">":return e>t;case"gte":case">=":return e>=t;case"lt":case"<":return e<t;case"lte":case"<=":return e<=t;case"isnull":return null===e;case"isnotnull":return null!==e;case"isempty":return""===e;case"isnotempty":return""!==e;case"==":if(w(e,t))return q(e,t);default:return e==t}}function $(e,t){if(!t.conditions||!t.logic||!v(t.conditions))throw new Error("Error in compareConditions: the filter should an abject with conditions and logic properties and conditions should be an array of objects");let n="AND"===t.logic;return y(t.conditions,r=>{let o;if(r.conditions&&v(r.conditions))o=$(e,r);else if(o=z(I(e,r.field),r.value,r.operator),o){let t=r.field.split("."),n=t.pop();t.length&&y(t,t=>e=e[t]),void 0===I(e,n)&&void 0!==r.value&&(o=!1)}if(o){if("OR"===t.logic)return n=!0,!1}else if("AND"===t.logic)return n=!1,!1}),n}function V(e,t="="){if(!w(e))throw new Error("Error in filterToCondition: filter must be an object");if(!e.conditions||!v(e.conditions)){let n=[];g(e,(e,r)=>{w(e)&&"object"==typeof e.conditions?n.push(V(e)):n.push({field:r,operator:t,value:e})}),e={conditions:n}}return e.logic||(e.logic="AND"),e}function J(e,t,n=null,r="=",o=0,i=!1){if(!c(e))throw new Error(bbn._("The first argument for a search should be iterable")+" "+typeof e+" "+bbn._("given"));if(!e.length)return-1;let s,a,l=!1;if(t)if("string"==typeof t)s={conditions:[{field:t,value:n,operator:r||"="}]};else if(i=!0===r,o="number"==typeof n?n:i?e.length-1:0,"function"==typeof t)l=!0,a=t;else if(w(t))if("field"in t&&"value"in t)s={conditions:[t],logic:"AND"};else if("conditions"in t)s=t;else{const e=[];for(let n in t)e.push({field:n,value:t[n],operator:"="});s={conditions:e,logic:"AND"}}else v(t)&&(s={conditions:t,logic:"AND"});else l=!0,a=e=>$({value:e},V({logic:"AND",conditions:[{field:"value",operator:r||"=",value:n}]}));if(l||s){if("number"!=typeof o&&(o=i?e.length-1:0),!a){const e=V(s);a=t=>$(t,e)}if(i)for(let t=o;t>=0;t--){if(bbn.env._enumerated.push(!0),a(e[t]))return bbn.env._enumerated.pop(),e[t],t;bbn.env._enumerated.pop()}else for(let t=o;t<e.length;t++){if(bbn.env._enumerated.push(!0),a(e[t]))return bbn.env._enumerated.pop(),e[t],t;bbn.env._enumerated.pop()}}return-1}function Z(e,t,n=null,r="=",o=0,i=!1,s=!1){let a=J(e,t,n,r,o,i);return a>-1?e[a]:t&&["object","function"].includes(typeof t)&&5 in arguments?i:s}function K(e,t=null,n=!1){let r=J(bbn.env.loaders,{key:e});if(r>-1){let o=bbn.env.loaders.splice(r,1)[0],i=Z(bbn.env.loadersHistory,{key:e,start:o.start});return i&&(i.loading=!1,i.duration=(new Date).getTime()-o.start,"string"==typeof t?(i.errorMessage=t,i.error=!n,i.abort=n):w(t)&&(i.success=!0)),!0}return!1}function X(e){let t=J(bbn.env.loaders,{key:e});return t>-1?bbn.env.loaders[t]:null}function G(e,t,n=null,r="=",o=0){if(!v(e))try{e=Array.from(e)}catch(t){throw bbn.fn.log("NOT ARRAY",e),new Error("Error in filter: The first argument must be an array")}let i={};const s=[],a="function"==typeof t;if(!t||!e.length)return e;if("object"==typeof t)i=t;else if("string"==typeof t)i[t]=n;else if(!a)throw new Error("Search function error: The prop argument should be a string or an object");let l;l="function"==typeof t?t:(e,t)=>$(e,i);for(let t=0;t<e.length&&(bbn.env._enumerated.push(!0),!(l(e[t],t)&&(bbn.env._enumerated.pop(),s.push(e[t]),bbn.env._enumerated.push(!0),o&&s.length>=o)));t++)bbn.env._enumerated.pop();return s}function Q(e){if(D(e)){bbn.var.colors||(bbn.var.colors={});let t=document.createElement("style");document.head.appendChild(t);let n=t.sheet,r=0;g(e,(e,t)=>{bbn.var.colors[t]=e,n.insertRule(".bbn-"+t+", .bbn-color-text-"+t+" {color: "+e+" !important;}",r),n.insertRule("svg.bbn-"+t+", .bbn-"+t+" svg, svg.bbn-color-text-"+t+", .bbn-color-text-"+t+" svg {fill: "+e+";}",r),n.insertRule(".bbn-bg-"+t+", .bbn-color-bg-"+t+", .bbn-color-background-"+t+" {background-color: "+e+" !important;}",r),n.insertRule(".bbn-border-"+t+", .bbn-color-border-"+t+" {border-color: "+e+" !important;}",r),n.insertRule(".bbn-color-"+t+" {border-color: "+e+"; background-color: "+e+"; color: "+e+";}",r)})}}function ee(e,t=null,n=""){if(e&&"FORM"===e.tagName){let r=(t,n)=>{let r=document.createElement("input");r.setAttribute("type","hidden"),r.setAttribute("name",t),r.setAttribute("value",n),e.appendChild(r)};t=JSON.parse(JSON.stringify(t||{})),n=n||"",t&&g(t,(t,o)=>{let i=n?`${n}[${o}]`:o;t instanceof Date?r(i,t.toISOString()):t instanceof Array?t.forEach((t,n)=>{const o=`${i}[${n}]`;"object"==typeof t?ee(e,t,o):r(o,t.toString())}):"object"!=typeof t||t instanceof File?r(i,t.toString()):ee(e,t,i)})}}function te(e,t){let n=0;y(t,t=>{t.style[e]="auto"}),y(t,(t,r)=>{let o=t.getBoundingClientRect(),i=o[e]%1?o[e]-o[e]%1+1:o[e];i>n&&(n=i)}),y(t,(t,r)=>{n&&(t.style[e]=n+"px")})}function ne(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function re(e,t,n,r=""){return n.toString().replace(w(e)?e:new RegExp(ne(e),"g"+r),t)}function oe(e,t,n){let r={};return t&&g(t,(e,t)=>{-1===t.indexOf("_bbn")&&(r[t]=e)}),e+":"+U((n||"json")+JSON.stringify(r))}function ie(e,t=null,n=null,r=null,o=null,i=null){if(null===t&&e&&"object"==typeof e&&e.url&&(e.abort&&(i=e.abort),e.failure&&(o=e.failure),e.success&&(r=e.success),e.data&&(n=e.data),e.datatype&&(t=e.datatype),e=e.url),e&&e&&"string"==typeof e){-1===e.indexOf("://")&&(e=re("//","/",e)),t||(t="json");let s=oe(e,n,t),a=X(s);if(null==a?void 0:a.loader)return a.loader;bbn.env.token&&_(n||{},{_bbn_token:bbn.env.token});const u=new AbortController;let c={responseType:t,signal:u.signal};"text"===t?c.headers={accept:"text/javascript","Content-Type":"text/javascript"}:"json"===t?c.headers={accept:"application/json","Content-Type":"application/json"}:"html"===t&&(c.headers={accept:"text/html","Content-Type":"text/html"});let f="get";w(n)&&D(n)>0&&(c.data=n,f="post");let d=l.run(f,e,c).then(t=>{if(K(s,t),bbn.fn.defaultEndLoadingFunction(e,b,n,t),200===t.status)h(r)&&r(t.data,t.headers);else{let e=1;h(o)&&(e=o(d,t.message,t)),e&&bbn.fn.defaultAjaxErrorFunction(d,t.message,t)}return t}).catch(t=>{let r=l.isCancel(t);if(K(s,t.message||t.response.data,r),bbn.fn.defaultEndLoadingFunction(e,b,n,t),r){let n=1;h(i)&&(n=i(t.message,e)),n&&bbn.fn.defaultAjaxAbortFunction(t.message,e)}else{let e=1;h(o)&&(e=o(d,t.message,t)),e&&bbn.fn.defaultAjaxErrorFunction(d,t.message,t.response)}return t.response}),b=A(s,d,u);return bbn.fn.defaultStartLoadingFunction(e,b,n,s),d}}const se=new TextDecoder;function ae(e){return se.decode(e)}function le(e,t){if(e&&f(e)){let n=e.split("/").pop();if(!t)return n;let r=t.length;if(n&&m(n,-r)===t)return m(n,0,n.length-r)}return""}function ue(...e){if(!e.length)return!1;for(let t of e)if(null!==t&&("object"==typeof t||"function"==typeof t))return!1;return!0}var ce,fe,de,he,be,me,pe,ge=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},ye=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const we=[{name:"mariadb-datetime",re:/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:+e[4],minute:+e[5],second:+e[6]})},{name:"mariadb-datetime-no-sec",re:/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:+e[4],minute:+e[5],second:0})},{name:"mariadb-date",re:/^(\d{4})-(\d{2})-(\d{2})$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:0,minute:0,second:0})},{name:"iso-datetime",re:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?(?:Z|[+\-]\d{2}:?\d{2})?$/,map:e=>({year:+e[1],month:+e[2],day:+e[3],hour:+e[4],minute:+e[5],second:void 0!==e[6]?+e[6]:0})},{name:"slash-date",re:/^(\d{2})\/(\d{2})\/(\d{4})$/,map:e=>({year:+e[3],month:+e[2],day:+e[1],hour:0,minute:0,second:0})},{name:"slash-datetime",re:/^(\d{2})\/(\d{2})\/(\d{4})[ T](\d{2}):(\d{2}):(\d{2})$/,map:e=>({year:+e[3],month:+e[2],day:+e[1],hour:+e[4],minute:+e[5],second:+e[6]})}],ve=[["y","year",31536e6],["m","month",2592e6],["w","week",6048e5],["d","day",864e5],["h","hour",36e5],["i","minute",6e4],["s","second",1e3]],_e={y:"Year",m:"Month",d:"Date",w:"Week",h:"Hours",i:"Minutes",s:"Seconds"},Ee={y:"YYYY",m:"MM",d:"DD",e:"EE",w:"WW",h:"HH",i:"II",s:"SS"},Se={years:"y",year:"y",YEARS:"y",YEAR:"y",Years:"y",Year:"y",YYYY:"y",YY:"y",yyyy:"y",yy:"y",months:"m",month:"m",Months:"m",Month:"m",MONTHS:"m",MONTH:"m",MMMM:"m",MMM:"m",MM:"m",weekday:"e",WEEKDAY:"e",ee:"e",EE:"e",ddd:"e",days:"d",day:"d",Days:"d",Day:"d",DAYS:"d",DAY:"d",DD:"d",dd:"d",hours:"h",hour:"h",Hours:"h",Hour:"h",HOURS:"h",HOUR:"h",HH:"h",hr:"h",hh:"h",minutes:"i",minute:"i",Minutes:"i",Minute:"i",MINUTES:"i",MINUTE:"i",II:"i",ii:"i",mn:"i",mm:"i",min:"i",SS:"s",ss:"s",seconds:"s",second:"s",Seconds:"s",Second:"s",SECONDS:"s",SECOND:"s",sec:"s",WW:"w",Y:"y",y:"y",M:"m",m:"m",e:"e",E:"e",D:"d",d:"d",H:"h",h:"h",n:"i",i:"i",s:"s",S:"s",W:"w",w:"w"},xe={};class ke{constructor(e,t,n=!1){ce.add(this),fe.set(this,0),de.set(this,"");const r=Se[t]||t;if(!r)throw new Error("Invalid unit for duration: "+t);ge(this,de,r,"f");const o=Z(ve,e=>e[0]===r);if(!o)throw new Error("Invalid unit for duration: "+r);const i=o[2];ge(this,fe,n?e:e*i,"f")}years(e=!1){return ye(this,ce,"m",be).call(this,"year",e)}months(e=!1){return ye(this,ce,"m",be).call(this,"month",e)}weeks(e=!1){return ye(this,ce,"m",be).call(this,"week",e)}days(e=!1){return ye(this,ce,"m",be).call(this,"day",e)}hours(e=!1){return ye(this,ce,"m",be).call(this,"hour",e)}minutes(e=!1){return ye(this,ce,"m",be).call(this,"minute",e)}seconds(e=!1){return ye(this,ce,"m",be).call(this,"second",e)}toJSON(){return{years:this.years(!0),months:this.months(!0),days:this.days(!0),hours:this.hours(!0),minutes:this.minutes(!0),seconds:this.seconds(!0),milliseconds:this.toMilliseconds()}}asYears(){const[,,e]=ye(this,ce,"m",he).call(this,"year");return ye(this,fe,"f")/e}asMonths(){const[,,e]=ye(this,ce,"m",he).call(this,"month");return ye(this,fe,"f")/e}asWeeks(){const[,,e]=ye(this,ce,"m",he).call(this,"week");return ye(this,fe,"f")/e}asDays(){const[,,e]=ye(this,ce,"m",he).call(this,"day");return ye(this,fe,"f")/e}asHours(){const[,,e]=ye(this,ce,"m",he).call(this,"hour");return ye(this,fe,"f")/e}asMinutes(){const[,,e]=ye(this,ce,"m",he).call(this,"minute");return ye(this,fe,"f")/e}asSeconds(){const[,,e]=ye(this,ce,"m",he).call(this,"second");return ye(this,fe,"f")/e}add(e,t){const n=t?Se[t]||t:ye(this,de,"f"),r=Z(ve,e=>e[0]===n);if(!r)throw new Error("Invalid unit for duration: "+(null!=t?t:n));return new ke(ye(this,fe,"f")+e*r[2],ye(this,de,"f"),!0)}subtract(e,t){return this.add(-e,t)}toMilliseconds(){return ye(this,fe,"f")}}fe=new WeakMap,de=new WeakMap,ce=new WeakSet,he=function(e){const t=Z(ve,t=>t[1]===e);if(!t)throw new Error("Unit name not found: "+e);return t},be=function(e,t){const n=ve.findIndex(([,t])=>t===e);if(-1===n)throw new Error("Unit not found: "+e);const r=ve[n][2];if(!t)return Math.floor(ye(this,fe,"f")/r);let o=ye(this,fe,"f");for(let e=0;e<n;e++){const[,,t]=ve[e];o-=Math.floor(o/t)*t}return Math.floor(o/r)};class Ae{static parse(e,t,n){var r,o,i,s;"monthsLong"in xe||_(xe,(()=>{const e=[bbn.env.lang,...navigator.languages],t=new Intl.DateTimeFormat(e,{month:"long"}),n=new Intl.DateTimeFormat(e,{month:"short"}),r=new Intl.DateTimeFormat(e,{weekday:"long"}),o=new Intl.DateTimeFormat(e,{weekday:"short"}),i=[],s=[];for(let e=0;e<12;e++){const r=new Date(2020,e,1);i.push(t.format(r)),s.push(n.format(r))}const a=new Date(2020,1,2),l=[],u=[];for(let e=0;e<7;e++){const t=new Date(a.getTime()+864e5*e);l.push(r.format(t)),u.push(o.format(t))}return{monthsLong:i,monthsShort:s,weekdaysLong:l,weekdaysShort:u}})());const a={monthsLong:null!==(r=null==n?void 0:n.monthsLong)&&void 0!==r?r:xe.monthsLong,monthsShort:null!==(o=null==n?void 0:n.monthsShort)&&void 0!==o?o:xe.monthsShort,weekdaysLong:null!==(i=null==n?void 0:n.weekdaysLong)&&void 0!==i?i:xe.weekdaysLong,weekdaysShort:null!==(s=null==n?void 0:n.weekdaysShort)&&void 0!==s?s:xe.weekdaysShort},l={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0},u=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=[...[{token:"YYYY",regex:"\\d{4}",apply:e=>{l.year=parseInt(e,10)}},{token:"YY",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);l.year=t>=70?1900+t:2e3+t}},{token:"Y",regex:"[+-]?\\d{1,6}",apply:e=>{l.year=parseInt(e,10)}},{token:"MMMM",regex:"[^\\d\\s]+",apply:e=>{const t=a.monthsLong.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid month name: "+e);l.month=t+1}},{token:"MMM",regex:"[^\\d\\s]+",apply:e=>{const t=a.monthsShort.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid short month name: "+e);l.month=t+1}},{token:"MM",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>12)throw new Error("Invalid month: "+t);l.month=t}},{token:"mm",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.month=t}},{token:"M",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>12)throw new Error("Invalid month: "+t);l.month=t}},{token:"m",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>12)throw new Error("Invalid month: "+t);l.month=t}},{token:"DD",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>31)throw new Error("Invalid day of month: "+t);l.day=t}},{token:"D",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>31)throw new Error("Invalid day of month: "+t);l.day=t}},{token:"d",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>31)throw new Error("Invalid day of month: "+t);l.day=t}},{token:"dddd",regex:"[^\\d\\s]+",apply:e=>{const t=a.weekdaysLong.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid weekday name: "+e);l.weekday=t}},{token:"ddd",regex:"[^\\d\\s]+",apply:e=>{const t=a.weekdaysShort.findIndex(t=>t.toLowerCase()===e.toLowerCase());if(-1===t)throw new Error("Invalid short weekday name: "+e);l.weekday=t}},{token:"EE",regex:"\\d{1}",apply:e=>{const t=parseInt(e,10);if(t<0||t>7)throw new Error("Invalid weekday number: "+t);l.weekday=t}},{token:"HH",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>23)throw new Error("Invalid hour: "+t);l.hour=t}},{token:"H",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>23)throw new Error("Invalid hour: "+t);l.hour=t}},{token:"h",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>23)throw new Error("Invalid hour: "+t);l.hour=t}},{token:"II",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.minute=t}},{token:"I",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.minute=t}},{token:"i",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid minute: "+t);l.minute=t}},{token:"SS",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid second: "+t);l.second=t}},{token:"S",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid second: "+t);l.second=t}},{token:"s",regex:"\\d{2}",apply:e=>{const t=parseInt(e,10);if(t<0||t>59)throw new Error("Invalid second: "+t);l.second=t}},{token:"ms",regex:"\\d{1,3}",apply:e=>{const t=parseInt(e,10);if(t<0||t>999)throw new Error("Invalid millisecond: "+t);l.ms=t}},{token:"WWWW",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}},{token:"WWW",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}},{token:"WW",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}},{token:"W",regex:"\\d{1,2}",apply:e=>{const t=parseInt(e,10);if(t<1||t>53)throw new Error("Invalid week number: "+t);l.week=t}}]].sort((e,t)=>t.token.length-e.token.length);let f="";const d=[];let h=0;for(;h<t.length;){let e=null;for(const n of c)if(t.startsWith(n.token,h)){e=n;break}e?(f+=`(${e.regex})`,e.apply?d.push(e.apply):d.push(()=>{}),h+=e.token.length):(f+=u(t[h]),h+=1)}const b=new RegExp("^"+f+"$").exec(e);if(!b)throw new Error(`Date string "${e}" does not match format "${t}"`);for(let e=1;e<b.length;e++){const t=b[e],n=d[e-1];null!=t&&n&&n(t)}const m=new Date(l.year,l.month-1,l.day,l.hour,l.minute,l.second,l.ms);if(m.getFullYear()!==l.year||m.getMonth()!==l.month-1||m.getDate()!==l.day||m.getHours()!==l.hour||m.getMinutes()!==l.minute||m.getSeconds()!==l.second||m.getMilliseconds()!==l.ms)throw new Error("Invalid date produced from components");return void 0!==l.weekday&&m.getDay(),m}constructor(e,t=null){me.set(this,void 0),pe.set(this,!1);let n=typeof e;if(e)if(t)this.matchFormat(e,t)&&ge(this,me,Ae.parse(e,t),"f");else if(("number"===n||u(e)&&""!==e)&&(e<5e3&&u(t)?e=Array.from(arguments):e<1e10&&(e*=1e3),Array.isArray(e)||ge(this,me,new Date(e),"f")),"string"===n){for(const t of we){const n=e.match(t.re);if(n){const{year:e,month:r,day:o,hour:i,minute:s,second:a}=t.map(n);ge(this,me,new Date(e,r-1,o,i,s,a,0),"f")}}if(!ye(this,me,"f"))throw new Error("Invalid date string format: "+e)}else T(e)?ge(this,me,e,"f"):Array.isArray(e)&&ge(this,me,new Date(...e),"f");else ge(this,me,new Date,"f")}parse(e,t){const n=Ae.parse(e,t);return new Ae(n)}matchFormat(e,t){try{return Ae.parse(e,t),!0}catch(e){return!1}}toString(){return ye(this,me,"f")?this.format():""}year(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setFullYear(e),new Ae(t)}return ye(this,me,"f").getFullYear()}}month(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setMonth(e-1),new Ae(t)}return ye(this,me,"f").getMonth()+1}}day(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setDate(e),new Ae(t)}return ye(this,me,"f").getDate()}}hour(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setHours(e),new Ae(t)}return ye(this,me,"f").getHours()}}minute(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setMinutes(e),new Ae(t)}return ye(this,me,"f").getMinutes()}}second(e){if(ye(this,me,"f")){if(0 in arguments&&void 0!==e&&!(e instanceof Event)){const t=this.copy();return t.setSeconds(e),new Ae(t)}return ye(this,me,"f").getSeconds()}}weekday(e,t=!1){if(ye(this,me,"f"))return!(0 in arguments)||void 0===e||e instanceof Event?ye(this,me,"f").getDay():this.setWeekday(e,t)}week(){const e=new Date(Date.UTC(this.year(),this.month()-1,this.day())),t=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+(4-t));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}get tst(){return Math.ceil(ye(this,me,"f").getTime()/1e3)}get mtst(){return ye(this,me,"f").getTime()}get YYYY(){return this.year().toString()}get YY(){return m(this.year().toString(),2,2)}get MMMM(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{month:"long"}).format(ye(this,me,"f"))}get MMM(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{month:"short"}).format(ye(this,me,"f"))}get MM(){const e=parseInt(this.month().toString());return e<10?"0"+e.toString():e.toString()}get M(){return this.month().toString()}get EE(){return this.weekday().toString()}get DD(){const e=parseInt(this.day().toString());return e<10?"0"+e.toString():e.toString()}get d(){return this.day().toString()}get dddd(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{weekday:"long"}).format(ye(this,me,"f"))}get ddd(){return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],{weekday:"short"}).format(ye(this,me,"f"))}get D(){return this.day().toString()}get HH(){const e=parseInt(this.hour().toString());return e<10?"0"+e.toString():e.toString()}get H(){return this.hour().toString()}get II(){const e=parseInt(this.minute().toString());return e<10?"0"+e.toString():e.toString()}get mm(){const e=parseInt(this.minute().toString());return e<10?"0"+e.toString():e.toString()}get I(){return this.minute().toString()}get SS(){const e=parseInt(this.second().toString());return e<10?"0"+e.toString():e.toString()}get S(){return this.second().toString()}get WW(){const e=parseInt(this.year().toString()),t=new Date(e,0,1),n=(ye(this,me,"f").getTime()-t.getTime())/864e5;return String(Math.ceil((n+t.getDay()+1)/7)).padStart(2,"0")}get isValid(){return void 0!==ye(this,me,"f")}inLeapYear(){if(this.isValid){const e=ye(this,me,"f").getFullYear();return e%4==0&&e%100!=0||e%400==0}return!1}daysInMonth(){if(this.isValid)switch(ye(this,me,"f").getMonth()){case 1:return ye(this,me,"f").getFullYear()%4==0?29:28;case 0:case 3:case 5:case 8:case 10:return 30;default:return 31}}valueOf(){return this.mtst}add(e,t="d"){const n=ye(this,me,"f")?new Date(ye(this,me,"f").getTime()):new Date;if(Se[t]){const r=Se[t],o="y"===r?"FullYear":_e[r],i="get"+o;return n["set"+o](n[i]()+e),new Ae(n)}return null}subtract(e,t){return this.add(-e,t)}dateFromFormat(e,t){return new Date}date(e){return!(0 in arguments)||void 0===e||e instanceof Event?this.format("Y-m-d"):this.parse(e,"Y-m-d")}datetime(e){return!(0 in arguments)||void 0===e||e instanceof Event?this.format("Y-m-d H:i:s"):this.parse(e,"Y-m-d H:i:s")}time(e){return!(0 in arguments)||void 0===e||e instanceof Event?this.format("H:i:s"):this.parse(e,"H:i:s")}fdate(e=!1,t=!1,n=!1){if(!ye(this,me,"f"))return"";const r=Object.assign(Object.assign({year:"numeric",month:e?"long":"numeric",day:"numeric"},n?{weekday:e?"long":"short"}:{}),t?{hour:e?"2-digit":"numeric",minute:"2-digit"}:{});return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],r).format(ye(this,me,"f"))}ftime(e=!1){if(!ye(this,me,"f"))return"";const t={hour:"2-digit",minute:"2-digit"};e&&(t.second="2-digit");return new Intl.DateTimeFormat([bbn.env.lang,...navigator.languages],t).format(ye(this,me,"f"))}format(e="YYYY-MM-DD HH:II:SS"){let t="";if(e){const n=new RegExp("([|]|"+Object.keys(Se).join("|")+")","g");let r=0;y(e.split(n),e=>{if("["!==e)if("]"!==e)if(r>0)t+=e;else if(e in Se)if(e in this&&ue(this[e]))t+=this[e];else{t+=this[Ee[Se[e]]]}else t+=e;else r--;else r++})}return t}unix(e=!1){if("number"==typeof e){const t=this.copy();return t.setTime(1e3*e),new Ae(t)}return ye(this,me,"f")?e?ye(this,me,"f").getTime():Math.floor(ye(this,me,"f").getTime()/1e3):0}sql(e=!1){return ye(this,me,"f")?e?this.format("YYYY-MM-DD"):this.format("YYYY-MM-DD HH:II:SS"):""}compare(e,t=""){var n;const r=e instanceof Ae?e:new Ae(e),o=Se[t]||null;if(!o)return this.mtst<r.mtst?-1:this.mtst>r.mtst?1:0;const i=["y","m","d","h","i","s"];for(const e of i){const t=null===(n=Z(ve,t=>t[0]===e))||void 0===n?void 0:n[1],i=this[t](),s=r[t]();if(i<s)return-1;if(i>s)return 1;if(e===o)break}return 0}isBefore(e,t=""){return-1===this.compare(e,t)}isAfter(e,t="day"){return 1===this.compare(e,t)}isSame(e,t="day"){return 0===this.compare(e,t)}isAfterOrSame(e,t=""){return[0,1].includes(this.compare(e,t))}isBeforeOrSame(e,t=""){return[-1,0].includes(this.compare(e,t))}fromNow(e=""){const t=new Date,n=Se[e]||this.guessUnit(this.diff(t)),r=this.diff(t,n),o=new Intl.RelativeTimeFormat([bbn.env.lang,...navigator.languages],{numeric:"auto"}),i=Z(ve,e=>e[0]===n);if(!i)throw new Error("Invalid unit for fromDate: "+e);return o.format(r,i[1])}fromDate(e,n=""){const r=Se[n]||this.guessUnit(this.diff(e)),o=this.diff(e,r);return o>0?t("%d %s before",o,n):o<0?t("%d %s after",-o,n):t("The same %s",n)}guessUnit(e){const t=Math.abs(e);for(const[e,n,r]of ve)if(t>=r||"second"===n)return e}diff(e,t="",n=!1){const r=e instanceof Ae?e.mtst:new Date(e).getTime();let o=this.mtst-r;if(n&&(o=Math.abs(o)),!t)return o;const i=Se[t],s=Z(ve,e=>e[0]===i);if(!s)throw new Error("Invalid unit for diff: "+t);const[a,l,u]=s;return Math.round(o/u)}calendar(e){return""}getWeekday(e,t="long",n){if(!t){const t=this.getWeekday(e,"narrow",n),r=this.getWeekday(e,"short",n),o=this.getWeekday(e,"long",n);return{letter:t,abbr:r,full:o,long:o,short:r,narrow:t}}let r;if("letter"===t)r="narrow";else if("abbr"===t)r="short";else if("full"===t)r="long";else{if(!["long","short","narrow"].includes(t))throw new Error("Invalid mode for getWeekDay: "+t+'. Allowed values are "long", "short", "narrow", "letter", "abbr", "full".');r=t}return new Date(2023,0,1+e).toLocaleDateString([n||bbn.env.lang,...navigator.languages],{weekday:r})}getWeekdayIndex(e,t){const n=t||bbn.env.lang,r=e.trim().toLowerCase(),o=[n,...navigator.languages];for(let e=0;e<o.length;e++){if(!o[e])continue;const t=new Intl.DateTimeFormat(o[e],{weekday:"long"});for(let e=0;e<7;e++){const n=new Date(2023,0,1+e);if(t.format(n).toLowerCase()===r)return e}}throw new Error(`Unknown weekday name '${e}' for locale '${n}'`)}setWeekday(e,t=!1,n){let r;if("string"==typeof e&&(e=this.getWeekdayIndex(e,n)),"number"!=typeof e)throw new TypeError("weekday must be a number (0–6) or a string");if(e<0||e>6)throw new RangeError("weekday number must be between 0 and 6");r=e;const o=this.weekday();let i;t?(i=(o-r+7)%7,0===i&&(i=7),i=-i):(i=(r-o+7)%7,0===i&&(i=7));const s=this.copy();return s.setDate(s.getDate()+i),new Ae(s)}copy(){return new Date(ye(this,me,"f").getTime())}clone(){return new Ae(ye(this,me,"f")?new Date(ye(this,me,"f").getTime()):void 0)}startOf(e="d"){const t=Se[e];if(!t)throw new Error("Invalid unit for startOf: "+e);let n;switch(t){case"y":n=new Date(this.year(),0,1,0,0,0,0);break;case"m":n=new Date(this.year(),this.month()-1,1,0,0,0,0);break;case"w":{const e=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),this.second(),0),t=(e.getDay()+6)%7;n=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t,0,0,0,0);break}case"d":n=new Date(this.year(),this.month()-1,this.day(),0,0,0,0);break;case"h":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),0,0,0);break;case"i":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),0,0);break;case"s":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),this.second(),0);break;default:throw new Error("Invalid unit for startOf: "+e)}return new Ae(n)}endOf(e="d"){const t=Se[e];if(!t)throw new Error("Invalid unit for endOf: "+e);let n;switch(t){case"y":n=new Date(this.year(),11,31,23,59,59,999);break;case"m":n=new Date(this.year(),this.month(),0,23,59,59,999);break;case"w":{const e=this.startOf("w"),t=new Date(e.year(),e.month()-1,e.day(),23,59,59,999);t.setDate(t.getDate()+6),n=t;break}case"day":n=new Date(this.year(),this.month()-1,this.day(),23,59,59,999);break;case"hour":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),59,59,999);break;case"minute":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),59,999);break;case"second":n=new Date(this.year(),this.month()-1,this.day(),this.hour(),this.minute(),this.second(),999);break;default:n=new Date(this.mtst)}return new Ae(n)}duration(e,t="s"){return new ke(e,t)}}function Ie(e,t=null){return e instanceof Ae?e:new Ae(e,t)}function Oe(e){if(arguments.length>1){const e=[];for(let t=1;t<arguments.length;t++)e.push(arguments[t]);e.unshift({_bbn_console_mode:"error",_bbn_console_level:1,_bbn_console_style:"color: #E64141; background: #F7E195; font-size: 14px"}),b.apply(this,e)}throw new Error(e)}function Te(e,t=null,n=null,r=null,o=null){let i=!1;if(t){i=!0;let s,a="object"===(typeof t).toLowerCase();if(a&&t.prescript)try{new Function(t.prescript)()}catch(e){Oe(e.message||"")}if(a&&void 0===t.url&&(t.url=e),i=n&&h(n)?n(t,o):bbn.fn.defaultLinkFunction(t,o),o&&a&&void 0!==t.content&&("value"in o?o.value=t.content:o.innerHTML=t.content),i&&a&&t.script&&(i="function"==typeof t.script?t.script(t.data?t.data:{},o||null):((e,n)=>{let r=null;try{r=new Function(t.script)(),h(r)&&(r=r(e,n))}catch(e){b(e,t),Oe(h(e.getMessage)?e.getMessage():null)}return r})(t.data?t.data:{},o||!1)),i&&r&&h(r)?r(t):a&&bbn.fn.defaultPostLinkFunction&&bbn.fn.defaultPostLinkFunction(t,o),i&&a&&t.postscript){new Function(t.postscript)(t.postscript)}a&&t.error&&(s=t.errorTitle||bbn.lng.server_response,bbn.fn.defaultErrorFunction(t.error,s))}else bbn.fn.defaultErrorFunction(bbn.lng.errorText,bbn.lng.error);return i}function je(e,t,n=!1){let r={error:!1,result:!0};if("string"==typeof t&&(t=[t]),v(t)||(r.error=bbn._("checkProps must receive a string or an array as props argument")),w(e)||(r.error=bbn._("checkProps must receive an object as obj argument")),!r.error){let o;y(t,t=>{let i=(t=t.trim().split(":"))[1]||!1;if(t=t[0],void 0===e[t]?r.error=t+" "+bbn._("is not defined"):i?(o="is"+m(i,0,1).toUpperCase()+m(i,1).toLowerCase(),void 0===bbn.fn[o]?r.error=i+" "+bbn._("is not a valid type"):bbn.fn[o](e[t])||(r.error=t+" "+bbn._("is not a")+" "+i)):n&&!e[t]&&(r.error=t+" "+bbn._("is empty")),r.error)return!1})}return r.error&&(r.result=!1),r}function De(e){return e.replace(/[A-z]{1}/,e=>e.toUpperCase())}function Ce(e,t,n,...r){let o=!1;v(t)||(t=[t]);const i=[];if(y(t,t=>{var n;if(t===String?t="string":t===Number?t="number":t===Array?t="array":t===Boolean?t="boolean":t===Object?t="object":t===Function&&(t="function"),h(t)){if(i.push(t.name||(null===(n=t.constructor)||void 0===n?void 0:n.name)||t.toString()),e instanceof t)return o=!0,!1}else if(f(t)&&h(bbn.fn["is"+De(t)])){if(bbn.fn["is"+De(t)](e))return o=!0,!1;i.push(t)}else Oe(`The type ${t} is not recognized`)}),!o)throw b(["Value given",e,"type",typeof e,"expected",i.join(" or ")]),r.length&&b(r),new Error((n?n+" - ":"")+bbn._("The value should be a %s",i.join(" "+bbn._("or a")+" ")))}function Me(e){if(v(e))return e.slice().map(e=>"object"==typeof e?Me(e):e);if(w(e)){return _(!0,Object.create(Object.getPrototypeOf(e)),e)}return e}me=new WeakMap,pe=new WeakMap;const Le=(e,t="text/plain")=>{const n=new DataTransfer;n.setData(t,e);const r=new ClipboardEvent("copy",{bubbles:!0,cancelable:!0,clipboardData:n});document.dispatchEvent(r)};function Fe(e,t,n=null,r="="){if(!v(e))throw bbn.fn.log("NOT ARRAY",e),new Error("Error in filter: The first argument must be an array");let o={};const i=[],s="function"==typeof t;if(!t||!e.length)return e;if("object"==typeof t)r=n,o=t;else if("string"==typeof t)o[t]=n;else if(!s)throw new Error("Search function error: The prop argument should be a string or an object");if("function"==typeof t)for(let n=0;n<e.length;n++)t(e[n],n)&&i.push(e[n]);else if(o=V(o,r),o.conditions&&o.logic)for(let t=0;t<e.length;t++)$(e[t],o)&&i.push(e[t]);return i}const Re=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;Re.push(t)}function Ne(...e){const t=Object.create(null);return e.length&&_(t,...e),t}function Pe(e){let t=typeof e;if(void 0===e)return new Date;if("number"===t||u(e)&&""!==e)return e<1e10&&(e*=1e3),new Date(e);if("string"===t){if(10===e.length)return new Date(parseInt(m(e,0,4)),parseInt(m(e,5,2))-1,parseInt(m(e,8,2)),12);if(19===e.length)return new Date(parseInt(m(e,0,4)),parseInt(m(e,5,2))-1,parseInt(m(e,8,2)),parseInt(m(e,11,2)),parseInt(m(e,14,2)),parseInt(m(e,17,2)))}else if(T(e))return e;return!1}function Be(e,t=""){b(e)}function He(e,t=null,n=null){b(t,n)}function Ye(e,t,n=null,r=null){return!0}function Ue(...e){if(!e.length)return!1;for(let t of e)if("object"==typeof t&&!M(t))return!1;return!0}let We=[];function qe(e){if(f(e)&&e){for(;"/"===m(e,e.length-1);)e=m(e,0,e.length-1);let t=e.lastIndexOf("/");if(t>0)return m(e,0,t);if(0===t)return"/"}return""}function ze(...e){if(!e.length)return!1;for(let t of e)if("[object Blob]"!=={}.toString.apply(t))return!1;return!0}function $e(e){if(e&&f(e)){let t=e.split(".");if(t[0]&&t.length>1)return t[t.length-1].toLowerCase()}return""}function Ve(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof HTMLCanvasElement))return!1;return!0}function Je(e,t,n=null){if(Ve(t))return void t.toBlob(t=>{let n=document.createElement("a");n.download=e,n.href=window.URL.createObjectURL(t),n.className="bbn-no",n.click(),window.URL.revokeObjectURL(n.href)},n||"image/png");n?-1===n.indexOf("/")&&(n="text/"+n):n=w(t)&&t.type?t.type:"octet/stream";let r=window.document.createElement("a");r.className="bbn-no";let o=null;if(f(t))o=new Blob([t],{type:n});else try{o=t}catch(e){b(e)}r.href=window.URL.createObjectURL(o),r.download=e,document.body.appendChild(r),r.click(),window.URL.revokeObjectURL(r.href),document.body.removeChild(r)}var Ze=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};function Ke(){return Ze(this,void 0,void 0,function*(){var e;(null===(e=window.scheduler)||void 0===e?void 0:e.yield)?yield window.scheduler.yield():yield new Promise(requestAnimationFrame)})}var Xe=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};function Ge(e){let t;return"checkbox"===e.type?e.checked?(t=e.value,t||(t=1)):t=0:"radio"===e.type?e.checked&&(t=e.value):t=e.value,t}function Qe(e){let t,n,r=e.querySelectorAll("input[name],select[name],textarea[name],button[name]"),o={};return y(r,(e,r)=>{if(n=Ge(e),void 0!==n&&!e.disabled){let r=e.name;if(-1===r.indexOf("[]")&&r.indexOf("[")>-1&&r.indexOf("]")>-1&&r.lastIndexOf("]")===r.length-1&&(r=re("][",".",r),r=re("[",".",r),r=re("]","",r)),r.length>2&&r.indexOf("[]")===r.length-2)t=m(r,0,r.length-2),void 0===o[t]&&(o[t]=[]),o[t].push(n);else if(r.indexOf(".")>-1){let e,t=r.split(".");e=o;for(let r=0;r<t.length;r++)void 0===o[t[r]]&&(r<t.length-1?e[t[r]]={}:e[t[r]]=n),e=e[t[r]]}else o[r]=n}}),o}function et(e){return e.filter((e,t,n)=>t===n.indexOf(e))}function tt(e,t=null){let n=[];if("string"==typeof e&&(e=document.querySelector(e)),e instanceof HTMLElement&&e.parentElement)if("string"==typeof t)for(;e=e.parentElement.closest(t);)n.push(e);else for(!0===t&&n.push(e);e=e.parentElement;)n.push(e);return n}function nt(e){0!==e.indexOf("--")&&(e="--"+e);let t=getComputedStyle(document.documentElement).getPropertyValue(e);return"string"==typeof t&&(t=t.trim()),t}function rt(){const e=navigator.userAgent.toLowerCase();return/iPhone|Android/i.test(navigator.userAgent)?"mobile":/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(e)?"tablet":"desktop"}function ot(){let e,t=window.getSelection();if(t.rangeCount>0){e=t.getRangeAt(0),b("RANGE",e);let n=e.cloneContents();b("clonedSelection",n);let r=document.createElement("div");return r.appendChild(n),r.innerHTML}return""}function it(e){return f(e)?e.replace(/<!--[\s\S]*?-->/g,""):e}function st(e){let t=document.createElement("div");return t.innerHTML=e,e=t.innerText}function at(e){let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t}function lt(e){let t,n,r={};if(w(e[0])&&1===e.length)return e[0];for(n=0;n<e.length;n++)t=typeof e[n],t=t.toLowerCase(),h(e[n])?(r.errorFn&&!r.abortFn&&(r.abortFn=e[n]),r.successFn&&!r.errorFn?r.errorFn=e[n]:r.successFn||(r.successFn=e[n])):1===e[n]||!0===e[n]?r.force=!0:"string"===t?r.url?r.datatype=e[n]:0===e[n].indexOf("#")||0===e[n].indexOf(bbn.env.root+"#")?r.url=m(e[n],bbn.env.root.length):(r.url=e[n],0===r.url.indexOf(bbn.env.root)&&(r.url=m(r.url,bbn.env.root.length))):e[n]&&"object"===t&&(e[n]instanceof Event?r.e=e[n]:r.ele||1!==e[n].nodeType?"object"===t.toLowerCase()&&(r.obj=e[n]):r.ele=e[n]);return!r.url&&D(r)&&(r.url=bbn.env.path),void 0===r.obj&&(r.obj={_bbn:"public"}),r.datatype||(r.datatype="json"),r}function ut(e,t,n=null,r=!1){bbn.env.old_path=bbn.env.path,bbn.env.url=["https:/","http://"].includes(m(e,0,7))?e:bbn.env.root+e,bbn.env.path=m(bbn.env.url,bbn.env.root.length),bbn.env.params=bbn.env.path.split("/").filter(e=>""!==e);let o=window.history;if(o){let e=o.state,i={url:bbn.env.path,old_path:bbn.env.old_path||null,data:n||{},reload:!1};e&&e.url===bbn.env.path&&(e.data&&_(i.data,e.data),e.title&&!t&&(t=e.title),r=!0),t=t?st(t):bbn.env.siteTitle,r?(i.reload=!0,o.replaceState(i,t,bbn.env.url)):o.pushState(i,t,bbn.env.url)}}function ct(...e){let t=lt(e),n=1;if(!0===t)return!0;if(!t)return ct(window.location.href);if(0===t.url.indexOf("javascript:"))return!0;if(0===t.url.indexOf("data:"))return!0;if(0===t.url.indexOf("#"))return location.href=bbn.env.url+t.url,!0;if(0===t.url.indexOf("mailto:"))return bbn.env.ignoreUnload=!0,window.location.href=t.url,setTimeout(()=>{bbn.env.ignoreUnload=!1},0),!1;if(X(t.url))return!1;if((0===t.url.indexOf("http://")||0===t.url.indexOf("https://"))&&0!==t.url.indexOf(bbn.env.host))return t.e&&t.e.preventDefault(),window.open(t.url),!1;if(t.url!==bbn.env.params.join("/")||1===t.force){if(t.successFn)n=t.successFn(t.url);else if(bbn.fn.defaultPreLinkFunction){let e=bbn.fn.defaultPreLinkFunction(t.url,t.force,t.ele);void 0!==e.data?(_(t.obj,e.data),n=1):n=e}if(n){1!==n&&"string"==typeof n&&(t.url=n);let e=bbn._("The Ajax call to")+" "+t.url+" ";return ie(t.url,t.datatype,t.obj,n=>{n||b(e+bbn._("returned no answer")),w(n)&&(0===Object.keys(n).length&&b(e+bbn._("returned an empty object")),n.new_url?(n.old_path=t.url,t.url=n.new_url):n.url&&t.url!==n.url&&(n.old_path=t.url)),Te(t.url,n,t.successFn,null,t.ele)&&void 0===n.noNav&&0!==bbn.env.path.indexOf(t.url)&&ut(t.url,(n.title?n.title+" - ":"")+bbn.env.siteTitle)},t.errorFn||null)}}return!0}function ft(...e){let t=lt(e);if(t.url)return ie(t.url,t.datatype,t.obj,e=>{Te(t.url,e,t.successFn,t.errorFn,t.ele)},t.errorFn,t.abortFn)}function dt(e,t,n){let r,o=e.getAttribute("action")||bbn.env.path;if(""===o&&(o="."),"string"==typeof o&&(0!==o.indexOf("http")||-1!==o.indexOf(window.document.location.hostname))&&!e.getAttribute("target")&&(t&&t.preventDefault(),r=Qe(e),r)){e.setAttribute("action",null);const t=[o,r];!n&&e.getAttribute("data-script")&&(n=(n=new Function(e.getAttribute("data-script")))()),n&&t.push(n),ft(...t)}}function ht(){let e=bbn.env.width!==window.innerWidth,t=bbn.env.height!==window.innerHeight;if(e||t){e&&(bbn.env.width=window.innerWidth||window.document.documentElement.clientWidth||window.document.body.clientWidth,document.documentElement.style.setProperty("--vw",.01*bbn.env.width+"px")),t&&(bbn.env.height=window.innerHeight||window.document.documentElement.clientHeight||window.document.body.clientHeight,document.documentElement.style.setProperty("--vh",.01*bbn.env.height+"px"));let n=parseInt(nt("mobile-limit"))||650,r="bbn-screen-"+(bbn.env.width<n?"small":"regular"),o=(document.body.className||"").split(" "),i=!1;y(o,(e,t)=>{if(3===e.split("-").length&&0===e.indexOf("bbn-screen-"))return i=!0,e!==r&&o.splice(t,1,r),!1}),i||o.push(r),bbn.fn.defaultResizeFunction(),document.body.className=o.join(" ")}}function bt(){return"mobile"===rt()}function mt(){return"tablet"===rt()}function pt(){return bt()||mt()}function gt(e=!1){let t=(new Date).getTime();return e?Math.round(t/1e3):t}function yt(e){if("string"==typeof e&&e.length>0&&(0===e.indexOf("calc")||u(m(e,0,1)))){let t=document.createElement("div");t.style.width=e;let n=!!t.style.width.length;return t.remove(),n}return!1}function wt(...e){if(!e.length)return!1;for(let t of e)if(!f(t)||!bbn.var.regexp.ip.test(t))return!1;return!0}function vt(...e){if(!e.length)return!1;for(let t of e)if("[object Symbol]"!=={}.toString.apply(t))return!1;return!0}function _t(e){const t=["BBN: "+e];t.unshift({_bbn_console_mode:"warn",_bbn_console_level:2,_bbn_console_style:"color: #E64141; background: #F7E195; font-size: 14px"}),b.apply(this,t)}function Et(e,t="",n=null){let r=new FormData,o=(e,t="")=>{(!n||v(n)&&!n.includes(t))&&(e instanceof File?r.append(t,e):v(e)?y(e,(e,n)=>{o(e,t+"["+n+"]")}):w(e)&&Object.keys(e).length?g(e,(n,r)=>{r in e&&o(n,t?t+"["+r+"]":r)}):M(e)||void 0===e||r.append(t,e))};return o(e,t),r}function St(e){return"string"==typeof e?document.querySelector(e):e}function xt(e,t,n,r){if("object"==typeof e&&"string"==typeof t){let o=e;const i=t.split(".");y(i,(e,t)=>{if(!o){if(!r)throw new Error(bbn._("The object is invalid"));o={}}i.length-1===t?o[e]=n:o=o[e]})}}function kt(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function At(e,t=" "){if(" "===t)return e.trim();if(!t)return e;if(t===e)return"";for(;0===e.indexOf(t);)e=m(e,t.length);for(;e.lastIndexOf(t)===e.length-t.length;)e=m(e,0,e.length-t.length);return e}function It(e,t,n){return"string"==typeof e.toLowerCase()&&(t||(t=bbn.var.shortenLen),void 0!==n&&f(n)||(n="..."),e.length>t&&(e=m(e,0,t)+n)),e}var Ot={_addLoader:A,_compareValues:j,_deleteLoader:K,abort:function(e){let t=X(e);(null==t?void 0:t.aborter)&&t.aborter.abort("Operation canceled by the user.")},abortURL:function(e){y(G(bbn.env.loaders,{url:e}),t=>{if(!t||!t.source)throw new Error("Impossible to find the loader with URL "+e);t.source.cancel("Operation canceled by the user.")})},addColors:Q,addInputs:ee,addStyle:function(e,t){w(t)&&g(t,(t,n)=>{e.style[n]=t})},adjustHeight:function(){let e=arguments;return 1===e.length&&c(e[0])&&(e=e[0]),te("height",e)},adjustSize:te,adjustWidth:function(){let e=arguments;return 1===e.length&&c(e[0])&&(e=e[0]),te("width",e)},ajax:ie,analyzeFunction:W,animateCss:function(e,t,n){e.classList.add("animated"),e.classList.add(t),e.addEventListener("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function e(r){r.target.removeEventListener(r.type,e),"function"==typeof n&&n.call(this),r.target.classList.remove(t)})},arrayBuffer2String:ae,arrayFromProp:function(e,t){let n=[];return y(e,(e,r)=>{n.push(I(e,t))}),n},autoExtend:function(e,t){bbn[e]||(bbn[e]={}),_(bbn[e],t)},baseName:le,br2nl:function(e){return re("<br />","\n",re("<br/>","\n",re("<br>","\n",e)))},calendar:function(e,t=!1){let n=Ie(e);return n.isValid?n.fdate():t&&f(t)?t:""},callback:Te,camelize:function(e){return e.replace(/^([A-Z])|[\s-](\w)/g,function(e,t,n,r){return n?n.toUpperCase():t.toLowerCase()})},camelToCss:function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}).replace("/^./",function(e){return e.toLowerCase()})},canvasToImage:function(e){let t=new Image;return t.src=e.toDataURL("image/png"),t},cast:function(e){var t;return e?"object"==typeof e?bbn.fn.isArray(e)?"Array ("+e.length+")":(null===(t=e.constructor)||void 0===t?void 0:t.name)||"{}":e.toString?e.toString():"string"==typeof e?e:"":""},center:function(e){let t=e.parentNode,n=t.clientWidth,r=t.clientHeight;for(;t&&(!n||!r);)t=e.parentNode,n=t.clientWidth,r=t.clientHeight;return e.style.position="absolute",e.style.top=Math.max(0,(r-e.offsetHeight)/2+t.scrollTop)+"px",e.style.left=Math.max(0,(r-e.offsetWidth)/2+t.scrollLeft)+"px",e},checkProps:function(e,t,n=!1){return je(e,t,n).result},checkPropsDetails:je,checkPropsOrDie:function(e,t,n=!1){let r=je(e,t,n);if(r.error)throw new Error(r.error);return!0},checkType:Ce,circularReplacer:function(){const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n),[void 0,Object,Array,null].includes(n.constructor)||(n=N(n)?n.bbnId?"__BBN_DOM__"+n.tagName+"/"+n.bbnId+n.bbnHash:"__BBN_DOM__"+n.tagName+"/"+n.className:B(n)?"__BBN_CP__"+n.$options.name+"/"+n.$cid:n.constructor.toString())}return n}},clone:Me,colorToHex:function(e){let t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,t.fillStyle},compare:z,compareConditions:$,copy:function(e,t){return new Promise(n=>{if(e){if(navigator&&navigator.clipboard)return void(e instanceof Blob?(navigator.clipboard.write([new ClipboardItem({[e.type.toString()]:e})]).then(()=>{n(!0)}),t||Le(e,e.type.toString())):w(e)&&h(e.toBlob)?e.toBlob(r=>{const o=new ClipboardItem({[r.type.toString()]:r});navigator.clipboard.write([o]).then(()=>{t||Le(e,r.type.toString()),n(!0)})}):(navigator.clipboard.writeText(e),t||Le(e),n(!0)));let r=document.createElement("textarea");r.style.opacity="0",r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),t||Le(e),n(!0)}n(!1)})},correctCase:De,count:function(e,t,n=null,r="="){return Fe(e,t,n,r).length||0},crc32:function(e){let t=~0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=t>>>8^Re[255&(t^r)]}return(-1^t)>>>0},createObject:Ne,cssExists:function(e){let t,n,r=document.styleSheets;for(let o=0;o<r.length;o++){t=1;try{n=r[o].rules||r[o].cssRules}catch(e){if(t=!1,"SecurityError"!==e.name)throw e}if(t)for(let t=0;t<n.length;t++)if(new RegExp("(^|\\s)"+ne(e)+"(\\{|\\s)","g").test(n[t].selectorText))return!0}return!1},data2Html:function e(t,n=""){const r=!v(t);let o='<ul class="bbn-bottom-xspadding '+(n||"bbn-ul")+'">';for(let i in t)o+="<li>",r&&(o+="<em>"+i+"</em>: "),t[i]&&(v(t[i])||w(t[i]))?o+=e(t[i],n):o+=null===t[i]?"<em>null</em>":t[i].toString?t[i].toString():t[i],o+="</li>";return o+='</ul><div class="bbn-bottom-xspadding '+(n||"bbn-div")+'"></div>',o},date:Pe,dateSQL:function(e,t){let n=Ie(e);if(n)return n.format("YYYY-MM-DD"+(t?"":" HH:mm:ss"))},deepPath:function e(t,n,r,o=[]){let i;return(i=J(t,n,0))>-1?(o.push(i),o):(y(t,(t,i)=>{if(v(t[r])){let s=o.slice();s.push(i);let a=e(t[r],n,r,s);if(!1!==a)return a}}),!1)},defaultAjaxAbortFunction:Be,defaultAjaxErrorFunction:He,defaultAlertFunction:function(e,t=null){alert(e)},defaultConfirmFunction:function(e,t,n=null){let r=0;confirm(e)&&h(t)&&(t(),r=1),!r&&h(n)&&n()},defaultEndLoadingFunction:Ye,defaultErrorFunction:function(e){b(e)},defaultHistoryFunction:function(e){return!0},defaultLinkFunction:function(e,t){return!0},defaultPostLinkFunction:function(e,t=null){return!0},defaultPreLinkFunction:function(e,t=!1,n=null){return b("defaultPreLinkFunction",e,t,n),!0},defaultResizeFunction:function(){return!0},defaultStartLoadingFunction:function(e,t,n,r){return!0},deleteProp:function(e,t){Ce(e,"object",bbn._("The obj must be an object in setProp")),Ce(t,"string",bbn._("The prop must be a string in setProp")),delete e[t]},diffObj:function e(t,n,r=!1,o=!1){o||(We=[]);let i="unchanged";void 0===o&&(o=!1);let s=Ne();if(!h(t)&&!h(n)){if(Ue(t)||Ue(n)){let e=(a=t)===(l=n)||T(a)&&T(l)&&a.getTime()===l.getTime()?i:void 0===a?"created":void 0===l?"deleted":"updated";if(r||e!==i){let r=Ne();return Object.defineProperty(r,"type",{value:e,enumerable:!1}),Object.defineProperty(r,"data",{value:void 0===t?n:t,enumerable:!1}),Object.defineProperty(r,"_bbnDiffObjProof",{value:!0,enumerable:!1}),void 0!==t&&Object.defineProperty(r,"newData",{value:n,enumerable:!1}),r}return!1}if(N(t)||N(n))return!1;if(We.includes(t)||We.includes(n))return!1;We.push(t,n);for(let o in t){if(h(t[o]))continue;let i;void 0!==n[o]&&(i=n[o]);let a=e(t[o],i,r,!0);a&&(s[o]=a)}for(let o in n){if(h(n[o])||void 0!==t[o])continue;let i=e(void 0,n[o],r,!0);i&&(s[o]=i)}}var a,l;return!(o&&!r&&!D(s))&&s},dirName:qe,download:function(e,t="",n=null){return t&&"object"==typeof t&&(n=t,t=""),ie(e,"blob",n||{_bbn_download:1},(n,r)=>{if(!t){let n="content-disposition",o="attachment; filename=";t=(null==r?void 0:r[n])&&0===r[n].indexOf(o)?m(r[n],o.length+1,r[n].length-o.length-2):le(e)}if(ze(n)){let e=$e(t),r=["php","html"];if("string"==typeof t&&("type"in n&&"text/html"!==n.type||r.includes(e)))return void Je(t,n)}},e=>{bbn.fn.defaultAjaxErrorFunction(e)})},downloadContent:Je,each:y,eraseCookie:function(e){document.cookie=e+"=; Max-Age=-99999999;"},error:Oe,escapeDquotes:function(e){return f(e)?e.replace(/"/g,'\\"'):e},escapeRegExp:ne,escapeSquotes:function(e){return f(e)?e.replace(/'/g,"\\'"):e},escapeTicks:function(e){return f(e)?e.replace(/`/g,"\\`"):e},escapeUrl:function(e,t){let n="";e.match("^(http|https)://")&&(n+="http","s"===(e=e.substring(4)).substr(0,1)&&(n+="s",e=e.substring(1)),n+="://",e=e.substring(3)),y(qe(e).split("/"),e=>{n+=encodeURIComponent(e)+"/"});let r=le(e),o="?",i="";if(r.indexOf(o)){let e=r.split("?");o="&",i="?"+e[1],r=e[0]}return t&&f(t)?(t.match("^(\\&|\\?)")&&(t=t.substring(1)),t=o+t):t="",n+encodeURIComponent(r)+i+t},executeSlowly:function(e,t){return Xe(this,void 0,void 0,function*(){for(let n=0;n<e.length;n++){yield Ke();let r=t(e[n],n);if(r instanceof Promise&&(r=yield r),!1===r)return!1}return!0})},extend:_,extendOut:function e(...t){let n=null;for(let r of t){if(!w(r))throw new Error("Each argument for extendOut must be an object, "+typeof r+" given");if(null===n)n=r;else for(let t in r)w(n[t],r[t])?e(n[t],r[t]):void 0===n[t]&&(n[t]=r[t])}return n},fdate:function(e,t=!1){let n=Ie(e),r=!1;return!0===t&&(r=!0),n.isValid?n.fdate(!1,r):t&&f(t)?t:""},fdatetime:function(e,t=!1){let n=Ie(e);return n.isValid?n.fdate(!1,!0):t&&f(t)?t:""},fieldValue:Ge,fileExt:$e,filter:Fe,filterToConditions:V,findAll:function e(t,n,r,o=[]){let i,s=0;for(;(i=J(t,n,s))>-1;)o.push(t[i]),s=i+1;return y(t,t=>{v(t[r])&&e(t[r],n,r,o)}),o},firstVarElement:function(e){const t=e.indexOf("["),n=e.indexOf(".");return-1===t&&-1===n?e:-1===t?e.substring(0,n):-1===n?e.substring(0,t):e.substring(0,Math.min(t,n))},fori:function(e,t,n=e.length-1,r=0){if(v(e)){let o=e.length-1;u(n)&&0<n&&n<=o||(n=o),(!u(r)||!(0<=r&&r<o)||r>n)&&(r=0);for(let o=r;o<=n;o++)if(!1===t(e[o],o))return}},forir:function(e,t,n=e.length-1,r=0){if(v(e)){let o=e.length-1;u(n)&&0<n&&n<=o||(n=o),(!u(r)||!(0<=r&&r<o)||r>n)&&(r=0);for(let o=n;o>=r;o--)if(!1===t(e[o],o))return}},format:function(e){let t=Array.prototype.slice.call(arguments,1);if(t.length){let n=0;return e.replace(/\%([d|s])/g,(e,r)=>{let o=t[n++];return Ce(o,"d"===r?"number":"string",bbn._("The value doesn't correspond to the format")),o})}return e},formatBytes:function(e,t=2){if(!e)return"0 B";const n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(t<0?0:t))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},formatDate:function(e,t){const n=Ie(e);return n.isValid?n.format(t):""},formatSize:function(e,t){return u(e)?e+"px":f(e)?e:!t&&"auto"},formdata:Qe,fphone:function(e){var t;if(u(e)&&(e=e.toString()),f(e)){const n=(null===(t=bbn.var)||void 0===t?void 0:t.phoneCodes)||[];let r="",o="",i="";if(n.length&&y(n,t=>{e.startsWith(t.prefix)&&t.prefix.length>o.length&&(o=t.prefix,i=t.mask||"")}),!i.length&&e.startsWith("+")){o.length||(o=e.substr(0,3));const t=e.slice(o.length);for(let e=0;e<t.length;e++)e+1<=t.length&&e%2==0&&(i+="0"+(t[e+1]?"0":"")+" ");i=i.trim()}if(i.length){o.length&&(r=o+" ",e=e.slice(o.length));let t=0;return r+=i.replace(/[0-9]/g,()=>e[t++]||""),r}}return e},fromXml:function(e,t){let n=null;if(window.DOMParser)n=(new DOMParser).parseFromString(e,"text/xml");else{if(!window.ActiveXObject)throw new Error("cannot parse xml string!");if(n=new window.ActiveXObject("Microsoft.XMLDOM"),n.async=!1,!n.loadXML(e))throw n.parseError.reason+" "+n.parseError.srcText}function r(e,n){if("#text"==e.nodeName){let t=e.nodeValue;return void(t.trim()&&(n["#text"]=t))}let o={},i=n[e.nodeName];if(i?Array.isArray(i)?n[e.nodeName].push(o):n[e.nodeName]=[i,o]:t&&-1!=t.indexOf(e.nodeName)?n[e.nodeName]=[o]:n[e.nodeName]=o,e.attributes)for(let t of e.attributes)o[t.nodeName]=t.nodeValue;for(let t of e.childNodes)r(t,o)}let o={};for(let e of n.childNodes)r(e,o);return o},ftime:function(e,t){let n=Ie(e);return n.isValid?n.ftime():t&&f(t)?t:""},getAllTags:function(){return et(Array.prototype.map.apply(document.all,[e=>e.tagName.toLowerCase()]))},getAncestors:tt,getAttributes:function(e){e.getAttributeNames||Oe("The element is not a proper HTML Element");let t=Object.create(null);return e.getAttributeNames().forEach(n=>{t[n]=e.getAttribute(n)}),t},getBrowserName:function(){const e=navigator.userAgent.toLowerCase();switch(!0){case e.includes("edge"):case e.includes("edg/"):return"Edge";case e.includes("opr")&&!!window.opr:return"Opera";case e.includes("chrome")&&!!window.chrome:return"Chrome";case e.includes("trident"):return"Internet Explorer";case e.includes("firefox"):return"Firefox";case e.includes("safari"):return"Safari";default:return"Other"}},getBrowserVersion:function(){const e=navigator.userAgent.toLowerCase();switch(!0){case e.includes("edge/"):return e.split("edge/")[1].split(" ")[0];case e.includes("edg/"):return e.split("edg/")[1].split(" ")[0];case e.includes("opr/")&&!!window.opr:return e.split("opr/")[1].split(" ")[0];case e.includes("chrome/")&&!!window.chrome:return e.split("chrome/")[1].split(" ")[0];case e.includes("trident/"):return e.split("trident/")[1].split(" ")[0];case e.includes("firefox/"):return e.split("firefox/")[1].split(" ")[0];case e.includes("safari/"):return e.split("version/")[1].split(" ")[0];default:return""}},getChrono:function(e="default"){return bbn.fn.microtimestamp()-this.constructor.chronos[e]},getCookie:function(e){let t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){let r=n[e];for(;" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t)){let e=r.substring(t.length,r.length);if(e)return JSON.parse(unescape(e)).value}}return null},getCssVar:nt,getDay:function(e){let t=Pe(e);if(t){let e=t.getTime(),r=t.getYear(),o=365*(r-1970);t.getMonth()<2&&r--;for(var n=1972;n<=r;n+=4)o++;return o+Math.floor(e/864e5)}return!1},getDeviceType:rt,getEventData:function(e){let t=e.dataTransfer||e.clipboardData,n=t.getData("Text"),r={raw:n,files:[],str:[]};return new Promise((o,i)=>{let s=!(t instanceof DataTransfer);if(!n&&"copy"===e.type){let e=window.getSelection();r.raw=e.toString();let t=ot();r.str.push({type:"text/plain",data:r.raw}),t!==r.raw?r.str.push({type:"text/html",data:t}):0===r.raw.trim().indexOf("<")&&r.str.push({type:"text/html",data:"<meta charset='utf-8'><code style=\"white-space: pre; font-family: 'Courier New', sans-serif\">\n"+r.raw+"\n</code>"}),s=!0,o(r)}if(!s){let e=[],n=t.items.length;y(t.items,(i,a)=>{let l=i.kind,u=i.type;if("file"===l){let l=t.files[a];if(!u&&l.name){let e=l.name.split(".");u=e[e.length-1]}let c=l?l.name:bbn._("untitled"),f=l?l.size:null,d=l?l.lastModified:null,h=i.getAsFile();h?(s=!0,n--,r.files.push({type:u,data:h,name:c,size:f,mdate:d}),e.push(c),n||(r.raw||(r.raw=e.join(", ")),o(r))):bbn.fn.defaultErrorFunction(bbn._("Impossible to read the file")+" "+c)}else s=!0,i.getAsString(t=>{n--,r.str.push({type:u,data:t}),"text/plain"===u&&e.push(name),n||(r.raw||(r.raw=e.join(", ")),o(r))})})}s||setTimeout(()=>{o(r)})})},getField:function(e,t,n="",r=null,o="=",i=0,s=!1,a=void 0){let l;return n&&["object","function"].includes(typeof n)&&6 in arguments&&(a=s),t?(l=Z(e,n,r,o,i,s,void 0),void 0===l?a:l[t]):a},getFieldValues:function(e,t,n,r,o){Ce(t,"string"),n&&(e=G(e,n,r,o));let i=[];return y(e,e=>-1===i.indexOf(e[t])?i.push(e[t]):null),i},getIndex:function(e,t=""){return e.parentElement?(t||Array.from(e.parentElement.children).indexOf(e),Array.from(e.parentElement.children).filter(e=>e.matches(t)).indexOf(e)):-1},getHtml:function(e,t=!1){let n=e.innerHTML();return t&&(n=it(n)),n.trim()},getHTMLOfSelection:ot,getLoader:X,getPath:P,getProp:function(e,t){return Ce(e,"object",bbn._("The obj must be an object in setProp")),Ce(t,"string",bbn._("The prop must be a string in setProp")),e[t]},getProperty:I,getRequestId:oe,getRow:Z,getScrollBarSize:function(){if(void 0===bbn.env.scrollBarSize){let e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px","msOverflowStyle"in e.style&&(e.style.msOverflowStyle="scrollbar"),document.body.appendChild(e);let t=e.offsetWidth;e.style.overflow="scroll";let n=document.createElement("div");n.style.width="100%",e.appendChild(n);let r=n.offsetWidth;e.parentNode.removeChild(e);let o=t-r;bbn.env.scrollBarSize=o?o+1:0}return bbn.env.scrollBarSize},getSortingMoves:function(e,t){if(e.length!==t.length)throw new Error("Lengths must match.");const n=new Set(t);if(n.size!==t.length)throw new Error("dst has duplicates.");const r=new Set(e);if(r.size!==e.length)throw new Error("src has duplicates.");if(e.length!==n.size||Array.from(r).some(e=>!n.has(e)))throw new Error("Arrays must contain the same unique values.");const o=new Map(t.map((e,t)=>[e,t])),i=(e=>{const t=e.length,n=[],r=Array(t).fill(-1);for(let o=0;o<t;o++){let t=e[o],i=0,s=n.length;for(;i<s;){const r=i+s>>1;e[n[r]]<t?i=r+1:s=r}i>0&&(r[o]=n[i-1]),n[i]=o}const o=[];for(let e=n.length?n[n.length-1]:-1;-1!==e;e=r[e])o.push(e);return o.reverse()})(e.map(e=>o.get(e))),s=new Set(i.map(t=>e[t])),a=Array(t.length).fill(-1);for(let e=t.length-2;e>=0;e--)a[e]=a[e+1],s.has(t[e+1])&&(a[e]=e+1);const l=e.slice(),u=new Map(l.map((e,t)=>[e,t])),c=[];for(let e=0;e<t.length;e++){const n=t[e];if(s.has(n))continue;const r=u.get(n);if(void 0===r)throw new Error("Inconsistent state");const o=a[e],i=-1!==o?u.get(t[o]):l.length;if(void 0===i)throw new Error("Inconsistent state");const f=r<i?i-1:i;if(r!==f){const[e]=l.splice(r,1);l.splice(f,0,e),c.push({from:r,to:f,value:n}),u.clear();for(let e=0;e<l.length;e++)u.set(l[e],e)}}return c},getText:function(e){return e.innerText().trim()},getTimeoff:function(){return bbn.env.isFocused?0:Math.round((new Date).getTime()/1e3-bbn.env.timeoff)},happy:function(...e){return e.unshift({_bbn_console_level:3,_bbn_console_style:"color: white; background: green; font-size: 18px;"}),b.apply(this,e),this},hash:Y,hex2rgb:function(e){"#"!==e.charAt(0)&&(e="#"+e),4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},history:function(){return window.history||!1},html2text:st,imageToCanvas:at,imgToBase64:function(e,t="image/png"){return at(e).toDataURL(t)},info:function(...e){return e.unshift({_bbn_console_level:4,_bbn_console_style:"color: #EEE; background: blue; font-size: 12px;"}),b.apply(this,e),this},init:function(e,t){let n;bbn.env.isInit||(bbn.env.root=document.baseURI.length>0?document.baseURI:bbn.env.host,bbn.env.root.length&&"/"!==m(bbn.env.root,-1)&&(bbn.env.root+="/"),"object"==typeof e&&_(!0,bbn,e),bbn.env.path=m(bbn.env.url,bbn.env.root.length),n=bbn.env.path.split("/"),y(n,(e,t)=>{""!==(e=decodeURI(e.trim()))&&bbn.env.params.push(e)}),bbn.var.colors&&Q(bbn.var.colors),document.addEventListener("visibilitychange",()=>{document.hidden&&bbn.env.isFocused?bbn.env.isFocused=!1:document.hidden||bbn.env.isFocused||(bbn.env.isFocused=!0)}),document.addEventListener("focusin",e=>{e.target instanceof HTMLElement&&!e.target.classList.contains("bbn-no")&&(bbn.env.focused=e.target),bbn.env.last_focus=gt()}),document.addEventListener("click",e=>{if(bbn.env.last_focus=gt(),"ajax"!==bbn.env.nav)return;let t=e.target;if(t instanceof HTMLElement&&"A"!==t.tagName){let e=t;for(;e&&"A"!==e.tagName&&"BODY"!==e.tagName;)e=e.parentElement;t=e&&"A"===e.tagName?e:null}return t instanceof HTMLElement&&t.hasAttribute("href")&&!t.hasAttribute("target")&&!t.classList.contains("bbn-no")?(e.preventDefault(),e.stopPropagation(),ct(t.getAttribute("href")),!1):void 0}),y(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"),e=>{e.addEventListener("submit",t=>{dt(e,t)})}),window.addEventListener("hashchange",()=>{bbn.env.hashChanged=(new Date).getTime()},!1),window.addEventListener("resize",()=>{ht()}),window.addEventListener("orientationchange",()=>{ht()}),ht(),pt()&&(document.body.classList.add("bbn-mobile"),mt()&&document.body.classList.add("bbn-tablet")),window.history&&(window.onpopstate=function(e){let t=window.history;if(!bbn.env.historyDisabled&&t&&bbn.fn.defaultHistoryFunction(t.state)){let e=t.state;e?ct(e.url,_({title:e.title||bbn.env.siteTitle},e.data||{})):e&&e.data&&h(e.data.script)&&e.data.script()}}),window.addEventListener("online",()=>{bbn.env.online=!0}),window.addEventListener("offline",()=>{bbn.env.online=!1}),bbn.env.isInit=!0,document.dispatchEvent(new Event("bbninit")),bbn.env.logging&&b("Logging in bbn is enabled"))},isActiveInterface:function(e=600){return!!bbn.env.last_focus&&(new Date).getTime()-bbn.env.last_focus<1e3*e},isArray:v,isBlob:ze,isBoolean:function(...e){if(!e.length)return!1;for(let t of e)if(![!0,!1].includes(t))return!1;return!0},isCanvas:Ve,isColor:function(...e){if(!e.length)return!1;var t=new RegExp("^(#[a-f0-9]{6}|#[a-f0-9]{3}|rgb *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|rgba *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|black|green|silver|gray|olive|white|yellow|maroon|navy|red|blue|purple|teal|fuchsia|aqua)$","i");for(let n of e){if(!f(n))return!1;if(!t.test(n))return!1}return!0},isComment:function(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof Comment))return!1;return!0},isCp:B,isDataURL:function(...e){if(!e.length)return!1;for(let t of e)if(!/^data:([a-z]+\/[a-z0-9\-\+\.]+(;[a-z\-]+\=[a-z0-9\-\.]+)?)?(;base64)?,/i.test(t))return!1;return!0},isDate:T,isDesktopDevice:function(){return"desktop"===rt()},isDimension:function(...e){if(!e.length)return!1;for(let t of e){if("number"!=typeof t||t<0)return!1;if(!yt(t))return!1}return!0},isDom:N,isEmail:function(...e){if(!e.length)return!1;let t=/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;for(let n of e){if(!f(n))return!1;if(!t.test(n))return!1}return!0},isEmpty:C,isEvent:function(...e){if(!e.length)return!1;for(let t of e)if(!(t instanceof Event))return!1;return!0},isFocused:function(e,t=!1){return e===document.activeElement||t&&e.contains&&e.contains(document.activeElement)},isFunction:h,isHex:function(e){return Boolean(e.match(/^(0x)?[0-9a-f]+$/i))},isHostname:function(...e){if(!e.length)return!1;for(let t of e){if(!f(t))return!1;if(!wt(t)&&!bbn.var.regexp.hostname.test(t))return!1}return!0},isInside:function(e,t){let n=tt(e);if(n.length){if(f(t)){let e=!1;return y(n,n=>{if(n.matches&&n.matches(t))return e=!0,!1}),e}if(t instanceof HTMLElement)return n.indexOf(t)>-1}return!1},isInt:d,isInViewport:function(e,t=!1){const n=e.getBoundingClientRect();if(t)return n.top>=0&&n.left>=0&&n.right<=(window.innerWidth||document.documentElement.clientWidth)&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight);const r=e.offsetHeight,o=e.offsetWidth;return n.top>=-r&&n.left>=-o&&n.right<=(window.innerWidth||document.documentElement.clientWidth)+o&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)+r},isIP:wt,isIterable:c,isMobile:pt,isMobileDevice:bt,isNotObject:Ue,isNull:M,isNumber:u,isObject:w,isPercent:function(...e){if(!e.length)return!1;for(let t of e)if("string"!=typeof t||!t.match(/^\d+(?:\.\d+)?%$/))return!1;return!0},isPrimitive:ue,isPromise:function(...e){if(!e.length)return!1;for(let t of e)if("[object Promise]"!=={}.toString.apply(t))return!1;return!0},isPropSize:function(e){let t=!1;return y(["width","height","gap","margin","padding","top","left","right","bottom"],n=>{if(-1!==e.indexOf(n))return t=!0,!1}),t},isSame:q,isSQLDate:function(...e){if(!e.length)return!1;for(let t of e)if("string"!=typeof t||!t.match(/^([1-2]\d{3})-((0\d)|(1[12]))-(([0-2]\d)|(3[01]))(?:( [0-2]\d):([0-5]\d):([0-5]\d))?$/))return!1;return!0},isString:f,isSymbol:vt,isTabletDevice:mt,isURL:function(...e){if(!e.length)return!1;for(let t of e)if(!bbn.var.regexp.url.test(t))return!1;return!0},isUid:function(...e){if(!e.length)return!1;for(let t of e)if("string"!=typeof t||!t.match(/^[0-9a-f]{32}$/i))return!1;return!0},isValidDimension:yt,isValidName:function(...e){if(!e.length)return!1;for(let t of e)if(!f(t)||!/^[$A-Z_][0-9A-Z_$]*$/i.test(t))return!1;return!0},isVue:function(...e){if(!e.length)return!1;if("vue"in bbn&&window.Vue)if("app"in bbn.vue){for(let t of e)if(!t||"function"!=typeof t.render)return!1}else for(let t of e)if(!(t instanceof window.Vue))return!1;return!("cp"in bbn)||!("isComponent"in bbn.cp)||"function"!=typeof bbn.cp.isComponent||bbn.cp.isComponent(...e)},isWritable:function(e,t){let n;for(;e&&(n=Object.getOwnPropertyDescriptor(e,t),!n);)e=Object.getPrototypeOf(e);return!n||Boolean(n.writable||n.set)},iterate:g,lightenDarkenHex:function(e,t){if(e&&t){let n="#"===e[0];e=n?e.slice(1):e;let r=parseInt(e,16),o=(r>>16)+t,i=(r>>8&255)+t,s=(255&r)+t;return o>255?o=255:o<0&&(o=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0),(n?"#":"")+(s|i<<8|o<<16).toString(16)}},link:ct,log:b,makeReactive:function e(t,n,r,o){const i=(null==r?void 0:r.$cid)||"",s="__bbn_"+(i?i+"_":"");if(t&&"object"==typeof t&&[void 0,Object,Array].includes(t.constructor)){if(t.__bbnIsProxy&&t.__bbnParent===r)return t;r&&r.$options&&"bbn-loadbar"===r.$options.name&&b(["MAKING bbn-loadbar",t]),t.__bbnWatchers||Reflect.defineProperty(t,"__bbnWatchers",{value:Ne(),writable:!0,configurable:!0,enumerable:!1});return new Proxy(t,{get(a,l){const c=Reflect.get(a,l),f=a.__bbnRoot||a;if(vt(l))return Reflect.get(f,l);const d=o?o+"."+l:l,m=s+(u(l)?l.toString():l);if(["fill","pop","push","reverse","shift","sort","splice","unshift"].includes(l)&&v(a))return function(...e){let t=f[l](...e);return _t("DOING ARRAY STUFF"),b(a.__bbnParent),n(a,"length",r),t};if(h(c))return c;if("__bbnRoot"===l){let e=t;for(;e&&(null==e?void 0:e.__bbnTarget);)e=e.__bbnTarget;return e}return"__bbnIsProxy"===l||("__bbnTarget"===l?a:"__bbnParent"===l?r:"__bbnWatchers"===l?a.__bbnWatchers:0===l.indexOf("__bbn_")?Reflect.get(a,l):"length"===l&&v(a.__bbnRoot||a)?f.length:l in a&&c&&"object"==typeof c&&[void 0,Object,Array].includes(c.constructor)?(c.__bbnIsProxy&&c.__bbnParent===r||(m in f||Reflect.defineProperty(f,m,{value:e(c,n,r,d),writable:!0,configurable:!0,enumerable:!1}),f[m].__bbnIsProxy&&!f.__bbnWatchers[i]&&(f.__bbnWatchers[i]=d)),f[m]):c)},set(t,a,l){if(vt(a))return Reflect.get(t,a,l);const c=t.__bbnRoot||t,f=o?o+"."+a:a;if(vt(a))return Reflect.get(t,a);if(r&&r.$options&&"bbn-loadbar"===r.$options.name&&b(["Setting proxy prop in "+r.$options.name,t,a,l]),!q(c[a],l)){if(0===a.indexOf("__bbn_"))Reflect.defineProperty(c,a,{value:e(l,n,r,f),writable:!0,configurable:!0,enumerable:!1});else if(l&&"object"==typeof l&&[void 0,Object,Array].includes(l.constructor)){const t=s+(u(a)?a.toString():a);Reflect.defineProperty(c,t,{value:e(l,n,r,f),writable:!0,configurable:!0,enumerable:!1}),c[t].__bbnIsProxy&&!c.__bbnWatchers[i]&&(c.__bbnWatchers[i]=f)}r&&r.$options&&"bbn-loadbar"===r.$options.name&&b(["Setting proxy prop in "+r.$options.name+" "+(u(a)?a.toString():a),l,t]),Reflect.set(c,a,l),n(t,a,r)}return!0},defineProperty(t,i,a){const l=t,c=o?o+"."+i:i;if("__bbnWatchers"===i||vt(i)||0===i.indexOf("__bbn_"))Reflect.defineProperty(l,i,a);else{const t=s+(u(i)?i.toString():i);Reflect.defineProperty(l,t,{value:e(a.value,n,r,c),writable:!0,configurable:!0,enumerable:!1})}return n(t,i,r),!0},deleteProperty(e,t){const n=e;if(0===t.indexOf("__bbn_"))Reflect.deleteProperty(n,t);else{const r=s+(u(t)?t.toString():t);Reflect.deleteProperty(n,r),Reflect.deleteProperty(e,t)}return!0}})}return t},map:function e(t,n,r,o=0){return t.map((t,i)=>(t=n(t,i,o),r&&t[r]&&v(t[r])&&(t[r]=e(t[r],n,r,o+1)),t))},md5:U,microtimestamp:function(){return window.performance.now()+performance.timeOrigin},money:function(e,t,n,r,o,i,s){if(o||(o=void 0===o&&bbn.env.money&&void 0!==bbn.env.money.decimal?bbn.env.money.decimal:"."),n||(n=void 0===n&&bbn.env.money&&void 0!==bbn.env.money.currency?bbn.env.money.currency:""),i||(i=void 0===i&&bbn.env.money&&void 0!==bbn.env.money.thousands?bbn.env.money.thousands:" "),s||(s=void 0===s&&bbn.env.money&&void 0!==bbn.env.money.precision?bbn.env.money.precision:0),t||(t=!(void 0!==t||!bbn.env.money||void 0===bbn.env.money.kilo)&&bbn.env.money.kilo),r||(r=!(void 0!==r||!bbn.env.money||void 0===bbn.env.money.novalue)&&bbn.env.money.novalue),u(s)||(s=t?3:0),0===e&&"number"==typeof s&&s>0){let r=e.toFixed(s).replace(".",o);return n&&(r+=" "+(t?"K"+n:n)),r}if((isNaN(e)||!e)&&r)return r;if(isNaN(e)||!e)return 0+(n?" "+n:"");if("string"==typeof e&&(e=Number(e)),"number"!=typeof e)throw new Error("The value must be a number");t&&e&&(e/=1e3,n&&(n="K"+n));let a=e.toFixed(s),l=0,c=1e4;return a&&(c=a.indexOf("."),c<=0?c=1e4:l=a.length-c),a.replace(/./g,function(e,t,n){return"."===e?o:t&&(n.length-t-l)%3==0&&t<c?i+e:e})+(n?" "+n:"")},move:function(e,t,n){if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}return e.splice(n,0,e.splice(t,1)[0]),e},multiorder:function(e,t){if(!t)return e;let n;if(Array.isArray(t)||"object"!=typeof t)n=t;else for(var r in n=[],t)n.push({field:r,dir:t[r]});if(!Array.isArray(n))throw new Error("The orders argument must be an array");return e.slice().sort((e,t)=>{let r;for(let o of n)if(r=j(e,t,o.field,o.dir),0!==r)return r;return 0})},mutateArray:function(e,t,n=null){if(!v(e,t))throw new TypeError("mutateArray can only be called with arrays");n?Ce(n,"function","The hash function must be a function"):n=Y;const r=new Map(t.map(e=>[n(e),e]));let o=[];t.forEach(e=>{o.push(e)});let i=e.length;for(;i--;)r.has(n(e[i]))||e.splice(i,1);for(let t=0;t<o.length;t++)if(t>=e.length||!q(e[t],o[t])){const n=J(e,o[t]);if(-1!==n){const[r]=e.splice(n,1);e.splice(t,0,r)}else e.splice(t,0,o[t])}return e.length>o.length&&e.splice(o.length,e.length-o.length),e},mutateObject:function(e,t,n){if(!w(e,t))throw new TypeError("mutateObject can only be called with arrays");n?Ce(n,"function","The hash function must be a function"):n=Y;const r=Object.keys(t);for(let t in e)r.includes(t)||delete e[t];return r.forEach(n=>{q(e[n],t[n])||(e[n]=t[n])}),e},nl2br:function(e,t){return re("\n","<br>"+(t?"\n":""),e)},numProperties:D,objectToFormData:Et,order:function(e,t,n="asc"){return e?e.sort(function(e,r){return j(e,r,t,n)}):e},outerHeight:function(e){if((e=St(e))&&"offsetHeight"in e){let t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom);return Math.ceil(e.offsetHeight+n)}},outerWidth:function(e){e=St(e);let t=window.getComputedStyle(e),n=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return Math.ceil(e.offsetWidth+n)},percent:function(e,t){return t/100*e},pickValue:function(e){if(Array.isArray(e)&&e.length)return e[Math.floor(Math.random()*e.length)]},post:ft,postOut:function(e,t,n=null,r=""){let o=document.body.querySelector("form#bbn-form_out");o||(o=document.createElement("form"),o.classList.add("bbn-no"),o.setAttribute("id","bbn-form_out"),o.setAttribute("method","post"),o.setAttribute("enctype","multipart/form-data-encoded"),xt(o,"style.display","none"),document.body.appendChild(o)),o instanceof HTMLFormElement&&(o.innerHTML="",o.setAttribute("action",e),o.setAttribute("target",r||"_blank"),t||(t={}),(t=Ne(t)).bbn||(t.bbn="public"),ee(o,t),o.submit(),n&&n())},printf:function(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,n){return void 0!==t[n]?t[n]:e})},quotes2html:function(e,t){return t&&0!==t.toLowerCase().indexOf("s")||(e=re("'","'",e)),t&&0!==t.toLowerCase().indexOf("d")||(e=re('"',""",e)),e},randomInt:kt,randomString:function(e,t,n){let r,o,i={n:"0123456789",l:"abcdefghijklmnopqrstuvwxyz",u:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};n||(n="nlu"),e||(r=kt(8,14)),"string"==typeof t?(n="n",delete i.l,delete i.u,i.n=t,r||(r=e)):"number"==typeof t&&e<t?r=kt(e,t):e&&(r=e);let s="";for(let e=0;e<r;e++)0===e?"n"!==n&&(o=-1===n.indexOf("u")?"l":"u"):o=n[Math.floor(Math.random()*n.length)],s+=i[o][Math.floor(Math.random()*i[o].length)];return s},range:function(e,t,n){return Array.from({length:(t-e)/n+1},(t,r)=>e+r*n)},removeAccents:O,removeEmpty:function(e){var t=[];if(v(e))for(let n=0;n<e.length;n++){let r=!1;e[n]&&(v(e[n])?e[n].length&&(r=!0):w(e[n])?D(e[n])&&(r=!0):r=!0),r&&t.push(e[n])}return t},removeExtraSpaces:function(e){return e.replace(/\s+/g," ").trim()},removeHtmlComments:it,removePrivateProp:p,removeTrailingChars:function(e,t){if(t||(t=" "),t.length){for(;m(e,-t.length)===t;)e=m(e,0,e.length-t.length);for(;m(e,0,t.length)===t;)e=m(e,t.length)}return e},repeat:function(e,t){return e.repeat(t)},replaceAll:re,replaceSelection:function(e,t){let n,r,o;if(n=window.getSelection(),n.getRangeAt&&n.rangeCount){if(r=window.getSelection().getRangeAt(0),r.deleteContents(),r.createContextualFragment)o=r.createContextualFragment(e);else{const t=document.createElement("div");let n;for(t.innerHTML=e,o=document.createDocumentFragment();n=t.firstChild;)o.appendChild(n)}const i=o.firstChild,s=o.lastChild;r.insertNode(o),n.removeAllRanges(),t?(i&&(r.setStartBefore(i),r.setEndAfter(s)),n.addRange(r)):(r.setStartAfter(s),n.addRange(r))}},resize:ht,rgb2hex:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""},riterate:function(e,t,n=!1){return g(e,t,n,!0)},roundDecimal:function(e,t){return Number(Math.round(parseFloat(e+"e"+t+"e-"+t)))},sanitize:function(e,t="_"){let n=["[","]","{","}","(",")","-","+","*","/"],r="[";for(let e=0;e<t.length;e++)n.includes(t[e])&&(r+="\\"),r+=t[e];r+="]+";let o=new RegExp(r,"g");return At(O(e).replace(/[^a-z0-9]/gi,t).replace(o,t),t)},search:J,selectElementText:function(e,t=null){if(t=t||window,e instanceof HTMLInputElement)return void e.select();let n,r,o=t.document;t.getSelection&&o.createRange?(n=t.getSelection(),r=o.createRange(),r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r)):"createTextRange"in o.body&&"function"==typeof o.body.createTextRange&&(r=o.body.createTextRange(),r.moveToElementText(e),r.select())},selector:St,setCookie:function(e,t,n){let r="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),r="; expires="+e.toUTCString()}let o=escape(JSON.stringify({value:t}));document.cookie=e+"="+o+r+"; path=/"},setCssVar:function(e,t){0!==e.indexOf("--")&&(e="--"+e),document.documentElement.style.setProperty(e,t)},setNavigationVars:ut,setProp:function(e,t,n,r=!0,o=!0){Object.defineProperty(e,t,{value:n,writable:r,configurable:o})},setProperty:xt,shorten:It,shortenObj:function e(t,n=100){let r=Me(t);return y(r,(t,o)=>{f(t)&&t.length>n?r[o]=It(t,n):t&&"object"==typeof t&&(r[o]=e(t))}),r},shuffle:function(e){let t,n=e.length;for(;0!=n;)t=Math.floor(Math.random()*n),n--,[e[n],e[t]]=[e[t],e[n]];return e},simpleHash:R,simpleHash1:L,simpleHash2:F,startChrono:function(e){let t=bbn.fn.microtimestamp();return this.constructor.chronos||Object.defineProperty(this.constructor,"chronos",{value:Object.create(null),writable:!1,configurable:!1}),this.constructor.chronos[e||"default"]=t,e},stopChrono:function(e,t){if(this.constructor.chronos[e||"default"]){let n=bbn.fn.microtimestamp()-this.constructor.chronos[e||"default"];return delete this.constructor.chronos[e||"default"],t&&(n=Math.round(n)/1e3),n}throw Error("No chrono with name "+(e||"default"))},stream:function(e,t,n,r,o,i){const s=oe(e,n,"json"),a=X(s);if(null==a?void 0:a.loader)return a.loader;n||(n={}),bbn.env.token&&(n._bbn_token=bbn.env.token);const l=new AbortController;let u="";const c=e=>{if(e.length){e=e.indexOf("\n")>-1?bbn.fn.removeEmpty(e.split("\n")):[e];for(let n in e)try{t(JSON.parse(e[n]))}catch(e){throw e}}},f=bbn.fn.startChrono(),d=fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",signal:l.signal,body:JSON.stringify(n||{})}).then(e=>{if(bbn.fn.log("RESPONSE IN "+bbn.fn.stopChrono(f,!0)+" SECS"),e.body){const r=e.body.getReader(),o=h(t);r.read().then(function e({done:a,value:l}){if(a)return K(s,n),u&&c(u),void(i&&i());if(o)if(u+=ae(l).trim(),bbn.fn.log(["STREAM RESULT",u.length,u]),u)try{c(u),u=""}catch(e){}else t();else bbn.fn.log(["STREAM SUCCESS IS FN? "+o]);return r.read().then(e)})}}).catch(t=>{let i=!(!(a=t)||!0!==a.__BBN_CANCEL__);var a;if(K(s,n,i),i){let n=1;h(o)&&(n=o(t.message,e)),n&&Be(t.message,e)}else{let e=1;h(r)&&(e=r(t.request,t)),e&&He(t.request,t.response?t.response.data:"",t.response?t.response.status:t)}});return A(s,d,l),d},string2ArrayBuffer:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,o=e.length;r<o;r++)n[r]=e.charCodeAt(r);return t},submit:dt,substr:m,sum:function(e,t,n,r,o){let i=0;return y(Fe(e,n,r,o),e=>{let n="function"==typeof t?t(e):e[t];n&&(i+=parseFloat(n)||0)}),i},timestamp:gt,toCSV:function(e,t=",",n="",r='"'){t||(t=","),r||(r='"');let o="",i=e.length;return y(e,(e,s)=>{let a=v(e)?e.length:Object.values(e).length,l=0;y(e,e=>{o+="string"==typeof e?r+re(r,"\\"+r,e)+r:0===e?"0":e&&e.toString?e.toString():r+r,l++,l<a&&(o+=t)}),s<i-1&&(o+=n+"\n")}),o},toggleFullScreen:function(){"mozRequestFullScreen"in window.document.documentElement?window.document.mozFullScreen?window.document.mozCancelFullScreen():"function"==typeof window.document.documentElement.mozRequestFullScreen&&window.document.documentElement.mozRequestFullScreen():"webkitRequestFullScreen"in window.document.documentElement?window.document.webkitIsFullScreen?window.document.webkitCancelFullScreen():"function"==typeof window.document.documentElement.webkitRequestFullScreen&&window.document.documentElement.webkitRequestFullScreen():"msRequestFullScreen"in window.document.documentElement?window.document.msFullscreenEnabled?window.document.msExitFullscreen():"function"==typeof window.document.documentElement.msRequestFullScreen&&window.document.documentElement.msRequestFullScreen():"requestFullscreen"in window.document&&(window.document.fullscreenEnabled?window.document.exitFullscreen():window.document.documentElement.requestFullscreen()),setTimeout(function(){ht()},0)},translate:function(e,t){let n=t?bbn.lng[0===t.indexOf("_")?t:"_"+t]:bbn.lng;g(e,(e,t)=>{n[t]=e})},treatAjaxArguments:lt,treatForHash:H,trim:At,uniqString:function(...e){for(var t="",n=0;n<e.length;n++)if(e[n])if("object"==typeof e[n])if(v(e[n]))t+=JSON.stringify(e[n]);else{let r={};y(Object.keys(e[n]).sort(),t=>{r[t]=e[n][t]}),t+=JSON.stringify(r)}else"string"!=typeof e[n]?t+=e[n].toString():t+=e[n];else t+="__bbn_empty__";return U(t)},unique:et,upload:function(e,t,n=null,r=null,o=null){const i=()=>l.run("post",e||bbn.env.path,{data:Et({file:t}),headers:{"Content-Type":"multipart/form-data"},onUploadProgress(e){if(o){let t=Math.round(100*e.loaded/e.total);o(t,e.loaded,e.total)}}});return n||r?i().then(e=>{n&&(b("SUCCESS",e),n(e))}).catch(e=>{r&&(b("ERROR",e),r(e))}):i()},warning:_t,yieldToBrowser:Ke};const Tt={version:"1.0.1",opt:{_cat:{}},app:{},_:t,$:function(e,t){if(null==t?void 0:t.querySelectorAll)return t.querySelectorAll(e);if(t)throw new Error("Invalid context");return document.body.querySelectorAll(e)},lng:{select_unselect_all:"Select/Clear all",select_all:"Select all",search:"Search",loading:"Loading...",choose:"Choose",error:"Error",server_response:"Server response",reload:"Reload",errorText:"Something went wrong",closeAll:"Close all",closeOthers:"Close others",pin:"Pin",arrange:"Arrange",cancel:"Cancel",unpin:"Unpin",yes:"Yes",no:"No",unknown:"Unknown",untitled:"Untitled",confirmation:"Confirmation",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},var:n,date:Ie,com:l,env:r,db:k,fn:Ot,info:[{value:"ajax",label:"Loading and streaming",description:"Functions related to Ajax requests",icon:"nf nf-fa-rocket"},{value:"browser",label:"Browser-only",description:"Functions that can only be run in the browser",icon:"nf nf-fa-desktop"},{value:"convert",label:"Conversion",description:"Functions related to data conversion",icon:"nf nf-fa-exchange"},{value:"datetime",label:"Date and time",description:"Functions related to dates and times",icon:"nf nf-fa-calendar"},{value:"form",label:"Form manipulation",description:"Functions related to form manipulation and validation",icon:"nf nf-fa-edit"},{value:"html",label:"HTML manipulation",description:"Functions related to HTML manipulation and DOM interaction",icon:"nf nf-fa-html5"},{value:"loop",label:"Looping",description:"Functions related to looping through arrays and objects",icon:"nf nf-fa-repeat"},{value:"misc",label:"Miscellaneous",description:"Miscellaneous functions that do not fit into other categories",icon:"nf nf-fa-cubes"},{value:"object",label:"Object manipulation",description:"Functions related to object manipulation and inspection",icon:"nf nf-fa-object_group"},{value:"phone",label:"Phone and contact",description:"Functions related to phone numbers and contact information",icon:"nf nf-fa-phone"},{value:"string",label:"String manipulation",description:"Functions related to string manipulation and formatting",icon:"nf nf-fa-text_height"},{value:"style",label:"Styling and layout",description:"Functions related to styling and layout management",icon:"nf nf-fa-paint_brush"},{value:"type",label:"Type checking",description:"Functions related to type checking and validation",icon:"nf nf-fa-check_square"}]};return"undefined"!=typeof window&&(window.bbn=Tt),e.bbn=Tt,e.default=Tt,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
2
2
|
//# sourceMappingURL=bbn.js.map
|