@memori.ai/memori-webcomponent 7.3.1 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/memori-webcomponent.js +2 -2
- package/package.json +2 -2
|
@@ -236,7 +236,7 @@ to {
|
|
|
236
236
|
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
237
237
|
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
238
238
|
*/function Pf(){return Pf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pf.apply(this,arguments)}function kf({bounds:e,boundsOptions:n,center:r,children:i,className:o,id:s,placeholder:a,style:l,whenReady:u,zoom:d,...h},p){const[f]=(0,c.useState)({className:o,id:s,style:l}),[m,g]=(0,c.useState)(null);(0,c.useImperativeHandle)(p,(()=>m?.map??null),[m]);const v=(0,c.useCallback)((t=>{if(null!==t&&null===m){const i=new(0,Rf.Map)(t,h);null!=r&&null!=d?i.setView(r,d):null!=e&&i.fitBounds(e,n),null!=u&&i.whenReady(u),g(Ef(i))}}),[]);(0,c.useEffect)((()=>()=>{m?.map.remove()}),[m]);const y=m?t(c).createElement(Mf,{value:m},i):a??null;return t(c).createElement("div",Pf({},f,{ref:v}),y)}!function(e){"use strict";var t="1.9.4";function n(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n])e[t]=i[t];return e}var r=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function i(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var o=0;function s(e){return"_leaflet_id"in e||(e._leaflet_id=++o),e._leaflet_id}function a(e,t,n){var r,i,o,s;return s=function(){r=!1,i&&(o.apply(n,i),i=!1)},o=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(s,t),r=!0)},o}function l(e,t,n){var r=t[1],i=t[0],o=r-i;return e===r&&n?e:((e-i)%o+o)%o+i}function c(){return!1}function u(e,t){if(!1===t)return e;var n=Math.pow(10,void 0===t?6:t);return Math.round(e*n)/n}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function h(e){return d(e).split(/\s+/)}function p(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?r(e.options):{}),t)e.options[n]=t[n];return e.options}function f(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(t&&-1!==t.indexOf("?")?"&":"?")+r.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function g(e,t){return e.replace(m,(function(e,n){var r=t[n];if(void 0===r)throw new Error("No value provided for variable "+e);return"function"==typeof r&&(r=r(t)),r}))}var v=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function y(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var b="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var S=0;function w(e){var t=+new Date,n=Math.max(0,16-(t-S));return S=t+n,window.setTimeout(e,n)}var _=window.requestAnimationFrame||x("RequestAnimationFrame")||w,C=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function A(e,t,n){if(!n||_!==w)return _.call(window,i(e,t));e.call(t)}function E(e){e&&C.call(window,e)}var T={__proto__:null,extend:n,create:r,bind:i,get lastId(){return o},stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:u,trim:d,splitWords:h,setOptions:p,getParamString:f,template:g,isArray:v,indexOf:y,emptyImageUrl:b,requestFn:_,cancelFn:C,requestAnimFrame:A,cancelAnimFrame:E};function M(){}function I(e){if("undefined"!=typeof L&&L&&L.Mixin){e=v(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}M.extend=function(e){var t=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=t.__super__=this.prototype,o=r(i);for(var s in o.constructor=t,t.prototype=o,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(t[s]=this[s]);return e.statics&&n(t,e.statics),e.includes&&(I(e.includes),n.apply(null,[o].concat(e.includes))),n(o,e),delete o.statics,delete o.includes,o.options&&(o.options=i.options?r(i.options):{},n(o.options,e.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=o._initHooks.length;e<t;e++)o._initHooks[e].call(this)}},t},M.include=function(e){var t=this.prototype.options;return n(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},M.mergeOptions=function(e){return n(this.prototype.options,e),this},M.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n="function"==typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var R={on:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t);else for(var i=0,o=(e=h(e)).length;i<o;i++)this._on(e[i],t,n);return this},off:function(e,t,n){if(arguments.length)if("object"==typeof e)for(var r in e)this._off(r,e[r],t);else{e=h(e);for(var i=1===arguments.length,o=0,s=e.length;o<s;o++)i?this._off(e[o]):this._off(e[o],t,n)}else delete this._events;return this},_on:function(e,t,n,r){if("function"==typeof t){if(!1===this._listens(e,t,n)){n===this&&(n=void 0);var i={fn:t,ctx:n};r&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}}else console.warn("wrong listener type: "+typeof t)},_off:function(e,t,n){var r,i,o;if(this._events&&(r=this._events[e]))if(1!==arguments.length)if("function"==typeof t){var s=this._listens(e,t,n);if(!1!==s){var a=r[s];this._firingCount&&(a.fn=c,this._events[e]=r=r.slice()),r.splice(s,1)}}else console.warn("wrong listener type: "+typeof t);else{if(this._firingCount)for(i=0,o=r.length;i<o;i++)r[i].fn=c;delete this._events[e]}},fire:function(e,t,r){if(!this.listens(e,r))return this;var i=n({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var o=this._events[e];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,a=o.length;s<a;s++){var l=o[s],c=l.fn;l.once&&this.off(e,c,l.ctx),c.call(l.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(e,t,n,r){"string"!=typeof e&&console.warn('"string" type argument expected');var i=t;"function"!=typeof t&&(r=!!t,i=void 0,n=void 0);var o=this._events&&this._events[e];if(o&&o.length&&!1!==this._listens(e,i,n))return!0;if(r)for(var s in this._eventParents)if(this._eventParents[s].listens(e,t,n,r))return!0;return!1},_listens:function(e,t,n){if(!this._events)return!1;var r=this._events[e]||[];if(!t)return!!r.length;n===this&&(n=void 0);for(var i=0,o=r.length;i<o;i++)if(r[i].fn===t&&r[i].ctx===n)return i;return!1},once:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t,!0);else for(var i=0,o=(e=h(e)).length;i<o;i++)this._on(e[i],t,n,!0);return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[s(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[s(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,n({layer:e.target,propagatedFrom:e.target},e),!0)}};R.addEventListener=R.on,R.removeEventListener=R.clearAllEventListeners=R.off,R.addOneTimeEventListener=R.once,R.fireEvent=R.fire,R.hasEventListeners=R.listens;var P=M.extend(R);function k(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var O=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function N(e,t,n){return e instanceof k?e:v(e)?new k(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new k(e.x,e.y):new k(e,t,n)}function D(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function B(e,t){return!e||e instanceof D?e:new D(e,t)}function z(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function F(e,t){return e instanceof z?e:new z(e,t)}function U(e,t,n){if(isNaN(e)||isNaN(t))throw new Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==n&&(this.alt=+n)}function j(e,t,n){return e instanceof U?e:v(e)&&"object"!=typeof e[0]?3===e.length?new U(e[0],e[1],e[2]):2===e.length?new U(e[0],e[1]):null:null==e?e:"object"==typeof e&&"lat"in e?new U(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new U(e,t,n)}k.prototype={clone:function(){return new k(this.x,this.y)},add:function(e){return this.clone()._add(N(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(N(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new k(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new k(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=O(this.x),this.y=O(this.y),this},distanceTo:function(e){var t=(e=N(e)).x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return(e=N(e)).x===this.x&&e.y===this.y},contains:function(e){return e=N(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},D.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof k||"number"==typeof e[0]||"x"in e)t=n=N(e);else if(t=(e=B(e)).min,n=e.max,!t||!n)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=t.clone(),this.max=n.clone()),this},getCenter:function(e){return N((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return N(this.min.x,this.max.y)},getTopRight:function(){return N(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return(e="number"==typeof e[0]||e instanceof k?N(e):B(e))instanceof D?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=B(e);var t=this.min,n=this.max,r=e.min,i=e.max,o=i.x>=t.x&&r.x<=n.x,s=i.y>=t.y&&r.y<=n.y;return o&&s},overlaps:function(e){e=B(e);var t=this.min,n=this.max,r=e.min,i=e.max,o=i.x>t.x&&r.x<n.x,s=i.y>t.y&&r.y<n.y;return o&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(e){var t=this.min,n=this.max,r=Math.abs(t.x-n.x)*e,i=Math.abs(t.y-n.y)*e;return B(N(t.x-r,t.y-i),N(n.x+r,n.y+i))},equals:function(e){return!!e&&(e=B(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},z.prototype={extend:function(e){var t,n,r=this._southWest,i=this._northEast;if(e instanceof U)t=e,n=e;else{if(!(e instanceof z))return e?this.extend(j(e)||F(e)):this;if(t=e._southWest,n=e._northEast,!t||!n)return this}return r||i?(r.lat=Math.min(t.lat,r.lat),r.lng=Math.min(t.lng,r.lng),i.lat=Math.max(n.lat,i.lat),i.lng=Math.max(n.lng,i.lng)):(this._southWest=new U(t.lat,t.lng),this._northEast=new U(n.lat,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,i=Math.abs(t.lng-n.lng)*e;return new z(new U(t.lat-r,t.lng-i),new U(n.lat+r,n.lng+i))},getCenter:function(){return new U((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof U||"lat"in e?j(e):F(e);var t,n,r=this._southWest,i=this._northEast;return e instanceof z?(t=e.getSouthWest(),n=e.getNorthEast()):t=n=e,t.lat>=r.lat&&n.lat<=i.lat&&t.lng>=r.lng&&n.lng<=i.lng},intersects:function(e){e=F(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>=t.lat&&r.lat<=n.lat,s=i.lng>=t.lng&&r.lng<=n.lng;return o&&s},overlaps:function(e){e=F(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>t.lat&&r.lat<n.lat,s=i.lng>t.lng&&r.lng<n.lng;return o&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=F(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}},U.prototype={equals:function(e,t){return!!e&&(e=j(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+u(this.lat,e)+", "+u(this.lng,e)+")"},distanceTo:function(e){return G.distance(this,j(e))},wrap:function(){return G.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return F([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new U(this.lat,this.lng,this.alt)}};var H,V={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new D(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?l(e.lng,this.wrapLng,!0):e.lng;return new U(this.wrapLat?l(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),r=t.lat-n.lat,i=t.lng-n.lng;if(0===r&&0===i)return e;var o=e.getSouthWest(),s=e.getNorthEast();return new z(new U(o.lat-r,o.lng-i),new U(s.lat-r,s.lng-i))}},G=n({},V,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,r=e.lat*n,i=t.lat*n,o=Math.sin((t.lat-e.lat)*n/2),s=Math.sin((t.lng-e.lng)*n/2),a=o*o+Math.cos(r)*Math.cos(i)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),W=6378137,q={R:W,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),i=Math.sin(r*t);return new k(this.R*e.lng*t,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(e){var t=180/Math.PI;return new U((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(H=W*Math.PI,new D([-H,-H],[H,H]))};function K(e,t,n,r){if(v(e))return this._a=e[0],this._b=e[1],this._c=e[2],void(this._d=e[3]);this._a=e,this._b=t,this._c=n,this._d=r}function J(e,t,n,r){return new K(e,t,n,r)}K.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new k((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var Q=n({},G,{code:"EPSG:3857",projection:q,transformation:function(){var e=.5/(Math.PI*q.R);return J(e,.5,-e,.5)}()}),Y=n({},Q,{code:"EPSG:900913"});function Z(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function X(e,t){var n,r,i,o,s,a,l="";for(n=0,i=e.length;n<i;n++){for(r=0,o=(s=e[n]).length;r<o;r++)l+=(r?"L":"M")+(a=s[r]).x+" "+a.y;l+=t?ze.svg?"z":"x":""}return l||"M0 0"}var $,ee=document.documentElement.style,te="ActiveXObject"in window,ne=te&&!document.addEventListener,re="msLaunchUri"in navigator&&!("documentMode"in document),ie=Be("webkit"),oe=Be("android"),se=Be("android 2")||Be("android 3"),ae=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),le=oe&&Be("Google")&&ae<537&&!("AudioNode"in window),ce=!!window.opera,ue=!re&&Be("chrome"),de=Be("gecko")&&!ie&&!ce&&!te,he=!ue&&Be("safari"),pe=Be("phantom"),fe="OTransition"in ee,me=0===navigator.platform.indexOf("Win"),ge=te&&"transition"in ee,ve="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!se,ye="MozPerspective"in ee,be=!window.L_DISABLE_3D&&(ge||ve||ye)&&!fe&&!pe,xe="undefined"!=typeof orientation||Be("mobile"),Se=xe&&ie,we=xe&&ve,_e=!window.PointerEvent&&window.MSPointerEvent,Ce=!(!window.PointerEvent&&!_e),Ae="ontouchstart"in window||!!window.TouchEvent,Ee=!window.L_NO_TOUCH&&(Ae||Ce),Te=xe&&ce,Me=xe&&de,Ie=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Re=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",c,t),window.removeEventListener("testPassiveEventSupport",c,t)}catch(e){}return e}(),Pe=!!document.createElement("canvas").getContext,ke=!(!document.createElementNS||!Z("svg").createSVGRect),Oe=!!ke&&(($=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===($.firstChild&&$.firstChild.namespaceURI)),Ne=!ke&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}(),Le=0===navigator.platform.indexOf("Mac"),De=0===navigator.platform.indexOf("Linux");function Be(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ze={ie:te,ielt9:ne,edge:re,webkit:ie,android:oe,android23:se,androidStock:le,opera:ce,chrome:ue,gecko:de,safari:he,phantom:pe,opera12:fe,win:me,ie3d:ge,webkit3d:ve,gecko3d:ye,any3d:be,mobile:xe,mobileWebkit:Se,mobileWebkit3d:we,msPointer:_e,pointer:Ce,touch:Ee,touchNative:Ae,mobileOpera:Te,mobileGecko:Me,retina:Ie,passiveEvents:Re,canvas:Pe,svg:ke,vml:Ne,inlineSvg:Oe,mac:Le,linux:De},Fe=ze.msPointer?"MSPointerDown":"pointerdown",Ue=ze.msPointer?"MSPointerMove":"pointermove",je=ze.msPointer?"MSPointerUp":"pointerup",He=ze.msPointer?"MSPointerCancel":"pointercancel",Ve={touchstart:Fe,touchmove:Ue,touchend:je,touchcancel:He},Ge={touchstart:et,touchmove:$e,touchend:$e,touchcancel:$e},We={},qe=!1;function Ke(e,t,n){return"touchstart"===t&&Xe(),Ge[t]?(n=Ge[t].bind(this,n),e.addEventListener(Ve[t],n,!1),n):(console.warn("wrong event specified:",t),c)}function Je(e,t,n){Ve[t]?e.removeEventListener(Ve[t],n,!1):console.warn("wrong event specified:",t)}function Qe(e){We[e.pointerId]=e}function Ye(e){We[e.pointerId]&&(We[e.pointerId]=e)}function Ze(e){delete We[e.pointerId]}function Xe(){qe||(document.addEventListener(Fe,Qe,!0),document.addEventListener(Ue,Ye,!0),document.addEventListener(je,Ze,!0),document.addEventListener(He,Ze,!0),qe=!0)}function $e(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in t.touches=[],We)t.touches.push(We[n]);t.changedTouches=[t],e(t)}}function et(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Qt(t),$e(e,t)}function tt(e){var t,n,r={};for(n in e)t=e[n],r[n]=t&&t.bind?t.bind(e):t;return e=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}var nt=200;function rt(e,t){e.addEventListener("dblclick",t);var n,r=0;function i(e){if(1===e.detail){if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var i=Zt(e);if(!i.some((function(e){return e instanceof HTMLLabelElement&&e.attributes.for}))||i.some((function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var o=Date.now();o-r<=nt?2==++n&&t(tt(e)):n=1,r=o}}}else n=e.detail}return e.addEventListener("click",i),{dblclick:t,simDblclick:i}}function it(e,t){e.removeEventListener("dblclick",t.dblclick),e.removeEventListener("click",t.simDblclick)}var ot,st,at,lt,ct,ut=Tt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),dt=Tt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ht="webkitTransition"===dt||"OTransition"===dt?dt+"End":"transitionend";function pt(e){return"string"==typeof e?document.getElementById(e):e}function ft(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function mt(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function gt(e){var t=e.parentNode;t&&t.removeChild(e)}function vt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function yt(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function bt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function xt(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=Ct(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function St(e,t){if(void 0!==e.classList)for(var n=h(t),r=0,i=n.length;r<i;r++)e.classList.add(n[r]);else if(!xt(e,t)){var o=Ct(e);_t(e,(o?o+" ":"")+t)}}function wt(e,t){void 0!==e.classList?e.classList.remove(t):_t(e,d((" "+Ct(e)+" ").replace(" "+t+" "," ")))}function _t(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function Ct(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function At(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&Et(e,t)}function Et(e,t){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(e){if(1===t)return}t=Math.round(100*t),n?(n.Enabled=100!==t,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}function Tt(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function Mt(e,t,n){var r=t||new k(0,0);e.style[ut]=(ze.ie3d?"translate("+r.x+"px,"+r.y+"px)":"translate3d("+r.x+"px,"+r.y+"px,0)")+(n?" scale("+n+")":"")}function It(e,t){e._leaflet_pos=t,ze.any3d?Mt(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function Rt(e){return e._leaflet_pos||new k(0,0)}if("onselectstart"in document)ot=function(){Ft(window,"selectstart",Qt)},st=function(){jt(window,"selectstart",Qt)};else{var Pt=Tt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ot=function(){if(Pt){var e=document.documentElement.style;at=e[Pt],e[Pt]="none"}},st=function(){Pt&&(document.documentElement.style[Pt]=at,at=void 0)}}function kt(){Ft(window,"dragstart",Qt)}function Ot(){jt(window,"dragstart",Qt)}function Nt(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(Lt(),lt=e,ct=e.style.outlineStyle,e.style.outlineStyle="none",Ft(window,"keydown",Lt))}function Lt(){lt&&(lt.style.outlineStyle=ct,lt=void 0,ct=void 0,jt(window,"keydown",Lt))}function Dt(e){do{e=e.parentNode}while(!(e.offsetWidth&&e.offsetHeight||e===document.body));return e}function Bt(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var zt={__proto__:null,TRANSFORM:ut,TRANSITION:dt,TRANSITION_END:ht,get:pt,getStyle:ft,create:mt,remove:gt,empty:vt,toFront:yt,toBack:bt,hasClass:xt,addClass:St,removeClass:wt,setClass:_t,getClass:Ct,setOpacity:At,testProp:Tt,setTransform:Mt,setPosition:It,getPosition:Rt,get disableTextSelection(){return ot},get enableTextSelection(){return st},disableImageDrag:kt,enableImageDrag:Ot,preventOutline:Nt,restoreOutline:Lt,getSizedParentNode:Dt,getScale:Bt};function Ft(e,t,n,r){if(t&&"object"==typeof t)for(var i in t)Gt(e,i,t[i],n);else for(var o=0,s=(t=h(t)).length;o<s;o++)Gt(e,t[o],n,r);return this}var Ut="_leaflet_events";function jt(e,t,n,r){if(1===arguments.length)Ht(e),delete e[Ut];else if(t&&"object"==typeof t)for(var i in t)Wt(e,i,t[i],n);else if(t=h(t),2===arguments.length)Ht(e,(function(e){return-1!==y(t,e)}));else for(var o=0,s=t.length;o<s;o++)Wt(e,t[o],n,r);return this}function Ht(e,t){for(var n in e[Ut]){var r=n.split(/\d/)[0];t&&!t(r)||Wt(e,r,null,null,n)}}var Vt={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Gt(e,t,n,r){var i=t+s(n)+(r?"_"+s(r):"");if(e[Ut]&&e[Ut][i])return this;var o=function(t){return n.call(r||e,t||window.event)},a=o;!ze.touchNative&&ze.pointer&&0===t.indexOf("touch")?o=Ke(e,t,o):ze.touch&&"dblclick"===t?o=rt(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Vt[t]||t,o,!!ze.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(o=function(t){t=t||window.event,tn(e,t)&&a(t)},e.addEventListener(Vt[t],o,!1)):e.addEventListener(t,a,!1):e.attachEvent("on"+t,o),e[Ut]=e[Ut]||{},e[Ut][i]=o}function Wt(e,t,n,r,i){i=i||t+s(n)+(r?"_"+s(r):"");var o=e[Ut]&&e[Ut][i];if(!o)return this;!ze.touchNative&&ze.pointer&&0===t.indexOf("touch")?Je(e,t,o):ze.touch&&"dblclick"===t?it(e,o):"removeEventListener"in e?e.removeEventListener(Vt[t]||t,o,!1):e.detachEvent("on"+t,o),e[Ut][i]=null}function qt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function Kt(e){return Gt(e,"wheel",qt),this}function Jt(e){return Ft(e,"mousedown touchstart dblclick contextmenu",qt),e._leaflet_disable_click=!0,this}function Qt(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Yt(e){return Qt(e),qt(e),this}function Zt(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function Xt(e,t){if(!t)return new k(e.clientX,e.clientY);var n=Bt(t),r=n.boundingClientRect;return new k((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var $t=ze.linux&&ze.chrome?window.devicePixelRatio:ze.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function en(e){return ze.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/$t:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}function tn(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e}var nn={__proto__:null,on:Ft,off:jt,stopPropagation:qt,disableScrollPropagation:Kt,disableClickPropagation:Jt,preventDefault:Qt,stop:Yt,getPropagationPath:Zt,getMousePosition:Xt,getWheelDelta:en,isExternalTarget:tn,addListener:Ft,removeListener:jt},rn=P.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Rt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=A(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=1e3*this._duration;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),It(this._el,n),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),on=P.extend({options:{crs:Q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=p(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=i(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(j(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=dt&&ze.any3d&&!ze.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ft(this._proxy,ht,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,r){return t=void 0===t?this._zoom:this._limitZoom(t),e=this._limitCenter(j(e),t,this.options.maxBounds),r=r||{},this._stop(),this._loaded&&!r.reset&&!0!==r&&(void 0!==r.animate&&(r.zoom=n({animate:r.animate},r.zoom),r.pan=n({animate:r.animate,duration:r.duration},r.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,r.zoom):this._tryAnimatedPan(e,r.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,r.pan&&r.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(ze.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(ze.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),i=this.getSize().divideBy(2),o=(e instanceof k?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/r),s=this.containerPointToLatLng(i.add(o));return this.setView(s,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():F(e);var n=N(t.paddingTopLeft||t.padding||[0,0]),r=N(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,n.add(r));if((i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i)===1/0)return{center:e.getCenter(),zoom:i};var o=r.subtract(n).divideBy(2),s=this.project(e.getSouthWest(),i),a=this.project(e.getNorthEast(),i);return{center:this.unproject(s.add(a).divideBy(2).add(o),i),zoom:i}},fitBounds:function(e,t){if(!(e=F(e)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(t=t||{},!(e=N(e).round()).x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new rn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){St(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,n){if(!1===(n=n||{}).animate||!ze.any3d)return this.setView(e,t,n);this._stop();var r=this.project(this.getCenter()),i=this.project(e),o=this.getSize(),s=this._zoom;e=j(e),t=void 0===t?s:t;var a=Math.max(o.x,o.y),l=a*this.getZoomScale(s,t),c=i.distanceTo(r)||1,u=1.42,d=u*u;function h(e){var t=(l*l-a*a+(e?-1:1)*d*d*c*c)/(2*(e?l:a)*d*c),n=Math.sqrt(t*t+1)-t;return n<1e-9?-18:Math.log(n)}function p(e){return(Math.exp(e)-Math.exp(-e))/2}function f(e){return(Math.exp(e)+Math.exp(-e))/2}function m(e){return p(e)/f(e)}var g=h(0);function v(e){return a*(f(g)/f(g+u*e))}function y(e){return a*(f(g)*m(g+u*e)-p(g))/d}function b(e){return 1-Math.pow(1-e,1.5)}var x=Date.now(),S=(h(1)-g)/u,w=n.duration?1e3*n.duration:1e3*S*.8;function _(){var n=(Date.now()-x)/w,o=b(n)*S;n<=1?(this._flyToFrame=A(_,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(y(o)/c)),s),this.getScaleZoom(a/v(o),s),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),_.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=F(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,F(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=N((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=N(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),o=this.project(e),s=this.getPixelBounds(),a=B([s.min.add(n),s.max.subtract(r)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var c=o.subtract(a.getCenter()),u=a.extend(o).getSize().subtract(l);i.x+=c.x<0?-u.x:u.x,i.y+=c.y<0?-u.y:u.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},!0===e?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),o=t.divideBy(2).round(),s=r.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(e.animate&&e.pan?this.panBy(a):(e.pan&&this._rawPanBy(a),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new U(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(i,r.maxZoom):i)}var o={latlng:t,bounds:n,timestamp:e.timestamp};for(var s in e.coords)"number"==typeof e.coords[s]&&(o[s]=e.coords[s]);this.fire("locationfound",o)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),gt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)gt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=mt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new z(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=F(e),n=N(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),o=this.getMaxZoom(),s=e.getNorthWest(),a=e.getSouthEast(),l=this.getSize().subtract(n),c=B(this.project(a,r),this.project(s,r)).getSize(),u=ze.any3d?this.options.zoomSnap:1,d=l.x/c.x,h=l.y/c.y,p=t?Math.max(d,h):Math.min(d,h);return r=this.getScaleZoom(p,r),u&&(r=Math.round(r/(u/100))*(u/100),r=t?Math.ceil(r/u)*u:Math.floor(r/u)*u),Math.max(i,Math.min(o,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new D(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(j(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(N(e),t)},layerPointToLatLng:function(e){var t=N(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(j(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(j(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(F(e))},distance:function(e,t){return this.options.crs.distance(j(e),j(t))},containerPointToLayerPoint:function(e){return N(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return N(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(N(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(e)))},mouseEventToContainerPoint:function(e){return Xt(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=pt(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");Ft(t,"scroll",this._onScroll,this),this._containerId=s(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ze.any3d,St(e,"leaflet-container"+(ze.touch?" leaflet-touch":"")+(ze.retina?" leaflet-retina":"")+(ze.ielt9?" leaflet-oldie":"")+(ze.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=ft(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),It(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(St(e.markerPane,"leaflet-zoom-hide"),St(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,n){It(this._mapPane,new k(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n,r){void 0===t&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire("zoom",n):((i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){It(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[s(this._container)]=this;var t=e?jt:Ft;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),ze.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=A((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],i="mouseout"===t||"mouseover"===t,o=e.target||e.srcElement,a=!1;o;){if((n=this._targets[s(o)])&&("click"===t||"preclick"===t)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(t,!0)){if(i&&!tn(o,e))break;if(r.push(n),i)break}if(o===this._container)break;o=o.parentNode}return r.length||a||i||!this.listens(t,!0)||(r=[this]),r},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var n=e.type;"mousedown"===n&&Nt(t),this._fireDOMEvent(e,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,r){if("click"===e.type){var i=n({},e);i.type="preclick",this._fireDOMEvent(i,i.type,r)}var o=this._findEventTargets(e,t);if(r){for(var s=[],a=0;a<r.length;a++)r[a].listens(t,!0)&&s.push(r[a]);o=s.concat(o)}if(o.length){"contextmenu"===t&&Qt(e);var l=o[0],c={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);c.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=u?l.getLatLng():this.layerPointToLatLng(c.layerPoint)}for(a=0;a<o.length;a++)if(o[a].fire(t,c,!0),c.originalEvent._stopped||!1===o[a].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,t))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return Rt(this._mapPane)||new k(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return B([this.project(e.getSouthWest(),t)._subtract(r),this.project(e.getNorthWest(),t)._subtract(r),this.project(e.getSouthEast(),t)._subtract(r),this.project(e.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),i=this.getSize().divideBy(2),o=new D(r.subtract(i),r.add(i)),s=this._getBoundsOffset(o,n,t);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?e:this.unproject(r.add(s),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new D(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=B(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),i=r.min.subtract(e.min),o=r.max.subtract(e.max);return new k(this._rebound(i.x,-o.x),this._rebound(i.y,-o.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=ze.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){wt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(n)||(this.panBy(n,t),0))},_createAnimProxy:function(){var e=this._proxy=mt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=ut,n=this._proxy.style[t];Mt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){gt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Mt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(i)||(A((function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)}),this),0))},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,St(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&wt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function sn(e,t){return new on(e,t)}var an=M.extend({options:{position:"topright"},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return St(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(gt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),ln=function(e){return new an(e)};on.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=mt("div",t+"control-container",this._container);function r(r,i){var o=t+r+" "+t+i;e[r+i]=mt("div",o,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)gt(this._controlCorners[e]);gt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var cn=an.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n<r?-1:r<n?1:0}},initialize:function(e,t,n){for(var r in p(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return an.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(s(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){St(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(St(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):wt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return wt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=mt("div",e),n=this.options.collapsed;t.setAttribute("aria-haspopup",!0),Jt(t),Kt(t);var r=this._section=mt("section",e+"-list");n&&(this._map.on("click",this.collapse,this),Ft(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=mt("a",e+"-toggle",t);i.href="#",i.title="Layers",i.setAttribute("role","button"),Ft(i,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){Qt(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=mt("div",e+"-base",r),this._separator=mt("div",e+"-separator",r),this._overlaysList=mt("div",e+"-overlays",r),t.appendChild(r)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&s(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(i((function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)}),this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;vt(this._baseLayersList),vt(this._overlaysList),this._layerControlInputs=[];var e,t,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),t=t||r.overlay,e=e||!r.overlay,i+=r.overlay?0:1;return this.options.hideSingleBase&&(e=e&&i>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(s(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+s(this),r),this._layerControlInputs.push(t),t.layerId=s(e.layer),Ft(t,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+e.name;var o=document.createElement("span");return n.appendChild(o),o.appendChild(t),o.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e,t,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)e=n[o],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||i.push(t);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])&&this._map.removeLayer(i[o]);for(o=0;o<r.length;o++)this._map.hasLayer(r[o])||this._map.addLayer(r[o]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,n=this._layerControlInputs,r=this._map.getZoom(),i=n.length-1;i>=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&r<t.options.minZoom||void 0!==t.options.maxZoom&&r>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ft(e,"click",Qt),this.expand();var t=this;setTimeout((function(){jt(e,"click",Qt),t._preventClick=!1}))}}),un=function(e,t,n){return new cn(e,t,n)},dn=an.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=mt("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var o=mt("a",n,r);return o.innerHTML=e,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),Jt(o),Ft(o,"click",Yt),Ft(o,"click",i,this),Ft(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";wt(this._zoomInButton,t),wt(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(St(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(St(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});on.mergeOptions({zoomControl:!0}),on.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new dn,this.addControl(this.zoomControl))}));var hn=function(e){return new dn(e)},pn=an.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",n=mt("div",t),r=this.options;return this._addScales(r,t+"-line",n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=mt("div",t,n)),e.imperial&&(this._iScale=mt("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t,n,r,i=3.2808399*e;i>5280?(t=i/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),fn=function(e){return new pn(e)},mn='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',gn=an.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ze.inlineSvg?mn+" ":"")+"Leaflet</a>"},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=mt("div","leaflet-control-attribution"),Jt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",(function(){this.removeAttribution(e.layer.getAttribution())}),this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});on.mergeOptions({attributionControl:!0}),on.addInitHook((function(){this.options.attributionControl&&(new gn).addTo(this)}));var vn=function(e){return new gn(e)};an.Layers=cn,an.Zoom=dn,an.Scale=pn,an.Attribution=gn,ln.layers=un,ln.zoom=hn,ln.scale=fn,ln.attribution=vn;var yn=M.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});yn.addTo=function(e,t){return e.addHandler(t,this),this};var bn={Events:R},xn=ze.touch?"touchstart mousedown":"mousedown",Sn=P.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(Ft(this._dragStartTarget,xn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Sn._dragging===this&&this.finishDrag(!0),jt(this._dragStartTarget,xn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!xt(this._element,"leaflet-zoom-anim")))if(e.touches&&1!==e.touches.length)Sn._dragging===this&&this.finishDrag();else if(!(Sn._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||(Sn._dragging=this,this._preventOutline&&Nt(this._element),kt(),ot(),this._moving))){this.fire("down");var t=e.touches?e.touches[0]:e,n=Dt(this._element);this._startPoint=new k(t.clientX,t.clientY),this._startPos=Rt(this._element),this._parentScale=Bt(n);var r="mousedown"===e.type;Ft(document,r?"mousemove":"touchmove",this._onMove,this),Ft(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(e){if(this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new k(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,Qt(e),this._moved||(this.fire("dragstart"),this._moved=!0,St(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),St(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),It(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){wt(document.body,"leaflet-dragging"),this._lastTarget&&(wt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),jt(document,"mousemove touchmove",this._onMove,this),jt(document,"mouseup touchend touchcancel",this._onUp,this),Ot(),st();var t=this._moved&&this._moving;this._moving=!1,Sn._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function wn(e,t,n){var r,i,o,s,a,l,c,u,d,h=[1,4,2,8];for(i=0,c=e.length;i<c;i++)e[i]._code=Ln(e[i],t);for(s=0;s<4;s++){for(u=h[s],r=[],i=0,o=(c=e.length)-1;i<c;o=i++)a=e[i],l=e[o],a._code&u?l._code&u||((d=Nn(l,a,u,t,n))._code=Ln(d,t),r.push(d)):(l._code&u&&((d=Nn(l,a,u,t,n))._code=Ln(d,t),r.push(d)),r.push(a));e=r}return e}function _n(e,t){var n,r,i,o,s,a,l,c,u;if(!e||0===e.length)throw new Error("latlngs not passed");zn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var d=j([0,0]),h=F(e);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(d=Cn(e));var p=e.length,f=[];for(n=0;n<p;n++){var m=j(e[n]);f.push(t.project(j([m.lat-d.lat,m.lng-d.lng])))}for(a=l=c=0,n=0,r=p-1;n<p;r=n++)i=f[n],o=f[r],s=i.y*o.x-o.y*i.x,l+=(i.x+o.x)*s,c+=(i.y+o.y)*s,a+=3*s;u=0===a?f[0]:[l/a,c/a];var g=t.unproject(N(u));return j([g.lat+d.lat,g.lng+d.lng])}function Cn(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var o=j(e[i]);t+=o.lat,n+=o.lng,r++}return j([t/r,n/r])}var An,En={__proto__:null,clipPolygon:wn,polygonCenter:_n,centroid:Cn};function Tn(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=Rn(e=kn(e,n),n)}function Mn(e,t,n){return Math.sqrt(Bn(e,t,n,!0))}function In(e,t,n){return Bn(e,t,n)}function Rn(e,t){var n=e.length,r=new("undefined"!=typeof Uint8Array?Uint8Array:Array)(n);r[0]=r[n-1]=1,Pn(e,r,t,0,n-1);var i,o=[];for(i=0;i<n;i++)r[i]&&o.push(e[i]);return o}function Pn(e,t,n,r,i){var o,s,a,l=0;for(s=r+1;s<=i-1;s++)(a=Bn(e[s],e[r],e[i],!0))>l&&(o=s,l=a);l>n&&(t[o]=1,Pn(e,t,n,r,o),Pn(e,t,n,o,i))}function kn(e,t){for(var n=[e[0]],r=1,i=0,o=e.length;r<o;r++)Dn(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<o-1&&n.push(e[o-1]),n}function On(e,t,n,r,i){var o,s,a,l=r?An:Ln(e,n),c=Ln(t,n);for(An=c;;){if(!(l|c))return[e,t];if(l&c)return!1;a=Ln(s=Nn(e,t,o=l||c,n,i),n),o===l?(e=s,l=a):(t=s,c=a)}}function Nn(e,t,n,r,i){var o,s,a=t.x-e.x,l=t.y-e.y,c=r.min,u=r.max;return 8&n?(o=e.x+a*(u.y-e.y)/l,s=u.y):4&n?(o=e.x+a*(c.y-e.y)/l,s=c.y):2&n?(o=u.x,s=e.y+l*(u.x-e.x)/a):1&n&&(o=c.x,s=e.y+l*(c.x-e.x)/a),new k(o,s,i)}function Ln(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function Dn(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function Bn(e,t,n,r){var i,o=t.x,s=t.y,a=n.x-o,l=n.y-s,c=a*a+l*l;return c>0&&((i=((e.x-o)*a+(e.y-s)*l)/c)>1?(o=n.x,s=n.y):i>0&&(o+=a*i,s+=l*i)),a=e.x-o,l=e.y-s,r?a*a+l*l:new k(o,s)}function zn(e){return!v(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function Fn(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),zn(e)}function Un(e,t){var n,r,i,o,s,a,l,c;if(!e||0===e.length)throw new Error("latlngs not passed");zn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var u=j([0,0]),d=F(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=Cn(e));var h=e.length,p=[];for(n=0;n<h;n++){var f=j(e[n]);p.push(t.project(j([f.lat-u.lat,f.lng-u.lng])))}for(n=0,r=0;n<h-1;n++)r+=p[n].distanceTo(p[n+1])/2;if(0===r)c=p[0];else for(n=0,o=0;n<h-1;n++)if(s=p[n],a=p[n+1],(o+=i=s.distanceTo(a))>r){l=(o-r)/i,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var m=t.unproject(N(c));return j([m.lat+u.lat,m.lng+u.lng])}var jn={__proto__:null,simplify:Tn,pointToSegmentDistance:Mn,closestPointOnSegment:In,clipSegment:On,_getEdgeIntersection:Nn,_getBitCode:Ln,_sqClosestPointOnSegment:Bn,isFlat:zn,_flat:Fn,polylineCenter:Un},Hn={project:function(e){return new k(e.lng,e.lat)},unproject:function(e){return new U(e.y,e.x)},bounds:new D([-180,-90],[180,90])},Vn={R:6378137,R_MINOR:6356752.314245179,bounds:new D([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,o=Math.sqrt(1-i*i),s=o*Math.sin(r),a=Math.tan(Math.PI/4-r/2)/Math.pow((1-s)/(1+s),o/2);return r=-n*Math.log(Math.max(a,1e-10)),new k(e.lng*t*n,r)},unproject:function(e){for(var t,n=180/Math.PI,r=this.R,i=this.R_MINOR/r,o=Math.sqrt(1-i*i),s=Math.exp(-e.y/r),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)t=o*Math.sin(a),t=Math.pow((1-t)/(1+t),o/2),a+=c=Math.PI/2-2*Math.atan(s*t)-a;return new U(a*n,e.x*n/r)}},Gn={__proto__:null,LonLat:Hn,Mercator:Vn,SphericalMercator:q},Wn=n({},G,{code:"EPSG:3395",projection:Vn,transformation:function(){var e=.5/(Math.PI*Vn.R);return J(e,.5,-e,.5)}()}),qn=n({},G,{code:"EPSG:4326",projection:Hn,transformation:J(1/180,1,-1/180,.5)}),Kn=n({},V,{projection:Hn,transformation:J(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});V.Earth=G,V.EPSG3395=Wn,V.EPSG3857=Q,V.EPSG900913=Y,V.EPSG4326=qn,V.Simple=Kn;var Jn=P.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[s(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[s(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",(function(){t.off(n,this)}),this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});on.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=s(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=s(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return s(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){for(var t=0,n=(e=e?v(e)?e:[e]:[]).length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[s(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=s(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;e=void 0===i.minZoom?e:Math.min(e,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Qn=Jn.extend({initialize:function(e,t){var n,r;if(p(this,t),this._layers={},e)for(n=0,r=e.length;n<r;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"==typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,n,r=Array.prototype.slice.call(arguments,1);for(t in this._layers)(n=this._layers[t])[e]&&n[e].apply(n,r);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return s(e)}}),Yn=function(e,t){return new Qn(e,t)},Zn=Qn.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Qn.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Qn.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new z;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),Xn=function(e,t){return new Zn(e,t)},$n=M.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){p(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if("icon"===e)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r=this._createImg(n,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(r,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(r.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),r},_setIconStyles:function(e,t){var n=this.options,r=n[t+"Size"];"number"==typeof r&&(r=[r,r]);var i=N(r),o=N("shadow"===t&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(n.className||""),o&&(e.style.marginLeft=-o.x+"px",e.style.marginTop=-o.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return ze.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}});function er(e){return new $n(e)}var tr=$n.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!=typeof tr.imagePath&&(tr.imagePath=this._detectIconPath()),(this.options.imagePath||tr.imagePath)+$n.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var r=t.exec(e);return r&&r[n]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=mt("div","leaflet-default-icon-path",document.body),t=ft(e,"background-image")||ft(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),nr=yn.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new Sn(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),St(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&wt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,o=Rt(t._icon),s=n.getPixelBounds(),a=n.getPixelOrigin(),l=B(s.min._subtract(a).add(i),s.max._subtract(a).subtract(i));if(!l.contains(o)){var c=N((Math.max(l.max.x,o.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,o.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,o.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,o.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(r);n.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),It(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=A(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=A(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,r=Rt(t._icon),i=t._map.layerPointToLatLng(r);n&&It(n,r),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),rr=Jn.extend({options:{icon:new tr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){p(this,t),this._latlng=j(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=j(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=e.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),St(n,t),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ft(n,"focus",this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(St(i,t),i.alt=""),this._shadow=i,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&jt(this._icon,"focus",this._panOnFocus,this),gt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&>(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&It(this._icon,e),this._shadow&&It(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(St(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),nr)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new nr(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&At(this._icon,e),this._shadow&&At(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?N(t.iconSize):N(0,0),r=t.iconAnchor?N(t.iconAnchor):N(0,0);e.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:n.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function ir(e,t){return new rr(e,t)}var or=Jn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return p(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),sr=or.extend({options:{fill:!0,radius:10},initialize:function(e,t){p(this,t),this._latlng=j(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=j(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return or.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),r=[e+n,t+n];this._pxBounds=new D(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ar(e,t){return new sr(e,t)}var lr=sr.extend({initialize:function(e,t,r){if("number"==typeof t&&(t=n({},r,{radius:t})),p(this,t),this._latlng=j(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new z(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:or.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===G.distance){var i=Math.PI/180,o=this._mRadius/G.R/i,s=n.project([t+o,e]),a=n.project([t-o,e]),l=s.add(a).divideBy(2),c=n.unproject(l).lat,u=Math.acos((Math.cos(o*i)-Math.sin(t*i)*Math.sin(c*i))/(Math.cos(t*i)*Math.cos(c*i)))/i;(isNaN(u)||0===u)&&(u=o/Math.cos(Math.PI/180*t)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-n.project([c,e-u]).x,this._radiusY=l.y-s.y}else{var d=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}});function cr(e,t,n){return new lr(e,t,n)}var ur=or.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){p(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,n,r=1/0,i=null,o=Bn,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,u=l.length;c<u;c++){var d=o(e,t=l[c-1],n=l[c],!0);d<r&&(r=d,i=o(e,t,n))}return i&&(i.distance=Math.sqrt(r)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Un(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=j(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new z,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return zn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=zn(e),r=0,i=e.length;r<i;r++)n?(t[r]=j(e[r]),this._bounds.extend(t[r])):t[r]=this._convertLatLngs(e[r]);return t},_project:function(){var e=new D;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new k(e,e);this._rawPxBounds&&(this._pxBounds=new D([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var r,i,o=e[0]instanceof U,s=e.length;if(o){for(i=[],r=0;r<s;r++)i[r]=this._map.latLngToLayerPoint(e[r]),n.extend(i[r]);t.push(i)}else for(r=0;r<s;r++)this._projectLatlngs(e[r],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else{var t,n,r,i,o,s,a,l=this._parts;for(t=0,r=0,i=this._rings.length;t<i;t++)for(n=0,o=(a=this._rings[t]).length;n<o-1;n++)(s=On(a[n],a[n+1],e,n,!0))&&(l[r]=l[r]||[],l[r].push(s[0]),s[1]===a[n+1]&&n!==o-2||(l[r].push(s[1]),r++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,r=e.length;n<r;n++)e[n]=Tn(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,r,i,o,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,o=this._parts.length;n<o;n++)for(r=0,i=(s=(a=this._parts[n]).length)-1;r<s;i=r++)if((t||0!==r)&&Mn(e,a[i],a[r])<=l)return!0;return!1}});function dr(e,t){return new ur(e,t)}ur._flat=Fn;var hr=ur.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return _n(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=ur.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof U&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){ur.prototype._setLatLngs.call(this,e),zn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return zn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new k(t,t);if(e=new D(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var r,i=0,o=this._rings.length;i<o;i++)(r=wn(this._rings[i],e,!0)).length&&this._parts.push(r)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,n,r,i,o,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(i=0,a=this._parts.length;i<a;i++)for(o=0,s=(l=(t=this._parts[i]).length)-1;o<l;s=o++)n=t[o],r=t[s],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(c=!c);return c||ur.prototype._containsPoint.call(this,e,!0)}});function pr(e,t){return new hr(e,t)}var fr=Zn.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,i=v(e)?e:e.features;if(i){for(t=0,n=i.length;t<n;t++)((r=i[t]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var o=this.options;if(o.filter&&!o.filter(e))return this;var s=mr(e,o);return s?(s.feature=wr(e),s.defaultOptions=s.options,this.resetStyle(s),o.onEachFeature&&o.onEachFeature(e,s),this.addLayer(s)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=n({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer((function(t){this._setLayerStyle(t,e)}),this)},_setLayerStyle:function(e,t){e.setStyle&&("function"==typeof t&&(t=t(e.feature)),e.setStyle(t))}});function mr(e,t){var n,r,i,o,s="Feature"===e.type?e.geometry:e,a=s?s.coordinates:null,l=[],c=t&&t.pointToLayer,u=t&&t.coordsToLatLng||vr;if(!a&&!s)return null;switch(s.type){case"Point":return gr(c,e,n=u(a),t);case"MultiPoint":for(i=0,o=a.length;i<o;i++)n=u(a[i]),l.push(gr(c,e,n,t));return new Zn(l);case"LineString":case"MultiLineString":return r=yr(a,"LineString"===s.type?0:1,u),new ur(r,t);case"Polygon":case"MultiPolygon":return r=yr(a,"Polygon"===s.type?1:2,u),new hr(r,t);case"GeometryCollection":for(i=0,o=s.geometries.length;i<o;i++){var d=mr({geometry:s.geometries[i],type:"Feature",properties:e.properties},t);d&&l.push(d)}return new Zn(l);case"FeatureCollection":for(i=0,o=s.features.length;i<o;i++){var h=mr(s.features[i],t);h&&l.push(h)}return new Zn(l);default:throw new Error("Invalid GeoJSON object.")}}function gr(e,t,n,r){return e?e(t,n):new rr(n,r&&r.markersInheritOptions&&r)}function vr(e){return new U(e[1],e[0],e[2])}function yr(e,t,n){for(var r,i=[],o=0,s=e.length;o<s;o++)r=t?yr(e[o],t-1,n):(n||vr)(e[o]),i.push(r);return i}function br(e,t){return void 0!==(e=j(e)).alt?[u(e.lng,t),u(e.lat,t),u(e.alt,t)]:[u(e.lng,t),u(e.lat,t)]}function xr(e,t,n,r){for(var i=[],o=0,s=e.length;o<s;o++)i.push(t?xr(e[o],zn(e[o])?0:t-1,n,r):br(e[o],r));return!t&&n&&i.length>0&&i.push(i[0].slice()),i}function Sr(e,t){return e.feature?n({},e.feature,{geometry:t}):wr(t)}function wr(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var _r={toGeoJSON:function(e){return Sr(this,{type:"Point",coordinates:br(this.getLatLng(),e)})}};function Cr(e,t){return new fr(e,t)}rr.include(_r),lr.include(_r),sr.include(_r),ur.include({toGeoJSON:function(e){var t=!zn(this._latlngs);return Sr(this,{type:(t?"Multi":"")+"LineString",coordinates:xr(this._latlngs,t?1:0,!1,e)})}}),hr.include({toGeoJSON:function(e){var t=!zn(this._latlngs),n=t&&!zn(this._latlngs[0]),r=xr(this._latlngs,n?2:t?1:0,!0,e);return t||(r=[r]),Sr(this,{type:(n?"Multi":"")+"Polygon",coordinates:r})}}),Qn.include({toMultiPoint:function(e){var t=[];return this.eachLayer((function(n){t.push(n.toGeoJSON(e).geometry.coordinates)})),Sr(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var n="GeometryCollection"===t,r=[];return this.eachLayer((function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var o=wr(i);"FeatureCollection"===o.type?r.push.apply(r,o.features):r.push(o)}}})),n?Sr(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});var Ar=Cr,Er=Jn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,n){this._url=e,this._bounds=F(t),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(St(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){gt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&yt(this._image),this},bringToBack:function(){return this._map&&bt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=F(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:mt("img");St(t,"leaflet-image-layer"),this._zoomAnimated&&St(t,"leaflet-zoom-animated"),this.options.className&&St(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onload=i(this.fire,this,"load"),t.onerror=i(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e?this._url=t.src:(t.src=this._url,t.alt=this.options.alt)},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Mt(this._image,n,t)},_reset:function(){var e=this._image,t=new D(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();It(e,t.min),e.style.width=n.x+"px",e.style.height=n.y+"px"},_updateOpacity:function(){At(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Tr=function(e,t,n){return new Er(e,t,n)},Mr=Er.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:mt("video");if(St(t,"leaflet-image-layer"),this._zoomAnimated&&St(t,"leaflet-zoom-animated"),this.options.className&&St(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onloadeddata=i(this.fire,this,"load"),e){for(var n=t.getElementsByTagName("source"),r=[],o=0;o<n.length;o++)r.push(n[o].src);this._url=n.length>0?r:[t.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=mt("source");a.src=this._url[s],t.appendChild(a)}}}});function Ir(e,t,n){return new Mr(e,t,n)}var Rr=Er.extend({_initImage:function(){var e=this._image=this._url;St(e,"leaflet-image-layer"),this._zoomAnimated&&St(e,"leaflet-zoom-animated"),this.options.className&&St(e,this.options.className),e.onselectstart=c,e.onmousemove=c}});function Pr(e,t,n){return new Rr(e,t,n)}var kr=Jn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof U||v(e))?(this._latlng=j(e),p(this,t)):(p(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return(e=arguments.length?e:this._source._map).hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&At(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&At(this._container,1),this.bringToFront(),this.options.interactive&&(St(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(At(this._container,0),this._removeTimeout=setTimeout(i(gt,void 0,this._container),200)):gt(this._container),this.options.interactive&&(wt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=j(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&yt(this._container),this},bringToBack:function(){return this._map&&bt(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Zn){t=null;var n=this._source._layers;for(var r in n)if(n[r]._map){t=n[r];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else{if(!t.getBounds)throw new Error("Unable to get source layer LatLng.");e=t.getBounds().getCenter()}return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=N(this.options.offset),n=this._getAnchor();this._zoomAnimated?It(this._container,e.add(n)):t=t.add(e).add(n);var r=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=r+"px",this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}});on.include({_initOverlay:function(e,t,n,r){var i=t;return i instanceof e||(i=new e(r).setContent(t)),n&&i.setLatLng(n),i}}),Jn.include({_initOverlay:function(e,t,n,r){var i=n;return i instanceof e?(p(i,r),i._source=this):(i=t&&!r?t:new e(r,this)).setContent(n),i}});var Or=kr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return!(e=arguments.length?e:this._source._map).hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,kr.prototype.openOn.call(this,e)},onAdd:function(e){kr.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof or||this._source.on("preclick",qt))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof or||this._source.off("preclick",qt))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=mt("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=mt("div",e+"-content-wrapper",t);if(this._contentNode=mt("div",e+"-content",n),Jt(t),Kt(this._contentNode),Ft(t,"contextmenu",qt),this._tipContainer=mt("div",e+"-tip-container",t),this._tip=mt("div",e+"-tip",this._tipContainer),this.options.closeButton){var r=this._closeButton=mt("a",e+"-close-button",t);r.setAttribute("role","button"),r.setAttribute("aria-label","Close popup"),r.href="#close",r.innerHTML='<span aria-hidden="true">×</span>',Ft(r,"click",(function(e){Qt(e),this.close()}),this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+"px",t.whiteSpace="",t.height="";var r=e.offsetHeight,i=this.options.maxHeight,o="leaflet-popup-scrolled";i&&r>i?(t.height=i+"px",St(e,o)):wt(e,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();It(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var e=this._map,t=parseInt(ft(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new k(this._containerLeft,-n-this._containerBottom);i._add(Rt(this._container));var o=e.layerPointToContainerPoint(i),s=N(this.options.autoPanPadding),a=N(this.options.autoPanPaddingTopLeft||s),l=N(this.options.autoPanPaddingBottomRight||s),c=e.getSize(),u=0,d=0;o.x+r+l.x>c.x&&(u=o.x+r-c.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+n+l.y>c.y&&(d=o.y+n-c.y+l.y),o.y-d-a.y<0&&(d=o.y-a.y),(u||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([u,d]))}},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Nr=function(e,t){return new Or(e,t)};on.mergeOptions({closePopupOnClick:!0}),on.include({openPopup:function(e,t,n){return this._initOverlay(Or,e,t,n).openOn(this),this},closePopup:function(e){return(e=arguments.length?e:this._popup)&&e.close(),this}}),Jn.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Or,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Zn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){Yt(e);var t=e.layer||e.target;this._popup._source!==t||t instanceof or?(this._popup._source=t,this.openPopup(e.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Lr=kr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){kr.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=mt("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,o=r.latLngToContainerPoint(r.getCenter()),s=r.layerPointToContainerPoint(e),a=this.options.direction,l=i.offsetWidth,c=i.offsetHeight,u=N(this.options.offset),d=this._getAnchor();"top"===a?(t=l/2,n=c):"bottom"===a?(t=l/2,n=0):"center"===a?(t=l/2,n=c/2):"right"===a?(t=0,n=c/2):"left"===a?(t=l,n=c/2):s.x<o.x?(a="right",t=0,n=c/2):(a="left",t=l+2*(u.x+d.x),n=c/2),e=e.subtract(N(t,n,!0)).add(u).add(d),wt(i,"leaflet-tooltip-right"),wt(i,"leaflet-tooltip-left"),wt(i,"leaflet-tooltip-top"),wt(i,"leaflet-tooltip-bottom"),St(i,"leaflet-tooltip-"+a),It(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&At(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return N(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Dr=function(e,t){return new Lr(e,t)};on.include({openTooltip:function(e,t,n){return this._initOverlay(Lr,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),Jn.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Lr,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t=e?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Zn||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&(Ft(t,"focus",(function(){this._tooltip._source=e,this.openTooltip()}),this),Ft(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",(function(){t._openOnceFlag=!1,t._openTooltip(e)}))}else this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)},_moveTooltip:function(e){var t,n,r=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),n=this._map.containerPointToLayerPoint(t),r=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(r)}});var Br=$n.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),n=this.options;if(n.html instanceof Element?(vt(t),t.appendChild(n.html)):t.innerHTML=!1!==n.html?n.html:"",n.bgPos){var r=N(n.bgPos);t.style.backgroundPosition=-r.x+"px "+-r.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});function zr(e){return new Br(e)}$n.Default=tr;var Fr=Jn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ze.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){p(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),gt(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(yt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(bt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof k?e:new k(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,n=this.getPane().children,r=-e(-1/0,1/0),i=0,o=n.length;i<o;i++)t=n[i].style.zIndex,n[i]!==this._container&&t&&(r=e(r,+t));isFinite(r)&&(this.options.zIndex=r+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ze.ielt9){At(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(i.current&&i.loaded){var o=Math.min(1,(e-i.loaded)/200);At(i.el,o),o<1?t=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(E(this._fadeFrame),this._fadeFrame=A(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=mt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(gt(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[e],i=this._map;return r||((r=this._levels[e]={}).el=mt("div","leaflet-tile-container leaflet-zoom-animated",this._container),r.el.style.zIndex=t,r.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),r.zoom=e,this._setZoomTransform(r,i.getCenter(),i.getZoom()),c(r.el.offsetWidth),this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var r=t.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)gt(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,r){var i=Math.floor(e/2),o=Math.floor(t/2),s=n-1,a=new k(+i,+o);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>r&&this._retainParent(i,o,s,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var o=2*t;o<2*t+2;o++){var s=new k(i,o);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<r&&this._retainChildren(i,o,n+1,r))}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,r){var i=Math.round(t);i=void 0!==this.options.maxZoom&&i>this.options.maxZoom||void 0!==this.options.minZoom&&i<this.options.minZoom?void 0:this._clampZoom(i);var o=this.options.updateWhenZooming&&i!==this._tileZoom;r&&!o||(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==i&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var r=this._map.getZoomScale(n,e.zoom),i=e.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,n)).round();ze.any3d?Mt(e.el,i,r):It(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],r).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],r).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],r).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),r=t.getZoomScale(n,this._tileZoom),i=t.project(e,this._tileZoom).floor(),o=t.getSize().divideBy(2*r);return new D(i.subtract(o),i.add(o))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var r=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(r),o=i.getCenter(),s=[],a=this.options.keepBuffer,l=new D(i.getBottomLeft().subtract([a,-a]),i.getTopRight().add([a,-a]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var u=this._tiles[c].coords;u.z===this._tileZoom&&l.contains(new k(u.x,u.y))||(this._tiles[c].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(e,n);else{for(var d=i.min.y;d<=i.max.y;d++)for(var h=i.min.x;h<=i.max.x;h++){var p=new k(h,d);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:s.push(p)}}if(s.sort((function(e,t){return e.distanceTo(o)-t.distanceTo(o)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(h=0;h<s.length;h++)this._addTile(s[h],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return F(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new z(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new k(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(gt(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){St(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=c,e.onmousemove=c,ze.ielt9&&this.options.opacity<1&&At(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),o=this.createTile(this._wrapCoords(e),i(this._tileReady,this,e));this._initTile(o),this.createTile.length<2&&A(i(this._tileReady,this,e,null,o)),It(o,n),this._tiles[r]={el:o,coords:e,current:!0},t.appendChild(o),this.fire("tileloadstart",{tile:o,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(At(n.el,0),E(this._fadeFrame),this._fadeFrame=A(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(St(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ze.ielt9||!this._map._fadeAnimated?A(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new k(this._wrapX?l(e.x,this._wrapX):e.x,this._wrapY?l(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new D(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Ur(e){return new Fr(e)}var jr=Fr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=p(this,t)).detectRetina&&ze.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return Ft(n,"load",i(this._tileOnLoad,this,t,n)),Ft(n,"error",i(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:ze.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=r),t["-y"]=r}return g(this._url,n(t,this.options))},_tileOnLoad:function(e,t){ze.ielt9?setTimeout(i(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=c,t.onerror=c,!t.complete)){t.src=b;var n=this._tiles[e].coords;gt(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",b),Fr.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==b))return Fr.prototype._tileReady.call(this,e,t,n)}});function Hr(e,t){return new jr(e,t)}var Vr=jr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var r=n({},this.defaultWmsParams);for(var i in t)i in this.options||(r[i]=t[i]);var o=(t=p(this,t)).detectRetina&&ze.retina?2:1,s=this.getTileSize();r.width=s.x*o,r.height=s.y*o,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,jr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=B(n.project(t[0]),n.project(t[1])),i=r.min,o=r.max,s=(this._wmsVersion>=1.3&&this._crs===qn?[i.y,i.x,o.y,o.x]:[i.x,i.y,o.x,o.y]).join(","),a=jr.prototype.getTileUrl.call(this,e);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(e,t){return n(this.wmsParams,e),t||this.redraw(),this}});function Gr(e,t){return new Vr(e,t)}jr.WMS=Vr,Hr.wms=Gr;var Wr=Jn.extend({options:{padding:.1},initialize:function(e){p(this,e),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),St(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),o=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));ze.any3d?Mt(this._container,o,n):It(this._container,o)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new D(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qr=Wr.extend({options:{tolerance:0},getEvents:function(){var e=Wr.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ft(e,"mousemove",this._onMouseMove,this),Ft(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ft(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,gt(this._container),jt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wr.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=ze.retina?2:1;It(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",ze.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){Wr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[s(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[s(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),i=[];for(n=0;n<r.length;n++){if(t=Number(r[n]),isNaN(t))return;i.push(t)}e.options._dashArray=i}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||A(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new D,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)e=r.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,r,i,o,s=e._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),n=0;n<a;n++){for(r=0,i=s[n].length;r<i;r++)o=s[n][r],l[r?"lineTo":"moveTo"](o.x,o.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(this._drawing&&!e._empty()){var t=e._point,n=this._ctx,r=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||r)/r;1!==i&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(t.x,t.y/i,r,0,2*Math.PI,!1),1!==i&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t,n,r=this._map.mouseEventToLayerPoint(e),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(r)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(n=t);this._fireEvent(!!n&&[n],e)},_onMouseMove:function(e){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(wt(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,r,o=this._drawFirst;o;o=o.next)(n=o.layer).options.interactive&&n._containsPoint(t)&&(r=n);r!==this._hoveredLayer&&(this._handleMouseOut(e),r&&(St(this._container,"leaflet-interactive"),this._fireEvent([r],e,"mouseover"),this._hoveredLayer=r)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(i((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;n&&(n.prev=r,r?r.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e))}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;r&&(r.next=n,n?n.prev=r:r&&(this._drawLast=r),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e))}}});function Kr(e){return ze.canvas?new qr(e):null}var Jr=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Qr={_initContainer:function(){this._container=mt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wr.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=Jr("shape");St(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=Jr("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;gt(t),e.removeInteractiveTarget(t),delete this._layers[s(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||(t=e._stroke=Jr("stroke")),i.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=v(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=Jr("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){yt(e._container)},_bringToBack:function(e){bt(e._container)}},Yr=ze.vml?Jr:Z,Zr=Wr.extend({_initContainer:function(){this._container=Yr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){gt(this._container),jt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wr.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),It(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=Yr("path");e.options.className&&St(t,e.options.className),e.options.interactive&&St(t,"leaflet-interactive"),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){gt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[s(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,X(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r="a"+n+","+(Math.max(Math.round(e._radiusY),1)||n)+" 0 1,0 ",i=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(e,i)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){yt(e._path)},_bringToBack:function(e){bt(e._path)}});function Xr(e){return ze.svg||ze.vml?new Zr(e):null}ze.vml&&Zr.include(Qr),on.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Kr(e)||Xr(e)}});var $r=hr.extend({initialize:function(e,t){hr.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=F(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function ei(e,t){return new $r(e,t)}Zr.create=Yr,Zr.pointsToPath=X,fr.geometryToLayer=mr,fr.coordsToLatLng=vr,fr.coordsToLatLngs=yr,fr.latLngToCoords=br,fr.latLngsToCoords=xr,fr.getFeature=Sr,fr.asFeature=wr,on.mergeOptions({boxZoom:!0});var ti=yn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ft(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){jt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){gt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),ot(),kt(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ft(document,{contextmenu:Yt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=mt("div","leaflet-zoom-box",this._container),St(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new D(this._point,this._startPoint),n=t.getSize();It(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(gt(this._box),wt(this._container,"leaflet-crosshair")),st(),Ot(),jt(document,{contextmenu:Yt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var t=new z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});on.addInitHook("addHandler","boxZoom",ti),on.mergeOptions({doubleClickZoom:!0});var ni=yn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});on.addInitHook("addHandler","doubleClickZoom",ni),on.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ri=yn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Sn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}St(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){wt(this._map._container,"leaflet-grab"),wt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=F(this._map.options.maxBounds);this._offsetLimit=B(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,o=(r+t+n)%e-t-n,s=Math.abs(i+n)<Math.abs(o+n)?i:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(e){var t=this._map,n=t.options,r=!n.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),r)t.fire("moveend");else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,s=n.easeLinearity,a=i.multiplyBy(s/o),l=a.distanceTo([0,0]),c=Math.min(n.inertiaMaxSpeed,l),u=a.multiplyBy(c/l),d=c/(n.inertiaDeceleration*s),h=u.multiplyBy(-d/2).round();h.x||h.y?(h=t._limitOffset(h,t.options.maxBounds),A((function(){t.panBy(h,{duration:d,easeLinearity:s,noMoveStart:!0,animate:!0})}))):t.fire("moveend")}}});on.addInitHook("addHandler","dragging",ri),on.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ii=yn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),Ft(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),jt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,r=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,n,r=this._panKeys={},i=this.keyCodes;for(t=0,n=i.left.length;t<n;t++)r[i.left[t]]=[-1*e,0];for(t=0,n=i.right.length;t<n;t++)r[i.right[t]]=[e,0];for(t=0,n=i.down.length;t<n;t++)r[i.down[t]]=[0,e];for(t=0,n=i.up.length;t<n;t++)r[i.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,n,r=this._zoomKeys={},i=this.keyCodes;for(t=0,n=i.zoomIn.length;t<n;t++)r[i.zoomIn[t]]=e;for(t=0,n=i.zoomOut.length;t<n;t++)r[i.zoomOut[t]]=-e},_addHooks:function(){Ft(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){jt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t,n=e.keyCode,r=this._map;if(n in this._panKeys){if(!r._panAnim||!r._panAnim._inProgress)if(t=this._panKeys[n],e.shiftKey&&(t=N(t).multiplyBy(3)),r.options.maxBounds&&(t=r._limitOffset(N(t),r.options.maxBounds)),r.options.worldCopyJump){var i=r.wrapLatLng(r.unproject(r.project(r.getCenter()).add(t)));r.panTo(i)}else r.panBy(t)}else if(n in this._zoomKeys)r.setZoom(r.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!r._popup||!r._popup.options.closeOnEscapeKey)return;r.closePopup()}Yt(e)}}});on.addInitHook("addHandler","keyboard",ii),on.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var oi=yn.extend({addHooks:function(){Ft(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){jt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=en(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var r=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i(this._performZoom,this),r),Yt(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var r=this._delta/(4*this._map.options.wheelPxPerZoomLevel),i=4*Math.log(2/(1+Math.exp(-Math.abs(r))))/Math.LN2,o=n?Math.ceil(i/n)*n:i,s=e._limitZoom(t+(this._delta>0?o:-o))-t;this._delta=0,this._startTime=null,s&&("center"===e.options.scrollWheelZoom?e.setZoom(t+s):e.setZoomAround(this._lastMousePos,t+s))}});on.addInitHook("addHandler","scrollWheelZoom",oi);var si=600;on.mergeOptions({tapHold:ze.touchNative&&ze.safari&&ze.mobile,tapTolerance:15});var ai=yn.extend({addHooks:function(){Ft(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){jt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new k(t.clientX,t.clientY),this._holdTimeout=setTimeout(i((function(){this._cancel(),this._isTapValid()&&(Ft(document,"touchend",Qt),Ft(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),this),si),Ft(document,"touchend touchcancel contextmenu",this._cancel,this),Ft(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){jt(document,"touchend",Qt),jt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),jt(document,"touchend touchcancel contextmenu",this._cancel,this),jt(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new k(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});on.addInitHook("addHandler","tapHold",ai),on.mergeOptions({touchZoom:ze.touch,bounceAtZoomLimits:!0});var li=yn.extend({addHooks:function(){St(this._map._container,"leaflet-touch-zoom"),Ft(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){wt(this._map._container,"leaflet-touch-zoom"),jt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),Ft(document,"touchmove",this._onTouchMove,this),Ft(document,"touchend touchcancel",this._onTouchEnd,this),Qt(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),o=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(o,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&o<1||this._zoom>t.getMaxZoom()&&o>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var a=i(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=A(a,this,!0),Qt(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),jt(document,"touchmove",this._onTouchMove,this),jt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});on.addInitHook("addHandler","touchZoom",li),on.BoxZoom=ti,on.DoubleClickZoom=ni,on.Drag=ri,on.Keyboard=ii,on.ScrollWheelZoom=oi,on.TapHold=ai,on.TouchZoom=li,e.Bounds=D,e.Browser=ze,e.CRS=V,e.Canvas=qr,e.Circle=lr,e.CircleMarker=sr,e.Class=M,e.Control=an,e.DivIcon=Br,e.DivOverlay=kr,e.DomEvent=nn,e.DomUtil=zt,e.Draggable=Sn,e.Evented=P,e.FeatureGroup=Zn,e.GeoJSON=fr,e.GridLayer=Fr,e.Handler=yn,e.Icon=$n,e.ImageOverlay=Er,e.LatLng=U,e.LatLngBounds=z,e.Layer=Jn,e.LayerGroup=Qn,e.LineUtil=jn,e.Map=on,e.Marker=rr,e.Mixin=bn,e.Path=or,e.Point=k,e.PolyUtil=En,e.Polygon=hr,e.Polyline=ur,e.Popup=Or,e.PosAnimation=rn,e.Projection=Gn,e.Rectangle=$r,e.Renderer=Wr,e.SVG=Zr,e.SVGOverlay=Rr,e.TileLayer=jr,e.Tooltip=Lr,e.Transformation=K,e.Util=T,e.VideoOverlay=Mr,e.bind=i,e.bounds=B,e.canvas=Kr,e.circle=cr,e.circleMarker=ar,e.control=ln,e.divIcon=zr,e.extend=n,e.featureGroup=Xn,e.geoJSON=Cr,e.geoJson=Ar,e.gridLayer=Ur,e.icon=er,e.imageOverlay=Tr,e.latLng=j,e.latLngBounds=F,e.layerGroup=Yn,e.map=sn,e.marker=ir,e.point=N,e.polygon=pr,e.polyline=dr,e.popup=Nr,e.rectangle=ei,e.setOptions=p,e.stamp=s,e.svg=Xr,e.svgOverlay=Pr,e.tileLayer=Hr,e.tooltip=Dr,e.transformation=J,e.version=t,e.videoOverlay=Ir;var ci=window.L;e.noConflict=function(){return window.L=ci,this},window.L=e}(Rf);const Of=(0,(c=o("85Hg2")).forwardRef)(kf);c=o("85Hg2");function Nf(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function Lf(e,t){return null==t?function(t,n){const r=(0,c.useRef)();return r.current||(r.current=e(t,n)),r}:function(n,r){const i=(0,c.useRef)();i.current||(i.current=e(n,r));const o=(0,c.useRef)(n),{instance:s}=i.current;return(0,c.useEffect)((function(){o.current!==n&&(t(s,n,o.current),o.current=n)}),[s,n,r]),i}}c=o("85Hg2");function Df(e){function n(n,r){const{instance:i,context:o}=e(n).current;return(0,c.useImperativeHandle)(r,(()=>i)),null==n.children?null:t(c).createElement(Mf,{value:o},n.children)}return(0,c.forwardRef)(n)}function Bf(e){function t(t,n){const[r,i]=(0,c.useState)(!1),{instance:o}=e(t,i).current;(0,c.useImperativeHandle)(n,(()=>o)),(0,c.useEffect)((function(){r&&o.update()}),[o,r,t.children]);const s=o._contentNode;return s?(0,a.createPortal)(t.children,s):null}return(0,c.forwardRef)(t)}function zf(e){function t(t,n){const{instance:r}=e(t).current;return(0,c.useImperativeHandle)(n,(()=>r)),null}return(0,c.forwardRef)(t)}c=o("85Hg2");c=o("85Hg2"),c=o("85Hg2");function Ff(e,t){const n=(0,c.useRef)(t);(0,c.useEffect)((function(){t!==n.current&&null!=e.attributionControl&&(null!=n.current&&e.attributionControl.removeAttribution(n.current),null!=t&&e.attributionControl.addAttribution(t)),n.current=t}),[e,t])}c=o("85Hg2");function Uf(e,t){const n=(0,c.useRef)();(0,c.useEffect)((function(){return null!=t&&e.instance.on(t),n.current=t,function(){null!=n.current&&e.instance.off(n.current),n.current=null}}),[e,t])}function jf(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function Hf(e,t){(0,c.useEffect)((function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}}),[t,e])}function Vf(e){return function(t){const n=If(),r=e(jf(t,n),n);return Ff(n.map,t.attribution),Uf(r.current,t.eventHandlers),Hf(r.current,n),r}}function Gf(e,t){return function(n,r){const i=If(),o=e(jf(n,i),i);return Ff(i.map,n.attribution),Uf(o.current,n.eventHandlers),t(o.current,i,n,r),o}}c=o("85Hg2");const Wf=(qf=function({position:e,...t},n){const r=new(0,Rf.Marker)(e,t);return Nf(r,(i=n,o={overlayContainer:r},Object.freeze({...i,...o})));var i,o},Df(Vf(Lf(qf,(function(e,t,n){t.position!==n.position&&e.setLatLng(t.position),null!=t.icon&&t.icon!==n.icon&&e.setIcon(t.icon),null!=t.zIndexOffset&&t.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(t.zIndexOffset),null!=t.opacity&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),null!=e.dragging&&t.draggable!==n.draggable&&(!0===t.draggable?e.dragging.enable():e.dragging.disable())})))));var qf;c=o("85Hg2");const Kf=function(e,t){return Bf(Gf(Lf(e),t))}((function(e,t){return Nf(new(0,Rf.Popup)(e,t.overlayContainer),t)}),(function(e,t,{position:n},r){(0,c.useEffect)((function(){const{instance:i}=e;function o(e){e.popup===i&&(i.update(),r(!0))}function s(e){e.popup===i&&r(!1)}return t.map.on({popupopen:o,popupclose:s}),null==t.overlayContainer?(null!=n&&i.setLatLng(n),i.openOn(t.map)):t.overlayContainer.bindPopup(i),function(){t.map.off({popupopen:o,popupclose:s}),t.overlayContainer?.unbindPopup(),t.map.removeLayer(i)}}),[e,t,r,n])}));function Jf(e,t,n){const{opacity:r,zIndex:i}=t;null!=r&&r!==n.opacity&&e.setOpacity(r),null!=i&&i!==n.zIndex&&e.setZIndex(i)}const Qf=function(e,t){return zf(Vf(Lf(e,t)))}((function({url:e,...t},n){return Nf(new(0,Rf.TileLayer)(e,jf(t,n)),n)}),(function(e,t,n){Jf(e,t,n);const{url:r}=t;null!=r&&r!==n.url&&e.setUrl(r)}));c=o("85Hg2");function Yf(){return If().map}c=o("85Hg2");const Zf=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e},Xf=()=>{var e;let t=(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||(null===navigator||void 0===navigator?void 0:navigator.platform)||"unknown",n=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)||n.includes("Mac")&&"ontouchend"in document},$f=/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$_:;|,~+=\{\}\[\]%^&*-]).{8,}$/,em=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/,tm=/^(?!.*\.\.)(?!.*\.$)[^\W][\w.+-]{2,32}$/;function nm(e,t){const n=(0,c.useRef)(),r=(0,c.useRef)(null);return(0,c.useEffect)((()=>(r.current=e,()=>{r.current=null})),[e]),(0,c.useEffect)((()=>()=>{clearTimeout(n.current)}),[]),(0,c.useMemo)((()=>(...e)=>{clearTimeout(n.current),n.current=window.setTimeout((()=>{r.current&&r.current(...e)}),t)}),[t])}const rm=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,im=e=>e.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim(),om=e=>e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(/```[\s\S]*?```/g,"")).replaceAll(/`[^`]*`/g,"")).replaceAll(/!\[[^\]]*\]\([^)]*\)/g,"")).replaceAll(/\[([^\]]*)\]\([^)]*\)/g,"$1")).replaceAll(/^> /gm,"")).replaceAll(/^#+ /gm,"")).replaceAll(/[*_]/g,"")).replaceAll(/---/g,"")).replaceAll(/~~/g,"")).replaceAll(/^\s*[-*+] /gm,"")).replaceAll(/^\s*\d+\.\s+/gm,"")).replaceAll(/^\|.*\|$/gm,"")).replaceAll(/\$\$[\s\S]*?\$\$/g,"")).replaceAll(/\$[\s\S]*?\$/g,"")).replaceAll(/\\\([\s\S]*?\\\)/g,"")).replaceAll(/\\\[[\s\S]*?\\\]/g,"")).replaceAll(/\s+/g," ").trim(),sm=e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML};function am(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const lm={startup:{elements:[".memori-chat--bubble-content"]},options:{processHtmlClass:"memori-chat--bubble-content"},tex:{inlineMath:[["$","$"],["\\$","\\$"],["(","\\)"],["\\(",")"],["[","\\]"],["\\(","\\)"],["\\[","\\]"],["\\\\[","\\\\]"],["\\\\\\[","\\\\\\]"],["((","))"]],displayMath:[["$$","$$"],["\\[[","\\]]"],["\\\\[[","\\\\]]"],["\\\\\\[[","\\\\\\]]"]],processEscapes:!1},asciimath:{fixphi:!0,displaystyle:!0,decimalsign:"."},skipStartupTypeset:!0,chtml:{displayAlign:"left"},svg:{fontCache:"global"}},cm=()=>{window.MathJax=lm,(()=>{const e=document.createElement("script");e.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js",e.async=!0,e.id="mathjax-script",document.head.appendChild(e)})()};c=o("85Hg2"),c=o("85Hg2");function um(e,t){let[n,r]=(0,c.useState)(e),i=Ah(e);return _h((()=>r(i.current)),[i,r,...t]),n}c=o("85Hg2");function dm(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function hm(e,t){let[n,r]=(0,c.useState)((()=>dm(e)));return _h((()=>{r(dm(e))}),[e.type,e.as]),_h((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}c=o("85Hg2");function pm({container:e,accept:t,walk:n,enabled:r=!0}){let i=(0,c.useRef)(t),o=(0,c.useRef)(n);(0,c.useEffect)((()=>{i.current=t,o.current=n}),[t,n]),_h((()=>{if(!e||!r)return;let t=hp(e);if(!t)return;let n=i.current,s=o.current,a=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);for(;l.nextNode();)s(l.currentNode)}),[e,r,i,o])}var fm=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(fm||{});function mm(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function gm(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))ym(n,vm(t,r),i);return n}function vm(e,t){return e?e+"["+t+"]":t}function ym(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())ym(e,vm(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):gm(n,t,e)}function bm(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function xm(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,s=(0,c.useRef)(o),a=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||s.current||a.current?!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Mh((e=>(o||i(e),null==t?void 0:t(e))))]}var Sm=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Sm||{}),wm=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(wm||{}),_m=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(_m||{}),Cm=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e))(Cm||{});function Am(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Cp(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let Em={1:e=>e.dataRef.current.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1},0(e){if(e.dataRef.current.disabled||0===e.comboboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex((e=>n(e.dataRef.current.value)));return-1!==r&&(t=r),{...e,comboboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.dataRef.current.optionsRef.current&&!e.dataRef.current.optionsPropsRef.current.static&&1===e.comboboxState)return e;let r=Am(e);if(null===r.activeOptionIndex){let e=r.options.findIndex((e=>!e.dataRef.current.disabled));-1!==e&&(r.activeOptionIndex=e)}let i=mm(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Am(e,(e=>[...e,n]));null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n));let i={...e,...r,activationTrigger:1};return e.dataRef.current.__demoMode&&void 0===e.dataRef.current.value&&(i.activeOptionIndex=0),i},4:(e,t)=>{let n=Am(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}},5:(e,t)=>({...e,labelId:t.id})},Tm=(0,c.createContext)(null);function Mm(e){let t=(0,c.useContext)(Tm);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Mm),t}return t}Tm.displayName="ComboboxActionsContext";let Im=(0,c.createContext)(null);function Rm(e){let t=(0,c.useContext)(Im);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Rm),t}return t}function Pm(e,t){return lh(t.type,Em,e,t)}Im.displayName="ComboboxDataContext";let km=c.Fragment;let Om=mh((function(e,n){let{value:r,defaultValue:i,onChange:o,name:s,by:a=((e,t)=>e===t),disabled:l=!1,__demoMode:u=!1,nullable:d=!1,multiple:h=!1,...p}=e,[f,m]=xm(r,o,i),[g,v]=(0,c.useReducer)(Pm,{dataRef:(0,c.createRef)(),comboboxState:u?0:1,options:[],activeOptionIndex:null,activationTrigger:1,labelId:null}),y=(0,c.useRef)(!1),b=(0,c.useRef)({static:!1,hold:!1}),x=(0,c.useRef)(null),S=(0,c.useRef)(null),w=(0,c.useRef)(null),_=(0,c.useRef)(null),C=Mh("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),A=(0,c.useCallback)((e=>lh(E.mode,{1:()=>f.some((t=>C(t,e))),0:()=>C(f,e)})),[f]),E=(0,c.useMemo)((()=>({...g,optionsPropsRef:b,labelRef:x,inputRef:S,buttonRef:w,optionsRef:_,value:f,disabled:l,mode:h?1:0,get activeOptionIndex(){if(y.current&&null===g.activeOptionIndex&&g.options.length>0){let e=g.options.findIndex((e=>!e.dataRef.current.disabled));if(-1!==e)return e}return g.activeOptionIndex},compare:C,isSelected:A,nullable:d,__demoMode:u})),[f,l,h,d,u,g]);_h((()=>{g.dataRef.current=E}),[E]),rf([E.buttonRef,E.inputRef,E.optionsRef],(()=>v({type:1})),0===E.comboboxState);let T=(0,c.useMemo)((()=>({open:0===E.comboboxState,disabled:l,activeIndex:E.activeOptionIndex,activeOption:null===E.activeOptionIndex?null:E.options[E.activeOptionIndex].dataRef.current.value,value:f})),[E,l,f]),M=Mh((e=>{let t=E.options.find((t=>t.id===e));!t||L(t.dataRef.current.value)})),I=Mh((()=>{if(null!==E.activeOptionIndex){let{dataRef:e,id:t}=E.options[E.activeOptionIndex];L(e.current.value),v({type:2,focus:fm.Specific,id:t})}})),R=Mh((()=>{v({type:0}),y.current=!0})),P=Mh((()=>{v({type:1}),y.current=!1})),k=Mh(((e,t,n)=>(y.current=!1,e===fm.Specific?v({type:2,focus:fm.Specific,id:t,trigger:n}):v({type:2,focus:e,trigger:n})))),O=Mh(((e,t)=>(v({type:3,id:e,dataRef:t}),()=>v({type:4,id:e})))),N=Mh((e=>(v({type:5,id:e}),()=>v({type:5,id:null})))),L=Mh((e=>lh(E.mode,{0:()=>null==m?void 0:m(e),1(){let t=E.value.slice(),n=t.findIndex((t=>C(t,e)));return-1===n?t.push(e):t.splice(n,1),null==m?void 0:m(t)}}))),D=(0,c.useMemo)((()=>({onChange:L,registerOption:O,registerLabel:N,goToOption:k,closeCombobox:P,openCombobox:R,selectActiveOption:I,selectOption:M})),[]),B=null===n?{}:{ref:n};return t(c).createElement(Tm.Provider,{value:D},t(c).createElement(Im.Provider,{value:E},t(c).createElement(Sh,{value:lh(E.comboboxState,{0:bh.Open,1:bh.Closed})},null!=s&&null!=f&&gm({[s]:f}).map((([e,n])=>t(c).createElement(dp,{features:up.Hidden,...gh({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),hh({ourProps:B,theirProps:p,slot:T,defaultTag:km,name:"Combobox"}))))})),Nm=mh((function(e,t){var n,r;let{value:i,onChange:o,displayValue:s,type:a="text",...l}=e,u=Rm("Combobox.Input"),d=Mm("Combobox.Input"),h=Ph(u.inputRef,t),p=`headlessui-combobox-input-${cp()}`,f=Uh(),m=!1;kp((([e,t],[n,r])=>{!u.inputRef.current||(0===r&&1===t?function(e){var t;let n=u.inputRef.current;if(!n||n.value===e)return;let r=Object.getOwnPropertyDescriptor(n.constructor.prototype,"value");null==(t=null==r?void 0:r.set)||t.call(n,e),m=!0,n.dispatchEvent(new Event("input",{bubbles:!0})),n.value=e,m=!1}(e):e!==n&&(u.inputRef.current.value=e))}),[(0,c.useMemo)((()=>{var e;return"function"==typeof s?null!=(e=s(u.value))?e:"":"string"==typeof u.value?u.value:""}),[u.value]),u.comboboxState]);let g=(0,c.useRef)(!1),v=Mh((()=>{g.current=!0})),y=Mh((()=>{setTimeout((()=>{g.current=!1}))})),b=Mh((e=>{switch(e.key){case ip.Backspace:case ip.Delete:if(0!==u.mode||!u.nullable)return;let t=e.currentTarget;f.requestAnimationFrame((()=>{""===t.value&&(d.onChange(null),u.optionsRef.current&&(u.optionsRef.current.scrollTop=0),d.goToOption(fm.Nothing))}));break;case ip.Enter:if(0!==u.comboboxState||g.current)return;if(e.preventDefault(),e.stopPropagation(),null===u.activeOptionIndex)return void d.closeCombobox();d.selectActiveOption(),0===u.mode&&d.closeCombobox();break;case ip.ArrowDown:return e.preventDefault(),e.stopPropagation(),lh(u.comboboxState,{0:()=>{d.goToOption(fm.Next)},1:()=>{d.openCombobox()}});case ip.ArrowUp:return e.preventDefault(),e.stopPropagation(),lh(u.comboboxState,{0:()=>{d.goToOption(fm.Previous)},1:()=>{d.openCombobox(),f.nextFrame((()=>{u.value||d.goToOption(fm.Last)}))}});case ip.Home:case ip.PageUp:return e.preventDefault(),e.stopPropagation(),d.goToOption(fm.First);case ip.End:case ip.PageDown:return e.preventDefault(),e.stopPropagation(),d.goToOption(fm.Last);case ip.Escape:return 0!==u.comboboxState?void 0:(e.preventDefault(),u.optionsRef.current&&!u.optionsPropsRef.current.static&&e.stopPropagation(),d.closeCombobox());case ip.Tab:if(0!==u.comboboxState)return;0===u.mode&&d.selectActiveOption(),d.closeCombobox()}})),x=Mh((e=>{m||d.openCombobox(),null==o||o(e)})),S=um((()=>{if(u.labelId)return[u.labelId].join(" ")}),[u.labelId]),w=(0,c.useMemo)((()=>({open:0===u.comboboxState,disabled:u.disabled})),[u]);return hh({ourProps:{ref:h,id:p,role:"combobox",type:a,"aria-controls":null==(n=u.optionsRef.current)?void 0:n.id,"aria-expanded":u.disabled?void 0:0===u.comboboxState,"aria-activedescendant":null===u.activeOptionIndex||null==(r=u.options[u.activeOptionIndex])?void 0:r.id,"aria-multiselectable":1===u.mode||void 0,"aria-labelledby":S,disabled:u.disabled,onCompositionStart:v,onCompositionEnd:y,onKeyDown:b,onChange:x},theirProps:l,slot:w,defaultTag:"input",name:"Combobox.Input"})})),Lm=mh((function(e,t){var n;let r=Rm("Combobox.Button"),i=Mm("Combobox.Button"),o=Ph(r.buttonRef,t),s=`headlessui-combobox-button-${cp()}`,a=Uh(),l=Mh((e=>{switch(e.key){case ip.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===r.comboboxState&&i.openCombobox(),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case ip.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===r.comboboxState&&(i.openCombobox(),a.nextFrame((()=>{r.value||i.goToOption(fm.Last)}))),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case ip.Escape:return 0!==r.comboboxState?void 0:(e.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&e.stopPropagation(),i.closeCombobox(),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})})));default:return}})),u=Mh((e=>{if(op(e.currentTarget))return e.preventDefault();0===r.comboboxState?i.closeCombobox():(e.preventDefault(),i.openCombobox()),a.nextFrame((()=>{var e;return null==(e=r.inputRef.current)?void 0:e.focus({preventScroll:!0})}))})),d=um((()=>{if(r.labelId)return[r.labelId,s].join(" ")}),[r.labelId,s]),h=(0,c.useMemo)((()=>({open:0===r.comboboxState,disabled:r.disabled,value:r.value})),[r]),p=e;return hh({ourProps:{ref:o,id:s,type:hm(e,r.buttonRef),tabIndex:-1,"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.comboboxState,"aria-labelledby":d,disabled:r.disabled,onClick:u,onKeyDown:l},theirProps:p,slot:h,defaultTag:"button",name:"Combobox.Button"})})),Dm=mh((function(e,t){let n=Rm("Combobox.Label"),r=`headlessui-combobox-label-${cp()}`,i=Mm("Combobox.Label"),o=Ph(n.labelRef,t);_h((()=>i.registerLabel(r)),[r]);let s=Mh((()=>{var e;return null==(e=n.inputRef.current)?void 0:e.focus({preventScroll:!0})})),a=(0,c.useMemo)((()=>({open:0===n.comboboxState,disabled:n.disabled})),[n]);return hh({ourProps:{ref:o,id:r,onClick:s},theirProps:e,slot:a,defaultTag:"label",name:"Combobox.Label"})})),Bm=uh.RenderStrategy|uh.Static,zm=mh((function(e,t){var n;let{hold:r=!1,...i}=e,o=Rm("Combobox.Options"),s=Ph(o.optionsRef,t),a=`headlessui-combobox-options-${cp()}`,l=xh(),u=null!==l?l===bh.Open:0===o.comboboxState;_h((()=>{var t;o.optionsPropsRef.current.static=null!=(t=e.static)&&t}),[o.optionsPropsRef,e.static]),_h((()=>{o.optionsPropsRef.current.hold=r}),[o.optionsPropsRef,r]),pm({container:o.optionsRef.current,enabled:0===o.comboboxState,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let d=um((()=>{var e,t;return null!=(t=o.labelId)?t:null==(e=o.buttonRef.current)?void 0:e.id}),[o.labelId,o.buttonRef.current]),h=(0,c.useMemo)((()=>({open:0===o.comboboxState})),[o]);return hh({ourProps:{"aria-activedescendant":null===o.activeOptionIndex||null==(n=o.options[o.activeOptionIndex])?void 0:n.id,"aria-labelledby":d,role:"listbox",id:a,ref:s},theirProps:i,slot:h,defaultTag:"ul",features:Bm,visible:u,name:"Combobox.Options"})})),Fm=mh((function(e,t){var n,r;let{disabled:i=!1,value:o,...s}=e,a=Rm("Combobox.Option"),l=Mm("Combobox.Option"),u=`headlessui-combobox-option-${cp()}`,d=null!==a.activeOptionIndex&&a.options[a.activeOptionIndex].id===u,h=a.isSelected(o),p=(0,c.useRef)(null),f=Ah({disabled:i,value:o,domRef:p,textValue:null==(r=null==(n=p.current)?void 0:n.textContent)?void 0:r.toLowerCase()}),m=Ph(t,p),g=Mh((()=>l.selectOption(u)));_h((()=>l.registerOption(u,f)),[f,u]);let v=(0,c.useRef)(!a.__demoMode);_h((()=>{if(!a.__demoMode)return;let e=Nh();return e.requestAnimationFrame((()=>{v.current=!0})),e.dispose}),[]),_h((()=>{if(0!==a.comboboxState||!d||!v.current||0===a.activationTrigger)return;let e=Nh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,d,a.comboboxState,a.activationTrigger,a.activeOptionIndex]);let y=Mh((e=>{if(i)return e.preventDefault();g(),0===a.mode&&l.closeCombobox()})),b=Mh((()=>{if(i)return l.goToOption(fm.Nothing);l.goToOption(fm.Specific,u)})),x=Mh((()=>{i||d||l.goToOption(fm.Specific,u,0)})),S=Mh((()=>{i||!d||a.optionsPropsRef.current.hold||l.goToOption(fm.Nothing)})),w=(0,c.useMemo)((()=>({active:d,selected:h,disabled:i})),[d,h,i]);return hh({ourProps:{id:u,ref:m,role:"option",tabIndex:!0===i?void 0:-1,"aria-disabled":!0===i||void 0,"aria-selected":h,disabled:void 0,onClick:y,onFocus:b,onPointerMove:x,onMouseMove:x,onPointerLeave:S,onMouseLeave:S},theirProps:s,slot:w,defaultTag:"li",name:"Combobox.Option"})})),Um=Object.assign(Om,{Input:Nm,Button:Lm,Label:Dm,Options:zm,Option:Fm});const jm=({center:e,size:n})=>{const r=If();return(0,c.useEffect)((()=>{const i=new(t(Rf).Circle)(e,n),o=r.layerContainer||r.map;return o.addLayer(i),()=>{o.removeLayer(i)}})),null},Hm=({center:e,uncertainty:t})=>{const[n,r]=(0,c.useState)(!1),i=Yf(),o=(0,c.useCallback)((()=>{let n=void 0!==t?Math.round(Math.log2(1e7/t)):i.getZoom();i.setView(e,n)}),[e,t,i]);return(0,c.useEffect)((()=>{n||(o(),r(!0))}),[]),(0,c.useEffect)((()=>{o()}),[e,t,o]),null};let Vm=t(Rf).icon({iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12.5,20.5],shadowAnchor:[12.5,20.5]});t(Rf).Marker.prototype.options.icon=Vm;const Gm=e=>{let t="Position";return(null==e?void 0:e.address)?t=[e.address.village||e.address.suburb,e.address.town||e.address.city||e.address.county||e.address.state,e.address.country].filter(Boolean).filter(((e,t,n)=>n.indexOf(e)===t)).join(", "):(null==e?void 0:e.display_name)&&(t=e.display_name),t};var Wm=({venue:e,setVenue:n,showUncertainty:r=!1,showGpsButton:i=!0,saveAndClose:o})=>{var a,l,u;const{t:d}=Se(),[h,p]=(0,c.useState)(!1),[f,m]=(0,c.useState)(!1),[g,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(""),[x,S]=(0,c.useState)([]),w=nm((async e=>{v(!0);try{let t=await fetch(`https://nominatim.openstreetmap.org/search?q=${e}&format=jsonv2&limit=5&addressdetails=1`),n=await t.json();S(n)}catch(e){console.error(e)}finally{v(!1)}}),1e3);return(0,c.useEffect)((()=>{p(!0)}),[]),(0,c.useEffect)((()=>{const e=document.createElement("link");return e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.rel="stylesheet",e.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",e.crossOrigin="",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsxs)("fieldset",{className:"memori--venue-widget",children:[(0,s.jsx)("legend",{className:"sr-only",children:"Venue"}),(0,s.jsxs)("div",{className:"memori--venue-widget__form-item",children:[(0,s.jsx)("div",{className:"memori--venue-widget__geosuggest",children:f?(0,s.jsx)("p",{children:d("write_and_speak.updatingPosition")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"memori--venue-widget-search",children:(0,s.jsxs)(Um,{value:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?{place_id:0,lat:null==e?void 0:e.latitude,lon:null==e?void 0:e.longitude,display_name:null==e?void 0:e.placeName}:void 0,onChange:e=>{console.log(e);const t=Gm(e);n({latitude:e.lat,longitude:e.lon,placeName:t,uncertainty:(null==e?void 0:e.boundingbox)?Af(e.boundingbox):2})},children:[(0,s.jsx)(Um.Input,{className:"memori--venue-widget-search--input",displayValue:e=>e?Gm(e):"",placeholder:d("searchVenue"),onChange:e=>{return t=e.target.value,b(t),void w(t);var t}}),(g||x.length>0||0===x.length&&""!==y)&&(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(Um.Options,{className:"memori--venue-widget-search--options",children:g?(0,s.jsx)(xf,{spinning:!0,children:(0,s.jsxs)("center",{className:"memori--venue-widget-search--option",children:[d("loading"),"..."]})}):0===x.length&&""!==y?(0,s.jsx)("center",{className:"memori--venue-widget-search--option",children:d("nothingFound")}):null==x?void 0:x.map((e=>(0,s.jsx)(Um.Option,{as:c.Fragment,value:e,children:({active:n,selected:r})=>(0,s.jsx)("li",{className:t(ws)("memori--venue-widget-search--option",{"memori--venue-widget-search--option-active":n,"memori--venue-widget-search--option-selected":r}),children:e.display_name})},e.place_id)))})})]})}),i&&(0,s.jsx)(Sf,{className:"memori--venue-widget__gps-button",primary:!0,loading:f,onClick:()=>{m(!0),(async()=>{m(!0),navigator.geolocation.getCurrentPosition((async e=>{let r={latitude:e.coords.latitude,longitude:e.coords.longitude,placeName:"Position",uncertainty:e.coords.accuracy/1e3};try{const t=await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.coords.latitude}&lon=${e.coords.longitude}&format=jsonv2&addressdetails=1`),i=await t.json(),s=Gm(i);r={latitude:e.coords.latitude,longitude:e.coords.longitude,placeName:s,uncertainty:e.coords.accuracy/1e3},n(r)}catch(e){let i=e;console.error("[POSITION ERROR]",i),(null==i?void 0:i.message)&&t(Ju).error(i.message),n(r)}finally{o&&o(r)}m(!1)}),(e=>{console.error("[POSITION ERROR]",e),t(Ju).error(e.message),m(!1)}))})()},children:d("write_and_speak.useMyPosition")})]})}),(0,s.jsx)("div",{children:(0,s.jsx)(Sf,{outlined:!0,className:"memori--venue-widget__no-location-button",onClick:()=>{let e={latitude:0,longitude:0,placeName:"Position",uncertainty:0};n(e),o&&o(e)},children:d("write_and_speak.dontWantToProvidePosition")})}),r&&(0,s.jsxs)("label",{className:"memori--venue-widget__select-label",children:[(0,s.jsxs)("span",{children:[d("uncertain"),": "]}),(0,s.jsxs)("select",{className:"memori-select--button memori--venue-widget__uncertainty",value:parseFloat((null!==(a=null==e?void 0:e.uncertainty)&&void 0!==a?a:0).toFixed(2)),disabled:!(e&&e.placeName&&e.latitude&&e.longitude),onChange:t=>{n({...e,uncertainty:parseFloat(t.target.value)})},children:[(null==e?void 0:e.uncertainty)&&![0,1,2,5,10,20,50,100].includes(e.uncertainty)&&(0,s.jsxs)("option",{value:e.uncertainty,children:[e.uncertainty," Km"]}),(0,s.jsx)("option",{value:0,children:d("exactPosition")}),(0,s.jsx)("option",{value:1,children:"1 km"}),(0,s.jsx)("option",{value:2,children:"2 km"}),(0,s.jsx)("option",{value:5,children:"5 km"}),(0,s.jsx)("option",{value:10,children:"10 km"}),(0,s.jsx)("option",{value:20,children:"20 km"}),(0,s.jsx)("option",{value:50,children:"50 km"}),(0,s.jsx)("option",{value:100,children:"100 km"})]})]})]}),(0,s.jsxs)("div",{className:"memori--venue-widget__form-item",children:[(null==e?void 0:e.placeName)&&"Position"!==e.placeName&&(0,s.jsxs)("p",{className:"memori--venue--widget__place-name",children:[(0,s.jsx)("strong",{children:d("venue")}),": ",e.placeName]}),(0,s.jsx)("div",{className:"memori--venue-widget__map",children:h&&(0,s.jsxs)(Of,{className:"memori--venue-widget__map",center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],zoom:13,scrollWheelZoom:!0,children:[(0,s.jsx)(Qf,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,s.jsx)(Hm,{center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],uncertainty:1e3*(null!==(l=null==e?void 0:e.uncertainty)&&void 0!==l?l:0)}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(0,s.jsx)(Wf,{position:[e.latitude,e.longitude],icon:Vm,children:(0,s.jsx)(Kf,{children:null!==(u=e.placeName)&&void 0!==u?u:""})}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&void 0!==(null==e?void 0:e.uncertainty)&&(0,s.jsx)(jm,{center:[e.latitude,e.longitude],size:1e3*e.uncertainty})]})})]})]})};var qm=({memori:e,open:t,onClose:n,venue:r,setVenue:i})=>{const{t:o}=Se();return(0,s.jsxs)(_f,{className:"memori-position-drawer",open:t,onClose:()=>n(r),title:o("widget.position")||"Position",animated:!1,children:[(0,s.jsx)("p",{children:o("write_and_speak.requirePositionHelp",{name:e.name})}),(0,s.jsx)(Wm,{venue:r,setVenue:i,showUncertainty:!1,saveAndClose:e=>{i(e),n(e)}})]})};c=o("85Hg2"),c=o("85Hg2");var Km=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,closable:d=!0,width:h="100%",widthMd:p="100%"})=>{const{t:f}=Se();return(0,s.jsx)(np,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(yf,{open:e,onClose:n,className:t(ws)("memori-modal",r),children:[(0,s.jsx)(np.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-modal--backdrop"})}),(0,s.jsx)("div",{className:"memori-modal--container",children:(0,s.jsx)("div",{className:"memori-modal--container-scrollable",children:(0,s.jsx)(np.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsxs)(yf.Panel,{className:"memori-modal--panel",children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${h};\n --memori-modal--width-md: ${p};\n }\n `}}),d&&(0,s.jsx)("div",{className:"memori-modal--close",children:(0,s.jsx)(Sf,{ghost:!0,padded:!0,shape:"circle",icon:(0,s.jsx)(wf,{}),title:f("close")||"Close",onClick:()=>n(!1)})}),(0,s.jsxs)(xf,{spinning:u,children:[i&&(0,s.jsx)(yf.Title,{className:"memori-modal--title",children:i}),o&&(0,s.jsx)(yf.Description,{className:"memori-modal--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-modal--footer",children:l})]})]})})})})]})})},Jm=(c=o("85Hg2"),e=>"checkbox"===e.type),Qm=e=>e instanceof Date,Ym=e=>null==e;const Zm=e=>"object"==typeof e;var Xm=e=>!Ym(e)&&!Array.isArray(e)&&Zm(e)&&!Qm(e),$m=e=>Xm(e)&&e.target?Jm(e.target)?e.target.checked:e.target.value:e,eg=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),tg=e=>Array.isArray(e)?e.filter(Boolean):[],ng=e=>void 0===e,rg=(e,t,n)=>{if(!t||!Xm(e))return n;const r=tg(t.split(/[,[\].]+?/)).reduce(((e,t)=>Ym(e)?e:e[t]),e);return ng(r)||r===e?ng(e[t])?n:e[t]:r};const ig="blur",og="focusout",sg="onBlur",ag="onChange",lg="onSubmit",cg="onTouched",ug="all",dg="max",hg="min",pg="maxLength",fg="minLength",mg="pattern",gg="required",vg="validate";t(c).createContext(null);var yg=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==ug&&(t._proxyFormState[i]=!r||ug),n&&(n[i]=!0),e[i]}});return i},bg=e=>Xm(e)&&!Object.keys(e).length,xg=(e,t,n)=>{const{name:r,...i}=e;return bg(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||ug)))},Sg=e=>Array.isArray(e)?e:[e];function wg(e){const n=t(c).useRef(e);n.current=e,t(c).useEffect((()=>{const t=!e.disabled&&n.current.subject.subscribe({next:n.current.callback});return()=>{t&&t.unsubscribe()}}),[e.disabled])}var _g=e=>"string"==typeof e,Cg=(e,t,n,r)=>_g(e)?(r&&t.watch.add(e),rg(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),rg(n,e)))):(t.watchAll=!!r,n),Ag="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Eg(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(Ag&&(e instanceof Blob||e instanceof FileList)||!n&&!Xm(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return Xm(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=Eg(e[n]);else t=e}return t}var Tg=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Mg=e=>/^\w*$/.test(e),Ig=e=>tg(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Rg(e,t,n){let r=-1;const i=Mg(t)?[t]:Ig(t),o=i.length,s=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==s){const n=e[t];o=Xm(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=o,e=e[t]}return e}const Pg=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=rg(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else Xm(r)&&Pg(r,t)}}};var kg=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),Og=(e,t,n)=>{const r=tg(rg(e,n));return Rg(r,"root",t[n]),Rg(e,n,r),e},Ng=e=>"boolean"==typeof e,Lg=e=>"file"===e.type,Dg=e=>"function"==typeof e,Bg=e=>_g(e)||t(c).isValidElement(e),zg=e=>"radio"===e.type,Fg=e=>e instanceof RegExp;const Ug={value:!1,isValid:!1},jg={value:!0,isValid:!0};var Hg=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ng(e[0].attributes.value)?ng(e[0].value)||""===e[0].value?jg:{value:e[0].value,isValid:!0}:jg:Ug}return Ug};const Vg={isValid:!1,value:null};var Gg=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Vg):Vg;function Wg(e,t,n="validate"){if(Bg(e)||Array.isArray(e)&&e.every(Bg)||Ng(e)&&!e)return{type:n,message:Bg(e)?e:"",ref:t}}var qg=e=>Xm(e)&&!Fg(e)?e:{value:e,message:""},Kg=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:p,name:f,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const y=s?s[0]:o,b=e=>{r&&y.reportValidity&&(y.setCustomValidity(Ng(e)?"":e||""),y.reportValidity())},x={},S=zg(o),w=Jm(o),_=S||w,C=(m||Lg(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,A=Tg.bind(null,f,n,x),E=(e,t,n,r=pg,i=fg)=>{const s=e?t:n;x[f]={type:e?r:i,message:s,ref:o,...A(e?r:i,s)}};if(i?!Array.isArray(t)||!t.length:a&&(!_&&(C||Ym(t))||Ng(t)&&!t||w&&!Hg(s).isValid||S&&!Gg(s).isValid)){const{value:e,message:t}=Bg(a)?{value:!!a,message:a}:qg(a);if(e&&(x[f]={type:gg,message:t,ref:y,...A(gg,t)},!n))return b(t),x}if(!(C||Ym(u)&&Ym(d))){let e,r;const i=qg(d),s=qg(u);if(Ym(t)||isNaN(t)){const n=o.valueAsDate||new Date(t),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==o.type,c="week"==o.type;_g(i.value)&&t&&(e=l?a(t)>a(i.value):c?t>i.value:n>new Date(i.value)),_g(s.value)&&t&&(r=l?a(t)<a(s.value):c?t<s.value:n<new Date(s.value))}else{const n=o.valueAsNumber||(t?+t:t);Ym(i.value)||(e=n>i.value),Ym(s.value)||(r=n<s.value)}if((e||r)&&(E(!!e,i.message,s.message,dg,hg),!n))return b(x[f].message),x}if((l||c)&&!C&&(_g(t)||i&&Array.isArray(t))){const e=qg(l),r=qg(c),i=!Ym(e.value)&&t.length>e.value,o=!Ym(r.value)&&t.length<r.value;if((i||o)&&(E(i,e.message,r.message),!n))return b(x[f].message),x}if(h&&!C&&_g(t)){const{value:e,message:r}=qg(h);if(Fg(e)&&!t.match(e)&&(x[f]={type:mg,message:r,ref:o,...A(mg,r)},!n))return b(r),x}if(p)if(Dg(p)){const e=Wg(await p(t),y);if(e&&(x[f]={...e,...A(vg,e.message)},!n))return b(e.message),x}else if(Xm(p)){let e={};for(const r in p){if(!bg(e)&&!n)break;const i=Wg(await p[r](t),y,r);i&&(e={...i,...A(r,i.message)},b(i.message),n&&(x[f]=e))}if(!bg(e)&&(x[f]={ref:y,...e},!n))return x}return b(!0),x};var Jg=e=>({isOnSubmit:!e||e===lg,isOnBlur:e===sg,isOnChange:e===ag,isOnAll:e===ug,isOnTouch:e===cg});function Qg(e){for(const t in e)if(!ng(e[t]))return!1;return!0}function Yg(e,t){const n=Mg(t)?[t]:Ig(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ng(e)?r++:e[t[r++]];return e}(e,n),i=n[n.length-1];let o;r&&delete r[i];for(let t=0;t<n.slice(0,-1).length;t++){let r,i=-1;const s=n.slice(0,-(t+1)),a=s.length-1;for(t>0&&(o=e);++i<s.length;){const t=s[i];r=r?r[t]:e[t],a===i&&(Xm(r)&&bg(r)||Array.isArray(r)&&Qg(r))&&(o?delete o[t]:delete e[t]),o=r}}return e}function Zg(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var Xg=e=>Ym(e)||!Zm(e);function $g(e,t){if(Xg(e)||Xg(t))return e===t;if(Qm(e)&&Qm(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(Qm(n)&&Qm(e)||Xm(n)&&Xm(e)||Array.isArray(n)&&Array.isArray(e)?!$g(n,e):n!==e)return!1}}return!0}var ev=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},tv=e=>"select-multiple"===e.type,nv=e=>ev(e)&&e.isConnected,rv=e=>{for(const t in e)if(Dg(e[t]))return!0;return!1};function iv(e,t={}){const n=Array.isArray(e);if(Xm(e)||n)for(const n in e)Array.isArray(e[n])||Xm(e[n])&&!rv(e[n])?(t[n]=Array.isArray(e[n])?[]:{},iv(e[n],t[n])):Ym(e[n])||(t[n]=!0);return t}function ov(e,t,n){const r=Array.isArray(e);if(Xm(e)||r)for(const r in e)Array.isArray(e[r])||Xm(e[r])&&!rv(e[r])?ng(t)||Xg(n[r])?n[r]=Array.isArray(e[r])?iv(e[r],[]):{...iv(e[r])}:ov(e[r],Ym(t)?{}:t[r],n[r]):$g(e[r],t[r])?delete n[r]:n[r]=!0;return n}var sv=(e,t)=>ov(e,t,iv(t)),av=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ng(e)?e:t?""===e?NaN:e?+e:e:n&&_g(e)?new Date(e):r?r(e):e;function lv(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Lg(t)?t.files:zg(t)?Gg(e.refs).value:tv(t)?[...t.selectedOptions].map((({value:e})=>e)):Jm(t)?Hg(e.refs).value:av(ng(t.value)?e.ref.value:t.value,e)}var cv=e=>ng(e)?e:Fg(e)?e.source:Xm(e)?Fg(e.value)?e.value.source:e.value:e;function uv(e,t,n){const r=rg(e,n);if(r||Mg(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=rg(t,r),s=rg(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(s&&s.type)return{name:r,error:s};i.pop()}return{name:n}}const dv={mode:lg,reValidateMode:ag,shouldFocusError:!0};function hv(e={}){let t,n={...dv,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=Eg(n.defaultValues)||{},s=n.shouldUnregister?{}:Eg(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={watch:Zg(),array:Zg(),state:Zg()},p=Jg(n.mode),f=Jg(n.reValidateMode),m=n.criteriaMode===ug,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?bg((await x()).errors):await S(i,!0),e!==r.isValid&&(r.isValid=e,h.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=rg(i,e);if(l){const i=rg(s,e,ng(n)?rg(o,e):n);ng(i)||r&&r.defaultChecked||t?Rg(s,e,t?i:lv(l._f)):C(e,i),a.mount&&g()}},y=(e,t,n,i,s)=>{let a=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=w(),a=l!==c.isDirty),d.dirtyFields&&(!n||i)){l=rg(r.dirtyFields,e);const n=$g(rg(o,e),t);n?Yg(r.dirtyFields,e):Rg(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,a=a||l!==!n}if(n){const t=rg(r.touchedFields,e);t||(Rg(r.touchedFields,e,n),c.touchedFields=r.touchedFields,a=a||d.touchedFields&&t!==n)}return a&&s&&h.state.next(c),a?c:{}},b=(n,i,o,s)=>{const a=rg(r.errors,n),l=d.isValid&&Ng(i)&&r.isValid!==i;var p;if(e.delayError&&o?(p=()=>((e,t)=>{Rg(r.errors,e,t),h.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(c),c=window.setTimeout(p,e)},t(e.delayError)):(clearTimeout(c),t=null,o?Rg(r.errors,n,o):Yg(r.errors,n)),(o?!$g(a,o):a)||!bg(s)||l){const e={...s,...l&&Ng(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},h.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(h.state.next({isValidating:!1}),u={})},x=async e=>n.resolver?await n.resolver({...s},n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=rg(t,n);e&&Rg(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)):{},S=async(e,t,i={valid:!0})=>{for(const o in e){const a=e[o];if(a){const{_f:e,...o}=a;if(e){const o=l.array.has(e.name),c=await Kg(a,rg(s,e.name),m,n.shouldUseNativeValidation,o);if(c[e.name]&&(i.valid=!1,t))break;!t&&(rg(c,e.name)?o?Og(r.errors,c,e.name):Rg(r.errors,e.name,c[e.name]):Yg(r.errors,e.name))}o&&await S(o,t,i)}}return i.valid},w=(e,t)=>(e&&t&&Rg(s,e,t),!$g(I(),o)),_=(e,t,n)=>Cg(e,l,{...a.mount?s:ng(t)?o:_g(e)?{[e]:t}:t},n),C=(e,t,n={})=>{const r=rg(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&Rg(s,e,av(t,n)),o=Ag&&ev(n.ref)&&Ym(t)?"":t,tv(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?Jm(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):Lg(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||h.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&y(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&M(e)},A=(e,t,n)=>{for(const r in t){const o=t[r],s=`${e}.${r}`,a=rg(i,s);!l.array.has(e)&&Xg(o)&&(!a||a._f)||Qm(o)?C(s,o,n):A(s,o,n)}},E=(e,t,n={})=>{const a=rg(i,e),c=l.array.has(e),u=Eg(t);Rg(s,e,u),c?(h.array.next({name:e,values:s}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=sv(o,s),h.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:w(e,u)}))):!a||a._f||Ym(u)?C(e,u,n):A(e,u,n),kg(e,l)&&h.state.next({}),h.watch.next({name:e})},T=async e=>{const o=e.target;let a=o.name;const c=rg(i,a);if(c){let S,w;const _=o.type?lv(c._f):$m(e),C=e.type===ig||e.type===og,A=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||rg(r.errors,a)||c._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(C,rg(r.touchedFields,a),r.isSubmitted,f,p),E=kg(a,l,C);Rg(s,a,_),C?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const T=y(a,_,C,!1),I=!bg(T)||E;if(!C&&h.watch.next({name:a,type:e.type}),A)return d.isValid&&g(),I&&h.state.next({name:a,...E?{}:T});if(!C&&E&&h.state.next({}),u[a]=u[a]?u[a]+1:1,h.state.next({isValidating:!0}),n.resolver){const{errors:e}=await x([a]),t=uv(r.errors,i,a),n=uv(e,i,t.name||a);S=n.error,a=n.name,w=bg(e)}else S=(await Kg(c,rg(s,a),m,n.shouldUseNativeValidation))[a],g();c._f.deps&&M(c._f.deps),b(a,w,S,T)}var v},M=async(e,t={})=>{let o,s;const a=Sg(e);if(h.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await x();if(e)for(const n of e){const e=rg(t,n);e?Rg(r.errors,n,e):Yg(r.errors,n)}else r.errors=t;return t})(ng(e)?e:a);o=bg(t),s=e?!a.some((e=>rg(t,e))):o}else e?(s=(await Promise.all(a.map((async e=>{const t=rg(i,e);return await S(t&&t._f?{[e]:t}:t)})))).every(Boolean),(s||r.isValid)&&g()):s=o=await S(i);return h.state.next({...!_g(e)||d.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!s&&Pg(i,(e=>e&&rg(r.errors,e)),e?a:l.mount),s},I=e=>{const t={...o,...a.mount?s:{}};return ng(e)?t:_g(e)?rg(t,e):e.map((e=>rg(t,e)))},R=(e,t)=>({invalid:!!rg((t||r).errors,e),isDirty:!!rg((t||r).dirtyFields,e),isTouched:!!rg((t||r).touchedFields,e),error:rg((t||r).errors,e)}),P=(e,t={})=>{for(const a of e?Sg(e):l.mount)l.mount.delete(a),l.array.delete(a),rg(i,a)&&(t.keepValue||(Yg(i,a),Yg(s,a)),!t.keepError&&Yg(r.errors,a),!t.keepDirty&&Yg(r.dirtyFields,a),!t.keepTouched&&Yg(r.touchedFields,a),!n.shouldUnregister&&!t.keepDefaultValue&&Yg(o,a));h.watch.next({}),h.state.next({...r,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&g()},k=(e,t={})=>{let r=rg(i,e);const c=Ng(t.disabled);return Rg(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&Rg(s,e,t.disabled?void 0:rg(s,e,lv(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:cv(t.min),max:cv(t.max),minLength:cv(t.minLength),maxLength:cv(t.maxLength),pattern:cv(t.pattern)}:{},name:e,onChange:T,onBlur:T,ref:s=>{if(s){k(e,t),r=rg(i,e);const n=ng(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=(e=>zg(e)||Jm(e))(n),l=r._f.refs||[];if(a?l.find((e=>e===n)):n===r._f.ref)return;Rg(i,e,{_f:{...r._f,...a?{refs:[...l.filter(nv),n,...Array.isArray(rg(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=rg(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!eg(l.array,e)||!a.action)&&l.unMount.add(e)}}},O=()=>n.shouldFocusError&&Pg(i,(e=>e&&rg(r.errors,e)),l.mount);return{control:{register:k,unregister:P,getFieldState:R,_executeSchema:x,_focusError:O,_getWatch:_,_getDirty:w,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=rg(i,e);t&&(t._f.refs?t._f.refs.every((e=>!nv(e))):!nv(t._f.ref))&&P(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(a.action=!0,u&&Array.isArray(rg(i,e))){const t=n(rg(i,e),l.argA,l.argB);c&&Rg(i,e,t)}if(u&&Array.isArray(rg(r.errors,e))){const t=n(rg(r.errors,e),l.argA,l.argB);c&&Rg(r.errors,e,t),((e,t)=>{!tg(rg(e,t)).length&&Yg(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(rg(r.touchedFields,e))){const t=n(rg(r.touchedFields,e),l.argA,l.argB);c&&Rg(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=sv(o,s)),h.state.next({isDirty:w(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Rg(s,e,t)},_getFieldArray:t=>tg(rg(a.mount?s:o,t,e.shouldUnregister?rg(o,t,[]):[])),_subjects:h,_proxyFormState:d,get _fields(){return i},get _formValues(){return s},get _stateFlags(){return a},set _stateFlags(e){a=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:M,register:k,handleSubmit:(e,t)=>async o=>{o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let a=!0,l=Eg(s);h.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await x();r.errors=e,l=t}else await S(i);bg(r.errors)?(h.state.next({errors:{},isSubmitting:!0}),await e(l,o)):(t&&await t({...r.errors},o),O())}catch(e){throw a=!1,e}finally{r.isSubmitted=!0,h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:bg(r.errors)&&a,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>Dg(e)?h.watch.subscribe({next:n=>e(_(void 0,t),n)}):_(e,t,!0),setValue:E,getValues:I,reset:(t,n)=>((t,n={})=>{const c=t||o,u=Eg(c),p=t&&!bg(t)?u:o;if(n.keepDefaultValues||(o=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)rg(r.dirtyFields,e)?Rg(p,e,rg(s,e)):E(e,rg(p,e));else{if(Ag&&ng(t))for(const e of l.mount){const t=rg(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(ev(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}s=e.shouldUnregister?n.keepDefaultValues?Eg(o):{}:u,h.array.next({values:p}),h.watch.next({values:p})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!n.keepIsValid,a.watch=!!e.shouldUnregister,h.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||$g(t,o)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?sv(o,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(Dg(t)?t(s):t,n),resetField:(e,t={})=>{rg(i,e)&&(ng(t.defaultValue)?E(e,rg(o,e)):(E(e,t.defaultValue),Rg(o,e,t.defaultValue)),t.keepTouched||Yg(r.touchedFields,e),t.keepDirty||(Yg(r.dirtyFields,e),r.isDirty=t.defaultValue?w(e,rg(o,e)):w()),t.keepError||(Yg(r.errors,e),d.isValid&&g()),h.state.next({...r}))},clearErrors:e=>{e?Sg(e).forEach((e=>Yg(r.errors,e))):r.errors={},h.state.next({errors:r.errors})},unregister:P,setError:(e,t,n)=>{const o=(rg(i,e,{_f:{}})._f||{}).ref;Rg(r.errors,e,{...t,ref:o}),h.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},setFocus:(e,t={})=>{const n=rg(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:R}}function pv(e={}){const n=t(c).useRef(),[r,i]=t(c).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});n.current||(n.current={...hv(e),formState:r});const o=n.current.control;return o._options=e,wg({subject:o._subjects.state,callback:t(c).useCallback((e=>{xg(e,o._proxyFormState,!0)&&(o._formState={...o._formState,...e},i({...o._formState}))}),[o])}),t(c).useEffect((()=>{o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),t(c).useEffect((()=>{r.submitCount&&o._focusError()}),[o,r.submitCount]),n.current.formState=yg(r,o),n.current}var fv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,s.jsx)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"})]});var mv=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:n,minimumNumberOfRecoveryTokens:r=1,showTokens:i=!0,openModal:o=!1,withModal:a=!1})=>{var l;const{t:u}=Se(),{register:d,handleSubmit:h,formState:{errors:p},setError:f}=pv(),[m,g]=(0,c.useState)(1),[v,y]=(0,c.useState)(!!e),b=(0,s.jsxs)("form",{name:"memoriAuth",onSubmit:h((t=>{var i,o,s;"password"===e&&!(null===(i=t.password)||void 0===i?void 0:i.length)||"tokens"===e&&(((null===(o=null==t?void 0:t.tokens)||void 0===o?void 0:o.length)||0)<r||!(null===(s=null==t?void 0:t.tokens)||void 0===s?void 0:s.every((e=>e.length))))?f("tokens",{type:"minLength",message:"Tokens"}):n&&n(t).then((()=>{y(!1)}))})),className:"memori-auth-widget--form",children:[("password"===e||!i)&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--password-fieldset",children:[(0,s.jsxs)("label",{children:["Password:"," ",(0,s.jsx)("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})]}),i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{}),(0,s.jsx)(Sf,{outlined:!0,onClick:()=>t("tokens"),children:u("auth.useRecoveryTokens")||"Recovery tokens"})]})]}),"tokens"===e&&i&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens",children:[(0,s.jsxs)("legend",{children:[u("auth.tokens"),": "]}),(x=m,Array.from({length:x},((e,t)=>t))).map((e=>(0,s.jsx)("label",{className:"memori-auth-widget--token",children:(0,s.jsx)("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})},e))),(0,s.jsx)(Sf,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:(0,s.jsx)(fv,{}),children:u("auth.addToken")||"Add token"}),(0,s.jsx)("hr",{}),(0,s.jsx)(Sf,{outlined:!0,onClick:()=>t("password"),children:u("auth.usePassword")||"Password"})]}),"minLength"===(null===(l=p.tokens)||void 0===l?void 0:l.type)&&(0,s.jsxs)("div",{className:"memori-auth-widget--error",children:[u("auth.atLeast")||"At least"," ",r]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit",children:u("confirm")||"Submit"})]});var x;return a?(0,s.jsx)(Km,{open:o||v,title:u("auth.title")||"Authentication",onClose:()=>t(null),closable:!1,children:b}):b};c=o("85Hg2");const gv=({type:e,resourceURI:t,sessionID:n,baseURL:r="",apiURL:i=""})=>{let o="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png?v=20231208`;try{return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:(t.startsWith("https://")||t.startsWith("http://"))&&(new URL(t).hostname.includes("memori.ai")||new URL(t).hostname.includes("aclambda.online")||new URL(t).hostname.includes("localhost"))?`${t}${t.endsWith("/")||!n?"":"/"}${n||""}`:t.startsWith("cloud://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:t||o:o}catch(e){return t||o}};c=o("85Hg2");var vv=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});var yv=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className:e,"aria-label":t,children:(0,s.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,s.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});var bv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var xv=({content:e,className:n,align:r="right",disabled:i=!1,visible:o=!1,children:a})=>(0,s.jsxs)("div",{className:t(ws)("memori-tooltip",`memori-tooltip--align-${r}`,n,{"memori-tooltip--disabled":i,"memori-tooltip--visible":o}),children:[(0,s.jsx)("div",{className:"memori-tooltip--content",children:e}),(0,s.jsx)("div",{className:"memori-tooltip--trigger",children:a})]}),Sv=(c=o("85Hg2"),c=o("85Hg2"),(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Sv||{})),wv=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(wv||{}),_v=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(_v||{});function Cv(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=Cp(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let Av={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Cv(e),i=mm(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Cv(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Cv(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Ev=(0,c.createContext)(null);function Tv(e){let t=(0,c.useContext)(Ev);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Tv),t}return t}function Mv(e,t){return lh(t.type,Av,e,t)}Ev.displayName="MenuContext";let Iv=c.Fragment,Rv=mh((function(e,n){let r=(0,c.useReducer)(Mv,{menuState:1,buttonRef:(0,c.createRef)(),itemsRef:(0,c.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:s},a]=r,l=Ph(n);rf([s,o],((e,t)=>{var n;a({type:1}),xp(t,bp.Loose)||(e.preventDefault(),null==(n=s.current)||n.focus())}),0===i);let u=Mh((()=>{a({type:1})})),d=(0,c.useMemo)((()=>({open:0===i,close:u})),[i,u]),h=e,p={ref:l};return t(c).createElement(Ev.Provider,{value:r},t(c).createElement(Sh,{value:lh(i,{0:bh.Open,1:bh.Closed})},hh({ourProps:p,theirProps:h,slot:d,defaultTag:Iv,name:"Menu"})))})),Pv=mh((function(e,t){var n;let[r,i]=Tv("Menu.Button"),o=Ph(r.buttonRef,t),s=`headlessui-menu-button-${cp()}`,a=Uh(),l=Mh((e=>{switch(e.key){case ip.Space:case ip.Enter:case ip.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:fm.First})));break;case ip.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:fm.Last})))}})),u=Mh((e=>{if(e.key===ip.Space)e.preventDefault()})),d=Mh((t=>{if(op(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),h=(0,c.useMemo)((()=>({open:0===r.menuState})),[r]),p=e;return hh({ourProps:{ref:o,id:s,type:hm(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:p,slot:h,defaultTag:"button",name:"Menu.Button"})})),kv=uh.RenderStrategy|uh.Static,Ov=mh((function(e,t){var n,r;let[i,o]=Tv("Menu.Items"),s=Ph(i.itemsRef,t),a=Rp(i.itemsRef),l=`headlessui-menu-items-${cp()}`,u=Uh(),d=xh(),h=null!==d?d===bh.Open:0===i.menuState;(0,c.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==a?void 0:a.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,a]),pm({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let p=Mh((e=>{var t,n;switch(u.dispose(),e.key){case ip.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:3,value:e.key});case ip.Enter:if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}Sp(i.buttonRef.current);break;case ip.ArrowDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:fm.Next});case ip.ArrowUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:fm.Previous});case ip.Home:case ip.PageUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:fm.First});case ip.End:case ip.PageDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:fm.Last});case ip.Escape:e.preventDefault(),e.stopPropagation(),o({type:1}),Nh().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case ip.Tab:e.preventDefault(),e.stopPropagation(),o({type:1}),Nh().nextFrame((()=>{Ap(i.buttonRef.current,e.shiftKey?mp.Previous:mp.Next)}));break;default:1===e.key.length&&(o({type:3,value:e.key}),u.setTimeout((()=>o({type:4})),350))}})),f=Mh((e=>{if(e.key===ip.Space)e.preventDefault()})),m=(0,c.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return hh({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=i.buttonRef.current)?void 0:r.id,id:l,onKeyDown:p,onKeyUp:f,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:m,defaultTag:"div",features:kv,visible:h,name:"Menu.Items"})})),Nv=c.Fragment,Lv=mh((function(e,t){let{disabled:n=!1,...r}=e,[i,o]=Tv("Menu.Item"),s=`headlessui-menu-item-${cp()}`,a=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===s,l=(0,c.useRef)(null),u=Ph(t,l);_h((()=>{if(0!==i.menuState||!a||0===i.activationTrigger)return;let e=Nh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,a,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,c.useRef)({disabled:n,domRef:l});_h((()=>{d.current.disabled=n}),[d,n]),_h((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),_h((()=>(o({type:5,id:s,dataRef:d}),()=>o({type:6,id:s}))),[d,s]);let h=Mh((()=>{o({type:1})})),p=Mh((e=>{if(n)return e.preventDefault();o({type:1}),Sp(i.buttonRef.current)})),f=Mh((()=>{if(n)return o({type:2,focus:fm.Nothing});o({type:2,focus:fm.Specific,id:s})})),m=Mh((()=>{n||a||o({type:2,focus:fm.Specific,id:s,trigger:0})})),g=Mh((()=>{n||!a||o({type:2,focus:fm.Nothing})})),v=(0,c.useMemo)((()=>({active:a,disabled:n,close:h})),[a,n,h]);return hh({ourProps:{id:s,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:p,onFocus:f,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:Nv,name:"Menu.Item"})})),Dv=Object.assign(Rv,{Button:Pv,Items:Ov,Item:Lv});var Bv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});const zv={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},Fv={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},Uv={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"};var jv=({memori:e,className:n,onNegativeClick:r,toggle:i=!1,dropdown:o=!1})=>{const[a,l]=(0,c.useState)(),u="it-IT"===e.culture?"it-IT":"fr-FR"===e.culture?"fr-FR":"en-GB",d=zv[u],h=Fv[u],p=Uv[u];return(0,s.jsx)("div",{className:"memori-chat--feedback"+(n?` ${n}`:""),children:o?(0,s.jsxs)(Dv,{as:"div",className:"memori-chat--feedback-menu",children:[(0,s.jsx)(Dv.Button,{as:t(c).Fragment,children:(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!a,icon:(0,s.jsx)(Bv,{className:a?"memori-chat--feedback-clicked":void 0})})}),(0,s.jsx)(np,{as:t(c).Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,s.jsx)(Dv.Items,{className:"memori-chat--feedback-menu-items",children:(0,s.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,s.jsx)(Dv.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("up"===a&&i?void 0:"up")},children:p})},"ok"),(0,s.jsx)(Dv.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},children:h})},"no")]})})})]}):(0,s.jsx)(xv,{align:"left",content:"Feedback",children:(0,s.jsx)(Sf,{title:"Feedback",onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},ghost:!0,shape:"circle",icon:(0,s.jsx)(Bv,{className:a?"memori-chat--feedback-clicked":void 0})})})})},Hv={};!function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults=t();const r=/[&<>"']/,i=new RegExp(r.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,s=new RegExp(o.source,"g"),a={"&":"&","<":"<",">":">",'"':""","'":"'"},l=e=>a[e];function c(e,t){if(t){if(r.test(e))return e.replace(i,l)}else if(o.test(e))return e.replace(s,l);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(u,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const h=/(^|[^\[])\^/g;function p(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(h,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function f(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const m={exec:()=>null};function g(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function v(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function y(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function b(e,t,n,r){const i=t.href,o=t.title?c(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:c(s)}}function x(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}class S{options;rules;lexer;constructor(t){this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:v(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=x(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=v(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=v(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="",a="",l=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())a+="\n"+c.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(i.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+c}d||c.trim()||(d=!0),s+=l+"\n",e=e.substring(l.length+1),r=c.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(s)&&(l=!0));let h,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(a),p&&(h="[ ] "!==p[0],a=a.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!p,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=g(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of i)o.rows.push(g(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=v(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=y(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),b(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return b(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const w=/^(?: *(?:\n|$))+/,_=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,C=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,E=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,T=/(?:[*+-]|\d{1,9}[.)])/,M=p(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,T).getRegex(),I=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,R=/^[^\n]+/,P=/(?!\s*\])(?:\\.|[^\[\]\\])+/,k=p(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",P).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),O=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,T).getRegex(),N="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",L=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,D=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",L).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),B=p(I).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),z={blockquote:p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B).getRegex(),code:_,def:k,fences:C,heading:E,hr:A,html:D,lheading:M,list:O,newline:w,paragraph:B,table:m,text:R},F=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),U={...z,table:F,paragraph:p(I).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",F).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex()},j={...z,html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",L).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:m,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(I).replace("hr",A).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,V=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,G=/^( {2,}|\\)\n(?!\s*$)/,W=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q="\\p{P}$+<=>`^|~",K=p(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,q).getRegex(),J=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Q=p(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,q).getRegex(),Y=p("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,q).getRegex(),Z=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,q).getRegex(),X=p(/\\([punct])/,"gu").replace(/punct/g,q).getRegex(),$=p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ee=p(L).replace("(?:--\x3e|$)","--\x3e").getRegex(),te=p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,re=p(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ie=p(/^!?\[(label)\]\[(ref)\]/).replace("label",ne).replace("ref",P).getRegex(),oe=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",P).getRegex(),se=p("reflink|nolink(?!\\()","g").replace("reflink",ie).replace("nolink",oe).getRegex(),ae={_backpedal:m,anyPunctuation:X,autolink:$,blockSkip:J,br:G,code:V,del:m,emStrongLDelim:Q,emStrongRDelimAst:Y,emStrongRDelimUnd:Z,escape:H,link:re,nolink:oe,punctuation:K,reflink:ie,reflinkSearch:se,tag:te,text:W,url:m},le={...ae,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",ne).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne).getRegex()},ce={...ae,escape:p(H).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ue={...ce,br:p(G).replace("{2,}","*").getRegex(),text:p(ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},de={normal:z,gfm:U,pedantic:j},he={normal:ae,gfm:ce,breaks:ue,pedantic:le};class pe{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new S,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:de.normal,inline:he.normal};this.options.pedantic?(n.block=de.pedantic,n.inline=he.pedantic):this.options.gfm&&(n.block=de.gfm,this.options.breaks?n.inline=he.breaks:n.inline=he.gfm),this.tokenizer.rules=n}static get rules(){return{block:de,inline:he}}static lex(e,t){return new pe(t).lex(e)}static lexInline(e,t){return new pe(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,o,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class fe{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+c(r)+'">'+(n?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:c(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=f(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>",i}image(e,t,n){const r=f(e);if(null===r)return n;let i=`<img src="${e=r}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class me{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ge{options;renderer;textRenderer;constructor(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new me}static parse(e,t){return new ge(t).parse(e)}static parseInline(e,t){return new ge(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(i.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,d(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let o="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,r=e.start,o=e.loose;let s="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,i=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);o?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),s+=this.renderer.listitem(a,i,!!r)}n+=this.renderer.list(s,t,r);continue}case"html":{const e=i;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],s+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(s):s;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}switch(i.type){case"escape":{const e=i;n+=t.text(e.text);break}case"html":{const e=i;n+=t.html(e.text);break}case"link":{const e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=i;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;n+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class ve{options;constructor(t){this.options=t||e.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class ye{defaults=t();options=this.setOptions;parse=this.#e(pe.lex,ge.parse);parseInline=this.#e(pe.lexInline,ge.parseInline);Parser=ge;Renderer=fe;TextRenderer=me;Lexer=pe;Tokenizer=S;Hooks=ve;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{n=n.concat(this.walkTokens(e[r],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new fe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new S(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ve;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],o=t[r];ve.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>o.call(t,e)));const n=i.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pe.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const i={...r},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const s=this.#t(!!o.silent,!!o.async);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let i=t(r,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return s(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+c(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const be=new ye;function xe(e,t){return be.parse(e,t)}xe.options=xe.setOptions=function(e){return be.setOptions(e),xe.defaults=be.defaults,n(xe.defaults),xe},xe.getDefaults=t,xe.defaults=e.defaults,xe.use=function(...e){return be.use(...e),xe.defaults=be.defaults,n(xe.defaults),xe},xe.walkTokens=function(e,t){return be.walkTokens(e,t)},xe.parseInline=be.parseInline,xe.Parser=ge,xe.parser=ge.parse,xe.Renderer=fe,xe.TextRenderer=me,xe.Lexer=pe,xe.lexer=pe.lex,xe.Tokenizer=S,xe.Hooks=ve,xe.parse=xe;const Se=xe.options,we=xe.setOptions,_e=xe.use,Ce=xe.walkTokens,Ae=xe.parseInline,Ee=xe,Te=ge.parse,Me=pe.lex;e.Hooks=ve,e.Lexer=pe,e.Marked=ye,e.Parser=ge,e.Renderer=fe,e.TextRenderer=me,e.Tokenizer=S,e.getDefaults=t,e.lexer=Me,e.marked=xe,e.options=Se,e.parse=Ee,e.parseInline=Ae,e.parser=Te,e.setOptions=we,e.use=_e,e.walkTokens=Ce}(Hv);var Vv={};
|
|
239
|
-
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */Vv=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=S(Array.prototype.forEach),d=S(Array.prototype.pop),h=S(Array.prototype.push),p=S(String.prototype.toLowerCase),f=S(String.prototype.toString),m=S(String.prototype.match),g=S(String.prototype.replace),v=S(String.prototype.indexOf),y=S(String.prototype.trim),b=S(RegExp.prototype.test),x=w(TypeError);function S(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function w(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function _(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function C(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function A(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return S(n.get);if("function"==typeof n.value)return S(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const E=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),M=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=s(/^(?:\w+script|data):/i),G=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:G,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:S,Element:w,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,V=w.prototype,G=A(V,"cloneNode"),Y=A(V,"nextSibling"),Z=A(V,"childNodes"),X=A(V,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let $,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:pe}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=_({},[...E,...T,...M,...R,...k]);let ve=null;const ye=_({},[...O,...N,...L,...D]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,Se=null,we=!0,_e=!0,Ce=!1,Ae=!0,Ee=!1,Te=!1,Me=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const Le="user-content-";let De=!0,Be=!1,ze={},Fe=null;const Ue=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=_({},["audio","video","img","source","image","track"]);let Ve=null;const Ge=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Ze=_({},[We,qe,Ke],f);let Xe=null;const $e=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),Xe=Xe=-1===$e.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Xe?f:p,me="ALLOWED_TAGS"in e?_({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?_({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?_({},e.ALLOWED_NAMESPACES,f):Ze,Ve="ADD_URI_SAFE_ATTR"in e?_(C(Ge),e.ADD_URI_SAFE_ATTR,tt):Ge,je="ADD_DATA_URI_TAGS"in e?_(C(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?_({},e.FORBID_CONTENTS,tt):Ue,xe="FORBID_TAGS"in e?_({},e.FORBID_TAGS,tt):{},Se="FORBID_ATTR"in e?_({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,we=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,De=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(_e=!1),Pe&&(Re=!0),ze&&(me=_({},[...k]),ve=[],!0===ze.html&&(_(me,E),_(ve,O)),!0===ze.svg&&(_(me,T),_(ve,N),_(ve,D)),!0===ze.svgFilters&&(_(me,M),_(ve,N),_(ve,D)),!0===ze.mathMl&&(_(me,R),_(ve,L),_(ve,D))),e.ADD_TAGS&&(me===ge&&(me=C(me)),_(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=C(ve)),_(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&_(Ve,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=C(Fe)),_(Fe,e.FORBID_CONTENTS,tt)),De&&(me["#text"]=!0),Te&&_(me,["html","head","body"]),me.table&&(_(me,["tbody"]),delete xe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=e.TRUSTED_TYPES_POLICY,ee=$.createHTML("")}else void 0===$&&($=J(j,s)),null!==$&&"string"==typeof ee&&(ee=$.createHTML(""));o&&o(e),nt=e}},st=_({},["mi","mo","mn","ms","mtext"]),at=_({},["foreignobject","desc","title","annotation-xml"]),lt=_({},["title","style","font","a","script"]),ct=_({},T);_(ct,M),_(ct,I);const ut=_({},R);_(ut,P);const dt=function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==Xe||!Ye[e.namespaceURI]))},ht=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Xe&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=$?$.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,Xe)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,Te?"html":"body")[0]:Te?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof S&&e instanceof S},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return ht(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ht(e),!0;if(!me[r]||xe[r]){if(!xe[r]&&St(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(De&&!Fe[r]){const t=X(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(G(n[r],!0),Y(e))}return ht(e),!0}return e instanceof w&&!dt(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ht(e),!0)},xt=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(_e&&!Se[t]&&b(ue,t));else if(we&&b(de,t));else if(!ve[t]||Se[t]){if(!(St(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(fe,g(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ce&&!b(he,g(n,pe,"")));else if(n)return!1;return!0},St=function(e){return e.indexOf("-")>0},wt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let h="value"===s?l:y(l);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),h=r.attrValue,r.forceKeepAttr)continue;if(pt(s,e),!r.keepAttr)continue;if(!Ae&&b(/\/>/i,h)){pt(s,e);continue}Ee&&u([ae,le,ce],(e=>{h=g(h,e," ")}));const p=tt(e.nodeName);if(xt(p,c,h)){if(!Ne||"id"!==c&&"name"!==c||(pt(s,e),h=Le+h),$&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(p,c)){case"TrustedHTML":h=$.createHTML(h);break;case"TrustedScriptURL":h=$.createScriptURL(h)}try{a?e.setAttributeNS(a,s,h):e.setAttribute(s,h),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},_t=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),wt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||xe[t])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof S)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Ee&&!Te&&-1===e.indexOf("<"))return $&&ke?$.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&ht(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&_t(s.content),wt(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=Te?r.outerHTML:r.innerHTML;return Te&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Ee&&u([ae,le,ce],(e=>{d=g(d,e," ")})),$&&ke?$.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){nt=null,Me=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return xt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],h(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}();var Gv=({className:e,title:t})=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),(0,s.jsx)("path",{d:"M12 17L12.01 17"})]});var Wv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",focusable:"false",role:"img",className:e,"aria-label":t,children:[(0,s.jsx)("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),(0,s.jsx)("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]});var qv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",focusable:"false",role:"img",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M10 9.5 8 12l2 2.5"}),(0,s.jsx)("path",{d:"m14 9.5 2 2.5-2 2.5"}),(0,s.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"})]});c=o("85Hg2"),c=o("85Hg2");var Kv=({rows:e,className:n,innerClassName:r,btnClassName:i,lineHeightMultiplier:o=1.2,defaultExpanded:a=!1,expandSymbol:l=(()=>"..."),collapseSymbol:u=(e=>"it"===e?"Mostra meno":"Show less"),children:d})=>{const{i18n:h}=Se(),p=h.language,f=u(p),m=l(p),[g,v]=(0,c.useState)(a),[y,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(16),w=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(w.current){let t=w.current.getBoundingClientRect().height,n=getComputedStyle(w.current),r=n.lineHeight,i="normal"!==r&&(null==r?void 0:r.length)?parseInt(r,10):o*parseInt(n.fontSize,10);console.table({rows:e,lineHeight:i,height:t,maxHeight:e*i,needsExpanding:t>e*i}),S(i),t&&t>e*i&&b(!0)}}),[e,w.current]),(0,s.jsxs)("div",{className:t(ws)("memori-expandable",n),children:[(0,s.jsx)("div",{ref:w,className:t(ws)("memori-expandable--inner",r),style:{maxHeight:g||!y?"9999px":x*e+"px"},children:d}),y&&!g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!0),children:m}),y&&g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!1),children:f})]})};const Jv=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,TENANT_ALREADY_EXISTS:-6,TENANT_MISSING_DESCRIPTION:-7,TENANT_CANT_SET_COMPLETION_PROVIDER:-8,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_TOO_MANY_ATTEMPTS:-38,USER_MUST_ACCEPT_TNC_AND_PP:-39,USER_BIRTH_DATE_CANT_BE_CHANGED:-40,USER_CANT_SET_COMPLETION_PROVIDER:-41,USER_CANT_ENABLE_DEEP_THOUGHT:-42,USER_CANT_ENABLE_DCM_INTEGRATION:-43,USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS:-44,USER_CREATION_BILLING_DENIED_PERMISSION:-46,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,SESSION_EXPIRED:-103,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS:-215,MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS:-216,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,MEMORI_FEATURE_REQUIRES_SUBSCRIPTION:-271,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905,NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD:-1001,PROCESS_INVALID_TYPE:-1401,PROCESS_ALREADY_RUNNING:-1401,PROCESS_NOT_FOUND:-1402,IMPORTCSV_MISSING_ROWS:-1501,IMPORTCSV_MISSING_CSV:-1502,IMPORTCSV_MISSING_SEPARATOR:-1503,IMPORTCSV_INVALID_SEPARATOR:-1504,IMPORTCSV_MISSING_HEADERS:-1505,IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1506,IMPORTCSV_INVALID_RECEIVER_ID:-1507,IMPORTCSV_INVALID_MEDIA_LINK:-1508,IMPORTCSV_UNDETECTABLE_CHAR_ENCODING:-1521,IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI:-1531,IMPORTTXT_MISSING_ROWS:-1601,IMPORTTXT_INVALID_GRANULARITY:-1602,IMPORTTXT_INVALID_RECEIVER_ID:-1603,IMPORTTXT_INVALID_MEDIA_LINK:-1604,IMPORTTXT_UNDETECTABLE_CHAR_ENCODING:-1621,IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI:-1631,IMPORTTXT_IMPORT_LIMIT_EXCEEDED:-1632,IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY:-1633,IMPORTTXT_IMPORT_REQUIRES_PAYING:-1634,IMPORTTXT_BILLING_DENIED_PERMISSION:-1635,EXPORTCSV_MISSING_CSV_SPECS:-1801,EXPORTCSV_MISSING_SEPARATOR:-1802,EXPORTCSV_INVALID_SEPARATOR:-1803,EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1804,EXPORTCSV_MISSING_NEW_LINE_CHAR:-1805,EXPORTCSV_INVALID_NEW_LINE_CHAR:-1806,EXPORTCSV_MISSING_PASSWORD:-1811,EXPORTJSONL_MISSING_JSONL_SPECS:-1821,EXPORTJSONL_MISSING_PLATFORM:-1822,EXPORTJSONL_INVALID_PLATFORM:-1823,EXPORTJSONL_MISSING_PASSWORD:-1831,EXPORTJSONL_EXPORT_REQUIRES_PAYING:-1832,ANALYSIS_MISSING_QUERY:-1901,ANALYSIS_CANT_ANALYZE_SECRET_MEMORI:-1902,ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT:-1903,BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS:-2001,BADGE_ASSIGNMENT_MISSING_REF_ID:-2002,BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND:-2003,BADGE_ASSIGNMENT_MISSING_ASSERTION_URL:-2004,BADGE_ASSIGNMENT_MISSING_BADGE_URL:-2005,BADGE_ASSIGNMENT_MISSING_ISSUER_URL:-2006,BADGE_ASSIGNMENT_INVALID_URL:-2007,BADGE_ASSIGNMENT_MISSING_RECIPIENT:-2021,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE:-2022,BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY:-2023,BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE:-2024,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE:-2025,BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY:-2026,BADGE_NOT_FOUND:-2051,OUTCOME_NO_DCM_CONFIGURED:-2071,OUTCOME_USER_BADGES_DISABLED:-2072}).map((([e,t])=>[t,e]))),Qv=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=Jv.get(e);return t?`errors.${t}`:"error.generic"},Yv=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"},{value:"EL",label:"Ελληνικά"},{value:"AR",label:"العربية"},{value:"ZH",label:"中文"},{value:"JA",label:"日本語"}],Zv="👤",Xv=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],$v={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};var ey={};function ty(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(ey=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){ty(o,r,i,s,a,"next",e)}function a(e){ty(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,ey.default=ey;var ny={};function ry(){return ny=ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ny.__esModule=!0,ny.default=ny,ry.apply(this,arguments)}(ny=ry).__esModule=!0,ny.default=ny;ee=o("ffgrs"),te=o("22y1y");var iy={},oy={};function sy(e,t){return oy=sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oy.__esModule=!0,oy.default=oy,sy(e,t)}(oy=sy).__esModule=!0,oy.default=oy,(iy=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oy(e,t)}).__esModule=!0,iy.default=iy;var ay={},ly=o("lEJSL").default,cy={};(cy=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,cy.default=cy,(ay=function(e,t){if(t&&("object"===ly(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return cy(e)}).__esModule=!0,ay.default=ay;var uy={};function dy(e){return uy=dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uy.__esModule=!0,uy.default=uy,dy(e)}(uy=dy).__esModule=!0,uy.default=uy;var hy,py=o("7qcgS")();hy=py;try{regeneratorRuntime=py}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=py:Function("r","regeneratorRuntime = r")(py)}c=o("85Hg2");var fy={},my={};(my=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,my.default=my,(fy=function(e,t){if(null==e)return{};var n,r,i=my(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,fy.default=fy;var gy={},vy={},yy=o("e3mvX");(vy=function(e){if(Array.isArray(e))return yy(e)}).__esModule=!0,vy.default=vy;var by={};(by=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,by.default=by;var xy=o("8xD61"),Sy={};(Sy=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Sy.default=Sy,(gy=function(e){return vy(e)||by(e)||xy(e)||Sy()}).__esModule=!0,gy.default=gy;c=o("85Hg2"),c=o("85Hg2");function wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _y(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?wy(Object(r),!0).forEach((function(n){t(X)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Cy={};function Ay(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Cy[r]||(Cy[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Cy[r]}function Ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Ay(r);return i.reduce((function(e,t){return _y(_y({},e),n[t])}),t)}function Ty(e){return e.join(" ")}function My(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,h=n.value;if("text"===u)return h;if(d){var p,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return My({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));p=_y(_y({},l),{},{className:Ty(v)||void 0,style:Ey(l.className,Object.assign({},l.style,o),r)})}else p=_y(_y({},l),{},{className:Ty(l.className)});var y=f(n.children);return t(c).createElement(d,t(ny)({key:a},p),y)}}var Iy=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Py(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Ry(Object(r),!0).forEach((function(n){t(X)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ry(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ky=/\n/g;function Oy(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Ny(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Ly(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return Py(Py({},i),o)}function Dy(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,h="function"==typeof a?a(n):a;if(h.className=c,n&&o){var p=Ly(r,n,i);t.unshift(Ny(n,p))}return d&u&&(h.style=Py(Py({},h.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function By(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Dy({children:[o],className:t(gy)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);By(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function zy(e,t,n,r,i,o,s,a,l){var c,u=By(e.value),d=[],h=-1,p=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Dy({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Ly(a,t,s);e.unshift(Ny(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[p],t=e.children[0].value;if(t.match(ky)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(h+1,p).concat(Dy({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[p+1]&&u[p+1].children&&u[p+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Dy({children:[f],className:e.properties.className});u.splice(p+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),h=p}p++};p<u.length;)v();if(h!==u.length-1){var y=u.slice(h+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function Fy(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return My({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Uy(e){return e&&void 0!==e.highlightAuto}function jy(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,h=void 0===d?{className:i?"language-".concat(i):void 0,style:Py(Py({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,p=r.useInlineStyles,f=void 0===p||p,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,x=void 0===b?1:b,S=r.lineNumberContainerStyle,w=r.lineNumberStyle,_=void 0===w?{}:w,C=r.wrapLines,A=r.wrapLongLines,E=void 0!==A&&A,T=r.lineProps,M=void 0===T?{}:T,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,L=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,D=r.astGenerator,B=t(fy)(r,Iy);D=D||e;var z=g?t(c).createElement(Oy,{containerStyle:S,codeStyle:h.style||{},numberStyle:_,startingLineNumber:x,codeString:L}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=Uy(D)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(h.style=Py(Py({},h.style),{},E?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!D)return t(c).createElement(P,j,z,t(c).createElement(O,h,L));(void 0===C&&I||E)&&(C=!0),I=I||Fy;var H=[{type:"text",value:L}],V=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(Uy(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:D,language:i,code:L,defaultCodeValue:H});null===V.language&&(V.value=H);var G=zy(V,C,M,g,y,x,V.value.length+x,_,E);return t(c).createElement(P,j,t(c).createElement(O,h,!y&&z,I({rows:G,stylesheet:a,useInlineStyles:f})))}}function Hy(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=t(uy)(e);if(n){var o=t(uy)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(ay)(this,r)}}var Vy,Gy,Wy,qy,Ky,Jy,Qy,Yy=function(e,n){return function(){var r=t(ey)(t(hy).mark((function r(i){var o;return t(hy).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},Zy={abap:Yy("abap",(function(){return o("bwHpE")})),abnf:Yy("abnf",(function(){return o("daD87")})),actionscript:Yy("actionscript",(function(){return o("lpEgO")})),ada:Yy("ada",(function(){return o("1sGW9")})),agda:Yy("agda",(function(){return o("e9VyR")})),al:Yy("al",(function(){return o("kMFSe")})),antlr4:Yy("antlr4",(function(){return o("8HlsP")})),apacheconf:Yy("apacheconf",(function(){return o("isFCh")})),apex:Yy("apex",(function(){return o("gUXVM")})),apl:Yy("apl",(function(){return o("2L15v")})),applescript:Yy("applescript",(function(){return o("8XyFT")})),aql:Yy("aql",(function(){return o("gFWTI")})),arduino:Yy("arduino",(function(){return o("jI3VB")})),arff:Yy("arff",(function(){return o("6uYTH")})),asciidoc:Yy("asciidoc",(function(){return o("gdYKH")})),asm6502:Yy("asm6502",(function(){return o("ahFLg")})),asmatmel:Yy("asmatmel",(function(){return o("4irIu")})),aspnet:Yy("aspnet",(function(){return o("yDC6n")})),autohotkey:Yy("autohotkey",(function(){return o("a4xpy")})),autoit:Yy("autoit",(function(){return o("iNSix")})),avisynth:Yy("avisynth",(function(){return o("kEBnk")})),avroIdl:Yy("avroIdl",(function(){return o("lzthi")})),bash:Yy("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:Yy("basic",(function(){return o("cxDu6")})),batch:Yy("batch",(function(){return o("6zDll")})),bbcode:Yy("bbcode",(function(){return o("bPS87")})),bicep:Yy("bicep",(function(){return o("8dy5f")})),birb:Yy("birb",(function(){return o("3vHrY")})),bison:Yy("bison",(function(){return o("bCjBS")})),bnf:Yy("bnf",(function(){return o("4NqDW")})),brainfuck:Yy("brainfuck",(function(){return o("4s0KX")})),brightscript:Yy("brightscript",(function(){return o("jTsQ4")})),bro:Yy("bro",(function(){return o("5lMc2")})),bsl:Yy("bsl",(function(){return o("jBYxC")})),c:Yy("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:Yy("cfscript",(function(){return o("coZDy")})),chaiscript:Yy("chaiscript",(function(){return o("e1zEN")})),cil:Yy("cil",(function(){return o("crKoM")})),clike:Yy("clike",(function(){return o("4kO9t")})),clojure:Yy("clojure",(function(){return o("01SpB")})),cmake:Yy("cmake",(function(){return o("9yG4p")})),cobol:Yy("cobol",(function(){return o("967Hn")})),coffeescript:Yy("coffeescript",(function(){return o("7Yi6H")})),concurnas:Yy("concurnas",(function(){return o("5tXmX")})),coq:Yy("coq",(function(){return o("ektdr")})),cpp:Yy("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:Yy("crystal",(function(){return o("8gt4L")})),csharp:Yy("csharp",(function(){return o("7K6eJ")})),cshtml:Yy("cshtml",(function(){return o("cVu4i")})),csp:Yy("csp",(function(){return o("ecKo1")})),cssExtras:Yy("cssExtras",(function(){return o("gnpv8")})),css:Yy("css",(function(){return o("jx0H8")})),csv:Yy("csv",(function(){return o("f9kmW")})),cypher:Yy("cypher",(function(){return o("lojor")})),d:Yy("d",(function(){return o("6Qa0U")})),dart:Yy("dart",(function(){return o("74K1B")})),dataweave:Yy("dataweave",(function(){return o("93H6c")})),dax:Yy("dax",(function(){return o("cf9Y9")})),dhall:Yy("dhall",(function(){return o("f6UWv")})),diff:Yy("diff",(function(){return o("klPVo")})),django:Yy("django",(function(){return o("jfxe9")})),dnsZoneFile:Yy("dnsZoneFile",(function(){return o("5aMz5")})),docker:Yy("docker",(function(){return o("kOauC")})),dot:Yy("dot",(function(){return o("btE6k")})),ebnf:Yy("ebnf",(function(){return o("aT88c")})),editorconfig:Yy("editorconfig",(function(){return o("jWOl8")})),eiffel:Yy("eiffel",(function(){return o("kHJaX")})),ejs:Yy("ejs",(function(){return o("frfnA")})),elixir:Yy("elixir",(function(){return o("hcrJ2")})),elm:Yy("elm",(function(){return o("jd271")})),erb:Yy("erb",(function(){return o("gczXL")})),erlang:Yy("erlang",(function(){return o("FsabW")})),etlua:Yy("etlua",(function(){return o("9DI9l")})),excelFormula:Yy("excelFormula",(function(){return o("3QVue")})),factor:Yy("factor",(function(){return o("ltNCT")})),falselang:Yy("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:Yy("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:Yy("flow",(function(){return o("e5prn")})),fortran:Yy("fortran",(function(){return o("gIEL6")})),fsharp:Yy("fsharp",(function(){return o("3wQkt")})),ftl:Yy("ftl",(function(){return o("7ZVWs")})),gap:Yy("gap",(function(){return o("hOFj6")})),gcode:Yy("gcode",(function(){return o("95BzQ")})),gdscript:Yy("gdscript",(function(){return o("iul6t")})),gedcom:Yy("gedcom",(function(){return o("e0qJM")})),gherkin:Yy("gherkin",(function(){return o("2SHak")})),git:Yy("git",(function(){return o("l6VFH")})),glsl:Yy("glsl",(function(){return o("cEMfJ")})),gml:Yy("gml",(function(){return o("8UVTr")})),gn:Yy("gn",(function(){return o("kvibD")})),goModule:Yy("goModule",(function(){return o("icqjF")})),go:Yy("go",(function(){return o("jLkg8")})),graphql:Yy("graphql",(function(){return o("aYGNi")})),groovy:Yy("groovy",(function(){return o("4bTmH")})),haml:Yy("haml",(function(){return o("h2A6V")})),handlebars:Yy("handlebars",(function(){return o("79YVJ")})),haskell:Yy("haskell",(function(){return o("bsiLW")})),haxe:Yy("haxe",(function(){return o("94Kdj")})),hcl:Yy("hcl",(function(){return o("9CheR")})),hlsl:Yy("hlsl",(function(){return o("h3dqW")})),hoon:Yy("hoon",(function(){return o("9WbsW")})),hpkp:Yy("hpkp",(function(){return o("GiPN3")})),hsts:Yy("hsts",(function(){return o("eaSn9")})),http:Yy("http",(function(){return o("1uj7b")})),ichigojam:Yy("ichigojam",(function(){return o("ge562")})),icon:Yy("icon",(function(){return o("lVHUf")})),icuMessageFormat:Yy("icuMessageFormat",(function(){return o("aYoUL")})),idris:Yy("idris",(function(){return o("1RVAE")})),iecst:Yy("iecst",(function(){return o("bi7Dr")})),ignore:Yy("ignore",(function(){return o("cq0Pi")})),inform7:Yy("inform7",(function(){return o("31K4E")})),ini:Yy("ini",(function(){return o("l05OZ")})),io:Yy("io",(function(){return o("6bY1b")})),j:Yy("j",(function(){return o("1ebDS")})),java:Yy("java",(function(){return o("iEZZI")})),javadoc:Yy("javadoc",(function(){return o("aHy5a")})),javadoclike:Yy("javadoclike",(function(){return o("5f3rE")})),javascript:Yy("javascript",(function(){return o("7JDFI")})),javastacktrace:Yy("javastacktrace",(function(){return o("gdCGE")})),jexl:Yy("jexl",(function(){return o("cqMb9")})),jolie:Yy("jolie",(function(){return o("cEDX4")})),jq:Yy("jq",(function(){return o("kEWsh")})),jsExtras:Yy("jsExtras",(function(){return o("74PI8")})),jsTemplates:Yy("jsTemplates",(function(){return o("30TPr")})),jsdoc:Yy("jsdoc",(function(){return o("9DH5c")})),json:Yy("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:Yy("json5",(function(){return o("920rv")})),jsonp:Yy("jsonp",(function(){return o("9AwS1")})),jsstacktrace:Yy("jsstacktrace",(function(){return o("bYXMr")})),jsx:Yy("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:Yy("julia",(function(){return o("g0ibH")})),keepalived:Yy("keepalived",(function(){return o("2hdnH")})),keyman:Yy("keyman",(function(){return o("cIufI")})),kotlin:Yy("kotlin",(function(){return o("c26dU")})),kumir:Yy("kumir",(function(){return o("iYAha")})),kusto:Yy("kusto",(function(){return o("9z1oX")})),latex:Yy("latex",(function(){return o("lCPLU")})),latte:Yy("latte",(function(){return o("c9oN0")})),less:Yy("less",(function(){return o("hA3V9")})),lilypond:Yy("lilypond",(function(){return o("hpHTA")})),liquid:Yy("liquid",(function(){return o("kpZTm")})),lisp:Yy("lisp",(function(){return o("chgK5")})),livescript:Yy("livescript",(function(){return o("2gdiv")})),llvm:Yy("llvm",(function(){return o("jUeFO")})),log:Yy("log",(function(){return o("3BFSQ")})),lolcode:Yy("lolcode",(function(){return o("lG9br")})),lua:Yy("lua",(function(){return o("cVGpd")})),magma:Yy("magma",(function(){return o("4LVzY")})),makefile:Yy("makefile",(function(){return o("2NviD")})),markdown:Yy("markdown",(function(){return o("jUFCF")})),markupTemplating:Yy("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:Yy("markup",(function(){return o("5hIXu")})),matlab:Yy("matlab",(function(){return o("kPAC0")})),maxscript:Yy("maxscript",(function(){return o("gHOJy")})),mel:Yy("mel",(function(){return o("9mj6e")})),mermaid:Yy("mermaid",(function(){return o("kozw5")})),mizar:Yy("mizar",(function(){return o("2bN6W")})),mongodb:Yy("mongodb",(function(){return o("eHKWX")})),monkey:Yy("monkey",(function(){return o("7Fh0C")})),moonscript:Yy("moonscript",(function(){return o("hDXwC")})),n1ql:Yy("n1ql",(function(){return o("j9bkC")})),n4js:Yy("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:Yy("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:Yy("naniscript",(function(){return o("VxHk1")})),nasm:Yy("nasm",(function(){return o("ly95T")})),neon:Yy("neon",(function(){return o("7Fk34")})),nevod:Yy("nevod",(function(){return o("3U8Qv")})),nginx:Yy("nginx",(function(){return o("c6qVk")})),nim:Yy("nim",(function(){return o("1JdCk")})),nix:Yy("nix",(function(){return o("jcstS")})),nsis:Yy("nsis",(function(){return o("kEJqW")})),objectivec:Yy("objectivec",(function(){return o("lUP8A")})),ocaml:Yy("ocaml",(function(){return o("lhTAD")})),opencl:Yy("opencl",(function(){return o("8rxKO")})),openqasm:Yy("openqasm",(function(){return o("ib0uL")})),oz:Yy("oz",(function(){return o("csCUS")})),parigp:Yy("parigp",(function(){return o("2DkHE")})),parser:Yy("parser",(function(){return o("2cp75")})),pascal:Yy("pascal",(function(){return o("fViVl")})),pascaligo:Yy("pascaligo",(function(){return o("9Uuxa")})),pcaxis:Yy("pcaxis",(function(){return o("jUdnN")})),peoplecode:Yy("peoplecode",(function(){return o("l8w4e")})),perl:Yy("perl",(function(){return o("aX7dM")})),phpExtras:Yy("phpExtras",(function(){return o("3cMZl")})),php:Yy("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:Yy("phpdoc",(function(){return o("bDyJN")})),plsql:Yy("plsql",(function(){return o("cPuMN")})),powerquery:Yy("powerquery",(function(){return o("jE1gU")})),powershell:Yy("powershell",(function(){return o("k7t0j")})),processing:Yy("processing",(function(){return o("jr8hV")})),prolog:Yy("prolog",(function(){return o("hpuat")})),promql:Yy("promql",(function(){return o("ckXC5")})),properties:Yy("properties",(function(){return o("fAh6P")})),protobuf:Yy("protobuf",(function(){return o("R6WqB")})),psl:Yy("psl",(function(){return o("Al65w")})),pug:Yy("pug",(function(){return o("dxbNS")})),puppet:Yy("puppet",(function(){return o("lrSuh")})),pure:Yy("pure",(function(){return o("6DKQK")})),purebasic:Yy("purebasic",(function(){return o("7ZkSb")})),purescript:Yy("purescript",(function(){return o("dBTYx")})),python:Yy("python",(function(){return Promise.resolve(o("kiy5M"))})),q:Yy("q",(function(){return o("4FXyy")})),qml:Yy("qml",(function(){return o("2zZFj")})),qore:Yy("qore",(function(){return o("iCK1Y")})),qsharp:Yy("qsharp",(function(){return o("dvH9H")})),r:Yy("r",(function(){return o("lQqRt")})),racket:Yy("racket",(function(){return o("eHKmq")})),reason:Yy("reason",(function(){return o("kkeLT")})),regex:Yy("regex",(function(){return o("llX50")})),rego:Yy("rego",(function(){return o("9hKdZ")})),renpy:Yy("renpy",(function(){return o("cJgw5")})),rest:Yy("rest",(function(){return o("867DK")})),rip:Yy("rip",(function(){return o("3Odjx")})),roboconf:Yy("roboconf",(function(){return o("gQ0Us")})),robotframework:Yy("robotframework",(function(){return o("bLCgx")})),ruby:Yy("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:Yy("rust",(function(){return o("cInT8")})),sas:Yy("sas",(function(){return o("iz7eP")})),sass:Yy("sass",(function(){return o("hrDC3")})),scala:Yy("scala",(function(){return o("ub8Bf")})),scheme:Yy("scheme",(function(){return o("7NAAt")})),scss:Yy("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:Yy("shellSession",(function(){return o("7kKCv")})),smali:Yy("smali",(function(){return o("2lkCb")})),smalltalk:Yy("smalltalk",(function(){return o("4280y")})),smarty:Yy("smarty",(function(){return o("4hXYK")})),sml:Yy("sml",(function(){return o("jh2E8")})),solidity:Yy("solidity",(function(){return o("dTdF2")})),solutionFile:Yy("solutionFile",(function(){return o("iI5tm")})),soy:Yy("soy",(function(){return o("aoU5C")})),sparql:Yy("sparql",(function(){return o("ggrvb")})),splunkSpl:Yy("splunkSpl",(function(){return o("8LhCX")})),sqf:Yy("sqf",(function(){return o("3tDsu")})),sql:Yy("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:Yy("squirrel",(function(){return o("bxaUV")})),stan:Yy("stan",(function(){return o("dBqrq")})),stylus:Yy("stylus",(function(){return o("JlHVK")})),swift:Yy("swift",(function(){return o("c7NBs")})),systemd:Yy("systemd",(function(){return o("jprZl")})),t4Cs:Yy("t4Cs",(function(){return o("edsMI")})),t4Templating:Yy("t4Templating",(function(){return o("bS9Wa")})),t4Vb:Yy("t4Vb",(function(){return o("gYk20")})),tap:Yy("tap",(function(){return o("byv7d")})),tcl:Yy("tcl",(function(){return o("lUAIZ")})),textile:Yy("textile",(function(){return o("7J2LO")})),toml:Yy("toml",(function(){return o("eXtdM")})),tremor:Yy("tremor",(function(){return o("vyajH")})),tsx:Yy("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:Yy("tt2",(function(){return o("8XOOm")})),turtle:Yy("turtle",(function(){return o("1XvLQ")})),twig:Yy("twig",(function(){return o("i9Fpp")})),typescript:Yy("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:Yy("typoscript",(function(){return o("kKk69")})),unrealscript:Yy("unrealscript",(function(){return o("jgq8Y")})),uorazor:Yy("uorazor",(function(){return o("dsZ00")})),uri:Yy("uri",(function(){return o("fqJRp")})),v:Yy("v",(function(){return o("bgfyB")})),vala:Yy("vala",(function(){return o("68x4q")})),vbnet:Yy("vbnet",(function(){return o("eUhQs")})),velocity:Yy("velocity",(function(){return o("fPNdV")})),verilog:Yy("verilog",(function(){return o("2fM1V")})),vhdl:Yy("vhdl",(function(){return o("hNF6q")})),vim:Yy("vim",(function(){return o("75TCr")})),visualBasic:Yy("visualBasic",(function(){return o("fc93z")})),warpscript:Yy("warpscript",(function(){return o("jgHlG")})),wasm:Yy("wasm",(function(){return o("dVZkI")})),webIdl:Yy("webIdl",(function(){return o("9Jnxv")})),wiki:Yy("wiki",(function(){return o("1Gimo")})),wolfram:Yy("wolfram",(function(){return o("4SyRT")})),wren:Yy("wren",(function(){return o("gaIVs")})),xeora:Yy("xeora",(function(){return o("lagad")})),xmlDoc:Yy("xmlDoc",(function(){return o("9DNYE")})),xojo:Yy("xojo",(function(){return o("ksF4f")})),xquery:Yy("xquery",(function(){return o("gXxHJ")})),yaml:Yy("yaml",(function(){return o("6rk3j")})),yang:Yy("yang",(function(){return o("kTyrQ")})),zig:Yy("zig",(function(){return o("d3mFC")}))},Xy=(Gy=(Vy={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:Zy,registerLanguage:function(e,t,n){return e.register(n)}}).loader,Wy=Vy.isLanguageRegistered,qy=Vy.registerLanguage,Ky=Vy.languageLoaders,Jy=Vy.noAsyncLoadingLanguages,Qy=function(e){t(iy)(i,e);var n,r=Hy(i);function i(){return t(ee)(this,i),r.apply(this,arguments)}return t(te)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&Ky&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&Ky&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(ny)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(ey)(t(hy).mark((function e(n){var r;return t(hy).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=Ky[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof Ky[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=Gy().then((function(e){i.astGenerator=e,qy&&i.languages.forEach((function(t,n){return qy(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(X)(Qy,"astGenerator",null),t(X)(Qy,"highlightInstance",jy(null,{})),t(X)(Qy,"astGeneratorPromise",null),t(X)(Qy,"languages",new Map),t(X)(Qy,"supportedLanguages",Vy.supportedLanguages||Object.keys(Ky||{})),t(X)(Qy,"isRegistered",(function(e){if(Jy)return!0;if(!qy)throw new Error("Current syntax highlighter doesn't support registration of languages");return Qy.astGenerator?Wy(Qy.astGenerator,e):Qy.languages.has(e)})),t(X)(Qy,"registerLanguage",(function(e,t){if(!qy)throw new Error("Current syntax highlighter doesn't support registration of languages");if(Qy.astGenerator)return qy(Qy.astGenerator,e,t);Qy.languages.set(e,t)})),Qy),$y={},eb={};(eb=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,eb.default=eb,Object.defineProperty($y,"__esModule",{value:!0}),Object.defineProperty($y,"a11yDark",{enumerable:!0,get:function(){return cb.default}}),Object.defineProperty($y,"atomDark",{enumerable:!0,get:function(){return ub.default}}),Object.defineProperty($y,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return db.default}}),Object.defineProperty($y,"cb",{enumerable:!0,get:function(){return hb.default}}),Object.defineProperty($y,"coldarkCold",{enumerable:!0,get:function(){return pb.default}}),Object.defineProperty($y,"coldarkDark",{enumerable:!0,get:function(){return fb.default}}),Object.defineProperty($y,"coy",{enumerable:!0,get:function(){return tb.default}}),Object.defineProperty($y,"coyWithoutShadows",{enumerable:!0,get:function(){return mb.default}}),Object.defineProperty($y,"darcula",{enumerable:!0,get:function(){return gb.default}}),Object.defineProperty($y,"dark",{enumerable:!0,get:function(){return nb.default}}),Object.defineProperty($y,"dracula",{enumerable:!0,get:function(){return vb.default}}),Object.defineProperty($y,"duotoneDark",{enumerable:!0,get:function(){return yb.default}}),Object.defineProperty($y,"duotoneEarth",{enumerable:!0,get:function(){return bb.default}}),Object.defineProperty($y,"duotoneForest",{enumerable:!0,get:function(){return xb.default}}),Object.defineProperty($y,"duotoneLight",{enumerable:!0,get:function(){return Sb.default}}),Object.defineProperty($y,"duotoneSea",{enumerable:!0,get:function(){return wb.default}}),Object.defineProperty($y,"duotoneSpace",{enumerable:!0,get:function(){return _b.default}}),Object.defineProperty($y,"funky",{enumerable:!0,get:function(){return rb.default}}),Object.defineProperty($y,"ghcolors",{enumerable:!0,get:function(){return Cb.default}}),Object.defineProperty($y,"gruvboxDark",{enumerable:!0,get:function(){return Ab.default}}),Object.defineProperty($y,"gruvboxLight",{enumerable:!0,get:function(){return Eb.default}}),Object.defineProperty($y,"holiTheme",{enumerable:!0,get:function(){return Tb.default}}),Object.defineProperty($y,"hopscotch",{enumerable:!0,get:function(){return Mb.default}}),Object.defineProperty($y,"lucario",{enumerable:!0,get:function(){return Ib.default}}),Object.defineProperty($y,"materialDark",{enumerable:!0,get:function(){return Rb.default}}),Object.defineProperty($y,"materialLight",{enumerable:!0,get:function(){return Pb.default}}),Object.defineProperty($y,"materialOceanic",{enumerable:!0,get:function(){return kb.default}}),Object.defineProperty($y,"nightOwl",{enumerable:!0,get:function(){return Ob.default}}),Object.defineProperty($y,"nord",{enumerable:!0,get:function(){return Nb.default}}),Object.defineProperty($y,"okaidia",{enumerable:!0,get:function(){return ib.default}}),Object.defineProperty($y,"oneDark",{enumerable:!0,get:function(){return Lb.default}}),Object.defineProperty($y,"oneLight",{enumerable:!0,get:function(){return Db.default}}),Object.defineProperty($y,"pojoaque",{enumerable:!0,get:function(){return Bb.default}}),Object.defineProperty($y,"prism",{enumerable:!0,get:function(){return lb.default}}),Object.defineProperty($y,"shadesOfPurple",{enumerable:!0,get:function(){return zb.default}}),Object.defineProperty($y,"solarizedDarkAtom",{enumerable:!0,get:function(){return Fb.default}}),Object.defineProperty($y,"solarizedlight",{enumerable:!0,get:function(){return ob.default}}),Object.defineProperty($y,"synthwave84",{enumerable:!0,get:function(){return Ub.default}}),Object.defineProperty($y,"tomorrow",{enumerable:!0,get:function(){return sb.default}}),Object.defineProperty($y,"twilight",{enumerable:!0,get:function(){return ab.default}}),Object.defineProperty($y,"vs",{enumerable:!0,get:function(){return jb.default}}),Object.defineProperty($y,"vscDarkPlus",{enumerable:!0,get:function(){return Hb.default}}),Object.defineProperty($y,"xonokai",{enumerable:!0,get:function(){return Vb.default}}),Object.defineProperty($y,"zTouch",{enumerable:!0,get:function(){return Gb.default}});var tb=eb(o("jcF8U")),nb=eb(o("3Tppx")),rb=eb(o("dBuK7")),ib=eb(o("eEjWK")),ob=eb(o("awG2g")),sb=eb(o("2oFzQ")),ab=eb(o("4Au6Q")),lb=eb(o("dAPqs")),cb=eb(o("8eAql")),ub=eb(o("cv2QE")),db=eb(o("h5I9g")),hb=eb(o("i4C5w")),pb=eb(o("3kFKo")),fb=eb(o("17zK0")),mb=eb(o("5Avqr")),gb=eb(o("1jHMv")),vb=eb(o("7Q8CE")),yb=eb(o("jKUos")),bb=eb(o("Uzm4J")),xb=eb(o("7yfkN")),Sb=eb(o("lT2l1")),wb=eb(o("fZ9um")),_b=eb(o("1MoQL")),Cb=eb(o("4uys7")),Ab=eb(o("kaYsk")),Eb=eb(o("kN6Vu")),Tb=eb(o("2Z6pG")),Mb=eb(o("4jQJK")),Ib=eb(o("bpXw0")),Rb=eb(o("i4S8s")),Pb=eb(o("5bNr4")),kb=eb(o("5ZYWT")),Ob=eb(o("ihJCU")),Nb=eb(o("8iIbg")),Lb=eb(o("424u7")),Db=eb(o("jPiNI")),Bb=eb(o("OHVOA")),zb=eb(o("2OKTL")),Fb=eb(o("2Mg8H")),Ub=eb(o("9Kud0")),jb=eb(o("eCrmR")),Hb=eb(o("8UhcQ")),Vb=eb(o("dtU9z")),Gb=eb(o("4xtLO")),Wb={};Object.defineProperty(Wb,"__esModule",{value:!0}),Wb.default=void 0;var qb=eb(o("7cTnl")).default;Wb.default=qb;var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0}),Kb.default=void 0;var Jb=eb(o("l1Rj1")).default;Kb.default=Jb;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0}),Qb.default=void 0;var Yb=eb(o("fU6a0")).default;Qb.default=Yb;var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0}),Zb.default=void 0;var Xb=eb(o("3aDLI")).default;Zb.default=Xb;var $b={};Object.defineProperty($b,"__esModule",{value:!0}),$b.default=void 0;var ex=eb(o("kiy5M")).default;$b.default=ex;var tx={};Object.defineProperty(tx,"__esModule",{value:!0}),tx.default=void 0;var nx=eb(o("lR39A")).default;tx.default=nx;var rx={};Object.defineProperty(rx,"__esModule",{value:!0}),rx.default=void 0;var ix=eb(o("5li5P")).default;rx.default=ix;var ox={};Object.defineProperty(ox,"__esModule",{value:!0}),ox.default=void 0;var sx=eb(o("ch1PX")).default;ox.default=sx;var ax={};Object.defineProperty(ax,"__esModule",{value:!0}),ax.default=void 0;var lx=eb(o("bnDV9")).default;ax.default=lx,Xy.registerLanguage("tsx",t(Wb)),Xy.registerLanguage("json",t(Kb)),Xy.registerLanguage("scss",t(Qb)),Xy.registerLanguage("bash",t(Zb)),Xy.registerLanguage("python",t($b)),Xy.registerLanguage("cpp",t(tx)),Xy.registerLanguage("php",t(rx)),Xy.registerLanguage("ruby",t(ox)),Xy.registerLanguage("sql",t(ax));var cx=({medium:e,className:t,preview:n=!1,showLineNumbers:r=!0,showCopyButton:i=!0})=>{var o,a,l,c;const{t:u}=Se();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(Xy,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:$y.atomDark,showLineNumbers:r,language:null!==(a=null===(o=Xv.find((t=>e.mimeType===t.mimeType)))||void 0===o?void 0:o.lang)&&void 0!==a?a:"text",children:(null===(l=e.content)||void 0===l?void 0:l.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),i&&(0,s.jsx)(Sf,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:u("copy")||"Copy",icon:(0,s.jsx)(Wv,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(c=e.title)||void 0===c?void 0:c.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};c=o("85Hg2"),c=o("85Hg2");var ux,dx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),hx={};ux=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,h=a,p=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(h++,p=i.height,h===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:p,rowsWrapped:h})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:p,rowsWrapped:h}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var h=d.innerHTML.split(a.delimiter);d.innerHTML="";var p=window.getComputedStyle(d);h.reduce(n,{el:d,buffer:d.innerHTML,elStyle:p,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],ux):ux(hx);var px=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(ws)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(xf,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const fx=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[h,p]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==h?void 0:h.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://aisuru.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{p(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==h?void 0:h.title,g=null==h?void 0:h.description,v=null==h?void 0:h.video,y=null!==(u=null==h?void 0:h.image)&&void 0!==u?u:null===(d=null==h?void 0:h.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,hx.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(ws)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(px,{hoverable:!0,className:t(ws)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y.startsWith("https")?y:`https://${y.replace("http://","")}`,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(dx,{className:"memori-link-item--icon"})}),title:m,description:g})})};var mx=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(np,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(np.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(fx,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const gx=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],vx=async(e,t,n,r)=>{var i;let o=(e=>e.replaceAll(/<output.*?>(.*?)<\/output>/g,""))(e);const s=gx.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),a=await fetch(`${r||"https://www.aisuru.com"}/api/translate?text=${encodeURIComponent(o)}&target_lang=${t.toUpperCase()}${s?`&source_lang=${s}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),l=await a.json();return null===(i=null==l?void 0:l.translations)||void 0===i?void 0:i[0]};c=o("85Hg2");var yx=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var bx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var xx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var Sx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var wx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const _x=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{var u,d;const h=gv({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),p=null==c?void 0:c(t.mimeType);if(p)return p;const f=(null===(u=t.url)||void 0===u?void 0:u.startsWith("rgb("))||(null===(d=t.url)||void 0===d?void 0:d.startsWith("rgba("));switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return f?(0,s.jsx)(px,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[(0,s.jsx)("div",{className:"memori-media-item--rgb-item",style:{backgroundColor:t.url}}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})}):(0,s.jsx)("a",{className:"memori-media-item--link",href:t.url,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&(0,s.jsx)("source",{srcSet:[h,t.url,t.content].join(", "),type:t.mimeType}),(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(wx,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(Sx,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(xx,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/quicktime":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsxs)("video",{style:{width:"100%",height:"100%"},controls:!0,src:h,title:t.title,children:["video/quicktime"===t.mimeType&&(0,s.jsx)("source",{src:t.url,type:"video/mp4"}),(0,s.jsx)("source",{src:t.url,type:t.mimeType}),"Your browser does not support this video format.",(0,s.jsx)("br",{}),(0,s.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:"Download the video"})]}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:h}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(yx,{src:h,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(bx,{className:"memori-media-item--icon"}),title:t.title})})}};var Cx=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,h]=(0,c.useState)(),p=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await vx(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);(0,c.useEffect)((()=>{r&&p()}),[r,p]);const f=l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!Xv.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)),m=l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&Xv.map((e=>e.mimeType)).includes(e.mimeType)})),g=l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));return(0,s.jsxs)(np,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[!!f.length&&(0,s.jsx)("div",{className:"memori-media-items--grid",children:f.map(((e,r)=>(0,s.jsx)(np.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(_x,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{h(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),m.map((e=>(0,s.jsx)(np.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(cx,{medium:e},e.mediumID)},e.mediumID))),g.map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Km,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>h(void 0),footer:null,children:(0,s.jsx)(_x,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var Ax=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:h}=Se(),[p,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(Cx,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(mx,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(np,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(np.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Sf,{className:t(ws)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Sf,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:h("expand")||"Expand"})})]})]})}));const Ex=e=>e.endsWith("?")?e:`${e}?`;var Tx=({message:e,apiURL:n,sessionID:r,visible:i=!0,initialMatches:o=[],closeDrawer:a,_TEST_loading:l=!1})=>{const{t:u}=Se(),d=Y(n).search.searchMemory,[h,p]=(0,c.useState)(o),[f,m]=(0,c.useState)(l),g=(0,c.useCallback)((async()=>{if(m(!0),!l){try{const{matches:n,...i}=await d(r,{searchType:"Semantic",numberOfResults:3,text:e.questionAnswered,date:e.date,placeName:e.placeName,placeLatitude:e.placeLatitude,placeLongitude:e.placeLongitude,placeUncertaintyKm:e.placeUncertaintyKm,contextVars:e.contextVars,tag:e.tag,memoryTags:e.memoryTags});0!==i.resultCode?(console.error(i),t(Ju).error(u(Qv(i.resultCode)))):p(null!=n?n:[])}catch(e){console.error("WHYTHISANSWER/FETCH",e),p(null!=o?o:[])}m(!1)}}),[e,r]);return(0,c.useEffect)((()=>{g()}),[g,e,r]),(0,s.jsxs)(_f,{open:i,width:"80%",animated:!1,className:"memori-whythisanswer-drawer",onClose:()=>a(),title:u("whyThisAnswer"),children:[(0,s.jsx)("p",{children:u("whyThisAnswerHelper")}),e.questionAnswered&&(0,s.jsxs)("p",{className:"memori--whythisanswer-question-answered",children:[(0,s.jsxs)("strong",{children:[u("question")||"Question",":"]})," ",e.questionAnswered]}),(0,s.jsxs)(xf,{primary:!0,spinning:f,children:[!f&&0===h.length&&(0,s.jsx)("p",{role:"info",className:"memori--whythisanswer-no-results",children:u("nothingFound")}),f&&0===h.length&&(0,s.jsxs)("ul",{className:"memori--whythisanswer-list memori--whythisanswer-skeleton",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsx)("div",{className:"memori--whythisanswer-title-text",children:(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]}),(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})]})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]})]}),h.length>0&&(0,s.jsx)("ul",{className:"memori--whythisanswer-list",children:h.map((e=>{var t,n,r,i,o,a,l;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:e.confidenceLevel}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{children:(0,s.jsx)("strong",{children:Ex(null!==(t=e.memory.title)&&void 0!==t?t:"")})}),(0,s.jsx)("p",{children:null===(r=null===(n=e.memory.titleVariants)||void 0===n?void 0:n.map((e=>Ex(e))))||void 0===r?void 0:r.join(" | ")})]})]}),null===(i=e.memory.answers)||void 0===i?void 0:i.map(((e,t)=>(0,s.jsx)("p",{className:"memori--whythisanswer-answer",children:(0,s.jsx)(Kv,{rows:3,children:e.text})},t))),(0,s.jsx)(Ax,{links:null===(o=e.memory.media)||void 0===o?void 0:o.filter((e=>"text/html"===e.mimeType))}),null===(l=null===(a=e.memory.media)||void 0===a?void 0:a.filter((e=>"text/plain"===e.mimeType)))||void 0===l?void 0:l.map((e=>(0,s.jsx)(Kv,{rows:2,lineHeightMultiplier:2,innerClassName:"memori--whythisanswer-snippet-expandable",children:(0,s.jsx)(cx,{medium:e,showCopyButton:!1,showLineNumbers:!1},e.mediumID)},e.mediumID)))]},e.memory.memoryID)}))})]})]})},Mx={};Mx=function(){"use strict";var e=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=/[\0-\x1F\x7F-\x9F]/,n=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,r=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;function i(i){const o={};i=i||{},o.src_Any=e.source,o.src_Cc=t.source,o.src_Z=r.source,o.src_P=n.source,o.src_ZPCc=[o.src_Z,o.src_P,o.src_Cc].join("|"),o.src_ZCc=[o.src_Z,o.src_Cc].join("|");const s="[><|]";return o.src_pseudo_letter="(?:(?!"+s+"|"+o.src_ZPCc+")"+o.src_Any+")",o.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",o.src_auth="(?:(?:(?!"+o.src_ZCc+"|[@/\\[\\]()]).)+@)?",o.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",o.src_host_terminator="(?=$|"+s+"|"+o.src_ZPCc+")(?!"+(i["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+o.src_ZPCc+"))",o.src_path="(?:[/?#](?:(?!"+o.src_ZCc+"|"+s+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+o.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+o.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+o.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+o.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+o.src_ZCc+"|[']).)+\\'|\\'(?="+o.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+o.src_ZCc+"|[.]|$)|"+(i["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+o.src_ZCc+"|$)|;(?!"+o.src_ZCc+"|$)|\\!+(?!"+o.src_ZCc+"|[!]|$)|\\?(?!"+o.src_ZCc+"|[?]|$))+|\\/)?",o.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',o.src_xn="xn--[a-z0-9\\-]{1,59}",o.src_domain_root="(?:"+o.src_xn+"|"+o.src_pseudo_letter+"{1,63})",o.src_domain="(?:"+o.src_xn+"|(?:"+o.src_pseudo_letter+")|(?:"+o.src_pseudo_letter+"(?:-|"+o.src_pseudo_letter+"){0,61}"+o.src_pseudo_letter+"))",o.src_host="(?:(?:(?:(?:"+o.src_domain+")\\.)*"+o.src_domain+"))",o.tpl_host_fuzzy="(?:"+o.src_ip4+"|(?:(?:(?:"+o.src_domain+")\\.)+(?:%TLDS%)))",o.tpl_host_no_ip_fuzzy="(?:(?:(?:"+o.src_domain+")\\.)+(?:%TLDS%))",o.src_host_strict=o.src_host+o.src_host_terminator,o.tpl_host_fuzzy_strict=o.tpl_host_fuzzy+o.src_host_terminator,o.src_host_port_strict=o.src_host+o.src_port+o.src_host_terminator,o.tpl_host_port_fuzzy_strict=o.tpl_host_fuzzy+o.src_port+o.src_host_terminator,o.tpl_host_port_no_ip_fuzzy_strict=o.tpl_host_no_ip_fuzzy+o.src_port+o.src_host_terminator,o.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+o.src_ZPCc+"|>|$))",o.tpl_email_fuzzy="(^|"+s+'|"|\\(|'+o.src_ZCc+")("+o.src_email_name+"@"+o.tpl_host_fuzzy_strict+")",o.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+o.src_ZPCc+"))((?![$+<=>^`||])"+o.tpl_host_port_fuzzy_strict+o.src_path+")",o.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+o.src_ZPCc+"))((?![$+<=>^`||])"+o.tpl_host_port_no_ip_fuzzy_strict+o.src_path+")",o}function o(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function s(e){return Object.prototype.toString.call(e)}function a(e){return"[object String]"===s(e)}function l(e){return"[object Object]"===s(e)}function c(e){return"[object RegExp]"===s(e)}function u(e){return"[object Function]"===s(e)}function d(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const h={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function p(e){return Object.keys(e||{}).reduce((function(e,t){return e||h.hasOwnProperty(t)}),!1)}const f={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},m="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",g="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function v(e){e.__index__=-1,e.__text_cache__=""}function y(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function b(){return function(e,t){t.normalize(e)}}function x(e){const t=e.re=i(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push(m),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const o=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){const n=e.__schemas__[t];if(null===n)return;const r={validate:null,link:null};if(e.__compiled__[t]=r,l(n))return c(n.validate)?r.validate=y(n.validate):u(n.validate)?r.validate=n.validate:s(t,n),void(u(n.normalize)?r.normalize=n.normalize:n.normalize?s(t,n):r.normalize=b());a(n)?o.push(t):s(t,n)})),o.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:b()};const h=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(d).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+h+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+h+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),v(e)}function S(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function w(e,t){const n=new S(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function _(e,t){if(!(this instanceof _))return new _(e,t);t||p(e)&&(t=e,e={}),this.__opts__=o({},h,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=o({},f,e),this.__compiled__={},this.__tlds__=g,this.__tlds_replaced__=!1,this.re={},x(this)}function C(e={},t={}){const n=new _(e,t);return E(n,t),{extensions:[{name:"autolink",level:"inline",start:e=>{const t=A(n,e);if(t)return t.index},tokenizer(e){if(this.lexer.state.inLink)return;const t=A(n,e);if(!t)return;let r;return 0===t.index?r=t.raw:1===t.index&&"<"===e.charAt(0)&&">"===e.charAt(t.lastIndex)&&(r=`<${t.raw}>`),r?{type:"link",raw:r,text:t.text,href:t.url,tokens:[{type:"text",raw:t.text,text:t.text}]}:void 0}}]}}function A(e,t){const n=e.match(t);if(n&&n.length)return n[0]}function E(e,t){const n=t.tlds;delete t.tlds;const r=t.tldsKeepOld;delete t.tldsKeepOld,n&&e.tlds(n,r)}return _.prototype.add=function(e,t){return this.__schemas__[e]=t,x(this),this},_.prototype.set=function(e){return this.__opts__=o(this.__opts__,e),this},_.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,o,s,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(i=this.testSchemaAt(e,t[2],a.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=s))),this.__index__>=0},_.prototype.pretest=function(e){return this.re.pretest.test(e)},_.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},_.prototype.match=function(e){const t=[];let n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(w(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(w(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},_.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,w(this,0)):null},_.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),x(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,x(this),this)},_.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},_.prototype.onCompile=function(){},C}();var Ix={};Ix=function(e){"use strict";const t=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/,n=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function r(e={}){return{extensions:[o(e,i(e,!1)),s(e,i(e,!0))]}}function i(t,n){return r=>e.renderToString(r.text,{...t,displayMode:r.displayMode})+(n?"\n":"")}function o(e,n){return{name:"inlineKatex",level:"inline",start(e){let n,r=e;for(;r;){if(n=r.indexOf("$"),-1===n)return;if((0===n||" "===r.charAt(n-1))&&r.substring(n).match(t))return n;r=r.substring(n+1).replace(/^\$+/,"")}},tokenizer(e,n){const r=e.match(t);if(r)return{type:"inlineKatex",raw:r[0],text:r[2].trim(),displayMode:2===r[1].length}},renderer:n}}function s(e,t){return{name:"blockKatex",level:"block",tokenizer(e,t){const r=e.match(n);if(r)return{type:"blockKatex",raw:r[0],text:r[2].trim(),displayMode:2===r[1].length}},renderer:t}}return r}(o("kqAxc"));const Rx=(e,t,n,r)=>{if(!t.rowspan)return"";return`${`<${n}`+(t.colspan>1?` colspan=${t.colspan}`:"")+(t.rowspan>1?` rowspan=${t.rowspan}`:"")+(r?` align=${r}`:"")+">"+e}</${n}>\n`},Px=(e,t,n=[])=>{var r,i,o;const s=[...e.matchAll(/(?:[^|\\]|\\.?)+(?:\|+|$)/g)].map((e=>e[0]));(null===(r=s[0])||void 0===r?void 0:r.trim())||s.shift(),(null===(i=s[s.length-1])||void 0===i?void 0:i.trim())||s.pop();let a,l,c,u,d,h=0;for(a=0;a<s.length;a++){if(c=s[a].split(/\|+$/)[0],s[a]={rowspan:1,colspan:Math.max(s[a].length-c.length,1),text:c.trim().replace(/\\\|/g,"|")},"^"===c.slice(-1)&&n.length)for(d=0,l=0;l<n.length;l++){if(u=n[l],d===h&&u.colspan===s[a].colspan){s[a].rowSpanTarget=null!==(o=u.rowSpanTarget)&&void 0!==o?o:u,s[a].rowSpanTarget.text+=` ${s[a].text.slice(0,-1)}`,s[a].rowSpanTarget.rowspan+=1,s[a].rowspan=0;break}if(d+=u.colspan,d>h)break}h+=s[a].colspan}if(h>t)s.splice(t);else for(;h<t;)s.push({colspan:1,text:""}),h+=1;return s};Hv.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=am(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}}),Hv.marked.use(t(Mx)()),Hv.marked.use(t(Ix)({throwOnError:!0,output:"htmlAndMathml"})),Hv.marked.use({extensions:[{name:"spanTable",level:"block",start(e){var t;return null===(t=e.match(/^\n *([^\n ].*\|.*)\n/))||void 0===t?void 0:t.index},tokenizer(e,t){const n=new RegExp("^ *([^\\n ].*\\|.*\\n(?: *[^\\s].*\\n)*?) {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n| {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)| {0,3}#{1,6} | {0,3}>| {4}[^\\n]| {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n| {0,3}(?:[*+-]|1[.)]) |<\\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?: +|\\n|\\/?>)|<(?:script|pre|style|textarea|!--)).*(?:\\n|$))*)\\n*|$)").exec(e);if(n){const e={type:"spanTable",header:n[1].replace(/\n$/,"").split("\n"),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]?n[3].replace(/\n$/,"").split("\n"):[]};e.header[0]=Px(e.header[0]);const t=e.header[0].reduce(((e,t)=>e+t.colspan),0);if(t===e.align.length){let r,i,o,s;e.raw=n[0];let a=e.align.length;for(r=0;r<a;r++)/^ *-+: *$/.test(e.align[r])?e.align[r]="right":/^ *:-+: *$/.test(e.align[r])?e.align[r]="center":/^ *:-+ *$/.test(e.align[r])?e.align[r]="left":e.align[r]=null;for(a=e.header.length,r=1;r<a;r++)e.header[r]=Px(e.header[r],t,e.header[r-1]);for(a=e.rows.length,r=0;r<a;r++)e.rows[r]=Px(e.rows[r],t,e.rows[r-1]);for(a=e.header.length,i=0;i<a;i++)for(s=e.header[i],o=0;o<s.length;o++)s[o].tokens=[],this.lexer.inline(s[o].text,s[o].tokens);for(a=e.rows.length,i=0;i<a;i++)for(s=e.rows[i],o=0;o<s.length;o++)s[o].tokens=[],this.lexer.inline(s[o].text,s[o].tokens);return e}}},renderer(e){let t,n,r,i,o,s,a='<div class="memori--responsive-table-wrapper"><table class="memori--table memori--table--compact">';for(a+="<thead>",t=0;t<e.header.length;t++){r=e.header[t];let o=0;for(a+="<tr>",n=0;n<r.length;n++)i=r[n],s=this.parser.parseInline(i.tokens),a+=Rx(s,i,"th",e.align[o]),o+=i.colspan;a+="</tr>"}if(a+="</thead>",e.rows.length){for(a+="<tbody>",t=0;t<e.rows.length;t++){for(r=e.rows[t],o=0,a+="<tr>",n=0;n<r.length;n++)i=r[n],s=this.parser.parseInline(i.tokens),a+=Rx(s,i,"td",e.align[o]),o+=i.colspan;a+="</tr>"}a+="</tbody>"}return a+="</table></div>",a}}]});var kx=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,sessionID:a,showFeedback:l,showWhyThisAnswer:u=!0,showCopyButton:d=!0,showTranslationOriginal:h=!1,simulateUserPrompt:p,showAIicon:f=!0,isFirst:m=!1,user:g,userAvatar:v,experts:y})=>{var b,x,S,w,_,C;const{t:A,i18n:E}=Se(),T=E.language||"en",[M,I]=(0,c.useState)(!1),R=e.translatedText||e.text,P=e.fromUser?R:t(Vv).sanitize(Hv.marked.parse(R.trim().replaceAll(/\[([^\]]+)\]\(([^\)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replaceAll(/```markdown([^```]+)```/g,"$1").replaceAll(/(?<!\\)\(/g,"\\(").replaceAll(/(?<!\\)\)/g,"\\)")).trim().replace(/\n/g,"<br>"),{ADD_ATTR:["target"]}).replaceAll(/(?<!\\)\[/g,"\\[").replaceAll(/(?<!\\)\]/g,"\\]").replace(/(<br>)+/g,"<br>").replace(/<p><\/p>/g,"<br>").replace(/<p><br><\/p>/g,"<br>"),k=e.fromUser?R:sm(om(im(R)));return(0,c.useLayoutEffect)((()=>{"undefined"==typeof window||e.fromUser||"MathJax"in window&&window.MathJax.typesetPromise&&window.MathJax.typesetPromise([".memori-chat--bubble-content"])}),[e.text,e.fromUser]),(0,s.jsxs)(s.Fragment,{children:[(e.initial||m)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(np,{show:!0,appear:!0,as:"div",className:t(ws)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&f||l&&p}),children:[!e.fromUser&&(0,s.jsx)(np.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(b=e.emitter)||void 0===b?void 0:b.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(x=e.emitter)||void 0===x?void 0:x.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(S=e.emitter)||void 0===S?void 0:S.length)&&n.enableBoardOfExperts&&(null==y?void 0:y.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(w=y.find((t=>t.name===e.emitter)))||void 0===w?void 0:w.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?gv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):gv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://www.aisuru.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?gv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):gv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(np.Child,{as:"div",className:t(ws)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":!e.fromUser&&d||e.generatedByAI&&f||l&&p,"memori-chat--ai-generated":e.generatedByAI&&f,"memori-chat--with-feedback":l}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dir:"auto",className:"memori-chat--bubble-content",dangerouslySetInnerHTML:{__html:P}}),(!e.fromUser&&d||e.generatedByAI&&f||l&&p)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[!e.fromUser&&d&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:A("copy")||"Copy",className:"memori-chat--bubble-action-icon",icon:(0,s.jsx)(Wv,{"aria-label":A("copy")||"Copy"}),onClick:()=>navigator.clipboard.writeText(k)}),!e.fromUser&&d&&k!==e.text&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:A("copyRawCode")||"Copy raw code",className:"memori-chat--bubble-action-icon",icon:(0,s.jsx)(qv,{"aria-label":A("copyRawCode")||"Copy raw code"}),onClick:()=>navigator.clipboard.writeText(e.text)}),l&&!!p&&(0,s.jsx)(jv,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&p(e)}}),e.generatedByAI&&f&&(0,s.jsx)(xv,{align:"left",content:A("generatedByAI"),className:"memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai",children:(0,s.jsx)("span",{children:(0,s.jsx)(yv,{title:A("generatedByAI")||void 0})})}),h&&e.translatedText&&e.translatedText!==e.text&&(0,s.jsx)(xv,{align:"left",content:`${"it"===T?"Testo originale":"Original text"}: ${e.text}`,className:"memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai",children:(0,s.jsx)("span",{children:(0,s.jsx)(bv,{"aria-label":"it"===T?"Testo originale":"Original text"})})}),!e.fromUser&&e.questionAnswered&&o&&u&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:A("whyThisAnswer")||void 0,className:"memori-chat--bubble-action-icon",onClick:()=>I(!0),disabled:M,icon:(0,s.jsx)(Gv,{title:A("whyThisAnswer")||void 0})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:v&&"string"==typeof v||!v&&(null===(_=null==g?void 0:g.avatarURL)||void 0===_?void 0:_.length)?(0,s.jsx)(np.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(C=null==g?void 0:g.userName)&&void 0!==C?C:"User",src:null!=v?v:null==g?void 0:g.avatarURL})}):v?(0,s.jsx)(np.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:v}):(0,s.jsx)(np.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(vv,{})})})]}),M&&o&&(0,s.jsx)(Tx,{visible:M,message:e,closeDrawer:()=>I(!1),apiURL:o,sessionID:a})]})};c=o("85Hg2");var Ox=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var Nx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var Lx=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=Se(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(ws)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Sf,{className:t(ws)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(Nx,{}):(0,s.jsx)(Ox,{})})})]})})};var Dx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var Bx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var zx=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=Se(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},h=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>h()),[]),(0,s.jsx)(xv,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Sf,{primary:!0,className:t(ws)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:h,onTouchEnd:h,shape:"circle",icon:(0,s.jsx)(Bx,{})})})};var Fx=({dialogState:e,userMessage:n="",onChangeUserMessage:r,sendMessage:i,onTextareaFocus:o,onTextareaBlur:a,onTextareaPressEnter:l,showMicrophone:c=!1,microphoneMode:u="HOLD_TO_TALK",listening:d=!1,stopAudio:h,startListening:p,stopListening:f})=>{const{t:m}=Se();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)(Lx,{value:n,onChange:r,onPressEnter:l,onFocus:o,onBlur:a,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Sf,{shape:"circle",primary:!!(null==n?void 0:n.length),disabled:!n||0===n.length,className:"memori-chat-inputs--send",onClick:()=>{i(n),h(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:m("send")||"Send",icon:(0,s.jsx)(Dx,{})}),c&&"HOLD_TO_TALK"===u&&(0,s.jsx)(zx,{listening:d,startListening:p,stopListening:()=>{f(),(null==n?void 0:n.length)&&i(n)},stopAudio:h}),c&&"CONTINUOUS"===u&&(0,s.jsx)(Sf,{primary:!0,className:t(ws)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":d}),title:d?m("write_and_speak.micButtonPopoverListening")||"Listening":m("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{d?f():(h(),p())},shape:"circle",icon:(0,s.jsx)(Bx,{})})]})};c=o("85Hg2");const Ux={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},jx=(e=3)=>new Array(20*e).fill(" ").join("");var Hx=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${jx(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${jx()}`:""),[d,h]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)h((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${jx(n.delayAfter)}`),h(""),a(e)}else if(!r&&!n&&e){const e=Ux[t][Math.floor(Math.random()*Ux[t].length)];u(`${e.text}${jx(e.delayAfter)}`),h("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var Vx=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:h=[],authToken:p,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,showWhyThisAnswer:b=!0,showCopyButton:x=!0,showTranslationOriginal:S=!1,selectReceiverTag:w,preview:_=!1,instruct:C=!1,showInputs:A=!0,showMicrophone:E=!1,microphoneMode:T="HOLD_TO_TALK",sendOnEnter:M,setSendOnEnter:I,attachmentsMenuOpen:R,setAttachmentsMenuOpen:P,userMessage:k="",onChangeUserMessage:O,sendMessage:N,listening:L,isPlayingAudio:D,stopAudio:B,startListening:z,stopListening:F,resetTranscript:U,customMediaRenderer:j,user:H,userAvatar:V,experts:G})=>{var W,q,K,J,Q,Y,Z,X;const $=()=>{setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),200)};(0,c.useEffect)((()=>{!_&&$()}),[h,_]);return(0,s.jsxs)("div",{className:t(ws)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(J=null===(K=null===(q=null===(W=e.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0])||void 0===K?void 0:K.toUpperCase())&&void 0!==J?J:"EN",children:[(0,s.jsx)("div",{className:t(ws)("memori-chat--history",{"memori-chat--history-touch":Zf()}),children:(0,s.jsxs)("div",{className:t(ws)("memori-chat--content",{"memori-chat--content-touch":Zf()}),children:[(0,s.jsx)("div",{className:t(ws)("memori-chat--cover"),style:{backgroundImage:`url("${gv({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${gv({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://www.aisuru.com",apiURL:o})}")`}}),h.map(((l,u)=>{var d,p,w,_;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(kx,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,sessionID:r,simulateUserPrompt:m,showAIicon:y,showWhyThisAnswer:b,showTranslationOriginal:S,showFeedback:u===h.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:H,userAvatar:V,experts:G,showCopyButton:x}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(p=l.contextVars)&&void 0!==p?p:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(Ax,{simulateUserPrompt:m,media:null===(w=null==l?void 0:l.media)||void 0===w?void 0:w.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(_=null==l?void 0:l.media)||void 0===_?void 0:_.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:j})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&!l&&(0,s.jsx)(Ax,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(Hx,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(Z=null===(Y=null===(Q=e.culture)||void 0===Q?void 0:Q.split("-"))||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?$v:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(X=f.knownTags)&&void 0!==X?X:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Sf,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>w(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),A&&(0,s.jsx)(Fx,{userMessage:k,onChangeUserMessage:O,dialogState:f,instruct:C,authToken:p,sendMessage:N,microphoneMode:T,sendOnEnter:M,setSendOnEnter:I,attachmentsMenuOpen:R,setAttachmentsMenuOpen:P,onTextareaPressEnter:()=>{"keypress"===M&&(null==k?void 0:k.length)>0&&(F(),N(k),O(""),U())},onTextareaFocus:()=>{var e,t,n,r;F(),Zf()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{$()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),$())},startListening:z,stopListening:F,stopAudio:B,listening:L,isPlayingAudio:D,showMicrophone:E})]})}));c=o("85Hg2");var Gx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var Wx=({memoriName:e,blockedUntil:t,notEnoughCredits:n=!1,showGiverInfo:r=!1,showTitle:i=!1,marginLeft:o=!1})=>{const{t:a}=Se(),l=new Date(t||Date.now());return n||l>new Date(Date.now())?(0,s.jsx)(xv,{className:"blocked-memori-badge--tooltip",content:n?(0,s.jsx)(s.Fragment,{children:a("notEnoughCredits")}):(0,s.jsxs)(s.Fragment,{children:[!r&&a("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(l)}),r&&a("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(l)}),r&&` ${a("memoriBlockedReasonExceedChats")}`,r&&(0,s.jsx)("br",{}),r&&`\n${a("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(o?" margin-left":""),children:(0,s.jsx)(Gx,{className:"blocked-memori-badge--icon"})}),i&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:a("memoriBlockedTitle")})]})}):null};var qx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var Kx=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var Jx=({forceStatus:e,provider:t})=>{var n;const{t:r}=Se(),[i,o]=(0,c.useState)(null!=e?e:"operational"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json"),n=null===(e=(await t.json()).components.find((e=>"API"===e.name)))||void 0===e?void 0:e.status;return null!=n?n:"operational"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"operational",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e))).catch(console.log)}),[e,t]),"operational"!==i?(0,s.jsx)(xv,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(Gx,{className:"memori--completion-provider-status--icon"})}):null};var Qx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{fill:"currentColor",d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"})});var Yx=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,instruct:h=!1,clickedStart:p,onClickStart:f,initializeTTS:m,_TEST_forceProviderStatus:g,isUserLoggedIn:v=!1,user:y,showLogin:b=!1,setShowLoginDrawer:x,notEnoughCredits:S=!1,isMultilanguageEnabled:w})=>{var _,C;const{t:A,i18n:E}=Se(),[T,M]=(0,c.useState)(e.description),[I,R]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=E.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&vx(e.description,null!==(l=null===(s=E.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{M(e.text)})).catch(console.error)}),[E.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${gv({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${gv({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(_=null==n?void 0:n.badge)||void 0===_?void 0:_.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(xv,{align:"left",content:`${A("gamification.level")} ${n.badge}, ${n.points} ${A("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${A("gamification.level")} ${n.badge}, ${n.points} ${A("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(xv,{align:"left",content:A("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":A("completionsEnabled")||"Completions",children:(0,s.jsx)(yv,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(xv,{align:"left",content:A("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":A("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(qx,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(xv,{align:"left",content:A("nsfw"),children:(0,s.jsx)("span",{title:A("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(C=e.avatarURL)&&void 0!==C?C:gv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?gv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):gv({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:A("write_and_speak.requirePositionHelp",{name:e.name})}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>d(),className:"memori--start-button",icon:(0,s.jsx)(Qx,{}),children:A("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:T&&I?T:e.description}),T!==e.description&&(0,s.jsx)(Sf,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(bv,{}),onClick:()=>{R((e=>!e))},children:A(I?"showOriginalText":"showTranslatedText")})]}),w&&!h&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:A("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:E.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:Yv.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Sf,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver||S,loading:p,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}m&&m(),f&&f()},className:"memori--start-button",children:A("write_and_speak."+(h?"instructButton":"tryMeButton"))}),(0,s.jsx)(Jx,{provider:e.completionProvider,forceStatus:g}),(0,s.jsx)("p",{className:"memori--start-description",children:A(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),(e.blockedUntil||S)&&(0,s.jsx)(Wx,{memoriName:e.name,blockedUntil:e.blockedUntil,notEnoughCredits:S,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!h&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(xv,{align:"left",content:A("deepThoughtHelper"),children:(0,s.jsx)(Kx,{})}),(0,s.jsx)("h2",{children:v&&(null==y?void 0:y.pAndCUAccepted)?A("deepThoughtDisclaimerTitle"):A("deepThought")}),v&&!(null==y?void 0:y.pAndCUAccepted)&&(0,s.jsx)("p",{children:A("deepThoughtPreDisclaimerNotAllowed")}),!v&&(0,s.jsx)("p",{children:A("deepThoughtPreDisclaimerUnlogged")}),!v&&b&&(0,s.jsx)("p",{children:(0,s.jsx)(Sf,{outlined:!0,padded:!1,onClick:()=>x(!0),children:"Login"})}),(0,s.jsx)("p",{className:"memori--deep-thought-disclaimer-text",children:A("deepThoughtDisclaimer")})]})]})]})},Zx=(c=o("85Hg2"),c=o("85Hg2"),Z=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function Xx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $x(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Xx(Object(r),!0).forEach((function(n){t(X)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class eS extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var tS=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(fy)(i,Zx),a=Se(e,$x($x({},s),{},{keyPrefix:n.keyPrefix})),l=t(Z)(a,3),u=l[0],d=l[1],h=l[2],p=$x($x({},s),{},{t:u,i18n:d,tReady:h});return n.withRef&&o?p.ref=o:!n.withRef&&o&&(p.forwardedRef=o),(0,c.createElement)(r,p)}i.displayName="withI18nextTranslation(".concat(ve(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(eS),nS=(c=o("85Hg2"),c=o("85Hg2"),{});e(nS,"REVISION",(()=>rS)),e(nS,"MOUSE",(()=>iS)),e(nS,"TOUCH",(()=>oS)),e(nS,"CullFaceNone",(()=>sS)),e(nS,"CullFaceBack",(()=>aS)),e(nS,"CullFaceFront",(()=>lS)),e(nS,"CullFaceFrontBack",(()=>cS)),e(nS,"BasicShadowMap",(()=>uS)),e(nS,"PCFShadowMap",(()=>dS)),e(nS,"PCFSoftShadowMap",(()=>hS)),e(nS,"VSMShadowMap",(()=>pS)),e(nS,"FrontSide",(()=>fS)),e(nS,"BackSide",(()=>mS)),e(nS,"DoubleSide",(()=>gS)),e(nS,"NoBlending",(()=>vS)),e(nS,"NormalBlending",(()=>yS)),e(nS,"AdditiveBlending",(()=>bS)),e(nS,"SubtractiveBlending",(()=>xS)),e(nS,"MultiplyBlending",(()=>SS)),e(nS,"CustomBlending",(()=>wS)),e(nS,"AddEquation",(()=>_S)),e(nS,"SubtractEquation",(()=>CS)),e(nS,"ReverseSubtractEquation",(()=>AS)),e(nS,"MinEquation",(()=>ES)),e(nS,"MaxEquation",(()=>TS)),e(nS,"ZeroFactor",(()=>MS)),e(nS,"OneFactor",(()=>IS)),e(nS,"SrcColorFactor",(()=>RS)),e(nS,"OneMinusSrcColorFactor",(()=>PS)),e(nS,"SrcAlphaFactor",(()=>kS)),e(nS,"OneMinusSrcAlphaFactor",(()=>OS)),e(nS,"DstAlphaFactor",(()=>NS)),e(nS,"OneMinusDstAlphaFactor",(()=>LS)),e(nS,"DstColorFactor",(()=>DS)),e(nS,"OneMinusDstColorFactor",(()=>BS)),e(nS,"SrcAlphaSaturateFactor",(()=>zS)),e(nS,"NeverDepth",(()=>FS)),e(nS,"AlwaysDepth",(()=>US)),e(nS,"LessDepth",(()=>jS)),e(nS,"LessEqualDepth",(()=>HS)),e(nS,"EqualDepth",(()=>VS)),e(nS,"GreaterEqualDepth",(()=>GS)),e(nS,"GreaterDepth",(()=>WS)),e(nS,"NotEqualDepth",(()=>qS)),e(nS,"MultiplyOperation",(()=>KS)),e(nS,"MixOperation",(()=>JS)),e(nS,"AddOperation",(()=>QS)),e(nS,"NoToneMapping",(()=>YS)),e(nS,"LinearToneMapping",(()=>ZS)),e(nS,"ReinhardToneMapping",(()=>XS)),e(nS,"CineonToneMapping",(()=>$S)),e(nS,"ACESFilmicToneMapping",(()=>ew)),e(nS,"CustomToneMapping",(()=>tw)),e(nS,"UVMapping",(()=>nw)),e(nS,"CubeReflectionMapping",(()=>rw)),e(nS,"CubeRefractionMapping",(()=>iw)),e(nS,"EquirectangularReflectionMapping",(()=>ow)),e(nS,"EquirectangularRefractionMapping",(()=>sw)),e(nS,"CubeUVReflectionMapping",(()=>aw)),e(nS,"RepeatWrapping",(()=>lw)),e(nS,"ClampToEdgeWrapping",(()=>cw)),e(nS,"MirroredRepeatWrapping",(()=>uw)),e(nS,"NearestFilter",(()=>dw)),e(nS,"NearestMipmapNearestFilter",(()=>hw)),e(nS,"NearestMipMapNearestFilter",(()=>pw)),e(nS,"NearestMipmapLinearFilter",(()=>fw)),e(nS,"NearestMipMapLinearFilter",(()=>mw)),e(nS,"LinearFilter",(()=>gw)),e(nS,"LinearMipmapNearestFilter",(()=>vw)),e(nS,"LinearMipMapNearestFilter",(()=>yw)),e(nS,"LinearMipmapLinearFilter",(()=>bw)),e(nS,"LinearMipMapLinearFilter",(()=>xw)),e(nS,"UnsignedByteType",(()=>Sw)),e(nS,"ByteType",(()=>ww)),e(nS,"ShortType",(()=>_w)),e(nS,"UnsignedShortType",(()=>Cw)),e(nS,"IntType",(()=>Aw)),e(nS,"UnsignedIntType",(()=>Ew)),e(nS,"FloatType",(()=>Tw)),e(nS,"HalfFloatType",(()=>Mw)),e(nS,"UnsignedShort4444Type",(()=>Iw)),e(nS,"UnsignedShort5551Type",(()=>Rw)),e(nS,"UnsignedInt248Type",(()=>Pw)),e(nS,"AlphaFormat",(()=>kw)),e(nS,"RGBFormat",(()=>Ow)),e(nS,"RGBAFormat",(()=>Nw)),e(nS,"LuminanceFormat",(()=>Lw)),e(nS,"LuminanceAlphaFormat",(()=>Dw)),e(nS,"DepthFormat",(()=>Bw)),e(nS,"DepthStencilFormat",(()=>zw)),e(nS,"RedFormat",(()=>Fw)),e(nS,"RedIntegerFormat",(()=>Uw)),e(nS,"RGFormat",(()=>jw)),e(nS,"RGIntegerFormat",(()=>Hw)),e(nS,"RGBAIntegerFormat",(()=>Vw)),e(nS,"RGB_S3TC_DXT1_Format",(()=>Gw)),e(nS,"RGBA_S3TC_DXT1_Format",(()=>Ww)),e(nS,"RGBA_S3TC_DXT3_Format",(()=>qw)),e(nS,"RGBA_S3TC_DXT5_Format",(()=>Kw)),e(nS,"RGB_PVRTC_4BPPV1_Format",(()=>Jw)),e(nS,"RGB_PVRTC_2BPPV1_Format",(()=>Qw)),e(nS,"RGBA_PVRTC_4BPPV1_Format",(()=>Yw)),e(nS,"RGBA_PVRTC_2BPPV1_Format",(()=>Zw)),e(nS,"RGB_ETC1_Format",(()=>Xw)),e(nS,"RGB_ETC2_Format",(()=>$w)),e(nS,"RGBA_ETC2_EAC_Format",(()=>e_)),e(nS,"RGBA_ASTC_4x4_Format",(()=>t_)),e(nS,"RGBA_ASTC_5x4_Format",(()=>n_)),e(nS,"RGBA_ASTC_5x5_Format",(()=>r_)),e(nS,"RGBA_ASTC_6x5_Format",(()=>i_)),e(nS,"RGBA_ASTC_6x6_Format",(()=>o_)),e(nS,"RGBA_ASTC_8x5_Format",(()=>s_)),e(nS,"RGBA_ASTC_8x6_Format",(()=>a_)),e(nS,"RGBA_ASTC_8x8_Format",(()=>l_)),e(nS,"RGBA_ASTC_10x5_Format",(()=>c_)),e(nS,"RGBA_ASTC_10x6_Format",(()=>u_)),e(nS,"RGBA_ASTC_10x8_Format",(()=>d_)),e(nS,"RGBA_ASTC_10x10_Format",(()=>h_)),e(nS,"RGBA_ASTC_12x10_Format",(()=>p_)),e(nS,"RGBA_ASTC_12x12_Format",(()=>f_)),e(nS,"RGBA_BPTC_Format",(()=>m_)),e(nS,"LoopOnce",(()=>g_)),e(nS,"LoopRepeat",(()=>v_)),e(nS,"LoopPingPong",(()=>y_)),e(nS,"InterpolateDiscrete",(()=>b_)),e(nS,"InterpolateLinear",(()=>x_)),e(nS,"InterpolateSmooth",(()=>S_)),e(nS,"ZeroCurvatureEnding",(()=>w_)),e(nS,"ZeroSlopeEnding",(()=>__)),e(nS,"WrapAroundEnding",(()=>C_)),e(nS,"NormalAnimationBlendMode",(()=>A_)),e(nS,"AdditiveAnimationBlendMode",(()=>E_)),e(nS,"TrianglesDrawMode",(()=>T_)),e(nS,"TriangleStripDrawMode",(()=>M_)),e(nS,"TriangleFanDrawMode",(()=>I_)),e(nS,"LinearEncoding",(()=>R_)),e(nS,"sRGBEncoding",(()=>P_)),e(nS,"BasicDepthPacking",(()=>k_)),e(nS,"RGBADepthPacking",(()=>O_)),e(nS,"TangentSpaceNormalMap",(()=>N_)),e(nS,"ObjectSpaceNormalMap",(()=>L_)),e(nS,"NoColorSpace",(()=>D_)),e(nS,"SRGBColorSpace",(()=>B_)),e(nS,"LinearSRGBColorSpace",(()=>z_)),e(nS,"ZeroStencilOp",(()=>F_)),e(nS,"KeepStencilOp",(()=>U_)),e(nS,"ReplaceStencilOp",(()=>j_)),e(nS,"IncrementStencilOp",(()=>H_)),e(nS,"DecrementStencilOp",(()=>V_)),e(nS,"IncrementWrapStencilOp",(()=>G_)),e(nS,"DecrementWrapStencilOp",(()=>W_)),e(nS,"InvertStencilOp",(()=>q_)),e(nS,"NeverStencilFunc",(()=>K_)),e(nS,"LessStencilFunc",(()=>J_)),e(nS,"EqualStencilFunc",(()=>Q_)),e(nS,"LessEqualStencilFunc",(()=>Y_)),e(nS,"GreaterStencilFunc",(()=>Z_)),e(nS,"NotEqualStencilFunc",(()=>X_)),e(nS,"GreaterEqualStencilFunc",(()=>$_)),e(nS,"AlwaysStencilFunc",(()=>eC)),e(nS,"StaticDrawUsage",(()=>tC)),e(nS,"DynamicDrawUsage",(()=>nC)),e(nS,"StreamDrawUsage",(()=>rC)),e(nS,"StaticReadUsage",(()=>iC)),e(nS,"DynamicReadUsage",(()=>oC)),e(nS,"StreamReadUsage",(()=>sC)),e(nS,"StaticCopyUsage",(()=>aC)),e(nS,"DynamicCopyUsage",(()=>lC)),e(nS,"StreamCopyUsage",(()=>cC)),e(nS,"GLSL1",(()=>uC)),e(nS,"GLSL3",(()=>dC)),e(nS,"_SRGBAFormat",(()=>hC)),e(nS,"EventDispatcher",(()=>pC)),e(nS,"MathUtils",(()=>TC)),e(nS,"Vector2",(()=>MC)),e(nS,"Matrix3",(()=>IC)),e(nS,"ColorManagement",(()=>BC)),e(nS,"Color",(()=>GC)),e(nS,"ImageUtils",(()=>qC)),e(nS,"Source",(()=>KC)),e(nS,"Texture",(()=>YC)),e(nS,"Vector4",(()=>ZC)),e(nS,"WebGLRenderTarget",(()=>XC)),e(nS,"DataArrayTexture",(()=>$C)),e(nS,"WebGLArrayRenderTarget",(()=>eA)),e(nS,"Data3DTexture",(()=>tA)),e(nS,"WebGL3DRenderTarget",(()=>nA)),e(nS,"WebGLMultipleRenderTargets",(()=>rA)),e(nS,"Quaternion",(()=>iA)),e(nS,"Vector3",(()=>oA)),e(nS,"Box3",(()=>lA)),e(nS,"Sphere",(()=>TA)),e(nS,"Ray",(()=>LA)),e(nS,"Matrix4",(()=>DA)),e(nS,"Euler",(()=>qA)),e(nS,"Layers",(()=>KA)),e(nS,"Object3D",(()=>aE)),e(nS,"Triangle",(()=>yE)),e(nS,"Material",(()=>xE)),e(nS,"MeshBasicMaterial",(()=>SE)),e(nS,"BufferAttribute",(()=>CE)),e(nS,"Int8BufferAttribute",(()=>AE)),e(nS,"Uint8BufferAttribute",(()=>EE)),e(nS,"Uint8ClampedBufferAttribute",(()=>TE)),e(nS,"Int16BufferAttribute",(()=>ME)),e(nS,"Uint16BufferAttribute",(()=>IE)),e(nS,"Int32BufferAttribute",(()=>RE)),e(nS,"Uint32BufferAttribute",(()=>PE)),e(nS,"Float16BufferAttribute",(()=>kE)),e(nS,"Float32BufferAttribute",(()=>OE)),e(nS,"Float64BufferAttribute",(()=>NE)),e(nS,"BufferGeometry",(()=>HE)),e(nS,"Mesh",(()=>sT)),e(nS,"BoxGeometry",(()=>lT)),e(nS,"UniformsUtils",(()=>dT)),e(nS,"ShaderMaterial",(()=>hT)),e(nS,"Camera",(()=>pT)),e(nS,"PerspectiveCamera",(()=>fT)),e(nS,"CubeCamera",(()=>gT)),e(nS,"CubeTexture",(()=>vT)),e(nS,"WebGLCubeRenderTarget",(()=>yT)),e(nS,"Plane",(()=>wT)),e(nS,"Frustum",(()=>AT)),e(nS,"PlaneGeometry",(()=>MT)),e(nS,"ShaderChunk",(()=>IT)),e(nS,"UniformsLib",(()=>RT)),e(nS,"ShaderLib",(()=>PT)),e(nS,"OrthographicCamera",(()=>zT)),e(nS,"PMREMGenerator",(()=>KT)),e(nS,"MeshDepthMaterial",(()=>VI)),e(nS,"MeshDistanceMaterial",(()=>GI)),e(nS,"WebGLUtils",(()=>JI)),e(nS,"ArrayCamera",(()=>QI)),e(nS,"Group",(()=>YI)),e(nS,"DepthTexture",(()=>$I)),e(nS,"WebGLRenderer",(()=>rR)),e(nS,"WebGL1Renderer",(()=>iR)),e(nS,"FogExp2",(()=>oR)),e(nS,"Fog",(()=>sR)),e(nS,"Scene",(()=>aR)),e(nS,"InterleavedBuffer",(()=>lR)),e(nS,"InterleavedBufferAttribute",(()=>uR)),e(nS,"SpriteMaterial",(()=>dR)),e(nS,"Sprite",(()=>AR)),e(nS,"LOD",(()=>IR)),e(nS,"SkinnedMesh",(()=>LR)),e(nS,"Bone",(()=>DR)),e(nS,"DataTexture",(()=>BR)),e(nS,"Skeleton",(()=>UR)),e(nS,"InstancedBufferAttribute",(()=>jR)),e(nS,"InstancedMesh",(()=>qR)),e(nS,"LineBasicMaterial",(()=>KR)),e(nS,"Line",(()=>$R)),e(nS,"LineSegments",(()=>nP)),e(nS,"LineLoop",(()=>rP)),e(nS,"PointsMaterial",(()=>iP)),e(nS,"Points",(()=>cP)),e(nS,"VideoTexture",(()=>dP)),e(nS,"FramebufferTexture",(()=>hP)),e(nS,"CompressedTexture",(()=>pP)),e(nS,"CanvasTexture",(()=>fP)),e(nS,"Curve",(()=>mP)),e(nS,"EllipseCurve",(()=>gP)),e(nS,"ArcCurve",(()=>vP)),e(nS,"CatmullRomCurve3",(()=>_P)),e(nS,"CubicBezierCurve",(()=>TP)),e(nS,"CubicBezierCurve3",(()=>MP)),e(nS,"LineCurve",(()=>IP)),e(nS,"LineCurve3",(()=>RP)),e(nS,"QuadraticBezierCurve",(()=>PP)),e(nS,"QuadraticBezierCurve3",(()=>kP)),e(nS,"SplineCurve",(()=>OP)),e(nS,"CurvePath",(()=>LP)),e(nS,"Path",(()=>DP)),e(nS,"LatheGeometry",(()=>BP)),e(nS,"CapsuleGeometry",(()=>zP)),e(nS,"CircleGeometry",(()=>FP)),e(nS,"CylinderGeometry",(()=>UP)),e(nS,"ConeGeometry",(()=>jP)),e(nS,"PolyhedronGeometry",(()=>HP)),e(nS,"DodecahedronGeometry",(()=>VP)),e(nS,"EdgesGeometry",(()=>JP)),e(nS,"Shape",(()=>QP)),e(nS,"ShapeUtils",(()=>Sk)),e(nS,"ExtrudeGeometry",(()=>Ck)),e(nS,"IcosahedronGeometry",(()=>Ek)),e(nS,"OctahedronGeometry",(()=>Tk)),e(nS,"RingGeometry",(()=>Mk)),e(nS,"ShapeGeometry",(()=>Ik)),e(nS,"SphereGeometry",(()=>Rk)),e(nS,"TetrahedronGeometry",(()=>Pk)),e(nS,"TorusGeometry",(()=>kk)),e(nS,"TorusKnotGeometry",(()=>Ok)),e(nS,"TubeGeometry",(()=>Nk)),e(nS,"WireframeGeometry",(()=>Lk)),e(nS,"ShadowMaterial",(()=>zk)),e(nS,"RawShaderMaterial",(()=>Fk)),e(nS,"MeshStandardMaterial",(()=>Uk)),e(nS,"MeshPhysicalMaterial",(()=>jk)),e(nS,"MeshPhongMaterial",(()=>Hk)),e(nS,"MeshToonMaterial",(()=>Vk)),e(nS,"MeshNormalMaterial",(()=>Gk)),e(nS,"MeshLambertMaterial",(()=>Wk)),e(nS,"MeshMatcapMaterial",(()=>qk)),e(nS,"LineDashedMaterial",(()=>Kk)),e(nS,"AnimationUtils",(()=>eO)),e(nS,"Interpolant",(()=>tO)),e(nS,"CubicInterpolant",(()=>nO)),e(nS,"LinearInterpolant",(()=>rO)),e(nS,"DiscreteInterpolant",(()=>iO)),e(nS,"KeyframeTrack",(()=>oO)),e(nS,"BooleanKeyframeTrack",(()=>sO)),e(nS,"ColorKeyframeTrack",(()=>aO)),e(nS,"NumberKeyframeTrack",(()=>lO)),e(nS,"QuaternionLinearInterpolant",(()=>cO)),e(nS,"QuaternionKeyframeTrack",(()=>uO)),e(nS,"StringKeyframeTrack",(()=>dO)),e(nS,"VectorKeyframeTrack",(()=>hO)),e(nS,"AnimationClip",(()=>pO)),e(nS,"Cache",(()=>mO)),e(nS,"LoadingManager",(()=>gO)),e(nS,"DefaultLoadingManager",(()=>vO)),e(nS,"Loader",(()=>yO)),e(nS,"FileLoader",(()=>SO)),e(nS,"AnimationLoader",(()=>wO)),e(nS,"CompressedTextureLoader",(()=>_O)),e(nS,"ImageLoader",(()=>CO)),e(nS,"CubeTextureLoader",(()=>AO)),e(nS,"DataTextureLoader",(()=>EO)),e(nS,"TextureLoader",(()=>TO)),e(nS,"Light",(()=>MO)),e(nS,"HemisphereLight",(()=>IO)),e(nS,"SpotLight",(()=>LO)),e(nS,"PointLight",(()=>UO)),e(nS,"DirectionalLight",(()=>HO)),e(nS,"AmbientLight",(()=>VO)),e(nS,"RectAreaLight",(()=>GO)),e(nS,"SphericalHarmonics3",(()=>WO)),e(nS,"LightProbe",(()=>qO)),e(nS,"MaterialLoader",(()=>KO)),e(nS,"LoaderUtils",(()=>JO)),e(nS,"InstancedBufferGeometry",(()=>QO)),e(nS,"BufferGeometryLoader",(()=>YO)),e(nS,"ObjectLoader",(()=>ZO)),e(nS,"ImageBitmapLoader",(()=>tN)),e(nS,"AudioContext",(()=>rN)),e(nS,"AudioLoader",(()=>iN)),e(nS,"HemisphereLightProbe",(()=>oN)),e(nS,"AmbientLightProbe",(()=>sN)),e(nS,"StereoCamera",(()=>uN)),e(nS,"Clock",(()=>dN)),e(nS,"AudioListener",(()=>vN)),e(nS,"Audio",(()=>yN)),e(nS,"PositionalAudio",(()=>_N)),e(nS,"AudioAnalyser",(()=>CN)),e(nS,"PropertyMixer",(()=>AN)),e(nS,"PropertyBinding",(()=>kN)),e(nS,"AnimationObjectGroup",(()=>ON)),e(nS,"AnimationMixer",(()=>DN)),e(nS,"Uniform",(()=>BN)),e(nS,"UniformsGroup",(()=>FN)),e(nS,"InstancedInterleavedBuffer",(()=>UN)),e(nS,"GLBufferAttribute",(()=>jN)),e(nS,"Raycaster",(()=>HN)),e(nS,"Spherical",(()=>WN)),e(nS,"Cylindrical",(()=>qN)),e(nS,"Box2",(()=>JN)),e(nS,"Line3",(()=>ZN)),e(nS,"SpotLightHelper",(()=>$N)),e(nS,"SkeletonHelper",(()=>rL)),e(nS,"PointLightHelper",(()=>oL)),e(nS,"HemisphereLightHelper",(()=>cL)),e(nS,"GridHelper",(()=>uL)),e(nS,"PolarGridHelper",(()=>dL)),e(nS,"DirectionalLightHelper",(()=>mL)),e(nS,"CameraHelper",(()=>yL)),e(nS,"BoxHelper",(()=>SL)),e(nS,"Box3Helper",(()=>wL)),e(nS,"PlaneHelper",(()=>_L)),e(nS,"ArrowHelper",(()=>TL)),e(nS,"AxesHelper",(()=>ML)),e(nS,"ShapePath",(()=>IL)),e(nS,"DataUtils",(()=>kL)),e(nS,"ImmediateRenderObject",(()=>OL)),e(nS,"WebGLMultisampleRenderTarget",(()=>NL)),e(nS,"DataTexture2DArray",(()=>LL)),e(nS,"DataTexture3D",(()=>DL)),e(nS,"BoxBufferGeometry",(()=>BL)),e(nS,"CapsuleBufferGeometry",(()=>zL)),e(nS,"CircleBufferGeometry",(()=>FL)),e(nS,"ConeBufferGeometry",(()=>UL)),e(nS,"CylinderBufferGeometry",(()=>jL)),e(nS,"DodecahedronBufferGeometry",(()=>HL)),e(nS,"ExtrudeBufferGeometry",(()=>VL)),e(nS,"IcosahedronBufferGeometry",(()=>GL)),e(nS,"LatheBufferGeometry",(()=>WL)),e(nS,"OctahedronBufferGeometry",(()=>qL)),e(nS,"PlaneBufferGeometry",(()=>KL)),e(nS,"PolyhedronBufferGeometry",(()=>JL)),e(nS,"RingBufferGeometry",(()=>QL)),e(nS,"ShapeBufferGeometry",(()=>YL)),e(nS,"SphereBufferGeometry",(()=>ZL)),e(nS,"TetrahedronBufferGeometry",(()=>XL)),e(nS,"TorusBufferGeometry",(()=>$L)),e(nS,"TorusKnotBufferGeometry",(()=>eD)),e(nS,"TubeBufferGeometry",(()=>tD));
|
|
239
|
+
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */Vv=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=S(Array.prototype.forEach),d=S(Array.prototype.pop),h=S(Array.prototype.push),p=S(String.prototype.toLowerCase),f=S(String.prototype.toString),m=S(String.prototype.match),g=S(String.prototype.replace),v=S(String.prototype.indexOf),y=S(String.prototype.trim),b=S(RegExp.prototype.test),x=w(TypeError);function S(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function w(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function _(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function C(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function A(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return S(n.get);if("function"==typeof n.value)return S(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const E=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),M=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=s(/^(?:\w+script|data):/i),G=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:G,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:S,Element:w,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,V=w.prototype,G=A(V,"cloneNode"),Y=A(V,"nextSibling"),Z=A(V,"childNodes"),X=A(V,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let $,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:pe}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=_({},[...E,...T,...M,...R,...k]);let ve=null;const ye=_({},[...O,...N,...L,...D]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,Se=null,we=!0,_e=!0,Ce=!1,Ae=!0,Ee=!1,Te=!1,Me=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const Le="user-content-";let De=!0,Be=!1,ze={},Fe=null;const Ue=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=_({},["audio","video","img","source","image","track"]);let Ve=null;const Ge=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Ze=_({},[We,qe,Ke],f);let Xe=null;const $e=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),Xe=Xe=-1===$e.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Xe?f:p,me="ALLOWED_TAGS"in e?_({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?_({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?_({},e.ALLOWED_NAMESPACES,f):Ze,Ve="ADD_URI_SAFE_ATTR"in e?_(C(Ge),e.ADD_URI_SAFE_ATTR,tt):Ge,je="ADD_DATA_URI_TAGS"in e?_(C(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?_({},e.FORBID_CONTENTS,tt):Ue,xe="FORBID_TAGS"in e?_({},e.FORBID_TAGS,tt):{},Se="FORBID_ATTR"in e?_({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,we=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ee=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,De=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(_e=!1),Pe&&(Re=!0),ze&&(me=_({},[...k]),ve=[],!0===ze.html&&(_(me,E),_(ve,O)),!0===ze.svg&&(_(me,T),_(ve,N),_(ve,D)),!0===ze.svgFilters&&(_(me,M),_(ve,N),_(ve,D)),!0===ze.mathMl&&(_(me,R),_(ve,L),_(ve,D))),e.ADD_TAGS&&(me===ge&&(me=C(me)),_(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=C(ve)),_(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&_(Ve,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=C(Fe)),_(Fe,e.FORBID_CONTENTS,tt)),De&&(me["#text"]=!0),Te&&_(me,["html","head","body"]),me.table&&(_(me,["tbody"]),delete xe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=e.TRUSTED_TYPES_POLICY,ee=$.createHTML("")}else void 0===$&&($=J(j,s)),null!==$&&"string"==typeof ee&&(ee=$.createHTML(""));o&&o(e),nt=e}},st=_({},["mi","mo","mn","ms","mtext"]),at=_({},["foreignobject","desc","title","annotation-xml"]),lt=_({},["title","style","font","a","script"]),ct=_({},T);_(ct,M),_(ct,I);const ut=_({},R);_(ut,P);const dt=function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==Xe||!Ye[e.namespaceURI]))},ht=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Xe&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=$?$.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,Xe)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,Te?"html":"body")[0]:Te?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof S&&e instanceof S},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return ht(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ht(e),!0;if(!me[r]||xe[r]){if(!xe[r]&&St(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(De&&!Fe[r]){const t=X(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(G(n[r],!0),Y(e))}return ht(e),!0}return e instanceof w&&!dt(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ee&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ht(e),!0)},xt=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(_e&&!Se[t]&&b(ue,t));else if(we&&b(de,t));else if(!ve[t]||Se[t]){if(!(St(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(fe,g(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ce&&!b(he,g(n,pe,"")));else if(n)return!1;return!0},St=function(e){return e.indexOf("-")>0},wt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let h="value"===s?l:y(l);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),h=r.attrValue,r.forceKeepAttr)continue;if(pt(s,e),!r.keepAttr)continue;if(!Ae&&b(/\/>/i,h)){pt(s,e);continue}Ee&&u([ae,le,ce],(e=>{h=g(h,e," ")}));const p=tt(e.nodeName);if(xt(p,c,h)){if(!Ne||"id"!==c&&"name"!==c||(pt(s,e),h=Le+h),$&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(p,c)){case"TrustedHTML":h=$.createHTML(h);break;case"TrustedScriptURL":h=$.createScriptURL(h)}try{a?e.setAttributeNS(a,s,h):e.setAttribute(s,h),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},_t=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),wt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Me||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||xe[t])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof S)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Ee&&!Te&&-1===e.indexOf("<"))return $&&ke?$.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&ht(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&_t(s.content),wt(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=Te?r.outerHTML:r.innerHTML;return Te&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Ee&&u([ae,le,ce],(e=>{d=g(d,e," ")})),$&&ke?$.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Me=!0},n.clearConfig=function(){nt=null,Me=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return xt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],h(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}();var Gv=({className:e,title:t})=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),(0,s.jsx)("path",{d:"M12 17L12.01 17"})]});var Wv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",focusable:"false",role:"img",className:e,"aria-label":t,children:[(0,s.jsx)("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),(0,s.jsx)("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]});var qv=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",focusable:"false",role:"img",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M10 9.5 8 12l2 2.5"}),(0,s.jsx)("path",{d:"m14 9.5 2 2.5-2 2.5"}),(0,s.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"})]});c=o("85Hg2"),c=o("85Hg2");var Kv=({rows:e,className:n,innerClassName:r,btnClassName:i,lineHeightMultiplier:o=1.2,defaultExpanded:a=!1,expandSymbol:l=(()=>"..."),collapseSymbol:u=(e=>"it"===e?"Mostra meno":"Show less"),children:d})=>{const{i18n:h}=Se(),p=h.language,f=u(p),m=l(p),[g,v]=(0,c.useState)(a),[y,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(16),w=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(w.current){let t=w.current.getBoundingClientRect().height,n=getComputedStyle(w.current),r=n.lineHeight,i="normal"!==r&&(null==r?void 0:r.length)?parseInt(r,10):o*parseInt(n.fontSize,10);console.table({rows:e,lineHeight:i,height:t,maxHeight:e*i,needsExpanding:t>e*i}),S(i),t&&t>e*i&&b(!0)}}),[e,w.current]),(0,s.jsxs)("div",{className:t(ws)("memori-expandable",n),children:[(0,s.jsx)("div",{ref:w,className:t(ws)("memori-expandable--inner",r),style:{maxHeight:g||!y?"9999px":x*e+"px"},children:d}),y&&!g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!0),children:m}),y&&g&&(0,s.jsx)(Sf,{ghost:!0,padded:!1,className:i,onClick:()=>v(!1),children:f})]})};const Jv=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,TENANT_ALREADY_EXISTS:-6,TENANT_MISSING_DESCRIPTION:-7,TENANT_CANT_SET_COMPLETION_PROVIDER:-8,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_TOO_MANY_ATTEMPTS:-38,USER_MUST_ACCEPT_TNC_AND_PP:-39,USER_BIRTH_DATE_CANT_BE_CHANGED:-40,USER_CANT_SET_COMPLETION_PROVIDER:-41,USER_CANT_ENABLE_DEEP_THOUGHT:-42,USER_CANT_ENABLE_DCM_INTEGRATION:-43,USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS:-44,USER_CREATION_BILLING_DENIED_PERMISSION:-46,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,SESSION_EXPIRED:-103,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS:-215,MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS:-216,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,MEMORI_FEATURE_REQUIRES_SUBSCRIPTION:-271,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905,NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD:-1001,PROCESS_INVALID_TYPE:-1401,PROCESS_ALREADY_RUNNING:-1401,PROCESS_NOT_FOUND:-1402,IMPORTCSV_MISSING_ROWS:-1501,IMPORTCSV_MISSING_CSV:-1502,IMPORTCSV_MISSING_SEPARATOR:-1503,IMPORTCSV_INVALID_SEPARATOR:-1504,IMPORTCSV_MISSING_HEADERS:-1505,IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1506,IMPORTCSV_INVALID_RECEIVER_ID:-1507,IMPORTCSV_INVALID_MEDIA_LINK:-1508,IMPORTCSV_UNDETECTABLE_CHAR_ENCODING:-1521,IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI:-1531,IMPORTTXT_MISSING_ROWS:-1601,IMPORTTXT_INVALID_GRANULARITY:-1602,IMPORTTXT_INVALID_RECEIVER_ID:-1603,IMPORTTXT_INVALID_MEDIA_LINK:-1604,IMPORTTXT_UNDETECTABLE_CHAR_ENCODING:-1621,IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI:-1631,IMPORTTXT_IMPORT_LIMIT_EXCEEDED:-1632,IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY:-1633,IMPORTTXT_IMPORT_REQUIRES_PAYING:-1634,IMPORTTXT_BILLING_DENIED_PERMISSION:-1635,EXPORTCSV_MISSING_CSV_SPECS:-1801,EXPORTCSV_MISSING_SEPARATOR:-1802,EXPORTCSV_INVALID_SEPARATOR:-1803,EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1804,EXPORTCSV_MISSING_NEW_LINE_CHAR:-1805,EXPORTCSV_INVALID_NEW_LINE_CHAR:-1806,EXPORTCSV_MISSING_PASSWORD:-1811,EXPORTJSONL_MISSING_JSONL_SPECS:-1821,EXPORTJSONL_MISSING_PLATFORM:-1822,EXPORTJSONL_INVALID_PLATFORM:-1823,EXPORTJSONL_MISSING_PASSWORD:-1831,EXPORTJSONL_EXPORT_REQUIRES_PAYING:-1832,ANALYSIS_MISSING_QUERY:-1901,ANALYSIS_CANT_ANALYZE_SECRET_MEMORI:-1902,ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT:-1903,BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS:-2001,BADGE_ASSIGNMENT_MISSING_REF_ID:-2002,BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND:-2003,BADGE_ASSIGNMENT_MISSING_ASSERTION_URL:-2004,BADGE_ASSIGNMENT_MISSING_BADGE_URL:-2005,BADGE_ASSIGNMENT_MISSING_ISSUER_URL:-2006,BADGE_ASSIGNMENT_INVALID_URL:-2007,BADGE_ASSIGNMENT_MISSING_RECIPIENT:-2021,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE:-2022,BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY:-2023,BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE:-2024,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE:-2025,BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY:-2026,BADGE_NOT_FOUND:-2051,OUTCOME_NO_DCM_CONFIGURED:-2071,OUTCOME_USER_BADGES_DISABLED:-2072}).map((([e,t])=>[t,e]))),Qv=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=Jv.get(e);return t?`errors.${t}`:"error.generic"},Yv=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"},{value:"EL",label:"Ελληνικά"},{value:"AR",label:"العربية"},{value:"ZH",label:"中文"},{value:"JA",label:"日本語"}],Zv="👤",Xv=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],$v={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};var ey={};function ty(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(ey=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){ty(o,r,i,s,a,"next",e)}function a(e){ty(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,ey.default=ey;var ny={};function ry(){return ny=ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ny.__esModule=!0,ny.default=ny,ry.apply(this,arguments)}(ny=ry).__esModule=!0,ny.default=ny;ee=o("ffgrs"),te=o("22y1y");var iy={},oy={};function sy(e,t){return oy=sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oy.__esModule=!0,oy.default=oy,sy(e,t)}(oy=sy).__esModule=!0,oy.default=oy,(iy=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oy(e,t)}).__esModule=!0,iy.default=iy;var ay={},ly=o("lEJSL").default,cy={};(cy=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,cy.default=cy,(ay=function(e,t){if(t&&("object"===ly(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return cy(e)}).__esModule=!0,ay.default=ay;var uy={};function dy(e){return uy=dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uy.__esModule=!0,uy.default=uy,dy(e)}(uy=dy).__esModule=!0,uy.default=uy;var hy,py=o("7qcgS")();hy=py;try{regeneratorRuntime=py}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=py:Function("r","regeneratorRuntime = r")(py)}c=o("85Hg2");var fy={},my={};(my=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,my.default=my,(fy=function(e,t){if(null==e)return{};var n,r,i=my(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,fy.default=fy;var gy={},vy={},yy=o("e3mvX");(vy=function(e){if(Array.isArray(e))return yy(e)}).__esModule=!0,vy.default=vy;var by={};(by=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,by.default=by;var xy=o("8xD61"),Sy={};(Sy=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Sy.default=Sy,(gy=function(e){return vy(e)||by(e)||xy(e)||Sy()}).__esModule=!0,gy.default=gy;c=o("85Hg2"),c=o("85Hg2");function wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _y(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?wy(Object(r),!0).forEach((function(n){t(X)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Cy={};function Ay(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Cy[r]||(Cy[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Cy[r]}function Ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Ay(r);return i.reduce((function(e,t){return _y(_y({},e),n[t])}),t)}function Ty(e){return e.join(" ")}function My(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,h=n.value;if("text"===u)return h;if(d){var p,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return My({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));p=_y(_y({},l),{},{className:Ty(v)||void 0,style:Ey(l.className,Object.assign({},l.style,o),r)})}else p=_y(_y({},l),{},{className:Ty(l.className)});var y=f(n.children);return t(c).createElement(d,t(ny)({key:a},p),y)}}var Iy=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Py(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Ry(Object(r),!0).forEach((function(n){t(X)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ry(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ky=/\n/g;function Oy(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Ny(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Ly(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return Py(Py({},i),o)}function Dy(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,h="function"==typeof a?a(n):a;if(h.className=c,n&&o){var p=Ly(r,n,i);t.unshift(Ny(n,p))}return d&u&&(h.style=Py(Py({},h.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function By(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Dy({children:[o],className:t(gy)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);By(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function zy(e,t,n,r,i,o,s,a,l){var c,u=By(e.value),d=[],h=-1,p=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Dy({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Ly(a,t,s);e.unshift(Ny(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[p],t=e.children[0].value;if(t.match(ky)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(h+1,p).concat(Dy({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[p+1]&&u[p+1].children&&u[p+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Dy({children:[f],className:e.properties.className});u.splice(p+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),h=p}p++};p<u.length;)v();if(h!==u.length-1){var y=u.slice(h+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function Fy(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return My({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Uy(e){return e&&void 0!==e.highlightAuto}function jy(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,h=void 0===d?{className:i?"language-".concat(i):void 0,style:Py(Py({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,p=r.useInlineStyles,f=void 0===p||p,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,x=void 0===b?1:b,S=r.lineNumberContainerStyle,w=r.lineNumberStyle,_=void 0===w?{}:w,C=r.wrapLines,A=r.wrapLongLines,E=void 0!==A&&A,T=r.lineProps,M=void 0===T?{}:T,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,L=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,D=r.astGenerator,B=t(fy)(r,Iy);D=D||e;var z=g?t(c).createElement(Oy,{containerStyle:S,codeStyle:h.style||{},numberStyle:_,startingLineNumber:x,codeString:L}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=Uy(D)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(h.style=Py(Py({},h.style),{},E?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!D)return t(c).createElement(P,j,z,t(c).createElement(O,h,L));(void 0===C&&I||E)&&(C=!0),I=I||Fy;var H=[{type:"text",value:L}],V=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(Uy(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:D,language:i,code:L,defaultCodeValue:H});null===V.language&&(V.value=H);var G=zy(V,C,M,g,y,x,V.value.length+x,_,E);return t(c).createElement(P,j,t(c).createElement(O,h,!y&&z,I({rows:G,stylesheet:a,useInlineStyles:f})))}}function Hy(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=t(uy)(e);if(n){var o=t(uy)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(ay)(this,r)}}var Vy,Gy,Wy,qy,Ky,Jy,Qy,Yy=function(e,n){return function(){var r=t(ey)(t(hy).mark((function r(i){var o;return t(hy).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},Zy={abap:Yy("abap",(function(){return o("bwHpE")})),abnf:Yy("abnf",(function(){return o("daD87")})),actionscript:Yy("actionscript",(function(){return o("lpEgO")})),ada:Yy("ada",(function(){return o("1sGW9")})),agda:Yy("agda",(function(){return o("e9VyR")})),al:Yy("al",(function(){return o("kMFSe")})),antlr4:Yy("antlr4",(function(){return o("8HlsP")})),apacheconf:Yy("apacheconf",(function(){return o("isFCh")})),apex:Yy("apex",(function(){return o("gUXVM")})),apl:Yy("apl",(function(){return o("2L15v")})),applescript:Yy("applescript",(function(){return o("8XyFT")})),aql:Yy("aql",(function(){return o("gFWTI")})),arduino:Yy("arduino",(function(){return o("jI3VB")})),arff:Yy("arff",(function(){return o("6uYTH")})),asciidoc:Yy("asciidoc",(function(){return o("gdYKH")})),asm6502:Yy("asm6502",(function(){return o("ahFLg")})),asmatmel:Yy("asmatmel",(function(){return o("4irIu")})),aspnet:Yy("aspnet",(function(){return o("yDC6n")})),autohotkey:Yy("autohotkey",(function(){return o("a4xpy")})),autoit:Yy("autoit",(function(){return o("iNSix")})),avisynth:Yy("avisynth",(function(){return o("kEBnk")})),avroIdl:Yy("avroIdl",(function(){return o("lzthi")})),bash:Yy("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:Yy("basic",(function(){return o("cxDu6")})),batch:Yy("batch",(function(){return o("6zDll")})),bbcode:Yy("bbcode",(function(){return o("bPS87")})),bicep:Yy("bicep",(function(){return o("8dy5f")})),birb:Yy("birb",(function(){return o("3vHrY")})),bison:Yy("bison",(function(){return o("bCjBS")})),bnf:Yy("bnf",(function(){return o("4NqDW")})),brainfuck:Yy("brainfuck",(function(){return o("4s0KX")})),brightscript:Yy("brightscript",(function(){return o("jTsQ4")})),bro:Yy("bro",(function(){return o("5lMc2")})),bsl:Yy("bsl",(function(){return o("jBYxC")})),c:Yy("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:Yy("cfscript",(function(){return o("coZDy")})),chaiscript:Yy("chaiscript",(function(){return o("e1zEN")})),cil:Yy("cil",(function(){return o("crKoM")})),clike:Yy("clike",(function(){return o("4kO9t")})),clojure:Yy("clojure",(function(){return o("01SpB")})),cmake:Yy("cmake",(function(){return o("9yG4p")})),cobol:Yy("cobol",(function(){return o("967Hn")})),coffeescript:Yy("coffeescript",(function(){return o("7Yi6H")})),concurnas:Yy("concurnas",(function(){return o("5tXmX")})),coq:Yy("coq",(function(){return o("ektdr")})),cpp:Yy("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:Yy("crystal",(function(){return o("8gt4L")})),csharp:Yy("csharp",(function(){return o("7K6eJ")})),cshtml:Yy("cshtml",(function(){return o("cVu4i")})),csp:Yy("csp",(function(){return o("ecKo1")})),cssExtras:Yy("cssExtras",(function(){return o("gnpv8")})),css:Yy("css",(function(){return o("jx0H8")})),csv:Yy("csv",(function(){return o("f9kmW")})),cypher:Yy("cypher",(function(){return o("lojor")})),d:Yy("d",(function(){return o("6Qa0U")})),dart:Yy("dart",(function(){return o("74K1B")})),dataweave:Yy("dataweave",(function(){return o("93H6c")})),dax:Yy("dax",(function(){return o("cf9Y9")})),dhall:Yy("dhall",(function(){return o("f6UWv")})),diff:Yy("diff",(function(){return o("klPVo")})),django:Yy("django",(function(){return o("jfxe9")})),dnsZoneFile:Yy("dnsZoneFile",(function(){return o("5aMz5")})),docker:Yy("docker",(function(){return o("kOauC")})),dot:Yy("dot",(function(){return o("btE6k")})),ebnf:Yy("ebnf",(function(){return o("aT88c")})),editorconfig:Yy("editorconfig",(function(){return o("jWOl8")})),eiffel:Yy("eiffel",(function(){return o("kHJaX")})),ejs:Yy("ejs",(function(){return o("frfnA")})),elixir:Yy("elixir",(function(){return o("hcrJ2")})),elm:Yy("elm",(function(){return o("jd271")})),erb:Yy("erb",(function(){return o("gczXL")})),erlang:Yy("erlang",(function(){return o("FsabW")})),etlua:Yy("etlua",(function(){return o("9DI9l")})),excelFormula:Yy("excelFormula",(function(){return o("3QVue")})),factor:Yy("factor",(function(){return o("ltNCT")})),falselang:Yy("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:Yy("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:Yy("flow",(function(){return o("e5prn")})),fortran:Yy("fortran",(function(){return o("gIEL6")})),fsharp:Yy("fsharp",(function(){return o("3wQkt")})),ftl:Yy("ftl",(function(){return o("7ZVWs")})),gap:Yy("gap",(function(){return o("hOFj6")})),gcode:Yy("gcode",(function(){return o("95BzQ")})),gdscript:Yy("gdscript",(function(){return o("iul6t")})),gedcom:Yy("gedcom",(function(){return o("e0qJM")})),gherkin:Yy("gherkin",(function(){return o("2SHak")})),git:Yy("git",(function(){return o("l6VFH")})),glsl:Yy("glsl",(function(){return o("cEMfJ")})),gml:Yy("gml",(function(){return o("8UVTr")})),gn:Yy("gn",(function(){return o("kvibD")})),goModule:Yy("goModule",(function(){return o("icqjF")})),go:Yy("go",(function(){return o("jLkg8")})),graphql:Yy("graphql",(function(){return o("aYGNi")})),groovy:Yy("groovy",(function(){return o("4bTmH")})),haml:Yy("haml",(function(){return o("h2A6V")})),handlebars:Yy("handlebars",(function(){return o("79YVJ")})),haskell:Yy("haskell",(function(){return o("bsiLW")})),haxe:Yy("haxe",(function(){return o("94Kdj")})),hcl:Yy("hcl",(function(){return o("9CheR")})),hlsl:Yy("hlsl",(function(){return o("h3dqW")})),hoon:Yy("hoon",(function(){return o("9WbsW")})),hpkp:Yy("hpkp",(function(){return o("GiPN3")})),hsts:Yy("hsts",(function(){return o("eaSn9")})),http:Yy("http",(function(){return o("1uj7b")})),ichigojam:Yy("ichigojam",(function(){return o("ge562")})),icon:Yy("icon",(function(){return o("lVHUf")})),icuMessageFormat:Yy("icuMessageFormat",(function(){return o("aYoUL")})),idris:Yy("idris",(function(){return o("1RVAE")})),iecst:Yy("iecst",(function(){return o("bi7Dr")})),ignore:Yy("ignore",(function(){return o("cq0Pi")})),inform7:Yy("inform7",(function(){return o("31K4E")})),ini:Yy("ini",(function(){return o("l05OZ")})),io:Yy("io",(function(){return o("6bY1b")})),j:Yy("j",(function(){return o("1ebDS")})),java:Yy("java",(function(){return o("iEZZI")})),javadoc:Yy("javadoc",(function(){return o("aHy5a")})),javadoclike:Yy("javadoclike",(function(){return o("5f3rE")})),javascript:Yy("javascript",(function(){return o("7JDFI")})),javastacktrace:Yy("javastacktrace",(function(){return o("gdCGE")})),jexl:Yy("jexl",(function(){return o("cqMb9")})),jolie:Yy("jolie",(function(){return o("cEDX4")})),jq:Yy("jq",(function(){return o("kEWsh")})),jsExtras:Yy("jsExtras",(function(){return o("74PI8")})),jsTemplates:Yy("jsTemplates",(function(){return o("30TPr")})),jsdoc:Yy("jsdoc",(function(){return o("9DH5c")})),json:Yy("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:Yy("json5",(function(){return o("920rv")})),jsonp:Yy("jsonp",(function(){return o("9AwS1")})),jsstacktrace:Yy("jsstacktrace",(function(){return o("bYXMr")})),jsx:Yy("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:Yy("julia",(function(){return o("g0ibH")})),keepalived:Yy("keepalived",(function(){return o("2hdnH")})),keyman:Yy("keyman",(function(){return o("cIufI")})),kotlin:Yy("kotlin",(function(){return o("c26dU")})),kumir:Yy("kumir",(function(){return o("iYAha")})),kusto:Yy("kusto",(function(){return o("9z1oX")})),latex:Yy("latex",(function(){return o("lCPLU")})),latte:Yy("latte",(function(){return o("c9oN0")})),less:Yy("less",(function(){return o("hA3V9")})),lilypond:Yy("lilypond",(function(){return o("hpHTA")})),liquid:Yy("liquid",(function(){return o("kpZTm")})),lisp:Yy("lisp",(function(){return o("chgK5")})),livescript:Yy("livescript",(function(){return o("2gdiv")})),llvm:Yy("llvm",(function(){return o("jUeFO")})),log:Yy("log",(function(){return o("3BFSQ")})),lolcode:Yy("lolcode",(function(){return o("lG9br")})),lua:Yy("lua",(function(){return o("cVGpd")})),magma:Yy("magma",(function(){return o("4LVzY")})),makefile:Yy("makefile",(function(){return o("2NviD")})),markdown:Yy("markdown",(function(){return o("jUFCF")})),markupTemplating:Yy("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:Yy("markup",(function(){return o("5hIXu")})),matlab:Yy("matlab",(function(){return o("kPAC0")})),maxscript:Yy("maxscript",(function(){return o("gHOJy")})),mel:Yy("mel",(function(){return o("9mj6e")})),mermaid:Yy("mermaid",(function(){return o("kozw5")})),mizar:Yy("mizar",(function(){return o("2bN6W")})),mongodb:Yy("mongodb",(function(){return o("eHKWX")})),monkey:Yy("monkey",(function(){return o("7Fh0C")})),moonscript:Yy("moonscript",(function(){return o("hDXwC")})),n1ql:Yy("n1ql",(function(){return o("j9bkC")})),n4js:Yy("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:Yy("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:Yy("naniscript",(function(){return o("VxHk1")})),nasm:Yy("nasm",(function(){return o("ly95T")})),neon:Yy("neon",(function(){return o("7Fk34")})),nevod:Yy("nevod",(function(){return o("3U8Qv")})),nginx:Yy("nginx",(function(){return o("c6qVk")})),nim:Yy("nim",(function(){return o("1JdCk")})),nix:Yy("nix",(function(){return o("jcstS")})),nsis:Yy("nsis",(function(){return o("kEJqW")})),objectivec:Yy("objectivec",(function(){return o("lUP8A")})),ocaml:Yy("ocaml",(function(){return o("lhTAD")})),opencl:Yy("opencl",(function(){return o("8rxKO")})),openqasm:Yy("openqasm",(function(){return o("ib0uL")})),oz:Yy("oz",(function(){return o("csCUS")})),parigp:Yy("parigp",(function(){return o("2DkHE")})),parser:Yy("parser",(function(){return o("2cp75")})),pascal:Yy("pascal",(function(){return o("fViVl")})),pascaligo:Yy("pascaligo",(function(){return o("9Uuxa")})),pcaxis:Yy("pcaxis",(function(){return o("jUdnN")})),peoplecode:Yy("peoplecode",(function(){return o("l8w4e")})),perl:Yy("perl",(function(){return o("aX7dM")})),phpExtras:Yy("phpExtras",(function(){return o("3cMZl")})),php:Yy("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:Yy("phpdoc",(function(){return o("bDyJN")})),plsql:Yy("plsql",(function(){return o("cPuMN")})),powerquery:Yy("powerquery",(function(){return o("jE1gU")})),powershell:Yy("powershell",(function(){return o("k7t0j")})),processing:Yy("processing",(function(){return o("jr8hV")})),prolog:Yy("prolog",(function(){return o("hpuat")})),promql:Yy("promql",(function(){return o("ckXC5")})),properties:Yy("properties",(function(){return o("fAh6P")})),protobuf:Yy("protobuf",(function(){return o("R6WqB")})),psl:Yy("psl",(function(){return o("Al65w")})),pug:Yy("pug",(function(){return o("dxbNS")})),puppet:Yy("puppet",(function(){return o("lrSuh")})),pure:Yy("pure",(function(){return o("6DKQK")})),purebasic:Yy("purebasic",(function(){return o("7ZkSb")})),purescript:Yy("purescript",(function(){return o("dBTYx")})),python:Yy("python",(function(){return Promise.resolve(o("kiy5M"))})),q:Yy("q",(function(){return o("4FXyy")})),qml:Yy("qml",(function(){return o("2zZFj")})),qore:Yy("qore",(function(){return o("iCK1Y")})),qsharp:Yy("qsharp",(function(){return o("dvH9H")})),r:Yy("r",(function(){return o("lQqRt")})),racket:Yy("racket",(function(){return o("eHKmq")})),reason:Yy("reason",(function(){return o("kkeLT")})),regex:Yy("regex",(function(){return o("llX50")})),rego:Yy("rego",(function(){return o("9hKdZ")})),renpy:Yy("renpy",(function(){return o("cJgw5")})),rest:Yy("rest",(function(){return o("867DK")})),rip:Yy("rip",(function(){return o("3Odjx")})),roboconf:Yy("roboconf",(function(){return o("gQ0Us")})),robotframework:Yy("robotframework",(function(){return o("bLCgx")})),ruby:Yy("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:Yy("rust",(function(){return o("cInT8")})),sas:Yy("sas",(function(){return o("iz7eP")})),sass:Yy("sass",(function(){return o("hrDC3")})),scala:Yy("scala",(function(){return o("ub8Bf")})),scheme:Yy("scheme",(function(){return o("7NAAt")})),scss:Yy("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:Yy("shellSession",(function(){return o("7kKCv")})),smali:Yy("smali",(function(){return o("2lkCb")})),smalltalk:Yy("smalltalk",(function(){return o("4280y")})),smarty:Yy("smarty",(function(){return o("4hXYK")})),sml:Yy("sml",(function(){return o("jh2E8")})),solidity:Yy("solidity",(function(){return o("dTdF2")})),solutionFile:Yy("solutionFile",(function(){return o("iI5tm")})),soy:Yy("soy",(function(){return o("aoU5C")})),sparql:Yy("sparql",(function(){return o("ggrvb")})),splunkSpl:Yy("splunkSpl",(function(){return o("8LhCX")})),sqf:Yy("sqf",(function(){return o("3tDsu")})),sql:Yy("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:Yy("squirrel",(function(){return o("bxaUV")})),stan:Yy("stan",(function(){return o("dBqrq")})),stylus:Yy("stylus",(function(){return o("JlHVK")})),swift:Yy("swift",(function(){return o("c7NBs")})),systemd:Yy("systemd",(function(){return o("jprZl")})),t4Cs:Yy("t4Cs",(function(){return o("edsMI")})),t4Templating:Yy("t4Templating",(function(){return o("bS9Wa")})),t4Vb:Yy("t4Vb",(function(){return o("gYk20")})),tap:Yy("tap",(function(){return o("byv7d")})),tcl:Yy("tcl",(function(){return o("lUAIZ")})),textile:Yy("textile",(function(){return o("7J2LO")})),toml:Yy("toml",(function(){return o("eXtdM")})),tremor:Yy("tremor",(function(){return o("vyajH")})),tsx:Yy("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:Yy("tt2",(function(){return o("8XOOm")})),turtle:Yy("turtle",(function(){return o("1XvLQ")})),twig:Yy("twig",(function(){return o("i9Fpp")})),typescript:Yy("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:Yy("typoscript",(function(){return o("kKk69")})),unrealscript:Yy("unrealscript",(function(){return o("jgq8Y")})),uorazor:Yy("uorazor",(function(){return o("dsZ00")})),uri:Yy("uri",(function(){return o("fqJRp")})),v:Yy("v",(function(){return o("bgfyB")})),vala:Yy("vala",(function(){return o("68x4q")})),vbnet:Yy("vbnet",(function(){return o("eUhQs")})),velocity:Yy("velocity",(function(){return o("fPNdV")})),verilog:Yy("verilog",(function(){return o("2fM1V")})),vhdl:Yy("vhdl",(function(){return o("hNF6q")})),vim:Yy("vim",(function(){return o("75TCr")})),visualBasic:Yy("visualBasic",(function(){return o("fc93z")})),warpscript:Yy("warpscript",(function(){return o("jgHlG")})),wasm:Yy("wasm",(function(){return o("dVZkI")})),webIdl:Yy("webIdl",(function(){return o("9Jnxv")})),wiki:Yy("wiki",(function(){return o("1Gimo")})),wolfram:Yy("wolfram",(function(){return o("4SyRT")})),wren:Yy("wren",(function(){return o("gaIVs")})),xeora:Yy("xeora",(function(){return o("lagad")})),xmlDoc:Yy("xmlDoc",(function(){return o("9DNYE")})),xojo:Yy("xojo",(function(){return o("ksF4f")})),xquery:Yy("xquery",(function(){return o("gXxHJ")})),yaml:Yy("yaml",(function(){return o("6rk3j")})),yang:Yy("yang",(function(){return o("kTyrQ")})),zig:Yy("zig",(function(){return o("d3mFC")}))},Xy=(Gy=(Vy={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:Zy,registerLanguage:function(e,t,n){return e.register(n)}}).loader,Wy=Vy.isLanguageRegistered,qy=Vy.registerLanguage,Ky=Vy.languageLoaders,Jy=Vy.noAsyncLoadingLanguages,Qy=function(e){t(iy)(i,e);var n,r=Hy(i);function i(){return t(ee)(this,i),r.apply(this,arguments)}return t(te)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&Ky&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&Ky&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(ny)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(ey)(t(hy).mark((function e(n){var r;return t(hy).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=Ky[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof Ky[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=Gy().then((function(e){i.astGenerator=e,qy&&i.languages.forEach((function(t,n){return qy(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(X)(Qy,"astGenerator",null),t(X)(Qy,"highlightInstance",jy(null,{})),t(X)(Qy,"astGeneratorPromise",null),t(X)(Qy,"languages",new Map),t(X)(Qy,"supportedLanguages",Vy.supportedLanguages||Object.keys(Ky||{})),t(X)(Qy,"isRegistered",(function(e){if(Jy)return!0;if(!qy)throw new Error("Current syntax highlighter doesn't support registration of languages");return Qy.astGenerator?Wy(Qy.astGenerator,e):Qy.languages.has(e)})),t(X)(Qy,"registerLanguage",(function(e,t){if(!qy)throw new Error("Current syntax highlighter doesn't support registration of languages");if(Qy.astGenerator)return qy(Qy.astGenerator,e,t);Qy.languages.set(e,t)})),Qy),$y={},eb={};(eb=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,eb.default=eb,Object.defineProperty($y,"__esModule",{value:!0}),Object.defineProperty($y,"a11yDark",{enumerable:!0,get:function(){return cb.default}}),Object.defineProperty($y,"atomDark",{enumerable:!0,get:function(){return ub.default}}),Object.defineProperty($y,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return db.default}}),Object.defineProperty($y,"cb",{enumerable:!0,get:function(){return hb.default}}),Object.defineProperty($y,"coldarkCold",{enumerable:!0,get:function(){return pb.default}}),Object.defineProperty($y,"coldarkDark",{enumerable:!0,get:function(){return fb.default}}),Object.defineProperty($y,"coy",{enumerable:!0,get:function(){return tb.default}}),Object.defineProperty($y,"coyWithoutShadows",{enumerable:!0,get:function(){return mb.default}}),Object.defineProperty($y,"darcula",{enumerable:!0,get:function(){return gb.default}}),Object.defineProperty($y,"dark",{enumerable:!0,get:function(){return nb.default}}),Object.defineProperty($y,"dracula",{enumerable:!0,get:function(){return vb.default}}),Object.defineProperty($y,"duotoneDark",{enumerable:!0,get:function(){return yb.default}}),Object.defineProperty($y,"duotoneEarth",{enumerable:!0,get:function(){return bb.default}}),Object.defineProperty($y,"duotoneForest",{enumerable:!0,get:function(){return xb.default}}),Object.defineProperty($y,"duotoneLight",{enumerable:!0,get:function(){return Sb.default}}),Object.defineProperty($y,"duotoneSea",{enumerable:!0,get:function(){return wb.default}}),Object.defineProperty($y,"duotoneSpace",{enumerable:!0,get:function(){return _b.default}}),Object.defineProperty($y,"funky",{enumerable:!0,get:function(){return rb.default}}),Object.defineProperty($y,"ghcolors",{enumerable:!0,get:function(){return Cb.default}}),Object.defineProperty($y,"gruvboxDark",{enumerable:!0,get:function(){return Ab.default}}),Object.defineProperty($y,"gruvboxLight",{enumerable:!0,get:function(){return Eb.default}}),Object.defineProperty($y,"holiTheme",{enumerable:!0,get:function(){return Tb.default}}),Object.defineProperty($y,"hopscotch",{enumerable:!0,get:function(){return Mb.default}}),Object.defineProperty($y,"lucario",{enumerable:!0,get:function(){return Ib.default}}),Object.defineProperty($y,"materialDark",{enumerable:!0,get:function(){return Rb.default}}),Object.defineProperty($y,"materialLight",{enumerable:!0,get:function(){return Pb.default}}),Object.defineProperty($y,"materialOceanic",{enumerable:!0,get:function(){return kb.default}}),Object.defineProperty($y,"nightOwl",{enumerable:!0,get:function(){return Ob.default}}),Object.defineProperty($y,"nord",{enumerable:!0,get:function(){return Nb.default}}),Object.defineProperty($y,"okaidia",{enumerable:!0,get:function(){return ib.default}}),Object.defineProperty($y,"oneDark",{enumerable:!0,get:function(){return Lb.default}}),Object.defineProperty($y,"oneLight",{enumerable:!0,get:function(){return Db.default}}),Object.defineProperty($y,"pojoaque",{enumerable:!0,get:function(){return Bb.default}}),Object.defineProperty($y,"prism",{enumerable:!0,get:function(){return lb.default}}),Object.defineProperty($y,"shadesOfPurple",{enumerable:!0,get:function(){return zb.default}}),Object.defineProperty($y,"solarizedDarkAtom",{enumerable:!0,get:function(){return Fb.default}}),Object.defineProperty($y,"solarizedlight",{enumerable:!0,get:function(){return ob.default}}),Object.defineProperty($y,"synthwave84",{enumerable:!0,get:function(){return Ub.default}}),Object.defineProperty($y,"tomorrow",{enumerable:!0,get:function(){return sb.default}}),Object.defineProperty($y,"twilight",{enumerable:!0,get:function(){return ab.default}}),Object.defineProperty($y,"vs",{enumerable:!0,get:function(){return jb.default}}),Object.defineProperty($y,"vscDarkPlus",{enumerable:!0,get:function(){return Hb.default}}),Object.defineProperty($y,"xonokai",{enumerable:!0,get:function(){return Vb.default}}),Object.defineProperty($y,"zTouch",{enumerable:!0,get:function(){return Gb.default}});var tb=eb(o("jcF8U")),nb=eb(o("3Tppx")),rb=eb(o("dBuK7")),ib=eb(o("eEjWK")),ob=eb(o("awG2g")),sb=eb(o("2oFzQ")),ab=eb(o("4Au6Q")),lb=eb(o("dAPqs")),cb=eb(o("8eAql")),ub=eb(o("cv2QE")),db=eb(o("h5I9g")),hb=eb(o("i4C5w")),pb=eb(o("3kFKo")),fb=eb(o("17zK0")),mb=eb(o("5Avqr")),gb=eb(o("1jHMv")),vb=eb(o("7Q8CE")),yb=eb(o("jKUos")),bb=eb(o("Uzm4J")),xb=eb(o("7yfkN")),Sb=eb(o("lT2l1")),wb=eb(o("fZ9um")),_b=eb(o("1MoQL")),Cb=eb(o("4uys7")),Ab=eb(o("kaYsk")),Eb=eb(o("kN6Vu")),Tb=eb(o("2Z6pG")),Mb=eb(o("4jQJK")),Ib=eb(o("bpXw0")),Rb=eb(o("i4S8s")),Pb=eb(o("5bNr4")),kb=eb(o("5ZYWT")),Ob=eb(o("ihJCU")),Nb=eb(o("8iIbg")),Lb=eb(o("424u7")),Db=eb(o("jPiNI")),Bb=eb(o("OHVOA")),zb=eb(o("2OKTL")),Fb=eb(o("2Mg8H")),Ub=eb(o("9Kud0")),jb=eb(o("eCrmR")),Hb=eb(o("8UhcQ")),Vb=eb(o("dtU9z")),Gb=eb(o("4xtLO")),Wb={};Object.defineProperty(Wb,"__esModule",{value:!0}),Wb.default=void 0;var qb=eb(o("7cTnl")).default;Wb.default=qb;var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0}),Kb.default=void 0;var Jb=eb(o("l1Rj1")).default;Kb.default=Jb;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0}),Qb.default=void 0;var Yb=eb(o("fU6a0")).default;Qb.default=Yb;var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0}),Zb.default=void 0;var Xb=eb(o("3aDLI")).default;Zb.default=Xb;var $b={};Object.defineProperty($b,"__esModule",{value:!0}),$b.default=void 0;var ex=eb(o("kiy5M")).default;$b.default=ex;var tx={};Object.defineProperty(tx,"__esModule",{value:!0}),tx.default=void 0;var nx=eb(o("lR39A")).default;tx.default=nx;var rx={};Object.defineProperty(rx,"__esModule",{value:!0}),rx.default=void 0;var ix=eb(o("5li5P")).default;rx.default=ix;var ox={};Object.defineProperty(ox,"__esModule",{value:!0}),ox.default=void 0;var sx=eb(o("ch1PX")).default;ox.default=sx;var ax={};Object.defineProperty(ax,"__esModule",{value:!0}),ax.default=void 0;var lx=eb(o("bnDV9")).default;ax.default=lx,Xy.registerLanguage("tsx",t(Wb)),Xy.registerLanguage("json",t(Kb)),Xy.registerLanguage("scss",t(Qb)),Xy.registerLanguage("bash",t(Zb)),Xy.registerLanguage("python",t($b)),Xy.registerLanguage("cpp",t(tx)),Xy.registerLanguage("php",t(rx)),Xy.registerLanguage("ruby",t(ox)),Xy.registerLanguage("sql",t(ax));var cx=({medium:e,className:t,preview:n=!1,showLineNumbers:r=!0,showCopyButton:i=!0})=>{var o,a,l,c;const{t:u}=Se();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(Xy,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:$y.atomDark,showLineNumbers:r,language:null!==(a=null===(o=Xv.find((t=>e.mimeType===t.mimeType)))||void 0===o?void 0:o.lang)&&void 0!==a?a:"text",children:(null===(l=e.content)||void 0===l?void 0:l.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),i&&(0,s.jsx)(Sf,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:u("copy")||"Copy",icon:(0,s.jsx)(Wv,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(c=e.title)||void 0===c?void 0:c.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};c=o("85Hg2"),c=o("85Hg2");var ux,dx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),hx={};ux=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,h=a,p=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(h++,p=i.height,h===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:p,rowsWrapped:h})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:p,rowsWrapped:h}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var h=d.innerHTML.split(a.delimiter);d.innerHTML="";var p=window.getComputedStyle(d);h.reduce(n,{el:d,buffer:d.innerHTML,elStyle:p,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],ux):ux(hx);var px=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(ws)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(xf,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const fx=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[h,p]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==h?void 0:h.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://aisuru.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{p(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==h?void 0:h.title,g=null==h?void 0:h.description,v=null==h?void 0:h.video,y=null!==(u=null==h?void 0:h.image)&&void 0!==u?u:null===(d=null==h?void 0:h.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,hx.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(ws)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(px,{hoverable:!0,className:t(ws)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y.startsWith("https")?y:`https://${y.replace("http://","")}`,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(dx,{className:"memori-link-item--icon"})}),title:m,description:g})})};var mx=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(np,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(np.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(fx,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const gx=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],vx=async(e,t,n,r)=>{var i;let o=(e=>e.replaceAll(/<output.*?>(.*?)<\/output>/g,""))(e);const s=gx.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),a=await fetch(`${r||"https://www.aisuru.com"}/api/translate?text=${encodeURIComponent(o)}&target_lang=${t.toUpperCase()}${s?`&source_lang=${s}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),l=await a.json();return null===(i=null==l?void 0:l.translations)||void 0===i?void 0:i[0]};c=o("85Hg2");var yx=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var bx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var xx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var Sx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var wx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const _x=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{var u,d;const h=gv({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),p=null==c?void 0:c(t.mimeType);if(p)return p;const f=(null===(u=t.url)||void 0===u?void 0:u.startsWith("rgb("))||(null===(d=t.url)||void 0===d?void 0:d.startsWith("rgba("));switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return f?(0,s.jsx)(px,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[(0,s.jsx)("div",{className:"memori-media-item--rgb-item",style:{backgroundColor:t.url}}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})}):(0,s.jsx)("a",{className:"memori-media-item--link",href:t.url,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&(0,s.jsx)("source",{srcSet:[h,t.url,t.content].join(", "),type:t.mimeType}),(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(wx,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(Sx,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(xx,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/quicktime":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsxs)("video",{style:{width:"100%",height:"100%"},controls:!0,src:h,title:t.title,children:["video/quicktime"===t.mimeType&&(0,s.jsx)("source",{src:t.url,type:"video/mp4"}),(0,s.jsx)("source",{src:t.url,type:t.mimeType}),"Your browser does not support this video format.",(0,s.jsx)("br",{}),(0,s.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:"Download the video"})]}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:h}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(yx,{src:h,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:h,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(px,{hoverable:!0,cover:(0,s.jsx)(bx,{className:"memori-media-item--icon"}),title:t.title})})}};var Cx=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,h]=(0,c.useState)(),p=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await vx(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);(0,c.useEffect)((()=>{r&&p()}),[r,p]);const f=l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!Xv.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)),m=l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&Xv.map((e=>e.mimeType)).includes(e.mimeType)})),g=l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));return(0,s.jsxs)(np,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[!!f.length&&(0,s.jsx)("div",{className:"memori-media-items--grid",children:f.map(((e,r)=>(0,s.jsx)(np.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(_x,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{h(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),m.map((e=>(0,s.jsx)(np.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(cx,{medium:e},e.mediumID)},e.mediumID))),g.map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Km,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>h(void 0),footer:null,children:(0,s.jsx)(_x,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var Ax=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:h}=Se(),[p,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(Cx,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(mx,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(np,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(np.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Sf,{className:t(ws)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Sf,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:h("expand")||"Expand"})})]})]})}));const Ex=e=>e.endsWith("?")?e:`${e}?`;var Tx=({message:e,apiURL:n,sessionID:r,visible:i=!0,initialMatches:o=[],closeDrawer:a,_TEST_loading:l=!1})=>{const{t:u}=Se(),d=Y(n).search.searchMemory,[h,p]=(0,c.useState)(o),[f,m]=(0,c.useState)(l),g=(0,c.useCallback)((async()=>{if(m(!0),!l){try{const{matches:n,...i}=await d(r,{searchType:"Semantic",numberOfResults:3,text:e.questionAnswered,date:e.date,placeName:e.placeName,placeLatitude:e.placeLatitude,placeLongitude:e.placeLongitude,placeUncertaintyKm:e.placeUncertaintyKm,contextVars:e.contextVars,tag:e.tag,memoryTags:e.memoryTags});0!==i.resultCode?(console.error(i),t(Ju).error(u(Qv(i.resultCode)))):p(null!=n?n:[])}catch(e){console.error("WHYTHISANSWER/FETCH",e),p(null!=o?o:[])}m(!1)}}),[e,r]);return(0,c.useEffect)((()=>{g()}),[g,e,r]),(0,s.jsxs)(_f,{open:i,width:"80%",animated:!1,className:"memori-whythisanswer-drawer",onClose:()=>a(),title:u("whyThisAnswer"),children:[(0,s.jsx)("p",{children:u("whyThisAnswerHelper")}),e.questionAnswered&&(0,s.jsxs)("p",{className:"memori--whythisanswer-question-answered",children:[(0,s.jsxs)("strong",{children:[u("question")||"Question",":"]})," ",e.questionAnswered]}),(0,s.jsxs)(xf,{primary:!0,spinning:f,children:[!f&&0===h.length&&(0,s.jsx)("p",{role:"info",className:"memori--whythisanswer-no-results",children:u("nothingFound")}),f&&0===h.length&&(0,s.jsxs)("ul",{className:"memori--whythisanswer-list memori--whythisanswer-skeleton",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsx)("div",{className:"memori--whythisanswer-title-text",children:(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]}),(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:(0,s.jsx)("span",{className:"memori--whythisanswer-skeleton-text"})}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("p",{className:"memori--whythisanswer-skeleton-text"})]})]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-text"})]}),(0,s.jsx)("div",{className:"memori--whythisanswer-skeleton-block"})]})]}),h.length>0&&(0,s.jsx)("ul",{className:"memori--whythisanswer-list",children:h.map((e=>{var t,n,r,i,o,a,l;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"memori--whythisanswer-title",children:[(0,s.jsx)("span",{className:"memori--whythisanswer-confidence",children:e.confidenceLevel}),(0,s.jsxs)("div",{className:"memori--whythisanswer-title-text",children:[(0,s.jsx)("p",{children:(0,s.jsx)("strong",{children:Ex(null!==(t=e.memory.title)&&void 0!==t?t:"")})}),(0,s.jsx)("p",{children:null===(r=null===(n=e.memory.titleVariants)||void 0===n?void 0:n.map((e=>Ex(e))))||void 0===r?void 0:r.join(" | ")})]})]}),null===(i=e.memory.answers)||void 0===i?void 0:i.map(((e,t)=>(0,s.jsx)("p",{className:"memori--whythisanswer-answer",children:(0,s.jsx)(Kv,{rows:3,children:e.text})},t))),(0,s.jsx)(Ax,{links:null===(o=e.memory.media)||void 0===o?void 0:o.filter((e=>"text/html"===e.mimeType))}),null===(l=null===(a=e.memory.media)||void 0===a?void 0:a.filter((e=>"text/plain"===e.mimeType)))||void 0===l?void 0:l.map((e=>(0,s.jsx)(Kv,{rows:2,lineHeightMultiplier:2,innerClassName:"memori--whythisanswer-snippet-expandable",children:(0,s.jsx)(cx,{medium:e,showCopyButton:!1,showLineNumbers:!1},e.mediumID)},e.mediumID)))]},e.memory.memoryID)}))})]})]})},Mx={};Mx=function(){"use strict";var e=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=/[\0-\x1F\x7F-\x9F]/,n=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,r=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;function i(i){const o={};i=i||{},o.src_Any=e.source,o.src_Cc=t.source,o.src_Z=r.source,o.src_P=n.source,o.src_ZPCc=[o.src_Z,o.src_P,o.src_Cc].join("|"),o.src_ZCc=[o.src_Z,o.src_Cc].join("|");const s="[><|]";return o.src_pseudo_letter="(?:(?!"+s+"|"+o.src_ZPCc+")"+o.src_Any+")",o.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",o.src_auth="(?:(?:(?!"+o.src_ZCc+"|[@/\\[\\]()]).)+@)?",o.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",o.src_host_terminator="(?=$|"+s+"|"+o.src_ZPCc+")(?!"+(i["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+o.src_ZPCc+"))",o.src_path="(?:[/?#](?:(?!"+o.src_ZCc+"|"+s+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+o.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+o.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+o.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+o.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+o.src_ZCc+"|[']).)+\\'|\\'(?="+o.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+o.src_ZCc+"|[.]|$)|"+(i["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+o.src_ZCc+"|$)|;(?!"+o.src_ZCc+"|$)|\\!+(?!"+o.src_ZCc+"|[!]|$)|\\?(?!"+o.src_ZCc+"|[?]|$))+|\\/)?",o.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',o.src_xn="xn--[a-z0-9\\-]{1,59}",o.src_domain_root="(?:"+o.src_xn+"|"+o.src_pseudo_letter+"{1,63})",o.src_domain="(?:"+o.src_xn+"|(?:"+o.src_pseudo_letter+")|(?:"+o.src_pseudo_letter+"(?:-|"+o.src_pseudo_letter+"){0,61}"+o.src_pseudo_letter+"))",o.src_host="(?:(?:(?:(?:"+o.src_domain+")\\.)*"+o.src_domain+"))",o.tpl_host_fuzzy="(?:"+o.src_ip4+"|(?:(?:(?:"+o.src_domain+")\\.)+(?:%TLDS%)))",o.tpl_host_no_ip_fuzzy="(?:(?:(?:"+o.src_domain+")\\.)+(?:%TLDS%))",o.src_host_strict=o.src_host+o.src_host_terminator,o.tpl_host_fuzzy_strict=o.tpl_host_fuzzy+o.src_host_terminator,o.src_host_port_strict=o.src_host+o.src_port+o.src_host_terminator,o.tpl_host_port_fuzzy_strict=o.tpl_host_fuzzy+o.src_port+o.src_host_terminator,o.tpl_host_port_no_ip_fuzzy_strict=o.tpl_host_no_ip_fuzzy+o.src_port+o.src_host_terminator,o.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+o.src_ZPCc+"|>|$))",o.tpl_email_fuzzy="(^|"+s+'|"|\\(|'+o.src_ZCc+")("+o.src_email_name+"@"+o.tpl_host_fuzzy_strict+")",o.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+o.src_ZPCc+"))((?![$+<=>^`||])"+o.tpl_host_port_fuzzy_strict+o.src_path+")",o.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+o.src_ZPCc+"))((?![$+<=>^`||])"+o.tpl_host_port_no_ip_fuzzy_strict+o.src_path+")",o}function o(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function s(e){return Object.prototype.toString.call(e)}function a(e){return"[object String]"===s(e)}function l(e){return"[object Object]"===s(e)}function c(e){return"[object RegExp]"===s(e)}function u(e){return"[object Function]"===s(e)}function d(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const h={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function p(e){return Object.keys(e||{}).reduce((function(e,t){return e||h.hasOwnProperty(t)}),!1)}const f={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},m="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",g="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function v(e){e.__index__=-1,e.__text_cache__=""}function y(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function b(){return function(e,t){t.normalize(e)}}function x(e){const t=e.re=i(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push(m),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const o=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){const n=e.__schemas__[t];if(null===n)return;const r={validate:null,link:null};if(e.__compiled__[t]=r,l(n))return c(n.validate)?r.validate=y(n.validate):u(n.validate)?r.validate=n.validate:s(t,n),void(u(n.normalize)?r.normalize=n.normalize:n.normalize?s(t,n):r.normalize=b());a(n)?o.push(t):s(t,n)})),o.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:b()};const h=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(d).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+h+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+h+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),v(e)}function S(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function w(e,t){const n=new S(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function _(e,t){if(!(this instanceof _))return new _(e,t);t||p(e)&&(t=e,e={}),this.__opts__=o({},h,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=o({},f,e),this.__compiled__={},this.__tlds__=g,this.__tlds_replaced__=!1,this.re={},x(this)}function C(e={},t={}){const n=new _(e,t);return E(n,t),{extensions:[{name:"autolink",level:"inline",start:e=>{const t=A(n,e);if(t)return t.index},tokenizer(e){if(this.lexer.state.inLink)return;const t=A(n,e);if(!t)return;let r;return 0===t.index?r=t.raw:1===t.index&&"<"===e.charAt(0)&&">"===e.charAt(t.lastIndex)&&(r=`<${t.raw}>`),r?{type:"link",raw:r,text:t.text,href:t.url,tokens:[{type:"text",raw:t.text,text:t.text}]}:void 0}}]}}function A(e,t){const n=e.match(t);if(n&&n.length)return n[0]}function E(e,t){const n=t.tlds;delete t.tlds;const r=t.tldsKeepOld;delete t.tldsKeepOld,n&&e.tlds(n,r)}return _.prototype.add=function(e,t){return this.__schemas__[e]=t,x(this),this},_.prototype.set=function(e){return this.__opts__=o(this.__opts__,e),this},_.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,o,s,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(i=this.testSchemaAt(e,t[2],a.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=s))),this.__index__>=0},_.prototype.pretest=function(e){return this.re.pretest.test(e)},_.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},_.prototype.match=function(e){const t=[];let n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(w(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(w(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},_.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,w(this,0)):null},_.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),x(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,x(this),this)},_.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},_.prototype.onCompile=function(){},C}();var Ix={};Ix=function(e){"use strict";const t=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/,n=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function r(e={}){return{extensions:[o(e,i(e,!1)),s(e,i(e,!0))]}}function i(t,n){return r=>e.renderToString(r.text,{...t,displayMode:r.displayMode})+(n?"\n":"")}function o(e,n){return{name:"inlineKatex",level:"inline",start(e){let n,r=e;for(;r;){if(n=r.indexOf("$"),-1===n)return;if((0===n||" "===r.charAt(n-1))&&r.substring(n).match(t))return n;r=r.substring(n+1).replace(/^\$+/,"")}},tokenizer(e,n){const r=e.match(t);if(r)return{type:"inlineKatex",raw:r[0],text:r[2].trim(),displayMode:2===r[1].length}},renderer:n}}function s(e,t){return{name:"blockKatex",level:"block",tokenizer(e,t){const r=e.match(n);if(r)return{type:"blockKatex",raw:r[0],text:r[2].trim(),displayMode:2===r[1].length}},renderer:t}}return r}(o("kqAxc"));const Rx=(e,t,n,r)=>{if(!t.rowspan)return"";return`${`<${n}`+(t.colspan>1?` colspan=${t.colspan}`:"")+(t.rowspan>1?` rowspan=${t.rowspan}`:"")+(r?` align=${r}`:"")+">"+e}</${n}>\n`},Px=(e,t,n=[])=>{var r,i,o;const s=[...e.matchAll(/(?:[^|\\]|\\.?)+(?:\|+|$)/g)].map((e=>e[0]));(null===(r=s[0])||void 0===r?void 0:r.trim())||s.shift(),(null===(i=s[s.length-1])||void 0===i?void 0:i.trim())||s.pop();let a,l,c,u,d,h=0;for(a=0;a<s.length;a++){if(c=s[a].split(/\|+$/)[0],s[a]={rowspan:1,colspan:Math.max(s[a].length-c.length,1),text:c.trim().replace(/\\\|/g,"|")},"^"===c.slice(-1)&&n.length)for(d=0,l=0;l<n.length;l++){if(u=n[l],d===h&&u.colspan===s[a].colspan){s[a].rowSpanTarget=null!==(o=u.rowSpanTarget)&&void 0!==o?o:u,s[a].rowSpanTarget.text+=` ${s[a].text.slice(0,-1)}`,s[a].rowSpanTarget.rowspan+=1,s[a].rowspan=0;break}if(d+=u.colspan,d>h)break}h+=s[a].colspan}if(h>t)s.splice(t);else for(;h<t;)s.push({colspan:1,text:""}),h+=1;return s};Hv.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=am(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}}),Hv.marked.use(t(Mx)()),Hv.marked.use(t(Ix)({throwOnError:!0,output:"htmlAndMathml"})),Hv.marked.use({extensions:[{name:"spanTable",level:"block",start(e){var t;return null===(t=e.match(/^\n *([^\n ].*\|.*)\n/))||void 0===t?void 0:t.index},tokenizer(e,t){const n=new RegExp("^ *([^\\n ].*\\|.*\\n(?: *[^\\s].*\\n)*?) {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n| {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)| {0,3}#{1,6} | {0,3}>| {4}[^\\n]| {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n| {0,3}(?:[*+-]|1[.)]) |<\\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?: +|\\n|\\/?>)|<(?:script|pre|style|textarea|!--)).*(?:\\n|$))*)\\n*|$)").exec(e);if(n){const e={type:"spanTable",header:n[1].replace(/\n$/,"").split("\n"),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]?n[3].replace(/\n$/,"").split("\n"):[]};e.header[0]=Px(e.header[0]);const t=e.header[0].reduce(((e,t)=>e+t.colspan),0);if(t===e.align.length){let r,i,o,s;e.raw=n[0];let a=e.align.length;for(r=0;r<a;r++)/^ *-+: *$/.test(e.align[r])?e.align[r]="right":/^ *:-+: *$/.test(e.align[r])?e.align[r]="center":/^ *:-+ *$/.test(e.align[r])?e.align[r]="left":e.align[r]=null;for(a=e.header.length,r=1;r<a;r++)e.header[r]=Px(e.header[r],t,e.header[r-1]);for(a=e.rows.length,r=0;r<a;r++)e.rows[r]=Px(e.rows[r],t,e.rows[r-1]);for(a=e.header.length,i=0;i<a;i++)for(s=e.header[i],o=0;o<s.length;o++)s[o].tokens=[],this.lexer.inline(s[o].text,s[o].tokens);for(a=e.rows.length,i=0;i<a;i++)for(s=e.rows[i],o=0;o<s.length;o++)s[o].tokens=[],this.lexer.inline(s[o].text,s[o].tokens);return e}}},renderer(e){let t,n,r,i,o,s,a='<div class="memori--responsive-table-wrapper"><table class="memori--table memori--table--compact">';for(a+="<thead>",t=0;t<e.header.length;t++){r=e.header[t];let o=0;for(a+="<tr>",n=0;n<r.length;n++)i=r[n],s=this.parser.parseInline(i.tokens),a+=Rx(s,i,"th",e.align[o]),o+=i.colspan;a+="</tr>"}if(a+="</thead>",e.rows.length){for(a+="<tbody>",t=0;t<e.rows.length;t++){for(r=e.rows[t],o=0,a+="<tr>",n=0;n<r.length;n++)i=r[n],s=this.parser.parseInline(i.tokens),a+=Rx(s,i,"td",e.align[o]),o+=i.colspan;a+="</tr>"}a+="</tbody>"}return a+="</table></div>",a}}]});var kx=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,sessionID:a,showFeedback:l,showWhyThisAnswer:u=!0,showCopyButton:d=!0,showTranslationOriginal:h=!1,simulateUserPrompt:p,showAIicon:f=!0,isFirst:m=!1,user:g,userAvatar:v,experts:y})=>{var b,x,S,w,_,C;const{t:A,i18n:E}=Se(),T=E.language||"en",[M,I]=(0,c.useState)(!1),R=e.translatedText||e.text,P=e.fromUser?R:t(Vv).sanitize(Hv.marked.parse(R.trim().replaceAll(/\[([^\]]+)\]\(([^\)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replaceAll(/```markdown([^```]+)```/g,"$1").replaceAll(/(?<!\\)\(/g,"\\(").replaceAll(/(?<!\\)\)/g,"\\)")).trim().replace(/\n/g,"<br>"),{ADD_ATTR:["target"]}).replaceAll(/(?<!\\)\[/g,"\\[").replaceAll(/(?<!\\)\]/g,"\\]").replace(/(<br>)+/g,"<br>").replace(/<p><\/p>/g,"<br>").replace(/<p><br><\/p>/g,"<br>"),k=e.fromUser?R:sm(om(im(R)));return(0,c.useLayoutEffect)((()=>{"undefined"==typeof window||e.fromUser||"MathJax"in window&&window.MathJax.typesetPromise&&window.MathJax.typesetPromise([".memori-chat--bubble-content"])}),[e.text,e.fromUser]),(0,s.jsxs)(s.Fragment,{children:[(e.initial||m)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(np,{show:!0,appear:!0,as:"div",className:t(ws)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&f||l&&p}),children:[!e.fromUser&&(0,s.jsx)(np.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(b=e.emitter)||void 0===b?void 0:b.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(x=e.emitter)||void 0===x?void 0:x.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(S=e.emitter)||void 0===S?void 0:S.length)&&n.enableBoardOfExperts&&(null==y?void 0:y.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(w=y.find((t=>t.name===e.emitter)))||void 0===w?void 0:w.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?gv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):gv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://www.aisuru.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?gv({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):gv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(np.Child,{as:"div",className:t(ws)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":!e.fromUser&&d||e.generatedByAI&&f||l&&p,"memori-chat--ai-generated":e.generatedByAI&&f,"memori-chat--with-feedback":l}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dir:"auto",className:"memori-chat--bubble-content",dangerouslySetInnerHTML:{__html:P}}),(!e.fromUser&&d||e.generatedByAI&&f||l&&p)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[!e.fromUser&&d&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:A("copy")||"Copy",className:"memori-chat--bubble-action-icon",icon:(0,s.jsx)(Wv,{"aria-label":A("copy")||"Copy"}),onClick:()=>navigator.clipboard.writeText(k)}),!e.fromUser&&d&&k!==e.text&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:A("copyRawCode")||"Copy raw code",className:"memori-chat--bubble-action-icon",icon:(0,s.jsx)(qv,{"aria-label":A("copyRawCode")||"Copy raw code"}),onClick:()=>navigator.clipboard.writeText(e.text)}),l&&!!p&&(0,s.jsx)(jv,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&p(e)}}),e.generatedByAI&&f&&(0,s.jsx)(xv,{align:"left",content:A("generatedByAI"),className:"memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai",children:(0,s.jsx)("span",{children:(0,s.jsx)(yv,{title:A("generatedByAI")||void 0})})}),h&&e.translatedText&&e.translatedText!==e.text&&(0,s.jsx)(xv,{align:"left",content:`${"it"===T?"Testo originale":"Original text"}: ${e.text}`,className:"memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai",children:(0,s.jsx)("span",{children:(0,s.jsx)(bv,{"aria-label":"it"===T?"Testo originale":"Original text"})})}),!e.fromUser&&e.questionAnswered&&o&&u&&(0,s.jsx)(Sf,{ghost:!0,shape:"circle",title:A("whyThisAnswer")||void 0,className:"memori-chat--bubble-action-icon",onClick:()=>I(!0),disabled:M,icon:(0,s.jsx)(Gv,{title:A("whyThisAnswer")||void 0})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:v&&"string"==typeof v||!v&&(null===(_=null==g?void 0:g.avatarURL)||void 0===_?void 0:_.length)?(0,s.jsx)(np.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(C=null==g?void 0:g.userName)&&void 0!==C?C:"User",src:null!=v?v:null==g?void 0:g.avatarURL})}):v?(0,s.jsx)(np.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:v}):(0,s.jsx)(np.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(vv,{})})})]}),M&&o&&(0,s.jsx)(Tx,{visible:M,message:e,closeDrawer:()=>I(!1),apiURL:o,sessionID:a})]})};c=o("85Hg2");var Ox=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var Nx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var Lx=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=Se(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(ws)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Sf,{className:t(ws)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(Nx,{}):(0,s.jsx)(Ox,{})})})]})})};var Dx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var Bx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var zx=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=Se(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},h=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>h()),[]),(0,s.jsx)(xv,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Sf,{primary:!0,className:t(ws)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:h,onTouchEnd:h,shape:"circle",icon:(0,s.jsx)(Bx,{})})})};var Fx=({dialogState:e,userMessage:n="",onChangeUserMessage:r,sendMessage:i,onTextareaFocus:o,onTextareaBlur:a,onTextareaPressEnter:l,showMicrophone:c=!1,microphoneMode:u="HOLD_TO_TALK",listening:d=!1,stopAudio:h,startListening:p,stopListening:f})=>{const{t:m}=Se();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)(Lx,{value:n,onChange:r,onPressEnter:l,onFocus:o,onBlur:a,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Sf,{shape:"circle",primary:!!(null==n?void 0:n.length),disabled:!n||0===n.length,className:"memori-chat-inputs--send",onClick:()=>{i(n),h(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:m("send")||"Send",icon:(0,s.jsx)(Dx,{})}),c&&"HOLD_TO_TALK"===u&&(0,s.jsx)(zx,{listening:d,startListening:p,stopListening:()=>{f(),(null==n?void 0:n.length)&&i(n)},stopAudio:h}),c&&"CONTINUOUS"===u&&(0,s.jsx)(Sf,{primary:!0,className:t(ws)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":d}),title:d?m("write_and_speak.micButtonPopoverListening")||"Listening":m("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{d?f():(h(),p())},shape:"circle",icon:(0,s.jsx)(Bx,{})})]})};c=o("85Hg2");const Ux={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},jx=(e=3)=>new Array(20*e).fill(" ").join("");var Hx=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${jx(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${jx()}`:""),[d,h]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)h((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${jx(n.delayAfter)}`),h(""),a(e)}else if(!r&&!n&&e){const e=Ux[t][Math.floor(Math.random()*Ux[t].length)];u(`${e.text}${jx(e.delayAfter)}`),h("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var Vx=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:h=[],authToken:p,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,showWhyThisAnswer:b=!0,showCopyButton:x=!0,showTranslationOriginal:S=!1,selectReceiverTag:w,preview:_=!1,instruct:C=!1,showInputs:A=!0,showMicrophone:E=!1,microphoneMode:T="HOLD_TO_TALK",sendOnEnter:M,setSendOnEnter:I,attachmentsMenuOpen:R,setAttachmentsMenuOpen:P,userMessage:k="",onChangeUserMessage:O,sendMessage:N,listening:L,isPlayingAudio:D,stopAudio:B,startListening:z,stopListening:F,resetTranscript:U,customMediaRenderer:j,user:H,userAvatar:V,experts:G})=>{var W,q,K,J,Q,Y,Z,X;const $=()=>{setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),200)};(0,c.useEffect)((()=>{!_&&$()}),[h,_]);return(0,s.jsxs)("div",{className:t(ws)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(J=null===(K=null===(q=null===(W=e.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0])||void 0===K?void 0:K.toUpperCase())&&void 0!==J?J:"EN",children:[(0,s.jsx)("div",{className:t(ws)("memori-chat--history",{"memori-chat--history-touch":Zf()}),children:(0,s.jsxs)("div",{className:t(ws)("memori-chat--content",{"memori-chat--content-touch":Zf()}),children:[(0,s.jsx)("div",{className:t(ws)("memori-chat--cover"),style:{backgroundImage:`url("${gv({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${gv({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://www.aisuru.com",apiURL:o})}")`}}),h.map(((l,u)=>{var d,p,w,_;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(kx,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,sessionID:r,simulateUserPrompt:m,showAIicon:y,showWhyThisAnswer:b,showTranslationOriginal:S,showFeedback:u===h.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:H,userAvatar:V,experts:G,showCopyButton:x}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(p=l.contextVars)&&void 0!==p?p:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(Ax,{simulateUserPrompt:m,media:null===(w=null==l?void 0:l.media)||void 0===w?void 0:w.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(_=null==l?void 0:l.media)||void 0===_?void 0:_.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:j})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&!l&&(0,s.jsx)(Ax,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(Hx,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(Z=null===(Y=null===(Q=e.culture)||void 0===Q?void 0:Q.split("-"))||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?$v:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(X=f.knownTags)&&void 0!==X?X:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Sf,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>w(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),A&&(0,s.jsx)(Fx,{userMessage:k,onChangeUserMessage:O,dialogState:f,instruct:C,authToken:p,sendMessage:N,microphoneMode:T,sendOnEnter:M,setSendOnEnter:I,attachmentsMenuOpen:R,setAttachmentsMenuOpen:P,onTextareaPressEnter:()=>{"keypress"===M&&(null==k?void 0:k.length)>0&&(F(),N(k),O(""),U())},onTextareaFocus:()=>{var e,t,n,r;F(),Zf()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{$()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),$())},startListening:z,stopListening:F,stopAudio:B,listening:L,isPlayingAudio:D,showMicrophone:E})]})}));c=o("85Hg2");var Gx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var Wx=({memoriName:e,blockedUntil:t,notEnoughCredits:n=!1,showGiverInfo:r=!1,showTitle:i=!1,marginLeft:o=!1})=>{const{t:a}=Se(),l=new Date(t||Date.now());return n||l>new Date(Date.now())?(0,s.jsx)(xv,{className:"blocked-memori-badge--tooltip",content:n?(0,s.jsx)(s.Fragment,{children:a("notEnoughCredits")}):(0,s.jsxs)(s.Fragment,{children:[!r&&a("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(l)}),r&&a("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(l)}),r&&` ${a("memoriBlockedReasonExceedChats")}`,r&&(0,s.jsx)("br",{}),r&&`\n${a("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(o?" margin-left":""),children:(0,s.jsx)(Gx,{className:"blocked-memori-badge--icon"})}),i&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:a("memoriBlockedTitle")})]})}):null};var qx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var Kx=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var Jx=({forceStatus:e,provider:t})=>{var n;const{t:r}=Se(),[i,o]=(0,c.useState)(null!=e?e:"operational"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json"),n=null===(e=(await t.json()).components.find((e=>"API"===e.name)))||void 0===e?void 0:e.status;return null!=n?n:"operational"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"operational",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e))).catch(console.log)}),[e,t]),"operational"!==i?(0,s.jsx)(xv,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(Gx,{className:"memori--completion-provider-status--icon"})}):null};var Qx=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{fill:"currentColor",d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"})});var Yx=({memori:e,tenant:t,language:n,userLang:r,setUserLang:i,baseUrl:o,apiUrl:a,position:l,openPositionDrawer:u,instruct:d=!1,clickedStart:h,onClickStart:p,initializeTTS:f,_TEST_forceProviderStatus:m,isUserLoggedIn:g=!1,user:v,showLogin:y=!1,setShowLoginDrawer:b,notEnoughCredits:x=!1,isMultilanguageEnabled:S})=>{var w;const{t:_,i18n:C}=Se(),[A,E]=(0,c.useState)(e.description),[T,M]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,r,i,s,a,l;(null!==(r=null===(t=C.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==r?r:"IT")!==(null!==(i=null==n?void 0:n.toUpperCase())&&void 0!==i?i:"IT")&&(null===(s=e.description)||void 0===s?void 0:s.length)&&vx(e.description,null!==(l=null===(a=C.language)||void 0===a?void 0:a.toUpperCase())&&void 0!==l?l:"IT",n,o).then((e=>{E(e.text)})).catch(console.error)}),[C.language,n,e.description,o]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${gv({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:o,apiURL:a})}"), url("${gv({type:"cover",tenantID:null==t?void 0:t.id,baseURL:o,apiURL:a})}")`},children:[!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(xv,{align:"left",content:_("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":_("completionsEnabled")||"Completions",children:(0,s.jsx)(yv,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(xv,{align:"left",content:_("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":_("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(qx,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(xv,{align:"left",content:_("nsfw"),children:(0,s.jsx)("span",{title:_("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(w=e.avatarURL)&&void 0!==w?w:gv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:o,apiURL:a})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?gv({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:o,apiURL:a}):gv({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:o,apiURL:a})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!l&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:_("write_and_speak.requirePositionHelp",{name:e.name})}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>u(),className:"memori--start-button",icon:(0,s.jsx)(Qx,{}),children:_("widget.position")})]}),(e.needsPosition&&l||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:A&&T?A:e.description}),A!==e.description&&(0,s.jsx)(Sf,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(bv,{}),onClick:()=>{M((e=>!e))},children:_(T?"showOriginalText":"showTranslatedText")})]}),S&&!d&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:_("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=r?r:C.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{i(e.target.value)},children:Yv.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Sf,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver||x,loading:h,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}f&&f(),p&&p()},className:"memori--start-button",children:_("write_and_speak."+(d?"instructButton":"tryMeButton"))}),(0,s.jsx)(Jx,{provider:e.completionProvider,forceStatus:m}),(0,s.jsx)("p",{className:"memori--start-description",children:_(d?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),(e.blockedUntil||x)&&(0,s.jsx)(Wx,{memoriName:e.name,blockedUntil:e.blockedUntil,notEnoughCredits:x,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!d&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(xv,{align:"left",content:_("deepThoughtHelper"),children:(0,s.jsx)(Kx,{})}),(0,s.jsx)("h2",{children:g&&(null==v?void 0:v.pAndCUAccepted)?_("deepThoughtDisclaimerTitle"):_("deepThought")}),g&&!(null==v?void 0:v.pAndCUAccepted)&&(0,s.jsx)("p",{children:_("deepThoughtPreDisclaimerNotAllowed")}),!g&&(0,s.jsx)("p",{children:_("deepThoughtPreDisclaimerUnlogged")}),!g&&y&&(0,s.jsx)("p",{children:(0,s.jsx)(Sf,{outlined:!0,padded:!1,onClick:()=>b(!0),children:"Login"})}),(0,s.jsx)("p",{className:"memori--deep-thought-disclaimer-text",children:_("deepThoughtDisclaimer")})]})]})]})},Zx=(c=o("85Hg2"),c=o("85Hg2"),Z=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function Xx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $x(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Xx(Object(r),!0).forEach((function(n){t(X)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class eS extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var tS=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(fy)(i,Zx),a=Se(e,$x($x({},s),{},{keyPrefix:n.keyPrefix})),l=t(Z)(a,3),u=l[0],d=l[1],h=l[2],p=$x($x({},s),{},{t:u,i18n:d,tReady:h});return n.withRef&&o?p.ref=o:!n.withRef&&o&&(p.forwardedRef=o),(0,c.createElement)(r,p)}i.displayName="withI18nextTranslation(".concat(ve(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(eS),nS=(c=o("85Hg2"),c=o("85Hg2"),{});e(nS,"REVISION",(()=>rS)),e(nS,"MOUSE",(()=>iS)),e(nS,"TOUCH",(()=>oS)),e(nS,"CullFaceNone",(()=>sS)),e(nS,"CullFaceBack",(()=>aS)),e(nS,"CullFaceFront",(()=>lS)),e(nS,"CullFaceFrontBack",(()=>cS)),e(nS,"BasicShadowMap",(()=>uS)),e(nS,"PCFShadowMap",(()=>dS)),e(nS,"PCFSoftShadowMap",(()=>hS)),e(nS,"VSMShadowMap",(()=>pS)),e(nS,"FrontSide",(()=>fS)),e(nS,"BackSide",(()=>mS)),e(nS,"DoubleSide",(()=>gS)),e(nS,"NoBlending",(()=>vS)),e(nS,"NormalBlending",(()=>yS)),e(nS,"AdditiveBlending",(()=>bS)),e(nS,"SubtractiveBlending",(()=>xS)),e(nS,"MultiplyBlending",(()=>SS)),e(nS,"CustomBlending",(()=>wS)),e(nS,"AddEquation",(()=>_S)),e(nS,"SubtractEquation",(()=>CS)),e(nS,"ReverseSubtractEquation",(()=>AS)),e(nS,"MinEquation",(()=>ES)),e(nS,"MaxEquation",(()=>TS)),e(nS,"ZeroFactor",(()=>MS)),e(nS,"OneFactor",(()=>IS)),e(nS,"SrcColorFactor",(()=>RS)),e(nS,"OneMinusSrcColorFactor",(()=>PS)),e(nS,"SrcAlphaFactor",(()=>kS)),e(nS,"OneMinusSrcAlphaFactor",(()=>OS)),e(nS,"DstAlphaFactor",(()=>NS)),e(nS,"OneMinusDstAlphaFactor",(()=>LS)),e(nS,"DstColorFactor",(()=>DS)),e(nS,"OneMinusDstColorFactor",(()=>BS)),e(nS,"SrcAlphaSaturateFactor",(()=>zS)),e(nS,"NeverDepth",(()=>FS)),e(nS,"AlwaysDepth",(()=>US)),e(nS,"LessDepth",(()=>jS)),e(nS,"LessEqualDepth",(()=>HS)),e(nS,"EqualDepth",(()=>VS)),e(nS,"GreaterEqualDepth",(()=>GS)),e(nS,"GreaterDepth",(()=>WS)),e(nS,"NotEqualDepth",(()=>qS)),e(nS,"MultiplyOperation",(()=>KS)),e(nS,"MixOperation",(()=>JS)),e(nS,"AddOperation",(()=>QS)),e(nS,"NoToneMapping",(()=>YS)),e(nS,"LinearToneMapping",(()=>ZS)),e(nS,"ReinhardToneMapping",(()=>XS)),e(nS,"CineonToneMapping",(()=>$S)),e(nS,"ACESFilmicToneMapping",(()=>ew)),e(nS,"CustomToneMapping",(()=>tw)),e(nS,"UVMapping",(()=>nw)),e(nS,"CubeReflectionMapping",(()=>rw)),e(nS,"CubeRefractionMapping",(()=>iw)),e(nS,"EquirectangularReflectionMapping",(()=>ow)),e(nS,"EquirectangularRefractionMapping",(()=>sw)),e(nS,"CubeUVReflectionMapping",(()=>aw)),e(nS,"RepeatWrapping",(()=>lw)),e(nS,"ClampToEdgeWrapping",(()=>cw)),e(nS,"MirroredRepeatWrapping",(()=>uw)),e(nS,"NearestFilter",(()=>dw)),e(nS,"NearestMipmapNearestFilter",(()=>hw)),e(nS,"NearestMipMapNearestFilter",(()=>pw)),e(nS,"NearestMipmapLinearFilter",(()=>fw)),e(nS,"NearestMipMapLinearFilter",(()=>mw)),e(nS,"LinearFilter",(()=>gw)),e(nS,"LinearMipmapNearestFilter",(()=>vw)),e(nS,"LinearMipMapNearestFilter",(()=>yw)),e(nS,"LinearMipmapLinearFilter",(()=>bw)),e(nS,"LinearMipMapLinearFilter",(()=>xw)),e(nS,"UnsignedByteType",(()=>Sw)),e(nS,"ByteType",(()=>ww)),e(nS,"ShortType",(()=>_w)),e(nS,"UnsignedShortType",(()=>Cw)),e(nS,"IntType",(()=>Aw)),e(nS,"UnsignedIntType",(()=>Ew)),e(nS,"FloatType",(()=>Tw)),e(nS,"HalfFloatType",(()=>Mw)),e(nS,"UnsignedShort4444Type",(()=>Iw)),e(nS,"UnsignedShort5551Type",(()=>Rw)),e(nS,"UnsignedInt248Type",(()=>Pw)),e(nS,"AlphaFormat",(()=>kw)),e(nS,"RGBFormat",(()=>Ow)),e(nS,"RGBAFormat",(()=>Nw)),e(nS,"LuminanceFormat",(()=>Lw)),e(nS,"LuminanceAlphaFormat",(()=>Dw)),e(nS,"DepthFormat",(()=>Bw)),e(nS,"DepthStencilFormat",(()=>zw)),e(nS,"RedFormat",(()=>Fw)),e(nS,"RedIntegerFormat",(()=>Uw)),e(nS,"RGFormat",(()=>jw)),e(nS,"RGIntegerFormat",(()=>Hw)),e(nS,"RGBAIntegerFormat",(()=>Vw)),e(nS,"RGB_S3TC_DXT1_Format",(()=>Gw)),e(nS,"RGBA_S3TC_DXT1_Format",(()=>Ww)),e(nS,"RGBA_S3TC_DXT3_Format",(()=>qw)),e(nS,"RGBA_S3TC_DXT5_Format",(()=>Kw)),e(nS,"RGB_PVRTC_4BPPV1_Format",(()=>Jw)),e(nS,"RGB_PVRTC_2BPPV1_Format",(()=>Qw)),e(nS,"RGBA_PVRTC_4BPPV1_Format",(()=>Yw)),e(nS,"RGBA_PVRTC_2BPPV1_Format",(()=>Zw)),e(nS,"RGB_ETC1_Format",(()=>Xw)),e(nS,"RGB_ETC2_Format",(()=>$w)),e(nS,"RGBA_ETC2_EAC_Format",(()=>e_)),e(nS,"RGBA_ASTC_4x4_Format",(()=>t_)),e(nS,"RGBA_ASTC_5x4_Format",(()=>n_)),e(nS,"RGBA_ASTC_5x5_Format",(()=>r_)),e(nS,"RGBA_ASTC_6x5_Format",(()=>i_)),e(nS,"RGBA_ASTC_6x6_Format",(()=>o_)),e(nS,"RGBA_ASTC_8x5_Format",(()=>s_)),e(nS,"RGBA_ASTC_8x6_Format",(()=>a_)),e(nS,"RGBA_ASTC_8x8_Format",(()=>l_)),e(nS,"RGBA_ASTC_10x5_Format",(()=>c_)),e(nS,"RGBA_ASTC_10x6_Format",(()=>u_)),e(nS,"RGBA_ASTC_10x8_Format",(()=>d_)),e(nS,"RGBA_ASTC_10x10_Format",(()=>h_)),e(nS,"RGBA_ASTC_12x10_Format",(()=>p_)),e(nS,"RGBA_ASTC_12x12_Format",(()=>f_)),e(nS,"RGBA_BPTC_Format",(()=>m_)),e(nS,"LoopOnce",(()=>g_)),e(nS,"LoopRepeat",(()=>v_)),e(nS,"LoopPingPong",(()=>y_)),e(nS,"InterpolateDiscrete",(()=>b_)),e(nS,"InterpolateLinear",(()=>x_)),e(nS,"InterpolateSmooth",(()=>S_)),e(nS,"ZeroCurvatureEnding",(()=>w_)),e(nS,"ZeroSlopeEnding",(()=>__)),e(nS,"WrapAroundEnding",(()=>C_)),e(nS,"NormalAnimationBlendMode",(()=>A_)),e(nS,"AdditiveAnimationBlendMode",(()=>E_)),e(nS,"TrianglesDrawMode",(()=>T_)),e(nS,"TriangleStripDrawMode",(()=>M_)),e(nS,"TriangleFanDrawMode",(()=>I_)),e(nS,"LinearEncoding",(()=>R_)),e(nS,"sRGBEncoding",(()=>P_)),e(nS,"BasicDepthPacking",(()=>k_)),e(nS,"RGBADepthPacking",(()=>O_)),e(nS,"TangentSpaceNormalMap",(()=>N_)),e(nS,"ObjectSpaceNormalMap",(()=>L_)),e(nS,"NoColorSpace",(()=>D_)),e(nS,"SRGBColorSpace",(()=>B_)),e(nS,"LinearSRGBColorSpace",(()=>z_)),e(nS,"ZeroStencilOp",(()=>F_)),e(nS,"KeepStencilOp",(()=>U_)),e(nS,"ReplaceStencilOp",(()=>j_)),e(nS,"IncrementStencilOp",(()=>H_)),e(nS,"DecrementStencilOp",(()=>V_)),e(nS,"IncrementWrapStencilOp",(()=>G_)),e(nS,"DecrementWrapStencilOp",(()=>W_)),e(nS,"InvertStencilOp",(()=>q_)),e(nS,"NeverStencilFunc",(()=>K_)),e(nS,"LessStencilFunc",(()=>J_)),e(nS,"EqualStencilFunc",(()=>Q_)),e(nS,"LessEqualStencilFunc",(()=>Y_)),e(nS,"GreaterStencilFunc",(()=>Z_)),e(nS,"NotEqualStencilFunc",(()=>X_)),e(nS,"GreaterEqualStencilFunc",(()=>$_)),e(nS,"AlwaysStencilFunc",(()=>eC)),e(nS,"StaticDrawUsage",(()=>tC)),e(nS,"DynamicDrawUsage",(()=>nC)),e(nS,"StreamDrawUsage",(()=>rC)),e(nS,"StaticReadUsage",(()=>iC)),e(nS,"DynamicReadUsage",(()=>oC)),e(nS,"StreamReadUsage",(()=>sC)),e(nS,"StaticCopyUsage",(()=>aC)),e(nS,"DynamicCopyUsage",(()=>lC)),e(nS,"StreamCopyUsage",(()=>cC)),e(nS,"GLSL1",(()=>uC)),e(nS,"GLSL3",(()=>dC)),e(nS,"_SRGBAFormat",(()=>hC)),e(nS,"EventDispatcher",(()=>pC)),e(nS,"MathUtils",(()=>TC)),e(nS,"Vector2",(()=>MC)),e(nS,"Matrix3",(()=>IC)),e(nS,"ColorManagement",(()=>BC)),e(nS,"Color",(()=>GC)),e(nS,"ImageUtils",(()=>qC)),e(nS,"Source",(()=>KC)),e(nS,"Texture",(()=>YC)),e(nS,"Vector4",(()=>ZC)),e(nS,"WebGLRenderTarget",(()=>XC)),e(nS,"DataArrayTexture",(()=>$C)),e(nS,"WebGLArrayRenderTarget",(()=>eA)),e(nS,"Data3DTexture",(()=>tA)),e(nS,"WebGL3DRenderTarget",(()=>nA)),e(nS,"WebGLMultipleRenderTargets",(()=>rA)),e(nS,"Quaternion",(()=>iA)),e(nS,"Vector3",(()=>oA)),e(nS,"Box3",(()=>lA)),e(nS,"Sphere",(()=>TA)),e(nS,"Ray",(()=>LA)),e(nS,"Matrix4",(()=>DA)),e(nS,"Euler",(()=>qA)),e(nS,"Layers",(()=>KA)),e(nS,"Object3D",(()=>aE)),e(nS,"Triangle",(()=>yE)),e(nS,"Material",(()=>xE)),e(nS,"MeshBasicMaterial",(()=>SE)),e(nS,"BufferAttribute",(()=>CE)),e(nS,"Int8BufferAttribute",(()=>AE)),e(nS,"Uint8BufferAttribute",(()=>EE)),e(nS,"Uint8ClampedBufferAttribute",(()=>TE)),e(nS,"Int16BufferAttribute",(()=>ME)),e(nS,"Uint16BufferAttribute",(()=>IE)),e(nS,"Int32BufferAttribute",(()=>RE)),e(nS,"Uint32BufferAttribute",(()=>PE)),e(nS,"Float16BufferAttribute",(()=>kE)),e(nS,"Float32BufferAttribute",(()=>OE)),e(nS,"Float64BufferAttribute",(()=>NE)),e(nS,"BufferGeometry",(()=>HE)),e(nS,"Mesh",(()=>sT)),e(nS,"BoxGeometry",(()=>lT)),e(nS,"UniformsUtils",(()=>dT)),e(nS,"ShaderMaterial",(()=>hT)),e(nS,"Camera",(()=>pT)),e(nS,"PerspectiveCamera",(()=>fT)),e(nS,"CubeCamera",(()=>gT)),e(nS,"CubeTexture",(()=>vT)),e(nS,"WebGLCubeRenderTarget",(()=>yT)),e(nS,"Plane",(()=>wT)),e(nS,"Frustum",(()=>AT)),e(nS,"PlaneGeometry",(()=>MT)),e(nS,"ShaderChunk",(()=>IT)),e(nS,"UniformsLib",(()=>RT)),e(nS,"ShaderLib",(()=>PT)),e(nS,"OrthographicCamera",(()=>zT)),e(nS,"PMREMGenerator",(()=>KT)),e(nS,"MeshDepthMaterial",(()=>VI)),e(nS,"MeshDistanceMaterial",(()=>GI)),e(nS,"WebGLUtils",(()=>JI)),e(nS,"ArrayCamera",(()=>QI)),e(nS,"Group",(()=>YI)),e(nS,"DepthTexture",(()=>$I)),e(nS,"WebGLRenderer",(()=>rR)),e(nS,"WebGL1Renderer",(()=>iR)),e(nS,"FogExp2",(()=>oR)),e(nS,"Fog",(()=>sR)),e(nS,"Scene",(()=>aR)),e(nS,"InterleavedBuffer",(()=>lR)),e(nS,"InterleavedBufferAttribute",(()=>uR)),e(nS,"SpriteMaterial",(()=>dR)),e(nS,"Sprite",(()=>AR)),e(nS,"LOD",(()=>IR)),e(nS,"SkinnedMesh",(()=>LR)),e(nS,"Bone",(()=>DR)),e(nS,"DataTexture",(()=>BR)),e(nS,"Skeleton",(()=>UR)),e(nS,"InstancedBufferAttribute",(()=>jR)),e(nS,"InstancedMesh",(()=>qR)),e(nS,"LineBasicMaterial",(()=>KR)),e(nS,"Line",(()=>$R)),e(nS,"LineSegments",(()=>nP)),e(nS,"LineLoop",(()=>rP)),e(nS,"PointsMaterial",(()=>iP)),e(nS,"Points",(()=>cP)),e(nS,"VideoTexture",(()=>dP)),e(nS,"FramebufferTexture",(()=>hP)),e(nS,"CompressedTexture",(()=>pP)),e(nS,"CanvasTexture",(()=>fP)),e(nS,"Curve",(()=>mP)),e(nS,"EllipseCurve",(()=>gP)),e(nS,"ArcCurve",(()=>vP)),e(nS,"CatmullRomCurve3",(()=>_P)),e(nS,"CubicBezierCurve",(()=>TP)),e(nS,"CubicBezierCurve3",(()=>MP)),e(nS,"LineCurve",(()=>IP)),e(nS,"LineCurve3",(()=>RP)),e(nS,"QuadraticBezierCurve",(()=>PP)),e(nS,"QuadraticBezierCurve3",(()=>kP)),e(nS,"SplineCurve",(()=>OP)),e(nS,"CurvePath",(()=>LP)),e(nS,"Path",(()=>DP)),e(nS,"LatheGeometry",(()=>BP)),e(nS,"CapsuleGeometry",(()=>zP)),e(nS,"CircleGeometry",(()=>FP)),e(nS,"CylinderGeometry",(()=>UP)),e(nS,"ConeGeometry",(()=>jP)),e(nS,"PolyhedronGeometry",(()=>HP)),e(nS,"DodecahedronGeometry",(()=>VP)),e(nS,"EdgesGeometry",(()=>JP)),e(nS,"Shape",(()=>QP)),e(nS,"ShapeUtils",(()=>Sk)),e(nS,"ExtrudeGeometry",(()=>Ck)),e(nS,"IcosahedronGeometry",(()=>Ek)),e(nS,"OctahedronGeometry",(()=>Tk)),e(nS,"RingGeometry",(()=>Mk)),e(nS,"ShapeGeometry",(()=>Ik)),e(nS,"SphereGeometry",(()=>Rk)),e(nS,"TetrahedronGeometry",(()=>Pk)),e(nS,"TorusGeometry",(()=>kk)),e(nS,"TorusKnotGeometry",(()=>Ok)),e(nS,"TubeGeometry",(()=>Nk)),e(nS,"WireframeGeometry",(()=>Lk)),e(nS,"ShadowMaterial",(()=>zk)),e(nS,"RawShaderMaterial",(()=>Fk)),e(nS,"MeshStandardMaterial",(()=>Uk)),e(nS,"MeshPhysicalMaterial",(()=>jk)),e(nS,"MeshPhongMaterial",(()=>Hk)),e(nS,"MeshToonMaterial",(()=>Vk)),e(nS,"MeshNormalMaterial",(()=>Gk)),e(nS,"MeshLambertMaterial",(()=>Wk)),e(nS,"MeshMatcapMaterial",(()=>qk)),e(nS,"LineDashedMaterial",(()=>Kk)),e(nS,"AnimationUtils",(()=>eO)),e(nS,"Interpolant",(()=>tO)),e(nS,"CubicInterpolant",(()=>nO)),e(nS,"LinearInterpolant",(()=>rO)),e(nS,"DiscreteInterpolant",(()=>iO)),e(nS,"KeyframeTrack",(()=>oO)),e(nS,"BooleanKeyframeTrack",(()=>sO)),e(nS,"ColorKeyframeTrack",(()=>aO)),e(nS,"NumberKeyframeTrack",(()=>lO)),e(nS,"QuaternionLinearInterpolant",(()=>cO)),e(nS,"QuaternionKeyframeTrack",(()=>uO)),e(nS,"StringKeyframeTrack",(()=>dO)),e(nS,"VectorKeyframeTrack",(()=>hO)),e(nS,"AnimationClip",(()=>pO)),e(nS,"Cache",(()=>mO)),e(nS,"LoadingManager",(()=>gO)),e(nS,"DefaultLoadingManager",(()=>vO)),e(nS,"Loader",(()=>yO)),e(nS,"FileLoader",(()=>SO)),e(nS,"AnimationLoader",(()=>wO)),e(nS,"CompressedTextureLoader",(()=>_O)),e(nS,"ImageLoader",(()=>CO)),e(nS,"CubeTextureLoader",(()=>AO)),e(nS,"DataTextureLoader",(()=>EO)),e(nS,"TextureLoader",(()=>TO)),e(nS,"Light",(()=>MO)),e(nS,"HemisphereLight",(()=>IO)),e(nS,"SpotLight",(()=>LO)),e(nS,"PointLight",(()=>UO)),e(nS,"DirectionalLight",(()=>HO)),e(nS,"AmbientLight",(()=>VO)),e(nS,"RectAreaLight",(()=>GO)),e(nS,"SphericalHarmonics3",(()=>WO)),e(nS,"LightProbe",(()=>qO)),e(nS,"MaterialLoader",(()=>KO)),e(nS,"LoaderUtils",(()=>JO)),e(nS,"InstancedBufferGeometry",(()=>QO)),e(nS,"BufferGeometryLoader",(()=>YO)),e(nS,"ObjectLoader",(()=>ZO)),e(nS,"ImageBitmapLoader",(()=>tN)),e(nS,"AudioContext",(()=>rN)),e(nS,"AudioLoader",(()=>iN)),e(nS,"HemisphereLightProbe",(()=>oN)),e(nS,"AmbientLightProbe",(()=>sN)),e(nS,"StereoCamera",(()=>uN)),e(nS,"Clock",(()=>dN)),e(nS,"AudioListener",(()=>vN)),e(nS,"Audio",(()=>yN)),e(nS,"PositionalAudio",(()=>_N)),e(nS,"AudioAnalyser",(()=>CN)),e(nS,"PropertyMixer",(()=>AN)),e(nS,"PropertyBinding",(()=>kN)),e(nS,"AnimationObjectGroup",(()=>ON)),e(nS,"AnimationMixer",(()=>DN)),e(nS,"Uniform",(()=>BN)),e(nS,"UniformsGroup",(()=>FN)),e(nS,"InstancedInterleavedBuffer",(()=>UN)),e(nS,"GLBufferAttribute",(()=>jN)),e(nS,"Raycaster",(()=>HN)),e(nS,"Spherical",(()=>WN)),e(nS,"Cylindrical",(()=>qN)),e(nS,"Box2",(()=>JN)),e(nS,"Line3",(()=>ZN)),e(nS,"SpotLightHelper",(()=>$N)),e(nS,"SkeletonHelper",(()=>rL)),e(nS,"PointLightHelper",(()=>oL)),e(nS,"HemisphereLightHelper",(()=>cL)),e(nS,"GridHelper",(()=>uL)),e(nS,"PolarGridHelper",(()=>dL)),e(nS,"DirectionalLightHelper",(()=>mL)),e(nS,"CameraHelper",(()=>yL)),e(nS,"BoxHelper",(()=>SL)),e(nS,"Box3Helper",(()=>wL)),e(nS,"PlaneHelper",(()=>_L)),e(nS,"ArrowHelper",(()=>TL)),e(nS,"AxesHelper",(()=>ML)),e(nS,"ShapePath",(()=>IL)),e(nS,"DataUtils",(()=>kL)),e(nS,"ImmediateRenderObject",(()=>OL)),e(nS,"WebGLMultisampleRenderTarget",(()=>NL)),e(nS,"DataTexture2DArray",(()=>LL)),e(nS,"DataTexture3D",(()=>DL)),e(nS,"BoxBufferGeometry",(()=>BL)),e(nS,"CapsuleBufferGeometry",(()=>zL)),e(nS,"CircleBufferGeometry",(()=>FL)),e(nS,"ConeBufferGeometry",(()=>UL)),e(nS,"CylinderBufferGeometry",(()=>jL)),e(nS,"DodecahedronBufferGeometry",(()=>HL)),e(nS,"ExtrudeBufferGeometry",(()=>VL)),e(nS,"IcosahedronBufferGeometry",(()=>GL)),e(nS,"LatheBufferGeometry",(()=>WL)),e(nS,"OctahedronBufferGeometry",(()=>qL)),e(nS,"PlaneBufferGeometry",(()=>KL)),e(nS,"PolyhedronBufferGeometry",(()=>JL)),e(nS,"RingBufferGeometry",(()=>QL)),e(nS,"ShapeBufferGeometry",(()=>YL)),e(nS,"SphereBufferGeometry",(()=>ZL)),e(nS,"TetrahedronBufferGeometry",(()=>XL)),e(nS,"TorusBufferGeometry",(()=>$L)),e(nS,"TorusKnotBufferGeometry",(()=>eD)),e(nS,"TubeBufferGeometry",(()=>tD));
|
|
240
240
|
/**
|
|
241
241
|
* @license
|
|
242
242
|
* Copyright 2010-2022 Three.js Authors
|
|
@@ -247,4 +247,4 @@ const rS="144",iS={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},oS={ROTATE:0,
|
|
|
247
247
|
* @license qrcode.react
|
|
248
248
|
* Copyright (c) Paul O'Shannessy
|
|
249
249
|
* SPDX-License-Identifier: ISC
|
|
250
|
-
*/function YU(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function ZU(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function XU(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var $U=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function ej(e){const n=e,{value:r,size:i=WU,level:o=qU,bgColor:s=KU,fgColor:a=JU,includeMargin:l=QU,style:u,imageSettings:d}=n,h=HU(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),p=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=VU.QrCode.encodeText(r,GU[o]).getModules();const c=l?4:0,u=n.length+2*c,h=XU(n,i,l,d),p=m.current,g=null!=h&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;g&&null!=h.excavation&&(n=ZU(n,h.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,$U?t.fill(new Path2D(YU(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(p,h.x+c,h.y+c,h.w,h.h)}})),(0,c.useEffect)((()=>{v(!1)}),[p]);const y=jU({height:i,width:i},u);let b=null;return null!=p&&(b=t(c).createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",jU({style:y,height:i,width:i,ref:f},h)),b)}var tj=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=Se(),[h,p]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||p(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${h}`,icon:TU},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${h}`,icon:MU},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${h}`,icon:IU},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${h}`,icon:RU},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${h}`,icon:LU},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${h}`,icon:PU}];return(0,s.jsxs)(Dv,{as:"div",className:t(ws)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Dv.Button,{className:t(ws)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(kU,{})})}),(0,s.jsxs)(Dv.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Dv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Sf,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(dx,{}),onClick:()=>{h&&navigator.clipboard.writeText(h)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Dv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(ws)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(Dv.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(ej,{id:"qr-canvas",value:null!=h?h:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(Sf,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(OU,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var nj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var rj=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var ij=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var oj=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:h,setSpeakerMuted:p,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,showLogin:x=!0,setShowLoginDrawer:S,clearHistory:w,loginToken:_,user:C,sessionID:A})=>{const{t:E}=Se(),[T,M]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&M(!0)}),[]),(0,s.jsxs)("div",{className:t(ws)("memori-header",e),children:[n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[0!==o.latitude&&0!==o.longitude&&(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--position",title:E("widget.position")||"Position",icon:(0,s.jsx)(Qx,{}),onClick:()=>a(!0)})]}),y&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:E("reload")||"Reload",icon:(0,s.jsx)(rj,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:E("clearHistory")||"Clear chat",icon:(0,s.jsx)(ij,{}),onClick:w}),T&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?E("fullscreenExit")||"Exit fullscreen":E("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(Nx,{}):(0,s.jsx)(nj,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),R(!1)):(document.documentElement.requestFullscreen(),R(!0))}}),n.enableDeepThought&&!!_&&(null==C?void 0:C.pAndCUAccepted)&&(0,s.jsx)(Sf,{primary:!!A&&!!f,shape:"circle",icon:(0,s.jsx)(Kx,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!A,onClick:()=>u(!0),title:E("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",icon:(0,s.jsx)(qx,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!A,onClick:()=>d(!0),title:E("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:h?(0,s.jsx)(nU,{}):(0,s.jsx)(iU,{}),onClick:()=>p(!h),title:E("widget.sound")||"Sound"}),(0,s.jsx)(AU,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(EU,{}),onClick:()=>l(!0),title:E("widget.settings")||"Settings"}),m&&(0,s.jsx)(tj,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),x&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(vv,{}),onClick:()=>S(!0),title:_?E("login.user")||"User":E("login.login")||"Login"})]})};var sj=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{const i="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator"===(null==e?void 0:e.theme)?"twincreator":"aisuru";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://aisuru.com/images/${i}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"sr-only",children:"Powered by"}),(0,s.jsx)("a",{href:`https://memori.ai/${"it"===(null==t?void 0:t.toLowerCase())?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},aj=(c=o("85Hg2"),c=o("85Hg2"),(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(aj||{})),lj=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(lj||{}),cj=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(cj||{}),uj=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(uj||{});function dj(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Cp(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let hj={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return lh(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=dj(e),i=mm(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=dj(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;lh(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=dj(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},pj=(0,c.createContext)(null);function fj(e){let t=(0,c.useContext)(pj);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,fj),t}return t}function mj(e,t){return lh(t.type,hj,e,t)}pj.displayName="ListboxContext";let gj=c.Fragment,vj=mh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...h}=e;const p=u?"horizontal":"vertical";let f=Ph(n),[m,g]=xm(r,s,i),v=(0,c.useReducer)(mj,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Mh("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:p,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:x,buttonRef:S},w]=v;b.current.value=m,b.current.mode=d?1:0,_h((()=>{b.current.onChange=e=>lh(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),_h((()=>w({type:2,disabled:l})),[l]),_h((()=>w({type:3,orientation:p})),[p]),rf([S,x],((e,t)=>{var n;w({type:1}),xp(t,bp.Loose)||(e.preventDefault(),null==(n=S.current)||n.focus())}),0===y);let _=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),C={ref:f};return t(c).createElement(pj.Provider,{value:v},t(c).createElement(Sh,{value:lh(y,{0:bh.Open,1:bh.Closed})},null!=o&&null!=m&&gm({[o]:m}).map((([e,n])=>t(c).createElement(dp,{features:up.Hidden,...gh({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),hh({ourProps:C,theirProps:h,slot:_,defaultTag:gj,name:"Listbox"})))})),yj=mh((function(e,t){var n;let[r,i]=fj("Listbox.Button"),o=Ph(r.buttonRef,t),s=`headlessui-listbox-button-${cp()}`,a=Uh(),l=Mh((e=>{switch(e.key){case ip.Space:case ip.Enter:case ip.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:fm.First})}));break;case ip.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:fm.Last})}))}})),u=Mh((e=>{if(e.key===ip.Space)e.preventDefault()})),d=Mh((e=>{if(op(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),h=um((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),p=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return hh({ourProps:{ref:o,id:s,type:hm(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":h,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:p,defaultTag:"button",name:"Listbox.Button"})})),bj=mh((function(e,t){let[n]=fj("Listbox.Label"),r=`headlessui-listbox-label-${cp()}`;return hh({ourProps:{ref:Ph(n.labelRef,t),id:r,onClick:Mh((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),xj=uh.RenderStrategy|uh.Static,Sj=mh((function(e,t){var n;let[r,i]=fj("Listbox.Options"),o=Ph(r.optionsRef,t),s=`headlessui-listbox-options-${cp()}`,a=Uh(),l=Uh(),u=xh(),d=null!==u?u===bh.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=hp(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let h=Mh((e=>{switch(l.dispose(),e.key){case ip.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case ip.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),Nh().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case lh(r.orientation,{vertical:ip.ArrowDown,horizontal:ip.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.Next});case lh(r.orientation,{vertical:ip.ArrowUp,horizontal:ip.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.Previous});case ip.Home:case ip.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.First});case ip.End:case ip.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.Last});case ip.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case ip.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),p=um((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return hh({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":p,"aria-orientation":r.orientation,id:s,onKeyDown:h,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:xj,visible:d,name:"Listbox.Options"})})),wj=mh((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=fj("Listbox.Option"),a=`headlessui-listbox-option-${cp()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,h=lh(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),p=(0,c.useRef)(null),f=Ph(t,p);_h((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=Nh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:p});_h((()=>{m.current.disabled=n}),[m,n]),_h((()=>{m.current.value=r}),[m,r]),_h((()=>{var e,t;m.current.textValue=null==(t=null==(e=p.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,p]);let g=Mh((()=>o.propsRef.current.onChange(r)));_h((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Mh((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),Nh().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Mh((()=>{if(n)return s({type:4,focus:fm.Nothing});s({type:4,focus:fm.Specific,id:a})})),b=Mh((()=>{n||l||s({type:4,focus:fm.Specific,id:a,trigger:0})})),x=Mh((()=>{n||!l||s({type:4,focus:fm.Nothing})})),S=(0,c.useMemo)((()=>({active:l,selected:h,disabled:n})),[l,h,n]);return hh({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":h,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:x,onMouseLeave:x},theirProps:i,slot:S,defaultTag:"li",name:"Listbox.Option"})})),_j=Object.assign(vj,{Button:yj,Label:bj,Options:Sj,Option:wj});var Cj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const Aj={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},Ej=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=Se(),[o,a]=(0,c.useState)(e?"string"==typeof e?_s.DateTime.fromISO(e):_s.DateTime.fromJSDate(e):_s.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(_j,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(_j.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(_j.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(_j.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(_j,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(_j.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(_j.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:Aj["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori--date-selector__select-options",children:Aj["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(_j.Option,{className:"memori--date-selector__select-option",value:o.set({month:Aj["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(_j,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(_j.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(_j.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori--date-selector__select-options",children:[...Array(_s.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(_j.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));Ej.displayName="DateSelector";var Tj=Ej;c=o("85Hg2");var Mj=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=Se(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,h]=(0,c.useState)(!1),p=(0,c.useCallback)((()=>{if(h(!0),!o)return t(Ju).error(i("requiredField")),u(i("requiredField")||"Required field"),void h(!1);if(_s.DateTime.now().diff(o,"years").years<r)return t(Ju).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void h(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Km,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),p()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(Tj,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Sf,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var Ij=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const h=(0,c.useRef)(null);return(0,c.useEffect)((()=>{h.current&&(h.current.indeterminate=i)}),[h,i]),(0,s.jsxs)("label",{className:t(ws)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:h,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var Rj=({className:e,value:n,name:r,displayValue:i,options:o,onChange:a,disabled:l=!1,label:u,placeholder:d})=>(0,s.jsx)("div",{className:t(ws)("memori-select",e),children:(0,s.jsxs)(_j,{value:n,onChange:e=>{a(e)},disabled:l,name:r,children:[u&&(0,s.jsxs)(_j.Label,{className:"memori-select--label",children:[u,":"]}),(0,s.jsxs)(_j.Button,{"aria-label":u,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(ws)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?i||n:d}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori-select--options",children:o.map((e=>(0,s.jsx)(_j.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const Pj={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken",location:"@memori:location"},kj=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=Pj[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},Oj=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=Pj[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},Nj=e=>{var t;try{window.localStorage.removeItem(null!==(t=Pj[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},Lj=[2,3,5,10,15,20,30,60];var Dj=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:h})=>{const{t:p}=Se();return(0,s.jsxs)(_f,{className:"memori-settings-drawer",open:e,onClose:n,title:p("widget.settings")||"Settings",description:p("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[p("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)(eU,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),Oj("microphoneMode",t)},children:[(0,s.jsx)(eU.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(eU.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(Rj,{label:p("write_and_speak.secondsLabel")||"Seconds",placeholder:p("write_and_speak.secondsLabel")||"Seconds",options:Lj.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),Oj("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[p("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)(eU,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),Oj("controlsPosition",e)},children:[(0,s.jsx)(eU.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("center")||"Center"})}),(0,s.jsx)(eU.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(Ij,{label:p("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),Oj("hideEmissions",e.target.checked)}})})]}),h&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:h})]})};c=o("85Hg2");var Bj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var zj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var Fj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var Uj=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=Se(),d=Y(e),{getKnownFactsPaginated:h,deleteKnownFact:p}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[x,S]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,_]=(0,c.useState)(!1),C=async(e,r,i)=>{if(n||e){_(!0);try{const{knownFacts:o,count:s,...a}=await h(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),S(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ju).error(u(Qv(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}_(!1)}};(0,c.useEffect)((()=>{C()}),[]);const[A,E]=(0,c.useState)(!1),[T,M]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(_f,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(xf,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Sf,{primary:!0,danger:!0,onClick:()=>{E(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(Bj,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Km,{className:"memori-known-facts-modal",open:A,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{E(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{E(!1)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>p(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ju).success(u("knownFacts.deleteSuccess")),R([]),C(),E(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ju).error(u(Qv(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ju).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),x>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[x>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Sf,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(zj,{}),onClick:()=>{let e=(y/g-1)*g;b(e),C(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(x/g)]}),(0,s.jsx)(Sf,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(Fj,{}),disabled:(y/g+1)*g>=x,onClick:()=>{let e=(y/g+1)*g;b(e),C(void 0,e,g)}})]}),(0,s.jsx)(Rj,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),C(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(Ij,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(Ij,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Sf,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(Bj,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>M(e.knownFactID)}),(0,s.jsx)(Km,{className:"memori-known-facts-modal",open:T===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{M(void 0)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const r=await p(n,e.knownFactID);0===r.resultCode?(t(Ju).success(u("knownFacts.deleteSuccess")),R([]),C(),M(void 0)):(console.error(r),t(Ju).error(u(Qv(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ju).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var jj=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=Se();return(0,s.jsx)(_f,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=gv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};c=o("85Hg2"),c=o("85Hg2");const Hj=["memori","private","public","api","404","500","it","en","account","auth","logout","privacy_and_cookie","unauthorized","users","virtual_spaces"];var Vj=({tenant:e,apiUrl:n,onLogin:r,goToLogin:i,__TEST__waitingForOtp:o=!1})=>{const{t:a,i18n:l}=Se(),u="it"===l.language?"it":"en",d=Y(n),{userSignUp:h,userConfirmSignUp:p,resendVerificationCode:f}=d.backend,[m,g]=(0,c.useState)(),[v,y]=(0,c.useState)(),[b,x]=(0,c.useState)(),[S,w]=(0,c.useState)(),_=!b||b&&$f.test(b),C=_&&b&&b.length>=24,A=!b||0===b.length,E=!_||A?0:b.length<8?15:b.length>=32?100:(b.length-8)*(50/24)+50,[T,M]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1),[P,k]=(0,c.useState)(o),[O,N]=(0,c.useState)(null),[L,D]=(0,c.useState)();(0,c.useEffect)((()=>{D(window.location.href)}),[]);return P?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async n=>{var i,o,s;n.preventDefault();const l=n.currentTarget,c=null!==(i=l.tenant.value)&&void 0!==i?i:e.id,u=null!==(o=l.userName.value)&&void 0!==o?o:v,d=null!==(s=l.password.value)&&void 0!==s?s:b,h=l.verificationCode.value;M(!0),N(null);try{const{user:e,token:n,...i}=await p({tenant:c,userName:u,password:d,verificationCode:h});0!==i.resultCode?(console.error(i),t(Ju).error(a(Qv(i.resultCode)))):e&&n&&(t(Ju).success(a("success")),r(e,n))}catch(e){let n=e;console.error("[validate otp]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{M(!1)}},children:[(0,s.jsx)("input",{type:"hidden",name:"userName",value:v}),(0,s.jsx)("input",{type:"hidden",name:"password",value:b}),(0,s.jsx)("input",{type:"hidden",name:"tenant",value:e.id}),(0,s.jsxs)("label",{htmlFor:"#verificationCode",children:[a("login.otpCode"),(0,s.jsx)("input",{id:"verificationCode",name:"verificationCode",type:"text",required:!0,autoComplete:"one-time-code",placeholder:a("login.otpCode")||"OTP"})]}),(0,s.jsx)("p",{children:(0,s.jsx)(Sf,{outlined:!0,onClick:async n=>{if(n.preventDefault(),v){R(!0);try{const n=await f({tenant:null==e?void 0:e.id,userName:v});0===n.resultCode?t(Ju).success(a("resentVerificationCode")):(console.error(n),t(Ju).error(a(Qv(n.resultCode))))}catch(e){let n=e;console.error("[resend otp]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{R(!1)}}},loading:I,children:a("login.resendVerificationCode")})}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:T,children:a("confirm")})]}),O&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:O})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async n=>{var r,i,o,s,l,c,u;n.preventDefault();const d=n.currentTarget,p=null!==(r=d.tenant.value)&&void 0!==r?r:e.id,f=(null!==(i=d.eMail.value)&&void 0!==i?i:m).toLowerCase(),g=null!==(o=d.userName.value)&&void 0!==o?o:v,y=d.password.value,b=new Date(null===(s=d.birthDate)||void 0===s?void 0:s.value).toISOString(),x=null===(l=d.tnCAndPPAccepted)||void 0===l?void 0:l.checked,S=null===(c=d.pAndCUAccepted)||void 0===c?void 0:c.checked,w=null===(u=d.referral)||void 0===u?void 0:u.value;if(!(f&&g&&y&&b&&x))return void N(a("missingData"));M(!0),N(null);if(((new Date).getTime()-new Date(b).getTime())/1e3/60/60/24/365<14)return t(Ju).error(a("login.underage",{age:14})),void N(a("login.underage",{age:14}));try{const{user:e,...n}=await h({tenant:p,eMail:f,userName:g,password:y,birthDate:b,tnCAndPPAccepted:x,tnCAndPPAcceptanceDate:(new Date).toISOString(),pAndCUAccepted:S,pAndCUAcceptanceDate:(new Date).toISOString(),referral:w});0!==n.resultCode?(console.error(n),t(Ju).error(a(Qv(n.resultCode)))):e&&(t(Ju).success(a("success")),k(!0))}catch(e){let n=e;console.error("[signup]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{M(!1)}},children:[(0,s.jsx)("input",{type:"hidden",name:"tenant",value:e.id}),(0,s.jsx)("input",{type:"hidden",name:"referral",value:L}),(0,s.jsxs)("label",{htmlFor:"#eMail",children:[a("login.email"),(0,s.jsx)("input",{type:"email",name:"eMail",id:"eMail",required:!0,autoComplete:"email",placeholder:a("login.email")||"Email",onChange:e=>g(e.target.value),"aria-invalid":!!(null==m?void 0:m.length)&&!em.test(m)})]}),!!(null==m?void 0:m.length)&&!em.test(m)&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.emailFormatError")}),(0,s.jsxs)("label",{htmlFor:"userName",children:[a("login.username"),(0,s.jsx)("input",{type:"text",name:"userName",id:"userName",required:!0,autoComplete:"username",placeholder:a("login.username")||"Username",onFocus:()=>{if(!(null==v?void 0:v.length)&&(null==m?void 0:m.length)){let e=(e=>e.split("@")[0].replace(/[^a-zA-Z0-9]/g,""))(m);const t=document.getElementById("userName");t&&(t.value=e,y(e))}},onChange:e=>y(e.target.value),"aria-invalid":!!(null==v?void 0:v.length)&&(Hj.includes(v.toLowerCase())||!tm.test(v))})]}),!!(null==v?void 0:v.length)&&Hj.includes(v.toLowerCase())&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.usernameContainsReservedWord")}),!!(null==v?void 0:v.length)&&!tm.test(v)&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.usernameFormatError")}),(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[a("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:a("login.birthDateHelper")})}),(0,s.jsxs)("label",{htmlFor:"#password",children:[a("login.password"),(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"new-password",placeholder:a("login.password")||"Password",onChange:e=>x(e.target.value),"aria-invalid":!_})]}),!_&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.passwordFormatError")}),(0,s.jsxs)("label",{htmlFor:"#confirm-password",children:[a("login.confirmPassword"),(0,s.jsx)("input",{id:"confirm-password",name:"confirmPassword",type:"password",required:!0,autoComplete:"new-password",placeholder:a("login.confirmPassword")||"Password",onChange:e=>w(e.target.value),"aria-invalid":!!(null==b?void 0:b.length)&&!!(null==S?void 0:S.length)&&b!==S})]}),!!(null==b?void 0:b.length)&&!!(null==S?void 0:S.length)&&b!==S&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.passwordMatchingError")}),(0,s.jsx)("meter",{className:"memori--login-drawer--password-meter",min:0,low:33,high:66,optimum:80,max:100,value:E,id:"password-strength-meter"}),(0,s.jsx)("small",{children:a("login.pwd"+(C?"Strong":_?"Acceptable":"Weak"))}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",required:!0,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[a("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${u}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:a("login.privacyAndCookiePolicy")})," ",a("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${u}/tos`,target:"_blank",rel:"noopener noreferrer",children:a("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[a("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",a("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:a("login.deepThoughtExplaination")})}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:T,children:a("login.signUp")}),(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[a("login.alreadyHaveAnAccount")," ",(0,s.jsx)(Sf,{outlined:!0,onClick:i,children:a("login.backToLogin")})]})]}),O&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:O})]})};c=o("85Hg2");const Gj=["image/jpeg","image/png","image/jpg","image/gif"];var Wj=({user:e,loginToken:n,apiUrl:r,onUserUpdate:i})=>{const{t:o,i18n:a}=Se(),l="it"===a.language?"it":"en",u=Y(r),{updateUser:d,uploadAsset:h}=u.backend,[p,f]=(0,c.useState)(),[m,g]=(0,c.useState)(),[v,y]=(0,c.useState)(),b=!m||m&&$f.test(m),x=b&&m&&m.length>=24,S=!m||0===m.length,w=!b||S?0:m.length<8?15:m.length>=32?100:(m.length-8)*(50/24)+50,[_,C]=(0,c.useState)(!1),[A,E]=(0,c.useState)(null),T=async(e,r)=>{try{const{user:s,...a}=await d(n,e,r);0!==a.resultCode?(console.error(a),t(Ju).error(o(Qv(a.resultCode)))):s&&(t(Ju).success(o("success")),i(s))}catch(e){let n=e;console.error("[signup]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{C(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"memori--login-drawer--edit-account-title",children:o("login.editAccount")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form memori--login-drawer--account-form",onSubmit:async r=>{var i,s,a,l,c;if(r.preventDefault(),!e.userID)return;const u=e.userID,d=r.currentTarget,f=null!==(i=d.eMail.value)&&void 0!==i?i:p,g=null!==(s=d.newPassword.value)&&void 0!==s?s:m,v=d.password.value,y=d.confirmPassword.value,b=null===(a=d.pAndCUAccepted)||void 0===a?void 0:a.checked,x=null===(c=null===(l=d.avatar)||void 0===l?void 0:l.files)||void 0===c?void 0:c[0];if(C(!0),E(null),(null==g?void 0:g.length)&&g!==y)return E(o("login.passwordMatchingError")),void C(!1);let S={...(null==f?void 0:f.length)&&f!==e.eMail?{eMail:f}:{},...g?{password:v,newPassword:g}:{},...void 0!==b&&b!==e.pAndCUAccepted?{pAndCUAccepted:b,pAndCUAcceptanceDate:(new Date).toISOString()}:{}};if(0===Object.values(S).length&&!x)return console.debug("No changes to submit"),void C(!1);if(x){const e=new FileReader;e.onload=async e=>{var r,i;try{const{asset:s,...a}=await h(null!==(r=x.name)&&void 0!==r?r:"avatar",null===(i=e.target)||void 0===i?void 0:i.result,n);0!==a.resultCode?(console.error(a),t(Ju).error(o(Qv(a.resultCode)))):s&&(S.avatarURL=s.assetURL,await T(u,S))}catch(e){let n=e;console.error("[avatar upload]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}},e.readAsDataURL(x)}else await T(u,S)},children:[(0,s.jsxs)("details",{className:"memori--details",children:[(0,s.jsx)("summary",{children:o("login.emailChange")}),(0,s.jsxs)("label",{htmlFor:"#eMail",children:[o("login.email"),(0,s.jsx)("input",{type:"email",name:"eMail",id:"eMail",autoComplete:"email",placeholder:e.eMail,onChange:e=>f(e.target.value),"aria-invalid":!!(null==p?void 0:p.length)&&!em.test(p)})]}),!!(null==p?void 0:p.length)&&!em.test(p)&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:o("login.emailFormatError")})]}),(0,s.jsxs)("details",{className:"memori--details",children:[(0,s.jsx)("summary",{children:o("login.passwordChange")}),(0,s.jsxs)("label",{htmlFor:"#password",children:[o("login.currentPassword"),(0,s.jsx)("input",{id:"password",name:"password",type:"password",autoComplete:"password",placeholder:o("login.currentPassword")||"Password"})]}),(0,s.jsxs)("label",{htmlFor:"#newPassword",children:[o("login.newPassword"),(0,s.jsx)("input",{id:"newPassword",name:"newPassword",type:"password",autoComplete:"new-password",placeholder:o("login.password")||"Password",onChange:e=>g(e.target.value),"aria-invalid":!b})]}),!b&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:o("login.passwordFormatError")}),(0,s.jsxs)("label",{htmlFor:"#confirm-password",children:[o("login.confirmPassword"),(0,s.jsx)("input",{id:"confirm-password",name:"confirmPassword",type:"password",autoComplete:"new-password",placeholder:o("login.confirmPassword")||"Password",onChange:e=>y(e.target.value),"aria-invalid":!!(null==m?void 0:m.length)&&!!(null==v?void 0:v.length)&&m!==v})]}),!!(null==m?void 0:m.length)&&!!(null==v?void 0:v.length)&&m!==v&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:o("login.passwordMatchingError")}),(0,s.jsx)("meter",{className:"memori--login-drawer--password-meter",min:0,low:33,high:66,optimum:80,max:100,value:w,id:"password-strength-meter"}),(0,s.jsx)("small",{children:o("login.pwd"+(x?"Strong":b?"Acceptable":"Weak"))})]}),(0,s.jsxs)("details",{className:"memori--details",children:[(0,s.jsx)("summary",{children:o("login.avatarChange")}),(0,s.jsxs)("label",{htmlFor:"#avatar",children:["Avatar",(0,s.jsx)("input",{type:"file",name:"avatar",id:"avatar",accept:Gj.join(", "),placeholder:e.avatarURL})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox memori-checkbox--disabled",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",disabled:!0,defaultChecked:e.tnCAndPPAccepted,checked:e.tnCAndPPAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[o("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${l}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:o("login.privacyAndCookiePolicy")})," ",o("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${l}/tos`,target:"_blank",rel:"noopener noreferrer",children:o("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",className:"memori-checkbox--input",defaultChecked:e.pAndCUAccepted}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsx)(xv,{align:"left",content:o("login.deepThoughtExplaination"),children:(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[o("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",o("login.optional"),")"]})})]})})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:_,children:o("login.save")})]}),A&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:A})]})};var qj=({open:e=!1,onClose:n,onLogin:r,onLogout:i,user:o,loginToken:a,tenant:l,apiUrl:u,__TEST__signup:d=!1,__TEST__needMissingData:h=!1,__TEST__waitingForOtp:p=!1,__TEST__changePwd:f=!1})=>{var m,g;const{t:v,i18n:y}=Se(),b="it"===y.language?"it":"en",x=Y(u),{userLogin:S,updateUser:w}=x.backend,_=(null==o?void 0:o.userID)&&a,[C,A]=(0,c.useState)(!1),[E,T]=(0,c.useState)(null),[M,I]=(0,c.useState)(d),[R,P]=(0,c.useState)(f?{flowID:"flowID",tenant:l.id,eMail:"email",userName:"username",password:"password"}:void 0),[k,O]=(0,c.useState)(h?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{}),[N,L]=(0,c.useState)(),[D,B]=(0,c.useState)(),z=!N||N&&$f.test(N),F=z&&N&&N.length>=24,U=!N||0===N.length,j=!z||U?0:N.length<8?15:N.length>=32?100:(N.length-8)*(50/24)+50;return(0,s.jsx)(_f,{open:e,onClose:n,className:t(ws)("memori--login-drawer",{"memori--login-drawer--logged":_,"memori--login-drawer--signup":M}),title:(0,s.jsx)("span",{className:"memori--login-drawer--title",children:_?v("login.loggedDrawerTitle",{name:o.userName}):v(M?"login.signupDrawerTitle":"login.loginDrawerTitle")}),children:_?(0,s.jsxs)("div",{className:"memori--login-drawer--logged",children:[o.avatarURL&&(0,s.jsx)("figure",{className:"memori--login-drawer--avatar",children:(0,s.jsx)("img",{src:o.avatarURL,alt:o.userName})}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>{i()},children:v("login.logout")}),(0,s.jsx)(Wj,{user:o,loginToken:a,apiUrl:u,onUserUpdate:e=>r(e,a)})]}):(null===(m=null==k?void 0:k.token)||void 0===m?void 0:m.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:v("login.missingData")}),(0,s.jsx)("p",{children:v("login.missingDataHelper")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,s;e.preventDefault();const a=e.currentTarget,l=null===(n=a.birthDate)||void 0===n?void 0:n.value,c=null===(i=a.tnCAndPPAccepted)||void 0===i?void 0:i.checked,u=null===(s=a.pAndCUAccepted)||void 0===s?void 0:s.checked;if(!(null==o?void 0:o.userID)||!(null==k?void 0:k.token))return;if(!l||!c)return void T(v("missingData"));let d={userID:o.userID,birthDate:(null==o?void 0:o.birthDate)||!k.birthDate?void 0:l,tnCAndPPAccepted:c||(null==o?void 0:o.tnCAndPPAccepted),tnCAndPPAcceptanceDate:c?(new Date).toISOString():void 0,pAndCUAccepted:u||(null==o?void 0:o.pAndCUAccepted),pAndCUAcceptanceDate:u?(new Date).toISOString():void 0};const{user:h,...p}=await w(k.token,o.userID,d);0!==p.resultCode?(console.error(p),t(Ju).error(v(Qv(p.resultCode))),T(p.resultMessage)):(t(Ju).success(v("success")),r(h||d,k.token))},children:[k.birthDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[v("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:v("login.birthDateHelper")})})]}),(null==k?void 0:k.tnCAndPPAccepted)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[v("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${b}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:v("login.privacyAndCookiePolicy")})," ",v("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${b}/tos`,target:"_blank",rel:"noopener noreferrer",children:v("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",defaultChecked:null==o?void 0:o.pAndCUAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[v("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",v("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:v("login.goToAccountToChangeYourPreferences")})}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:v("login.deepThoughtExplaination")})})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:C,children:v("login.save")})]})]}):(null==R?void 0:R.flowID)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:v("login.mustChangePassword")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,o,s,a;e.preventDefault();const c=e.currentTarget,u=null!==(n=c.tenant.value)&&void 0!==n?n:l.id,d=null!==(i=c.flowID.value)&&void 0!==i?i:null==R?void 0:R.flowID,h=null!==(o=c.eMail.value)&&void 0!==o?o:null==R?void 0:R.eMail,p=null!==(s=c.userName.value)&&void 0!==s?s:null==R?void 0:R.userName,f=null!==(a=c.password.value)&&void 0!==a?a:null==R?void 0:R.password,m=c.newPassword.value;if(!(null==m?void 0:m.length)||!z)return void T(v("login.passwordFormatError"));A(!0);const g={tenant:u,flowID:d,eMail:h,userName:p,password:f,newPassword:m};try{const{user:e,token:n,...i}=await S(g);0!==i.resultCode?(console.error(i),t(Ju).error(v(Qv(i.resultCode))),T(i.resultMessage)):e&&n&&(t(Ju).success(v("success")),r(e||g,n))}catch(e){let n=e;console.error("[LOGIN/CHANGE PWD]",n),n.message&&(t(Ju).error(n.message),T(n.message))}finally{A(!1)}},children:[(0,s.jsx)("input",{type:"hidden",name:"tenant",value:null!==(g=R.tenant)&&void 0!==g?g:null==l?void 0:l.id}),(0,s.jsx)("input",{type:"hidden",name:"flowID",value:R.flowID}),(0,s.jsx)("input",{type:"hidden",name:"eMail",value:R.eMail}),(0,s.jsx)("input",{type:"hidden",name:"userName",value:R.userName}),(0,s.jsx)("input",{type:"hidden",name:"password",value:R.password}),(0,s.jsxs)("label",{htmlFor:"#newPassword",children:[v("login.password"),(0,s.jsx)("input",{id:"newPassword",name:"newPassword",type:"password",required:!0,autoComplete:"new-password",placeholder:v("login.password")||"Password",onChange:e=>L(e.target.value),"aria-invalid":!z})]}),!z&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:v("login.passwordFormatError")}),(0,s.jsxs)("label",{htmlFor:"#confirm-password",children:[v("login.confirmPassword"),(0,s.jsx)("input",{id:"confirm-password",name:"confirmPassword",type:"password",required:!0,autoComplete:"new-password",placeholder:v("login.confirmPassword")||"Password",onChange:e=>B(e.target.value),"aria-invalid":!!(null==N?void 0:N.length)&&!!(null==D?void 0:D.length)&&N!==D})]}),!!(null==N?void 0:N.length)&&!!(null==D?void 0:D.length)&&N!==D&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:v("login.passwordMatchingError")}),(0,s.jsx)("meter",{className:"memori--login-drawer--password-meter",min:0,low:33,high:66,optimum:80,max:100,value:j,id:"password-strength-meter"}),(0,s.jsx)("small",{children:v("login.pwd"+(F?"Strong":z?"Acceptable":"Weak"))}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:C,children:v("confirm")})]})]}):M?(0,s.jsx)(Vj,{tenant:l,apiUrl:u,onLogin:r,goToLogin:()=>I(!1),__TEST__waitingForOtp:p}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:e=>{e.preventDefault();const n=e.currentTarget,i=n.userNameOrEmail.value,o=n.password.value,s=em.test(i),a=s?{tenant:null==l?void 0:l.id,eMail:i,password:o}:{tenant:null==l?void 0:l.id,userName:i,password:o};A(!0),T(null),S(a).then((e=>{var n,a,c,u,d;-14===e.resultCode?P({tenant:l.id,eMail:s?i:void 0,userName:s?void 0:i,password:o,flowID:e.flowID||(null===(n=e.user)||void 0===n?void 0:n.flowID)}):0!==e.resultCode?(console.error(e),t(Ju).error(v(Qv(e.resultCode))),T(e.resultMessage)):e.user&&e.token&&((null===(a=e.user)||void 0===a?void 0:a.tnCAndPPAccepted)&&(null===(c=e.user)||void 0===c?void 0:c.birthDate)?r(e.user,e.token):O({token:e.token,birthDate:!(null===(u=e.user)||void 0===u?void 0:u.birthDate),tnCAndPPAccepted:!(null===(d=e.user)||void 0===d?void 0:d.tnCAndPPAccepted)}))})).catch((e=>{console.error("[LOGIN]",e),e.message&&(t(Ju).error(e.message),T(e.message))})).finally((()=>{A(!1)}))},children:[(0,s.jsxs)("label",{htmlFor:"#userNameOrEmail",children:[v("login.userNameOrEmail"),(0,s.jsx)("input",{id:"userNameOrEmail",name:"userNameOrEmail",required:!0,autoComplete:"email",placeholder:"Username/email"})]}),(0,s.jsxs)("label",{htmlFor:"#password",children:["Password",(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"password",placeholder:"Password"})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:C,children:v("login.login")}),(null==l?void 0:l.disableRegistration)?l.adminEmail?(0,s.jsxs)("div",{className:"memori--login-drawer--signup",children:[(0,s.jsx)("p",{children:v("login.registrationDisabled")}),(0,s.jsxs)("p",{children:[v("login.contactAdmin"),":"," ",(0,s.jsx)("a",{href:`mailto:${l.adminEmail}`,children:l.adminEmail})]})]}):null:(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[v("login.newUserSignUp")," ",(0,s.jsx)(Sf,{outlined:!0,onClick:()=>I(!0),children:v("login.signUp")})]})]}),E&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:E})]})})};var Kj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(xf,{spinning:g,children:[m&&d&&h&&(0,s.jsx)(d,{...h}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var Jj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(xf,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var Qj=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:h,showInstruct:p=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(xf,{spinning:f,className:"memori-chat-layout",children:[m,p&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&h&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var Yj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:x}=Se(),[S,w]=(0,c.useState)(!0),[_,C]=(0,c.useState)(),A=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),E=e=>{w(e),C(e?void 0:(new Date).toISOString());try{null==A||A()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(S?"collapsed":"expanded"),children:S?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>E(!1),title:x("expand")||"Expand",children:(0,s.jsx)(LF,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(xf,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>E(!0),icon:(0,s.jsx)(wf,{}),title:x("close")||"Close"})}),m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${_}`:void 0}:{},key:_})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:Zj,getStatistics:Xj,initSession:$j}=Y(),eH=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),tH=e=>{const t=Array.from(eH.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return eH.get(e)}return""},nH=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of eH){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},rH=e=>{let t=0;for(const[n,r]of eH)if(r===e){t=n;break}return t},iH=e=>{const t=Math.round(e),n=tH(t);return{points:t,badge:n,pointsForCurrentBadge:rH(n),nextBadge:nH(n)}},oH=async({operation:e="session_creation",baseUrl:t,userID:n,userName:r,tenant:i})=>{if(!n&&!r)throw new Error("Either userID or userName must be provided");const o=await fetch(`${t}/api/verify-tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e,userID:n,userName:r,tenant:i})});if(!o.ok)throw new Error("Failed to fetch credits");return o.json()},sH=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let aH,lH,cH,uH,dH,hH;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=sH,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>sH(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),sH(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let pH,fH=!1,mH=!1;var gH=({memori:e,memoriConfigs:n,ownerUserID:r,ownerUserName:i,tenantID:o,memoriLang:a,multilingual:l,integration:u,layout:d="DEFAULT",customLayout:h,showInstruct:p=!1,showShare:f,preview:m=!1,embed:g=!1,showCopyButton:v=!0,showTranslationOriginal:y=!1,showInputs:b=!0,showDates:x=!1,showContextPerLine:S=!1,showSettings:w=!0,showTypingText:_=!1,showClear:C=!1,showLogin:A=!1,showOnlyLastMessages:E,height:T="100vh",secret:M,baseUrl:I="https://aisuru.com",apiUrl:R="https://backend.memori.ai",initialContextVars:P,initialQuestion:k,ogImage:O,sessionID:N,tenant:L,personification:D,authToken:B,AZURE_COGNITIVE_SERVICES_TTS_KEY:z,defaultSpeakerActive:F=!0,disableTextEnteredEvents:U=!1,onStateChange:j,additionalInfo:H,additionalSettings:V,customMediaRenderer:G,userAvatar:W})=>{var q,K,J,Q,Z,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,he,pe,fe,me,ge;const{t:ve,i18n:ye}=Se(),[be,xe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{xe(!0)}),[]);const we=Y(R),{initSession:_e,postTextEnteredEvent:Ce,postPlaceChangedEvent:Ae,postDateChangedEvent:Ee,postTimeoutEvent:Te,postTagChangedEvent:Me,getSession:Ie,getContentQualityIndexes:Re,getExpertReferences:Pe}=we,[ke,Oe]=(0,c.useState)(!1),[Ne,Le]=(0,c.useState)(null!==(q=null==H?void 0:H.loginToken)&&void 0!==q?q:B),[De,Be]=(0,c.useState)({avatarURL:"string"==typeof W?W:void 0});(0,c.useEffect)((()=>{Ne&&!(null==De?void 0:De.userID)&&A&&we.backend.getCurrentUser(Ne).then((({user:e,resultCode:t})=>{e&&0===t?(Be(e),Oj("loginToken",Ne)):Nj("loginToken")}))}),[Ne,null==De?void 0:De.userID]);const[ze,Fe]=(0,c.useState)(!1),[Ue,je]=(0,c.useState)(!1),[He,Ve]=(0,c.useState)(!1),Ge=(null===(Q=null===(J=null===(K=e.culture)||void 0===K?void 0:K.split("-"))||void 0===J?void 0:J[0])||void 0===Q?void 0:Q.toUpperCase())||(null===(ee=null===($=null===(X=null===(Z=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===Z?void 0:Z.culture)||void 0===X?void 0:X.split("-"))||void 0===$?void 0:$[0])||void 0===ee?void 0:ee.toUpperCase()),We=(null==u?void 0:u.customData)?JSON.parse(u.customData):null,qe=void 0!==l?l:!!(null==We?void 0:We.multilanguage),Ke=null==We?void 0:We.forcedTimeout,[Je,Qe]=(0,c.useState)(null!==(ie=null!==(re=null!==(ne=null!==(te=null!=a?a:null==We?void 0:We.lang)&&void 0!==te?te:Ge)&&void 0!==ne?ne:null==We?void 0:We.uiLang)&&void 0!==re?re:ye.language)&&void 0!==ie?ie:"IT"),[Ye,Ze]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[et,tt]=(0,c.useState)(),nt=d||(null==We?void 0:We.layout)||"DEFAULT",[rt,it]=(0,c.useState)(!1),[ot,st]=(0,c.useState)(!1),[at,lt]=(0,c.useState)(!1),[ct,ut]=(0,c.useState)(!1),[dt,ht]=(0,c.useState)(!1),[pt,ft]=(0,c.useState)(!1),[mt,gt]=(0,c.useState)(!F),[vt,yt]=(0,c.useState)(!1),[bt,xt]=(0,c.useState)(2),[St,wt]=(0,c.useState)(!1),[_t,Ct]=(0,c.useState)("center"),[At,Et]=(0,c.useState)(!1);(0,c.useEffect)((()=>{wt(!!cH),mH=!!cH}),[cH]),(0,c.useEffect)((()=>{let e="bottom",t=kj("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",gt(kj("muteSpeaker",!F)),fH=kj("muteSpeaker",!F),yt("CONTINUOUS"===t),xt(kj("continuousSpeechTimeout",2)),Ct(kj("controlsPosition",e)),Et(kj("hideEmissions",!1)),(null==H?void 0:H.loginToken)||B||(Le(kj("loginToken",void 0)),pH=kj("loginToken",void 0))}),[]);const[Tt,Mt]=(0,c.useState)(M),[It,Rt]=(0,c.useState)(),[Pt,kt]=(0,c.useState)(null),[Ot,Nt]=(0,c.useState)(),Lt=async(e,t)=>{var n;const r=null!=t?t:Yt;if(e&&r){const{currentState:t,...i}=await Ae({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&$t((e=>{var n;return{...e,...t,hints:(null===(n=t.hints)||void 0===n?void 0:n.length)?t.hints:null==e?void 0:e.hints}}))}};(0,c.useEffect)((()=>{const e=kj("position",void 0);e&&Nt(e)}),[]);const[Dt,Bt]=(0,c.useState)(""),[zt,Ft]=(0,c.useState)(!1),[Ut,jt]=(0,c.useState)([]),Ht=e=>{jt((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},Vt=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,h,p,f;const m=i||Yt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Ht({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Yt?!!i&&i!==Yt:!!i}),$e(!0),tt(l);let g=n,v=!1;try{if(!a&&o&&!ke&&qe&&Je.toUpperCase()!==Ge.toUpperCase()){g=(await vx(n,Ge,Je,I)).text}const{currentState:i,...s}=await Ce({sessionId:m,text:g});if(0===s.resultCode&&i){const n=c&&l?l:null!==(h=i.emission)&&void 0!==h?h:null==Xt?void 0:Xt.emission;if("X4"===i.state&&e.giverTag){const{currentState:r,...i}=await Me(m,e.giverTag);0===i.resultCode?(en(r),n&&(Ht({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag,memoryTags:r.memoryTags}),yn(n))):(console.error(s,i),t(Ju).error(ve(Qv(i.resultCode))),v=!0)}else if("X2d"===i.state&&e.giverTag){const{currentState:r,...i}=await Ce({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await Me(m,e.giverTag);0===i.resultCode?(en(r),n&&(Ht({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag,memoryTags:r.memoryTags}),yn(n))):(console.error(s,i),t(Ju).error(ve(Qv(i.resultCode))),v=!0)}else console.error(s,i),t(Ju).error(ve(Qv(i.resultCode))),v=!0}else Je.toLowerCase()!==Ge.toLowerCase()&&n&&!ke&&qe?Gt(i,Je,g).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})):(en({...i,emission:n}),n&&(Ht({text:n,emitter:i.emitter,media:i.media,fromUser:!1,questionAnswered:g,generatedByAI:!!i.completion,contextVars:i.contextVars,date:i.currentDate,placeName:i.currentPlaceName,placeLatitude:i.currentLatitude,placeLongitude:i.currentLongitude,placeUncertaintyKm:i.currentUncertaintyKm,tag:i.currentTag,memoryTags:i.memoryTags}),yn(n)))}else 404===s.resultCode&&(jt((e=>[...e.slice(0,e.length-1)])),nn(!1,Tt||e.secretToken,It,ke&&e.giverTag?e.giverTag:void 0,ke&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||"",...P||{}},k).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Vt(n,r,null==e?void 0:e.sessionID)}),500)})))}catch(e){console.error(e),v=!0,tt(void 0),$e(!1)}u||(tt(void 0),$e(!1))},Gt=async(e,t,n)=>{var r,i,o;const s=null!==(r=e.emission)&&void 0!==r?r:null==Xt?void 0:Xt.emission;let a={...e},l=null;if(s&&!ke&&Ge.toUpperCase()!==t.toUpperCase()&&qe)try{const r=await vx(s,t,Ge,I);if(e.hints&&e.hints.length>0){const n=await Promise.all((null!==(i=e.hints)&&void 0!==i?i:[]).map((async e=>{var n;const r=await vx(e,t,Ge,I);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));a={...e,emission:r.text,translatedHints:n}}else a={...e,emission:s,translatedEmission:r.text,hints:null!==(o=e.hints)&&void 0!==o?o:"G1"===e.state?null==Xt?void 0:Xt.hints:[]};r.text.length>0&&(l={text:s,translatedText:r.text,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,generatedByAI:!!e.completion,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags})}catch(t){console.error(t),a={...e,emission:s},l={text:s,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags}}else a={...e,emission:s},s&&(l={text:s,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags});return en(a),l&&Ht(l),a},Wt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[qt,Kt]=(0,c.useState)(),[Jt,Qt]=(0,c.useState)(!1),[Yt,Zt]=(0,c.useState)(N),[Xt,$t]=(0,c.useState)(),en=e=>{var t;$t(e),j&&j(e);const n=new CustomEvent("MemoriNewDialogState",{detail:e});document.dispatchEvent(n);const r=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==r||r.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.warn(e)}}))},tn=async n=>{var r,i,o,s,a;let l=kj("birthDate",void 0);if(qt||l||!Wt)if("PUBLIC"===e.privacyType||e.secretToken||Tt||It){Ze(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.debug(e)}const c=await _e({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==D?void 0:D.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==D?void 0:D.pin,additionalInfo:{...H||{},loginToken:null!==(a=null!==(s=null!=pH?pH:Ne)&&void 0!==s?s:null==H?void 0:H.loginToken)&&void 0!==a?a:B,language:fn(Je),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Zt(c.sessionID),Ot&&Lt(Ot,c.sessionID),Ze(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.warn(c),t(Ju).error(ve("underageTwinSession",{age:Wt})),Ve(!0)):403===(null==c?void 0:c.resultCode)?(Mt(void 0),kt("password")):(console.warn(c),t(Ju).error(ve(Qv(null==c?void 0:c.resultCode))),Ve(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else kt("password");else Qt(!0)},nn=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,h,p,f;Ze(!0);try{let m,g=kj("birthDate",void 0);if(!c&&!g&&Wt)return void Qt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||Tt||i||It))return void kt("password");try{m=window.location.href}catch(e){console.debug(e)}const{sessionID:v,currentState:y,...b}=await _e({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||Tt||e.secretToken,recoveryTokens:i||It,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(h=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===h?void 0:h.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...H||{},loginToken:null!==(f=null!==(p=null!=pH?pH:Ne)&&void 0!==p?p:null==H?void 0:H.loginToken)&&void 0!==f?f:B,language:fn(Je),referral:m}});if(v&&y&&0===b.resultCode)return Zt(v),n&&(en(y),y.emission&&(Ut.length<=1?jt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag,memoryTags:y.memoryTags}]):Ht({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag,memoryTags:y.memoryTags}))),Ot&&Lt(Ot,v),e.needsDateTime&&on({sessionID:v,state:y}),Ze(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ju).error(ve("underageTwinSession",{age:Wt})),Ve(!0)):403===(null==b?void 0:b.resultCode)?(Mt(void 0),kt("password")):(console.error(b),t(Ju).error(ve(Qv(b.resultCode))),Ve(!0))}catch(e){console.error(e)}return Ze(!1),null},rn=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await Me(n,null!=r?r:Zv);if(0===u){let d=0;if(r!==Zv&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await Ce({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await Ie(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=kj("birthDate",void 0);try{t=window.location.href}catch(e){console.debug(e)}tn({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:M||Tt||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...P||{}},initialQuestion:k,birthDate:qt||n||void 0,additionalInfo:{...H||{},loginToken:null!==(c=null!==(l=null!=pH?pH:Ne)&&void 0!==l?l:null==H?void 0:H.loginToken)&&void 0!==c?c:B,language:fn(Je),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.warn("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{Xt&&(null==Xt?void 0:Xt.currentTag)===e.giverTag||(async()=>{Yt&&e.giverTag&&e.giverPIN&&(jt([]),await rn(e.engineMemoriID,Yt,e.giverTag,e.giverPIN))})()}),[]);const on=(0,c.useCallback)((async({sessionID:t,date:n,state:r})=>{var i;const o=null!=t?t:Yt,s=null!=r?r:Xt;if(!o||!e.needsDateTime||(null===(i=null==s?void 0:s.hints)||void 0===i?void 0:i.length))return;const a=(n?_s.DateTime.fromISO(n):_s.DateTime.now()).toUTC().toFormat("yyyy/MM/dd HH:mm:ss ZZ").split(":").slice(0,-1).join(":"),{currentState:l,...c}=await Ee(o,a);0===c.resultCode&&l&&$t((e=>{var t;return{...e,...l,hints:(null===(t=l.hints)||void 0===t?void 0:t.length)?l.hints:null==e?void 0:e.hints}}))}),[Xt,e.needsDateTime,Yt]);(0,c.useEffect)((()=>{if(Yt&&e.needsDateTime){on({sessionID:Yt,state:Xt});let e=setInterval((()=>{on({sessionID:Yt})}),6e4);return()=>{clearInterval(e)}}}),[e.needsDateTime,Yt]);const[sn,an]=(0,c.useState)(),ln=(0,c.useRef)(),cn=()=>{sn&&(clearTimeout(sn),an(void 0)),(null==ln?void 0:ln.current)&&(clearTimeout(ln.current),ln.current=void 0)},un=()=>{cn(),St||Dt.length||Xe||zt||hn()},dn=async()=>{var e;if(!rt||St||Dt.length||Xe||zt)un();else if(Yt&&rt&&(null==Xt?void 0:Xt.acceptsTimeout)){const{currentState:t,...n}=await Te(Yt);if(0===n.resultCode&&t){const n=t.emission;if(!ke&&qe&&Je!==(null==ye?void 0:ye.language)&&n&&n.length>0)Gt({...t,emission:n},Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)}));else{if(!(n&&n.length>0))return void un();Ht({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion,contextVars:t.contextVars,date:t.currentDate,placeName:t.currentPlaceName,placeLatitude:t.currentLatitude,placeLongitude:t.currentLongitude,placeUncertaintyKm:t.currentUncertaintyKm,tag:t.currentTag,memoryTags:t.memoryTags}),yn(n),en({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Xt?void 0:Xt.hints:[]})}}}},hn=()=>{let e=null==Xt?void 0:Xt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Xt?void 0:Xt.emission){e+=Xt.emission.length/26.5}}if(Ke&&(e=Ke,null==Xt?void 0:Xt.emission)){e+=Xt.emission.length/26.5}let t=setTimeout(dn,1e3*e);an(t),ln.current=t};(0,c.useEffect)((()=>{(Dt.length||St||Xe)&&cn(),Yt&&!Dt.length&&un()}),[null==Xt?void 0:Xt.acceptsTimeout,null==Xt?void 0:Xt.timeout,null==Xt?void 0:Xt.state,St,Yt,Ut,Dt,Xe,rt]),(0,c.useEffect)((()=>()=>{it(!1),je(!1),cn(),ln.current=void 0}),[]);const pn=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:ye.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Xt?void 0:Xt.emitter)){null==Yn||Yn.find((e=>e.name===(null==Xt?void 0:Xt.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;case"EL":s=""+("MALE"===l?"el-GR-NestorasNeural":"el-GR-AthinaNeural");break;case"AR":s=""+("MALE"===l?"ar-SA-HamedNeural":"ar-SA-ZariyahNeural");break;case"ZH":s=""+("MALE"===l?"zh-CN-YunxiNeural":"zh-CN-XiaoxiaoNeural");break;case"JA":s=""+("MALE"===l?"ja-JP-KeitaNeural":"ja-JP-NanamiNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==Xt?void 0:Xt.emitter,ye.language,e.culture]),fn=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||ye.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI";break;case"EL":i="el-GR";break;case"AR":i="ar-SA";break;case"ZH":i="zh-CN";break;case"JA":i="ja-JP"}return i},[mn,gn]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${I||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{gn(e)}))}),[]);const vn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},yn=e=>{if(!z||m)return void vn();if(Mn(),m)return;if(mt||fH)return mH=!1,$e(!1),vn(),void(vt&&An());uH&&uH.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===dH.state)return void dH.resume().then((()=>yn(e)));if("closed"===dH.state){dH=new Qo;let e=dH.createBuffer(1,1e4,22050),t=dH.createBufferSource();t.buffer=e,t.connect(dH.destination)}else if("suspended"===dH.state){bn(),dH=new Qo;let e=dH.createBuffer(1,1e4,22050),t=dH.createBufferSource();t.buffer=e,t.connect(dH.destination)}if(!cH){n||(uH=new bs.SpeakerAudioDestination);let e=bs.AudioConfig.fromSpeakerOutput(uH);cH=new bs.SpeechSynthesizer(lH,e)}const r=dH.createBufferSource();r.addEventListener("ended",(()=>{wt(!1),mH=!1})),uH.onAudioEnd=()=>{wt(!1),mH=!1,r.disconnect(),vn(),On()},cH.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${fn(Je)}"><voice name="${pn(Je)}"><s>${((e,t)=>{var n;if(!mn)return e;const r={...null!==(n=mn.common)&&void 0!==n?n:{},...(null==L?void 0:L.id)&&mn[L.id]?mn[L.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})(sm(om(im(e))),Je.toLowerCase())}</s></voice></speak>`,(i=>{if(i){wt(!0),mH=!0;try{dH.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(dH.destination),(Ut.length<1||t&&n)&&r.start(0)})),dH.onstatechange=()=>{"suspended"===dH.state||"closed"===dH.state?(r.disconnect(),wt(!1),mH=!1):"interrupted"===dH.state&&dH.resume()},dH.resume(),cH&&(cH.close(),cH=null)}catch(t){console.warn("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),wt(!1),mH=!1,cH&&(cH.close(),cH=null),vn()}}else dH.resume(),wt(!1),mH=!1,vn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),wt(!1),mH=!1,vn()})),$e(!1)},bn=()=>{wt(!1),mH=!1;try{cH&&(cH.close(),cH=null),"closed"!==dH.state&&dH.close(),uH&&(uH.pause(),uH.close())}catch(e){console.debug("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Xt?void 0:Xt.emission]);const[xn,Sn]=(0,c.useState)(""),wn=()=>Sn(""),[_n,Cn]=(0,c.useState)(null),An=()=>{let e=setTimeout((async()=>{In();const e=rm(xn);e.length>0&&zt?(Vt(e),wn(),Bt("")):zt&&un()}),1e3*bt);Cn(e)},En=()=>{_n&&(clearTimeout(_n),Cn(null))};(0,c.useEffect)((()=>{En(),vt&&An(),un()}),[xn]);const Tn=()=>{if(z){In(),Sn(""),wn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){st(!0),lH||(lH=bs.SpeechConfig.fromSubscription(z,"eastus"),lH.speechRecognitionLanguage=fn(Je),lH.speechSynthesisLanguage=fn(Je),lH.speechSynthesisVoiceName=pn(Je));const t=bs.AudioConfig.fromDefaultMicrophoneInput();aH=new bs.SpeechRecognizer(lH,t),Ft(!0),aH.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===bs.ResultReason.RecognizedSpeech){let e=t.result.text;if(Sn(e||""),(null==e?void 0:e.length)>0){const t=rm(e);t.length>0&&Bt((e=>`${e} ${t}`))}}else t.result.reason===bs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},aH.canceled=(e,t)=>{t.reason===bs.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),Mn()},aH.sessionStopped=(e,t)=>{Mn()},wn(),aH.startContinuousRecognitionAsync()})).catch(console.debug)}catch(e){console.debug(e)}}},Mn=()=>{aH&&(aH.stopContinuousRecognitionAsync(),aH.close(),aH=null),Ft(!1)},In=()=>{st(!1),Mn(),En()},Rn=()=>{try{In(),cn(),je(!1),ln.current=void 0,bn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{Rn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",Rn),()=>{document.removeEventListener("MemoriResetUIEffects",Rn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Xt?void 0:Xt.state)&&In()}),[null==Xt?void 0:Xt.state]);const[Pn,kn]=(0,c.useState)(!1),On=(0,c.useCallback)((e=>{St&&cH&&(cH.close(),cH=null),!vt||!ot&&Pn||(kn(!0),Tn())}),[vt,ot]);(0,c.useEffect)((()=>{Ut.length>1&&!St&&vt&&(ot||!Pn)?Tn():St&&zt&&Mn()}),[St]),(0,c.useEffect)((()=>{zt&&(In(),wn(),Bt(""),Tn())}),[Ge]);const[Nn,Ln]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{window.innerWidth<=768&&Zf()?Ln("click"):Ln("keypress")}),[]);const[Dn,Bn]=(0,c.useState)(),zn=null==We?void 0:We.globalBackground,Fn=zn?`url(${zn})`:null,Un=u?{"--memori-chat-bubble-bg":"#fff",...We&&!p?{"--memori-text-color":null!==(oe=We.textColor)&&void 0!==oe?oe:"#000"}:{},...(null==We?void 0:We.buttonBgColor)?{"--memori-button-bg":We.buttonBgColor,"--memori-primary":We.buttonBgColor}:{},...(null==We?void 0:We.buttonTextColor)?{"--memori-button-text":We.buttonTextColor}:{},...(null==We?void 0:We.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==We?void 0:We.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===We.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(se=We.innerBgAlpha)&&void 0!==se?se:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===We.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ae=null==We?void 0:We.innerBgAlpha)&&void 0!==ae?ae:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},jn=`\n ${m?"#preview,":"WEBSITE_ASSISTANT"===nt?"":":root,"} .memori-widget, .memori-drawer, .memori-modal {\n ${Object.entries(Un).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,Hn=void 0===(null==We?void 0:We.showAIicon)||(null==We?void 0:We.showAIicon),Vn=void 0===(null==We?void 0:We.showWhyThisAnswer)||(null==We?void 0:We.showWhyThisAnswer),[Gn,Wn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===nt||"FULLPAGE"!==nt)&&Wn(!0)}),[]);const[qn,Kn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await Re(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.debug("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Kn(iH(e.points))})).catch(console.debug)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==We?void 0:We.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",We.seoTitle),document.head.append(e)}if(null==We?void 0:We.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",We.seoDescription),document.head.append(e)}if(null==We?void 0:We.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",We.seoUrl),document.head.append(e)}let t=O||e.avatarURL;if((null==We?void 0:We.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[We,e.avatarURL,O]);const Jn=(0,c.useCallback)((e=>{if(U)return;const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!fH&&(mH||Xe)?setTimeout((()=>{Jn(e)}),1e3):(Mn(),bn(),Vt(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Yt,St,Xe,Je,U]);(0,c.useEffect)((()=>(U?document.removeEventListener("MemoriTextEntered",Jn):document.addEventListener("MemoriTextEntered",Jn),()=>{document.removeEventListener("MemoriTextEntered",Jn)})),[Yt,Je,U]);const Qn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c,u,d,h,p,f,m,g,v,y,b;const x=(null==t?void 0:t.sessionID)||Yt,S=(null==t?void 0:t.dialogState)||Xt;je(!0);let w=document.getElementById("memori-audio"),_=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");w&&_&&(w.muted=!1,w.play().catch((e=>{console.warn("error playing intro audio",e)})));let C=kj("birthDate",void 0),A=qt||C||void 0;if(x||!Wt||A){if(!x&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!Tt&&!It||!x&&He)return kt("password"),void je(!1);if(!x){je(!1),Ve(!1);const t=await tn({memoriID:e.engineMemoriID,password:M||Tt||e.secretToken,tag:null==D?void 0:D.tag,pin:null==D?void 0:D.pin,initialContextVars:{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...P||{}},initialQuestion:k,birthDate:A,additionalInfo:{...H||{},loginToken:null!==(a=null!==(s=null!=pH?pH:Ne)&&void 0!==s?s:null==H?void 0:H.loginToken)&&void 0!==a?a:B,language:fn(Je)}});return void((null==t?void 0:t.dialogState)?(jt([]),Gt(t.dialogState,Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})).finally((()=>{it(!0)}))):await Qn(t||void 0))}if(N){const{currentState:t,...n}=await Ie(x);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Ve(!0),Zt(void 0),je(!1),void await Qn();if(jt([]),Ot&&Lt(Ot,x),e.needsDateTime&&on({sessionID:x,state:t}),ke&&e.giverTag&&(null==Xt?void 0:Xt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await rn(e.engineMemoriID,x,"-");const t=await rn(e.engineMemoriID,x,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Gt(t.currentState,Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})).finally((()=>{it(!0)}))}catch(t){console.error("session #2",t),nn(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:null===(l=window.location.pathname)||void 0===l?void 0:l.toUpperCase(),ROUTE:(null===(d=null===(u=null===(c=window.location.pathname)||void 0===c?void 0:c.split("/"))||void 0===u?void 0:u.pop())||void 0===d?void 0:d.toUpperCase())||"",...P||{}},k,A).then((()=>{it(!0)}))}else if(!ke&&D&&(null==Xt?void 0:Xt.currentTag)!==D.tag)try{console.debug("change tag #3"),await rn(e.engineMemoriID,x,"-");const t=await rn(e.engineMemoriID,x,D.tag,D.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Gt(t.currentState,Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})).finally((()=>{it(!0)}))}catch(t){console.error("session #5",t),nn(!0,null==e?void 0:e.secretToken,void 0,D.tag,D.pin,{PATHNAME:null===(h=window.location.pathname)||void 0===h?void 0:h.toUpperCase(),ROUTE:(null===(m=null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||void 0===m?void 0:m.toUpperCase())||"",...P||{}},k,A).then((()=>{it(!0)}))}else if(ke||D||(null==Xt?void 0:Xt.currentTag)===Zv)Gt(t,Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})).finally((()=>{it(!0)}));else try{console.debug("change tag #6"),await rn(e.engineMemoriID,x,"-");const t=await rn(e.engineMemoriID,x,Zv);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Gt(t.currentState,Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})).finally((()=>{it(!0)}))}catch(t){console.error("session #8",t),nn(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:null===(g=window.location.pathname)||void 0===g?void 0:g.toUpperCase(),ROUTE:(null===(b=null===(y=null===(v=window.location.pathname)||void 0===v?void 0:v.split("/"))||void 0===y?void 0:y.pop())||void 0===b?void 0:b.toUpperCase())||"",...P||{}},k,A).then((()=>{it(!0)}))}Ot&&Lt(Ot,x),e.needsDateTime&&on({sessionID:x,state:t})}else jt([]),Gt(S,Je).then((e=>{let t=e.translatedEmission||e.emission;t&&yn(t)})).finally((()=>{it(!0)}))}else Qt(!0),je(!1)}),[Tt,e,It,qt,Yt,Je,Ot]);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?(Le(t.target.getAttribute("authtoken")||void 0),pH=t.target.getAttribute("authtoken")||void 0):(Le((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0),pH=t.target.getAttribute("authtoken")||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Yn,Zn]=(0,c.useState)(),Xn=(0,c.useCallback)((async()=>{if(Yt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Pe(Yt);0===n.resultCode?Zn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Yt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Xn()}),[Yt,Xn]);const $n=e.enableDeepThought&&!!Ne&&!!(null==De?void 0:De.userID)&&(null==De?void 0:De.pAndCUAccepted),er=null==L?void 0:L.billingDelegation,[tr,nr]=(0,c.useState)(!0),rr=(0,c.useCallback)((async()=>{if(null==L?void 0:L.billingDelegation)try{const e=await oH({operation:$n?"dt_session_creation":"session_creation",baseUrl:I,userID:r,userName:i,tenant:o});e.enough?nr(!0):(nr(!1),console.warn("Not enough credits. Required:",e.required))}catch(e){let t=e;console.debug(t)}}),[null==L?void 0:L.billingDelegation,$n]);(0,c.useEffect)((()=>{(null==L?void 0:L.billingDelegation)&&rr()}),[null==L?void 0:L.billingDelegation,$n]);const ir=void 0===E?"TOTEM"!==d&&"WEBSITE_ASSISTANT"!==d:!E,or={memori:e,tenant:L,history:Ut,showShare:null===(le=null!=f?f:null==We?void 0:We.showShare)||void 0===le||le,position:Ot,setShowPositionDrawer:lt,setShowSettingsDrawer:ut,setShowKnownFactsDrawer:ht,setShowExpertsDrawer:ft,showSpeaker:!!z,speakerMuted:mt||fH,setSpeakerMuted:e=>{if(fH=!!e,gt(e),Oj("muteSpeaker",!!e),e)bn();else{dH=new Qo;let e=dH.createBuffer(1,1e4,22050),t=dH.createBufferSource();t.buffer=e,t.connect(dH.destination)}},showSettings:w,hasUserActivatedSpeak:rt,showReload:"TOTEM"===nt,showClear:C,clearHistory:()=>jt((e=>e.slice(-1))),showLogin:A,setShowLoginDrawer:Fe,loginToken:Ne,user:De,sessionID:Yt},sr={memori:e,integration:u,integrationConfig:We,tenant:L,instruct:ke,avatar3dVisible:Gn,setAvatar3dVisible:Wn,hasUserActivatedSpeak:rt,isPlayingAudio:St&&!mt,loading:!!Xe,baseUrl:I,apiUrl:R},ar={memori:e,tenant:L,gamificationLevel:qn,language:Ge,userLang:Je,setUserLang:Qe,baseUrl:I,apiUrl:R,position:Ot,openPositionDrawer:()=>lt(!0),integrationConfig:We,instruct:ke,sessionId:Yt,clickedStart:Ue,isMultilanguageEnabled:qe,onClickStart:Qn,initializeTTS:()=>{if(!z)return;lH=bs.SpeechConfig.fromSubscription(z,"eastus"),lH.speechSynthesisLanguage=fn(Je),lH.speechSynthesisVoiceName=pn(Je),lH.speechRecognitionLanguage=fn(Je),Zf()&&(lH.speechSynthesisOutputFormat=bs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),dH=new Qo;let e=dH.createBuffer(1,1e4,22050),t=dH.createBufferSource();t.buffer=e,t.connect(dH.destination),uH=new bs.SpeakerAudioDestination;let n=bs.AudioConfig.fromSpeakerOutput(uH);cH=new bs.SpeechSynthesizer(lH,n)},isUserLoggedIn:!!Ne&&!!(null==De?void 0:De.userID),notEnoughCredits:er&&!tr,showLogin:A,setShowLoginDrawer:Fe,user:De},lr={memori:e,sessionID:Yt||"",tenant:L,translateTo:qe&&Je.toUpperCase()!==(null===(pe=null!==(he=null!==(de=null===(ue=null===(ce=e.culture)||void 0===ce?void 0:ce.split("-"))||void 0===ue?void 0:ue[0])&&void 0!==de?de:ye.language)&&void 0!==he?he:"IT")||void 0===pe?void 0:pe.toUpperCase())?Je:void 0,baseUrl:I,apiUrl:R,layout:d,memoriTyping:Xe,typingText:et,showTypingText:_,history:ir?Ut:Ut.slice(-2),authToken:null!==(me=null!==(fe=null!=Ne?Ne:pH)&&void 0!==fe?fe:null==H?void 0:H.loginToken)&&void 0!==me?me:B,dialogState:Xt,setDialogState:en,pushMessage:Ht,simulateUserPrompt:(e,t)=>{Mn(),bn(),Vt(e,void 0,void 0,!1,t)},showDates:x,showContextPerLine:S,showAIicon:Hn,showWhyThisAnswer:Vn,showCopyButton:v,showTranslationOriginal:y,client:we,selectReceiverTag:async n=>{var r;if(Yt)try{const{currentState:i,...o}=await Me(Yt,n);if(0===o.resultCode)if(Ht({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await we.postTagChangedEvent(Yt,e.giverTag);0===r.resultCode?(en(n),n.emission&&Ht({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1,contextVars:n.contextVars,date:n.currentDate,placeName:n.currentPlaceName,placeLatitude:n.currentLatitude,placeLongitude:n.currentLongitude,placeUncertaintyKm:n.currentUncertaintyKm,tag:n.currentTag,memoryTags:n.memoryTags})):(console.error(r),t(Ju).error(ve(Qv(r.resultCode))))}else en(i),i.emission&&Ht({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1,contextVars:i.contextVars,date:i.currentDate,placeName:i.currentPlaceName,placeLatitude:i.currentLatitude,placeLongitude:i.currentLongitude,placeUncertaintyKm:i.currentUncertaintyKm,tag:i.currentTag,memoryTags:i.memoryTags});else console.error(o,n,null===(r=null==Xt?void 0:Xt.knownTags)||void 0===r?void 0:r[n]),t(Ju).error(ve(Qv(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ju).error(n.message)}},preview:m,sendOnEnter:Nn,setSendOnEnter:Ln,microphoneMode:vt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:Dn,setAttachmentsMenuOpen:Bn,instruct:ke,showInputs:b,showMicrophone:!!z,userMessage:Dt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Bt(""),void un();Bt(e),cn()},sendMessage:e=>{bn(),Mn(),Vt(e),Bt(""),wn()},stopListening:In,startListening:Tn,stopAudio:bn,resetTranscript:wn,listening:zt,isPlayingAudio:St,customMediaRenderer:G,user:De,userAvatar:W,experts:Yn},cr=u&&Fn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:Fn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),ur=u?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:jn}}):null,dr={canInstruct:!!e.giverTag,instruct:!!ke,onChangeMode:e=>{Oe("instruct"===e),it(!1),je(!1)}},hr=(0,s.jsx)(sj,{tenant:L,userLang:Je,integrationID:null==u?void 0:u.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),pr=h||("TOTEM"===nt?Jj:"CHAT"===nt?Qj:"FULLPAGE"===nt?Kj:"WEBSITE_ASSISTANT"===nt?Yj:Kj);return(0,s.jsxs)("div",{className:t(ws)("memori","memori-widget",`memori-layout-${d.toLowerCase()}`,`memori-controls-${_t.toLowerCase()}`,`memori--avatar-${(null==We?void 0:We.avatar)||"default"}`,{"memori--preview":m,"memori--embed":g,"memori--with-integration":u,"memori--with-speechkey":!!z,"memori--active":rt,"memori--hide-emissions":At,"memori--has-active-session":!!Yt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Yt,"data-memori-integration":null==u?void 0:u.integrationID,"data-memori-engine-state":JSON.stringify({...Xt,sessionID:Yt}),style:{height:T},children:[(0,s.jsx)(pr,{Header:oj,headerProps:or,Avatar:FF,avatarProps:sr,Chat:Vx,chatProps:lr,StartPanel:Yx,startPanelProps:ar,integrationStyle:ur,integrationBackground:cr,ChangeMode:tU,changeModeProps:dr,poweredBy:hr,sessionId:Yt,hasUserActivatedSpeak:rt,showInstruct:p,loading:Ye}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),be&&(0,s.jsx)(mv,{withModal:!0,pwdOrTokens:Pt,openModal:!!Pt,setPwdOrTokens:kt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r,i,o;t.password&&Mt(t.password),t.password&&(hH=t.password),t.tokens&&Rt(t.tokens),nn(!Yt,t.password,t.tokens,ke?e.giverTag:null==D?void 0:D.tag,ke?e.giverPIN:null==D?void 0:D.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...P||{}},k,qt).then((e=>{kt(null),Qn(e||void 0)})).catch((()=>{kt(null),Ve(!0)}))},minimumNumberOfRecoveryTokens:null!==(ge=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==ge?ge:1}),be&&(0,s.jsx)(Mj,{visible:Jt,minAge:Wt,onClose:t=>{var n,r,i,o;t?(Kt(t),Oj("birthDate",t),nn(!Yt,hH||Tt||(null==e?void 0:e.secretToken),It,ke?e.giverTag:null==D?void 0:D.tag,ke?e.giverPIN:null==D?void 0:D.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...P||{}},k,t).then((e=>{Qt(!1),kt(null),Qn(e||void 0)})).catch((()=>{Qt(!1),Ve(!0)}))):(Qt(!1),je(!1))}}),ct&&(0,s.jsx)(Dj,{layout:nt,open:!!ct,onClose:()=>ut(!1),microphoneMode:vt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:bt,setMicrophoneMode:e=>yt("CONTINUOUS"===e),setContinuousSpeechTimeout:xt,controlsPosition:_t,setControlsPosition:Ct,hideEmissions:At,setHideEmissions:Et,additionalSettings:V}),at&&(0,s.jsx)(qm,{memori:e,open:!!at,venue:Ot,setVenue:e=>{Nt(e),Lt(e),e?Oj("position",JSON.stringify(e)):Nj("position")},onClose:e=>{e&&Lt(e),lt(!1)}}),dt&&Yt&&(0,s.jsx)(Uj,{apiURL:R,memori:e,sessionID:Yt,visible:dt,closeDrawer:()=>ht(!1)}),pt&&!!Yn&&(0,s.jsx)(jj,{apiUrl:R,baseUrl:I,tenant:L,experts:Yn,open:pt,onClose:()=>ft(!1)}),ze&&(null==L?void 0:L.id)&&(0,s.jsx)(qj,{tenant:L,apiUrl:R,open:!!ze,user:De,loginToken:Ne,onClose:()=>Fe(!1),onLogin:(e,t)=>{Be(e),Le(t),pH=t,Fe(!1),Oj("loginToken",t)},onLogout:()=>{Ne&&we.backend.userLogout(Ne).then((()=>{Fe(!1),Be(void 0),Le(void 0),pH=void 0,Nj("loginToken")}))}})]})};const vH={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},yH=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://aisuru.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...vH,tenantID:e}}catch(t){return{...vH,tenantID:e}}};function bH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xH(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CF(r.key),r)}}function SH(e,t,n){return t&&xH(e.prototype,t),n&&xH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wH(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _H(e,t){return _H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_H(e,t)}function CH(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_H(e,t)}function AH(e,t){if(t&&("object"===wF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wH(e)}function EH(e){return EH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},EH(e)}function TH(e){if(Array.isArray(e))return e}function MH(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function IH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RH(e,t){if(e){if("string"==typeof e)return IH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IH(e,t):void 0}}function PH(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kH(e){return TH(e)||MH(e)||RH(e)||PH()}function OH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function NH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OH(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var LH={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},DH=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};bH(this,e),this.init(t,n)}return SH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||LH,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,NH(NH({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),BH=new DH,zH=function(){function e(){bH(this,e),this.observers={}}return SH(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function FH(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function UH(e){return null==e?"":""+e}function jH(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function HH(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function VH(e,t,n){var r=HH(e,t,Object);r.obj[r.k]=n}function GH(e,t){var n=HH(e,t),r=n.obj,i=n.k;if(r)return r[i]}function WH(e,t,n){var r=GH(e,n);return void 0!==r?r:GH(t,n)}function qH(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):qH(e[r],t[r],n):e[r]=t[r]);return e}function KH(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var JH={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function QH(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return JH[e]})):e}var YH="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ZH=[" ",",","?","!",";"];function XH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XH(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eV(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=EH(e);if(t){var i=EH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return AH(this,n)}}function tV(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?tV(l,c,n):void 0}i=i[r[o]]}return i}}var nV=function(e){CH(n,e);var t=eV(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return bH(this,n),r=t.call(this),YH&&zH.call(wH(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return SH(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=GH(this.data,s);return a||!o||"string"!=typeof n?a:tV(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),VH(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=GH(this.data,s)||{};r?qH(a,n,i):a=$H($H({},a),n),VH(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?$H($H({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(zH),rV={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function iV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sV(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=EH(e);if(t){var i=EH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return AH(this,n)}}var aV={},lV=function(e){CH(n,e);var t=sV(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return bH(this,n),r=t.call(this),YH&&zH.call(wH(r)),jH(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,wH(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=BH.create("translator"),r}return SH(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=ZH.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==wF(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var p=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(p).concat(l),f):"".concat(u).concat(p).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(S&&m&&w&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,oV(oV({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=_,f):_}if(s){var C="[object Array]"===y,A=C?[]:{},E=C?v:g;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var M="".concat(E).concat(s).concat(T);A[T]=this.translate(M,oV(oV({},t),{joinArrays:!1,ns:c})),A[T]===M&&(A[T]=m[T])}m=A}}else if(S&&"string"==typeof x&&"[object Array]"===y)(m=m.join(x))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,oV(oV({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,oV(oV({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(oV(oV({},n),{interpolation:oV(oV({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=oV(oV({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=rV.handle(h,e,t,this.options&&this.options.postProcessPassResolved?oV({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,h=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!aV["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(aV["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+f)),p){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),h&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(zH);function cV(e){return e.charAt(0).toUpperCase()+e.slice(1)}var uV=function(){function e(t){bH(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=BH.create("languageUtils")}return SH(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=cV(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=cV(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=cV(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),dV=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],hV={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},pV=["v1","v2","v3"],fV={zero:0,one:1,two:2,few:3,many:4,other:5};function mV(){var e={};return dV.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:hV[t.fc]}}))})),e}var gV=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};bH(this,e),this.languageUtils=t,this.options=n,this.logger=BH.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=mV()}return SH(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return fV[e]-fV[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!pV.includes(this.options.compatibilityJSON)}}]),e}();function vV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bV=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};bH(this,e),this.logger=BH.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return SH(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:QH,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?KH(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?KH(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?KH(t.nestingPrefix):t.nestingPrefixEscaped||KH("$t("),this.nestingSuffix=t.nestingSuffix?KH(t.nestingSuffix):t.nestingSuffixEscaped||KH(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=WH(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,yV(yV(yV({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(WH(t,l,s),c,n,yV(yV(yV({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(h){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=UH(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=yV({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=yV(yV({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=UH(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,yV(yV({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function xV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function SV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wV(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var _V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};bH(this,e),this.logger=BH.create("formatter"),this.options=t,this.formats={number:wV((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:wV((function(e,t){var n=new Intl.NumberFormat(e,SV(SV({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:wV((function(e,t){var n=new Intl.DateTimeFormat(e,SV({},t));return function(e){return n.format(e)}})),relativetime:wV((function(e,t){var n=new Intl.RelativeTimeFormat(e,SV({},t));return function(e){return n.format(e,t.range||"day")}})),list:wV((function(e,t){var n=new Intl.ListFormat(e,SV({},t));return function(e){return n.format(e)}}))},this.init(t)}return SH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=wV(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=kH(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,SV(SV(SV({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function CV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function AV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function EV(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=EH(e);if(t){var i=EH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return AH(this,n)}}var TV=function(e){CH(n,e);var t=EV(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return bH(this,n),o=t.call(this),YH&&zH.call(wH(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=BH.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return SH(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=HH(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,AV(AV({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(zH);function MV(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===wF(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===wF(e[2])||"object"===wF(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function IV(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function RV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function PV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kV(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=EH(e);if(t){var i=EH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return AH(this,n)}}function OV(){}function NV(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var LV=function(e){CH(n,e);var t=kV(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(bH(this,n),e=t.call(this),YH&&zH.call(wH(e)),e.options=IV(r),e.services={},e.logger=BH,e.modules={external:[]},NV(wH(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),AH(e,wH(e));setTimeout((function(){e.init(r,i)}),0)}return e}return SH(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=MV();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=PV(PV(PV({},r),this.options),IV(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=PV(PV({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?BH.init(i(this.modules.logger),this.options):BH.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=_V);var s=new uV(this.options);this.store=new nV(this.options.resources,this.options);var a=this.services;a.logger=BH,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new gV(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new bV(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new TV(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new lV(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=OV),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=FH(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:OV,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=FH();return e||(e=this.languages),t||(t=this.options.ns),n||(n=OV),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&rV.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=FH();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==wF(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=PV({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=FH();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=FH();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:OV,i=PV(PV(PV({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=PV({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new lV(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(zH);AF(LV,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new LV(e,t)}));var DV=LV.createInstance();DV.createInstance=LV.createInstance;var BV,zV=DV.createInstance;DV.init,DV.loadResources,DV.reloadResources,DV.use,DV.changeLanguage,DV.getFixedT,DV.t,DV.exists,DV.setDefaultNamespace,DV.hasLoadedNamespace,DV.loadNamespaces,DV.loadLanguages;BV=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyRawCode":"Copia codice sorgente","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","exactPosition":"Posizione esatta","uncertain":"Incertezza","question":"Domanda","nothingFound":"Nessun risultato","venue":"Luogo","searchVenue":"Cerca luogo...","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","whyThisAnswer":"Perché questa risposta?","whyThisAnswerHelper":"Questa risposta è stata generata automaticamente da un\'intelligenza artificiale sulla base di questi contenuti verificati.","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtPreDisclaimerUnlogged":"Accedi per abilitare Pensiero Profondo.","deepThoughtPreDisclaimerNotAllowed":"Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.","notEnoughCredits":"L\'autore di questo Twin non ha abbastanza crediti per rispondere alla tua domanda.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Preferenze posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePositionHelp":"Per parlare con {{name}} devi decidere se fornire o meno la tua posizione. Questo perchè diverse risposte che potrà fornirti potrebbero dipendere da dove ti trovi.","dontWantToProvidePosition":"Non voglio fornire la mia posizione","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"login":{"login":"Accedi","logout":"Esci","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","signupDrawerTitle":"Registrati","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","alreadyHaveAnAccount":"Hai già un account?","backToLogin":"Torna al login","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","email":"Email","emailFormatError":"Per favore, inserisci una mail valida","username":"Nome utente","usernameContainsReservedWord":"Il nome utente contiene una parola riservata, per favore cambia il nome utente","usernameFormatError":"Il nome utente deve essere lungo almeno 3 caratteri e può contenere solo lettere, numeri e _","otpCode":"Codice di verifica","resendVerificationCode":"Invia di nuovo","resentVerificationCode":"Codice di verifica inviato! Controlla la tua mail.","password":"Password","newPassword":"Nuova password","confirmPassword":"Conferma la password","currentPassword":"Password attuale","passwordMatchingError":"Le password non coincidono.","passwordFormatError":"La password deve essere lunga almeno 8 caratteri e contenere almeno un numero, una lettera maiuscola, una minuscola e un simbolo","pwdWeak":"Debole","pwdAcceptable":"Accettabile","pwdStrong":"Forte","mustChangePassword":"Devi cambiare la password","passwordChange":"Cambio password","emailChange":"Cambio email","avatarChange":"Cambio avatar","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","missingData":"Informazioni mancanti","missingDataHelper":"Sappiamo che questo è un po\' fastidioso, ma abbiamo bisogno di alcune informazioni in più per completare la tua registrazione.","goToAccountToChangeYourPreferences":"Puoi cambiare la tua scelta in qualsiasi momento dalla tua pagina Account.","deepThoughtExplaination":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme. Consenti all\'autore del twin di contattarti per offerte commerciali riguardanti prodotti su cui hai espresso interesse.","tnCAndPPAcceptedHelper":"Dall\'ultimo accesso, i T&C e l\'Informativa sulla privacy sono stati modificati. Si prega di accettarle, altrimenti non sarà possibile apportare modifiche ai propri gemelli. Puoi sempre cancellare il tuo account nella pagina del tuo profilo utente.","privacyLabel":"Ho letto e accettato l\'","privacyAndCookiePolicy":"informativa sui cookie e sulla privacy","and":"e","termsOfService":"i termini del servizio","pAndCUAccepted":"Accetto le condizioni di utilizzo relative a Pensiero Profondo","editAccount":"Modifica account","save":"Salva"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","USER_CREATION_BILLING_DENIED_PERMISSION":"Non hai crediti sufficienti per creare un Twin","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","SESSION_EXPIRED":"Sessione scaduta","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Memori: funzionalità richiede un abbonamento","INTEGRATION_NOT_FOUND":"Integrazione non trovata","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_INVALID_RECEIVER_ID":"Importazione CSV: ID receiver non valido","IMPORTCSV_INVALID_MEDIA_LINK":"Importazione CSV: link media non valido","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in Memori segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_INVALID_RECEIVER_ID":"Importazione TXT: ID receiver non valido","IMPORTTXT_INVALID_MEDIA_LINK":"Importazione TXT: link media non valido","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in Memori segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importazione TXT: non hai crediti sufficienti per l\'operazione","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare Memori segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Esito: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Esito: badge utente disabilitati"}}');const FV=zV({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyRawCode":"Copy raw code","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","exactPosition":"Exact position","uncertain":"Uncertain","question":"Question","nothingFound":"Nothing found","venue":"Venue","searchVenue":"Search venue...","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","whyThisAnswer":"Why this answer?","whyThisAnswerHelper":"This answer was generated automatically by an artificial intelligence based on these verified contents.","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together.","deepThoughtPreDisclaimerUnlogged":"Log in to enable Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought is disabled since you didn\'t consent its usage, you can change this any time in your account settings.","notEnoughCredits":"The author of this Twin does not have enough credits to answer your question.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position preferences","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","requirePositionHelp":"To talk to {{name}} you have to decide whether to provide your position or not. This is because different answers that it can provide you may depend on where you are.","dontWantToProvidePosition":"I don\'t want to provide my position","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"login":{"login":"Login","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","loginDrawerTitle":"Login","signupDrawerTitle":"Sign up","newUserSignUp":"New user?","signUp":"Sign up!","alreadyHaveAnAccount":"Already have an account?","backToLogin":"Back to login","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","email":"Email","emailFormatError":"Please, insert a valid email","username":"Username","usernameContainsReservedWord":"Username contains a reserved word, please choose another one","usernameFormatError":"Username must be at least 3 characters long and contain only letters, numbers and _","otpCode":"Verification code","resendVerificationCode":"Resend code","resentVerificationCode":"Confirmation code sent! Please check your email.","password":"Password","newPassword":"New password","confirmPassword":"Confirm Password","currentPassword":"Current password","passwordMatchingError":"Passwords do not match.","passwordFormatError":"Password must be at least 8 characters long and contain at least a number, an upper case letter, a lower case letter and a symbol","pwdWeak":"Weak","pwdAcceptable":"Acceptable","pwdStrong":"Strong","mustChangePassword":"You must change your password","passwordChange":"Change password","emailChange":"Change email","avatarChange":"Change avatar","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing informations","missingDataHelper":"We know that this is a bit annoying, but we need some more informations to complete your registration.","goToAccountToChangeYourPreferences":"You can change your choice at any time from your Account page.","deepThoughtExplaination":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","tnCAndPPAcceptedHelper":"Since your last login, T&C and Privacy Policy have changed. Please accept them, otherwise you won\'t be able to make changes to your Twins. You can always delete your account in your user profile page.","privacyLabel":"I have read and accepted the","privacyAndCookiePolicy":"Privacy e Cookie Policy","and":"and","termsOfService":"Terms of Service","pAndCUAccepted":"I accept the terms of service about Deep Thought","editAccount":"Edit account","save":"Save"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","USER_CREATION_BILLING_DENIED_PERMISSION":"You don\'t have enough credits to create a Twin","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","SESSION_EXPIRED":"Session expired","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_INVALID_RECEIVER_ID":"CSV import: invalid receiver ID","IMPORTCSV_INVALID_MEDIA_LINK":"CSV import: invalid media link","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_INVALID_RECEIVER_ID":"Import TXT: invalid receiver ID","IMPORTTXT_INVALID_MEDIA_LINK":"Import TXT: invalid media link","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","IMPORTTXT_BILLING_DENIED_PERMISSION":"Import TXT: you don\'t have enough credits for the operation","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Result: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Result: user badges disabled"}}'))},it:{translation:t(BV)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});FV.init();var UV=FV;c=o("85Hg2");function jV(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(ae.Provider,{value:i},r)}const HV=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:h=!0,showCopyButton:p=!0,showTranslationOriginal:f=!1,showSettings:m=!0,showInstruct:g=!1,showTypingText:v=!1,showClear:y=!1,showOnlyLastMessages:b=!1,showInputs:x=!0,showDates:S=!1,showContextPerLine:w=!1,showLogin:_,height:C="100%",baseURL:A,apiURL:E="https://backend.memori.ai",engineURL:T="https://engine.memori.ai",tag:M,pin:I,context:R,initialQuestion:P,uiLang:k,spokenLang:O,multilingual:N,authToken:L,AZURE_COGNITIVE_SERVICES_TTS_KEY:D,defaultSpeakerActive:B=!0,disableTextEnteredEvents:z=!1,onStateChange:F,additionalInfo:U,customMediaRenderer:j,additionalSettings:H,userAvatar:V})=>{var G,W,q;const[K,J]=(0,c.useState)(),[Q,Z]=(0,c.useState)(),[X,$]=(0,c.useState)(D),{t:ee}=Se();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const te=Y(E,T),ne=(0,c.useCallback)((async()=>{const e=A||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&$(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{D||ne()}),[D]);const re=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await te.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?J(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await te.backend.getMemori(o,e,n);0===r.resultCode&&t?J(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{re()}),[re,o]);const ie=(0,c.useCallback)((async()=>{const e=await yH(o,A);e&&Z(e)}),[o,E]);(0,c.useEffect)((()=>{ie()}),[ie]),(0,c.useEffect)((()=>{if(k)UV.changeLanguage(k.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();UV.changeLanguage(e).catch((()=>{UV.changeLanguage(t)}))}}),[k]),(0,c.useEffect)((()=>{cm()}),[]);const oe=K?(0,s.jsx)(gH,{layout:u,customLayout:d,height:C,baseUrl:A||(o.startsWith("https://")?o:`https://${o}`),apiUrl:E,memori:{...K,secretToken:a},ownerUserName:null!=e?e:K.ownerUserName,ownerUserID:null!=t?t:K.ownerUserID,tenantID:o,memoriLang:null!=O?O:null===(W=null===(G=K.culture)||void 0===G?void 0:G.split("-"))||void 0===W?void 0:W[0],multilingual:N,tenant:Q,secret:a,sessionID:l,showShare:h,showCopyButton:p,showTranslationOriginal:f,showSettings:m,showInstruct:g,showTypingText:v,showClear:y,showOnlyLastMessages:b,showInputs:x,showDates:S,showContextPerLine:w,showLogin:null!=_?_:null==K?void 0:K.enableDeepThought,integration:null===(q=null==K?void 0:K.integrations)||void 0===q?void 0:q.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:R,initialQuestion:P,authToken:L,AZURE_COGNITIVE_SERVICES_TTS_KEY:X||D,defaultSpeakerActive:B,disableTextEnteredEvents:z,onStateChange:F,additionalInfo:U,customMediaRenderer:j,additionalSettings:H,userAvatar:V,...M&&I?{personification:{tag:M,pin:I}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[ee("loading")||"Loading","..."]})});return(0,s.jsxs)(jV,{i18n:UV,children:[(0,s.jsx)(Ju.Toaster,{position:"top-center",reverseOrder:!0}),oe]})};HV.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showCopyButton:t(l).bool,showTranslationOriginal:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,showLogin:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,engineURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,defaultSpeakerActive:t(l).bool,disableTextEnteredEvents:t(l).bool,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var VV=HV;class GV extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(VV.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),"true"!==e[t]&&"false"!==e[t]||(e[t]="true"===e[t])),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(VV,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",GV)})();
|
|
250
|
+
*/function YU(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function ZU(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function XU(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var $U=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function ej(e){const n=e,{value:r,size:i=WU,level:o=qU,bgColor:s=KU,fgColor:a=JU,includeMargin:l=QU,style:u,imageSettings:d}=n,h=HU(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),p=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=VU.QrCode.encodeText(r,GU[o]).getModules();const c=l?4:0,u=n.length+2*c,h=XU(n,i,l,d),p=m.current,g=null!=h&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;g&&null!=h.excavation&&(n=ZU(n,h.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,$U?t.fill(new Path2D(YU(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(p,h.x+c,h.y+c,h.w,h.h)}})),(0,c.useEffect)((()=>{v(!1)}),[p]);const y=jU({height:i,width:i},u);let b=null;return null!=p&&(b=t(c).createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",jU({style:y,height:i,width:i,ref:f},h)),b)}var tj=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=Se(),[h,p]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||p(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${h}`,icon:TU},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${h}`,icon:MU},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${h}`,icon:IU},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${h}`,icon:RU},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${h}`,icon:LU},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${h}`,icon:PU}];return(0,s.jsxs)(Dv,{as:"div",className:t(ws)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Dv.Button,{className:t(ws)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(kU,{})})}),(0,s.jsxs)(Dv.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Dv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Sf,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(dx,{}),onClick:()=>{h&&navigator.clipboard.writeText(h)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Dv.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(ws)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(Dv.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(ej,{id:"qr-canvas",value:null!=h?h:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(Sf,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(OU,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var nj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var rj=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var ij=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var oj=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,enableAudio:h=!0,speakerMuted:p,setSpeakerMuted:f,hasUserActivatedSpeak:m=!1,showShare:g=!0,showSettings:v=!0,showSpeaker:y=!0,showReload:b=!1,showClear:x=!1,showLogin:S=!0,setShowLoginDrawer:w,clearHistory:_,loginToken:C,user:A,sessionID:E})=>{const{t:T}=Se(),[M,I]=(0,c.useState)(!1),[R,P]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&I(!0)}),[]),(0,s.jsxs)("div",{className:t(ws)("memori-header",e),children:[n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[0!==o.latitude&&0!==o.longitude&&(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--position",title:T("widget.position")||"Position",icon:(0,s.jsx)(Qx,{}),onClick:()=>a(!0)})]}),b&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:T("reload")||"Reload",icon:(0,s.jsx)(rj,{}),onClick:()=>{window.location.reload()}}),x&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:T("clearHistory")||"Clear chat",icon:(0,s.jsx)(ij,{}),onClick:_}),M&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:R?T("fullscreenExit")||"Exit fullscreen":T("fullscreenEnter")||"Enter fullscreen",icon:R?(0,s.jsx)(Nx,{}):(0,s.jsx)(nj,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),P(!1)):(document.documentElement.requestFullscreen(),P(!0))}}),n.enableDeepThought&&!!C&&(null==A?void 0:A.pAndCUAccepted)&&(0,s.jsx)(Sf,{primary:!!E&&!!m,shape:"circle",icon:(0,s.jsx)(Kx,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!m||!E,onClick:()=>u(!0),title:T("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",icon:(0,s.jsx)(qx,{}),className:"memori-header--button memori-header--button--experts",disabled:!m||!E,onClick:()=>d(!0),title:T("widget.showExpertsInTheBoard")||"Experts in this board"}),h&&y&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(nU,{}):(0,s.jsx)(iU,{}),onClick:()=>f(!p),title:T("widget.sound")||"Sound"}),(0,s.jsx)(AU,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!m||0===i.length}),v&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(EU,{}),onClick:()=>l(!0),title:T("widget.settings")||"Settings"}),g&&(0,s.jsx)(tj,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Sf,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(vv,{}),onClick:()=>w(!0),title:C?T("login.user")||"User":T("login.login")||"Login"})]})};var sj=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{const i="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator"===(null==e?void 0:e.theme)?"twincreator":"aisuru";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://aisuru.com/images/${i}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"sr-only",children:"Powered by"}),(0,s.jsx)("a",{href:`https://memori.ai/${"it"===(null==t?void 0:t.toLowerCase())?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},aj=(c=o("85Hg2"),c=o("85Hg2"),(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(aj||{})),lj=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(lj||{}),cj=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(cj||{}),uj=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(uj||{});function dj(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Cp(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let hj={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return lh(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=dj(e),i=mm(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=dj(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;lh(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=dj(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},pj=(0,c.createContext)(null);function fj(e){let t=(0,c.useContext)(pj);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,fj),t}return t}function mj(e,t){return lh(t.type,hj,e,t)}pj.displayName="ListboxContext";let gj=c.Fragment,vj=mh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...h}=e;const p=u?"horizontal":"vertical";let f=Ph(n),[m,g]=xm(r,s,i),v=(0,c.useReducer)(mj,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Mh("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:p,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:x,buttonRef:S},w]=v;b.current.value=m,b.current.mode=d?1:0,_h((()=>{b.current.onChange=e=>lh(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),_h((()=>w({type:2,disabled:l})),[l]),_h((()=>w({type:3,orientation:p})),[p]),rf([S,x],((e,t)=>{var n;w({type:1}),xp(t,bp.Loose)||(e.preventDefault(),null==(n=S.current)||n.focus())}),0===y);let _=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),C={ref:f};return t(c).createElement(pj.Provider,{value:v},t(c).createElement(Sh,{value:lh(y,{0:bh.Open,1:bh.Closed})},null!=o&&null!=m&&gm({[o]:m}).map((([e,n])=>t(c).createElement(dp,{features:up.Hidden,...gh({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),hh({ourProps:C,theirProps:h,slot:_,defaultTag:gj,name:"Listbox"})))})),yj=mh((function(e,t){var n;let[r,i]=fj("Listbox.Button"),o=Ph(r.buttonRef,t),s=`headlessui-listbox-button-${cp()}`,a=Uh(),l=Mh((e=>{switch(e.key){case ip.Space:case ip.Enter:case ip.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:fm.First})}));break;case ip.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:fm.Last})}))}})),u=Mh((e=>{if(e.key===ip.Space)e.preventDefault()})),d=Mh((e=>{if(op(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),h=um((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),p=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return hh({ourProps:{ref:o,id:s,type:hm(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":h,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:p,defaultTag:"button",name:"Listbox.Button"})})),bj=mh((function(e,t){let[n]=fj("Listbox.Label"),r=`headlessui-listbox-label-${cp()}`;return hh({ourProps:{ref:Ph(n.labelRef,t),id:r,onClick:Mh((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),xj=uh.RenderStrategy|uh.Static,Sj=mh((function(e,t){var n;let[r,i]=fj("Listbox.Options"),o=Ph(r.optionsRef,t),s=`headlessui-listbox-options-${cp()}`,a=Uh(),l=Uh(),u=xh(),d=null!==u?u===bh.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=hp(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let h=Mh((e=>{switch(l.dispose(),e.key){case ip.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case ip.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),Nh().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case lh(r.orientation,{vertical:ip.ArrowDown,horizontal:ip.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.Next});case lh(r.orientation,{vertical:ip.ArrowUp,horizontal:ip.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.Previous});case ip.Home:case ip.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.First});case ip.End:case ip.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:fm.Last});case ip.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case ip.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),p=um((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return hh({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":p,"aria-orientation":r.orientation,id:s,onKeyDown:h,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:xj,visible:d,name:"Listbox.Options"})})),wj=mh((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=fj("Listbox.Option"),a=`headlessui-listbox-option-${cp()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,h=lh(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),p=(0,c.useRef)(null),f=Ph(t,p);_h((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=Nh();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:p});_h((()=>{m.current.disabled=n}),[m,n]),_h((()=>{m.current.value=r}),[m,r]),_h((()=>{var e,t;m.current.textValue=null==(t=null==(e=p.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,p]);let g=Mh((()=>o.propsRef.current.onChange(r)));_h((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Mh((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),Nh().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Mh((()=>{if(n)return s({type:4,focus:fm.Nothing});s({type:4,focus:fm.Specific,id:a})})),b=Mh((()=>{n||l||s({type:4,focus:fm.Specific,id:a,trigger:0})})),x=Mh((()=>{n||!l||s({type:4,focus:fm.Nothing})})),S=(0,c.useMemo)((()=>({active:l,selected:h,disabled:n})),[l,h,n]);return hh({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":h,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:x,onMouseLeave:x},theirProps:i,slot:S,defaultTag:"li",name:"Listbox.Option"})})),_j=Object.assign(vj,{Button:yj,Label:bj,Options:Sj,Option:wj});var Cj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const Aj={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},Ej=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=Se(),[o,a]=(0,c.useState)(e?"string"==typeof e?_s.DateTime.fromISO(e):_s.DateTime.fromJSDate(e):_s.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(_j,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(_j.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(_j.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(_j.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(_j,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(_j.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(_j.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:Aj["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori--date-selector__select-options",children:Aj["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(_j.Option,{className:"memori--date-selector__select-option",value:o.set({month:Aj["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(_j,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(_j.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(_j.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori--date-selector__select-options",children:[...Array(_s.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(_j.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));Ej.displayName="DateSelector";var Tj=Ej;c=o("85Hg2");var Mj=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=Se(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,h]=(0,c.useState)(!1),p=(0,c.useCallback)((()=>{if(h(!0),!o)return t(Ju).error(i("requiredField")),u(i("requiredField")||"Required field"),void h(!1);if(_s.DateTime.now().diff(o,"years").years<r)return t(Ju).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void h(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Km,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),p()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(Tj,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Sf,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var Ij=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const h=(0,c.useRef)(null);return(0,c.useEffect)((()=>{h.current&&(h.current.indeterminate=i)}),[h,i]),(0,s.jsxs)("label",{className:t(ws)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:h,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var Rj=({className:e,value:n,name:r,displayValue:i,options:o,onChange:a,disabled:l=!1,label:u,placeholder:d})=>(0,s.jsx)("div",{className:t(ws)("memori-select",e),children:(0,s.jsxs)(_j,{value:n,onChange:e=>{a(e)},disabled:l,name:r,children:[u&&(0,s.jsxs)(_j.Label,{className:"memori-select--label",children:[u,":"]}),(0,s.jsxs)(_j.Button,{"aria-label":u,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(ws)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?i||n:d}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(Cj,{})})]}),(0,s.jsx)(np,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(_j.Options,{className:"memori-select--options",children:o.map((e=>(0,s.jsx)(_j.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const Pj={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken",location:"@memori:location"},kj=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=Pj[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},Oj=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=Pj[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},Nj=e=>{var t;try{window.localStorage.removeItem(null!==(t=Pj[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},Lj=[2,3,5,10,15,20,30,60];var Dj=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:h})=>{const{t:p}=Se();return(0,s.jsxs)(_f,{className:"memori-settings-drawer",open:e,onClose:n,title:p("widget.settings")||"Settings",description:p("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[p("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)(eU,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),Oj("microphoneMode",t)},children:[(0,s.jsx)(eU.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(eU.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(Rj,{label:p("write_and_speak.secondsLabel")||"Seconds",placeholder:p("write_and_speak.secondsLabel")||"Seconds",options:Lj.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),Oj("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[p("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)(eU,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),Oj("controlsPosition",e)},children:[(0,s.jsx)(eU.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("center")||"Center"})}),(0,s.jsx)(eU.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Sf,{primary:e,outlined:!e,children:p("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(Ij,{label:p("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),Oj("hideEmissions",e.target.checked)}})})]}),h&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:h})]})};c=o("85Hg2");var Bj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var zj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var Fj=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var Uj=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=Se(),d=Y(e),{getKnownFactsPaginated:h,deleteKnownFact:p}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[x,S]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,_]=(0,c.useState)(!1),C=async(e,r,i)=>{if(n||e){_(!0);try{const{knownFacts:o,count:s,...a}=await h(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),S(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ju).error(u(Qv(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}_(!1)}};(0,c.useEffect)((()=>{C()}),[]);const[A,E]=(0,c.useState)(!1),[T,M]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(_f,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(xf,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Sf,{primary:!0,danger:!0,onClick:()=>{E(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(Bj,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Km,{className:"memori-known-facts-modal",open:A,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{E(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{E(!1)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>p(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ju).success(u("knownFacts.deleteSuccess")),R([]),C(),E(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ju).error(u(Qv(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ju).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),x>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[x>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Sf,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(zj,{}),onClick:()=>{let e=(y/g-1)*g;b(e),C(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(x/g)]}),(0,s.jsx)(Sf,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(Fj,{}),disabled:(y/g+1)*g>=x,onClick:()=>{let e=(y/g+1)*g;b(e),C(void 0,e,g)}})]}),(0,s.jsx)(Rj,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),C(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(Ij,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(Ij,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Sf,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(Bj,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>M(e.knownFactID)}),(0,s.jsx)(Km,{className:"memori-known-facts-modal",open:T===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Sf,{ghost:!0,onClick:()=>{M(void 0)},children:u("cancel")}),(0,s.jsx)(Sf,{primary:!0,danger:!0,onClick:async()=>{try{const r=await p(n,e.knownFactID);0===r.resultCode?(t(Ju).success(u("knownFacts.deleteSuccess")),R([]),C(),M(void 0)):(console.error(r),t(Ju).error(u(Qv(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ju).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var jj=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=Se();return(0,s.jsx)(_f,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=gv({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};c=o("85Hg2"),c=o("85Hg2");const Hj=["memori","private","public","api","404","500","it","en","account","auth","logout","privacy_and_cookie","unauthorized","users","virtual_spaces"];var Vj=({tenant:e,apiUrl:n,onLogin:r,goToLogin:i,__TEST__waitingForOtp:o=!1})=>{const{t:a,i18n:l}=Se(),u="it"===l.language?"it":"en",d=Y(n),{userSignUp:h,userConfirmSignUp:p,resendVerificationCode:f}=d.backend,[m,g]=(0,c.useState)(),[v,y]=(0,c.useState)(),[b,x]=(0,c.useState)(),[S,w]=(0,c.useState)(),_=!b||b&&$f.test(b),C=_&&b&&b.length>=24,A=!b||0===b.length,E=!_||A?0:b.length<8?15:b.length>=32?100:(b.length-8)*(50/24)+50,[T,M]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1),[P,k]=(0,c.useState)(o),[O,N]=(0,c.useState)(null),[L,D]=(0,c.useState)();(0,c.useEffect)((()=>{D(window.location.href)}),[]);return P?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async n=>{var i,o,s;n.preventDefault();const l=n.currentTarget,c=null!==(i=l.tenant.value)&&void 0!==i?i:e.id,u=null!==(o=l.userName.value)&&void 0!==o?o:v,d=null!==(s=l.password.value)&&void 0!==s?s:b,h=l.verificationCode.value;M(!0),N(null);try{const{user:e,token:n,...i}=await p({tenant:c,userName:u,password:d,verificationCode:h});0!==i.resultCode?(console.error(i),t(Ju).error(a(Qv(i.resultCode)))):e&&n&&(t(Ju).success(a("success")),r(e,n))}catch(e){let n=e;console.error("[validate otp]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{M(!1)}},children:[(0,s.jsx)("input",{type:"hidden",name:"userName",value:v}),(0,s.jsx)("input",{type:"hidden",name:"password",value:b}),(0,s.jsx)("input",{type:"hidden",name:"tenant",value:e.id}),(0,s.jsxs)("label",{htmlFor:"#verificationCode",children:[a("login.otpCode"),(0,s.jsx)("input",{id:"verificationCode",name:"verificationCode",type:"text",required:!0,autoComplete:"one-time-code",placeholder:a("login.otpCode")||"OTP"})]}),(0,s.jsx)("p",{children:(0,s.jsx)(Sf,{outlined:!0,onClick:async n=>{if(n.preventDefault(),v){R(!0);try{const n=await f({tenant:null==e?void 0:e.id,userName:v});0===n.resultCode?t(Ju).success(a("resentVerificationCode")):(console.error(n),t(Ju).error(a(Qv(n.resultCode))))}catch(e){let n=e;console.error("[resend otp]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{R(!1)}}},loading:I,children:a("login.resendVerificationCode")})}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:T,children:a("confirm")})]}),O&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:O})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async n=>{var r,i,o,s,l,c,u;n.preventDefault();const d=n.currentTarget,p=null!==(r=d.tenant.value)&&void 0!==r?r:e.id,f=(null!==(i=d.eMail.value)&&void 0!==i?i:m).toLowerCase(),g=null!==(o=d.userName.value)&&void 0!==o?o:v,y=d.password.value,b=new Date(null===(s=d.birthDate)||void 0===s?void 0:s.value).toISOString(),x=null===(l=d.tnCAndPPAccepted)||void 0===l?void 0:l.checked,S=null===(c=d.pAndCUAccepted)||void 0===c?void 0:c.checked,w=null===(u=d.referral)||void 0===u?void 0:u.value;if(!(f&&g&&y&&b&&x))return void N(a("missingData"));M(!0),N(null);if(((new Date).getTime()-new Date(b).getTime())/1e3/60/60/24/365<14)return t(Ju).error(a("login.underage",{age:14})),void N(a("login.underage",{age:14}));try{const{user:e,...n}=await h({tenant:p,eMail:f,userName:g,password:y,birthDate:b,tnCAndPPAccepted:x,tnCAndPPAcceptanceDate:(new Date).toISOString(),pAndCUAccepted:S,pAndCUAcceptanceDate:(new Date).toISOString(),referral:w});0!==n.resultCode?(console.error(n),t(Ju).error(a(Qv(n.resultCode)))):e&&(t(Ju).success(a("success")),k(!0))}catch(e){let n=e;console.error("[signup]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{M(!1)}},children:[(0,s.jsx)("input",{type:"hidden",name:"tenant",value:e.id}),(0,s.jsx)("input",{type:"hidden",name:"referral",value:L}),(0,s.jsxs)("label",{htmlFor:"#eMail",children:[a("login.email"),(0,s.jsx)("input",{type:"email",name:"eMail",id:"eMail",required:!0,autoComplete:"email",placeholder:a("login.email")||"Email",onChange:e=>g(e.target.value),"aria-invalid":!!(null==m?void 0:m.length)&&!em.test(m)})]}),!!(null==m?void 0:m.length)&&!em.test(m)&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.emailFormatError")}),(0,s.jsxs)("label",{htmlFor:"userName",children:[a("login.username"),(0,s.jsx)("input",{type:"text",name:"userName",id:"userName",required:!0,autoComplete:"username",placeholder:a("login.username")||"Username",onFocus:()=>{if(!(null==v?void 0:v.length)&&(null==m?void 0:m.length)){let e=(e=>e.split("@")[0].replace(/[^a-zA-Z0-9]/g,""))(m);const t=document.getElementById("userName");t&&(t.value=e,y(e))}},onChange:e=>y(e.target.value),"aria-invalid":!!(null==v?void 0:v.length)&&(Hj.includes(v.toLowerCase())||!tm.test(v))})]}),!!(null==v?void 0:v.length)&&Hj.includes(v.toLowerCase())&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.usernameContainsReservedWord")}),!!(null==v?void 0:v.length)&&!tm.test(v)&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.usernameFormatError")}),(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[a("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:a("login.birthDateHelper")})}),(0,s.jsxs)("label",{htmlFor:"#password",children:[a("login.password"),(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"new-password",placeholder:a("login.password")||"Password",onChange:e=>x(e.target.value),"aria-invalid":!_})]}),!_&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.passwordFormatError")}),(0,s.jsxs)("label",{htmlFor:"#confirm-password",children:[a("login.confirmPassword"),(0,s.jsx)("input",{id:"confirm-password",name:"confirmPassword",type:"password",required:!0,autoComplete:"new-password",placeholder:a("login.confirmPassword")||"Password",onChange:e=>w(e.target.value),"aria-invalid":!!(null==b?void 0:b.length)&&!!(null==S?void 0:S.length)&&b!==S})]}),!!(null==b?void 0:b.length)&&!!(null==S?void 0:S.length)&&b!==S&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:a("login.passwordMatchingError")}),(0,s.jsx)("meter",{className:"memori--login-drawer--password-meter",min:0,low:33,high:66,optimum:80,max:100,value:E,id:"password-strength-meter"}),(0,s.jsx)("small",{children:a("login.pwd"+(C?"Strong":_?"Acceptable":"Weak"))}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",required:!0,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[a("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${u}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:a("login.privacyAndCookiePolicy")})," ",a("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${u}/tos`,target:"_blank",rel:"noopener noreferrer",children:a("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[a("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",a("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:a("login.deepThoughtExplaination")})}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:T,children:a("login.signUp")}),(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[a("login.alreadyHaveAnAccount")," ",(0,s.jsx)(Sf,{outlined:!0,onClick:i,children:a("login.backToLogin")})]})]}),O&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:O})]})};c=o("85Hg2");const Gj=["image/jpeg","image/png","image/jpg","image/gif"];var Wj=({user:e,loginToken:n,apiUrl:r,onUserUpdate:i})=>{const{t:o,i18n:a}=Se(),l="it"===a.language?"it":"en",u=Y(r),{updateUser:d,uploadAsset:h}=u.backend,[p,f]=(0,c.useState)(),[m,g]=(0,c.useState)(),[v,y]=(0,c.useState)(),b=!m||m&&$f.test(m),x=b&&m&&m.length>=24,S=!m||0===m.length,w=!b||S?0:m.length<8?15:m.length>=32?100:(m.length-8)*(50/24)+50,[_,C]=(0,c.useState)(!1),[A,E]=(0,c.useState)(null),T=async(e,r)=>{try{const{user:s,...a}=await d(n,e,r);0!==a.resultCode?(console.error(a),t(Ju).error(o(Qv(a.resultCode)))):s&&(t(Ju).success(o("success")),i(s))}catch(e){let n=e;console.error("[signup]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}finally{C(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"memori--login-drawer--edit-account-title",children:o("login.editAccount")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form memori--login-drawer--account-form",onSubmit:async r=>{var i,s,a,l,c;if(r.preventDefault(),!e.userID)return;const u=e.userID,d=r.currentTarget,f=null!==(i=d.eMail.value)&&void 0!==i?i:p,g=null!==(s=d.newPassword.value)&&void 0!==s?s:m,v=d.password.value,y=d.confirmPassword.value,b=null===(a=d.pAndCUAccepted)||void 0===a?void 0:a.checked,x=null===(c=null===(l=d.avatar)||void 0===l?void 0:l.files)||void 0===c?void 0:c[0];if(C(!0),E(null),(null==g?void 0:g.length)&&g!==y)return E(o("login.passwordMatchingError")),void C(!1);let S={...(null==f?void 0:f.length)&&f!==e.eMail?{eMail:f}:{},...g?{password:v,newPassword:g}:{},...void 0!==b&&b!==e.pAndCUAccepted?{pAndCUAccepted:b,pAndCUAcceptanceDate:(new Date).toISOString()}:{}};if(0===Object.values(S).length&&!x)return console.debug("No changes to submit"),void C(!1);if(x){const e=new FileReader;e.onload=async e=>{var r,i;try{const{asset:s,...a}=await h(null!==(r=x.name)&&void 0!==r?r:"avatar",null===(i=e.target)||void 0===i?void 0:i.result,n);0!==a.resultCode?(console.error(a),t(Ju).error(o(Qv(a.resultCode)))):s&&(S.avatarURL=s.assetURL,await T(u,S))}catch(e){let n=e;console.error("[avatar upload]",n),(null==n?void 0:n.message)&&t(Ju).error(n.message)}},e.readAsDataURL(x)}else await T(u,S)},children:[(0,s.jsxs)("details",{className:"memori--details",children:[(0,s.jsx)("summary",{children:o("login.emailChange")}),(0,s.jsxs)("label",{htmlFor:"#eMail",children:[o("login.email"),(0,s.jsx)("input",{type:"email",name:"eMail",id:"eMail",autoComplete:"email",placeholder:e.eMail,onChange:e=>f(e.target.value),"aria-invalid":!!(null==p?void 0:p.length)&&!em.test(p)})]}),!!(null==p?void 0:p.length)&&!em.test(p)&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:o("login.emailFormatError")})]}),(0,s.jsxs)("details",{className:"memori--details",children:[(0,s.jsx)("summary",{children:o("login.passwordChange")}),(0,s.jsxs)("label",{htmlFor:"#password",children:[o("login.currentPassword"),(0,s.jsx)("input",{id:"password",name:"password",type:"password",autoComplete:"password",placeholder:o("login.currentPassword")||"Password"})]}),(0,s.jsxs)("label",{htmlFor:"#newPassword",children:[o("login.newPassword"),(0,s.jsx)("input",{id:"newPassword",name:"newPassword",type:"password",autoComplete:"new-password",placeholder:o("login.password")||"Password",onChange:e=>g(e.target.value),"aria-invalid":!b})]}),!b&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:o("login.passwordFormatError")}),(0,s.jsxs)("label",{htmlFor:"#confirm-password",children:[o("login.confirmPassword"),(0,s.jsx)("input",{id:"confirm-password",name:"confirmPassword",type:"password",autoComplete:"new-password",placeholder:o("login.confirmPassword")||"Password",onChange:e=>y(e.target.value),"aria-invalid":!!(null==m?void 0:m.length)&&!!(null==v?void 0:v.length)&&m!==v})]}),!!(null==m?void 0:m.length)&&!!(null==v?void 0:v.length)&&m!==v&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:o("login.passwordMatchingError")}),(0,s.jsx)("meter",{className:"memori--login-drawer--password-meter",min:0,low:33,high:66,optimum:80,max:100,value:w,id:"password-strength-meter"}),(0,s.jsx)("small",{children:o("login.pwd"+(x?"Strong":b?"Acceptable":"Weak"))})]}),(0,s.jsxs)("details",{className:"memori--details",children:[(0,s.jsx)("summary",{children:o("login.avatarChange")}),(0,s.jsxs)("label",{htmlFor:"#avatar",children:["Avatar",(0,s.jsx)("input",{type:"file",name:"avatar",id:"avatar",accept:Gj.join(", "),placeholder:e.avatarURL})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox memori-checkbox--disabled",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",disabled:!0,defaultChecked:e.tnCAndPPAccepted,checked:e.tnCAndPPAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[o("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${l}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:o("login.privacyAndCookiePolicy")})," ",o("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${l}/tos`,target:"_blank",rel:"noopener noreferrer",children:o("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",className:"memori-checkbox--input",defaultChecked:e.pAndCUAccepted}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsx)(xv,{align:"left",content:o("login.deepThoughtExplaination"),children:(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[o("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",o("login.optional"),")"]})})]})})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:_,children:o("login.save")})]}),A&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:A})]})};var qj=({open:e=!1,onClose:n,onLogin:r,onLogout:i,user:o,loginToken:a,tenant:l,apiUrl:u,__TEST__signup:d=!1,__TEST__needMissingData:h=!1,__TEST__waitingForOtp:p=!1,__TEST__changePwd:f=!1})=>{var m,g;const{t:v,i18n:y}=Se(),b="it"===y.language?"it":"en",x=Y(u),{userLogin:S,updateUser:w}=x.backend,_=(null==o?void 0:o.userID)&&a,[C,A]=(0,c.useState)(!1),[E,T]=(0,c.useState)(null),[M,I]=(0,c.useState)(d),[R,P]=(0,c.useState)(f?{flowID:"flowID",tenant:l.id,eMail:"email",userName:"username",password:"password"}:void 0),[k,O]=(0,c.useState)(h?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{}),[N,L]=(0,c.useState)(),[D,B]=(0,c.useState)(),z=!N||N&&$f.test(N),F=z&&N&&N.length>=24,U=!N||0===N.length,j=!z||U?0:N.length<8?15:N.length>=32?100:(N.length-8)*(50/24)+50;return(0,s.jsx)(_f,{open:e,onClose:n,className:t(ws)("memori--login-drawer",{"memori--login-drawer--logged":_,"memori--login-drawer--signup":M}),title:(0,s.jsx)("span",{className:"memori--login-drawer--title",children:_?v("login.loggedDrawerTitle",{name:o.userName}):v(M?"login.signupDrawerTitle":"login.loginDrawerTitle")}),children:_?(0,s.jsxs)("div",{className:"memori--login-drawer--logged",children:[o.avatarURL&&(0,s.jsx)("figure",{className:"memori--login-drawer--avatar",children:(0,s.jsx)("img",{src:o.avatarURL,alt:o.userName})}),(0,s.jsx)(Sf,{primary:!0,onClick:()=>{i()},children:v("login.logout")}),(0,s.jsx)(Wj,{user:o,loginToken:a,apiUrl:u,onUserUpdate:e=>r(e,a)})]}):(null===(m=null==k?void 0:k.token)||void 0===m?void 0:m.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:v("login.missingData")}),(0,s.jsx)("p",{children:v("login.missingDataHelper")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,s;e.preventDefault();const a=e.currentTarget,l=null===(n=a.birthDate)||void 0===n?void 0:n.value,c=null===(i=a.tnCAndPPAccepted)||void 0===i?void 0:i.checked,u=null===(s=a.pAndCUAccepted)||void 0===s?void 0:s.checked;if(!(null==o?void 0:o.userID)||!(null==k?void 0:k.token))return;if(!l||!c)return void T(v("missingData"));let d={userID:o.userID,birthDate:(null==o?void 0:o.birthDate)||!k.birthDate?void 0:l,tnCAndPPAccepted:c||(null==o?void 0:o.tnCAndPPAccepted),tnCAndPPAcceptanceDate:c?(new Date).toISOString():void 0,pAndCUAccepted:u||(null==o?void 0:o.pAndCUAccepted),pAndCUAcceptanceDate:u?(new Date).toISOString():void 0};const{user:h,...p}=await w(k.token,o.userID,d);0!==p.resultCode?(console.error(p),t(Ju).error(v(Qv(p.resultCode))),T(p.resultMessage)):(t(Ju).success(v("success")),r(h||d,k.token))},children:[k.birthDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[v("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:v("login.birthDateHelper")})})]}),(null==k?void 0:k.tnCAndPPAccepted)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[v("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${b}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:v("login.privacyAndCookiePolicy")})," ",v("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${b}/tos`,target:"_blank",rel:"noopener noreferrer",children:v("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",defaultChecked:null==o?void 0:o.pAndCUAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[v("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",v("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:v("login.goToAccountToChangeYourPreferences")})}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:v("login.deepThoughtExplaination")})})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:C,children:v("login.save")})]})]}):(null==R?void 0:R.flowID)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:v("login.mustChangePassword")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,o,s,a;e.preventDefault();const c=e.currentTarget,u=null!==(n=c.tenant.value)&&void 0!==n?n:l.id,d=null!==(i=c.flowID.value)&&void 0!==i?i:null==R?void 0:R.flowID,h=null!==(o=c.eMail.value)&&void 0!==o?o:null==R?void 0:R.eMail,p=null!==(s=c.userName.value)&&void 0!==s?s:null==R?void 0:R.userName,f=null!==(a=c.password.value)&&void 0!==a?a:null==R?void 0:R.password,m=c.newPassword.value;if(!(null==m?void 0:m.length)||!z)return void T(v("login.passwordFormatError"));A(!0);const g={tenant:u,flowID:d,eMail:h,userName:p,password:f,newPassword:m};try{const{user:e,token:n,...i}=await S(g);0!==i.resultCode?(console.error(i),t(Ju).error(v(Qv(i.resultCode))),T(i.resultMessage)):e&&n&&(t(Ju).success(v("success")),r(e||g,n))}catch(e){let n=e;console.error("[LOGIN/CHANGE PWD]",n),n.message&&(t(Ju).error(n.message),T(n.message))}finally{A(!1)}},children:[(0,s.jsx)("input",{type:"hidden",name:"tenant",value:null!==(g=R.tenant)&&void 0!==g?g:null==l?void 0:l.id}),(0,s.jsx)("input",{type:"hidden",name:"flowID",value:R.flowID}),(0,s.jsx)("input",{type:"hidden",name:"eMail",value:R.eMail}),(0,s.jsx)("input",{type:"hidden",name:"userName",value:R.userName}),(0,s.jsx)("input",{type:"hidden",name:"password",value:R.password}),(0,s.jsxs)("label",{htmlFor:"#newPassword",children:[v("login.password"),(0,s.jsx)("input",{id:"newPassword",name:"newPassword",type:"password",required:!0,autoComplete:"new-password",placeholder:v("login.password")||"Password",onChange:e=>L(e.target.value),"aria-invalid":!z})]}),!z&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:v("login.passwordFormatError")}),(0,s.jsxs)("label",{htmlFor:"#confirm-password",children:[v("login.confirmPassword"),(0,s.jsx)("input",{id:"confirm-password",name:"confirmPassword",type:"password",required:!0,autoComplete:"new-password",placeholder:v("login.confirmPassword")||"Password",onChange:e=>B(e.target.value),"aria-invalid":!!(null==N?void 0:N.length)&&!!(null==D?void 0:D.length)&&N!==D})]}),!!(null==N?void 0:N.length)&&!!(null==D?void 0:D.length)&&N!==D&&(0,s.jsx)("p",{className:"memori--login-drawer--inline-error",children:v("login.passwordMatchingError")}),(0,s.jsx)("meter",{className:"memori--login-drawer--password-meter",min:0,low:33,high:66,optimum:80,max:100,value:j,id:"password-strength-meter"}),(0,s.jsx)("small",{children:v("login.pwd"+(F?"Strong":z?"Acceptable":"Weak"))}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:C,children:v("confirm")})]})]}):M?(0,s.jsx)(Vj,{tenant:l,apiUrl:u,onLogin:r,goToLogin:()=>I(!1),__TEST__waitingForOtp:p}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:e=>{e.preventDefault();const n=e.currentTarget,i=n.userNameOrEmail.value,o=n.password.value,s=em.test(i),a=s?{tenant:null==l?void 0:l.id,eMail:i,password:o}:{tenant:null==l?void 0:l.id,userName:i,password:o};A(!0),T(null),S(a).then((e=>{var n,a,c,u,d;-14===e.resultCode?P({tenant:l.id,eMail:s?i:void 0,userName:s?void 0:i,password:o,flowID:e.flowID||(null===(n=e.user)||void 0===n?void 0:n.flowID)}):0!==e.resultCode?(console.error(e),t(Ju).error(v(Qv(e.resultCode))),T(e.resultMessage)):e.user&&e.token&&((null===(a=e.user)||void 0===a?void 0:a.tnCAndPPAccepted)&&(null===(c=e.user)||void 0===c?void 0:c.birthDate)?r(e.user,e.token):O({token:e.token,birthDate:!(null===(u=e.user)||void 0===u?void 0:u.birthDate),tnCAndPPAccepted:!(null===(d=e.user)||void 0===d?void 0:d.tnCAndPPAccepted)}))})).catch((e=>{console.error("[LOGIN]",e),e.message&&(t(Ju).error(e.message),T(e.message))})).finally((()=>{A(!1)}))},children:[(0,s.jsxs)("label",{htmlFor:"#userNameOrEmail",children:[v("login.userNameOrEmail"),(0,s.jsx)("input",{id:"userNameOrEmail",name:"userNameOrEmail",required:!0,autoComplete:"email",placeholder:"Username/email"})]}),(0,s.jsxs)("label",{htmlFor:"#password",children:["Password",(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"password",placeholder:"Password"})]}),(0,s.jsx)(Sf,{htmlType:"submit",primary:!0,loading:C,children:v("login.login")}),(null==l?void 0:l.disableRegistration)?l.adminEmail?(0,s.jsxs)("div",{className:"memori--login-drawer--signup",children:[(0,s.jsx)("p",{children:v("login.registrationDisabled")}),(0,s.jsxs)("p",{children:[v("login.contactAdmin"),":"," ",(0,s.jsx)("a",{href:`mailto:${l.adminEmail}`,children:l.adminEmail})]})]}):null:(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[v("login.newUserSignUp")," ",(0,s.jsx)(Sf,{outlined:!0,onClick:()=>I(!0),children:v("login.signUp")})]})]}),E&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:E})]})})};var Kj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(xf,{spinning:g,children:[m&&d&&h&&(0,s.jsx)(d,{...h}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var Jj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(xf,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var Qj=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:h,showInstruct:p=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(xf,{spinning:f,className:"memori-chat-layout",children:[m,p&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&h&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var Yj=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:h,sessionId:p,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:x}=Se(),[S,w]=(0,c.useState)(!0),[_,C]=(0,c.useState)(),A=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),E=e=>{w(e),C(e?void 0:(new Date).toISOString());try{null==A||A()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(S?"collapsed":"expanded"),children:S?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>E(!1),title:x("expand")||"Expand",children:(0,s.jsx)(LF,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(xf,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Sf,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>E(!0),icon:(0,s.jsx)(wf,{}),title:x("close")||"Close"})}),m&&d&&h&&(0,s.jsx)(d,{...h}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${_}`:void 0}:{},key:_})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:p&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const Zj=async({operation:e="session_creation",baseUrl:t,userID:n,userName:r,tenant:i})=>{if(!n&&!r)throw new Error("Either userID or userName must be provided");const o=await fetch(`${t}/api/verify-tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e,userID:n,userName:r,tenant:i})});if(!o.ok)throw new Error("Failed to fetch credits");return o.json()},Xj=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let $j,eH,tH,nH,rH,iH;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=Xj,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>Xj(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),Xj(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let oH,sH=!1,aH=!1;var lH=({memori:e,memoriConfigs:n,ownerUserID:r,ownerUserName:i,tenantID:o,memoriLang:a,multilingual:l,integration:u,layout:d="DEFAULT",customLayout:h,showInstruct:p=!1,showShare:f,preview:m=!1,embed:g=!1,showCopyButton:v=!0,showTranslationOriginal:y=!1,showInputs:b=!0,showDates:x=!1,showContextPerLine:S=!1,showSettings:w=!0,showTypingText:_=!1,showClear:C=!1,showLogin:A=!1,showOnlyLastMessages:E,height:T="100vh",secret:M,baseUrl:I="https://aisuru.com",apiUrl:R="https://backend.memori.ai",initialContextVars:P,initialQuestion:k,ogImage:O,sessionID:N,tenant:L,personification:D,authToken:B,AZURE_COGNITIVE_SERVICES_TTS_KEY:z,enableAudio:F,defaultSpeakerActive:U=!0,disableTextEnteredEvents:j=!1,onStateChange:H,additionalInfo:V,additionalSettings:G,customMediaRenderer:W,userAvatar:q})=>{var K,J,Q,Z,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,he,pe,fe,me,ge,ve,ye,be;const{t:xe,i18n:we}=Se(),[_e,Ce]=(0,c.useState)(!1);(0,c.useEffect)((()=>{Ce(!0)}),[]);const Ae=Y(R),{initSession:Ee,postTextEnteredEvent:Te,postPlaceChangedEvent:Me,postDateChangedEvent:Ie,postTimeoutEvent:Re,postTagChangedEvent:Pe,getSession:ke,getContentQualityIndexes:Oe,getExpertReferences:Ne}=Ae,[Le,De]=(0,c.useState)(!1),[Be,ze]=(0,c.useState)(null!==(K=null==V?void 0:V.loginToken)&&void 0!==K?K:B),[Fe,Ue]=(0,c.useState)({avatarURL:"string"==typeof q?q:void 0});(0,c.useEffect)((()=>{Be&&!(null==Fe?void 0:Fe.userID)&&A&&Ae.backend.getCurrentUser(Be).then((({user:e,resultCode:t})=>{e&&0===t?(Ue(e),Oj("loginToken",Be)):Nj("loginToken")}))}),[Be,null==Fe?void 0:Fe.userID]);const[je,He]=(0,c.useState)(!1),[Ve,Ge]=(0,c.useState)(!1),[We,qe]=(0,c.useState)(!1),Ke=(null===(Z=null===(Q=null===(J=e.culture)||void 0===J?void 0:J.split("-"))||void 0===Q?void 0:Q[0])||void 0===Z?void 0:Z.toUpperCase())||(null===(te=null===(ee=null===($=null===(X=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===X?void 0:X.culture)||void 0===$?void 0:$.split("-"))||void 0===ee?void 0:ee[0])||void 0===te?void 0:te.toUpperCase()),Je=(null==u?void 0:u.customData)?JSON.parse(u.customData):null,Qe=void 0!==l?l:!!(null==Je?void 0:Je.multilanguage),Ye=null==Je?void 0:Je.forcedTimeout,[Ze,Xe]=(0,c.useState)(null!==(oe=null!==(ie=null!==(re=null!==(ne=null!=a?a:null==Je?void 0:Je.lang)&&void 0!==ne?ne:Ke)&&void 0!==re?re:null==Je?void 0:Je.uiLang)&&void 0!==ie?ie:we.language)&&void 0!==oe?oe:"IT"),[$e,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(),ot=d||(null==Je?void 0:Je.layout)||"DEFAULT",[st,at]=(0,c.useState)(!1),[lt,ct]=(0,c.useState)(!1),[ut,dt]=(0,c.useState)(!1),[ht,pt]=(0,c.useState)(!1),[ft,mt]=(0,c.useState)(!1),[gt,vt]=(0,c.useState)(!1),[yt,bt]=(0,c.useState)(!(null===(se=null!=F?F:null==Je?void 0:Je.enableAudio)||void 0===se||se)||!U),[xt,St]=(0,c.useState)(!1),[wt,_t]=(0,c.useState)(2),[Ct,At]=(0,c.useState)(!1),[Et,Tt]=(0,c.useState)("center"),[Mt,It]=(0,c.useState)(!1);(0,c.useEffect)((()=>{At(!!tH),aH=!!tH}),[tH]),(0,c.useEffect)((()=>{let e="bottom",t=kj("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",bt(kj("muteSpeaker",!U)),sH=kj("muteSpeaker",!U),St("CONTINUOUS"===t),_t(kj("continuousSpeechTimeout",2)),Tt(kj("controlsPosition",e)),It(kj("hideEmissions",!1)),(null==V?void 0:V.loginToken)||B||(ze(kj("loginToken",void 0)),oH=kj("loginToken",void 0))}),[]);const[Rt,Pt]=(0,c.useState)(M),[kt,Ot]=(0,c.useState)(),[Nt,Lt]=(0,c.useState)(null),[Dt,Bt]=(0,c.useState)(),zt=async(e,t)=>{var n;const r=null!=t?t:$t;if(e&&r){const{currentState:t,...i}=await Me({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&nn((e=>{var n;return{...e,...t,hints:(null===(n=t.hints)||void 0===n?void 0:n.length)?t.hints:null==e?void 0:e.hints}}))}};(0,c.useEffect)((()=>{const e=kj("position",void 0);e&&Bt(e)}),[]);const[Ft,Ut]=(0,c.useState)(""),[jt,Ht]=(0,c.useState)(!1),[Vt,Gt]=(0,c.useState)([]),Wt=e=>{Gt((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},qt=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,h,p,f;const m=i||$t||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Wt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:$t?!!i&&i!==$t:!!i}),nt(!0),it(l);let g=n,v=!1;try{if(!a&&o&&!Le&&Qe&&Ze.toUpperCase()!==Ke.toUpperCase()){g=(await vx(n,Ke,Ze,I)).text}const{currentState:i,...s}=await Te({sessionId:m,text:g});if(0===s.resultCode&&i){const n=c&&l?l:null!==(h=i.emission)&&void 0!==h?h:null==tn?void 0:tn.emission;if("X4"===i.state&&e.giverTag){const{currentState:r,...i}=await Pe(m,e.giverTag);0===i.resultCode?(rn(r),n&&(Wt({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag,memoryTags:r.memoryTags}),Sn(n))):(console.error(s,i),t(Ju).error(xe(Qv(i.resultCode))),v=!0)}else if("X2d"===i.state&&e.giverTag){const{currentState:r,...i}=await Te({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await Pe(m,e.giverTag);0===i.resultCode?(rn(r),n&&(Wt({text:n,emitter:r.emitter,media:r.media,fromUser:!1,questionAnswered:g,contextVars:r.contextVars,date:r.currentDate,placeName:r.currentPlaceName,placeLatitude:r.currentLatitude,placeLongitude:r.currentLongitude,placeUncertaintyKm:r.currentUncertaintyKm,tag:r.currentTag,memoryTags:r.memoryTags}),Sn(n))):(console.error(s,i),t(Ju).error(xe(Qv(i.resultCode))),v=!0)}else console.error(s,i),t(Ju).error(xe(Qv(i.resultCode))),v=!0}else Ze.toLowerCase()!==Ke.toLowerCase()&&n&&!Le&&Qe?Kt(i,Ze,g).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})):(rn({...i,emission:n}),n&&(Wt({text:n,emitter:i.emitter,media:i.media,fromUser:!1,questionAnswered:g,generatedByAI:!!i.completion,contextVars:i.contextVars,date:i.currentDate,placeName:i.currentPlaceName,placeLatitude:i.currentLatitude,placeLongitude:i.currentLongitude,placeUncertaintyKm:i.currentUncertaintyKm,tag:i.currentTag,memoryTags:i.memoryTags}),Sn(n)))}else 404===s.resultCode&&(Gt((e=>[...e.slice(0,e.length-1)])),sn(!1,Rt||e.secretToken,kt,Le&&e.giverTag?e.giverTag:void 0,Le&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||"",...P||{}},k).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{qt(n,r,null==e?void 0:e.sessionID)}),500)})))}catch(e){console.error(e),v=!0,it(void 0),nt(!1)}u||(it(void 0),nt(!1))},Kt=async(e,t,n)=>{var r,i,o;const s=null!==(r=e.emission)&&void 0!==r?r:null==tn?void 0:tn.emission;let a={...e},l=null;if(s&&!Le&&Ke.toUpperCase()!==t.toUpperCase()&&Qe)try{const r=await vx(s,t,Ke,I);if(e.hints&&e.hints.length>0){const n=await Promise.all((null!==(i=e.hints)&&void 0!==i?i:[]).map((async e=>{var n;const r=await vx(e,t,Ke,I);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));a={...e,emission:r.text,translatedHints:n}}else a={...e,emission:s,translatedEmission:r.text,hints:null!==(o=e.hints)&&void 0!==o?o:"G1"===e.state?null==tn?void 0:tn.hints:[]};r.text.length>0&&(l={text:s,translatedText:r.text,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,generatedByAI:!!e.completion,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags})}catch(t){console.error(t),a={...e,emission:s},l={text:s,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags}}else a={...e,emission:s},s&&(l={text:s,emitter:e.emitter,media:e.media,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags});return rn(a),l&&Wt(l),a},Jt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Qt,Yt]=(0,c.useState)(),[Zt,Xt]=(0,c.useState)(!1),[$t,en]=(0,c.useState)(N),[tn,nn]=(0,c.useState)(),rn=e=>{var t;nn(e),H&&H(e);const n=new CustomEvent("MemoriNewDialogState",{detail:e});document.dispatchEvent(n);const r=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==r||r.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.warn(e)}}))},on=async n=>{var r,i,o,s,a;let l=kj("birthDate",void 0);if(Qt||l||!Jt)if("PUBLIC"===e.privacyType||e.secretToken||Rt||kt){et(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.debug(e)}const c=await Ee({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==D?void 0:D.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==D?void 0:D.pin,additionalInfo:{...V||{},loginToken:null!==(a=null!==(s=null!=oH?oH:Be)&&void 0!==s?s:null==V?void 0:V.loginToken)&&void 0!==a?a:B,language:vn(Ze),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return en(c.sessionID),Dt&&zt(Dt,c.sessionID),et(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.warn(c),t(Ju).error(xe("underageTwinSession",{age:Jt})),qe(!0)):403===(null==c?void 0:c.resultCode)?(Pt(void 0),Lt("password")):(console.warn(c),t(Ju).error(xe(Qv(null==c?void 0:c.resultCode))),qe(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else Lt("password");else Xt(!0)},sn=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,h,p,f;et(!0);try{let m,g=kj("birthDate",void 0);if(!c&&!g&&Jt)return void Xt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||Rt||i||kt))return void Lt("password");try{m=window.location.href}catch(e){console.debug(e)}const{sessionID:v,currentState:y,...b}=await Ee({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||Rt||e.secretToken,recoveryTokens:i||kt,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(h=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===h?void 0:h.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...V||{},loginToken:null!==(f=null!==(p=null!=oH?oH:Be)&&void 0!==p?p:null==V?void 0:V.loginToken)&&void 0!==f?f:B,language:vn(Ze),referral:m}});if(v&&y&&0===b.resultCode)return en(v),n&&(rn(y),y.emission&&(Vt.length<=1?Gt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag,memoryTags:y.memoryTags}]):Wt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0,contextVars:y.contextVars,date:y.currentDate,placeName:y.currentPlaceName,placeLatitude:y.currentLatitude,placeLongitude:y.currentLongitude,placeUncertaintyKm:y.currentUncertaintyKm,tag:y.currentTag,memoryTags:y.memoryTags}))),Dt&&zt(Dt,v),e.needsDateTime&&ln({sessionID:v,state:y}),et(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ju).error(xe("underageTwinSession",{age:Jt})),qe(!0)):403===(null==b?void 0:b.resultCode)?(Pt(void 0),Lt("password")):(console.error(b),t(Ju).error(xe(Qv(b.resultCode))),qe(!0))}catch(e){console.error(e)}return et(!1),null},an=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await Pe(n,null!=r?r:Zv);if(0===u){let d=0;if(r!==Zv&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await Te({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await ke(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=kj("birthDate",void 0);try{t=window.location.href}catch(e){console.debug(e)}on({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:M||Rt||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...P||{}},initialQuestion:k,birthDate:Qt||n||void 0,additionalInfo:{...V||{},loginToken:null!==(c=null!==(l=null!=oH?oH:Be)&&void 0!==l?l:null==V?void 0:V.loginToken)&&void 0!==c?c:B,language:vn(Ze),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.warn("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{tn&&(null==tn?void 0:tn.currentTag)===e.giverTag||(async()=>{$t&&e.giverTag&&e.giverPIN&&(Gt([]),await an(e.engineMemoriID,$t,e.giverTag,e.giverPIN))})()}),[]);const ln=(0,c.useCallback)((async({sessionID:t,date:n,state:r})=>{var i;const o=null!=t?t:$t,s=null!=r?r:tn;if(!o||!e.needsDateTime||(null===(i=null==s?void 0:s.hints)||void 0===i?void 0:i.length))return;const a=(n?_s.DateTime.fromISO(n):_s.DateTime.now()).toUTC().toFormat("yyyy/MM/dd HH:mm:ss ZZ").split(":").slice(0,-1).join(":"),{currentState:l,...c}=await Ie(o,a);0===c.resultCode&&l&&nn((e=>{var t;return{...e,...l,hints:(null===(t=l.hints)||void 0===t?void 0:t.length)?l.hints:null==e?void 0:e.hints}}))}),[tn,e.needsDateTime,$t]);(0,c.useEffect)((()=>{if($t&&e.needsDateTime){ln({sessionID:$t,state:tn});let e=setInterval((()=>{ln({sessionID:$t})}),6e4);return()=>{clearInterval(e)}}}),[e.needsDateTime,$t]);const[cn,un]=(0,c.useState)(),dn=(0,c.useRef)(),hn=()=>{cn&&(clearTimeout(cn),un(void 0)),(null==dn?void 0:dn.current)&&(clearTimeout(dn.current),dn.current=void 0)},pn=()=>{hn(),Ct||Ft.length||tt||jt||mn()},fn=async()=>{var e;if(!st||Ct||Ft.length||tt||jt)pn();else if($t&&st&&(null==tn?void 0:tn.acceptsTimeout)){const{currentState:t,...n}=await Re($t);if(0===n.resultCode&&t){const n=t.emission;if(!Le&&Qe&&Ze!==(null==we?void 0:we.language)&&n&&n.length>0)Kt({...t,emission:n},Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)}));else{if(!(n&&n.length>0))return void pn();Wt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion,contextVars:t.contextVars,date:t.currentDate,placeName:t.currentPlaceName,placeLatitude:t.currentLatitude,placeLongitude:t.currentLongitude,placeUncertaintyKm:t.currentUncertaintyKm,tag:t.currentTag,memoryTags:t.memoryTags}),Sn(n),rn({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==tn?void 0:tn.hints:[]})}}}},mn=()=>{let e=null==tn?void 0:tn.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==tn?void 0:tn.emission){e+=tn.emission.length/26.5}}if(Ye&&(e=Ye,null==tn?void 0:tn.emission)){e+=tn.emission.length/26.5}let t=setTimeout(fn,1e3*e);un(t),dn.current=t};(0,c.useEffect)((()=>{(Ft.length||Ct||tt)&&hn(),$t&&!Ft.length&&pn()}),[null==tn?void 0:tn.acceptsTimeout,null==tn?void 0:tn.timeout,null==tn?void 0:tn.state,Ct,$t,Vt,Ft,tt,st]),(0,c.useEffect)((()=>()=>{at(!1),Ge(!1),hn(),dn.current=void 0}),[]);const gn=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:we.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==tn?void 0:tn.emitter)){null==Zn||Zn.find((e=>e.name===(null==tn?void 0:tn.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;case"EL":s=""+("MALE"===l?"el-GR-NestorasNeural":"el-GR-AthinaNeural");break;case"AR":s=""+("MALE"===l?"ar-SA-HamedNeural":"ar-SA-ZariyahNeural");break;case"ZH":s=""+("MALE"===l?"zh-CN-YunxiNeural":"zh-CN-XiaoxiaoNeural");break;case"JA":s=""+("MALE"===l?"ja-JP-KeitaNeural":"ja-JP-NanamiNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==tn?void 0:tn.emitter,we.language,e.culture]),vn=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||we.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI";break;case"EL":i="el-GR";break;case"AR":i="ar-SA";break;case"ZH":i="zh-CN";break;case"JA":i="ja-JP"}return i},[yn,bn]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${I||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{bn(e)}))}),[]);const xn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},Sn=e=>{if(!z||m)return void xn();if(Pn(),m)return;if(yt||sH)return aH=!1,nt(!1),xn(),void(xt&&Mn());nH&&nH.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===rH.state)return void rH.resume().then((()=>Sn(e)));if("closed"===rH.state){rH=new Qo;let e=rH.createBuffer(1,1e4,22050),t=rH.createBufferSource();t.buffer=e,t.connect(rH.destination)}else if("suspended"===rH.state){wn(),rH=new Qo;let e=rH.createBuffer(1,1e4,22050),t=rH.createBufferSource();t.buffer=e,t.connect(rH.destination)}if(!tH){n||(nH=new bs.SpeakerAudioDestination);let e=bs.AudioConfig.fromSpeakerOutput(nH);tH=new bs.SpeechSynthesizer(eH,e)}const r=rH.createBufferSource();r.addEventListener("ended",(()=>{At(!1),aH=!1})),nH.onAudioEnd=()=>{At(!1),aH=!1,r.disconnect(),xn(),Dn()},tH.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${vn(Ze)}"><voice name="${gn(Ze)}"><s>${((e,t)=>{var n;if(!yn)return e;const r={...null!==(n=yn.common)&&void 0!==n?n:{},...(null==L?void 0:L.id)&&yn[L.id]?yn[L.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})(sm(om(im(e))),Ze.toLowerCase())}</s></voice></speak>`,(i=>{if(i){At(!0),aH=!0;try{rH.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(rH.destination),(Vt.length<1||t&&n)&&r.start(0)})),rH.onstatechange=()=>{"suspended"===rH.state||"closed"===rH.state?(r.disconnect(),At(!1),aH=!1):"interrupted"===rH.state&&rH.resume()},rH.resume(),tH&&(tH.close(),tH=null)}catch(t){console.warn("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),At(!1),aH=!1,tH&&(tH.close(),tH=null),xn()}}else rH.resume(),At(!1),aH=!1,xn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),At(!1),aH=!1,xn()})),nt(!1)},wn=()=>{At(!1),aH=!1;try{tH&&(tH.close(),tH=null),"closed"!==rH.state&&rH.close(),nH&&(nH.pause(),nH.close())}catch(e){console.debug("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==tn?void 0:tn.emission]);const[_n,Cn]=(0,c.useState)(""),An=()=>Cn(""),[En,Tn]=(0,c.useState)(null),Mn=()=>{let e=setTimeout((async()=>{kn();const e=rm(_n);e.length>0&&jt?(qt(e),An(),Ut("")):jt&&pn()}),1e3*wt);Tn(e)},In=()=>{En&&(clearTimeout(En),Tn(null))};(0,c.useEffect)((()=>{In(),xt&&Mn(),pn()}),[_n]);const Rn=()=>{if(z){kn(),Cn(""),An();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){ct(!0),eH||(eH=bs.SpeechConfig.fromSubscription(z,"eastus"),eH.speechRecognitionLanguage=vn(Ze),eH.speechSynthesisLanguage=vn(Ze),eH.speechSynthesisVoiceName=gn(Ze));const t=bs.AudioConfig.fromDefaultMicrophoneInput();$j=new bs.SpeechRecognizer(eH,t),Ht(!0),$j.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===bs.ResultReason.RecognizedSpeech){let e=t.result.text;if(Cn(e||""),(null==e?void 0:e.length)>0){const t=rm(e);t.length>0&&Ut((e=>`${e} ${t}`))}}else t.result.reason===bs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},$j.canceled=(e,t)=>{t.reason===bs.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),Pn()},$j.sessionStopped=(e,t)=>{Pn()},An(),$j.startContinuousRecognitionAsync()})).catch(console.debug)}catch(e){console.debug(e)}}},Pn=()=>{$j&&($j.stopContinuousRecognitionAsync(),$j.close(),$j=null),Ht(!1)},kn=()=>{ct(!1),Pn(),In()},On=()=>{try{kn(),hn(),Ge(!1),dn.current=void 0,wn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{On()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",On),()=>{document.removeEventListener("MemoriResetUIEffects",On)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==tn?void 0:tn.state)&&kn()}),[null==tn?void 0:tn.state]);const[Nn,Ln]=(0,c.useState)(!1),Dn=(0,c.useCallback)((e=>{Ct&&tH&&(tH.close(),tH=null),!xt||!lt&&Nn||(Ln(!0),Rn())}),[xt,lt]);(0,c.useEffect)((()=>{Vt.length>1&&!Ct&&xt&&(lt||!Nn)?Rn():Ct&&jt&&Pn()}),[Ct]),(0,c.useEffect)((()=>{jt&&(kn(),An(),Ut(""),Rn())}),[Ke]);const[Bn,zn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{window.innerWidth<=768&&Zf()?zn("click"):zn("keypress")}),[]);const[Fn,Un]=(0,c.useState)(),jn=null==Je?void 0:Je.globalBackground,Hn=jn?`url(${jn})`:null,Vn=u?{"--memori-chat-bubble-bg":"#fff",...Je&&!p?{"--memori-text-color":null!==(ae=Je.textColor)&&void 0!==ae?ae:"#000"}:{},...(null==Je?void 0:Je.buttonBgColor)?{"--memori-button-bg":Je.buttonBgColor,"--memori-primary":Je.buttonBgColor}:{},...(null==Je?void 0:Je.buttonTextColor)?{"--memori-button-text":Je.buttonTextColor}:{},...(null==Je?void 0:Je.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Je?void 0:Je.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Je.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(le=Je.innerBgAlpha)&&void 0!==le?le:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Je.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ce=null==Je?void 0:Je.innerBgAlpha)&&void 0!==ce?ce:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Gn=`\n ${m?"#preview,":"WEBSITE_ASSISTANT"===ot?"":":root,"} .memori-widget, .memori-drawer, .memori-modal {\n ${Object.entries(Vn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,Wn=void 0===(null==Je?void 0:Je.showAIicon)||(null==Je?void 0:Je.showAIicon),qn=void 0===(null==Je?void 0:Je.showWhyThisAnswer)||(null==Je?void 0:Je.showWhyThisAnswer),[Kn,Jn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===ot||"FULLPAGE"!==ot)&&Jn(!0)}),[]),(0,c.useEffect)((()=>{if(null==Je?void 0:Je.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Je.seoTitle),document.head.append(e)}if(null==Je?void 0:Je.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Je.seoDescription),document.head.append(e)}if(null==Je?void 0:Je.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Je.seoUrl),document.head.append(e)}let t=O||e.avatarURL;if((null==Je?void 0:Je.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Je,e.avatarURL,O]);const Qn=(0,c.useCallback)((e=>{if(j)return;const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!sH&&(aH||tt)?setTimeout((()=>{Qn(e)}),1e3):(Pn(),wn(),qt(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[$t,Ct,tt,Ze,j]);(0,c.useEffect)((()=>(j?document.removeEventListener("MemoriTextEntered",Qn):document.addEventListener("MemoriTextEntered",Qn),()=>{document.removeEventListener("MemoriTextEntered",Qn)})),[$t,Ze,j]);const Yn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c,u,d,h,p,f,m,g,v,y,b;const x=(null==t?void 0:t.sessionID)||$t,S=(null==t?void 0:t.dialogState)||tn;Ge(!0);let w=document.getElementById("memori-audio"),_=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");w&&_&&(w.muted=!1,w.play().catch((e=>{console.warn("error playing intro audio",e)})));let C=kj("birthDate",void 0),A=Qt||C||void 0;if(x||!Jt||A){if(!x&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!Rt&&!kt||!x&&We)return Lt("password"),void Ge(!1);if(!x){Ge(!1),qe(!1);const t=await on({memoriID:e.engineMemoriID,password:M||Rt||e.secretToken,tag:null==D?void 0:D.tag,pin:null==D?void 0:D.pin,initialContextVars:{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...P||{}},initialQuestion:k,birthDate:A,additionalInfo:{...V||{},loginToken:null!==(a=null!==(s=null!=oH?oH:Be)&&void 0!==s?s:null==V?void 0:V.loginToken)&&void 0!==a?a:B,language:vn(Ze)}});return void((null==t?void 0:t.dialogState)?(Gt([]),Kt(t.dialogState,Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})).finally((()=>{at(!0)}))):await Yn(t||void 0))}if(N){const{currentState:t,...n}=await ke(x);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),qe(!0),en(void 0),Ge(!1),void await Yn();if(Gt([]),Dt&&zt(Dt,x),e.needsDateTime&&ln({sessionID:x,state:t}),Le&&e.giverTag&&(null==tn?void 0:tn.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await an(e.engineMemoriID,x,"-");const t=await an(e.engineMemoriID,x,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Kt(t.currentState,Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})).finally((()=>{at(!0)}))}catch(t){console.error("session #2",t),sn(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:null===(l=window.location.pathname)||void 0===l?void 0:l.toUpperCase(),ROUTE:(null===(d=null===(u=null===(c=window.location.pathname)||void 0===c?void 0:c.split("/"))||void 0===u?void 0:u.pop())||void 0===d?void 0:d.toUpperCase())||"",...P||{}},k,A).then((()=>{at(!0)}))}else if(!Le&&D&&(null==tn?void 0:tn.currentTag)!==D.tag)try{console.debug("change tag #3"),await an(e.engineMemoriID,x,"-");const t=await an(e.engineMemoriID,x,D.tag,D.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Kt(t.currentState,Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})).finally((()=>{at(!0)}))}catch(t){console.error("session #5",t),sn(!0,null==e?void 0:e.secretToken,void 0,D.tag,D.pin,{PATHNAME:null===(h=window.location.pathname)||void 0===h?void 0:h.toUpperCase(),ROUTE:(null===(m=null===(f=null===(p=window.location.pathname)||void 0===p?void 0:p.split("/"))||void 0===f?void 0:f.pop())||void 0===m?void 0:m.toUpperCase())||"",...P||{}},k,A).then((()=>{at(!0)}))}else if(Le||D||(null==tn?void 0:tn.currentTag)===Zv)Kt(t,Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})).finally((()=>{at(!0)}));else try{console.debug("change tag #6"),await an(e.engineMemoriID,x,"-");const t=await an(e.engineMemoriID,x,Zv);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Kt(t.currentState,Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})).finally((()=>{at(!0)}))}catch(t){console.error("session #8",t),sn(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:null===(g=window.location.pathname)||void 0===g?void 0:g.toUpperCase(),ROUTE:(null===(b=null===(y=null===(v=window.location.pathname)||void 0===v?void 0:v.split("/"))||void 0===y?void 0:y.pop())||void 0===b?void 0:b.toUpperCase())||"",...P||{}},k,A).then((()=>{at(!0)}))}Dt&&zt(Dt,x),e.needsDateTime&&ln({sessionID:x,state:t})}else Gt([]),Kt(S,Ze).then((e=>{let t=e.translatedEmission||e.emission;t&&Sn(t)})).finally((()=>{at(!0)}))}else Xt(!0),Ge(!1)}),[Rt,e,kt,Qt,$t,Ze,Dt]);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?(ze(t.target.getAttribute("authtoken")||void 0),oH=t.target.getAttribute("authtoken")||void 0):(ze((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0),oH=t.target.getAttribute("authtoken")||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Zn,Xn]=(0,c.useState)(),$n=(0,c.useCallback)((async()=>{if($t&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Ne($t);0===n.resultCode?Xn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[$t,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{$n()}),[$t,$n]);const er=e.enableDeepThought&&!!Be&&!!(null==Fe?void 0:Fe.userID)&&(null==Fe?void 0:Fe.pAndCUAccepted),tr=null==L?void 0:L.billingDelegation,[nr,rr]=(0,c.useState)(!0),ir=(0,c.useCallback)((async()=>{if(null==L?void 0:L.billingDelegation)try{const e=await Zj({operation:er?"dt_session_creation":"session_creation",baseUrl:I,userID:r,userName:i,tenant:o});e.enough?rr(!0):(rr(!1),console.warn("Not enough credits. Required:",e.required))}catch(e){let t=e;console.debug(t)}}),[null==L?void 0:L.billingDelegation,er]);(0,c.useEffect)((()=>{(null==L?void 0:L.billingDelegation)&&ir()}),[null==L?void 0:L.billingDelegation,er]);const or=void 0===E?"TOTEM"!==d&&"WEBSITE_ASSISTANT"!==d:!E,sr={memori:e,tenant:L,history:Vt,showShare:null===(ue=null!=f?f:null==Je?void 0:Je.showShare)||void 0===ue||ue,position:Dt,setShowPositionDrawer:dt,setShowSettingsDrawer:pt,setShowKnownFactsDrawer:mt,setShowExpertsDrawer:vt,enableAudio:null===(de=null!=F?F:null==Je?void 0:Je.enableAudio)||void 0===de||de,showSpeaker:!!z,speakerMuted:yt||sH,setSpeakerMuted:e=>{if(sH=!!e,bt(e),Oj("muteSpeaker",!!e),e)wn();else{rH=new Qo;let e=rH.createBuffer(1,1e4,22050),t=rH.createBufferSource();t.buffer=e,t.connect(rH.destination)}},showSettings:w,hasUserActivatedSpeak:st,showReload:"TOTEM"===ot,showClear:C,clearHistory:()=>Gt((e=>e.slice(-1))),showLogin:A,setShowLoginDrawer:He,loginToken:Be,user:Fe,sessionID:$t},ar={memori:e,integration:u,integrationConfig:Je,tenant:L,instruct:Le,avatar3dVisible:Kn,setAvatar3dVisible:Jn,hasUserActivatedSpeak:st,isPlayingAudio:Ct&&!yt,loading:!!tt,baseUrl:I,apiUrl:R},lr={memori:e,tenant:L,language:Ke,userLang:Ze,setUserLang:Xe,baseUrl:I,apiUrl:R,position:Dt,openPositionDrawer:()=>dt(!0),integrationConfig:Je,instruct:Le,sessionId:$t,clickedStart:Ve,isMultilanguageEnabled:Qe,onClickStart:Yn,initializeTTS:()=>{if(!z)return;eH=bs.SpeechConfig.fromSubscription(z,"eastus"),eH.speechSynthesisLanguage=vn(Ze),eH.speechSynthesisVoiceName=gn(Ze),eH.speechRecognitionLanguage=vn(Ze),Zf()&&(eH.speechSynthesisOutputFormat=bs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),rH=new Qo;let e=rH.createBuffer(1,1e4,22050),t=rH.createBufferSource();t.buffer=e,t.connect(rH.destination),nH=new bs.SpeakerAudioDestination;let n=bs.AudioConfig.fromSpeakerOutput(nH);tH=new bs.SpeechSynthesizer(eH,n)},isUserLoggedIn:!!Be&&!!(null==Fe?void 0:Fe.userID),notEnoughCredits:tr&&!nr,showLogin:A,setShowLoginDrawer:He,user:Fe},cr={memori:e,sessionID:$t||"",tenant:L,translateTo:Qe&&Ze.toUpperCase()!==(null===(ge=null!==(me=null!==(fe=null===(pe=null===(he=e.culture)||void 0===he?void 0:he.split("-"))||void 0===pe?void 0:pe[0])&&void 0!==fe?fe:we.language)&&void 0!==me?me:"IT")||void 0===ge?void 0:ge.toUpperCase())?Ze:void 0,baseUrl:I,apiUrl:R,layout:d,memoriTyping:tt,typingText:rt,showTypingText:_,history:or?Vt:Vt.slice(-2),authToken:null!==(ye=null!==(ve=null!=Be?Be:oH)&&void 0!==ve?ve:null==V?void 0:V.loginToken)&&void 0!==ye?ye:B,dialogState:tn,setDialogState:rn,pushMessage:Wt,simulateUserPrompt:(e,t)=>{Pn(),wn(),qt(e,void 0,void 0,!1,t)},showDates:x,showContextPerLine:S,showAIicon:Wn,showWhyThisAnswer:qn,showCopyButton:v,showTranslationOriginal:y,client:Ae,selectReceiverTag:async n=>{var r;if($t)try{const{currentState:i,...o}=await Pe($t,n);if(0===o.resultCode)if(Wt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await Ae.postTagChangedEvent($t,e.giverTag);0===r.resultCode?(rn(n),n.emission&&Wt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1,contextVars:n.contextVars,date:n.currentDate,placeName:n.currentPlaceName,placeLatitude:n.currentLatitude,placeLongitude:n.currentLongitude,placeUncertaintyKm:n.currentUncertaintyKm,tag:n.currentTag,memoryTags:n.memoryTags})):(console.error(r),t(Ju).error(xe(Qv(r.resultCode))))}else rn(i),i.emission&&Wt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1,contextVars:i.contextVars,date:i.currentDate,placeName:i.currentPlaceName,placeLatitude:i.currentLatitude,placeLongitude:i.currentLongitude,placeUncertaintyKm:i.currentUncertaintyKm,tag:i.currentTag,memoryTags:i.memoryTags});else console.error(o,n,null===(r=null==tn?void 0:tn.knownTags)||void 0===r?void 0:r[n]),t(Ju).error(xe(Qv(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ju).error(n.message)}},preview:m,sendOnEnter:Bn,setSendOnEnter:zn,microphoneMode:xt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:Fn,setAttachmentsMenuOpen:Un,instruct:Le,showInputs:b,showMicrophone:!!z,userMessage:Ft,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Ut(""),void pn();Ut(e),hn()},sendMessage:e=>{wn(),Pn(),qt(e),Ut(""),An()},stopListening:kn,startListening:Rn,stopAudio:wn,resetTranscript:An,listening:jt,isPlayingAudio:Ct,customMediaRenderer:W,user:Fe,userAvatar:q,experts:Zn},ur=u&&Hn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:Hn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),dr=u?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Gn}}):null,hr={canInstruct:!!e.giverTag,instruct:!!Le,onChangeMode:e=>{De("instruct"===e),at(!1),Ge(!1)}},pr=(0,s.jsx)(sj,{tenant:L,userLang:Ze,integrationID:null==u?void 0:u.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),fr=h||("TOTEM"===ot?Jj:"CHAT"===ot?Qj:"FULLPAGE"===ot?Kj:"WEBSITE_ASSISTANT"===ot?Yj:Kj);return(0,s.jsxs)("div",{className:t(ws)("memori","memori-widget",`memori-layout-${d.toLowerCase()}`,`memori-controls-${Et.toLowerCase()}`,`memori--avatar-${(null==Je?void 0:Je.avatar)||"default"}`,{"memori--preview":m,"memori--embed":g,"memori--with-integration":u,"memori--with-speechkey":!!z,"memori--active":st,"memori--hide-emissions":Mt,"memori--has-active-session":!!$t}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":$t,"data-memori-integration":null==u?void 0:u.integrationID,"data-memori-engine-state":JSON.stringify({...tn,sessionID:$t}),style:{height:T},children:[(0,s.jsx)(fr,{Header:oj,headerProps:sr,Avatar:FF,avatarProps:ar,Chat:Vx,chatProps:cr,StartPanel:Yx,startPanelProps:lr,integrationStyle:dr,integrationBackground:ur,ChangeMode:tU,changeModeProps:hr,poweredBy:pr,sessionId:$t,hasUserActivatedSpeak:st,showInstruct:p,loading:$e}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),_e&&(0,s.jsx)(mv,{withModal:!0,pwdOrTokens:Nt,openModal:!!Nt,setPwdOrTokens:Lt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r,i,o;t.password&&Pt(t.password),t.password&&(iH=t.password),t.tokens&&Ot(t.tokens),sn(!$t,t.password,t.tokens,Le?e.giverTag:null==D?void 0:D.tag,Le?e.giverPIN:null==D?void 0:D.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...P||{}},k,Qt).then((e=>{Lt(null),Yn(e||void 0)})).catch((()=>{Lt(null),qe(!0)}))},minimumNumberOfRecoveryTokens:null!==(be=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==be?be:1}),_e&&(0,s.jsx)(Mj,{visible:Zt,minAge:Jt,onClose:t=>{var n,r,i,o;t?(Yt(t),Oj("birthDate",t),sn(!$t,iH||Rt||(null==e?void 0:e.secretToken),kt,Le?e.giverTag:null==D?void 0:D.tag,Le?e.giverPIN:null==D?void 0:D.pin,{PATHNAME:null===(n=window.location.pathname)||void 0===n?void 0:n.toUpperCase(),ROUTE:(null===(o=null===(i=null===(r=window.location.pathname)||void 0===r?void 0:r.split("/"))||void 0===i?void 0:i.pop())||void 0===o?void 0:o.toUpperCase())||"",...P||{}},k,t).then((e=>{Xt(!1),Lt(null),Yn(e||void 0)})).catch((()=>{Xt(!1),qe(!0)}))):(Xt(!1),Ge(!1))}}),ht&&(0,s.jsx)(Dj,{layout:ot,open:!!ht,onClose:()=>pt(!1),microphoneMode:xt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:wt,setMicrophoneMode:e=>St("CONTINUOUS"===e),setContinuousSpeechTimeout:_t,controlsPosition:Et,setControlsPosition:Tt,hideEmissions:Mt,setHideEmissions:It,additionalSettings:G}),ut&&(0,s.jsx)(qm,{memori:e,open:!!ut,venue:Dt,setVenue:e=>{Bt(e),zt(e),e?Oj("position",JSON.stringify(e)):Nj("position")},onClose:e=>{e&&zt(e),dt(!1)}}),ft&&$t&&(0,s.jsx)(Uj,{apiURL:R,memori:e,sessionID:$t,visible:ft,closeDrawer:()=>mt(!1)}),gt&&!!Zn&&(0,s.jsx)(jj,{apiUrl:R,baseUrl:I,tenant:L,experts:Zn,open:gt,onClose:()=>vt(!1)}),je&&(null==L?void 0:L.id)&&(0,s.jsx)(qj,{tenant:L,apiUrl:R,open:!!je,user:Fe,loginToken:Be,onClose:()=>He(!1),onLogin:(e,t)=>{Ue(e),ze(t),oH=t,He(!1),Oj("loginToken",t)},onLogout:()=>{Be&&Ae.backend.userLogout(Be).then((()=>{He(!1),Ue(void 0),ze(void 0),oH=void 0,Nj("loginToken")}))}})]})};const cH={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},uH=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://aisuru.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...cH,tenantID:e}}catch(t){return{...cH,tenantID:e}}};function dH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hH(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CF(r.key),r)}}function pH(e,t,n){return t&&hH(e.prototype,t),n&&hH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fH(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mH(e,t){return mH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mH(e,t)}function gH(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mH(e,t)}function vH(e,t){if(t&&("object"===wF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fH(e)}function yH(e){return yH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yH(e)}function bH(e){if(Array.isArray(e))return e}function xH(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function SH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wH(e,t){if(e){if("string"==typeof e)return SH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SH(e,t):void 0}}function _H(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function CH(e){return bH(e)||xH(e)||wH(e)||_H()}function AH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function EH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AH(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var TH={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},MH=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dH(this,e),this.init(t,n)}return pH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||TH,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,EH(EH({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),IH=new MH,RH=function(){function e(){dH(this,e),this.observers={}}return pH(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function PH(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function kH(e){return null==e?"":""+e}function OH(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function NH(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function LH(e,t,n){var r=NH(e,t,Object);r.obj[r.k]=n}function DH(e,t){var n=NH(e,t),r=n.obj,i=n.k;if(r)return r[i]}function BH(e,t,n){var r=DH(e,n);return void 0!==r?r:DH(t,n)}function zH(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):zH(e[r],t[r],n):e[r]=t[r]);return e}function FH(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var UH={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function jH(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return UH[e]})):e}var HH="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,VH=[" ",",","?","!",";"];function GH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function WH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GH(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yH(e);if(t){var i=yH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vH(this,n)}}function KH(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?KH(l,c,n):void 0}i=i[r[o]]}return i}}var JH=function(e){gH(n,e);var t=qH(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return dH(this,n),r=t.call(this),HH&&RH.call(fH(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return pH(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=DH(this.data,s);return a||!o||"string"!=typeof n?a:KH(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),LH(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=DH(this.data,s)||{};r?zH(a,n,i):a=WH(WH({},a),n),LH(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?WH(WH({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(RH),QH={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function YH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ZH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YH(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function XH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yH(e);if(t){var i=yH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vH(this,n)}}var $H={},eV=function(e){gH(n,e);var t=XH(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return dH(this,n),r=t.call(this),HH&&RH.call(fH(r)),OH(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,fH(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=IH.create("translator"),r}return pH(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=VH.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==wF(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var p=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(p).concat(l),f):"".concat(u).concat(p).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(S&&m&&w&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,ZH(ZH({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=_,f):_}if(s){var C="[object Array]"===y,A=C?[]:{},E=C?v:g;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var M="".concat(E).concat(s).concat(T);A[T]=this.translate(M,ZH(ZH({},t),{joinArrays:!1,ns:c})),A[T]===M&&(A[T]=m[T])}m=A}}else if(S&&"string"==typeof x&&"[object Array]"===y)(m=m.join(x))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,ZH(ZH({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,ZH(ZH({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(ZH(ZH({},n),{interpolation:ZH(ZH({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=ZH(ZH({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=QH.handle(h,e,t,this.options&&this.options.postProcessPassResolved?ZH({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,h=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!$H["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&($H["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+f)),p){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),h&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(RH);function tV(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nV=function(){function e(t){dH(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=IH.create("languageUtils")}return pH(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=tV(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=tV(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=tV(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),rV=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],iV={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},oV=["v1","v2","v3"],sV={zero:0,one:1,two:2,few:3,many:4,other:5};function aV(){var e={};return rV.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:iV[t.fc]}}))})),e}var lV=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dH(this,e),this.languageUtils=t,this.options=n,this.logger=IH.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=aV()}return pH(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return sV[e]-sV[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!oV.includes(this.options.compatibilityJSON)}}]),e}();function cV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dV=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};dH(this,e),this.logger=IH.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return pH(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:jH,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?FH(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?FH(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?FH(t.nestingPrefix):t.nestingPrefixEscaped||FH("$t("),this.nestingSuffix=t.nestingSuffix?FH(t.nestingSuffix):t.nestingSuffixEscaped||FH(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=BH(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,uV(uV(uV({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(BH(t,l,s),c,n,uV(uV(uV({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(h){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=kH(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=uV({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=uV(uV({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=kH(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,uV(uV({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function hV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fV(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var mV=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};dH(this,e),this.logger=IH.create("formatter"),this.options=t,this.formats={number:fV((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:fV((function(e,t){var n=new Intl.NumberFormat(e,pV(pV({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:fV((function(e,t){var n=new Intl.DateTimeFormat(e,pV({},t));return function(e){return n.format(e)}})),relativetime:fV((function(e,t){var n=new Intl.RelativeTimeFormat(e,pV({},t));return function(e){return n.format(e,t.range||"day")}})),list:fV((function(e,t){var n=new Intl.ListFormat(e,pV({},t));return function(e){return n.format(e)}}))},this.init(t)}return pH(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=fV(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=CH(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,pV(pV(pV({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function gV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yV(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yH(e);if(t){var i=yH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vH(this,n)}}var bV=function(e){gH(n,e);var t=yV(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dH(this,n),o=t.call(this),HH&&RH.call(fH(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=IH.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return pH(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=NH(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,vV(vV({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(RH);function xV(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===wF(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===wF(e[2])||"object"===wF(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function SV(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function wV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wV(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function CV(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yH(e);if(t){var i=yH(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vH(this,n)}}function AV(){}function EV(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var TV=function(e){gH(n,e);var t=CV(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(dH(this,n),e=t.call(this),HH&&RH.call(fH(e)),e.options=SV(r),e.services={},e.logger=IH,e.modules={external:[]},EV(fH(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),vH(e,fH(e));setTimeout((function(){e.init(r,i)}),0)}return e}return pH(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=xV();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=_V(_V(_V({},r),this.options),SV(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_V(_V({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?IH.init(i(this.modules.logger),this.options):IH.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=mV);var s=new nV(this.options);this.store=new JH(this.options.resources,this.options);var a=this.services;a.logger=IH,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new lV(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new dV(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new bV(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new eV(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=AV),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=PH(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AV,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=PH();return e||(e=this.languages),t||(t=this.options.ns),n||(n=AV),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&QH.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=PH();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==wF(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=_V({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=PH();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=PH();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AV,i=_V(_V(_V({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=_V({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new eV(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(RH);AF(TV,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new TV(e,t)}));var MV=TV.createInstance();MV.createInstance=TV.createInstance;var IV,RV=MV.createInstance;MV.init,MV.loadResources,MV.reloadResources,MV.use,MV.changeLanguage,MV.getFixedT,MV.t,MV.exists,MV.setDefaultNamespace,MV.hasLoadedNamespace,MV.loadNamespaces,MV.loadLanguages;IV=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyRawCode":"Copia codice sorgente","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","exactPosition":"Posizione esatta","uncertain":"Incertezza","question":"Domanda","nothingFound":"Nessun risultato","venue":"Luogo","searchVenue":"Cerca luogo...","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","whyThisAnswer":"Perché questa risposta?","whyThisAnswerHelper":"Questa risposta è stata generata automaticamente da un\'intelligenza artificiale sulla base di questi contenuti verificati.","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtPreDisclaimerUnlogged":"Accedi per abilitare Pensiero Profondo.","deepThoughtPreDisclaimerNotAllowed":"Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.","notEnoughCredits":"L\'autore di questo Twin non ha abbastanza crediti per rispondere alla tua domanda.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Preferenze posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePositionHelp":"Per parlare con {{name}} devi decidere se fornire o meno la tua posizione. Questo perchè diverse risposte che potrà fornirti potrebbero dipendere da dove ti trovi.","dontWantToProvidePosition":"Non voglio fornire la mia posizione","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"login":{"login":"Accedi","logout":"Esci","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","signupDrawerTitle":"Registrati","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","alreadyHaveAnAccount":"Hai già un account?","backToLogin":"Torna al login","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","email":"Email","emailFormatError":"Per favore, inserisci una mail valida","username":"Nome utente","usernameContainsReservedWord":"Il nome utente contiene una parola riservata, per favore cambia il nome utente","usernameFormatError":"Il nome utente deve essere lungo almeno 3 caratteri e può contenere solo lettere, numeri e _","otpCode":"Codice di verifica","resendVerificationCode":"Invia di nuovo","resentVerificationCode":"Codice di verifica inviato! Controlla la tua mail.","password":"Password","newPassword":"Nuova password","confirmPassword":"Conferma la password","currentPassword":"Password attuale","passwordMatchingError":"Le password non coincidono.","passwordFormatError":"La password deve essere lunga almeno 8 caratteri e contenere almeno un numero, una lettera maiuscola, una minuscola e un simbolo","pwdWeak":"Debole","pwdAcceptable":"Accettabile","pwdStrong":"Forte","mustChangePassword":"Devi cambiare la password","passwordChange":"Cambio password","emailChange":"Cambio email","avatarChange":"Cambio avatar","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","missingData":"Informazioni mancanti","missingDataHelper":"Sappiamo che questo è un po\' fastidioso, ma abbiamo bisogno di alcune informazioni in più per completare la tua registrazione.","goToAccountToChangeYourPreferences":"Puoi cambiare la tua scelta in qualsiasi momento dalla tua pagina Account.","deepThoughtExplaination":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme. Consenti all\'autore del twin di contattarti per offerte commerciali riguardanti prodotti su cui hai espresso interesse.","tnCAndPPAcceptedHelper":"Dall\'ultimo accesso, i T&C e l\'Informativa sulla privacy sono stati modificati. Si prega di accettarle, altrimenti non sarà possibile apportare modifiche ai propri gemelli. Puoi sempre cancellare il tuo account nella pagina del tuo profilo utente.","privacyLabel":"Ho letto e accettato l\'","privacyAndCookiePolicy":"informativa sui cookie e sulla privacy","and":"e","termsOfService":"i termini del servizio","pAndCUAccepted":"Accetto le condizioni di utilizzo relative a Pensiero Profondo","editAccount":"Modifica account","save":"Salva"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","USER_CREATION_BILLING_DENIED_PERMISSION":"Non hai crediti sufficienti per creare un Twin","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","SESSION_EXPIRED":"Sessione scaduta","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Memori: funzionalità richiede un abbonamento","INTEGRATION_NOT_FOUND":"Integrazione non trovata","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_INVALID_RECEIVER_ID":"Importazione CSV: ID receiver non valido","IMPORTCSV_INVALID_MEDIA_LINK":"Importazione CSV: link media non valido","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in Memori segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_INVALID_RECEIVER_ID":"Importazione TXT: ID receiver non valido","IMPORTTXT_INVALID_MEDIA_LINK":"Importazione TXT: link media non valido","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in Memori segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importazione TXT: non hai crediti sufficienti per l\'operazione","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare Memori segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Esito: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Esito: badge utente disabilitati"}}');const PV=RV({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyRawCode":"Copy raw code","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","exactPosition":"Exact position","uncertain":"Uncertain","question":"Question","nothingFound":"Nothing found","venue":"Venue","searchVenue":"Search venue...","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","whyThisAnswer":"Why this answer?","whyThisAnswerHelper":"This answer was generated automatically by an artificial intelligence based on these verified contents.","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together.","deepThoughtPreDisclaimerUnlogged":"Log in to enable Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought is disabled since you didn\'t consent its usage, you can change this any time in your account settings.","notEnoughCredits":"The author of this Twin does not have enough credits to answer your question.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position preferences","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","requirePositionHelp":"To talk to {{name}} you have to decide whether to provide your position or not. This is because different answers that it can provide you may depend on where you are.","dontWantToProvidePosition":"I don\'t want to provide my position","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"login":{"login":"Login","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","loginDrawerTitle":"Login","signupDrawerTitle":"Sign up","newUserSignUp":"New user?","signUp":"Sign up!","alreadyHaveAnAccount":"Already have an account?","backToLogin":"Back to login","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","email":"Email","emailFormatError":"Please, insert a valid email","username":"Username","usernameContainsReservedWord":"Username contains a reserved word, please choose another one","usernameFormatError":"Username must be at least 3 characters long and contain only letters, numbers and _","otpCode":"Verification code","resendVerificationCode":"Resend code","resentVerificationCode":"Confirmation code sent! Please check your email.","password":"Password","newPassword":"New password","confirmPassword":"Confirm Password","currentPassword":"Current password","passwordMatchingError":"Passwords do not match.","passwordFormatError":"Password must be at least 8 characters long and contain at least a number, an upper case letter, a lower case letter and a symbol","pwdWeak":"Weak","pwdAcceptable":"Acceptable","pwdStrong":"Strong","mustChangePassword":"You must change your password","passwordChange":"Change password","emailChange":"Change email","avatarChange":"Change avatar","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing informations","missingDataHelper":"We know that this is a bit annoying, but we need some more informations to complete your registration.","goToAccountToChangeYourPreferences":"You can change your choice at any time from your Account page.","deepThoughtExplaination":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","tnCAndPPAcceptedHelper":"Since your last login, T&C and Privacy Policy have changed. Please accept them, otherwise you won\'t be able to make changes to your Twins. You can always delete your account in your user profile page.","privacyLabel":"I have read and accepted the","privacyAndCookiePolicy":"Privacy e Cookie Policy","and":"and","termsOfService":"Terms of Service","pAndCUAccepted":"I accept the terms of service about Deep Thought","editAccount":"Edit account","save":"Save"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","USER_CREATION_BILLING_DENIED_PERMISSION":"You don\'t have enough credits to create a Twin","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","SESSION_EXPIRED":"Session expired","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_INVALID_RECEIVER_ID":"CSV import: invalid receiver ID","IMPORTCSV_INVALID_MEDIA_LINK":"CSV import: invalid media link","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_INVALID_RECEIVER_ID":"Import TXT: invalid receiver ID","IMPORTTXT_INVALID_MEDIA_LINK":"Import TXT: invalid media link","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","IMPORTTXT_BILLING_DENIED_PERMISSION":"Import TXT: you don\'t have enough credits for the operation","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Result: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Result: user badges disabled"}}'))},it:{translation:t(IV)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});PV.init();var kV=PV;c=o("85Hg2");function OV(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(ae.Provider,{value:i},r)}const NV=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:h=!0,showCopyButton:p=!0,showTranslationOriginal:f=!1,showSettings:m=!0,showInstruct:g=!1,showTypingText:v=!1,showClear:y=!1,showOnlyLastMessages:b=!1,showInputs:x=!0,showDates:S=!1,showContextPerLine:w=!1,showLogin:_,height:C="100%",baseURL:A,apiURL:E="https://backend.memori.ai",engineURL:T="https://engine.memori.ai",tag:M,pin:I,context:R,initialQuestion:P,uiLang:k,spokenLang:O,multilingual:N,authToken:L,AZURE_COGNITIVE_SERVICES_TTS_KEY:D,enableAudio:B,defaultSpeakerActive:z=!0,disableTextEnteredEvents:F=!1,onStateChange:U,additionalInfo:j,customMediaRenderer:H,additionalSettings:V,userAvatar:G})=>{var W,q,K;const[J,Q]=(0,c.useState)(),[Z,X]=(0,c.useState)(),[$,ee]=(0,c.useState)(D),{t:te}=Se();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const ne=Y(E,T),re=(0,c.useCallback)((async()=>{const e=A||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&ee(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{D||re()}),[D]);const ie=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await ne.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?Q(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await ne.backend.getMemori(o,e,n);0===r.resultCode&&t?Q(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{ie()}),[ie,o]);const oe=(0,c.useCallback)((async()=>{const e=await uH(o,A);e&&X(e)}),[o,E]);(0,c.useEffect)((()=>{oe()}),[oe]),(0,c.useEffect)((()=>{if(k)kV.changeLanguage(k.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();kV.changeLanguage(e).catch((()=>{kV.changeLanguage(t)}))}}),[k]),(0,c.useEffect)((()=>{cm()}),[]);const se=J?(0,s.jsx)(lH,{layout:u,customLayout:d,height:C,baseUrl:A||(o.startsWith("https://")?o:`https://${o}`),apiUrl:E,memori:{...J,secretToken:a},ownerUserName:null!=e?e:J.ownerUserName,ownerUserID:null!=t?t:J.ownerUserID,tenantID:o,memoriLang:null!=O?O:null===(q=null===(W=J.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0],multilingual:N,tenant:Z,secret:a,sessionID:l,showShare:h,showCopyButton:p,showTranslationOriginal:f,showSettings:m,showInstruct:g,showTypingText:v,showClear:y,showOnlyLastMessages:b,showInputs:x,showDates:S,showContextPerLine:w,showLogin:null!=_?_:null==J?void 0:J.enableDeepThought,integration:null===(K=null==J?void 0:J.integrations)||void 0===K?void 0:K.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:R,initialQuestion:P,authToken:L,AZURE_COGNITIVE_SERVICES_TTS_KEY:$||D,enableAudio:B,defaultSpeakerActive:z,disableTextEnteredEvents:F,onStateChange:U,additionalInfo:j,customMediaRenderer:H,additionalSettings:V,userAvatar:G,...M&&I?{personification:{tag:M,pin:I}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[te("loading")||"Loading","..."]})});return(0,s.jsxs)(OV,{i18n:kV,children:[(0,s.jsx)(Ju.Toaster,{position:"top-center",reverseOrder:!0}),se]})};NV.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showCopyButton:t(l).bool,showTranslationOriginal:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,showLogin:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,engineURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,enableAudio:t(l).bool,defaultSpeakerActive:t(l).bool,disableTextEnteredEvents:t(l).bool,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var LV=NV;class DV extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(LV.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),"true"!==e[t]&&"false"!==e[t]||(e[t]="true"===e[t])),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(LV,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",DV)})();
|