jvcgpt / dist /assets /index-D9GZL6lq.js
Greums's picture
add static webpage
eda2b55
raw
history blame
30.8 kB
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();var ee,v,Me,E,ye,Oe,se,Ue,ce,ie,ae,A={},Ae=[],tt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,le=Array.isArray;function L(e,t){for(var n in t)e[n]=t[n];return e}function ue(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function j(e,t,n){var o,s,r,a={};for(r in t)r=="key"?o=t[r]:r=="ref"?s=t[r]:a[r]=t[r];if(arguments.length>2&&(a.children=arguments.length>3?ee.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)a[r]===void 0&&(a[r]=e.defaultProps[r]);return J(e,a,o,s,null)}function J(e,t,n,o,s){var r={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++Me,__i:-1,__u:0};return s==null&&v.vnode!=null&&v.vnode(r),r}function z(e){return e.children}function K(e,t){this.props=e,this.context=t}function M(e,t){if(t==null)return e.__?M(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?M(e):null}function De(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return De(e)}}function be(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!Q.__r++||ye!==v.debounceRendering)&&((ye=v.debounceRendering)||Oe)(Q)}function Q(){var e,t,n,o,s,r,a,_;for(E.sort(se);e=E.shift();)e.__d&&(t=E.length,o=void 0,r=(s=(n=e).__v).__e,a=[],_=[],n.__P&&((o=L({},s)).__v=s.__v+1,v.vnode&&v.vnode(o),de(n.__P,o,s,n.__n,n.__P.namespaceURI,32&s.__u?[r]:null,a,r??M(s),!!(32&s.__u),_),o.__v=s.__v,o.__.__k[o.__i]=o,We(a,o,_),o.__e!=r&&De(o)),E.length>t&&E.sort(se));Q.__r=0}function ze(e,t,n,o,s,r,a,_,u,l,f){var i,h,d,g,x,b,m=o&&o.__k||Ae,p=t.length;for(u=nt(n,t,m,u,p),i=0;i<p;i++)(d=n.__k[i])!=null&&(h=d.__i===-1?A:m[d.__i]||A,d.__i=i,b=de(e,d,h,s,r,a,_,u,l,f),g=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&fe(h.ref,null,d),f.push(d.ref,d.__c||g,d)),x==null&&g!=null&&(x=g),4&d.__u||h.__k===d.__k?u=Ge(d,u,e):typeof d.type=="function"&&b!==void 0?u=b:g&&(u=g.nextSibling),d.__u&=-7);return n.__e=x,u}function nt(e,t,n,o,s){var r,a,_,u,l,f=n.length,i=f,h=0;for(e.__k=new Array(s),r=0;r<s;r++)(a=t[r])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=r+h,(a=e.__k[r]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?J(null,a,null,null,null):le(a)?J(z,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?J(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,_=null,(l=a.__i=ot(a,n,u,i))!==-1&&(i--,(_=n[l])&&(_.__u|=2)),_==null||_.__v===null?(l==-1&&h--,typeof a.type!="function"&&(a.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,a.__u|=4))):e.__k[r]=null;if(i)for(r=0;r<f;r++)(_=n[r])!=null&&!(2&_.__u)&&(_.__e==o&&(o=M(_)),Be(_,_));return o}function Ge(e,t,n){var o,s;if(typeof e.type=="function"){for(o=e.__k,s=0;o&&s<o.length;s++)o[s]&&(o[s].__=e,t=Ge(o[s],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=M(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ot(e,t,n,o){var s,r,a=e.key,_=e.type,u=t[n];if(u===null||u&&a==u.key&&_===u.type&&!(2&u.__u))return n;if(o>(u!=null&&!(2&u.__u)?1:0))for(s=n-1,r=n+1;s>=0||r<t.length;){if(s>=0){if((u=t[s])&&!(2&u.__u)&&a==u.key&&_===u.type)return s;s--}if(r<t.length){if((u=t[r])&&!(2&u.__u)&&a==u.key&&_===u.type)return r;r++}}return-1}function we(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||tt.test(t)?n:n+"px"}function G(e,t,n,o,s){var r;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||we(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||we(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Ue,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=ce,e.addEventListener(t,r?ae:ie,r)):e.removeEventListener(t,r?ae:ie,r);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function $e(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ce++;else if(t.t<n.u)return;return n(v.event?v.event(t):t)}}}function de(e,t,n,o,s,r,a,_,u,l){var f,i,h,d,g,x,b,m,p,C,T,y,$,N,S,I,R,P=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),r=[_=t.__e=n.__e]),(f=v.__b)&&f(t);e:if(typeof P=="function")try{if(m=t.props,p="prototype"in P&&P.prototype.render,C=(f=P.contextType)&&o[f.__c],T=f?C?C.props.value:f.__:o,n.__c?b=(i=t.__c=n.__c).__=i.__E:(p?t.__c=i=new P(m,T):(t.__c=i=new K(m,T),i.constructor=P,i.render=st),C&&C.sub(i),i.props=m,i.state||(i.state={}),i.context=T,i.__n=o,h=i.__d=!0,i.__h=[],i._sb=[]),p&&i.__s==null&&(i.__s=i.state),p&&P.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=L({},i.__s)),L(i.__s,P.getDerivedStateFromProps(m,i.__s))),d=i.props,g=i.state,i.__v=t,h)p&&P.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),p&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(p&&P.getDerivedStateFromProps==null&&m!==d&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(m,T),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(m,i.__s,T)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(i.props=m,i.state=i.__s,i.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(O){O&&(O.__=t)}),y=0;y<i._sb.length;y++)i.__h.push(i._sb[y]);i._sb=[],i.__h.length&&a.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(m,i.__s,T),p&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(d,g,x)})}if(i.context=T,i.props=m,i.__P=e,i.__e=!1,$=v.__r,N=0,p){for(i.state=i.__s,i.__d=!1,$&&$(t),f=i.render(i.props,i.state,i.context),S=0;S<i._sb.length;S++)i.__h.push(i._sb[S]);i._sb=[]}else do i.__d=!1,$&&$(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++N<25);i.state=i.__s,i.getChildContext!=null&&(o=L(L({},o),i.getChildContext())),p&&!h&&i.getSnapshotBeforeUpdate!=null&&(x=i.getSnapshotBeforeUpdate(d,g)),_=ze(e,le(I=f!=null&&f.type===z&&f.key==null?f.props.children:f)?I:[I],t,n,o,s,r,a,_,u,l),i.base=t.__e,t.__u&=-161,i.__h.length&&a.push(i),b&&(i.__E=i.__=null)}catch(O){if(t.__v=null,u||r!=null)if(O.then){for(t.__u|=u?160:128;_&&_.nodeType==8&&_.nextSibling;)_=_.nextSibling;r[r.indexOf(_)]=null,t.__e=_}else for(R=r.length;R--;)ue(r[R]);else t.__e=n.__e,t.__k=n.__k;v.__e(O,t,n)}else r==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):_=t.__e=rt(n.__e,t,n,o,s,r,a,u,l);return(f=v.diffed)&&f(t),128&t.__u?void 0:_}function We(e,t,n){for(var o=0;o<n.length;o++)fe(n[o],n[++o],n[++o]);v.__c&&v.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(r){r.call(s)})}catch(r){v.__e(r,s.__v)}})}function rt(e,t,n,o,s,r,a,_,u){var l,f,i,h,d,g,x,b=n.props,m=t.props,p=t.type;if(p=="svg"?s="http://www.w3.org/2000/svg":p=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),r!=null){for(l=0;l<r.length;l++)if((d=r[l])&&"setAttribute"in d==!!p&&(p?d.localName==p:d.nodeType==3)){e=d,r[l]=null;break}}if(e==null){if(p==null)return document.createTextNode(m);e=document.createElementNS(s,p,m.is&&m),_&&(v.__m&&v.__m(t,r),_=!1),r=null}if(p===null)b===m||_&&e.data===m||(e.data=m);else{if(r=r&&ee.call(e.childNodes),b=n.props||A,!_&&r!=null)for(b={},l=0;l<e.attributes.length;l++)b[(d=e.attributes[l]).name]=d.value;for(l in b)if(d=b[l],l!="children"){if(l=="dangerouslySetInnerHTML")i=d;else if(!(l in m)){if(l=="value"&&"defaultValue"in m||l=="checked"&&"defaultChecked"in m)continue;G(e,l,null,d,s)}}for(l in m)d=m[l],l=="children"?h=d:l=="dangerouslySetInnerHTML"?f=d:l=="value"?g=d:l=="checked"?x=d:_&&typeof d!="function"||b[l]===d||G(e,l,d,b[l],s);if(f)_||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),ze(e,le(h)?h:[h],t,n,o,p=="foreignObject"?"http://www.w3.org/1999/xhtml":s,r,a,r?r[0]:n.__k&&M(n,0),_,u),r!=null)for(l=r.length;l--;)ue(r[l]);_||(l="value",p=="progress"&&g==null?e.removeAttribute("value"):g!==void 0&&(g!==e[l]||p=="progress"&&!g||p=="option"&&g!==b[l])&&G(e,l,g,b[l],s),l="checked",x!==void 0&&x!==e[l]&&G(e,l,x,b[l],s))}return e}function fe(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(s){v.__e(s,n)}}function Be(e,t,n){var o,s;if(v.unmount&&v.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||fe(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){v.__e(r,t)}o.base=o.__P=null}if(o=e.__k)for(s=0;s<o.length;s++)o[s]&&Be(o[s],t,n||typeof e.type!="function");n||ue(e.__e),e.__c=e.__=e.__e=void 0}function st(e,t,n){return this.constructor(e,n)}function it(e,t,n){var o,s,r,a;t==document&&(t=document.documentElement),v.__&&v.__(e,t),s=(o=!1)?null:t.__k,r=[],a=[],de(t,e=t.__k=j(z,null,[e]),s||A,A,t.namespaceURI,s?null:t.firstChild?ee.call(t.childNodes):null,r,s?s.__e:t.firstChild,o,a),We(r,e,a)}ee=Ae.slice,v={__e:function(e,t,n,o){for(var s,r,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((r=s.constructor)&&r.getDerivedStateFromError!=null&&(s.setState(r.getDerivedStateFromError(e)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,o||{}),a=s.__d),a)return s.__E=s}catch(_){e=_}throw e}},Me=0,K.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=L({},this.state),typeof e=="function"&&(e=e(L({},n),this.props)),e&&L(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),be(this))},K.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),be(this))},K.prototype.render=z,E=[],Oe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,se=function(e,t){return e.__v.__b-t.__v.__b},Q.__r=0,Ue=/(PointerCapture)$|Capture$/i,ce=0,ie=$e(!1),ae=$e(!0);var at=0;function c(e,t,n,o,s,r){t||(t={});var a,_,u=t;if("ref"in u)for(_ in u={},t)_=="ref"?a=t[_]:u[_]=t[_];var l={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--at,__i:-1,__u:0,__source:s,__self:r};if(typeof e=="function"&&(a=e.defaultProps))for(_ in a)u[_]===void 0&&(u[_]=a[_]);return v.vnode&&v.vnode(l),l}var D,w,ne,ke,X=0,Ve=[],k=v,Se=k.__b,xe=k.__r,Te=k.diffed,Ne=k.__c,Ce=k.unmount,Pe=k.__;function he(e,t){k.__h&&k.__h(w,e,X||t),X=0;var n=w.__H||(w.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function q(e){return X=1,_t(Ke,e)}function _t(e,t,n){var o=he(D++,2);if(o.t=e,!o.__c&&(o.__=[Ke(void 0,t),function(_){var u=o.__N?o.__N[0]:o.__[0],l=o.t(u,_);u!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=w,!w.u)){var s=function(_,u,l){if(!o.__c.__H)return!0;var f=o.__c.__H.__.filter(function(h){return!!h.__c});if(f.every(function(h){return!h.__N}))return!r||r.call(this,_,u,l);var i=o.__c.props!==_;return f.forEach(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(i=!0)}}),r&&r.call(this,_,u,l)||i};w.u=!0;var r=w.shouldComponentUpdate,a=w.componentWillUpdate;w.componentWillUpdate=function(_,u,l){if(this.__e){var f=r;r=void 0,s(_,u,l),r=f}a&&a.call(this,_,u,l)},w.shouldComponentUpdate=s}return o.__N||o.__}function W(e,t){var n=he(D++,3);!k.__s&&Je(n.__H,t)&&(n.__=e,n.i=t,w.__H.__h.push(n))}function pe(e,t){var n=he(D++,7);return Je(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ie(e,t){return X=8,pe(function(){return e},t)}function ct(){for(var e;e=Ve.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Z),e.__H.__h.forEach(_e),e.__H.__h=[]}catch(t){e.__H.__h=[],k.__e(t,e.__v)}}k.__b=function(e){w=null,Se&&Se(e)},k.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pe&&Pe(e,t)},k.__r=function(e){xe&&xe(e),D=0;var t=(w=e.__c).__H;t&&(ne===w?(t.__h=[],w.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(Z),t.__h.forEach(_e),t.__h=[],D=0)),ne=w},k.diffed=function(e){Te&&Te(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ve.push(t)!==1&&ke===k.requestAnimationFrame||((ke=k.requestAnimationFrame)||lt)(ct)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),ne=w=null},k.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Z),n.__h=n.__h.filter(function(o){return!o.__||_e(o)})}catch(o){t.some(function(s){s.__h&&(s.__h=[])}),t=[],k.__e(o,n.__v)}}),Ne&&Ne(e,t)},k.unmount=function(e){Ce&&Ce(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{Z(o)}catch(s){t=s}}),n.__H=void 0,t&&k.__e(t,n.__v))};var qe=typeof requestAnimationFrame=="function";function lt(e){var t,n=function(){clearTimeout(o),qe&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);qe&&(t=requestAnimationFrame(n))}function Z(e){var t=w,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),w=t}function _e(e){var t=w;e.__c=e.__(),w=t}function Je(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Ke(e,t){return typeof t=="function"?t(e):t}const ut="_header_1hnaa_1",dt="_logo_1hnaa_6",He={header:ut,logo:dt},ft="_container_1putz_1",ht={container:ft};function Le(e){return c("div",{class:ht.container,children:e.children})}const Ze="topics";function pt(){const e=localStorage.getItem(Ze);return e?JSON.parse(e):[]}function mt(e){localStorage.setItem(Ze,JSON.stringify(e))}function gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/var je;function vt(){return je||(je=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",a=0;a<arguments.length;a++){var _=arguments[a];_&&(r=s(r,o(_)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var _ in r)t.call(r,_)&&r[_]&&(a=s(a,_));return a}function s(r,a){return a?r?r+" "+a:r+a:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(oe)),oe.exports}var yt=vt();const te=gt(yt),bt="_spinnerSquare_4vgl0_1",wt="_square1_4vgl0_14",$t="_square2_4vgl0_18",kt="_square3_4vgl0_22",B={spinnerSquare:bt,square1:wt,"square-anim":"_square-anim_4vgl0_1",square2:$t,square3:kt};function St(e){return c("div",{className:te(B.spinnerSquare,e.className),children:[c("div",{className:B.square1}),c("div",{className:B.square2}),c("div",{className:B.square3})]})}const xt="_spinner_1pqws_1",Tt="_list_1pqws_5",Nt="_highlight_1pqws_44",Ct="_head_1pqws_48",Pt="_generationSettings_1pqws_52",U={spinner:xt,list:Tt,highlight:Nt,head:Ct,generationSettings:Pt},H={home:"home",topic:"topic",settings:"settings"},It="_btn_1ts7o_1",qt="_disabled_1ts7o_18",Ht="_secondary_1ts7o_22",Lt="_spinner_1ts7o_32",jt="_load3_1ts7o_1",V={btn:It,disabled:qt,secondary:Ht,spinner:Lt,load3:jt};function me(e){const t=e.disabled||e.loading,n=te(V.btn,{[V.secondary]:e.secondary},"button",e.className,{[V.disabled]:t});let o;return e.loading&&(o=c("span",{className:V.spinner})),c("button",{type:"button",onClick:()=>{t||e.onClick()},className:n,disabled:t,children:[o,e.children]})}const Rt=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;function ge(e){console.log("iso8601ToTokens",e);const t=e.match(Rt),n=t[1],o=Qe[parseInt(t[2],10)-1],s=t[3],r=t[4],a=t[5],_=t[6];return`${s} ${o} ${n} à ${r}:${a}:${_}`}const Et=/(\d{1,2}) ([a-zA-Z\u00C0-\u024F]+) (\d{4}) à (\d{2}):(\d{2}):(\d{2})/;function Ft(e){console.log("tokensToIso8601",e);const t=e.match(Et);if(!t)throw new Error("Invalid date format");const[,n,o,s,r,a,_]=t,u=(Qe.indexOf(o)+1).toString();if(!u)throw new Error("Invalid month name");return`${s}-${u.padStart(2,"0")}-${n.padStart(2,"0")}T${r}:${a}:${_}`}const Qe=["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],Mt="_formGroup_1eeq9_1",Ot={formGroup:Mt};function Y(e){return c("div",{className:Ot.formGroup,children:e.children})}const Ut="_rangeSlider_jfo6h_1",At="_rangeSlider__values_jfo6h_99",Dt="_progress_jfo6h_116",Re={rangeSlider:Ut,rangeSlider__values:At,progress:Dt};function ve(e){return c("div",{className:Re.rangeSlider,style:`--min:${e.min}; --max:${e.max}; --step:${Math.max(e.step,.5)}; --value:${e.value}; --text-value:"${e.value}";`,children:[c("input",{name:e.name,type:"range",min:e.min,max:e.max,step:e.step,value:e.value,onInput:t=>e.onChange(Number(t.target.value))}),c("output",{}),c("div",{className:Re.progress})]})}function zt(e){const t=pe(()=>e.topics===null||e.topics.length<1?e.topics:e.topics.sort((n,o)=>n.posts.length<1||o.posts.length<1?0:o.posts[o.posts.length-1].date.localeCompare(n.posts[n.posts.length-1].date)),[e.topics]);return c("div",{children:[t===null?c(St,{className:U.spinner}):c(Gt,{topics:t,setRoute:e.setRoute,latestGeneratedTopicId:e.latestGeneratedTopicId}),c("div",{children:[c("h2",{children:"Nouveau topic"}),c("div",{className:U.generationSettings,children:c(Y,{children:[c("label",{for:"postCount",children:"Nombre de posts"}),c(ve,{name:"postCount",value:e.settings.postCount,onChange:n=>e.setSettings({...e.settings,postCount:n}),min:1,max:10,step:1})]})}),c(me,{onClick:()=>e.generateTopic(e.settings.postCount),secondary:!0,loading:e.pendingGeneration,children:"Générer"})]}),c("hr",{})]})}function Gt(e){return c("ul",{className:U.list,children:[c("li",{className:U.head,children:[c("span",{children:"Sujet"}),c("span",{children:"Auteur"}),c("span",{children:"NB"}),c("span",{children:"Dernier msg"})]}),e.topics.map(t=>c("li",{className:te({[U.highlight]:t.id===e.latestGeneratedTopicId}),children:[c("span",{children:c("a",{href:"#",onClick:n=>{n.preventDefault(),e.setRoute(H.topic,0,t.id)},children:t.title})}),c("span",{children:t.posts[0].user}),c("span",{children:t.posts.length}),c("span",{children:ge(t.posts[t.posts.length-1].date)})]}))]})}const Wt="_post_uuidr_1",Bt="_postHeader_uuidr_12",Vt="_avatar_uuidr_23",Jt="_user_uuidr_31",Kt="_date_uuidr_39",Zt="_generationSettings_uuidr_46",F={post:Wt,postHeader:Bt,avatar:Vt,user:Jt,date:Kt,generationSettings:Zt},Qt="_wrapper_cfqzy_1",Xt={wrapper:Qt},Yt=[[":)","1"],[":snif:","20"],[":gba:","17"],[":g)","3"],[":-)","46"],[":snif2:","13"],[":bravo:","69"],[":d)","4"],[":hap:","18"],[":ouch:","22"],[":pacg:","9"],[":cd:","5"],[":-)))","23"],[":ouch2:","57"],[":pacd:","10"],[":cute:","nyu"],[":content:","24"],[":p)","7"],[":-p","31"],[":noel:","11"],[":oui:","37"],[":(","45"],[":peur:","47"],[":question:","2"],[":cool:","26"],[":-(","14"],[":coeur:","54"],[":mort:","21"],[":rire:","39"],[":-((","15"],[":fou:","50"],[":sleep:","27"],[":-D","40"],[":nonnon:","25"],[":fier:","53"],[":honte:","30"],[":rire2:","41"],[":non2:","33"],[":sarcastic:","43"],[":monoeil:","34"],[":o))","12"],[":nah:","19"],[":doute:","28"],[":rouge:","55"],[":ok:","36"],[":non:","35"],[":malade:","8"],[":fete:","66"],[":sournois:","67"],[":hum:","68"],[":ange:","60"],[":diable:","61"],[":gni:","62"],[":play:","play"],[":desole:","65"],[":spoiler:","63"],[":merci:","58"],[":svp:","59"],[":sors:","56"],[":salut:","42"],[":rechercher:","38"],[":hello:","29"],[":up:","44"],[":bye:","48"],[":gne:","51"],[":lol:","32"],[":dpdr:","49"],[":dehors:","52"],[":hs:","64"],[":banzai:","70"],[":bave:","71"],[":pf:","pf"],[":cimer:","cimer"],[":ddb:","ddb"],[":pave:","pave"],[":objection:","objection"],[":siffle:","siffle"]];function en(e){const t=pe(()=>{const n=on(e.raw);return nn(n).replace(/\n/g,"<br/>")},[e.raw]);return c("div",{className:Xt.wrapper,dangerouslySetInnerHTML:{__html:t}})}const tn=[[/(^| )https?:\/\/image\.noelshack\.com\/(?:fichiers|minis)(\S+)/gm,'$1<img width="68" height="51" alt="noelshak" src="https://image.noelshack.com/minis/$2"/>'],[/(^| )https:\/\/vocaroo.com\/(.+)/gm,'$1<div><iframe width="300" height="60" src="https://vocaroo.com/embed/$2?autoplay=0" frameborder="0" allow="autoplay"></iframe></div>'],[/^(?:&gt;.*(?:\n&gt;.*)*)/g,(e,t)=>{const n=e.exec(t);if(!n)return t;console.log(n);const o=n.index,s=n[0].length;return t.substring(0,o)+`<blockquote>${n[0].replace(/^&gt;/gm,"")}</blockquote>`+t.substring(o+s)}],[/&lt;spoil&gt;(.*?)&lt;\/spoil&gt;/gm,(e,t)=>t.replace(e,(n,o)=>{const s=(Math.random()+1).toString(36).substring(2);return`<span class="bloc-spoil-jv"><input type="checkbox" id="${s}" class="open-spoil"><label class="barre-head" for="${s}"><span class="txt-spoil">Spoil</span></label><span class="contenu-spoil">${o}</span></span>`})],[/(^| )(https?:\/\/\S+)/gm,'$1<a href="$2" target="_blank">$2</a>'],...Yt.map(e=>[new RegExp("(?:(^| )"+e[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+")","gm"),`$1<img src="https://image.jeuxvideo.com/smileys_img/${e[1]}.gif" alt="${e[0]}"/>`])];function nn(e){do for(const[t,n]of tn)n instanceof Function?e=n(t,e):e=e.replace(t,n);while(!1);return e}function on(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function rn(e){return console.log(e.topic),c("div",{children:[e.topic.posts.map(t=>c(sn,{post:t})),c("div",{children:[c("h2",{children:"Ajout de posts"}),c("div",{className:F.generationSettings,children:c(Y,{children:[c("label",{htmlFor:"postCount",children:"Nombre de posts"}),c(ve,{name:"postCount",value:e.settings.postCount,onChange:t=>e.setSettings({...e.settings,postCount:t}),min:1,max:10,step:1})]})}),c(me,{onClick:()=>e.addPosts(e.topic.id,e.settings.postCount),secondary:!0,loading:e.pendingGeneration,children:"Générer"})]}),c("hr",{})]})}function sn(e){return c("div",{className:F.post,children:[c("div",{className:F.postHeader,children:[c("img",{src:"https://image.jeuxvideo.com/avatar-sm/default.jpg",className:F.avatar,alt:"ahi"}),c("div",{className:F.user,children:e.post.user}),c("div",{className:F.date,children:ge(e.post.date)})]}),c(en,{raw:e.post.content})]})}const an="_wrapper_1dmrl_1",_n="_icon_1dmrl_6",cn="_input_1dmrl_14",re={wrapper:an,icon:_n,input:cn},ln=({type:e,icon:t,value:n,placeholder:o,onChange:s,className:r,disabled:a,id:_,name:u})=>{const[l,f]=q(!1),i=te(re.input,"generic-input",r,{focused:l,disabled:a}),h=g=>{console.log("handleInputChange");const x=g.target;s(e==="number"?parseFloat(x.value)||0:x.value)},d=t;return c("div",{className:re.wrapper,children:[c(d,{className:re.icon,size:18}),c("input",{title:"Le pseudo doit avoir une longueur comprise entre 3 et 15 caractères.",type:e,id:_,name:u,value:n,placeholder:o,onInput:h,className:i,disabled:a,onFocus:()=>f(!0),onBlur:()=>f(!1)})]})},un=e=>{const t=e.color||"currentColor",n=e.size||24;return delete e.color,delete e.size,j("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e),j("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),j("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}))},dn=e=>{const t=e.color||"currentColor",n=e.size||24;return delete e.color,delete e.size,j("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e),j("circle",{cx:"12",cy:"12",r:"3"}),j("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))};function fn(e){return c("div",{children:c("form",{children:[c(Y,{children:[c("label",{htmlFor:"api",children:"API"}),c(ln,{type:"text",placeholder:"URl d'API ex: https://ouruq7zepnehg2-5000.proxy.runpod.net/",icon:un,value:e.settings.apiURL,onChange:t=>e.setSettings({...e.settings,apiURL:t})})]}),c(Y,{children:[c("label",{for:"temperature",children:"Temperature"}),c(ve,{name:"temperature",value:e.settings.temperature,onChange:t=>e.setSettings({...e.settings,temperature:t}),min:0,max:5,step:.1})]}),c(me,{onClick:()=>{history.go(-1)},children:"Retour"})]})})}const hn="_breadcrumbs_145yl_1",pn="_actions_145yl_10",Ee={breadcrumbs:hn,actions:pn};function mn(e){return c("div",{children:[c("nav",{className:Ee.breadcrumbs,children:[e.breadcrumbs,c("div",{className:Ee.actions,children:c("a",{href:"#",title:"Paramètres",onClick:t=>{t.preventDefault(),e.setRoute(H.settings)},children:c(dn,{size:18})})})]}),c("h2",{children:e.title}),e.children]})}const Xe="settings",Fe={apiURL:"http://localhost:8000",temperature:.75,postCount:3};function gn(){const e=localStorage.getItem(Xe);return e?{...Fe,...JSON.parse(e)}:Fe}function vn(e){localStorage.setItem(Xe,JSON.stringify(e))}function yn(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}const bn=/Sujet\s+:\s+"(.+?)"?<\|eot_id\|>/,wn=/<\|im_pseudo\|>([^<]+)<\|end_pseudo\|>/,$n=/<\|im_date\|>([^<]+)<\|end_date\|>/,kn=/<\|begin_of_post\|>([\s\S]+)(?:<\|end_of_post\|>)?$/;function Sn(e){const t={id:yn(),title:"",posts:[]};for(const n of e.split("<|end_of_post|>").slice(0,-1)){if(console.log("Post tokens:"),console.log(n),t.posts.length<1){const o=n.match(bn);console.log(`title: ${o[1]}`),t.title=o[1]}t.posts=t.posts.concat(Ye(n))}return t}function Ye(e){const t=[];for(const n of e.split("<|end_of_post|>")){if(n.length<1)continue;console.log("Post tokens:"),console.log(n);const o=n.match(wn);console.log(`user: ${o[1]}`);const s=n.match($n);console.log(`date: ${s[1]}`);const r=n.match(kn);console.log(`content: ${r[1]}`),t.push({user:o[1],date:Ft(s[1]),content:r[1]})}return t}function xn(e){if(e.posts.length===0)throw new Error("Topic must have at least one post");const t=e.posts.map(o=>Tn(o,e.posts[0].user)).flat().join("");return["<|start_header_id|><|sujet|><|end_header_id|>","",`Sujet : "${e.title}"`].join(`
`)+t}function Tn(e,t){return[`<|eot_id|><|start_header_id|><|${e.user===t?"autheur":"khey"}|>`,"<|end_header_id|>","",`<|im_pseudo|>${e.user}<|end_pseudo|>`,`<|im_date|>Le ${ge(e.date)}<|end_date|>`,"",`<|begin_of_post|>${e.content}<|end_of_post|>`].join(`
`)}async function Nn(e,t){console.log(e);const n=await et(e,"<|start_header_id|>",t);return Sn(n)}async function Cn(e,t,n){const o=await et(e,xn(n),t);return console.log("rawOutput"),console.log(o),Ye(o)}const Pn="<|end_of_post|>";async function et(e,t,n){const o=new AbortController,s=await fetch(new URL("/v1/completions",e.apiURL),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:t,temperature:e.temperature,max_tokens:2e3,stream:!0,skip_special_tokens:!1}),signal:o.signal});if(!s.ok)throw new Error(`Failed to fetch API (${s.status} ${s.statusText}): ${await s.text()}`);console.log(`Fetching topic with ${n} posts...`);let r=0,a="",_=null;try{await s.body.pipeThrough(new TextDecoderStream("utf-8")).pipeTo(new WritableStream({write(u){for(const l of u.split(`
`)){if(!l.startsWith("data:"))continue;const f=JSON.parse(l.slice(6)),i=f.choices[0].text;if(console.log(i),a+=f.choices[0].text,i.includes(Pn)){if(r++,r>=n){_="custom_stop",o.abort();break}}else _=f.choices[0].finish_reason}}}))}catch(u){if(u.name!=="AbortError")throw u}return console.log("Done fetching data"),console.log(`Finish reason: ${_}`),console.log(`Tokens: ${a}`),a}function In(){const[e,t]=q(H.home),[n,o]=q(0),[s,r]=q(null),[a,_]=q(pt),[u,l]=q(null),[f,i]=q(!1);W(()=>{console.log("save !"),mt(a)},[a]);const h=async y=>{i(!0);const $=await Nn(g,y);l($.id),_(N=>[...N,$]),i(!1)},d=async(y,$)=>{i(!0);const N=await Cn(g,$,a.find(R=>R.id===y)),S=[...a],I=S.findIndex(R=>R.id===y);S[I].posts=S[I].posts.concat(N),_(S),i(!1)},[g,x]=q(gn);W(()=>{vn(g)},[g]);const b=Ie(()=>{const y=new URL(window.location.href),$=y.searchParams.get("route");$&&$ in H&&t($);const N=y.searchParams.get("page");N&&o(parseInt(N));const S=y.searchParams.get("id");S&&r(S)},[]);W(()=>{b()},[]),W(()=>{function y(){b()}return window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)}},[]);const m=Ie((y,$,N)=>{const S=new URL(window.location.href);S.searchParams.set("route",y),t(y),$!==void 0?(S.searchParams.set("page",String($)),o($)):(S.searchParams.delete("page"),o(0)),N!==void 0?(S.searchParams.set("id",N),r(N)):(S.searchParams.delete("id"),r(null));const I=S.toString();I!==window.location.href&&window.history.pushState({},"",I)},[]);let p,C,T;switch(e){case H.home:p=c(zt,{topics:a,setRoute:m,settings:g,setSettings:x,generateTopic:h,pendingGeneration:f,latestGeneratedTopicId:u}),C="accueil",T="Liste des topics";break;case H.topic:if(s===null)p=c("div",{children:"Impossible d'afficher le topic"}),C="accueil",T="Topic";else if(a===null)p=c("div",{children:"Chargement..."}),C="accueil / topic",T="Chargement...";else{const y=a.find($=>$.id===s);p=c(rn,{topic:y,settings:g,setSettings:x,addPosts:d,pendingGeneration:f}),C=`accueil / ${y.title}`,T=`Topic : ${y.title}`}break;case H.settings:p=c(fn,{settings:g,setSettings:x}),C="accueil / paramètres",T="Paramètres";break}return c(z,{children:[c("header",{className:He.header,children:c(Le,{children:c("h1",{className:He.logo,children:c("a",{href:"#",onClick:y=>{y.preventDefault(),m(H.home)},children:"JVCGPT"})})})}),c("main",{children:c(Le,{children:c(mn,{breadcrumbs:C,title:T,setRoute:m,children:p})})})]})}it(j(In,null),document.getElementById("app"));