From ea113f2769b61c5291ca0768ed4b7187e83b622b Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 16 Sep 2024 21:45:41 +0200 Subject: [PATCH] Update getPagerCount query --- Blacklight/Releases.php | 26 ++++++++++++++++---------- public/build/assets/app-D2jpX1vH.js | 6 ------ public/build/assets/forum-DyY0By5q.js | 8 -------- public/build/manifest.json | 8 ++++---- 4 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 public/build/assets/app-D2jpX1vH.js delete mode 100644 public/build/assets/forum-DyY0By5q.js diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index 0b66a0f3c..78284a08d 100644 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -1075,24 +1075,30 @@ class Releases extends Release /** * Get count of releases for pager. * - * * @param string $query The query to get the count from. */ private function getPagerCount(string $query): int { - $sql = sprintf( - 'SELECT COUNT(z.id) AS count FROM (%s LIMIT %s) z', - preg_replace('/SELECT.+?FROM\s+releases/is', 'SELECT r.id FROM releases', $query), - (int) config('nntmux.max_pager_results') - ); + $queryBuilder = DB::table(DB::raw('('.preg_replace( + '/SELECT.+?FROM\s+releases/is', + 'SELECT r.id FROM releases', + $query + ).' LIMIT '.(int) config('nntmux.max_pager_results').') as z')) + ->selectRaw('COUNT(z.id) as count'); + + $sql = $queryBuilder->toSql(); $count = Cache::get(md5($sql)); + if ($count !== null) { return $count; } - $count = self::fromQuery($sql); - $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_short')); - Cache::put(md5($sql), $count[0]->count, $expiresAt); - return $count[0]->count ?? 0; + $result = $queryBuilder->first(); + $count = $result->count ?? 0; + + $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_short')); + Cache::put(md5($sql), $count, $expiresAt); + + return $count; } } diff --git a/public/build/assets/app-D2jpX1vH.js b/public/build/assets/app-D2jpX1vH.js deleted file mode 100644 index a8d6b5fa6..000000000 --- a/public/build/assets/app-D2jpX1vH.js +++ /dev/null @@ -1,6 +0,0 @@ -function me(e,t){return function(){return e.apply(t,arguments)}}const{toString:je}=Object.prototype,{getPrototypeOf:Z}=Object,H=(e=>t=>{const n=je.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>H(t)===e),q=e=>t=>typeof t===e,{isArray:C}=Array,_=q("undefined");function He(e){return e!==null&&!_(e)&&e.constructor!==null&&!_(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=A("ArrayBuffer");function qe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ye(e.buffer),t}const Ie=q("string"),R=q("function"),Ee=q("number"),I=e=>e!==null&&typeof e=="object",Me=e=>e===!0||e===!1,L=e=>{if(H(e)!=="object")return!1;const t=Z(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ze=A("Date"),Je=A("File"),$e=A("Blob"),Ve=A("FileList"),We=e=>I(e)&&R(e.pipe),Ke=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=H(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},Xe=A("URLSearchParams"),Ge=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function B(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),C(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const be=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Se=e=>!_(e)&&e!==be;function K(){const{caseless:e}=Se(this)&&this||{},t={},n=(r,s)=>{const o=e&&we(t,s)||s;L(t[o])&&L(r)?t[o]=K(t[o],r):L(r)?t[o]=K({},r):C(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(B(t,(s,o)=>{n&&R(s)?e[o]=me(s,n):e[o]=s},{allOwnKeys:r}),e),Qe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ze=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Ye=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Z(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},et=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},tt=e=>{if(!e)return null;if(C(e))return e;let t=e.length;if(!Ee(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},nt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Z(Uint8Array)),rt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},st=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ot=A("HTMLFormElement"),it=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),at=A("RegExp"),Re=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};B(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},ct=e=>{Re(e,(t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(R(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ut=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return C(e)?r(e):r(String(e).split(t)),n},lt=()=>{},ft=(e,t)=>(e=+e,Number.isFinite(e)?e:t),J="abcdefghijklmnopqrstuvwxyz",oe="0123456789",Oe={DIGIT:oe,ALPHA:J,ALPHA_DIGIT:J+J.toUpperCase()+oe},dt=(e=16,t=Oe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function pt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ht=e=>{const t=new Array(10),n=(r,s)=>{if(I(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=C(r)?[]:{};return B(r,(i,c)=>{const p=n(i,s+1);!_(p)&&(o[c]=p)}),t[s]=void 0,o}}return r};return n(e,0)},mt=A("AsyncFunction"),yt=e=>e&&(I(e)||R(e))&&R(e.then)&&R(e.catch),a={isArray:C,isArrayBuffer:ye,isBuffer:He,isFormData:Ke,isArrayBufferView:qe,isString:Ie,isNumber:Ee,isBoolean:Me,isObject:I,isPlainObject:L,isUndefined:_,isDate:ze,isFile:Je,isBlob:$e,isRegExp:at,isFunction:R,isStream:We,isURLSearchParams:Xe,isTypedArray:nt,isFileList:Ve,forEach:B,merge:K,extend:ve,trim:Ge,stripBOM:Qe,inherits:Ze,toFlatObject:Ye,kindOf:H,kindOfTest:A,endsWith:et,toArray:tt,forEachEntry:rt,matchAll:st,isHTMLForm:ot,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:Re,freezeMethods:ct,toObjectSet:ut,toCamelCase:it,noop:lt,toFiniteNumber:ft,findKey:we,global:be,isContextDefined:Se,ALPHABET:Oe,generateString:dt,isSpecCompliantForm:pt,toJSONObject:ht,isAsyncFn:mt,isThenable:yt};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ae=m.prototype,Te={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Te[e]={value:e}});Object.defineProperties(m,Te);Object.defineProperty(Ae,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(Ae);return a.toFlatObject(e,i,function(p){return p!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Et=null;function X(e){return a.isPlainObject(e)||a.isArray(e)}function ge(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ie(e,t,n){return e?e.concat(t).map(function(s,o){return s=ge(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function wt(e){return a.isArray(e)&&!e.some(X)}const bt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function M(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,w){return!a.isUndefined(w[d])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!p&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,d,w){let b=f;if(f&&!w&&typeof f=="object"){if(a.endsWith(d,"{}"))d=r?d:d.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&wt(f)||(a.isFileList(f)||a.endsWith(d,"[]"))&&(b=a.toArray(f)))return d=ge(d),b.forEach(function(x,ke){!(a.isUndefined(x)||x===null)&&t.append(i===!0?ie([d],ke,o):i===null?d:d+"[]",h(x))}),!1}return X(f)?!0:(t.append(ie(w,d,o),h(f)),!1)}const u=[],E=Object.assign(bt,{defaultVisitor:l,convertValue:h,isVisitable:X});function S(f,d){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+d.join("."));u.push(f),a.forEach(f,function(b,g){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(g)?g.trim():g,d,E))===!0&&S(b,d?d.concat(g):[g])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return S(e),t}function ae(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Y(e,t){this._pairs=[],e&&M(e,this,t)}const xe=Y.prototype;xe.append=function(t,n){this._pairs.push([t,n])};xe.toString=function(t){const n=t?function(r){return t.call(this,r,ae)}:ae;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function St(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ne(e,t,n){if(!t)return e;const r=n&&n.encode||St,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new Y(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class ce{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Pe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Rt=typeof URLSearchParams<"u"?URLSearchParams:Y,Ot=typeof FormData<"u"?FormData:null,At=typeof Blob<"u"?Blob:null,Tt={isBrowser:!0,classes:{URLSearchParams:Rt,FormData:Ot,Blob:At},protocols:["http","https","file","blob","url","data"]},Ce=typeof window<"u"&&typeof document<"u",gt=(e=>Ce&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),xt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Nt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ce,hasStandardBrowserEnv:gt,hasStandardBrowserWebWorkerEnv:xt},Symbol.toStringTag,{value:"Module"})),O={...Nt,...Tt};function Pt(e,t){return M(e,new O.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return O.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Ct(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ft(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return i=!i&&a.isArray(s)?s.length:i,p?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Ft(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Ct(r),s,n,0)}),n}return null}function _t(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ee={transitional:Pe,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Fe(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Pt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return M(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),_t(t)):t}],transformResponse:[function(t){const n=this.transitional||ee.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const te=ee,Bt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Dt=e=>{const t={};let n,r,s;return e&&e.split(` -`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Bt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ue=Symbol("internals");function F(e){return e&&String(e).trim().toLowerCase()}function U(e){return e===!1||e==null?e:a.isArray(e)?e.map(U):String(e)}function Lt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ut=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function $(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function kt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function jt(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class z{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,p,h){const l=F(p);if(!l)throw new Error("header name must be a non-empty string");const u=a.findKey(s,l);(!u||s[u]===void 0||h===!0||h===void 0&&s[u]!==!1)&&(s[u||p]=U(c))}const i=(c,p)=>a.forEach(c,(h,l)=>o(h,l,p));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!Ut(t)?i(Dt(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=F(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Lt(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=F(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||$(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=F(i),i){const c=a.findKey(r,i);c&&(!n||$(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||$(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=U(s),delete n[o];return}const c=t?kt(o):String(o).trim();c!==o&&delete n[o],n[c]=U(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ue]=this[ue]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=F(i);r[c]||(jt(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(z.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(z);const T=z;function V(e,t){const n=this||te,r=t||n,s=T.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function _e(e){return!!(e&&e.__CANCEL__)}function D(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(D,m,{__CANCEL__:!0});function Ht(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const qt=O.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function It(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Be(e,t){return e&&!It(t)?Mt(e,t):t}const zt=O.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function Jt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function $t(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const h=Date.now(),l=r[o];i||(i=h),n[s]=p,r[s]=h;let u=o,E=0;for(;u!==s;)E+=n[u++],u=u%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),h-i{const o=s.loaded,i=s.lengthComputable?s.total:void 0,c=o-n,p=r(c),h=o<=i;n=o;const l={loaded:o,total:i,progress:i?o/i:void 0,bytes:c,rate:p||void 0,estimated:p&&i&&h?(i-o)/p:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const Vt=typeof XMLHttpRequest<"u",Wt=Vt&&function(e){return new Promise(function(n,r){let s=e.data;const o=T.from(e.headers).normalize();let{responseType:i,withXSRFToken:c}=e,p;function h(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}let l;if(a.isFormData(s)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((l=o.getContentType())!==!1){const[d,...w]=l?l.split(";").map(b=>b.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...w].join("; "))}}let u=new XMLHttpRequest;if(e.auth){const d=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(d+":"+w))}const E=Be(e.baseURL,e.url);u.open(e.method.toUpperCase(),Ne(E,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function S(){if(!u)return;const d=T.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),b={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:d,config:e,request:u};Ht(function(x){n(x),h()},function(x){r(x),h()},b),u=null}if("onloadend"in u?u.onloadend=S:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(S)},u.onabort=function(){u&&(r(new m("Request aborted",m.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let w=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const b=e.transitional||Pe;e.timeoutErrorMessage&&(w=e.timeoutErrorMessage),r(new m(w,b.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,u)),u=null},O.hasStandardBrowserEnv&&(c&&a.isFunction(c)&&(c=c(e)),c||c!==!1&&zt(E))){const d=e.xsrfHeaderName&&e.xsrfCookieName&&qt.read(e.xsrfCookieName);d&&o.set(e.xsrfHeaderName,d)}s===void 0&&o.setContentType(null),"setRequestHeader"in u&&a.forEach(o.toJSON(),function(w,b){u.setRequestHeader(b,w)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&i!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",le(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",le(e.onUploadProgress)),(e.cancelToken||e.signal)&&(p=d=>{u&&(r(!d||d.type?new D(null,e,u):d),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p)));const f=Jt(E);if(f&&O.protocols.indexOf(f)===-1){r(new m("Unsupported protocol "+f+":",m.ERR_BAD_REQUEST,e));return}u.send(s||null)})},G={http:Et,xhr:Wt};a.forEach(G,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const fe=e=>`- ${e}`,Kt=e=>a.isFunction(e)||e===null||e===!1,De={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o`adapter ${c} `+(p===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : -`+o.map(fe).join(` -`):" "+fe(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:G};function W(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new D(null,e)}function de(e){return W(e),e.headers=T.from(e.headers),e.data=V.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),De.getAdapter(e.adapter||te.adapter)(e).then(function(r){return W(e),r.data=V.call(e,e.transformResponse,r),r.headers=T.from(r.headers),r},function(r){return _e(r)||(W(e),r&&r.response&&(r.response.data=V.call(e,e.transformResponse,r.response),r.response.headers=T.from(r.response.headers))),Promise.reject(r)})}const pe=e=>e instanceof T?{...e}:e;function P(e,t){t=t||{};const n={};function r(h,l,u){return a.isPlainObject(h)&&a.isPlainObject(l)?a.merge.call({caseless:u},h,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(h,l,u){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h,u)}else return r(h,l,u)}function o(h,l){if(!a.isUndefined(l))return r(void 0,l)}function i(h,l){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function c(h,l,u){if(u in t)return r(h,l);if(u in e)return r(void 0,h)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(h,l)=>s(pe(h),pe(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const u=p[l]||s,E=u(e[l],t[l],l);a.isUndefined(E)&&u!==c||(n[l]=E)}),n}const Le="1.6.8",ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ne[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const he={};ne.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Le+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!he[i]&&(he[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Xt(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],p=c===void 0||i(c,o,e);if(p!==!0)throw new m("option "+o+" must be "+p,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const v={assertOptions:Xt,validators:ne},N=v.validators;class j{constructor(t){this.defaults=t,this.interceptors={request:new ce,response:new ce}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=P(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&v.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:v.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=T.concat(i,o);const c=[];let p=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(p=p&&d.synchronous,c.unshift(d.fulfilled,d.rejected))});const h=[];this.interceptors.response.forEach(function(d){h.push(d.fulfilled,d.rejected)});let l,u=0,E;if(!p){const f=[de.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,h),E=f.length,l=Promise.resolve(n);u{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new D(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new re(function(s){t=s}),cancel:t}}}const Gt=re;function vt(e){return function(n){return e.apply(null,n)}}function Qt(e){return a.isObject(e)&&e.isAxiosError===!0}const Q={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Q).forEach(([e,t])=>{Q[t]=e});const Zt=Q;function Ue(e){const t=new k(e),n=me(k.prototype.request,t);return a.extend(n,k.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Ue(P(e,s))},n}const y=Ue(te);y.Axios=k;y.CanceledError=D;y.CancelToken=Gt;y.isCancel=_e;y.VERSION=Le;y.toFormData=M;y.AxiosError=m;y.Cancel=y.CanceledError;y.all=function(t){return Promise.all(t)};y.spread=vt;y.isAxiosError=Qt;y.mergeConfig=P;y.AxiosHeaders=T;y.formToJSON=e=>Fe(a.isHTMLForm(e)?new FormData(e):e);y.getAdapter=De.getAdapter;y.HttpStatusCode=Zt;y.default=y;const Yt=y;window.axios=Yt;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest"; diff --git a/public/build/assets/forum-DyY0By5q.js b/public/build/assets/forum-DyY0By5q.js deleted file mode 100644 index ac12249bd..000000000 --- a/public/build/assets/forum-DyY0By5q.js +++ /dev/null @@ -1,8 +0,0 @@ -function E(r){const a=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&a==="[object Date]"?new r.constructor(+r):typeof r=="number"||a==="[object Number]"||typeof r=="string"||a==="[object String]"?new Date(r):new Date(NaN)}const te=43200,be=1440;let _e={};function Re(){return _e}function Le(r){const a=E(r),e=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return e.setUTCFullYear(a.getFullYear()),+r-+e}function ae(r,a){const e=E(r),n=E(a),o=e.getTime()-n.getTime();return o<0?-1:o>0?1:o}function qe(r,a){const e=E(r),n=E(a),o=e.getFullYear()-n.getFullYear(),u=e.getMonth()-n.getMonth();return o*12+u}function Xe(r){return a=>{const n=(r?Math[r]:Math.trunc)(a);return n===0?0:n}}function Ye(r,a){return+E(r)-+E(a)}function Ve(r){const a=E(r);return a.setHours(23,59,59,999),a}function $e(r){const a=E(r),e=a.getMonth();return a.setFullYear(a.getFullYear(),e+1,0),a.setHours(23,59,59,999),a}function Ue(r){const a=E(r);return+Ve(a)==+$e(a)}function ze(r,a){const e=E(r),n=E(a),o=ae(e,n),u=Math.abs(qe(e,n));let d;if(u<1)d=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-o*u);let l=ae(e,n)===-o;Ue(E(r))&&u===1&&ae(r,n)===1&&(l=!1),d=o*(u-Number(l))}return d===0?0:d}function Ge(r,a,e){const n=Ye(r,a)/1e3;return Xe(e==null?void 0:e.roundingMethod)(n)}const Je={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ke=(r,a,e)=>{let n;const o=Je[r];return typeof o=="string"?n=o:a===1?n=o.one:n=o.other.replace("{{count}}",a.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function de(r){return(a={})=>{const e=a.width?String(a.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const Qe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},et={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tt={date:de({formats:Qe,defaultWidth:"full"}),time:de({formats:Ze,defaultWidth:"full"}),dateTime:de({formats:et,defaultWidth:"full"})},at={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rt=(r,a,e,n)=>at[r];function G(r){return(a,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let o;if(n==="formatting"&&r.formattingValues){const d=r.defaultFormattingWidth||r.defaultWidth,l=e!=null&&e.width?String(e.width):d;o=r.formattingValues[l]||r.formattingValues[d]}else{const d=r.defaultWidth,l=e!=null&&e.width?String(e.width):r.defaultWidth;o=r.values[l]||r.values[d]}const u=r.argumentCallback?r.argumentCallback(a):a;return o[u]}}const nt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},it={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},st={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ot={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},lt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ct={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},dt=(r,a)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},ut={ordinalNumber:dt,era:G({values:nt,defaultWidth:"wide"}),quarter:G({values:it,defaultWidth:"wide",argumentCallback:r=>r-1}),month:G({values:st,defaultWidth:"wide"}),day:G({values:ot,defaultWidth:"wide"}),dayPeriod:G({values:lt,defaultWidth:"wide",formattingValues:ct,defaultFormattingWidth:"wide"})};function J(r){return(a,e={})=>{const n=e.width,o=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],u=a.match(o);if(!u)return null;const d=u[0],l=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],g=Array.isArray(l)?ft(l,k=>k.test(d)):ht(l,k=>k.test(d));let p;p=r.valueCallback?r.valueCallback(g):g,p=e.valueCallback?e.valueCallback(p):p;const w=a.slice(d.length);return{value:p,rest:w}}}function ht(r,a){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&a(r[e]))return e}function ft(r,a){for(let e=0;e{const n=a.match(r.matchPattern);if(!n)return null;const o=n[0],u=a.match(r.parsePattern);if(!u)return null;let d=r.valueCallback?r.valueCallback(u[0]):u[0];d=e.valueCallback?e.valueCallback(d):d;const l=a.slice(o.length);return{value:d,rest:l}}}const gt=/^(\d+)(th|st|nd|rd)?/i,pt=/\d+/i,yt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},vt={any:[/^b/i,/^(a|c)/i]},bt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Lt={any:[/1/i,/2/i,/3/i,/4/i]},It={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Nt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Dt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Et={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},At={ordinalNumber:mt({matchPattern:gt,parsePattern:pt,valueCallback:r=>parseInt(r,10)}),era:J({matchPatterns:yt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any"}),quarter:J({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:Lt,defaultParseWidth:"any",valueCallback:r=>r+1}),month:J({matchPatterns:It,defaultMatchWidth:"wide",parsePatterns:Nt,defaultParseWidth:"any"}),day:J({matchPatterns:wt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:Dt,defaultMatchWidth:"any",parsePatterns:Et,defaultParseWidth:"any"})},Pt={code:"en-US",formatDistance:Ke,formatLong:tt,formatRelative:rt,localize:ut,match:At,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Mt(r,a,e){const n=Re(),o=(e==null?void 0:e.locale)??n.locale??Pt,u=2520,d=ae(r,a);if(isNaN(d))throw new RangeError("Invalid time value");const l=Object.assign({},e,{addSuffix:e==null?void 0:e.addSuffix,comparison:d});let g,p;d>0?(g=E(a),p=E(r)):(g=E(r),p=E(a));const w=Ge(p,g),k=(Le(p)-Le(g))/1e3,L=Math.round((w-k)/60);let A;if(L<2)return e!=null&&e.includeSeconds?w<5?o.formatDistance("lessThanXSeconds",5,l):w<10?o.formatDistance("lessThanXSeconds",10,l):w<20?o.formatDistance("lessThanXSeconds",20,l):w<40?o.formatDistance("halfAMinute",0,l):w<60?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",1,l):L===0?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",L,l);if(L<45)return o.formatDistance("xMinutes",L,l);if(L<90)return o.formatDistance("aboutXHours",1,l);if(L{/*! -* Copyright (c) 2021-2024 Momo Bassit. -* Licensed under the MIT License (MIT) -* https://github.com/mdbassit/Coloris -* Version: 0.24.0 -* NPM: https://github.com/melloware/coloris-npm -*/return((r,a,e,n)=>{const o=a.createElement("canvas").getContext("2d"),u={r:0,g:0,b:0,h:0,s:0,v:0,a:1};let d,l,g,p,w,k,L,A,D,O,C,x,I,X,B,re,T={};const c={el:"[data-coloris]",parent:"body",theme:"default",themeMode:"light",rtl:!1,wrap:!0,margin:2,format:"hex",formatToggle:!1,swatches:[],swatchesOnly:!1,alpha:!0,forceAlpha:!1,focusInput:!0,selectInput:!1,inline:!1,defaultColor:"#000000",clearButton:!1,clearLabel:"Clear",closeButton:!1,closeLabel:"Close",onChange:()=>n,a11y:{open:"Open color picker",close:"Close color picker",clear:"Clear the selected color",marker:"Saturation: {s}. Brightness: {v}.",hueSlider:"Hue slider",alphaSlider:"Opacity slider",input:"Color value field",format:"Color format",swatch:"Color swatch",instruction:"Saturation and brightness selector. Use up, down, left and right arrow keys to select."}},Y={};let ne="",V={},$=!1;function K(t){if(typeof t=="object")for(const i in t)switch(i){case"el":se(t.el),t.wrap!==!1&&Q(t.el);break;case"parent":d=t.parent instanceof HTMLElement?t.parent:a.querySelector(t.parent),d&&(d.appendChild(l),c.parent=t.parent,d===a.body&&(d=n));break;case"themeMode":c.themeMode=t.themeMode,t.themeMode==="auto"&&r.matchMedia&&r.matchMedia("(prefers-color-scheme: dark)").matches&&(c.themeMode="dark");case"theme":t.theme&&(c.theme=t.theme),l.className="clr-picker clr-"+c.theme+" clr-"+c.themeMode,c.inline&&U();break;case"rtl":c.rtl=!!t.rtl,Array.from(a.getElementsByClassName("clr-field")).forEach(f=>f.classList.toggle("clr-rtl",c.rtl));break;case"margin":t.margin*=1,c.margin=isNaN(t.margin)?c.margin:t.margin;break;case"wrap":t.el&&t.wrap&&Q(t.el);break;case"formatToggle":c.formatToggle=!!t.formatToggle,P("clr-format").style.display=c.formatToggle?"block":"none",c.formatToggle&&(c.format="auto");break;case"swatches":if(Array.isArray(t.swatches)){const f=P("clr-swatches"),m=a.createElement("div");f.textContent="",t.swatches.forEach((N,M)=>{const v=a.createElement("button");v.setAttribute("type","button"),v.setAttribute("id","clr-swatch-"+M),v.setAttribute("aria-labelledby","clr-swatch-label clr-swatch-"+M),v.style.color=N,v.textContent=N,m.appendChild(v)}),t.swatches.length&&f.appendChild(m),c.swatches=t.swatches.slice()}break;case"swatchesOnly":c.swatchesOnly=!!t.swatchesOnly,l.setAttribute("data-minimal",c.swatchesOnly);break;case"alpha":c.alpha=!!t.alpha,l.setAttribute("data-alpha",c.alpha);break;case"inline":if(c.inline=!!t.inline,l.setAttribute("data-inline",c.inline),c.inline){const f=t.defaultColor||c.defaultColor;X=le(f),U(),z(f)}break;case"clearButton":typeof t.clearButton=="object"&&(t.clearButton.label&&(c.clearLabel=t.clearButton.label,L.innerHTML=c.clearLabel),t.clearButton=t.clearButton.show),c.clearButton=!!t.clearButton,L.style.display=c.clearButton?"block":"none";break;case"clearLabel":c.clearLabel=t.clearLabel,L.innerHTML=c.clearLabel;break;case"closeButton":c.closeButton=!!t.closeButton,c.closeButton?l.insertBefore(A,w):w.appendChild(A);break;case"closeLabel":c.closeLabel=t.closeLabel,A.innerHTML=c.closeLabel;break;case"a11y":const s=t.a11y;let h=!1;if(typeof s=="object")for(const f in s)s[f]&&c.a11y[f]&&(c.a11y[f]=s[f],h=!0);if(h){const f=P("clr-open-label"),m=P("clr-swatch-label");f.innerHTML=c.a11y.open,m.innerHTML=c.a11y.swatch,A.setAttribute("aria-label",c.a11y.close),L.setAttribute("aria-label",c.a11y.clear),D.setAttribute("aria-label",c.a11y.hueSlider),C.setAttribute("aria-label",c.a11y.alphaSlider),k.setAttribute("aria-label",c.a11y.input),g.setAttribute("aria-label",c.a11y.instruction)}break;default:c[i]=t[i]}}function De(t,i){typeof t=="string"&&typeof i=="object"&&(Y[t]=i,$=!0)}function Ee(t){delete Y[t],Object.keys(Y).length===0&&($=!1,t===ne&&ie())}function he(t){if($){const i=["el","wrap","rtl","inline","defaultColor","a11y"];for(let s in Y){const h=Y[s];if(t.matches(s)){ne=s,V={},i.forEach(f=>delete h[f]);for(let f in h)V[f]=Array.isArray(c[f])?c[f].slice():c[f];K(h);break}}}}function ie(){Object.keys(V).length>0&&(K(V),ne="",V={})}function se(t){t instanceof HTMLElement&&(t=[t]),Array.isArray(t)?t.forEach(i=>{b(i,"click",fe),b(i,"input",me)}):(b(a,"click",t,fe),b(a,"input",t,me))}function fe(t){c.inline||(he(t.target),I=t.target,B=I.value,X=le(B),l.classList.add("clr-open"),U(),z(B),(c.focusInput||c.selectInput)&&(k.focus({preventScroll:!0}),k.setSelectionRange(I.selectionStart,I.selectionEnd)),c.selectInput&&k.select(),(re||c.swatchesOnly)&&ve().shift().focus(),I.dispatchEvent(new Event("open",{bubbles:!0})))}function U(){if(!l||!I&&!c.inline)return;const t=d,i=r.scrollY,s=l.offsetWidth,h=l.offsetHeight,f={left:!1,top:!1};let m,N,M,v={x:0,y:0};if(t&&(m=r.getComputedStyle(t),N=parseFloat(m.marginTop),M=parseFloat(m.borderTopWidth),v=t.getBoundingClientRect(),v.y+=M+i),!c.inline){const S=I.getBoundingClientRect();let F=S.x,_=i+S.y+S.height+c.margin;t?(F-=v.x,_-=v.y,F+s>t.clientWidth&&(F+=S.width-s,f.left=!0),_+h>t.clientHeight-N&&h+c.margin<=S.top-(v.y-i)&&(_-=S.height+h+c.margin*2,f.top=!0),_+=t.scrollTop):(F+s>a.documentElement.clientWidth&&(F+=S.width-s,f.left=!0),_+h-i>a.documentElement.clientHeight&&h+c.margin<=S.top&&(_=i+S.y-h-c.margin,f.top=!0)),l.classList.toggle("clr-left",f.left),l.classList.toggle("clr-top",f.top),l.style.left=F+"px",l.style.top=_+"px",v.x+=l.offsetLeft,v.y+=l.offsetTop}T={width:g.offsetWidth,height:g.offsetHeight,x:g.offsetLeft+v.x,y:g.offsetTop+v.y}}function Q(t){t instanceof HTMLElement?oe(t):Array.isArray(t)?t.forEach(oe):a.querySelectorAll(t).forEach(oe)}function oe(t){const i=t.parentNode;if(!i.classList.contains("clr-field")){const s=a.createElement("div");let h="clr-field";(c.rtl||t.classList.contains("clr-rtl"))&&(h+=" clr-rtl"),s.innerHTML='',i.insertBefore(s,t),s.className=h,s.style.color=t.value,s.appendChild(t)}}function me(t){const i=t.target.parentNode;i.classList.contains("clr-field")&&(i.style.color=t.target.value)}function q(t){if(I&&!c.inline){const i=I;t&&(I=n,B!==i.value&&(i.value=B,i.dispatchEvent(new Event("input",{bubbles:!0})))),setTimeout(()=>{B!==i.value&&i.dispatchEvent(new Event("change",{bubbles:!0}))}),l.classList.remove("clr-open"),$&&ie(),i.dispatchEvent(new Event("close",{bubbles:!0})),c.focusInput&&i.focus({preventScroll:!0}),I=n}}function z(t){const i=Oe(t),s=xe(i);pe(s.s,s.v),Z(i,s),D.value=s.h,l.style.color="hsl("+s.h+", 100%, 50%)",O.style.left=s.h/360*100+"%",p.style.left=T.width*s.s/100+"px",p.style.top=T.height-T.height*s.v/100+"px",C.value=s.a*100,x.style.left=s.a*100+"%"}function le(t){const i=t.substring(0,3).toLowerCase();return i==="rgb"||i==="hsl"?i:"hex"}function W(t){t=t!==n?t:k.value,I&&(I.value=t,I.dispatchEvent(new Event("input",{bubbles:!0}))),c.onChange&&c.onChange.call(r,t,I),a.dispatchEvent(new CustomEvent("coloris:pick",{detail:{color:t,currentEl:I}}))}function ge(t,i){const s={h:D.value*1,s:t/T.width*100,v:100-i/T.height*100,a:C.value/100},h=Te(s);pe(s.s,s.v),Z(h,s),W()}function pe(t,i){let s=c.a11y.marker;t=t.toFixed(1)*1,i=i.toFixed(1)*1,s=s.replace("{s}",t),s=s.replace("{v}",i),p.setAttribute("aria-label",s)}function Ae(t){return{pageX:t.changedTouches?t.changedTouches[0].pageX:t.pageX,pageY:t.changedTouches?t.changedTouches[0].pageY:t.pageY}}function j(t){const i=Ae(t);let s=i.pageX-T.x,h=i.pageY-T.y;d&&(h+=d.scrollTop),ye(s,h),t.preventDefault(),t.stopPropagation()}function Pe(t,i){let s=p.style.left.replace("px","")*1+t,h=p.style.top.replace("px","")*1+i;ye(s,h)}function ye(t,i){t=t<0?0:t>T.width?T.width:t,i=i<0?0:i>T.height?T.height:i,p.style.left=t+"px",p.style.top=i+"px",ge(t,i),p.focus()}function Z(t,i){t===void 0&&(t={}),i===void 0&&(i={});let s=c.format;for(const m in t)u[m]=t[m];for(const m in i)u[m]=i[m];const h=He(u),f=h.substring(0,7);switch(p.style.color=f,x.parentNode.style.color=f,x.style.color=h,w.style.color=h,g.style.display="none",g.offsetHeight,g.style.display="",x.nextElementSibling.style.display="none",x.nextElementSibling.offsetHeight,x.nextElementSibling.style.display="",s==="mixed"?s=u.a===1?"hex":"rgb":s==="auto"&&(s=X),s){case"hex":k.value=h;break;case"rgb":k.value=Be(u);break;case"hsl":k.value=We(Ce(u));break}a.querySelector('.clr-format [value="'+s+'"]').checked=!0}function Me(){const t=D.value*1,i=p.style.left.replace("px","")*1,s=p.style.top.replace("px","")*1;l.style.color="hsl("+t+", 100%, 50%)",O.style.left=t/360*100+"%",ge(i,s)}function Se(){const t=C.value/100;x.style.left=t*100+"%",Z({a:t}),W()}function Te(t){const i=t.s/100,s=t.v/100;let h=i*s,f=t.h/60,m=h*(1-e.abs(f%2-1)),N=s-h;h=h+N,m=m+N;const M=e.floor(f)%6,v=[h,m,N,N,m,h][M],S=[m,h,h,m,N,N][M],F=[N,N,m,h,h,m][M];return{r:e.round(v*255),g:e.round(S*255),b:e.round(F*255),a:t.a}}function Ce(t){const i=t.v/100,s=i*(1-t.s/100/2);let h;return s>0&&s<1&&(h=e.round((i-s)/e.min(s,1-s)*100)),{h:t.h,s:h||0,l:e.round(s*100),a:t.a}}function xe(t){const i=t.r/255,s=t.g/255,h=t.b/255,f=e.max(i,s,h),m=e.min(i,s,h),N=f-m,M=f;let v=0,S=0;return N&&(f===i&&(v=(s-h)/N),f===s&&(v=2+(h-i)/N),f===h&&(v=4+(i-s)/N),f&&(S=N/f)),v=e.floor(v*60),{h:v<0?v+360:v,s:e.round(S*100),v:e.round(M*100),a:t.a}}function Oe(t){const i=/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i;let s,h;return o.fillStyle="#000",o.fillStyle=t,s=i.exec(o.fillStyle),s?h={r:s[3]*1,g:s[4]*1,b:s[5]*1,a:s[6]*1}:(s=o.fillStyle.replace("#","").match(/.{2}/g).map(f=>parseInt(f,16)),h={r:s[0],g:s[1],b:s[2],a:1}),h}function He(t){let i=t.r.toString(16),s=t.g.toString(16),h=t.b.toString(16),f="";if(t.r<16&&(i="0"+i),t.g<16&&(s="0"+s),t.b<16&&(h="0"+h),c.alpha&&(t.a<1||c.forceAlpha)){const m=t.a*255|0;f=m.toString(16),m<16&&(f="0"+f)}return"#"+i+s+h+f}function Be(t){return!c.alpha||t.a===1&&!c.forceAlpha?"rgb("+t.r+", "+t.g+", "+t.b+")":"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"}function We(t){return!c.alpha||t.a===1&&!c.forceAlpha?"hsl("+t.h+", "+t.s+"%, "+t.l+"%)":"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"}function Fe(){a.getElementById("clr-picker")||(d=n,l=a.createElement("div"),l.setAttribute("id","clr-picker"),l.className="clr-picker",l.innerHTML=''+('
')+'
'+('')+'
'+('')+'
'+(""+c.a11y.format+"")+'
'+('")+'
'+('")+"
"+('")+('"),a.body.appendChild(l),g=P("clr-color-area"),p=P("clr-color-marker"),L=P("clr-clear"),A=P("clr-close"),w=P("clr-color-preview"),k=P("clr-color-value"),D=P("clr-hue-slider"),O=P("clr-hue-marker"),C=P("clr-alpha-slider"),x=P("clr-alpha-marker"),se(c.el),Q(c.el),b(l,"mousedown",t=>{l.classList.remove("clr-keyboard-nav"),t.stopPropagation()}),b(g,"mousedown",t=>{b(a,"mousemove",j)}),b(g,"contextmenu",t=>{t.preventDefault()}),b(g,"touchstart",t=>{a.addEventListener("touchmove",j,{passive:!1})}),b(p,"mousedown",t=>{b(a,"mousemove",j)}),b(p,"touchstart",t=>{a.addEventListener("touchmove",j,{passive:!1})}),b(k,"change",t=>{const i=k.value;if(I||c.inline){const s=i===""?i:z(i);W(s)}}),b(L,"click",t=>{W(""),q()}),b(A,"click",t=>{W(),q()}),b(P("clr-format"),"click",".clr-format input",t=>{X=t.target.value,Z(),W()}),b(l,"click",".clr-swatches button",t=>{z(t.target.textContent),W(),c.swatchesOnly&&q()}),b(a,"mouseup",t=>{a.removeEventListener("mousemove",j)}),b(a,"touchend",t=>{a.removeEventListener("touchmove",j)}),b(a,"mousedown",t=>{re=!1,l.classList.remove("clr-keyboard-nav"),q()}),b(a,"keydown",t=>{const i=t.key,s=t.target,h=t.shiftKey;if(i==="Escape"?q(!0):["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(i)&&(re=!0,l.classList.add("clr-keyboard-nav")),i==="Tab"&&s.matches(".clr-picker *")){const m=ve(),N=m.shift(),M=m.pop();h&&s===N?(M.focus(),t.preventDefault()):!h&&s===M&&(N.focus(),t.preventDefault())}}),b(a,"click",".clr-field button",t=>{$&&ie(),t.target.nextElementSibling.dispatchEvent(new Event("click",{bubbles:!0}))}),b(p,"keydown",t=>{const i={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]};Object.keys(i).includes(t.key)&&(Pe(...i[t.key]),t.preventDefault())}),b(g,"click",j),b(D,"input",Me),b(C,"input",Se))}function ve(){return Array.from(l.querySelectorAll("input, button")).filter(s=>!!s.offsetWidth)}function P(t){return a.getElementById(t)}function b(t,i,s,h){const f=Element.prototype.matches||Element.prototype.msMatchesSelector;typeof s=="string"?t.addEventListener(i,m=>{f.call(m.target,s)&&h.call(m.target,m)}):(h=s,t.addEventListener(i,h))}function ee(t,i){i=i!==n?i:[],a.readyState!=="loading"?t(...i):a.addEventListener("DOMContentLoaded",()=>{t(...i)})}NodeList!==n&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);function je(t,i){I=i,B=I.value,he(i),X=le(t),U(),z(t),W(),B!==t&&I.dispatchEvent(new Event("change",{bubbles:!0}))}const ce=(()=>{const t={init:Fe,set:K,wrap:Q,close:q,setInstance:De,setColor:je,removeInstance:Ee,updatePosition:U,ready:ee};function i(s){ee(()=>{s&&(typeof s=="string"?se(s):K(s))})}for(const s in t)i[s]=function(){for(var h=arguments.length,f=new Array(h),m=0;m{r.addEventListener("resize",s=>{i.updatePosition()}),r.addEventListener("scroll",s=>{i.updatePosition()})}),i})();return ce.coloris=ce,ce})(window,document,Math)})();H.coloris;H.init;H.set;H.wrap;H.close;H.setInstance;H.removeInstance;H.updatePosition;function Ne(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function Ie(r,a){for(var e=0;er.length)&&(a=r.length);for(var e=0,n=new Array(a);e1&&arguments[1]!==void 0?arguments[1]:"li",o=e.id,u=e.text,d=document.createElement(n);return d.dataset.id=o,n==="li"&&u&&(d.innerHTML=u),n==="li"&&typeof this.renderListItem=="function"?this.renderListItem(d,e):d}},{key:"elementIsParentOfItem",value:function(e,n){return e.dataset.id==="".concat(n.parent)}},{key:"getParentNodeOfItem",value:function(e,n,o){return e.querySelector("".concat(o,'[data-id="').concat(n.parent,'"]'))}},{key:"elementIsAncestorOfItem",value:function(e,n){return!!this.getParentNodeOfItem(e,n,"li")}},{key:"getDirectListParentOfItem",value:function(e,n){return this.getParentNodeOfItem(e,n,"ol")}},{key:"maybeAppendItemToParentDom",value:function(e){var n=this,o=e.parent,u=this.sortedDataDomArray.find(function(p){return n.elementIsParentOfItem(p,e)||n.elementIsAncestorOfItem(p,e)});if(!u)return!1;var d=this.createItemElement(e),l=this.getDirectListParentOfItem(u,e);if(!l){l=this.createItemElement({id:o},"ol");var g=this.getParentNodeOfItem(u,e,"li")||u;g.appendChild(l)}return l.appendChild(d),!0}},{key:"getListItemsDom",value:function(){var e=this;this.sortedDataDomArray=[];for(var n=[];n.length!==this.sortListItems().length;)n=this.sortedData.reduce(function(o,u){if(!u.id)return o;var d=u.id.toString();if(o.includes(d))return o;var l;if(u.parent)l=e.maybeAppendItemToParentDom(u);else{var g=e.createItemElement(u);e.sortedDataDomArray.push(g),l=!0}return l&&o.push(d),o},n);return this.sortedDataDomArray}},{key:"convertDomToData",value:function(e){var n=this;return Array.from((e==null?void 0:e.querySelectorAll("li"))||[]).map(function(o){var u,d=o.parentNode,l=d.dataset.id,g=Array.from(d.children).findIndex(function(p){return p===o})+1;return u={},y(u,n.getItemPropProxyName("id"),o.dataset.id),y(u,n.getItemPropProxyName("parent"),l),y(u,n.getItemPropProxyName("order"),g),u})}},{key:"render",value:function(){var e=document.createElement("ol");return this.getListItemsDom().forEach(function(n){return e.appendChild(n)}),e}}]),r}(),Bt=function(){function r(a){var e=a.actions,n=e===void 0?{}:e,o=a.data,u=a.droppingEdge,d=u===void 0?15:u,l=a.el,g=a.init,p=g===void 0?!0:g,w=a.listClassNames,k=a.listItemClassNames,L=a.nestingLevels,A=a.propertyMap,D=A===void 0?{}:A,O=a.renderListItem;Ne(this,r),y(this,"actions",void 0),y(this,"classNames",void 0),y(this,"cursor",void 0),y(this,"data",void 0),y(this,"dataEngine",void 0),y(this,"distances",void 0),y(this,"draggedNode",void 0),y(this,"initialised",void 0),y(this,"listClassNames",void 0),y(this,"listEventListeners",void 0),y(this,"listInterface",void 0),y(this,"listItemClassNames",void 0),y(this,"mainListClassName",void 0),y(this,"nestingLevels",void 0),y(this,"placeholderList",void 0),y(this,"placeholderInUse",void 0),y(this,"propertyMap",void 0),y(this,"renderListItem",void 0),y(this,"sortableList",void 0),y(this,"targetedNode",void 0),y(this,"targetNode",void 0),y(this,"wrapper",void 0),this.renderListItem=O;var C=typeof l=="string"?document.querySelector(l):l,x=C instanceof HTMLOListElement||C instanceof HTMLUListElement;this.wrapper=x?void 0:C,this.sortableList=x?C:null,this.data=o,this.listClassNames=this.createListClassNamesArray(w),this.mainListClassName=this.listClassNames[0]||"nested-sort",this.listItemClassNames=this.createListClassNamesArray(k),this.propertyMap=D,this.actions={onDrop:n.onDrop},this.initialised=!1,this.distances={droppingEdge:d},this.classNames={dragged:"ns-dragged",placeholder:"ns-placeholder",targeted:"ns-targeted"},this.listEventListeners={dragover:this.onDragOver.bind(this),dragstart:this.onDragStart.bind(this),dragenter:this.onDragEnter.bind(this),dragend:this.onDragEnd.bind(this),drop:this.onDrop.bind(this)};var I=parseInt(L);this.nestingLevels=isNaN(I)?-1:I,this.listInterface=this.getListInterface(),this.maybeInitDataDom(),this.addListAttributes(),p&&this.initDragAndDrop()}return we(r,[{key:"getListInterface",value:function(){return Array.isArray(this.data)&&this.data.length||this.sortableList instanceof HTMLOListElement?HTMLOListElement:HTMLUListElement}},{key:"getDataEngine",value:function(){return this.dataEngine?this.dataEngine:(this.dataEngine=new Ht({data:this.data,propertyMap:this.propertyMap,renderListItem:this.renderListItem}),this.dataEngine)}},{key:"createListClassNamesArray",value:function(e){return e?Array.isArray(e)?e:e.split(" "):[]}},{key:"maybeInitDataDom",value:function(){if(Array.isArray(this.data)&&this.data.length&&this.wrapper){var e=this.getDataEngine().render();this.wrapper.innerHTML="",this.wrapper.appendChild(e),this.sortableList=e}}},{key:"getListTagName",value:function(){return this.listInterface===HTMLOListElement?"ol":"ul"}},{key:"getSortableList",value:function(){var e;return this.sortableList instanceof this.listInterface?this.sortableList:(this.sortableList=(e=this.wrapper)===null||e===void 0?void 0:e.querySelector(this.getListTagName()),this.sortableList)}},{key:"addListAttributes",value:function(){var e,n=this,o=this.getSortableList();o&&((e=o.classList).add.apply(e,R(this.listClassNames.concat(this.mainListClassName))),o.querySelectorAll(this.getListTagName()).forEach(function(u){var d;(d=u.classList).add.apply(d,R(n.listClassNames))}),o.querySelectorAll("li").forEach(function(u){var d;(d=u.classList).add.apply(d,R(n.listItemClassNames))}))}},{key:"toggleMainListLifeCycleClassName",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=this.getSortableList();if(n){var o="".concat(this.mainListClassName,"--enabled");e?n.classList.add(o):n.classList.remove(o)}}},{key:"toggleListItemAttributes",value:function(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;(e=this.getSortableList())===null||e===void 0||e.querySelectorAll("li").forEach(function(o){o.setAttribute("draggable",n.toString())})}},{key:"toggleListEventListeners",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.getSortableList();o&&Object.keys(this.listEventListeners).forEach(function(u){n?o.removeEventListener(u,e.listEventListeners[u]):o.addEventListener(u,e.listEventListeners[u],!1)})}},{key:"initDragAndDrop",value:function(){this.initialised||(this.toggleListEventListeners(),this.initPlaceholderList(),this.toggleListItemAttributes(),this.toggleMainListLifeCycleClassName(),this.initialised=!0)}},{key:"init",value:function(){this.initDragAndDrop()}},{key:"destroy",value:function(){this.toggleListEventListeners(!0),this.toggleListItemAttributes(!1),this.toggleMainListLifeCycleClassName(!1),this.initialised=!1}},{key:"removeClassFromEl",value:function(e,n){n&&n.classList.contains(e)&&n.classList.remove(e)}},{key:"canBeTargeted",value:function(e){return!this.draggedNode||this.draggedNode===e?!1:e.nodeName==="LI"?!this.nestingThresholdReached(e):e instanceof this.listInterface&&e.classList.contains(this.classNames.placeholder)}},{key:"onDragStart",value:function(e){var n;this.draggedNode=e.target,this.draggedNode.classList.add(this.classNames.dragged),(n=e.dataTransfer)===null||n===void 0||n.setData("text","")}},{key:"onDragOver",value:function(e){e.preventDefault(),this.updateCoordination(e),this.managePlaceholderLists()}},{key:"onDragEnter",value:function(e){this.canBeTargeted(e.target)&&(this.removeClassFromEl(this.classNames.targeted,this.targetedNode),this.targetedNode=e.target,this.targetedNode.classList.add(this.classNames.targeted))}},{key:"onDragEnd",value:function(e){e.stopPropagation(),this.removeClassFromEl(this.classNames.dragged,this.draggedNode),this.removeClassFromEl(this.classNames.targeted,this.targetedNode),this.cleanupPlaceholderLists(),delete this.draggedNode,delete this.targetedNode}},{key:"onDrop",value:function(e){e.stopPropagation(),this.maybeDrop(),this.cleanupPlaceholderLists(),typeof this.actions.onDrop=="function"&&this.actions.onDrop(this.getDataEngine().convertDomToData(this.getSortableList()))}},{key:"updateCoordination",value:function(e){this.calcMouseCoords(e),this.calcMouseToTargetedElDist()}},{key:"getDropLocation",value:function(){if(this.canBeDropped()){var e;if(((e=this.targetedNode)===null||e===void 0?void 0:e.nodeName)==="LI")return"before";if(this.targetedNode instanceof this.listInterface)return"inside"}}},{key:"maybeDrop",value:function(){var e=this.getDropLocation();e&&this.dropTheItem(e)}},{key:"dropTheItem",value:function(e){var n,o,u;switch(e){case"before":(n=this.targetedNode)===null||n===void 0||(o=n.parentNode)===null||o===void 0||o.insertBefore(this.draggedNode,this.targetedNode);break;case"inside":(u=this.targetedNode)===null||u===void 0||u.appendChild(this.draggedNode);break}}},{key:"calcMouseCoords",value:function(e){this.cursor={X:e.clientX,Y:e.clientY}}},{key:"calcMouseToTargetedElDist",value:function(){if(this.targetedNode){var e=this.targetedNode.getBoundingClientRect();this.targetNode={X:e.left,Y:e.top};var n=this.targetNode.Y-this.cursor.Y,o=Math.abs(n);this.distances.mouseTo={targetedElTop:n,targetedElTopAbs:o,targetedElBot:o-this.targetedNode.clientHeight}}}},{key:"areNested",value:function(e,n){return!!e&&!!n&&Array.from(n==null?void 0:n.querySelectorAll("li")).some(function(o){return o===e})}},{key:"cursorIsIndentedEnough",value:function(){return this.cursor.X-this.targetNode.X>50}},{key:"mouseIsTooCloseToTop",value:function(){var e;return(e=this.distances)!==null&&e!==void 0&&e.droppingEdge?this.cursor.Y-this.targetNode.Yl?d:l}for(;o!==((g=e)===null||g===void 0?void 0:g.parentElement);){var g,p,w;((p=e)===null||p===void 0?void 0:p.parentElement)instanceof this.listInterface&&n++,e=(w=e)===null||w===void 0?void 0:w.parentElement}return n+u}},{key:"nestingThresholdReached",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.nestingLevels<0?!1:n?this.getNodeDepth(e)>=this.nestingLevels:this.getNodeDepth(e)>this.nestingLevels}},{key:"analysePlaceHolderSituation",value:function(){if(!this.targetedNode||this.areNested(this.targetedNode,this.draggedNode))return[];var e=[];return!this.cursorIsIndentedEnough()||this.mouseIsTooCloseToTop()?this.targetedNodeIsPlaceholder()||e.push("cleanup"):this.targetedNode!==this.draggedNode&&this.targetedNode.nodeName==="LI"&&!this.targetedNode.querySelectorAll(this.getListTagName()).length&&!this.nestingThresholdReached(this.targetedNode,!0)&&e.push("add"),e}},{key:"animatePlaceholderList",value:function(){var e;this.placeholderInUse.style.minHeight="0",this.placeholderInUse.style.transition="min-height ease .2s",this.placeholderInUse.style.minHeight="".concat((e=this.draggedNode)===null||e===void 0?void 0:e.offsetHeight,"px")}},{key:"addPlaceholderList",value:function(){var e;this.getPlaceholderList(),(e=this.targetedNode)===null||e===void 0||e.appendChild(this.placeholderInUse),this.animatePlaceholderList()}},{key:"targetNodeIsIdentified",value:function(){return!!this.targetedNode}},{key:"targetNodeIsBeingDragged",value:function(){return this.targetNodeIsIdentified()&&this.targetedNode===this.draggedNode}},{key:"targetNodeIsListWithItems",value:function(){return this.targetNodeIsIdentified()&&this.targetedNode instanceof this.listInterface&&!!this.targetedNode.querySelectorAll("li").length}},{key:"canBeDropped",value:function(){return this.targetNodeIsIdentified()&&!this.targetNodeIsBeingDragged()&&!this.targetNodeIsListWithItems()&&!this.areNested(this.targetedNode,this.draggedNode)}},{key:"cleanupPlaceholderLists",value:function(){var e,n=this,o=this.getListTagName(),u=((e=this.getSortableList())===null||e===void 0?void 0:e.querySelectorAll(o))||[];Array.from(u).forEach(function(d){d.querySelectorAll("li").length?d.classList.contains(n.classNames.placeholder)&&(d.classList.remove(n.classNames.placeholder),d.style.minHeight="auto",d.dataset.id=d.parentNode.dataset.id):d.remove()})}},{key:"initPlaceholderList",value:function(){var e;this.placeholderList=document.createElement(this.getListTagName()),(e=this.placeholderList.classList).add.apply(e,[this.classNames.placeholder].concat(R(this.listClassNames)))}},{key:"getPlaceholderList",value:function(){return this.placeholderInUse=this.placeholderList.cloneNode(!0),this.placeholderInUse}},{key:"addNewItem",value:function(e){var n,o=e.item,u=e.asLastChild,d=u===void 0?!1:u,l=this.getDataEngine().addNewItem({item:o,asLastChild:d});return l.setAttribute("draggable",String(this.initialised)),(n=this.getSortableList())===null||n===void 0||n[d?"append":"prepend"](l),{data:this.getDataEngine().convertDomToData(this.getSortableList())}}}]),r}();window.dateFormatDistance=Mt;window.Coloris=H;window.Coloris.init();window.NestedSort=Bt; diff --git a/public/build/manifest.json b/public/build/manifest.json index 0590b8018..a433ae50c 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -1,16 +1,16 @@ { "resources/css/app.css": { - "file": "assets/app-2M_Y6p7_.css", + "file": "assets/app-CKANnDLf.css", "src": "resources/css/app.css", "isEntry": true }, "resources/forum/livewire-tailwind/css/forum.css": { - "file": "assets/forum-7Kg14gm4.css", + "file": "assets/forum-D6itczZG.css", "src": "resources/forum/livewire-tailwind/css/forum.css", "isEntry": true }, "resources/forum/livewire-tailwind/js/forum.js": { - "file": "assets/forum-DyY0By5q.js", + "file": "assets/forum-DYii3E-X.js", "name": "forum", "src": "resources/forum/livewire-tailwind/js/forum.js", "isEntry": true, @@ -19,7 +19,7 @@ ] }, "resources/js/app.js": { - "file": "assets/app-D2jpX1vH.js", + "file": "assets/app-CEsE5a7F.js", "name": "app", "src": "resources/js/app.js", "isEntry": true