@telia-ace/knowledge-widget-plugins 1.1.1-rc.2 → 1.1.1-rc.3

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/index.js CHANGED
@@ -1,1060 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@emotion/styled"),$=require("@emotion/react"),o=require("react"),Xn=require("react-transition-group"),er=require("react-dom"),Ke=require("react-router-dom"),Ge=(t,e,n,...r)=>{const s=`[${t.get("$environment").name||"webprovisions"}] ${n}`;switch(e){case"info":console.info(s,...r);break;case"warning":console.warn(s,...r);break;case"error":console.error(s,...r);break}},tr=t=>{const e=t.container||t;return{info:(n,...r)=>Ge(e,"info",n,...r),warn:(n,...r)=>Ge(e,"warning",n,...r),error:(n,...r)=>Ge(e,"error",n,...r)}};var ve=(t=>(t.Implementation="implementation",t.Widget="widget",t))(ve||{}),te=(t=>(t.Pre="pre",t.Post="post",t))(te||{});const nr=(t,e,n,r)=>{try{const s=new e(n,r);return{name:t,invoke:(i,a)=>{let c;return s[i]&&(c=s[i].call(s,a)),Promise.resolve(c)},getInstance:()=>s}}catch(s){if(s.message&&s.message.indexOf("is not a constructor")>=0)return{name:t,invoke:i=>{let a;return i==="initialize"&&(a=e(n,r)),Promise.resolve(a)},getInstance:()=>e};throw s}};function Ut(t,e){return typeof t>"u"?e:t}let rr=class{constructor(e={}){this.part=e}createCommand(e,n,r){let s;typeof n=="function"?s={scope:ve.Widget,stage:te.Post,defaultArgs:void 0,handlerResolver:n}:s={scope:Ut(n.scope,ve.Widget),stage:Ut(n.stage,te.Post),defaultArgs:n.defaultArgs,handlerResolver:r};let i=this.part;const a=e.split(".");return a.forEach((c,l)=>{l===a.length-1?i[c]||(i[c]=()=>s):i=this.part[c]=this.part[c]||{}}),this}get(){return this.part}};const gn=t=>{const e=new rr({});return t(e),e.get()};gn(t=>{t.createCommand("types.register",{scope:ve.Implementation,stage:te.Pre},e=>(n,r)=>{e.container.get("$types")[n]=r}).createCommand("type",{stage:te.Pre},e=>n=>{e.container.register("$type",n)}).createCommand("settings",{stage:te.Pre,defaultArgs:[null]},e=>n=>{e.events.dispatch("settings:change",n,{bubbles:!0}),e.container.register("$settings",n)}).createCommand("plugin",{stage:te.Pre},e=>(n,r,s)=>{const{container:i}=e;let a=null,c=n,l=r;typeof n=="string"&&(a=n,c=r,l=s);const h=u=>{const{transformPluginSettings:d}=e.container.get("$environmentOptions"),f=d?d(l||{},a,e.container,c):r;try{const p=nr(a,c,i,f);i.get("$plugins").push(p),u&&p.invoke("initialize",null)}catch(p){tr(e).warn("Error when initializing plugin",p)}};e.container.get("$instance")?h(!0):e.events.subscribeOnce("widget:instance-created",()=>h(!1))}).createCommand("container.register",e=>(n,r)=>{e.container.register(n,r)}).createCommand("container.registerAsync",e=>(n,r)=>{e.container.registerAsync(n,r)}).createCommand("container.registerFactory",e=>(n,r)=>{e.container.registerFactory(n,r)}).createCommand("container.touch",e=>(n,r)=>{e.container.touch(n,r)}).createCommand("csp",{},e=>n=>{e.container.register("csp",n)})});const sr=gn(t=>{t.createCommand("ready",{scope:ve.Implementation,stage:te.Pre},e=>n=>{const{container:r}=e,s=r.owner;r.get("bootstrapping").ready?n(s):s.events.subscribeOnce("bootstrap:ready",()=>{n(s)})})}),Je=new WeakMap;function ue(){return t=>(Je.has(t)||Je.set(t,{}),Je.get(t))}const Qe=(t,e,n,...r)=>{const s=`[${t.get("$environment").name||"webprovisions"}] ${n}`;switch(e){case"info":console.info(s,...r);break;case"warning":console.warn(s,...r);break;case"error":console.error(s,...r);break}},H=t=>{const e=t.container||t;return{info:(n,...r)=>Qe(e,"info",n,...r),warn:(n,...r)=>Qe(e,"warning",n,...r),error:(n,...r)=>Qe(e,"error",n,...r)}},A=ue(),yt=(()=>{let t=0;return()=>++t})(),vt=(t,e,n)=>{const r=A(t).touchQueue.get(e);r&&r.forEach(s=>{s(n,t)})};class ir{constructor(e,n,r,s){this.key=e,this.factory=n,this.parent=r,this.container=s,this.id=yt(),this.resolved=!1,this.constructed=!1,this.async=!0}resolve(){if(!this.constructed){const e=this.factory(this.parent,this.container);return this.constructed=!0,this.value=Promise.resolve(e).then(n=>(this.resolved=!0,vt(this.container,this.key,n),n))}return this.value}}class or{constructor(e,n,r,s){this.key=e,this.value=n,this.parent=r,this.container=s,this.id=yt(),this.async=!1,this.resolved=!1,this.constructed=!0,this.resolve=()=>(this.resolved=!0,vt(this.container,this.key,this.value),this.value)}}class ar{constructor(e,n,r,s){this.key=e,this.value=n,this.parent=r,this.container=s,this.id=yt(),this.async=!1,this.resolved=!1,this.constructed=!1,this.resolve=()=>{this.resolved=!0,this.constructed=!0;const i=this.value(this.parent,this.container);return vt(this.container,this.key,this.value),i}}}class _e{constructor(e,n,r){this.owner=e,this.name=n,this.parent=r,A(this).resolvers=new Map,A(this).touchQueue=new Map,A(this).children=[]}delete(e){const n=A(this).resolvers,r=Array.from(n.values()).find(s=>s.id===e);return r?(A(this).touchQueue.delete(r.key),Promise.resolve(n.delete(r.key))):this.parent?this.parent.delete(e):Promise.resolve(!1)}clear(){const e=A(this).resolvers,n=Array.from(e.values());return Promise.all(n.map(r=>{if(r.constructed)return Promise.resolve(r.resolve()).then(s=>{if(s!==null&&typeof s=="object"&&typeof s.dispose=="function")return s.dispose.call(s,this,r)})})).then(()=>{n.forEach(r=>this.delete(r.id)),A(this).children.forEach(r=>r.clear())})}detach(){if(this.parent){const e=A(this.parent).children,n=e.indexOf(this);n>-1&&(e.splice(n,1),delete this.parent)}}touch(e,n){const r=A(this).resolvers.get(e);if(r&&r.constructed)Promise.resolve(r.resolve()).then(s=>{n(s,this)});else{const s=A(this).touchQueue;let i=s.get(e);i||(i=[],s.set(e,i)),i.push(n)}return this.parent&&!r?this.parent.touch(e,n):Promise.resolve()}registerAsync(e,n){const r=A(this).resolvers.get(e);r&&!r.async&&process.env.NODE_ENV!=="production"&&H(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${e}') previously used by a non-async resolver.`);const s=new ir(e,n,r,this);return A(this).resolvers.set(e,s),s.id}registerFactory(e,n){const r=A(this).resolvers.get(e);r&&r.async&&process.env.NODE_ENV!=="production"&&H(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${e}') previously used by an async resolver.`);const s=new ar(e,n,r,this);return A(this).resolvers.set(e,s),s.id}register(e,n){const r=A(this).resolvers.get(e);r&&r.async&&process.env.NODE_ENV!=="production"&&H(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${e}') previously used by an async resolver.`);const s=new or(e,n,r,this);return A(this).resolvers.set(e,s),s.id}get(e){const n=A(this).resolvers.get(e);if(n)return n.async&&process.env.NODE_ENV!=="production"&&H(this).warn(`You are retrieving an async value (with key '${e}') by the non-async function 'container.get(key)'. This will not be supported in future versions. Use 'container.getAsync(key) instead.'`),n.resolve();if(this.parent)return this.parent.get(e)}getAsync(e){const n=A(this).resolvers.get(e);if(n){if(!n.async)throw process.env.NODE_ENV!=="production"&&H(this).warn(`You are retrieving a non-async value (with key '${e}') by the async function 'container.getAsync(key)'.Use 'container.get(key) instead.'`),"Mismatching resolver type";return n.resolve()}return this.parent?this.parent.getAsync(e):Promise.resolve(void 0)}getMany(...e){const n={};return e.forEach(r=>n[r]=this.get(r)),n}getManyAsync(...e){const n={};return Promise.all(e.map(r=>this.getAsync(r).then(s=>n[r]=s))).then(()=>n)}createChild(e,n){const r=new _e(e,n,this);return A(this).children.push(r),r}}class Kt{constructor(e,n,r=!1,s=!1){this.type=e,this.target=n,this.cancelable=!!r,this.bubbles=!!s,this.defaultPrevented=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}}const q=ue(),Gt=(t,e)=>[].concat(q(t).listenerLookup.get(e.toLowerCase())||[],q(t).listenerLookup.get("*")||[]),Jt=(t,e,n,r)=>{let s,i;return e instanceof Kt?(s=e,i=e.type):(s=new Kt(e,t.target,!!n.cancelable,!!n.bubbles),i=e),{event:s,type:i,async:r}};class bt{constructor(e,n){this.target=e,this.parent=n,q(this).listenerLookup=new Map,q(this).children=[]}clear(){q(this).listenerLookup.clear(),q(this).children.forEach(e=>e.clear())}detach(){if(this.parent){const e=q(this.parent).children,n=e.indexOf(this);n>-1&&e.splice(n,1)}}subscribe(e,n,r){const s=q(this).listenerLookup,i=e.toLowerCase();return s.has(i)||s.set(i,[]),s.get(i).push(n),()=>this.unsubscribe(e,n)}subscribeOnce(e,n){const r=this.subscribe(e,(s,i)=>(r(),n(s,i)))}unsubscribe(e,n){const r=q(this).listenerLookup.get(e.toLowerCase());if(r){const s=r.indexOf(n);s>-1&&r.splice(s,1)}}dispatchAsync(e,n,r={}){const{event:s,type:i}=Jt(this,e,r,!0),a=Gt(this,i);let c=0;const l=a.length;let h=Promise.resolve();for(c=0;c<l;c++)(u=>{h=h.then(d=>d?Promise.resolve(!0):Promise.resolve(u(s,n)).then(()=>s.defaultPrevented))})(a[c]);return h.then(u=>!u&&s.bubbles&&this.parent?this.parent.dispatchAsync(s,n):u)}dispatch(e,n,r={}){const{event:s,type:i}=Jt(this,e,r,!1),a=Gt(this,i);let c=0;const l=a.length;let h=!1;for(c=0;c<l;c++)if(a[c](s,n),s.defaultPrevented){h=!0;break}return!h&&s.bubbles&&this.parent&&(h=this.parent.dispatch(s,n)),h}createChild(e){const n=new bt(e,this);return q(this).children.push(n),n}}const Le=(t,e,n)=>{const r=t.get("$plugins").map(s=>{try{return s.invoke(e,n)}catch(i){H(t).error("An error occured when invoking a plugin.",s,i)}});return Promise.all(r)};class cr{constructor(e){this.widget=e.get("$widget"),this.events=this.widget.events,this.container=this.widget.container,this.initialized=null,this.activated=null,this.initialize=this.initialize.bind(this),this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.invoke=this.invoke.bind(this),this.createInstance()}createInstance(){if(!this.widget.container.get("$instance")){const e=this.widget.container.get("$types"),n=this.widget.container.get("$type");!n&&H(this).error("Unable to create widget. No type is specified.");const r=e[n];!r&&H(this).error(`Unable to create widget. Type '${n}' is not registered.`),this.widget.events.dispatch("widget:create-instance",{},{bubbles:!0});try{this.widget.container.register("$instance",new r(this.container))}catch(s){H(this).error("Unable to create widget type.",s)}this.widget.events.dispatch("widget:instance-created",{},{bubbles:!0})}}initialize(e){return this.initialized=this.initialized||(()=>{const n=this.container.get("$instance"),r=n.initialize||(()=>{});return this.initialized=Promise.resolve(r.call(n,e)).then(()=>Le(this.container,"initialize",e)).then(()=>{})})()}activate(e){return(this.initialized||this.initialize()).then(()=>{this.activated=this.activated||(()=>Le(this.container,"activate").then(()=>{const n=this.container.get("$instance");return this.activated=n.activate(e)}))()})}deactivate(){const e=this.container.get("$instance"),n=e.deactivate||(()=>{});return Le(this.container,"deactivate").then(()=>Promise.resolve(n.call(e))).then(()=>{this.initialized=null,this.activated=null}).then(()=>{})}invoke(e,...n){return Le(this.container,"invoke",{command:e,args:n}).then(()=>{const r=this.container.get("$instance");if(r[e])return r[e].apply(r,n);const s=r.invoke;if(s)return s.call(r,e,...n)})}}const ae=(t,e)=>{if(!e)return!0;if(typeof e=="string"){const n=e.split(",");for(let r=0,s=n.length;r<s;r++){const i=n[r].trim();if(i===t||i==="*")return!0}}return e instanceof Array?e.indexOf(t)>-1:!1},lr=(t,e)=>{if(typeof e=="function")return e(t);const n=typeof e=="string"?dr(e):e;return!(!ae(t.implementation.tenant||"",n.tenant||"")||!ae(t.implementation.name,n.implementation||"")||!ae(t.name,n.widget||"")||!ae(t.container.get("$type"),n.type||""))},ur=(t,e)=>{if(typeof e=="function")return e(t);const n=typeof e=="string"?fr(e):e;return!(!ae(t.tenant||"",n.tenant||"")||!ae(t.name,n.implementation||""))},yn=t=>e=>lr(e,t),hr=t=>e=>ur(e,t),J=t=>t instanceof Array&&t.length===1?t[0]:t,dr=t=>{const e={},n=t.split(":");return n.length===1?e.widget=J(n[0].split(",")):n.length===2?(e.implementation=J(n[0].split(",")),e.widget=J(n[1].split(","))):(e.tenant=J(n[0].split(",")),e.implementation=J(n[1].split(",")),e.widget=J(n[2].split(","))),e},fr=t=>{const e={},n=t.split(":");return n.length===1?e.implementation=J(n[0].split(",")):(e.tenant=J(n[0].split(",")),e.implementation=J(n[1].split(","))),e},Be=ue(),Qt=(t,e,n)=>t.filter(r=>r.stage===e&&yn(r.selector)(n));function mr(t){const e=t.container.get("$environment");let n=Be(e).configurationCache;n&&(n=n.filter(r=>r[0]!==t),Be(e).configurationCache=n)}var Ie=(t=>(t.Implementation="implementation",t.Widget="widget",t))(Ie||{}),Q=(t=>(t.Pre="pre",t.Post="post",t))(Q||{});const vn=(t,e,n)=>(Object.keys(e).forEach(r=>{const s=e[r];if(typeof s=="function"){const i=s();typeof i.defaultArgs<"u"&&n(i,...i.defaultArgs),t[r]=(...a)=>{const c=Object.assign({},i,{handlerResolver:i.handlerResolver.bind({})});return n(c,...a),t}}else t[r]=vn({},s,n)}),t),pr=(t,e)=>{switch(e){case"implementation":return t.implementation;case"widget":return t}},Yt=(t,e,n,r)=>(r.forEach(s=>{vn(t,s,(i,...a)=>{const c={selector:e,stage:i.stage,handler:l=>{const h=pr(l,i.scope),u={container:h.container,events:h.events},d=i.handlerResolver,f=d(u);let p=Be(n.environment).configurationCache;return p||(p=Be(n.environment).configurationCache=[]),p.find(g=>g.indexOf(h)>-1&&g.indexOf(d)>-1)?Promise.resolve():(p.push([h,d]),Promise.resolve(f(...a)))}};n.instructions.push(c)})}),t);function gr(t,e){function n(r){return Yt({},r,t,e)}return Yt(n,"*",t,e)}class yr{constructor(e,n){this.container=e,this.settings=n,this.widget=e.get("$widget"),this.events=this.widget.events}}const vr=(t,e,n,r)=>{try{const s=new e(n,r);return{name:t,invoke:(i,a)=>{let c;return s[i]&&(c=s[i].call(s,a)),Promise.resolve(c)},getInstance:()=>s}}catch(s){if(s.message&&s.message.indexOf("is not a constructor")>=0)return{name:t,invoke:i=>{let a;return i==="initialize"&&(a=e(n,r)),Promise.resolve(a)},getInstance:()=>e};throw s}};function Xt(t,e){return typeof t>"u"?e:t}class br{constructor(e={}){this.part=e}createCommand(e,n,r){let s;typeof n=="function"?s={scope:Ie.Widget,stage:Q.Post,defaultArgs:void 0,handlerResolver:n}:s={scope:Xt(n.scope,Ie.Widget),stage:Xt(n.stage,Q.Post),defaultArgs:n.defaultArgs,handlerResolver:r};let i=this.part;const a=e.split(".");return a.forEach((c,l)=>{l===a.length-1?i[c]||(i[c]=()=>s):i=this.part[c]=this.part[c]||{}}),this}get(){return this.part}}const je=t=>{const e=new br({});return t(e),e.get()},wr=je(t=>{t.createCommand("types.register",{scope:Ie.Implementation,stage:Q.Pre},e=>(n,r)=>{e.container.get("$types")[n]=r}).createCommand("type",{stage:Q.Pre},e=>n=>{e.container.register("$type",n)}).createCommand("settings",{stage:Q.Pre,defaultArgs:[null]},e=>n=>{e.events.dispatch("settings:change",n,{bubbles:!0}),e.container.register("$settings",n)}).createCommand("plugin",{stage:Q.Pre},e=>(n,r,s)=>{const{container:i}=e;let a=null,c=n,l=r;typeof n=="string"&&(a=n,c=r,l=s);const h=u=>{const{transformPluginSettings:d}=e.container.get("$environmentOptions"),f=d?d(l||{},a,e.container,c):r;try{const p=vr(a,c,i,f);i.get("$plugins").push(p),u&&p.invoke("initialize",null)}catch(p){H(e).warn("Error when initializing plugin",p)}};e.container.get("$instance")?h(!0):e.events.subscribeOnce("widget:instance-created",()=>h(!1))}).createCommand("container.register",e=>(n,r)=>{e.container.register(n,r)}).createCommand("container.registerAsync",e=>(n,r)=>{e.container.registerAsync(n,r)}).createCommand("container.registerFactory",e=>(n,r)=>{e.container.registerFactory(n,r)}).createCommand("container.touch",e=>(n,r)=>{e.container.touch(n,r)}).createCommand("csp",{},e=>n=>{e.container.register("csp",n)})}),Cr=wr;function xr(t,e,n=[]){const r=[Cr].concat(n),s=gr(e,r);t(s,e)}class Er{constructor(){this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(e,n,r,s){this.tasks.push({task:e,resolve:n,reject:r,done:s}),this.next()}next(){this.current=this.current.then(()=>{const e=this.tasks.shift();if(e){const n=Promise.resolve(e.task());return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{e.done(),e.resolve(r)})).catch(r=>(e.done(),e.reject(r),this.next()))}return Promise.resolve()})}}const Ne=new WeakMap;function kr(t){return Ne.has(t)||Ne.set(t,new Er),e=>new Promise((n,r)=>{const s=Ne.get(t);s.add(e,n,r,()=>{s.tasks.length||Ne.delete(t)})})}const en=t=>typeof t<"u";var bn=(t=>(t.Activating="activating",t.Loading="loading",t.Activated="activated",t.Deactivating="deactivating",t.Deactivated="deactivated",t))(bn||{});const fe=(t,e)=>{t.events.dispatch("widget:state-change",{state:e},{bubbles:!0}),t.state=e,t.events.dispatch("widget:state-changed",{},{bubbles:!0})},V=ue(),$r=t=>{const{container:e,events:n}=t;e.get("$controller")||(e.register("$controller",new cr(e)),n.dispatch("widget:controller-created",{},{bubbles:!0}))};class Sr{constructor(e,n,r){this.state="deactivated",this.name=e,this.implementation=n,this.container=n.container.createChild(this,e),this.events=n.events.createChild(this),V(this).subscriptions=[],r&&n.configure(s=>{const i=s(e);en(r.type)&&i.type(r.type),en(r.settings)&&i.settings(r.settings),r.plugins&&Object.keys(r.plugins).forEach(a=>{var c;const l=(c=r.plugins)==null?void 0:c[a];i.plugin(a,l)})}),this.load=this.load.bind(this),this.activate=this.activate.bind(this),this.invoke=this.invoke.bind(this),this.deactivate=this.deactivate.bind(this)}load(){return kr(this)(()=>{V(this).deactivatedPromise=null;const e=this.state==="deactivated";e&&(fe(this,"activating"),this.container.register("$widget",this),this.container.register("$controller",null),this.container.register("$plugins",[]),this.container.register("$type",null),this.container.register("$instance",null)),fe(this,"loading");const n=this.implementation.instructions,r=Qt(n,Q.Pre,this);return Promise.all(r.map(s=>s.handler(this))).then(()=>{$r(this);const s=Qt(n,Q.Post,this);return Promise.all(s.map(i=>i.handler(this))).then(()=>{e&&this.container.get("$controller").initialize()})}).then(()=>(fe(this,"activated"),this))})}activate(e){V(this).subscriptions.push(this.implementation.events.subscribe("implementation:configured",()=>{["activated","activating","loading"].indexOf(this.state)>-1&&this.load()}));const n=V(this).activatedPromise;return n?(process.env.NODE_ENV!=="production"&&H(this).warn(`Widget '${this.name}' has already been activated. The passed arguments for this activation will be discarded.`,e),n):V(this).activatedPromise=this.load().then(()=>this.container.get("$controller").activate(e))}invoke(e,...n){const r=V(this).activatedPromise,s=(i,...a)=>r.then(this.load).then(()=>this.container.get("$controller").invoke(i,...a));return r?s(e,...n):(process.env.NODE_ENV!=="production"&&H(this).warn("You are invoking a command on a deactivated widget. The invocation will be queued until the widget is activated.",this),new Promise(i=>{const a=this.events.subscribe("widget:state-changed",()=>{this.state==="activated"&&(a(),i(s(e,...n)))})}))}deactivate(){return V(this).deactivatedPromise||(this.state==="deactivated"?Promise.resolve():(fe(this,"deactivating"),V(this).deactivatedPromise=this.container.get("$controller").deactivate().then(()=>(V(this).activatedPromise=null,V(this).subscriptions.forEach(n=>n()),V(this).subscriptions=[],this.container.clear().then(()=>{this.events.clear(),mr(this),fe(this,"deactivated")})))))}}const tn=ue();class Lr{constructor(e,n,r=[]){this.instructions=[],this.widgets=new Map,this.name=e.name,this.tenant=e.tenant,this.environment=n,this.container=n.container.createChild(this,this.name),this.events=n.events.createChild(this),this.container.register("$types",{}),tn(this).configurationApiExtensions=r}load(){const e=Array.from(this.widgets.values());return Promise.all(e.map(n=>n.load())).then(()=>e)}configure(e){return xr(e,this,tn(this).configurationApiExtensions),this.events.dispatch("implementation:configured",{implementation:this},{bubbles:!0}),this}createWidget(e,n){const r=new Sr(e,this,n);return this.widgets.set(r.name,r),r}}function Nr(t,e,n){const r=new Lr(t,e,n);return t.widgets&&Object.keys(t.widgets).forEach(s=>{var i;const a=(i=t.widgets)==null?void 0:i[s];r.createWidget(s,a)}),r}class Ve{constructor(e,n){this.selectorFactory=n,typeof e=="function"?this.resolver=e:this.resolver=()=>e}append(e){const n=typeof e=="function"?e:()=>e;return new Ve(()=>this.all().concat(n()),this.selectorFactory)}all(){return this.resolver().concat([])}query(e){return this.all().filter(this.selectorFactory(e))}find(e){const n=this.query(e);if(n.length)return n[0]}}const wt="#____version____#",Ye=ue(),Rr=t=>t.tenant?`${t.name}:${t.tenant}`:t.name,wn=class{constructor(t,e=[],n={}){this.widgets=new Ve(()=>{let r=[];return this.implementations.all().forEach(s=>{r=r.concat(Array.from(s.widgets.values()))}),r},yn),this.implementations=new Ve([],hr),this.name=t,this.container=new _e(this,t),this.events=new bt(this),this.container.register("$version",wt),this.container.register("$environment",this),this.container.register("$environmentOptions",n),Ye(this).configurationApiExtensions=e}createImplementation(t){const e=Rr(t);let n=this.implementations.find(e);if(n)return process.env.NODE_ENV!=="production"&&H(n).warn(`Implementation "${e}" already exist on current environment.`),n;const r=Ye(this).configurationApiExtensions;return n=Nr(t,this,r),this.implementations=this.implementations.append([n]),this.events.dispatch("implementation:created",{implementation:n}),n}patch(t={}){const{name:e,configurationApiExtensions:n}=t;typeof e<"u"&&e!==null&&(this.name=e),n&&n.forEach(r=>{Ye(this).configurationApiExtensions.push(r)})}static create(t={}){return new wn(t.name||"",t.configurationApiExtensions,t.options)}};let Cn=wn;Cn.version=wt;const Ar=t=>{const e=[];return[(r,s)=>{e.push(t.subscribe(r,s))},()=>{e.forEach(r=>{r()})}]};class Ct{constructor(e,n=[]){this.platform=e,this.rules=n}match(e){return this.rules.every(n=>!(n.id&&n.id!==e.id||n.type&&n.type!==e.type))}ofType(e){return this.rules.push({type:e}),this}withId(e){return this.rules.push({id:e}),this}select(){return new Or(this.platform,this)}}class xn{constructor(e,n,r){this.platform=e,this.node=n,this.actions=new xt(e,new Ct(e).withId(n.id),r);const[s,i]=Ar(this.platform.events);this.subscribe=s,this.unsubscribe=i}properties(e){return e&&this.node.touchProperties(n=>e(n)),this.node.attributes.properties}context(e){return e&&this.subscribe("components:context-changed",(n,{node:r})=>{r===this.node&&e(this.node.attributes.context)}),this.node.attributes.context}layout(e){return e&&this.subscribe("components:layout-changed",(n,{node:r})=>{r===this.node&&e(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(e,n){this.node.writeProperties(e,n)}writeContext(e,n){this.node.writeProperties(e,n)}writeLayout(e,n){this.node.writeLayout(e,n)}dispose(){this.unsubscribe(),this.actions.dispose()}}class Or{constructor(e,n,r=!0){this.platform=e,this.target=n,this.clearOnDispose=r,this.removes=[],this.actions=new xt(this.platform,this.target)}writeProperties(e,n){this.removes.push(this.platform.write({options:n,attributes:{properties:e},target:this.target,removable:this.clearOnDispose}))}writeContext(e,n){this.removes.push(this.platform.write({options:n,attributes:{context:e},target:this.target,removable:this.clearOnDispose}))}writeLayout(e,n){this.removes.push(this.platform.write({options:n,attributes:{layout:e},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(e=>{e()}),this.actions.dispose()}}const Mr=(t,e,n)=>{const r=t.concat(),s=(i,a,c)=>{let l=!0;if(r.length){const h=r.shift(),u=(d,f)=>(l=!1,s(d,Object.assign({},a,f),c));return Promise.resolve(h(i,u,c)).then(d=>({...d,cancelled:l}))}return Promise.resolve({data:i,cancelled:!1,options:a})};return s(e,{},n)};class xt{constructor(e,n,r){this.platform=e,this.target=n,this.ns=r,this.subscriptions=[],this.create=this.create.bind(this)}create(e,n=()=>{}){const r={key:e,fn:n,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(r);const s=()=>{const i=this.platform.actionsState.handlers.indexOf(r);i>-1&&this.platform.actionsState.handlers.splice(i,1)};return this.subscriptions.push(s),s}dispatch(e,n){const r=this.platform.nodes.all.concat(this.platform.nodes.detached),s={},i=this.platform.actionsState.handlers.filter(a=>a.key===e&&(!a.ns||!this.ns||a.ns===this.ns));return Promise.all(i.map(a=>{const c=r.filter(h=>a.target.match(h)&&this.target.match(h)),l=this.platform.actionsState.watchers.filter(h=>h.key===e&&(!h.ns||!this.ns||h.ns===this.ns)&&c.some(u=>h.target.match(u))).map(h=>h.fn);return Promise.all(c.map(h=>{const u=new xn(this.platform,h,this.ns);return Mr(l,n,u).then(d=>{const{data:f={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:a.fn(f,p,u)).then(v=>{s[h.id]=v})})}))})).then(()=>s)}watch(e,n){let r=e,s=this.ns;const i=e.split(".");i.length>1&&(s=i[0],r=i.splice(1).join("."));const a={fn:n,target:this.target,key:r,ns:s};this.platform.actionsState.watchers.push(a);const c=()=>{const l=this.platform.actionsState.watchers.indexOf(a);l>-1&&this.platform.actionsState.watchers.splice(l,1)};return this.subscriptions.push(c),c}dispose(){this.subscriptions.forEach(e=>e())}}je(t=>{t.createCommand("components",e=>n=>{e.events.subscribeOnce("components:platform-created",(r,{platform:s})=>{n.handlers&&n.handlers.forEach(([i,a])=>{s.addComponentHandler(i,a)})})})});function Pr(t){const e=[];return t.forEach(n=>{e.indexOf(n)===-1&&e.push(n)}),e}function ut(t="",e=""){const n=t.split(" ").concat(e.split(" "));return Pr(n).join(" ").trim()}function Tr(t,e){if(t){if(typeof e=="string")return e;if(Array.isArray(e)){let n="";return e.forEach(r=>n=ut(n,r)),n}}}function L(...t){let e="";return t.length&&t.forEach(n=>{typeof n=="string"?e=ut(e,n):Array.isArray(n)?e=ut(e,Tr(...n)):typeof n<"u"&&n!==null&&process.env.NODE_ENV!=="production"&&M.warn("appendClassNames: arguments either haveto be a string or [boolean, ...string[]]. Passed args:",...t)}),e}function De(t){const e={};if(typeof t=="number"||typeof t=="string")return t;for(const n in t)if(t.hasOwnProperty(n)){const r=t[n],s=n.substring(0,1).toLowerCase()+n.substring(1);if(Object.prototype.toString.call(r)==="[object Array]"){e[s]=[];for(let i=0,a=r.length;i<a;i++)e[s].push(De(r[i]))}else r!==null&&typeof r=="object"?e[s]=De(r):e[s]=r}return e}const qe=(t,e,...n)=>typeof e=="string"?t(`[humany] ${e}`,...n):t(e,...n),me=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>me.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>me.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>me.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>me.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let M=me;M.log=(...t)=>qe(console.log,...t);M.warn=(...t)=>qe(console.warn,...t);M.error=(...t)=>qe(console.error,...t);M.info=(...t)=>qe(console.info,...t);const Et=t=>{let e={},n,r;if(typeof t!="object"||t===null)return t;e=Array.isArray(t)?[]:{};for(r in t)n=t[r],e[r]=typeof n=="object"&&n!==null?Et(n):n;return e};function nn(t){let e=0;if(t.length===0)return e.toString();for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return e.toString()}function zr(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase()}class Hr{constructor(e,n){this.lockWarningTime=e,this.lockErrorTime=n,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(e,n,r,s){this.tasks.push({task:e,resolve:n,reject:r,done:s}),this.next()}next(){this.current=this.current.then(()=>{const e=this.tasks.shift();if(e){let n;const r=setTimeout(()=>{process.env.NODE_ENV!=="production"&&M.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,e),n=setTimeout(()=>{e.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),s=Promise.resolve(e.task()).then(i=>(clearTimeout(r),clearTimeout(n),i));return Promise.resolve(s).then(this.next).then(()=>s.then(i=>{e.done(),e.resolve(i)})).catch(i=>(e.done(),e.reject(i),this.next()))}return Promise.resolve()})}}const Re=new WeakMap;function we(t,e=5e3,n=1e3){return Re.has(t)||Re.set(t,new Hr(e,n)),r=>new Promise((s,i)=>{const a=Re.get(t);a.add(r,s,i,()=>{a.tasks.length||Re.delete(t)})})}const Br=(t={})=>(Object.keys(t).forEach(e=>{(t[e]===null||typeof t[e]>"u")&&delete t[e]}),t),Ae=(t,e)=>{let n=!0;return Object.keys(t).length!==Object.keys(e).length||Object.keys(t).some(s=>!Object.keys(e).some(a=>s===a))?!1:(Object.keys(t).forEach(s=>{if(n){const i=typeof t[s]>"u"?"":t[s],a=typeof e[s]>"u"?"":e[s];n=i.toString()===a.toString()}}),n)},ee=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function Ce(){return ee()+ee()+"-"+ee()+"-"+ee()+"-"+ee()+"-"+ee()+ee()+ee()}class rn{constructor(e,n){this.events=e,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=Ce(),this.type=n,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(e,n){let r=e.get("mounted-nodes");return r||(r=new Map,e.register("mounted-nodes",r)),r.has(this)?(process.env.NODE_ENV!=="production"&&M.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{r.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(e,n="default"){if(e.parent){if(e.parent===this)return;e.parent.removeChild(e)}e.parent=this,this.children[n]||(this.children[n]=[]),this.children[n].push(e),this.events.dispatch("components:node-appended",{node:e})}prependChild(e,n="default"){if(e.parent){if(e.parent===this)return;e.parent.removeChild(e)}e.parent=this,this.children[n]||(this.children[n]=[]),this.children[n].unshift(e),this.events.dispatch("components:node-appended",{node:e})}touchProperties(e,n={},r){const i=[{properties:e},n];return this.changesets.push(i),this.events.dispatch("components:set-properties",{node:this}),()=>{if(r){const a=this.changesets.indexOf(i);a>-1&&(this.changesets.splice(a,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(e,n={},r){const i=[{properties:e},n];return this.changesets.push(i),this.events.dispatch("components:set-properties",{node:this}),()=>{if(r){const a=this.changesets.indexOf(i);a>-1&&(this.changesets.splice(a,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(e,n={},r){const i=[{layout:e},n];return this.changesets.push(i),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!r)return;const a=this.changesets.indexOf(i);a>-1&&(this.changesets.splice(a,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(e,n={},r){const i=[{context:e},n];return this.changesets.push(i),this.events.dispatch("components:set-context",{node:this}),()=>{if(!r)return;const a=this.changesets.indexOf(i);a>-1&&(this.changesets.splice(a,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(e="default"){const n=this.children[e]||[];return n.reduce((r,s,i)=>{const{order:a=i}=s.attributes.layout;return r[a]?r.splice(a,0,s):r[a]=s,r},Array(n.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(e){Object.keys(this.children).forEach(n=>{const r=this.children[n],s=r.indexOf(e);s>-1&&(r.splice(s,1),this.events.dispatch("components:node-removed",{node:e,parentNode:this}))}),delete e.parent}}const En=(t,e,n)=>{for(let r=0,s=t.length;r<s&&n(t[r])!==!0;r++){const i=e[t[r].id]||"default",a=t[r].getChildren(i);En(a,e,n)}},kt=(t,e,n)=>{if(n(t)!==!0){const r=e[t.id]||"default",s=t.children[r];En(s,e,n)}},Xe=(t,e)=>{const n=[];return kt(t,e,r=>{n.push(r)}),n},Ir=(t,e,n)=>{let r;return kt(t,e,s=>{if(n(s))return r=s,!0}),r};class Vr{constructor(e,n,r){this.root=e,this.switches=n,this.all=[],this.visible=[],this.detached=[],r.subscribe("components:node-appended",(s,i)=>{this.all.push(i.node),this.visible=Xe(e,n)}),r.subscribe("components:node-removed",(s,i)=>{let a=this.all.indexOf(i.node);a>-1&&this.all.splice(a,1),a=this.visible.indexOf(i.node),a>-1&&this.visible.splice(a,1),this.visible=Xe(e,n)}),r.subscribe("components:node-switched",(s,i)=>{this.visible=Xe(e,n)})}query(e={}){const n=[];return kt(this.root,this.switches,r=>{Object.keys(e).every(i=>e[i]===r[i])&&n.push(r)}),n}get(e){return Ir(this.root,this.switches,n=>n.id===e)||this.detached.find(n=>n.id===e)}}class Dr{constructor(){this.handlers=new Map}add(e,n){this.handlers.set(e,n)}get(e){return this.handlers.get(e)}}const Fr=t=>{let e=t,n=0;for(;e.parent;)n=n+1,e=e.parent;return n},_r=t=>t.map(([n,r])=>[Fr(n),n,r]).sort(([n],[r])=>n-r).map(([,n,r])=>[n,r]),et=t=>t instanceof Date?!1:t&&typeof t=="object"&&!Array.isArray(t),G=(t,...e)=>{if(!e.length)return t;const n=e.shift();if(et(t)&&et(n))for(const r in n)et(n[r])?(t[r]||Object.assign(t,{[r]:{}}),G(t[r],n[r])):Object.assign(t,{[r]:n[r]});return G(t,...e)},jr=(t,e)=>!t||t==="all"?!0:t.some(n=>e.indexOf(n)>-1),qr=(t,e)=>{let n=[],r=[],s;const i=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const c=new Map,l=_r(n.map((u,d)=>[u,r[d]])),h=(u,d)=>{var E;const f=c.get(u)||{},p=d.context&&!f.context,g=d.properties&&!f.properties,v=d.layout&&!f.layout;c.set(u,{context:f.context||p,properties:f.properties||g,layout:f.layout||v}),g&&(u.attributes.properties={}),v&&(u.attributes.layout={}),p&&(u.attributes.context=G({},(E=u.parent)==null?void 0:E.attributes.context));const m=[],b=[],w=[];if(u.changesets.forEach(C=>{const[k,I]=C;jr(I.breakpoints,t.breakpoints)&&(g&&(typeof k.properties=="function"?m.push(k.properties):G(u.attributes.properties,k.properties)),v&&(typeof k.layout=="function"?b.push(k.layout):G(u.attributes.layout,k.layout)),p&&(typeof k.context=="function"?w.push(k.context):G(u.attributes.context,k.context)))}),m.forEach(C=>{G(u.attributes.properties,C(u.attributes.properties))}),b.forEach(C=>{G(u.attributes.layout,C(u.attributes.layout))}),w.forEach(C=>{G(u.attributes.context,C(u.attributes.context))}),p||d.recursive){const C=t.getBranch(u),k=d.recursive?d:{context:!!p};u.getChildren(C).forEach(I=>{h(I,k)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),l.forEach(([u,d])=>{h(u,d)}),n=[],r=[],e(c)},a=()=>{clearTimeout(s),s=setTimeout(i,0)};return(c,l)=>{const h=n.indexOf(c);if(h>-1){const u=r[h];return l.context&&(u.context=!0),l.properties&&(u.properties=!0),l.layout&&(u.layout=!0),l.recursive&&(u.recursive=!0),a()}return n.push(c),r.push(l),a()}};class kn{constructor(e,n={}){this.providers=n,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new Dr,this.events=e.events.createChild(this);const r=new rn(this.events,"root");r.name=`root-${e.name}`,this.nodes=new Vr(r,this.switches,this.events);const s=this.processNode=qr(this,i=>{const a=Array.from(i.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${a.length} node(s) processed:
2
- ${a.map(c=>`${c.name||"<no name>"} (${c.id})
3
- `)}`),a.forEach(c=>{const l=i.get(c);c.parent&&c.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:c}),l!=null&&l.context&&this.events.dispatch("components:context-changed",{node:c}),l!=null&&l.properties&&this.events.dispatch("components:properties-changed",{node:c}),l!=null&&l.layout&&this.events.dispatch("components:layout-changed",{node:c})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(n).map(i=>n[i].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(i,a)=>{const{node:c}=a;this.changesets.forEach(l=>{const{changeset:h,target:u,removes:d}=l,[f,p]=h;u.match(a.node)&&(f.properties&&d.push(c.writeProperties(f.properties,p)),f.context&&d.push(c.writeContext(f.context,p)),f.layout&&d.push(c.writeLayout(f.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(i,a)=>{s(a.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(i,a)=>{s(a.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(i,a)=>{s(a.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(i,a)=>{s(a.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(i,a)=>{s(a.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(i,{node:a,branch:c})=>{s(a,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(i,{parentNode:a})=>{s(a,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(e){return e.getAsync("components")}addBreakpoint(e){this.breakpoints.indexOf(e)===-1&&(this.breakpoints.push(e),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(e){const n=this.breakpoints.indexOf(e);n>-1&&(this.breakpoints.splice(n,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(e,n){this.switches[e.id]=n,this.events.dispatch("components:node-switched",{node:e,branch:n})}getBranch(e){return this.switches[e.id]}createNode(e,n={}){const r=new rn(this.events,e);return n.detached&&this.nodes.detached.push(r),r}components(){return new Ct(this)}actions(e,n){return new xt(this,e,n)}write(e){const{provider:n,target:r,attributes:s,options:i={},removable:a}=e,c=e.key||Ce(),h={changeset:[s,i],target:r,removes:[]};if(n){const u=this.providers[n];u.write(c,r,s,i),h.removes.push(()=>{u.remove(c)})}return this.changesets.push(h),this.nodes.all.forEach(u=>{if(r.match(u)){let d=()=>{};s.properties&&(d=u.writeProperties(s.properties,i,a)),s.context&&(d=u.writeContext(s.context,i,a)),s.layout&&(d=u.writeContext(s.layout,i,a)),h.removes.push(d)}}),()=>{if(a){h.removes.forEach(d=>d());const u=this.changesets.indexOf(h);u>-1&&this.changesets.splice(u,1)}}}addComponentHandler(e,n){this.customComponentHandler.add(e,n)}getComponentHandler(e){return this.customComponentHandler.get(e)}dispose(){this.subscriptions.forEach(e=>e())}}const Wr=(t,e,n,r=Ce(),s={})=>t.getAsync("components").then(i=>{let a;if(typeof e=="string"){const h=new Ct(i);h.ofType(e),a=h}else a=e;const c={},l=h=>{const u=c[h.id];return u?Promise.resolve(u.controller):kn.getInstance(t).then(d=>new xn(d,h,r))};i.events.subscribe("components:node-enter",(h,{node:u})=>{a.match(u)&&l(u).then(d=>{Promise.resolve(n(d)).then(f=>{c[u.id]={dispose:f,controller:d}})})}),i.events.subscribe("components:node-exit",(h,{node:u})=>{const d=c[u.id];d&&(d.dispose&&d.dispose(),s.reuseController||(d.controller.dispose(),delete c[u.id]))})}),Zr="#____version____#",$n=class extends Cn{constructor(t,e=[]){super(t,e,{transformPluginSettings:(n,r,s)=>{const i=s.get("$settings");return{...i.plugins&&r?i.plugins[r]||{}:{},...n}}})}createImplementation(t){const e=super.createImplementation(t);return e.bindings=t.bindings,e}navigate(t,e,n){this.widgets.query(t).forEach(r=>r.invoke("navigate",{route:e,params:n}))}static create(t={}){const e=[sr].concat(t.configurationApiExtensions||[]);return new $n("humany",e)}static createFromGlobal(t,e={}){if(this.isRuntime(t))return t.patch(e),t;const n=[],r=t&&t._c;r&&r.forEach(i=>n.push(i));const s=this.create(e);return s.container.register("$runtimecfg",n),s}static isRuntime(t){return!!(t&&typeof t=="object"&&t.container&&typeof t.container.get=="function"&&t.container.get("$environment")===t&&t.container.owner===t)}};let Ur=$n;Ur.version=`${Zr} (${wt})`;class $t extends yr{constructor(e,n){super(e,n)}}var be=(t=>(t.open="open",t.closed="closed",t.hidden="hidden",t))(be||{}),Pe=(t=>(t.guide="guide",t.link="link",t.default="default",t))(Pe||{}),F=(t=>(t.Cookie="cookie",t.Local="local",t.Session="session",t))(F||{}),St=(t=>(t.Tenant="tenant",t.Implementation="implementation",t.Widget="widget",t))(St||{}),z=(t=>(t.Necessary="necessary",t.Functional="functional",t.Analytical="analytical",t.Marketing="marketing",t))(z||{});const Lt=(t,e,n,r={})=>sn(t,n).then(s=>(process.env.NODE_ENV!=="production"&&s&&M.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
4
- Key: ${e}
5
- Category: ${JSON.stringify(n)}
6
- Options: ${JSON.stringify(r)}`),i=>(At(t),sn(t,n).then(a=>{if(a){process.env.NODE_ENV!=="production"&&M.warn(`storageWriter: Attempted to write to storage using unallowed category.
7
- Key: ${e}
8
- Category: ${JSON.stringify(n)}
9
- Value: ${JSON.stringify(i)}
10
- Options: ${JSON.stringify(r)}`);return}const{scope:c=St.Widget,medium:l=F.Session,duration:h}=r,u=Gr();return u[c][e]=Nn(i,n,h),l===F.Cookie?es(t,u):ns(t,l,u)})))),Nt=(t,e,n=F.Session)=>(At(t),typeof e>"u"?(process.env.NODE_ENV!=="production"&&M.warn("readStorage: Undefined key passed when reading storage. ",e,n),Promise.resolve(void 0)):n===F.Cookie?Xr(t).then(r=>dt(r,e)):ts(t,n).then(r=>dt(r,e))),ce=t=>!!Object.entries(t).filter(([e,n])=>typeof n<"u").length,tt=t=>Object.entries(t).filter(([e,n])=>typeof n<"u").forEach(([e,{value:n}])=>{typeof n>"u"&&delete t[e]}),Sn=(t,e)=>{const n={tenant:{...t.tenant,...e.tenant},implementation:{...t.implementation,...e.implementation},widget:{...t.widget,...e.widget}};return tt(n.tenant),tt(n.implementation),tt(n.widget),n},Kr=t=>Object.entries(t).reduce((n,r)=>{const[s,i]=r;return Object.entries(i).forEach(a=>{const[c,{expiration:l}]=a;l&&n.push(l)}),n},[]).slice().sort((n,r)=>new Date(r).valueOf()-new Date(n).valueOf()).shift()||Ot(),We=t=>{const{name:e,implementation:{name:n,tenant:r}}=t.get("$widget");return[`humany_${r}`,`humany_${nn(r+n)}`,`humany_${nn(r+n+e)}`]},nt=t=>{const e=new RegExp(`(?:^|;)\\s?${t}=(.*?)(?:;|$)`,"i"),n=document.cookie.match(e);return n&&n[1]&&JSON.parse(n[1])||void 0},rt=(t,e,n)=>{const r=`${t}=${JSON.stringify(e).trim()}`,s=`expires=${new Date(n).toUTCString()}`,i="path=/",a="SameSite=None;Secure";return document.cookie=`${r}; ${s}; ${i}; ${a}`},Rt=t=>{const[e,n,r]=We(t),s=nt(e)||{},i=nt(n)||{},a=nt(r)||{};return{tenant:s,implementation:i,widget:a}},Ln=(t,e)=>{const n=Rt(t),r=Sn(n,e),[s,i,a]=We(t),{tenant:c,implementation:l,widget:h}=r,u=Kr(e),d=Ot({days:-1});rt(s,c,ce(c)?u:d),rt(i,l,ce(l)?u:d),rt(a,h,ce(h)?u:d)},Fe=(t,e)=>{const[n,r,s]=We(t),i=e.getItem(n)||"{}",a=e.getItem(r)||"{}",c=e.getItem(s)||"{}";return{tenant:JSON.parse(i),implementation:JSON.parse(a),widget:JSON.parse(c)}},ht=(t,e,n)=>{const r=Fe(t,e),s=Sn(r,n),[i,a,c]=We(t),{tenant:l,implementation:h,widget:u}=s;ce(l)?e.setItem(i,JSON.stringify(l)):e.removeItem(i),ce(h)?e.setItem(a,JSON.stringify(h)):e.removeItem(a),ce(u)?e.setItem(c,JSON.stringify(u)):e.removeItem(c)},Gr=()=>({tenant:{},implementation:{},widget:{}}),Jr=t=>t?!!t&&new Date>new Date(t):!1,dt=(t,e)=>{const n=t.widget[e]||t.implementation[e]||t.tenant[e];return n==null?void 0:n.value},Nn=(t,e,n)=>n?{value:t,category:e,expiration:typeof n=="object"?Ot(n):n}:{value:t,category:e},Qr=(t,e)=>{const n=Et(t);return Object.entries(n).forEach(([r,s])=>{Object.entries(s).forEach(([i,a])=>{const{expiration:c,category:l}=a;(Jr(c)||Yr(e,l))&&(s[i]=Nn(void 0,l,c))})}),n},sn=(t,e)=>Nt(t,"storagePolicy",F.Cookie).then((n=[z.Necessary])=>!!e&&n.indexOf(e)===-1),Yr=(t=[z.Necessary],e)=>!!e&&t.indexOf(e)===-1,At=t=>{const e=Rt(t),n=Fe(t,window.localStorage),r=Fe(t,sessionStorage),s=dt(e,"storagePolicy"),[i,a,c]=[e,n,r].map(l=>Qr(l,s));Ln(t,i),ht(t,window.localStorage,a),ht(t,window.sessionStorage,c)},Ot=(t={days:30})=>{const{days:e=0,hours:n=0,minutes:r=0,seconds:s=0}=t,i=new Date;return i.setTime(i.getTime()+n*60*60*1e3),i.setTime(i.getTime()+e*24*60*60*1e3),i.setTime(i.getTime()+r*60*1e3),i.setTime(i.getTime()+s*1e3),i.toISOString()},Xr=t=>we(document)(()=>Rt(t)),es=(t,e)=>we(document)(()=>Ln(t,e)),ts=(t,e)=>{const n=e===F.Local?window.localStorage:window.sessionStorage;return we(n)(()=>Fe(t,n))},ns=(t,e,n)=>{const r=e===F.Local?window.localStorage:window.sessionStorage;return we(r)(()=>ht(t,r,n))};je(t=>{t.createCommand("storage",e=>(n={})=>{const{consent:r}=n;if(typeof r<"u"){if(typeof r!="number"&&typeof r!="string"&&!Array.isArray(r)){process.env.NODE_ENV!=="production"&&M.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
11
- Passed consent: ${JSON.stringify(r)}`);return}if(Array.isArray(r)&&!r.every(i=>typeof i=="number"||typeof i=="string")){process.env.NODE_ENV!=="production"&&M.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
12
- Passed consent: ${JSON.stringify(r)}`);return}const s=[z.Necessary,z.Functional,z.Analytical,z.Marketing].filter((i,a,c)=>typeof r=="number"?r>a:typeof r=="string"?c.indexOf(r)+1>a:Array.isArray(r)?r.findIndex(l=>l===a+1||l===i)>-1:!0);return s.indexOf(z.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&M.warn(`storagePolicyConfigurationApi: passed consent does not include category: '${z.Necessary}'. Consent has to atleast include the '${z.Necessary}' category.
13
- Passed consent: ${JSON.stringify(r)}`),s.unshift(z.Necessary)),Lt(e.container,"storagePolicy",z.Necessary,{medium:F.Cookie,scope:St.Tenant,duration:{days:365}}).then(i=>i(s)).then(()=>{At(e.container),e.events.dispatch("storage:policy-changed",s)})}})});const Rn="favorites",Mt=async t=>await Lt(t,Rn,z.Necessary,{medium:F.Local}),Pt=async t=>await Nt(t,Rn,F.Local)||[],rs=async(t,e)=>{const n=await Mt(e),r=await Pt(e);if(r.indexOf(t)>-1)return r;const s=r.concat(t);return n(s),s},ss=async(t,e)=>{const n=await Mt(e),s=(await Pt(e)).filter(i=>i!==t);return n(s),s},is=async t=>{try{return await Pt(t)}catch{return[]}},os=async t=>((await Mt(t))([]),[]),st=(t,e)=>{const{updated:n}=e,{events:r}=t.get("$widget");r.dispatch("widget:favorites-updated",{updated:n})},as=t=>{let e=[];const n=()=>{is(t).then(c=>{e=c})},r=()=>e,s=async c=>{const l=await rs(c,t);return e=l,st(t,{updated:l}),l},i=async()=>{const c=await os(t);return e=c,st(t,{updated:c}),c},a=async c=>{const l=await ss(c,t);return e=l,st(t,{updated:l}),l};return n(),{add:s,get:r,clear:i,remove:a}};class cs extends $t{constructor(e,n){super(e),this.settings=n,this.handler=as(e),e.register("favorites",this.handler)}}const on=t=>{const e=document.createElement("a");return e.href=t,e.protocol+"//"+e.hostname+e.pathname+e.hash+e.search};class ls{constructor(e,n,r){this.url=e,this.required=n,this.type=r}getFileInfo(){let e;const r=/^([a-z][a-z0-9+\-.]*:(\/\/[^\/?#]+)?)?([a-z0-9\-._~%!$&'()*+,;=:@\/]*)/gi.exec(this.url);if(!this.type&&r&&r.length>3&&(e=r[3].split("."),e=e[e.length-1]),e==="js"||this.type==="script")return{type:"javascript",elementType:"script",sourceAttribute:"src",attributes:{src:this.url,type:"text/javascript"}};if(e==="css"||this.type==="style")return{type:"stylesheet",elementType:"link",sourceAttribute:"href",attributes:{href:this.url,rel:"stylesheet"}}}isPresent(){const e=this.getFileInfo();if(e){const r=document.getElementsByTagName("html")[0].getElementsByTagName(e.elementType);for(let s=0;s<r.length;s++)if(this.equals(r[s].getAttribute(e.sourceAttribute)||""))return!0}return!1}equals(e){return on(this.url)===on(e)}}const an=(t,e,n)=>{const r=new RegExp(`([?&])${e}=.*?(&|$)`,"i"),s=t.indexOf("?")>-1?"&":"?";return t.match(r)?t.replace(r,`$1${e}:${encodeURIComponent(n)}$2`):`${t}${s}${e}=${encodeURIComponent(n)}`},An=(...t)=>{const e=t[0],n=t[1],r=typeof t[2]>"u"?1e3:t[2],s=t[3]||function(){},i=10;for(;!n();){r<=0?s():setTimeout(()=>{An(e,n,Math.max(r-i,0),s)},i);return}e()},cn=t=>typeof t=="function",On=(t,e)=>{t.sheet||t.styleSheet&&t.styleSheet.cssText.length>0||t.innerHTML&&t.innerHTML.length>0?e():setTimeout(On,10,t,e)};class us{constructor(e){this.cacheBuster=e,this.resources=[],this.loadedResources={}}add(e,n,r,s){let i=e;if(this.cacheBuster&&(i=an(i,"v",this.cacheBuster)),r)for(const a in r)r.hasOwnProperty(a)&&(i=an(i,a,r[a]));this.resources.push(new ls(i,!!n,s))}load(e,n){let r=this.resources.length;if(n)(function i(a,c,l){l.insertResource(a[c],()=>{++c<a.length?i(a,c,l):cn(e)&&setTimeout(e.call(l))})})(this.resources,0,this);else for(let i=0,a=this.resources.length;i<a;i++)this.insertResource(this.resources[i],s);function s(i){--r===0&&cn(e)&&setTimeout(()=>e())}}insertResource(e,n){var s;if(e.isPresent()){this.loadedResources[e.url]===void 0?n.call(this,e):An(()=>n.call(this,e),()=>this.loadedResources[e.url]===!0);return}this.loadedResources[e.url]=!1;const r=e.getFileInfo();if(r){const i=document.createElement(r.elementType),a=((s=window.webprovisionsEnvironmentVariables)==null?void 0:s.cspNonce)||void 0;a&&(i.nonce=a,i.setAttribute("nonce",a)),e.required&&(i.readyState?i.onreadystatechange=function(){(i.readyState==="loaded"||i.readyState==="complete")&&(this.loadedResources[e.url]=!0,i.onreadystatechange=null,n.call(this,e))}:r.type==="stylesheet"?On(i,()=>{this.loadedResources[e.url]=!0,n.call(this,e)}):i.onload=()=>{this.loadedResources[e.url]=!0,n.call(this,e)});for(const c in r.attributes)i[c]=r.attributes[c];document.getElementsByTagName("head")[0].appendChild(i)}e.required||n.call(this,e)}}const hs=t=>{const e=document.createElement("a");return e.href=t,`//${e.hostname}/`};class ds extends $t{constructor(e,n={}){super(e),this.widget.events.subscribeOnce("widget:attached",()=>{var i,a;const{data:{projection:r}}=this.container.get("$settings");if(r){const c=hs(r),l=new us;l.add(`${c}ClientLibraries/Supplementary/font-awesome-4.7.0/css/font-awesome.min.css`),l.add(`${c}${(i=this.container.parent)==null?void 0:i.name}/widgets.css`),l.load()}const{initialCss:s=""}=n;if(s.length){const c=document.createElement("style"),l=((a=window.webprovisionsEnvironmentVariables)==null?void 0:a.cspNonce)||void 0;l&&(c.nonce=l,c.setAttribute("nonce",l)),c.innerHTML=s,document.head.appendChild(c)}})}}const fs=async(t,e)=>{const{denyAutoExpandContactMethods:n}=e;if(n){const r=new RegExp(n);Wr(t,"contact-list",s=>{s.properties(({contactMethods:i=[]})=>{const a=i.filter(({clientName:c})=>r.test(c));if(a.length)return a.forEach(c=>{c.expanded=!1,c.inline=!1}),{contactMethods:i}})})}return[]},ln=t=>Promise.resolve().then(()=>require("./index-373df3a5.js")).then(({ServiceClient:e,ServiceProxy:n})=>t.get("settings").then(r=>{const{name:s,events:i}=t.get("$widget"),{data:{projection:a="",site:c="current",forceHttps:l=!1}}=r,h=new n(a,{credentials:"same-origin"}),u=new e(h,{funnel:s.replace("_contact-method","").replace("_contact",""),site:ms(c,l)},null,t);return i.subscribe("widget:settings-updated",(d,{data:f})=>{f&&f.projection!==a&&u.proxy.setBaseUrl(f.projection)}),u})),ms=(t,e)=>()=>{const n=s=>{const i=document.createElement("a");return i.href=s,i};let r=window.location;return t==="referrer"&&document.referrer&&(r=n(document.referrer)),[e?"https:":"","//",r.host,r.pathname].join("")};function D(t,e){return t.hints&&t.hints.indexOf(e)>-1}function ps(t){return t.constraints&&t.constraints.verifyValue}function gs(t){return t.constraints&&t.constraints.required}function ys(t){const e=t.hints.filter(n=>n.indexOf("=")>-1&&n.split("=")[0]==="linkText")[0]||null;return e?e.split("=")[1]:null}function vs(t){const e=t.hints.filter(n=>n.indexOf("=")>-1&&n.split("=")[0]==="url")[0]||null;return e?e.split("=")[1]:null}function bs(t){const e=t.hints.filter(n=>n.indexOf("=")>-1&&n.split("=")[0]==="availableHours")[0]||null;return e?e.split("=")[1]||[]:[]}function ws(t){const e=t.hints.filter(n=>n.indexOf("=")>-1&&n.split("=")[0]==="minuteInterval")[0]||null;return e?e.split("=")[1]||[]:[]}function un(t){return t.components?"Fieldset":D(t,"fullname")?"Name":D(t,"address")?"Address":D(t,"dropdown")?"DropDownList":D(t,"checkbox")?"CheckboxList":D(t,"radio")?"RadioButtonList":D(t,"email")?"Email":D(t,"agreement")?"Agreement":D(t,"phonenumber")?"PhoneNumber":D(t,"date")?"Date":t.type==="text/paragraph"?"Textarea":t.type==="text/number"?"Number":t.type==="text/password"?"Password":t.type==="hidden"?"Hidden":t.type==="file"?"File":t.type==="hwebsite"?"AntiSpam":"Text"}function Cs(t){if(t.hints)for(let e=0;e<t.hints.length;e++){const n=t.hints[e];if(n.substr(0,12)==="placeholder=")return n.substr(12)}}function xs(t){return t.children||t.components||t.groups?"object":"string"}class Tt{constructor(e,n,r,s=r.getErrorMessage,i=r.getGeneralErrors){if(this.name=e,this.source=n,this.parent=r,this.getErrorMessage=s,this.getGeneralErrors=i,this.children=[],this.isValid=!this.getGeneralErrors(this.source)&&!this.getErrorMessage(this.source),!this.isValid){let a=this.parent;for(;a;)a.isValid=!1,a=a.parent}n.dataPath=r&&r.source?`${r.source.dataPath}.${e}`:e,this.schema={type:"object",actionKey:r?`${r.createSchema().actionKey}.${e}`:e,required:[]}}createChild(e,n){const r=new Tt(e,n,this);return this.children.push(r),r}createSchema(){const e=Object.assign({},this.schema);return this.id&&(e.id=this.id),this.source&&(e.type=xs(this.source),e.title=this.source.title,e.evaluate=this.source.hasDependants,e.isValid=this.isValid,this.source.options&&(D(this.source,"multiple")?(e.type="array",e.items={type:"string",enum:this.source.options.map(n=>n.value)}):e.enum=this.source.options.map(n=>n.value))),this.children&&this.children.length&&(e.properties={},this.children.forEach(n=>{e.properties[n.name]=n.createSchema(),gs(n.source)&&e.required.push(n.name)})),e}createLayout(){const e={};if(this.source){const r=un(this.source)==="Fieldset";e["ui:component"]=un(this.source),e["ui:placeholder"]=Cs(this.source),e["ui:description"]=this.source.description,e["ui:tags"]=this.source.hints?this.source.hints.filter(s=>s.indexOf("=")===-1):[],e["ui:hidden"]=!this.source.visible,e["ui:error"]=this.getErrorMessage(this.source)||r&&this.getGeneralErrors(this.source),this.source.options&&(e["ui:enumNames"]=this.source.options.map(s=>s.title)),r&&this.schema.required.length&&(e["ui:hasRequiredChildren"]=!0),e["ui:component"]==="Agreement"&&(e["ui:linkText"]=ys(this.source),e["ui:link"]=vs(this.source)),e["ui:component"]==="PhoneNumber"&&(e["ui:options"]=this.source.options),e["ui:component"]==="Date"&&(e["ui:availableHours"]=bs(this.source),e["ui:minuteInterval"]=ws(this.source))}return this.children&&(e["ui:order"]=[],this.children.forEach(n=>{e["ui:order"].push(n.name),e[n.name]=n.createLayout()})),e}createData(){if(this.children.length>0){const e={};return this.children.forEach(n=>{e[n.name]=n.createData()}),e}return this.source.type==="choice"?D(this.source,"multiple")?this.source.options.filter(e=>e.selected).map(e=>e.value):this.source.options.filter(e=>e.selected).map(e=>e.value).join(","):this.source.value}}function Es(t,e,n,r){const s=new Tt(t,{title:"",groups:e.groups},null,n,r);return s.id=t,s}let ks=class{constructor(e,n,r){this.validationSource=r,this.getErrorMessage=this.getErrorMessage.bind(this),this.getGeneralErrors=this.getGeneralErrors.bind(this),this.validationSource=r,this.root=Es(e,{title:"",groups:n.groups},this.getErrorMessage,this.getGeneralErrors)}create(){return{schema:this.root.createSchema(),layout:this.root.createLayout(),data:this.root.createData()}}getGeneralErrors(e){if(this.validationSource&&this.validationSource.generalErrors&&this.validationSource.generalErrors.length>0)return this.validationSource.generalErrors[0]}getErrorMessage(e){if(this.validationSource&&e.name&&this.validationSource.errors&&this.validationSource.errors[e.name])return this.validationSource.errors[e.name]}};const $s=(t,e)=>{const n=t.hints.find(r=>r.startsWith(e+"="));if(n)return n.substr(e.length+1)};function Ss(t,e,n,r){const s=De(e),i=n?De(n):void 0,a=new ks(t,s,i),c=a.root;return(s.Groups||s.groups).forEach((l,h)=>{const u=l.title||"group",d=l.name||`${u}[${h}]`,f=c.createChild(d,l),p=l.components;p&&p.forEach((g,v)=>{const m=g.name||`${g.title}[${v}]`,b=f.createChild(m,g);if(ps(g)){const w=$s(g,"verifyLabel")||`Confirm ${g.title}`;f.createChild(`${m}$VerifyValue`,{...g,name:`${g.name}$VerifyValue`,title:w,value:s.extra&&s.extra[`${g.name}$VerifyValue`]||""})}g.children&&g.children.forEach((w,E)=>{const C=w.name||`${w.title}[${E}]`;b.createChild(C,w)})})}),a.create()}const Oe=(t,e)=>typeof t>"u"?e:t,Ls=(t,e)=>{let n=t["ui:order"];n||(n=[],t["ui:order"]=n),n.push(e)},Ns=(t,e)=>`${t.schema.id}$${e}`,Rs=(t,e)=>(t.schema.properties=Oe(t.schema.properties,{}),t.schema.properties[e.name]={id:e.id||Ns(t,e.name),type:e.type,title:e.title,isValid:!0,required:[],evaluate:Oe(e.evaluate,!1),actionKey:e.actionKey,items:e.items?{type:"string",enum:e.items.map(n=>n.value)}:void 0},e.required===!0&&t.schema.required.push(e.name),Ls(t.layout,e.name),t.layout=Oe(t.layout,{}),t.layout[e.name]={"ui:component":e.component,"ui:description":e.description,"ui:placeholder":e.placeholder,"ui:onClick":e.onClick||void 0,"ui:enumNames":e.items?e.items.map(n=>n.label):void 0},t.data=Oe(t.data,{}),t.data[e.name]=e.type==="object"?{}:e.value,t),As=(t,e)=>Object.assign({},{schema:t.schema.properties[e],layout:t.layout[e],data:t.data[e]}),Os=(t,e,n)=>{const r=As(t,e),s=new ne(r);return n(s),s},Mn=(t,e,n,r,s=[])=>{Object.keys(t).forEach(i=>{i===e&&s.indexOf(i)===-1&&(t[i]=n,s.push(i),r&&(t["data:options"]=t["data:options"]||{},t["data:options"][i]=r)),typeof t[i]=="object"&&Mn(t[i],e,n,r,s)})},Pn=(t,e,n,r)=>{t&&t["ui:component"]===e&&(t[`ui:${n}`]=r),t&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&Pn(t[s],e,n,r)})},Te=(t,e,n)=>{t!==null&&typeof t=="object"&&e===null&&n(t),t!==null&&typeof t=="object"&&typeof t[e]=="object"?n(t[e]):t!==null&&typeof t=="object"&&Object.keys(t).forEach(r=>{Te(t[r],e,n)})},ze=(t,e,n)=>{t&&t.properties&&e&&typeof t.properties[e]=="object"?n(t.properties[e]):t&&t.properties&&Object.keys(t.properties).forEach(r=>{t.properties&&ze(t.properties[r],e,n)}),e===null&&n(t)};class ne{constructor(e){this.form=e}createComponent(e,n){return this.form=Rs(this.form,e),n&&Os(this.form,e.name,n),new ne(this.form)}setData(e,n,r){Mn(this.form.data,e,n,r)}setLayout(e,n,r){Pn(this.form.layout,e,n,r)}setMeta(e){return this.form.meta=e,this.form}setValidationErrors(e){if(e){const{general:n,...r}=e;Te(this.form.layout,null,s=>s["ui:error"]=!1),ze(this.form.schema,null,s=>s.isValid=!0),this.form.schema.isValid=!1,n&&this.form.layout["group[0]"]&&(this.form.layout["group[0]"]["ui:error"]=n),Object.keys(r).forEach(s=>{Te(this.form.layout,s,i=>i["ui:error"]=r[s]),ze(this.form.schema,s,i=>i.isValid=!1)})}else Te(this.form.layout,null,n=>n["ui:error"]=!1),ze(this.form.schema,null,n=>n.isValid=!0);return new ne(this.form)}get(){return this.form}static create(e){const n={schema:{id:e,type:"object",title:"",isValid:!0,required:[]},layout:{},data:{}};return new ne(n)}static fromLegacyForm(e,n,r,s){const i=Ss(e,n,r);return new ne(i)}}var ft=(t=>(t.Opera="opera",t.Chrome="chrome",t.Firefox="firefox",t.Safari="safari",t.Edge="edge",t.EdgeChromium="edge-chromium",t.Blink="blink",t.IE="internet-explorer",t))(ft||{});const hn=()=>{const{opr:t,opera:e,InstallTrigger:n,HTMLElement:r,safari:s,documentMode:i,StyleMedia:a,chrome:c,CSS:l}=window,h=!!t&&!!t.addons||!!e||navigator.userAgent.indexOf(" OPR/")>=0;if(h)return"opera";if(n)return"firefox";const u=(p=>p.toString()==="[object SafariRemoteNotification]")(!s||typeof s<"u"&&s.pushNotification);if(/constructor/i.test(r)||u)return"safari";const d=!!i;if(d)return"internet-explorer";if(!d&&a)return"edge";const f=!!c&&(!!c.webstore||!!c.runtime);if(f)return"chrome";if(f&&navigator.userAgent.indexOf("Edg")!==-1)return"edge-chromium";if((f||h)&&l)return"blink"},Ms=["string","number"],_=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]>"u"?"":t[n],s=typeof r;if(Ms.indexOf(s)>-1){const i=n.substring(0,5);i==="data-"||i==="aria-"?e[zr(n)]=r.toString():n.substring(0,4)!=="css-"&&(e[n]=r.toString())}else e[n]=r;return e},{}),Ps=t=>new RegExp("^#","i").test(t),Ts=t=>({children:e,...n})=>{const{implementation:r,name:s}=t.get("$widget"),{href:i=""}=n;if(Ps(i))return o.createElement(js,{smooth:!0,to:i},e);const a=r.bindings.map(h=>h.replace(/\./g,"\\.")).join("|"),l=new RegExp(`^((http[s]?:)?//)?(${a})/([^\\s]+)`).exec(i);if(l&&l.length>=4){const h=l[4];if(r.widgets.get(h)&&!h.startsWith("blob?")&&!h.startsWith(s))return o.createElement(eo,{widgetName:h},e)}return o.createElement("a",{...n},e)},Tn=t=>{const e={};return Object.keys(t).forEach(n=>{n.indexOf("css-")>-1&&(e[n]=t[n])}),e},zs=t=>{let e="";return Object.keys(Tn(t)).forEach(n=>{n.indexOf("css-")>-1&&(e+=`${n.replace("css-","")}:${t[n]};`)}),$.css`
14
- ${e}
15
- `},Hs=(t,e)=>{let n="";const r=()=>{n=""},s=u=>{const d=document.getElementById(n);return d!==null?(u(d),r(),!0):!1},i=u=>(u.preventDefault(),r(),t.onClick&&t.onClick(u),typeof t.to=="string"&&(n=t.to.split("#").slice(1).join("#")),n!==""&&s(t.scroll||(d=>t.smooth?d.scrollIntoView({behavior:"smooth"}):d.scrollIntoView())),!1),{scroll:a,smooth:c,to:l,...h}=t;return e==="a"&&(h.href="javascript:;"),o.createElement(e,{...h,onClick:i},t.children)},zt=t=>(e,n)=>{let r=e,s="";if(["h1","h2","h3","h4","h5","h6"].includes(e))r=e;else{const c=e.match(/h1|h2|h3|h4|h5|h6/);if(c!=null&&c[0]){r=c[0];const[l]=e.split(r);s=l}}const a=((c,l,h)=>h[c]?`${l}${h[c]}`:`${l}${c}`)(r,s,t.theme.typographyVariantMapping||{});return $.css`
16
- ${a} {
17
- ${n}
18
- }
19
- `};var Bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Is(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zn(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){if(this instanceof r){var s=[null];s.push.apply(s,arguments);var i=Function.bind.apply(e,s);return new i}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var Hn={exports:{}};(function(t,e){(function(n,r){t.exports=r(o)})(Bs,function(n){function r(d,f,p,g){return f===void 0&&(f={}),Object.keys(f).reduce(function(v,m){if(/^on.*/.test(m))return v;var b=m;/^(data|aria)-/.test(m)||p.filter(function(P){return P instanceof RegExp?P.test(m):P===m}).length===0&&(b=s(m));var w,E,C=g(d,b);if(C.name==="style")v[C.name]=(w=f.style,E={},w.split(";").filter(function(P){return P.trim()!==""}).forEach(function(P){var S,T=P.split(":");if(T.length>1){var Z=function(R){return/^-ms-/.test(R)&&(R=R.substr(1)),R.startsWith("--")?R:s(R)}(T[0].trim()),O=(S=T.slice(1).join(":").trim(),/^\d+$/.test(S)?Number(S):S.replace(/'/g,'"'));E[Z]=O}}),E);else{var k=f[m],I=k===""||String(k).toLowerCase()===b.toLowerCase();v[C.name]=C.isBoolean?I:k}return v},{})}function s(d){return d.replace(/(-|:)(.)/g,function(f,p,g){return g.toUpperCase()})}n=n&&n.hasOwnProperty("default")?n.default:n;var i=["table","tbody","thead","tfoot","tr"],a={for:"htmlFor",class:"className",allowfullscreen:["allowFullScreen","allowFullscreen"],autocomplete:"autoComplete",autofocus:["autoFocus"],contenteditable:"contentEditable",spellcheck:"spellCheck",srcdoc:"srcDoc",srcset:"srcSet",itemscope:"itemScope",itemprop:"itemProp",itemtype:"itemType"};function c(d,f){var p=a[f],g=document.createElement(d);if(p)return{name:Array.isArray(p)?p[0]:p,isBoolean:l(g,Array.isArray(p)?p[1]||f:p)};for(var v in g)if(v.toLowerCase()===f.toLowerCase())return{name:v,isBoolean:l(g,v)};return{name:f,isBoolean:l(g,f)}}function l(d,f){return d.setAttribute(f,""),d[f]===!0||h.indexOf(f)>-1}var h=["itemScope"];function u(d,f,p,g){g===void 0&&(g=null);var v=p[d],m=p._;return v?n.createElement(v,f,g):m?m(d,f,g):n.createElement(d,f,g)}return function(d,f){if(f===void 0&&(f={}),typeof d!="string")throw new TypeError("Expected HTML string");var p=document.createElement("div");p.innerHTML=d.trim();var g=Array.from(p.childNodes).map(function(v,m){return function b(w,E,C){var k=C.transform||{},I=C.preserveAttributes||[],P=C.dangerouslySetChildren||["style"],S=k._;if(w.nodeType===8)return null;if(w.nodeType===3){var T=w.textContent;return S?S(T):T}for(var Z={},O=w.attributes,R=0;R<O.length;R++)Z[O[R].name]=O[R].value;Z.key=E.toString();var U=w.tagName.toLowerCase(),de=r(U,Z,I,c),Ee=Array.from(w.childNodes).map(function(Y,oe){return i.indexOf(U)>-1&&Y.nodeType===3&&(Y.textContent=Y.textContent.trim(),Y.textContent==="")?null:b(Y,E+"."+oe,C)}).filter(Boolean);if(P.indexOf(U)>-1){var ie=w.innerHTML;return ie&&(U!=="style"&&U!=="script"&&(ie=ie.replace(/"/g,"&quot;")),de.dangerouslySetInnerHTML={__html:ie.trim()}),u(U,de,k)}var ke=Ee.length===0?null:Ee;return u(U,de,k,ke)}(v,String(m),f)}).filter(Boolean);return g.length===1?g[0]:g}})})(Hn);var Vs=Hn.exports;const dn=Is(Vs);function Ds(t,e){return e?dn(t,e):dn(t)}const Fs=t=>e=>o.createElement(Vi,{attrs:e,htmlBody:t}),_s=(t,e)=>({transform:{a:Ts(t),img:Fs(e)}}),js=t=>Hs(t,"a"),re=o.forwardRef(({className:t,children:e,...n},r)=>o.createElement(qs,{type:"button",className:L(t,"humany-button"),..._(n),ref:r},e)),qs=y.button`
20
- -webkit-appearance: button;
21
- text-transform: none;
22
- overflow: visible;
23
- outline: none;
24
- border: none;
25
- background-color: transparent;
26
- cursor: pointer;
27
- font-family: inherit;
28
- font-size: inherit;
29
- line-height: normal;
30
- margin: 0;
31
- padding: 0;
32
- `,Ws=o.createContext(new _e);o.createContext(1);const Zs=o.createContext({id:"",type:"",name:"",branch:""});o.createContext({});const Us=o.createContext(null);o.createContext(null);const he=()=>o.useContext(Ws),Ks=t=>{const e=o.useContext(Zs),n=In(),[r,s]=o.useState();return o.useEffect(()=>{if((t||e.id)&&n){const i=n.nodes.get(t||e.id);s(i)}},[t,e.id,n]),r},Bn=()=>{const t=o.useRef(!1);return o.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),t},In=t=>{const e=he(),[n,r]=o.useState(null),s=Bn();return o.useEffect(()=>{kn.getInstance(t||e).then(i=>{s.current&&r(i)})},[s]),n},Gs=t=>{const e=Ks(t),n=In(),[r,s]=o.useState({}),i=Bn();return o.useEffect(()=>{e&&i.current&&s(e.attributes.context)},[i,e]),o.useEffect(()=>{if(n){const a=n.events.subscribe("components:context-changed",(c,l)=>{e===l.node&&i.current&&s(l.node.attributes.context)});return()=>{a()}}},[i,n,e]),r},le=(t,e,n=window,r=()=>!0)=>{const s=o.useRef(()=>{});o.useEffect(()=>{s.current=e},[e]),o.useEffect(()=>{if(!(n&&r()))return;const a=c=>s.current(c);return n.addEventListener(t,a),()=>{n.removeEventListener(t,a)}},[t,n])},Js=t=>{const e=he(),{events:n}=(t||e).get("$widget");return n},ge=(t,e)=>{const[n,r]=o.useState(!1),s=o.useCallback(a=>{const{key:c}=a;c===t&&(r(!0),e&&e(a))},[r,e]),i=o.useCallback(({key:a})=>{a===t&&r(!1)},[r]);return le("keydown",s,window),le("keyup",i,window),n},Qs=t=>{const e=o.useRef();return o.useEffect(()=>{e.current=t}),e.current},Ys=()=>o.useContext(Us),Xs=t=>{const e=o.useRef(),n=o.useRef(0);let r;const s=o.useCallback(()=>{var h;(h=e.current)==null||h.classList.add("humany-scrolling"),clearTimeout(r),r=setTimeout(()=>{var u;(u=e.current)==null||u.classList.remove("humany-scrolling")},500)},[e]),i=o.useCallback(h=>{n.current=h.touches[0].clientY},[e]),a=h=>c(h)?h===e.current?h:null:h.parentElement?a(h.parentElement):null,c=h=>h.scrollWidth>h.clientWidth||h.scrollHeight>h.clientHeight,l=o.useCallback(h=>{if(!h.cancelable)return;const u=h.touches[0].clientY,d=a(h.target);if(!d)return;const f=d.scrollTop,p=n.current-u<0?"up":"down",g=f<=0&&p==="up",v=f>=d.scrollHeight-d.offsetHeight&&p==="down";(g||v)&&h.preventDefault(),n.current=u},[e,n]);return le("scroll",s,e.current,()=>e.current&&t),le("touchstart",i,e.current,()=>e.current&&t),le("touchmove",l,e.current,()=>e.current&&t),t?[ei,e]:["",e]},ei=`
33
- overflow-y: ${hn()===ft.Chrome||hn()===ft.EdgeChromium?"overlay":"auto"};
34
- overflow-x: hidden;
35
- -ms-overflow-style: none; /* IE 10+ */
36
- scrollbar-width: thin; /* Firefox */
37
- scrollbar-color: transparent transparent; /* Firefox */
38
-
39
- ::-webkit-scrollbar {
40
- width: 3px !important;
41
- background-color: transparent;
42
- border-left: none;
43
- }
44
- ::-webkit-scrollbar-thumb {
45
- background-color: transparent;
46
- }
47
- ::-webkit-scrollbar-track {
48
- -webkit-box-shadow: none !important;
49
- background-color: transparent;
50
- }
51
- &.humany-scrolling {
52
- scrollbar-color: #7F7F7F transparent;
53
- scrollbar-width: thin; /* Firefox */
54
- -ms-overflow-style: none; /* IE 10+ */
55
-
56
- ::-webkit-scrollbar-thumb {
57
- background-color: #7F7F7F;
58
- }
59
- }
60
- `,ti=(t=!1)=>{const[e,n]=o.useState(t),r=o.useCallback(s=>{n(typeof s=="boolean"?s:i=>!i)},[]);return[e,r]},Ht=(t,e,n=[],r)=>{const s=Js(r);return o.useEffect(()=>{if(s){const i=s.subscribe(t,e);return()=>{i()}}},[s].concat(n)),i=>s==null?void 0:s.dispatch(t,i)},Vn=(t,e)=>{const n=Ht("widget:menu-toggled",(r,s)=>{s!==t&&e()});return()=>n(t)},Bt=o.forwardRef(({className:t,children:e,...n},r)=>o.createElement("span",{ref:r,className:L(t,"humany-text"),..._(n)},e)),Dn=t=>$.css`
61
- display: flex;
62
- justify-content: center;
63
- flex-direction: column;
64
- background: #ffffff;
65
- border-radius: ${t.theme.borderRadius};
66
- border: ${t.theme.border};
67
- box-shadow: ${t.theme.boxShadow||"none"};
68
- ${t["data-loading"]&&"min-height: 150px;"}
69
- `,Fn=t=>{var e,n,r;return $.css`
70
- cursor: pointer;
71
- text-align: center;
72
- border: none;
73
- font-weight: 300;
74
- padding: ${(e=t.theme.sizes)==null?void 0:e.normal};
75
- border-radius: ${t.theme.borderRadius};
76
- font-family: ${(n=t.theme.fonts)==null?void 0:n.type};
77
- font-size: ${(r=t.theme.fonts)==null?void 0:r.normal};
78
- `},W=t=>{var e,n,r;return $.css`
79
- outline: ${(e=t.theme.accessibility)==null?void 0:e.border};
80
- color: ${(r=(n=t.theme.accessibility)==null?void 0:n.colors)==null?void 0:r.inactiveText};
81
- border-color: transparent;
82
- `},_n=y(re)`
83
- position: absolute;
84
- top: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
85
- right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
86
- z-index: 1;
87
-
88
- svg {
89
- stroke: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
90
- }
91
-
92
- &:focus-visible {
93
- ${W}
94
- padding: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}};
95
- height: 15px;
96
- box-sizing: content-box;
97
- }
98
- `,It=y(Bt)`
99
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
100
- font-weight: normal;
101
- line-height: 1.2em;
102
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
103
- `,jn=t=>{var e;return $.css`
104
- padding: 0;
105
- margin: 0;
106
- list-style: none;
107
- > li {
108
- margin: 0 0 ${(e=t.theme.sizes)==null?void 0:e.normal};
109
- white-space: nowrap;
110
- text-overflow: ellipsis;
111
- min-width: 0;
112
- &:focus {
113
- outline-offset: -2px;
114
- }
115
- > a {
116
- text-decoration: none;
117
- }
118
- }
119
- > li:last-of-type {
120
- margin: 0;
121
- }
122
- `},Vt=({elementId:t="humany-portal-elements",parent:e=document.body,children:n})=>{const[r]=o.useState(()=>{const s=document.getElementById(t)||document.createElement("div");return s.id=t,s});return o.useEffect(()=>(e.appendChild(r),()=>{r.childElementCount<=1&&r.remove()}),[r]),er.createPortal(n,r)},xe=({text:t="",backgroundSize:e="contain",size:n=12,symbol:r={content:"",type:""},elementStyle:s={},className:i,...a})=>{const{type:c,content:l}=r,h={"aria-label":t,role:"presentation"};switch(c){case"Uri":{const u={backgroundSize:e,backgroundImage:`url('${l}')`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundAttachment:"center"};return o.createElement("i",{className:L(i,"humany-icon","humany-custom-icon"),title:t,style:{...u,...s},...h,...a})}case"Svg":{const u={className:L(i,"humany-icon"),width:`${n}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,ref:null},d={minWidth:`${n}`};switch(l){case"search":return o.createElement("svg",{viewBox:"0 0 32 30",...u},o.createElement("circle",{cx:"14.8457",cy:"14.5175",r:"8.14359",transform:"rotate(45 14.8457 14.5175)"}),o.createElement("line",{x1:"21.1001",y1:"20.4865",x2:"26.5798",y2:"25.9661"}));case"clear":return o.createElement("svg",{viewBox:"0 0 27 27",...u},o.createElement("circle",{cx:"13.4351",cy:"13.435",r:"9",transform:"rotate(45 13.4351 13.435)",stroke:"black"}),o.createElement("line",{x1:"16.6172",y1:"10.2531",x2:"10.2533",y2:"16.6171",stroke:"black"}),o.createElement("line",{x1:"16.6171",y1:"16.617",x2:"10.2532",y2:"10.2531",stroke:"black"}));case"close":return o.createElement("svg",{viewBox:"0 0 13 13",...u},o.createElement("path",{d:"M12.3068 0.50647L1.27246 11.7273",stroke:"black"}),o.createElement("path",{d:"M12.2812 11.9473L1.24686 0.726451",stroke:"black"}));case"caret-right":return o.createElement("svg",{viewBox:"0 0 14 14",style:d,...u},o.createElement("line",{x1:"4.13",y1:"1.05",x2:"10.13",y2:"7.05",stroke:"black"}),o.createElement("line",{x1:"10.13",y1:"6.95",x2:"4.13",y2:"12.95",stroke:"black"}));case"caret-left":return o.createElement("svg",{viewBox:"0 0 14 14",style:d,...u},o.createElement("line",{x1:"10.13",y1:"12.95",x2:"4.13",y2:"6.95",stroke:"black"}),o.createElement("line",{x1:"4.13",y1:"7.05",x2:"10.13",y2:"1.05",stroke:"black"}));case"caret-up":return o.createElement(ni,{viewBox:"0 0 14 14",style:d,...u},o.createElement("line",{x1:"13.09",y1:"3.99",x2:"7.1",y2:"9.99",stroke:"black"}),o.createElement("line",{x1:"7.19",y1:"9.99",x2:"1.19",y2:"3.99",stroke:"black"}));case"caret-down":return o.createElement("svg",{viewBox:"0 0 14 14",style:d,...u},o.createElement("line",{x1:"13.09",y1:"3.99",x2:"7.1",y2:"9.99",stroke:"black"}),o.createElement("line",{x1:"7.19",y1:"9.99",x2:"1.19",y2:"3.99",stroke:"black"}));case"back":return o.createElement("svg",{viewBox:"0 0 18 18",...u},o.createElement("line",{y1:"-0.5",x2:"11.724",y2:"-0.5",transform:"matrix(-0.682355 -0.731021 0.682355 -0.731021 13 16.9999)",stroke:"white"}),o.createElement("line",{y1:"-0.5",x2:"11.724",y2:"-0.5",transform:"matrix(0.682355 -0.731021 0.682355 0.731021 5 9.5705)",stroke:"white"}));case"alert":return o.createElement("svg",{viewBox:"0 0 19 19",...u},o.createElement("circle",{cx:"9.5",cy:"9.5",r:"9.5",fill:"#CA0813"}),o.createElement("path",{d:"M10.36 4.878V8.882C10.36 9.30667 10.339 9.72433 10.297 10.135C10.255 10.541 10.199 10.9727 10.129 11.43H8.96C8.89 10.9727 8.834 10.541 8.792 10.135C8.75 9.72433 8.729 9.30667 8.729 8.882V4.878H10.36ZM8.463 14.048C8.463 13.9033 8.48867 13.7657 8.54 13.635C8.596 13.5043 8.67067 13.3923 8.764 13.299C8.862 13.2057 8.97633 13.131 9.107 13.075C9.23767 13.019 9.37767 12.991 9.527 12.991C9.67167 12.991 9.80933 13.019 9.94 13.075C10.0707 13.131 10.1827 13.2057 10.276 13.299C10.3693 13.3923 10.444 13.5043 10.5 13.635C10.556 13.7657 10.584 13.9033 10.584 14.048C10.584 14.1973 10.556 14.3373 10.5 14.468C10.444 14.594 10.3693 14.7037 10.276 14.797C10.1827 14.8903 10.0707 14.9627 9.94 15.014C9.80933 15.07 9.67167 15.098 9.527 15.098C9.37767 15.098 9.23767 15.07 9.107 15.014C8.97633 14.9627 8.862 14.8903 8.764 14.797C8.67067 14.7037 8.596 14.594 8.54 14.468C8.48867 14.3373 8.463 14.1973 8.463 14.048Z",fill:"white"}));case"send":return o.createElement("svg",{viewBox:"0 0 20 17",...u},o.createElement("path",{d:"M18.95 8.56428L0.949951 0.941406V7.02531L13.6351 8.47059L0.950001 9.92276L0.949951 15.9414L18.95 8.56428Z",fill:"#A6A6A6",stroke:"#A6A6A6",strokeWidth:"0.1"}));case"chat":return o.createElement("svg",{viewBox:"-2 -3 40 40",...u},o.createElement("path",{strokeWidth:"0",fillRule:"evenodd",clipRule:"evenodd",d:"M16.9799 34C21.2676 34 25.1841 32.4256 28.1725 29.8285L34.9534 32.1994C35.7991 32.4951 36.553 31.5778 36.0892 30.8173L32.2559 24.5317C33.3474 22.3103 33.9598 19.8153 33.9598 17.1786C33.9598 7.88838 26.3576 0.357178 16.9799 0.357178C7.60216 0.357178 0 7.88838 0 17.1786C0 26.4688 7.60216 34 16.9799 34ZM30.7031 24.565C31.9094 22.3701 32.5948 19.8536 32.5948 17.1786C32.5948 8.6352 25.6038 1.70942 16.9799 1.70942C8.35601 1.70942 1.36498 8.6352 1.36498 17.1786C1.36498 25.722 8.35601 32.6478 16.9799 32.6478C21.1946 32.6478 25.0193 30.9935 27.8285 28.3047L34.3975 30.5798L30.7031 24.565Z",fill:"currentColor"}),o.createElement("path",{strokeWidth:"0",d:"M12.9395 17.1786C12.9395 18.6079 11.7809 19.7665 10.3516 19.7665C8.92237 19.7665 7.76373 18.6079 7.76373 17.1786C7.76373 15.7493 8.92237 14.5907 10.3516 14.5907C11.7809 14.5907 12.9395 15.7493 12.9395 17.1786Z",fill:"currentColor"}),o.createElement("path",{strokeWidth:"0",d:"M19.4093 17.1786C19.4093 18.6079 18.2507 19.7665 16.8214 19.7665C15.3921 19.7665 14.2335 18.6079 14.2335 17.1786C14.2335 15.7493 15.3921 14.5907 16.8214 14.5907C18.2507 14.5907 19.4093 15.7493 19.4093 17.1786Z",fill:"currentColor"}),o.createElement("path",{strokeWidth:"0",d:"M25.8791 17.1786C25.8791 18.6079 24.7204 19.7665 23.2912 19.7665C21.8619 19.7665 20.7033 18.6079 20.7033 17.1786C20.7033 15.7493 21.8619 14.5907 23.2912 14.5907C24.7204 14.5907 25.8791 15.7493 25.8791 17.1786Z",fill:"currentColor"}));case"chat-new":return o.createElement("svg",{viewBox:"0 0 26 24",...u},o.createElement("path",{d:"M22.1109 10.3813C22.3941 10.2876 22.6674 10.1722 22.9288 10.0371C23.1902 10.9797 23.33 11.9734 23.33 13C23.33 19.0751 18.4348 24 12.3962 24C9.6352 24 7.11325 22.9705 5.18893 21.2721L0.82251 22.8226C0.277922 23.0159 -0.207515 22.4161 0.0911259 21.9188L2.55952 17.8084C1.85665 16.3558 1.46233 14.7242 1.46233 13C1.46233 6.92487 6.35758 2 12.3962 2C13.4013 2 14.3747 2.13645 15.2992 2.39193C15.1628 2.65458 15.0464 2.92925 14.9519 3.21394C14.1358 2.99881 13.2793 2.88427 12.3962 2.88427C6.84301 2.88427 2.34128 7.41324 2.34128 13C2.34128 14.7493 2.78263 16.3949 3.5594 17.8302L1.18047 21.7634L5.41046 20.2757C7.21939 22.034 9.68221 23.1157 12.3962 23.1157C17.9493 23.1157 22.451 18.5868 22.451 13C22.451 12.0944 22.3328 11.2165 22.1109 10.3813Z",fill:"currentColor"}),o.createElement("path",{d:"M25.6633 4C25.6633 6.20914 23.8724 8 21.6633 8C19.4541 8 17.6633 6.20914 17.6633 4C17.6633 1.79086 19.4541 0 21.6633 0C23.8724 0 25.6633 1.79086 25.6633 4Z",fill:"currentColor"}));case"agent":return o.createElement("svg",{viewBox:"0 0 36 30",...u},o.createElement("path",{d:"M0.900024 15.3887C0.900024 12.9034 2.91474 10.8887 5.40002 10.8887H6.28179V20.0995H5.40002C2.91474 20.0995 0.900024 18.0848 0.900024 15.5995V15.3887Z",stroke:"white"}),o.createElement("path",{d:"M34.65 15.5996C34.65 18.0849 32.6353 20.0996 30.15 20.0996L29.2683 20.0996L29.2683 10.8888L30.15 10.8888C32.6353 10.8888 34.65 12.9035 34.65 15.3888L34.65 15.5996Z",stroke:"white"}),o.createElement("path",{d:"M29.2565 20.5974C29.2565 26.341 22.8747 26.9792 19.6838 26.9792",stroke:"white"}),o.createElement("circle",{cx:"17.4074",cy:"26.9795",r:"2.05271",stroke:"white"}),o.createElement("path",{d:"M6.28467 12.9396C6.28467 11.195 6.28686 18.0452 6.28467 8.47234C6.28248 -1.10049 29.2591 -1.10047 29.259 8.47234C29.259 18.0452 29.2569 11.6631 29.259 12.9396",stroke:"white"}));case"minimize":return o.createElement("svg",{viewBox:"0 -10 22 22",...u},o.createElement("path",{d:"M0 1H22",stroke:"white"}));case"sorting":return o.createElement("svg",{viewBox:"0 0 18 14",...u},o.createElement("path",{d:"M18 1H0M8 13H0M13 7H0"}));case"copy":return o.createElement("svg",{viewBox:"0 0 19 17",...u},o.createElement("rect",{x:"0.5",y:"0.5",width:"11.6667",height:"11.6014",rx:"1.5",fill:"white"}),o.createElement("rect",{x:"6.83301",y:"4.89868",width:"11.6667",height:"11.6014",rx:"1.5",fill:"white"}));case"print":return o.createElement("svg",{viewBox:"0 0 16 17",...u},o.createElement("path",{d:"M4.31592 0.999999C4.31592 0.723857 4.53977 0.5 4.81592 0.5H11.1845C11.4606 0.5 11.6845 0.723858 11.6845 1V4.53323H4.31592V0.999999Z",fill:"white",stroke:"black"}),o.createElement("path",{d:"M0.5 4.84595C0.5 4.56981 0.723858 4.34595 1 4.34595H15C15.2761 4.34595 15.5 4.5698 15.5 4.84595V10.8399C15.5 11.116 15.2761 11.3399 15 11.3399H1C0.723858 11.3399 0.5 11.116 0.5 10.8399V4.84595Z",fill:"white",stroke:"black"}),o.createElement("path",{d:"M4.31592 10.0061C4.31592 9.72996 4.53978 9.5061 4.81592 9.5061H11.1845C11.4606 9.5061 11.6845 9.72996 11.6845 10.0061V16.0001C11.6845 16.2762 11.4606 16.5001 11.1845 16.5001H4.81592C4.53978 16.5001 4.31592 16.2762 4.31592 16.0001V10.0061Z",fill:"white",stroke:"black"}),o.createElement("line",{x1:"5.29004",y1:"10.8323",x2:"10.7101",y2:"10.8323",stroke:"black"}),o.createElement("line",{x1:"5.29004",y1:"12.5242",x2:"10.7101",y2:"12.5242",stroke:"black"}),o.createElement("line",{x1:"5.29004",y1:"14.2161",x2:"10.7101",y2:"14.2161",stroke:"black"}));case"language":return o.createElement("svg",{viewBox:"0 0 19 19",...u},o.createElement("path",{d:"M9.5 18C14.1944 18 18 14.1944 18 9.5C18 4.80558 14.1944 1 9.5 1M9.5 18C4.80558 18 1 14.1944 1 9.5C1 4.80558 4.80558 1 9.5 1M9.5 18C11.823 18 13.7062 14.1944 13.7062 9.5C13.7062 4.80558 11.823 1 9.5 1M9.5 18C7.17699 18 5.29381 14.1944 5.29381 9.5C5.29381 4.80558 7.17699 1 9.5 1M1.44333 6.78351H17.4742M1.3088 11.7784H17.6912",stroke:"black"}));case"information":return o.createElement("svg",{viewBox:"0 0 17 17",...u},o.createElement("path",{d:"M9.72182 5.99993C10.0524 5.99993 10.3203 5.73198 10.3203 5.40145C10.3203 5.07092 10.0524 4.80297 9.72182 4.80297C9.39129 4.80297 9.12335 5.07092 9.12335 5.40145C9.12335 5.73198 9.39129 5.99993 9.72182 5.99993Z",fill:"black"}),o.createElement("path",{d:"M7.21887 6.67639C6.89117 6.71981 6.66072 7.02066 6.70414 7.34836C6.74756 7.67605 7.04841 7.9065 7.3761 7.86308L8.353 7.73364L7.17405 11.3945C7.11289 11.5844 7.15164 11.7825 7.26117 11.932C7.38068 12.1287 7.60875 12.2469 7.85155 12.2147L9.40669 12.0087C9.73436 11.9653 9.96479 11.6645 9.92137 11.3368C9.87795 11.0091 9.57713 10.7787 9.24947 10.8221L8.58762 10.9098L9.76774 7.24534C9.83038 7.05084 9.78821 6.84771 9.67254 6.69702C9.55085 6.50877 9.32791 6.39694 9.09093 6.42834L7.21887 6.67639Z",fill:"black"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0C13.1944 0 17 3.80558 17 8.5ZM16 8.5C16 12.8454 12.8454 16 8.5 16C4.15461 16 1 12.8454 1 8.5C1 4.15461 4.15461 1 8.5 1C12.8454 1 16 4.15461 16 8.5Z",fill:"black"}));case"options":return o.createElement("svg",{viewBox:"0 0 16 2",...u},o.createElement("circle",{cx:"15",cy:"1",r:"1",transform:"rotate(90 15 1)",fill:"black"}),o.createElement("circle",{cx:"1",cy:"1",r:"1",transform:"rotate(90 1 1)",fill:"black"}),o.createElement("circle",{cx:"8",cy:"1",r:"1",transform:"rotate(90 8 1)",fill:"black"}));case"browse":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"currentColor"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.16663 7.33334C6.16663 6.68901 6.68896 6.16667 7.33329 6.16667H10.25C10.8943 6.16667 11.4166 6.68901 11.4166 7.33334V10.25C11.4166 10.8943 10.8943 11.4167 10.25 11.4167H7.33329C6.68896 11.4167 6.16663 10.8943 6.16663 10.25V7.33334ZM7.33329 7.04167H10.25C10.411 7.04167 10.5416 7.17226 10.5416 7.33334V10.25C10.5416 10.4111 10.411 10.5417 10.25 10.5417H7.33329C7.17221 10.5417 7.04163 10.4111 7.04163 10.25V7.33334C7.04163 7.17226 7.17221 7.04167 7.33329 7.04167Z",fill:"white"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.16663 13.75C6.16663 13.1057 6.68896 12.5833 7.33329 12.5833H10.25C10.8943 12.5833 11.4166 13.1057 11.4166 13.75V16.6667C11.4166 17.311 10.8943 17.8333 10.25 17.8333H7.33329C6.68896 17.8333 6.16663 17.311 6.16663 16.6667V13.75ZM7.33329 13.4583H10.25C10.411 13.4583 10.5416 13.5889 10.5416 13.75V16.6667C10.5416 16.8278 10.411 16.9583 10.25 16.9583H7.33329C7.17221 16.9583 7.04163 16.8278 7.04163 16.6667V13.75C7.04163 13.5889 7.17221 13.4583 7.33329 13.4583Z",fill:"white"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.75 6.16667C13.1056 6.16667 12.5833 6.68901 12.5833 7.33334V10.25C12.5833 10.8943 13.1056 11.4167 13.75 11.4167H16.6666C17.311 11.4167 17.8333 10.8943 17.8333 10.25V7.33334C17.8333 6.68901 17.311 6.16667 16.6666 6.16667H13.75ZM16.6666 7.04167H13.75C13.5889 7.04167 13.4583 7.17226 13.4583 7.33334V10.25C13.4583 10.4111 13.5889 10.5417 13.75 10.5417H16.6666C16.8277 10.5417 16.9583 10.4111 16.9583 10.25V7.33334C16.9583 7.17226 16.8277 7.04167 16.6666 7.04167Z",fill:"white"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.8333 15.2083C17.8333 16.6581 16.658 17.8333 15.2083 17.8333C13.7585 17.8333 12.5833 16.6581 12.5833 15.2083C12.5833 13.7586 13.7585 12.5833 15.2083 12.5833C16.658 12.5833 17.8333 13.7586 17.8333 15.2083ZM16.9583 15.2083C16.9583 16.1748 16.1748 16.9583 15.2083 16.9583C14.2418 16.9583 13.4583 16.1748 13.4583 15.2083C13.4583 14.2418 14.2418 13.4583 15.2083 13.4583C16.1748 13.4583 16.9583 14.2418 16.9583 15.2083Z",fill:"white"}));case"video":return d.minWidth&&typeof d.minWidth=="number"&&(d.minWidth=`${d.minWidth}px`),o.createElement("svg",{viewBox:"0 0 25 25",...u,style:d},o.createElement("path",{d:"M16.8245 10.0758C18.7392 8.55799 21.3085 7.08973 21.7947 7.61552C22.5982 8.47863 22.5288 16.6929 21.7947 17.4766C21.3482 17.9627 18.7589 16.4945 16.8245 14.9866",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.61914 12.5385C2.61914 7.12973 4.41578 5.32715 9.80764 5.32715C15.1985 5.32715 16.9952 7.12973 16.9952 12.5385C16.9952 17.9462 15.1985 19.7497 9.80764 19.7497C4.41578 19.7497 2.61914 17.9462 2.61914 12.5385Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}));case"star-empty":return o.createElement("svg",{viewBox:"0 0 13 12",...u},o.createElement("path",{d:"M2 5.2767L5.11944 4.81796L6.70023 2L7.96487 4.81796L11 5.51699L8.75527 7.64684L9.18735 11L6.42623 9.40534L3.62295 10.7925L4.21311 7.64684L2 5.2767Z",stroke:"black"}));case"star-filled":return o.createElement("svg",{viewBox:"0 0 13 12",...u},o.createElement("path",{d:"M2 5.2767L5.11944 4.81796L6.70023 2L7.96487 4.81796L11 5.51699L8.75527 7.64684L9.18735 11L6.42623 9.40534L3.62295 10.7925L4.21311 7.64684L2 5.2767Z",fill:"black",stroke:"black"}));case"cog-wheel":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.273 2.68498V1C15.273 0.447715 14.8253 0 14.273 0H9.72754C9.17525 0 8.72754 0.447715 8.72754 1V2.6852C8.72754 3.20708 8.09656 3.46843 7.72754 3.09941L6.53588 1.90775C6.14536 1.51723 5.51219 1.51723 5.12167 1.90775L1.90755 5.12187C1.51702 5.5124 1.51702 6.14556 1.90755 6.53609L3.09865 7.72719C3.46767 8.09621 3.20632 8.72719 2.68444 8.72719H1C0.447715 8.72719 0 9.1749 0 9.72719V14.2726C0 14.8249 0.447715 15.2726 1 15.2726H2.68534C3.20722 15.2726 3.46857 15.9036 3.09955 16.2726L1.90793 17.4643C1.51741 17.8548 1.51741 18.488 1.90793 18.8785L5.12205 22.0926C5.51258 22.4831 6.14574 22.4831 6.53627 22.0926L7.72754 20.9013C8.09656 20.5323 8.72754 20.7937 8.72754 21.3155V23C8.72754 23.5523 9.17525 24 9.72754 24H14.273C14.8253 24 15.273 23.5523 15.273 23V21.3158C15.273 20.7939 15.904 20.5325 16.273 20.9015L17.4639 22.0924C17.8544 22.483 18.4876 22.483 18.8781 22.0924L22.0922 18.8783C22.4828 18.4878 22.4828 17.8546 22.0922 17.4641L20.9008 16.2726C20.5317 15.9036 20.7931 15.2726 21.315 15.2726H23C23.5523 15.2726 24 14.8249 24 14.2726V9.72719C24 9.1749 23.5523 8.72719 23 8.72719H21.3159C20.794 8.72719 20.5326 8.09621 20.9017 7.72719L22.0926 6.53625C22.4831 6.14572 22.4831 5.51256 22.0926 5.12203L18.8785 1.90791C18.488 1.51739 17.8548 1.51739 17.4643 1.90791L16.273 3.0992C15.904 3.46822 15.273 3.20686 15.273 2.68498ZM16.5792 4.20716C16.263 4.52345 15.7775 4.58532 15.3687 4.40375C15.2439 4.34832 15.1174 4.29587 14.9895 4.2465C14.5723 4.08555 14.273 3.69861 14.273 3.25149V2C14.273 1.44771 13.8253 1 13.273 1H10.7275C10.1753 1 9.72754 1.44772 9.72754 2V3.25116C9.72754 3.69832 9.42816 4.08528 9.01096 4.2462C8.88288 4.29561 8.75633 4.34809 8.6314 4.40357C8.22262 4.58511 7.73715 4.52323 7.42087 4.20695L6.53588 3.32196C6.14536 2.93144 5.51219 2.93144 5.12167 3.32196L3.32176 5.12187C2.93124 5.5124 2.93124 6.14556 3.32176 6.53609L4.20676 7.42109C4.52303 7.73736 4.58491 8.22283 4.40338 8.63161C4.34797 8.75638 4.29555 8.88276 4.2462 9.01067C4.08526 9.42784 3.69831 9.72719 3.25118 9.72719H2C1.44772 9.72719 1 10.1749 1 10.7272V13.2726C1 13.8249 1.44772 14.2726 2 14.2726H3.2511C3.69825 14.2726 4.0852 14.572 4.24614 14.9892C4.29556 15.1173 4.34807 15.2439 4.40357 15.3688C4.58513 15.7776 4.52327 16.2631 4.20698 16.5794L3.32215 17.4643C2.93162 17.8548 2.93162 18.488 3.32215 18.8785L5.12205 20.6784C5.51258 21.0689 6.14574 21.0689 6.53627 20.6784L7.42136 19.7933C7.73762 19.477 8.22305 19.4151 8.63183 19.5966C8.75662 19.6521 8.88302 19.7045 9.01096 19.7538C9.42816 19.9147 9.72754 20.3017 9.72754 20.7489V22C9.72754 22.5523 10.1753 23 10.7275 23H13.273C13.8253 23 14.273 22.5523 14.273 22V20.7485C14.273 20.3014 14.5723 19.9145 14.9895 19.7535C15.1173 19.7042 15.2436 19.6518 15.3682 19.5965C15.777 19.4149 16.2625 19.4768 16.5788 19.7931L17.4639 20.6782C17.8544 21.0687 18.4876 21.0687 18.8781 20.6782L20.678 18.8783C21.0685 18.4878 21.0685 17.8546 20.678 17.4641L19.7929 16.579C19.4766 16.2627 19.4147 15.7772 19.5963 15.3684C19.6517 15.2436 19.7042 15.1172 19.7535 14.9892C19.9145 14.572 20.3014 14.2726 20.7486 14.2726H22C22.5523 14.2726 23 13.8249 23 13.2726V10.7272C23 10.1749 22.5523 9.72719 22 9.72719H20.7485C20.3013 9.72719 19.9144 9.42784 19.7535 9.01067C19.7042 8.8829 19.6518 8.75665 19.5965 8.63201C19.415 8.22324 19.4768 7.7378 19.7931 7.42154L20.6784 6.53625C21.0689 6.14572 21.0689 5.51256 20.6784 5.12203L18.8785 3.32213C18.488 2.9316 17.8548 2.9316 17.4643 3.32213L16.5792 4.20716ZM16.5999 12.0001C16.5999 14.5406 14.5404 16.6001 11.9999 16.6001C9.45939 16.6001 7.3999 14.5406 7.3999 12.0001C7.3999 9.45958 9.45939 7.40009 11.9999 7.40009C14.5404 7.40009 16.5999 9.45958 16.5999 12.0001ZM17.5999 12.0001C17.5999 15.0929 15.0927 17.6001 11.9999 17.6001C8.90711 17.6001 6.3999 15.0929 6.3999 12.0001C6.3999 8.90729 8.90711 6.40009 11.9999 6.40009C15.0927 6.40009 17.5999 8.90729 17.5999 12.0001Z",fill:"black"}));case"zoom-in":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9774 20.8287L17.9149 16.7662C17.8437 16.6957 17.76 16.639 17.668 16.5992C20.7612 12.9331 20.415 7.48045 16.883 4.23507C13.3509 0.989694 7.88848 1.10517 4.49673 4.49691C1.10499 7.88866 0.98951 13.3511 4.23489 16.8831C7.48027 20.4152 12.9329 20.7614 16.599 17.6682C16.6388 17.7601 16.6955 17.8439 16.766 17.9151L20.8285 21.9776C21.1457 22.2948 21.6601 22.2948 21.9774 21.9776C22.2947 21.6603 22.2947 21.1459 21.9774 20.8287ZM10.8404 18.1531C6.80186 18.1531 3.52794 14.8792 3.52794 10.8406C3.52794 6.80204 6.80186 3.52813 10.8404 3.52813C14.879 3.52813 18.1529 6.80204 18.1529 10.8406C18.1483 14.8773 14.8771 18.1484 10.8404 18.1531Z",fill:"white"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8749 6.75003C11.2892 6.75003 11.6249 7.08581 11.6249 7.50003V14.25C11.6249 14.6642 11.2892 15 10.8749 15C10.4607 15 10.1249 14.6642 10.1249 14.25V7.50003C10.1249 7.08581 10.4607 6.75003 10.8749 6.75003Z",fill:"white"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.74994 10.875C6.74994 10.4608 7.08573 10.125 7.49994 10.125H14.2499C14.6642 10.125 14.9999 10.4608 14.9999 10.875C14.9999 11.2892 14.6642 11.625 14.2499 11.625H7.49994C7.08573 11.625 6.74994 11.2892 6.74994 10.875Z",fill:"white"}));case"zoom-out":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.1025 20.9536L18.04 16.8911C17.9688 16.8206 17.8851 16.764 17.7931 16.7241C20.8864 13.0581 20.5401 7.60539 17.0081 4.36001C13.476 1.11463 8.0136 1.23011 4.62185 4.62185C1.23011 8.0136 1.11463 13.476 4.36001 17.0081C7.60539 20.5401 13.0581 20.8864 16.7241 17.7931C16.764 17.8851 16.8206 17.9688 16.8911 18.04L20.9536 22.1025C21.2709 22.4198 21.7853 22.4198 22.1025 22.1025C22.4198 21.7853 22.4198 21.2709 22.1025 20.9536ZM10.9656 18.2781C6.92698 18.2781 3.65306 15.0041 3.65306 10.9656C3.65306 6.92698 6.92698 3.65306 10.9656 3.65306C15.0041 3.65306 18.2781 6.92698 18.2781 10.9656C18.2734 15.0022 15.0022 18.2734 10.9656 18.2781Z",fill:"white"}),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.87506 11C6.87506 10.5858 7.21085 10.25 7.62506 10.25H14.3751C14.7893 10.25 15.1251 10.5858 15.1251 11C15.1251 11.4142 14.7893 11.75 14.3751 11.75H7.62506C7.21085 11.75 6.87506 11.4142 6.87506 11Z",fill:"white"}));case"download":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.5 11.1346V18.4038C22.498 20.1873 21.0527 21.6326 19.2692 21.6346H4.73077C2.94731 21.6326 1.50204 20.1873 1.5 18.4038V11.1346C1.5 10.6885 1.86162 10.3269 2.30769 10.3269C2.75377 10.3269 3.11538 10.6885 3.11538 11.1346V18.4038C3.1164 19.2956 3.83904 20.0182 4.73077 20.0192H19.2692C20.161 20.0182 20.8836 19.2956 20.8846 18.4038V11.1346C20.8846 10.6885 21.2462 10.3269 21.6923 10.3269C22.1384 10.3269 22.5 10.6885 22.5 11.1346ZM11.1434 16.2663C11.6167 16.7388 12.3832 16.7388 12.8565 16.2663L17.4172 11.7057C17.7326 11.3903 17.7326 10.8789 17.4172 10.5635C17.1018 10.2481 16.5904 10.2481 16.275 10.5635L12.8076 14.0308V3.05769C12.8076 2.61162 12.446 2.25 11.9999 2.25C11.5539 2.25 11.1923 2.61162 11.1923 3.05769V14.0308L7.72485 10.5636C7.40946 10.2482 6.89812 10.2482 6.58273 10.5636C6.26734 10.8789 6.26734 11.3903 6.58273 11.7057L11.1434 16.2663Z",fill:"white"}));case"lightbox-close":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M19.2621 18.1129C19.4674 18.3182 19.5475 18.6173 19.4724 18.8977C19.3973 19.178 19.1783 19.397 18.8979 19.4721C18.6176 19.5472 18.3184 19.4671 18.1132 19.2619L12.1877 13.3363L6.26214 19.2619C6.0569 19.4671 5.75776 19.5472 5.47741 19.4721C5.19705 19.397 4.97807 19.178 4.90294 18.8977C4.82782 18.6173 4.90798 18.3182 5.11321 18.1129L11.0388 12.1874L5.11321 6.26186C4.90798 6.05663 4.82782 5.75749 4.90294 5.47713C4.97807 5.19678 5.19705 4.97779 5.47741 4.90267C5.75776 4.82755 6.0569 4.9077 6.26214 5.11294L12.1877 11.0385L18.1132 5.11294C18.4305 4.79567 18.9449 4.79567 19.2621 5.11294C19.5794 5.4302 19.5794 5.9446 19.2621 6.26186L13.3366 12.1874L19.2621 18.1129Z",fill:"white"}));case"pagination-left":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.7935 18.7087C16.0092 18.9029 16.105 19.1974 16.0447 19.4813C15.9844 19.7652 15.7772 19.9954 15.5012 20.0852C15.2251 20.1749 14.9222 20.1105 14.7065 19.9164L6.58148 12.6039C6.41027 12.4498 6.3125 12.2303 6.3125 12C6.3125 11.7697 6.41027 11.5503 6.58148 11.3962L14.7065 4.08372C15.04 3.78354 15.5536 3.81054 15.8538 4.14402C16.154 4.4775 16.127 4.99119 15.7935 5.29136L8.33939 12L15.7935 18.7087Z",fill:"#222222"}));case"pagination-right":return o.createElement("svg",{viewBox:"0 0 24 24",...u},o.createElement("path",{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"}))}return null}case"FontAwesome":return o.createElement(ci,{className:i,faIcon:l,title:t,...a});default:case"Text":return t?o.createElement("i",{className:L(i,"humany-letter-symbol"),title:t,...h,...a},t.substring(0,2)):null}},ni=y.svg`
123
- transform: rotate(180deg);
124
- `,ri={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",p:"p",span:"span"},Dt=({variant:t,component:e,className:n,children:r})=>{const{typographyVariantMapping:s={}}=Gs(),i={...ri,...s},a=e||i[t]||"span";return o.createElement(si,{className:n,as:a},r)},si=y.span``,Ze=y.div`
125
- font-family: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.type}};
126
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
127
- position: fixed;
128
- bottom: 0;
129
- left: 0;
130
- border: ${t=>t.theme.border};
131
- width: 100%;
132
- box-shadow: ${t=>t.theme.boxShadow};
133
- background: #ffffff;
134
- ${t=>t.css&&t.css}
135
- `;y(Dt)`
136
- padding: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
137
- margin: 0;
138
- text-align: center;
139
- border-bottom: #eeeeee 1px solid;
140
- background: #ffffff;
141
- position: relative;
142
- display: flex;
143
- justify-content: center;
144
- align-items: center;
145
- font-weight: bold;
146
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
147
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
148
- line-height: 1.2em;
149
- `;const Ue=t=>$.css`
150
- transition: ${t.duration}ms;
151
- `;y(Ze)`
152
- max-height: 0;
153
- ${Ue}
154
-
155
- &.humany-drawer-transition-enter {
156
- max-height: 0;
157
- }
158
- &.humany-drawer-transition-enter-active,
159
- &.humany-drawer-transition-enter-done,
160
- &.humany-drawer-transition-exit {
161
- max-height: ${t=>t.fullScreen?"100%":"400px"};
162
- }
163
-
164
- &.humany-drawer-transition-exit-active,
165
- &.humany-drawer-transition-exit-done {
166
- max-height: 0;
167
- }
168
- `;y(Ze)`
169
- ${Ue}
170
- transform: translateX(100%);
171
- height: ${t=>t.fullScreen?"100%":"auto"};
172
-
173
- &.humany-drawer-transition-enter {
174
- transform: translateX(100%);
175
- }
176
- &.humany-drawer-transition-enter-active,
177
- &.humany-drawer-transition-enter-done,
178
- &.humany-drawer-transition-exit {
179
- transform: translateX(0);
180
- }
181
-
182
- &.humany-drawer-transition-exit-active,
183
- &.humany-drawer-transition-exit-done {
184
- transform: translateX(100%);
185
- }
186
- `;y(Ze)`
187
- ${Ue}
188
- transform: translateX(-100%);
189
- height: ${t=>t.fullScreen?"100%":"auto"};
190
-
191
- &.humany-drawer-transition-enter {
192
- transform: translateX(-100%);
193
- }
194
- &.humany-drawer-transition-enter-active,
195
- &.humany-drawer-transition-enter-done,
196
- &.humany-drawer-transition-exit {
197
- transform: translateX(0);
198
- }
199
-
200
- &.humany-drawer-transition-exit-active,
201
- &.humany-drawer-transition-exit-done {
202
- transform: translateX(-100%);
203
- }
204
- `;y(Ze)`
205
- ${Ue}
206
- bottom: unset;
207
- top: 0;
208
- height: 0;
209
-
210
- &.humany-drawer-transition-enter {
211
- height: 0;
212
- }
213
- &.humany-drawer-transition-enter-active,
214
- &.humany-drawer-transition-enter-done,
215
- &.humany-drawer-transition-exit {
216
- height: ${t=>t.clientHeight}px;
217
- }
218
-
219
- &.humany-drawer-transition-exit-active,
220
- &.humany-drawer-transition-exit-done {
221
- height: 0;
222
- }
223
- `;const ii=(t,e,n)=>{const[r,s]=o.useState(0),[i,a]=o.useState(0),c=o.useCallback((l,h)=>{if(l.preventDefault(),h){const u=h.getBoundingClientRect();s(Math.max(document.body.clientWidth-u.right,1)),a(u.bottom+window.scrollY)}},[r,i,s,a]);return o.useEffect(()=>{if(!n||!t)return;const l=n.getBoundingClientRect(),h={x:r,y:i};l.left<0&&(h.x=0),l.bottom>window.innerHeight&&(h.y=0),h.x!==r&&s(h.x),h.y!==i&&a(h.y)},[n,t,e]),[{x:r,y:i},c]};o.forwardRef(({className:t="",children:e=null,trigger:n,closeButtonAriaLabel:r,...s},i)=>{const a=o.useRef(),c=o.useRef(),l=o.useRef();o.useImperativeHandle(i,()=>l.current,[l.current]);const h=o.useRef(Ce()),[u,d]=o.useState(!1),f=Qs(u),[{x:p,y:g},v]=ii(u,h.current,l.current),m=ge("Escape");o.useEffect(()=>{m&&d(!1)},[m]),o.useEffect(()=>{u&&a.current?a.current.focus():!u&&c.current&&f&&c.current.focus()},[u,a.current,c.current]),le("click",E=>{const{target:C}=E;!l.current||!C||l.current!==C&&!l.current.contains(C)&&d(!1)},window),Ht("router:changed",()=>{d(!1)});const b=Vn(h.current,()=>{d(!1)}),w=o.useCallback(E=>{E.stopPropagation(),v(E,c.current),d(!u),b()},[b,v,d]);return o.createElement(o.Fragment,null,u&&o.createElement(Vt,null,o.createElement(oi,{className:L("humany-dropdown",`humany-dropdown-${h.current}`,t),...s,x:p,y:g,ref:l},o.createElement(_n,{onClick:()=>d(!1),tabIndex:0,ref:a,"aria-label":r},o.createElement(xe,{symbol:{type:"Svg",content:"close"}})),e)),o.cloneElement(n,{onClick:w,ref:c,"aria-label":n.props.title,"aria-expanded":u}))});const oi=y.div`
224
- ${Dn}
225
- padding: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}};
226
- min-width: 150px;
227
- position: absolute;
228
- box-shadow: ${t=>t.theme.boxShadow};
229
-
230
- ${t=>{var n,r,s;let e="";return t.y>0?e+=`top: calc(${((n=t.theme.sizes)==null?void 0:n.small)||"0px"} + ${t.y||"0"}px);`:e+=`bottom: ${((r=t.theme.sizes)==null?void 0:r.normal)||"0px"};`,t.x>0?e+=`right: ${t.x||"0"}px;`:e+=`left: ${((s=t.theme.sizes)==null?void 0:s.normal)||"0px"};`,e}};
231
- `;y.div`
232
- display: none;
233
- `;o.forwardRef(({children:t,columns:e,gap:n,className:r,...s},i)=>o.createElement(ai,{className:L(r,"humany-grid"),"data-columns":e,"data-gap":n,...Tn(s),..._(s),ref:i},t));const ai=y.div`
234
- display: grid;
235
- grid-template-columns: repeat(${t=>t["data-columns"]}, 1fr);
236
- grid-gap: ${t=>t["data-gap"]};
237
- justify-content: center;
238
- grid-auto-rows: max-content;
239
- ${zs}
240
- `,qn=o.forwardRef(({htmlParseInstruction:t=null,className:e,html:n,...r},s)=>{const i=he(),[a,c]=o.useState();return o.useEffect(()=>{const l=_s(i,n),h={...l,...t,transform:{...l.transform,...t==null?void 0:t.transform}},u=Ds(n,h);c(u)},[n,t]),o.createElement("div",{className:L(e,"humany-html"),..._(r),ref:s},a)}),ci=({faIcon:t,title:e,className:n="",role:r="presentation",...s})=>o.createElement("i",{className:L(n,`fa fa-${t}`),title:e,role:r,..._(s)}),li=o.forwardRef(({className:t="",autoFocus:e=!1,onFocusChange:n=()=>{},onEnter:r=()=>{},onEscape:s=()=>{},selectAllOnFocus:i,onChange:a=()=>{},disabled:c=!1,type:l,...h},u)=>{const[d,f]=o.useState(e),p=o.useRef();o.useImperativeHandle(u,()=>p.current),o.useEffect(()=>{var m;e&&((m=p==null?void 0:p.current)==null||m.focus())},[e,u,p]);const g=(m,b)=>{f(m),n&&n(m),i&&m&&b.target.select()},v={..._(h),disabled:c,autoFocus:e,type:l,onKeyDown:m=>{m.key==="Enter"&&d&&r(m),m.key==="Escape"&&d&&s(m)},onFocus:m=>g(!0,m),onBlur:m=>g(!1,m),onChange:m=>a(m.target.value||""),className:L(t,"humany-input"),"data-type":l};return l!=="textarea"?o.createElement("input",{...v,ref:p}):o.createElement("textarea",{...v,ref:p})}),Ft=o.forwardRef(({className:t,items:e,renderItem:n,renderLi:r=!1,...s},i)=>o.createElement("ul",{className:L(t,"humany-list"),"data-item-count":e.length,..._(s),ref:i},e.map((a,c,l)=>r?o.createElement("li",{className:"humany-list-item",key:a.id||c},n(a,c,l)):n(a,c,l)))),ui=o.forwardRef(({text:t,html:e,header:n,className:r,htmlParseInstruction:s,symbol:i,...a},c)=>o.createElement("div",{className:L(r,"humany-paragraph"),..._(a),ref:c},n?o.createElement(Dt,{variant:"h1"},i?o.createElement(xe,{symbol:i}):null,n):null,e?o.createElement(qn,{html:e,htmlParseInstruction:s}):null,t?o.createElement(Bt,null,t):null));o.forwardRef(({header:t,customHeader:e,text:n,html:r,className:s,children:i,symbol:a,items:c,renderItem:l,renderLi:h,ulProps:u,...d},f)=>o.createElement("div",{className:L(s,"humany-item-list"),"data-item-count":c.length,..._(d),ref:f},e||(t||n||r?o.createElement(ui,{symbol:a,header:t,text:n,html:r}):null),c.length?o.createElement(Ft,{items:c,renderItem:l,renderLi:h,...u}):null,i));var Wn=function(){};process.env.NODE_ENV!=="production"&&(Wn=function(t,e,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var s=2;s<r;s++)n[s-2]=arguments[s];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!t){var i=0,a="Warning: "+e.replace(/%s/g,function(){return n[i++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var hi=Wn,di=hi;fi(di);function fi(t){return t&&t.__esModule?t:{default:t}}function Me(t){return t.charAt(0)==="/"}function it(t,e){for(var n=e,r=n+1,s=t.length;r<s;n+=1,r+=1)t[n]=t[r];t.pop()}function mi(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=t&&t.split("/")||[],r=e&&e.split("/")||[],s=t&&Me(t),i=e&&Me(e),a=s||i;if(t&&Me(t)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var c=void 0;if(r.length){var l=r[r.length-1];c=l==="."||l===".."||l===""}else c=!1;for(var h=0,u=r.length;u>=0;u--){var d=r[u];d==="."?it(r,u):d===".."?(it(r,u),h++):h&&(it(r,u),h--)}if(!a)for(;h--;h)r.unshift("..");a&&r[0]!==""&&(!r[0]||!Me(r[0]))&&r.unshift("");var f=r.join("/");return c&&f.substr(-1)!=="/"&&(f+="/"),f}const pi=Object.freeze(Object.defineProperty({__proto__:null,default:mi},Symbol.toStringTag,{value:"Module"})),gi=zn(pi);var fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function He(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(l,h){return He(l,e[h])});var n=typeof t>"u"?"undefined":fn(t),r=typeof e>"u"?"undefined":fn(e);if(n!==r)return!1;if(n==="object"){var s=t.valueOf(),i=e.valueOf();if(s!==t||i!==e)return He(s,i);var a=Object.keys(t),c=Object.keys(e);return a.length!==c.length?!1:a.every(function(l){return He(t[l],e[l])})}return!1}const yi=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"})),vi=zn(yi);var bi=gi;Zn(bi);var wi=vi;Zn(wi);function Zn(t){return t&&t.__esModule?t:{default:t}}var mt=(t=>(t.scopedHash="scopedHash",t.hash="hash",t.browser="browser",t.memory="memory",t))(mt||{});const Ci=(t,e)=>{const n=`humany-${e}=([^&?]+)&?`,r=new RegExp(n,"i"),s=t.match(r);return s&&s[1]||"/"};je(t=>{t.createCommand("routing",e=>n=>{const r={mode:n.mode};n.basePath&&(r.basePath=n.basePath),e.container.register("routingSettings",r)})});const xi=o.forwardRef(({className:t,onClick:e=()=>{},name:n="",to:r="",params:s={},children:i,...a},c)=>{const l=Ys(),h=he();if(!l)return null;let u="";const d={onClick:e,className:L(t,"humany-route-link"),to:u,innerRef:c,...a,ref:null};if(n){if(!(l.routes||[]).find(v=>v.name===n))return process.env.NODE_ENV!=="production"&&M.warn(`Unable to create route. No route named "${n}" exist.`),o.createElement(Ke.Link,{...d,onClick:v=>{e(v),v.preventDefault(),process.env.NODE_ENV!=="production"&&M.warn(`Unable to navigate. No route named "${n}" exist.`)}},i);const g=Object.keys(s).reduce((v,m)=>{const b=s[m];if(Array.isArray(b)){if(b.length===0)return v;v[m]=b.map(w=>typeof w=="string"?encodeURIComponent(w):w).join(",")}else v[m]=typeof b=="string"?encodeURIComponent(b):b;return v},{});try{u=l.generate(n,g||{})}catch{return o.createElement(Ke.Link,{...d,ref:d.innerRef},i)}u&&l.settings.mode&&l.settings.mode===mt.browser&&u[0]!=="/"&&(u=`/${u}`)}else if(r&&l.history)u=l.history.createHref({hash:"",pathname:r,search:"",state:void 0});else return process.env.NODE_ENV!=="production"&&M.warn('Unable to generate path for route link. Either specify route name or use the "to" prop.'),null;if(l.settings&&l.settings.mode===mt.scopedHash){const f=h.get("$widget").name;u=Ci(u,f)}return d.as?o.createElement(Ei,{...d,as:d.as},i):o.createElement(Ke.Link,{...d,to:u},i)}),Ei=y.span``,_t=o.forwardRef(({className:t,disabled:e=!1,role:n="link",tabIndex:r=0,onClick:s=()=>{},onKeyDown:i=()=>{},title:a,as:c,href:l,children:h,target:u,routeName:d,params:f,...p},g)=>{const v={title:a,disabled:e,role:n,as:c,tabIndex:r,className:L(t,"humany-link",[!!e,"humany-disabled"]),onClick:m=>{if(m.persist(),e){m.preventDefault();return}s(m)},onKeyDown:m=>{if(m.persist(),e){m.key!=="Tab"&&m.preventDefault();return}i(m)}};return d?o.createElement(ki,{name:d,params:f,...v,..._(p),ref:g},h):o.createElement($i,{href:l,target:u,...v,..._(p),ref:g},h)}),ki=y(xi)`
241
- ${t=>t.disabled?`
242
- pointer-events: none;
243
- opacity: .7;
244
- `:"cursor: pointer;"}
245
- `,$i=y.a`
246
- ${t=>t.disabled?`
247
- pointer-events: none;
248
- opacity: .7;
249
- `:"cursor: pointer;"}
250
- `,Un=({visible:t,duration:e=500,children:n,onClick:r=()=>{},...s})=>{const i=o.useRef(),a=o.useCallback(c=>{c.target===i.current&&r(c)},[r]);return o.createElement(Xn.CSSTransition,{in:t,className:"humany-overlay-transition",classNames:"humany-overlay-transition",unmountOnExit:!0,timeout:e},o.createElement(Vt,null,o.createElement(Si,{className:"humany-overlay",duration:e,ref:i,onClick:a,...s},n)))},Si=y.div`
251
- background: rgba(0, 0, 0, 0.6);
252
- min-width: 100%;
253
- min-height: 100%;
254
- position: fixed;
255
- top: 0;
256
- bottom: 0;
257
- right: 0;
258
- left: 0;
259
- display: flex;
260
- justify-content: center;
261
- align-items: center;
262
- z-index: 7;
263
-
264
- transition: ${t=>t.duration}ms;
265
- opacity: 0;
266
-
267
- &.humany-overlay-transition-enter {
268
- opacity: 0.1;
269
- }
270
- &.humany-overlay-transition-enter-active,
271
- &.humany-overlay-transition-enter-done,
272
- &.humany-overlay-transition-exit {
273
- opacity: 1;
274
- }
275
-
276
- &.humany-overlay-transition-exit-active,
277
- &.humany-overlay-transition-exit-done {
278
- opacity: 0;
279
- }
280
- `,Li=$.keyframes`
281
- 100% {
282
- transform: rotate(360deg);
283
- }
284
- `,Ni=$.keyframes`
285
- 0% {
286
- stroke-dasharray: 1, 200;
287
- stroke-dashoffset: 0;
288
- }
289
- 50% {
290
- stroke-dasharray: 89, 200;
291
- stroke-dashoffset: -35px;
292
- }
293
- 100% {
294
- stroke-dasharray: 89, 200;
295
- stroke-dashoffset: -124px;
296
- }
297
- `,Ri=y.svg`
298
- animation: ${Li} 2s linear infinite;
299
- height: 100%;
300
- transform-origin: center center;
301
- width: 100%;
302
- position: absolute;
303
- top: 0;
304
- bottom: 0;
305
- left: 0;
306
- right: 0;
307
- margin: auto;
308
- transition: 200ms ease-out opacity;
309
- `,Ai=y.div`
310
- position: absolute;
311
- top: 0;
312
- bottom: 0;
313
- left: 0;
314
- right: 0;
315
- height: 100%;
316
- width: 100%;
317
- pointer-events: ${t=>t["data-loading"]?"all":"none"};
318
- display: flex;
319
- flex-direction: column;
320
- justify-content: center;
321
- transition: 200ms ease-out opacity;
322
- box-sizing: border-box;
323
- overflow: hidden;
324
- svg {
325
- opacity: ${t=>t["data-loading"]?"1":"0"};
326
- }
327
- `,Oi=y.div`
328
- position: relative;
329
- margin: 0 auto;
330
- width: 100px;
331
- &:before {
332
- content: '';
333
- display: block;
334
- padding-top: 100%;
335
- }
336
- `,Mi=y.circle`
337
- stroke-dasharray: 1, 200;
338
- stroke-dashoffset: 0;
339
- animation: ${Ni} 1.5s ease-in-out infinite;
340
- stroke-linecap: round;
341
- stroke: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
342
- stroke-width: 2px;
343
- `,Pi=({className:t,loading:e=!1})=>o.createElement(Ai,{className:L("humany-loader",t),"data-loading":e},o.createElement(Oi,{className:"humany-spinner"},o.createElement(Ri,{viewBox:"25 25 50 50"},o.createElement(Mi,{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})))),Ti=({zoomState:t,image:e,changeZoom:n,...r})=>{var g;const s=o.useRef(null),[i,a]=o.useState(!1),[c,l]=o.useState(!1),{width:h,height:u,...d}=r.style||{},f=o.useCallback(()=>{const v=s.current;if(v){const m=window.innerWidth/v.naturalWidth,b=window.innerHeight/v.naturalHeight,w=Math.min(m,b);return b>=1&&m>=1?1:w}return 1},[i,e.src]),p=o.useMemo(()=>{const v=s.current;if(v&&i){if(!c){l(!0);const m=f();n(m)}return v.naturalWidth>=v.naturalHeight?[`${t*v.naturalWidth}px`,"auto"]:["auto",`${t*v.naturalHeight}px`]}return null},[t,s,i,e.src]);return o.useEffect(()=>(a(!1),function(){l(!1)}),[e.src]),o.createElement(o.Fragment,null,o.createElement(zi,{loading:!i}),o.createElement(Hi,{onLoad:()=>{a(!0)},ref:s,imageSize:p,draggable:"false",...r,alt:((g=r.alt)==null?void 0:g.toString())||"",style:d,src:e.src,loaded:i}),o.createElement(Bi,null))},zi=y(Pi)`
344
- svg circle {
345
- stroke: #ffffff;
346
- }
347
- `,Hi=y.img`
348
- transform: none;
349
-
350
- ${t=>t.imageSize&&$.css`
351
- width: ${t.imageSize[0]};
352
- height: ${t.imageSize[1]};
353
- display: inline-block;
354
- `}
355
- vertical-align: middle;
356
- position: relative;
357
- ${t=>!t.loaded&&"display:none;"}
358
- `,Bi=y.div`
359
- height: 100%;
360
- display: inline-block;
361
- vertical-align: middle;
362
- `,Ii=()=>{const t=o.useRef(),[e,n]=o.useState(!0),r=o.useCallback(()=>(e||n(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{n(!1)},3e3),()=>{t.current&&clearTimeout(t.current)}),[e,t]);return[e,r]},Vi=({attrs:t,htmlBody:e})=>{var Wt;const n=ge("Escape"),r=ge("ArrowLeft"),s=ge("ArrowRight"),[i,a]=o.useState(1),[c,l]=o.useState({top:0,left:0,x:0,y:0}),[h,u]=o.useState(!1),[d,f]=Ii(),[p,g]=o.useState(null),[v,m]=o.useState(null),b=o.useRef(null),w=o.useRef(null),E=o.useRef(null),C=o.useRef(null),k=o.useRef(null),[I,P]=o.useState(null);o.useEffect(()=>{n&&g(null)},[n]),o.useEffect(()=>{a(1)},[p]),o.useEffect(()=>{var X,Se;if(p===null||w.current===null)return;const x=w.current.firstElementChild,N=(X=E.current)==null?void 0:X.querySelector(".nav-left"),B=(Se=E.current)==null?void 0:Se.querySelector(".nav-right");if(v==="Right")$e&&B?B.focus():oe&&N&&N.focus();else if(v==="Left")oe&&N?N.focus():$e&&B&&B.focus();else{if(!x)return;x.focus()}},[p,w,E,v]),o.useEffect(()=>{if(r){if(oe)return ke()}else if(s&&$e)return Y()},[r,s]),o.useEffect(()=>{var N,B;const x=((B=(N=k.current)==null?void 0:N.style)==null?void 0:B.float)||"";(x==="left"||x==="right")&&P(x)},[]);const S=o.useMemo(()=>{const x=document.createElement("div");x.innerHTML=e||"";const N=x.getElementsByTagName("img");return Array.from(N).reduce((X,Se)=>{const Zt=Se.getAttribute("src");if(Zt){const Yn={src:Zt};X.push(Yn)}return X},[])},[e]),T=o.useCallback(()=>{const{src:x}=t;if(x){const N=S.findIndex((B,X)=>B.src===x);g(N)}},[S,t]),Z=o.useCallback(x=>{g(null)},[]),O=o.useCallback(x=>{a(x?i+i*.25:i-i*.25)},[a,i]),R=o.useCallback(()=>{if(p!==null){const{src:x}=S[p];x&&window.open(x,"_self")}},[S,p]),U=o.useCallback(x=>{const N=C.current;N&&(l({top:N.scrollTop,left:N.scrollLeft,x:x.clientX,y:x.clientY}),u(!0))},[C]),de=o.useCallback(x=>{const N=C.current;if(N&&h){const B=x.clientX-c.x,X=x.clientY-c.y;N.scrollTop=c.top-X,N.scrollLeft=c.left-B}},[h,c]),Ee=x=>{x.preventDefault(),u(!1)},ie=o.useMemo(()=>{if(C.current){const x=C.current.getElementsByTagName("img");if(x&&x.length){const N=x[0];return N.width>window.innerWidth||N.height>window.innerHeight}}return!1},[C,i]),ke=()=>{p!==null&&(m("Left"),g(p-1))},Y=()=>{p!==null&&(m("Right"),g(p+1))},oe=p!==null&&p>0&&S.length>1,$e=p!==null&&S.length-1>p;return o.createElement(o.Fragment,null,o.createElement(Un,{visible:p!==null,onClick:Z},o.createElement(Ui,{onMouseDown:()=>f(),onMouseMove:()=>f(),onTouchStart:()=>f(),onKeyDown:()=>f()},o.createElement(Ki,{show:d.toString()},o.createElement(ji,{ref:w,buttons:[{id:"download",onClick:R,icon:"download",ariaLabel:"Download image"},{id:"lightbox-close",onClick:()=>g(null),icon:"lightbox-close",ariaLabel:"Close"}]})),o.createElement(Ji,{scrolling:h.toString(),isDraggable:ie.toString(),ref:C,onMouseMove:de,onMouseDown:U,onMouseUp:Ee},p!==null&&o.createElement(Ti,{changeZoom:x=>{a(x)},zoomState:i,...t,style:{...t.style||{},float:"none"},image:S[p]})),o.createElement(Wi,{ref:E,show:d.toString(),buttons:[{id:"previous",onClick:ke,icon:"caret-left",circle:!0,show:oe,className:"nav-left",ariaLabel:"Navigate to previous image"},{id:"next",onClick:Y,icon:"caret-right",circle:!0,show:$e,className:"nav-right",ariaLabel:"Navigate to next image"}]}),o.createElement(Gi,{show:d.toString()},o.createElement(qi,{buttons:[{id:"zoom-out",onClick:()=>O(!1),icon:"zoom-out",ariaLabel:"Zoom out"},{id:"zoom-in",onClick:()=>O(!0),icon:"zoom-in",ariaLabel:"Zoom in"}]}),o.createElement(Zi,{variant:"span"},Math.trunc(i*100),"%")))),o.createElement(Di,{ref:b,onClick:T,onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),T())},alignment:I,tabIndex:0},o.createElement(Qi,{...t,alt:((Wt=t.alt)==null?void 0:Wt.toString())||"",ref:k})))},jt=o.forwardRef(({show:t="true",buttons:e,className:n},r)=>o.createElement(Fi,{ref:r,show:t,className:L("humany-button-set",n)},e.map(({id:s,circle:i=!1,show:a=!0,ariaLabel:c,onClick:l,icon:h,className:u},d)=>o.createElement(_i,{key:s+d.toString(),circle:i.toString(),onClick:l,tabIndex:a?void 0:-1,show:a.toString(),icon:h,className:u,"aria-label":c},o.createElement(xe,{size:24,symbol:{type:"Svg",content:h}}))))),Kn=y.div`
363
- transition: opacity 0.3s ease 0s;
364
- z-index: 5;
365
- ${t=>t.show==="true"?"opacity: 1;":$.css`
366
- opacity: 0;
367
- pointer-events: none;
368
- `}
369
- `,Di=y(_t)`
370
- display: inline-block !important;
371
-
372
- ${t=>(t.alignment==="right"||t.alignment==="left")&&$.css`
373
- float: ${t.alignment};
374
- `}
375
- `,Fi=y(Kn)`
376
- position: fixed;
377
- display: flex;
378
- gap: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
379
- `,pt="39px",_i=y(re)`
380
- width: ${pt};
381
- height: ${pt};
382
- display: flex;
383
- justify-content: center;
384
- align-items: center;
385
-
386
- ${t=>t.icon==="caret-left"&&$.css`
387
- svg {
388
- position: relative;
389
- left: -2px;
390
- }
391
- `}
392
-
393
- ${t=>{var e;return t.circle==="true"?$.css`
394
- background-color: #ffffff;
395
- border-radius: 50%;
396
-
397
- svg {
398
- path,
399
- line {
400
- stroke: ${(e=t.theme.colors)==null?void 0:e.text};
401
- }
402
- }
403
-
404
- &:focus-visible {
405
- ${W(t)}
406
- outline-color: #ffffff;
407
- background-color: transparent;
408
-
409
- svg {
410
- path,
411
- line {
412
- stroke: #ffffff;
413
- }
414
- }
415
- }
416
- `:$.css`
417
- svg {
418
- path,
419
- line {
420
- stroke: #ffffff;
421
- }
422
- }
423
- &:focus {
424
- outline-color: #ffffff;
425
- }
426
- &:focus-visible {
427
- ${W(t)}
428
- }
429
- `}}
430
-
431
- ${t=>t.show==="true"?$.css`
432
- opacity: 0.8;
433
- transition: opacity 0.3s ease 0s;
434
- &:hover {
435
- opacity: 1;
436
- }
437
- `:$.css`
438
- opacity: 0;
439
- pointer-events: none;
440
- `}
441
- `,ji=y(jt)`
442
- top: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
443
- right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
444
- `,qi=y(jt)`
445
- bottom: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
446
- width: 100%;
447
- align-items: center;
448
- justify-content: center;
449
- `,Wi=y(jt)`
450
- display: block;
451
- button {
452
- position: fixed;
453
- top: calc(50% - calc(${pt} / 2));
454
- &:first-child {
455
- left: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
456
- }
457
- &:last-child {
458
- right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
459
- }
460
- }
461
- `,Zi=y(Dt)`
462
- position: fixed;
463
- bottom: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
464
- right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.large}};
465
- color: #ffffff;
466
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.medium}};
467
- font-family: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.type}};
468
- `,Gn=y(Kn)`
469
- position: absolute;
470
- width: 100vw;
471
- height: 88px;
472
- left: 0px;
473
- z-index: 5;
474
- `,Ui=y.div`
475
- width: 100%;
476
- `,Ki=y(Gn)`
477
- top: 0px;
478
- background-image: linear-gradient(
479
- to bottom,
480
- rgb(34, 34, 34, 0.8),
481
- rgba(34, 34, 34, 0)
482
- );
483
- `,Gi=y(Gn)`
484
- bottom: 0px;
485
- background-image: linear-gradient(
486
- to top,
487
- rgb(34, 34, 34, 0.8),
488
- rgba(34, 34, 34, 0)
489
- );
490
- `,Ji=y.div`
491
- width: 100%;
492
- height: 100vh;
493
- overflow: auto;
494
- text-align: center;
495
- vertical-align: middle;
496
- white-space: nowrap;
497
- justify-content: center;
498
- cursor: ${t=>t.isDraggable==="true"?t.scrolling==="true"?"grabbing":"grab":"auto"};
499
- `,Qi=y.img`
500
- cursor: pointer;
501
- `,Yi=o.forwardRef(({className:t,children:e,trigger:n,onOverlayClick:r=()=>{},close:s=!1,...i},a)=>{const[c,l]=ti(),[h,u]=Xs(!0),d=o.useRef(),f=o.useRef(Ce()),p=ge("Escape");o.useEffect(()=>{(p||s)&&l(!1)},[p,s]),o.useEffect(()=>{c&&d.current&&d.current.focus()},[c,d.current]),Ht("router:changed",()=>{l(!1)});const g=o.useCallback(m=>{l(!1),r(m)},[r,l]);o.useImperativeHandle(a,()=>({close(){l(!1)}}));const v=o.useCallback(()=>Vn(f.current,()=>{l(!1)}),[f.current]);return o.createElement(o.Fragment,null,o.createElement(Un,{visible:c,onClick:g},o.createElement(Xi,{className:L(t,"humany-modal",`humany-modal-${f.current}`),css:h,tabIndex:-1,...i,ref:u},o.createElement(_n,{onClick:()=>l(!1),tabIndex:0,ref:d},o.createElement(xe,{symbol:{type:"Svg",content:"close"}})),e)),o.cloneElement(n,{onClick:m=>{l(),v()}}))}),Xi=y.div`
502
- font-family: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.type}};
503
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
504
- position: relative;
505
- max-width: 50%;
506
- min-width: 200px;
507
- padding: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}};
508
- ${t=>Dn(t)}
509
- ${t=>t.css&&t.css}
510
- outline: none;
511
- `;y(Yi)`
512
- display: block;
513
-
514
- span {
515
- display: block;
516
- margin: 0 0 ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
517
-
518
- &:first-of-type:not(:only-of-type) {
519
- font-weight: 700;
520
- margin: 0 0 ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}};
521
- }
522
- }
523
- `;y(re)`
524
- display: inline-block;
525
- min-width: 50px;
526
- ${t=>{var e,n;return`padding: ${(e=t.theme.sizes)==null?void 0:e.small} ${(n=t.theme.sizes)==null?void 0:n.normal};`}}
527
- ${t=>t.theme.borderRadius&&`border-radius: ${t.theme.borderRadius};`}
528
- color: #FFFFFF;
529
- background-color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
530
- border: 1px solid ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
531
-
532
- margin: 0 ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}} 0 0;
533
-
534
- &:focus {
535
- background-color: transparent;
536
- }
537
-
538
- &:focus-visible {
539
- ${W}
540
- }
541
- `;y(re)`
542
- display: inline-block;
543
- min-width: 50px;
544
- ${t=>{var e,n;return`padding: ${(e=t.theme.sizes)==null?void 0:e.small} ${(n=t.theme.sizes)==null?void 0:n.normal};`}}
545
- ${t=>t.theme.borderRadius&&`border-radius: ${t.theme.borderRadius};`}
546
- background-color: transparent;
547
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
548
- border: 1px solid ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
549
-
550
- &:focus-visible {
551
- ${W};
552
- }
553
- `;y.div`
554
- display: flex;
555
- flex-wrap: wrap;
556
- `;y.div`
557
- ${t=>zt(t)("h2",$.css`
558
- padding: 0;
559
- margin: 0;
560
- color: gray;
561
- font-size: 7em;
562
- `)}
563
- `;y.div`
564
- margin-left: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}};
565
-
566
- ${t=>{var e;return zt(t)("h3",$.css`
567
- text-transform: uppercase;
568
- font-size: ${(e=t.theme.fonts)==null?void 0:e.normal};
569
- `)}}
570
-
571
- a {
572
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.link}};
573
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.small}};
574
- }
575
- `;y.div`
576
- margin-top: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}};
577
- min-width: 100%;
578
-
579
- span {
580
- font-weight: bold;
581
- }
582
- `;o.forwardRef(({className:t,description:e,text:n,children:r,...s},i)=>o.createElement(_t,{className:L(t,"humany-text-link"),...s,ref:i},r,o.createElement(Bt,null,n),e?o.createElement(qn,{html:e,className:"humany-description"}):null));y.div`
583
- display: flex;
584
- align-items: center;
585
- `;y.div`
586
- color: #ffffff;
587
- background: #161616;
588
- border-radius: ${t=>t.theme.borderRadius};
589
- padding: calc(${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}} * 2);
590
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
591
- font-family: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.type}};
592
- position: absolute;
593
- z-index: 10;
594
-
595
- a {
596
- color: ${t=>t.color?t.color:"inherit"};
597
- text-decoration: none;
598
- }
599
-
600
- i,
601
- svg {
602
- margin-right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}};
603
- }
604
-
605
- ${t=>{let e="";return t.y>0?e+=`top: calc(2px + ${t.y||"0"}px);`:e+="bottom: 2px;",t.x>0?e+=`right: calc(2px + ${t.x||"0"}px);`:e+="left: 2px;",e}};
606
- `;const eo=o.forwardRef(({className:t,children:e,onClick:n=()=>{},widgetName:r,activationOptions:s,...i},a)=>{const c=he(),l=()=>{const{implementation:d}=c.get("$widget");return d.widgets.get(r)};o.useEffect(()=>{const d=l();return d==null||d.activate(s).then(()=>d.invoke("attach")),()=>{d==null||d.deactivate()}},[r]);const h=d=>{const f=l(),p=d.currentTarget;if(f){const g=()=>{f.invoke("renderState").then(v=>v===be.open?f.invoke("close"):f.invoke("open")).then(()=>{f.events.subscribeOnce("widget:area-rendered",(v,m)=>{c.get("widgetDOMElement")&&f.events.dispatch("widget:modal-opened",{name:f.name,ref:p})})})};f.state===bn.Deactivated?f.activate(s).then(()=>f.invoke("attach")).then(g):g()}},u=d=>{d.key==="Enter"&&(d.preventDefault(),h(d))};return o.createElement(_t,{className:L(t,"humany-widget-link"),onKeyDown:u,onClick:d=>{n(d),h(d)},...i,ref:a},e)});o.forwardRef(({portalId:t="humany-widget-overlay-portal",className:e,children:n},r)=>{const s=he(),i=o.useMemo(()=>{if(!s)return null;const a=s.get("widgetDOMElement");return!a||!a.childElementCount?null:a.children[0]},[s]);return i?o.createElement(Vt,{elementId:t,parent:i},o.createElement(to,{className:L("humany-widget-overlay-outlet",e),ref:r},n)):null});const to=y.div`
607
- background-color: #ffffff;
608
- position: absolute;
609
- top: 0;
610
- left: 0;
611
- bottom: 0;
612
- right: 0;
613
- z-index: 10;
614
- width: 100%;
615
- height: 100%;
616
- `;y.div`
617
- background-color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.warning}};
618
- color: #ffffff;
619
- padding: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}} ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}};
620
- margin: 0 0 ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}} 0;
621
- border-radius: ${t=>t.theme.borderRadius};
622
-
623
- ${t=>{var e,n;return zt(t)("h3",$.css`
624
- margin: 0 0 ${(e=t.theme.sizes)==null?void 0:e.normal} 0;
625
- font-size: ${(n=t.theme.fonts)==null?void 0:n.normal};
626
- `)}}
627
- `;y(Ft)`
628
- ${jn}
629
- li {
630
- font-weight: 300;
631
- }
632
-
633
- > li {
634
- white-space: normal;
635
- }
636
- `;o.createContext(()=>{});y.div`
637
- textarea:focus-visible,
638
- input:focus-visible,
639
- select:focus-visible {
640
- ${W}
641
- }
642
- button:focus-visible {
643
- ${W}
644
- background-color: transparent;
645
- }
646
- `;y.label`
647
- display: block;
648
- position: relative;
649
- padding-left: 35px;
650
- margin-bottom: 12px;
651
- cursor: pointer;
652
- user-select: none;
653
- font-weight: 300;
654
- white-space: normal;
655
- word-break: break-word;
656
-
657
- input {
658
- position: absolute;
659
- opacity: 0;
660
- cursor: pointer;
661
- height: 0;
662
- width: 0;
663
-
664
- &:checked {
665
- ~ .check {
666
- background-color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
667
- border: ${t=>t.theme.inputBorder};
668
-
669
- &:after {
670
- display: block;
671
- }
672
- }
673
- }
674
-
675
- &:focus-visible {
676
- ~ .check {
677
- ${W}
678
- }
679
- }
680
- }
681
-
682
- .check:after {
683
- content: '';
684
- position: absolute;
685
- display: none;
686
- }
687
- `;y.span`
688
- position: absolute;
689
- top: 0;
690
- left: 0;
691
- height: 18px;
692
- width: 18px;
693
- background-color: #ffffff;
694
- border: ${t=>t.theme.inputBorder};
695
- border-radius: 3px;
696
-
697
- &:after {
698
- left: 6px;
699
- top: 3px;
700
- width: 4px;
701
- height: 9px;
702
- border: solid #ffffff;
703
- border-width: 0 2px 2px 0;
704
- transform: rotate(45deg);
705
- }
706
-
707
- && {
708
- box-sizing: content-box;
709
- }
710
- `;const no=({isRequired:t})=>t?o.createElement(oo,null,"*"):null,Jn=({title:t,required:e,children:n,error:r,elementId:s="",description:i="",className:a="",ui:{component:c,error:l}={}})=>{const h=o.createElement(no,{isRequired:e});return o.createElement(ro,{className:L(a,"humany-form-component"),"data-type":c,"data-error":r},s.length?o.createElement("label",{htmlFor:s,className:"humany-form-component-title"},t,h):o.createElement(io,{className:"humany-form-component-title"},t,h),n,l&&o.createElement(ao,{id:`${s}_error`},o.createElement(xe,{size:19,symbol:{type:"Svg",content:"alert"}}),o.createElement("span",null,l)),i&&o.createElement(so,{className:"humany-form-component-description"},i))},ro=y.div`
711
- ${t=>t["data-type"]==="AntiSpam"&&"display: none;"}
712
- > label {
713
- display: block;
714
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
715
- margin: 0 0 10px 0;
716
- font-weight: normal;
717
- }
718
- ${t=>{var e;return t["data-error"]&&$.css`
719
- > input,
720
- > textarea,
721
- > select {
722
- border-color: ${(e=t.theme.colors)==null?void 0:e.warning};
723
- }
724
- `}}
725
- &:not(:last-child) {
726
- margin: 0 0 ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}} 0;
727
- }
728
- label {
729
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
730
- }
731
- `,so=y(It)`
732
- margin: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}} 0 0 0;
733
- display: block;
734
- font-weight: 300;
735
- `,io=y(It)`
736
- display: block;
737
- font-size: 18px;
738
- margin: 0 0 10px 0;
739
- `,oo=y.strong`
740
- margin: 0 0 0 5px;
741
- display: inline-block;
742
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.warning}};
743
- `,ao=y.div`
744
- && {
745
- margin: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}} 0 0 0;
746
- }
747
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.warning}};
748
- display: flex;
749
- align-items: center;
750
- font-weight: 300;
751
-
752
- svg {
753
- margin-right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.small}};
754
-
755
- circle {
756
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.warning}};
757
- }
758
- }
759
- `;y(Jn)`
760
- font-weight: 300;
761
-
762
- input {
763
- margin: 0 5px 0 0;
764
- cursor: pointer;
765
- vertical-align: middle;
766
- }
767
- a {
768
- text-decoration: none;
769
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.link}};
770
- }
771
- label {
772
- display: inline;
773
- margin-right: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
774
- }
775
- `;const qt=t=>{var e,n,r;return $.css`
776
- border: ${t.theme.inputBorder};
777
- border-radius: ${t.theme.borderRadius};
778
- padding: ${(e=t.theme.sizes)==null?void 0:e.normal};
779
- width: 100%;
780
- font-size: 16px;
781
- box-sizing: border-box;
782
- &:focus {
783
- border-color: ${(n=t.theme.colors)==null?void 0:n.primary};
784
- }
785
- ${t["data-focused"]?`border-color: ${(r=t.theme.colors)==null?void 0:r.primary}`:""}
786
- `};y(li)`
787
- ${qt}
788
- ${t=>t["data-type"]==="textarea"&&$.css`
789
- resize: vertical;
790
- min-height: 100px;
791
- `}
792
- `;y(Ft)`
793
- ${t=>jn(t)}
794
- li {
795
- display: flex;
796
- align-items: center;
797
- }
798
-
799
- input {
800
- margin: 0 5px 0 0;
801
- cursor: pointer;
802
- }
803
-
804
- label {
805
- cursor: pointer;
806
- }
807
- `;y.div`
808
- margin-top: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
809
- display: flex;
810
- flex-direction: row;
811
- span {
812
- text-align: center;
813
- align-self: center;
814
- margin: 0 5px;
815
- font-size: 1.5em;
816
- }
817
- `;y.select`
818
- ${t=>qt(t)}
819
- font-family: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.type}};
820
-
821
- option {
822
- font-weight: 300;
823
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
824
- }
825
- `;y.div`
826
- padding: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
827
- border: ${t=>t.theme.inputBorder};
828
- border-radius: ${t=>t.theme.borderRadius};
829
- `;y.div`
830
- display: flex;
831
- flex-direction: row;
832
- width: 100%;
833
- justify-content: space-between;
834
- overflow: hidden;
835
- text-overflow: ellipsis;
836
- white-space: nowrap;
837
- margin-bottom: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
838
- `;y.div`
839
- display: flex;
840
- flex-direction: row;
841
- width: 100%;
842
- justify-content: space-between;
843
- `;y.p`
844
- margin: 0;
845
- line-height: 2em;
846
- border: ${t=>t.theme.inputBorder};
847
- &:hover {
848
- background-color: rgba(0, 0, 0, 0.1);
849
- }
850
- ${t=>{var e;return t["data-current"]&&`border-color: ${(e=t.theme.colors)==null?void 0:e.link};`}}
851
- ${t=>{var e,n;return t["data-selected"]&&`
852
- background-color: ${(e=t.theme.colors)==null?void 0:e.link};
853
- color: #FFF;
854
- border-color: ${(n=t.theme.colors)==null?void 0:n.link}
855
- `}}
856
- `;y(re)`
857
- flex: 1 0 0;
858
- text-align: center;
859
- margin-top: 5px;
860
- font-weight: bold;
861
- text-decoration: none;
862
- border-radius: 0;
863
- ${t=>t.disabled&&`
864
- pointer-events: none;
865
- opacity: .5;
866
- `}
867
- &:first-of-type > .humany-date-picker-week-item-date {
868
- border-top-left-radius: ${t=>t.theme.borderRadius};
869
- border-bottom-left-radius: ${t=>t.theme.borderRadius};
870
- }
871
- &:last-of-type > .humany-date-picker-week-item-date {
872
- border-top-right-radius: ${t=>t.theme.borderRadius};
873
- border-bottom-right-radius: ${t=>t.theme.borderRadius};
874
- }
875
- `;y.p`
876
- margin-bottom: 5px;
877
- `;y(re)`
878
- flex: 1 0 auto;
879
- align-self: flex-end;
880
- text-align: right;
881
- `;y(re)`
882
- flex: 1 0 auto;
883
- align-self: flex-start;
884
- text-align: left;
885
- `;y.select`
886
- ${t=>qt(t)}
887
- font-family: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.type}};
888
-
889
- option {
890
- font-weight: 300;
891
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.normal}};
892
- }
893
- `;y.fieldset`
894
- border: none;
895
- margin: 0;
896
- padding: 0;
897
- white-space: normal;
898
- legend {
899
- display: block;
900
- font-size: ${t=>{var e;return(e=t.theme.fonts)==null?void 0:e.medium}};
901
- line-height: 29px;
902
- margin: 0 0 15px 0;
903
- font-weight: normal;
904
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
905
- }
906
- > span {
907
- margin: 15px 0 0 0;
908
- display: block;
909
- }
910
- &:not(:last-child) {
911
- margin: 0 0 15px 0;
912
- }
913
- ${t=>{var e;return t["data-type"]==="Name"&&t["data-multiline-form"]&&$.css`
914
- > div {
915
- display: grid;
916
- grid-template-columns: repeat(2, 1fr);
917
- grid-gap: ${(e=t.theme.sizes)==null?void 0:e.medium};
918
- div {
919
- margin: 0;
920
- }
921
- }
922
- `}}
923
- ${t=>{var e;return t["data-type"]==="Address"&&t["data-multiline-form"]&&$.css`
924
- > div {
925
- display: grid;
926
- grid-template-columns: repeat(8, 1fr);
927
- grid-gap: ${(e=t.theme.sizes)==null?void 0:e.medium};
928
- div {
929
- margin: 0;
930
- &:nth-child(1) {
931
- grid-column: span 6;
932
- }
933
- &:nth-child(2) {
934
- grid-column: span 2;
935
- }
936
- &:nth-child(3) {
937
- grid-column: span 3;
938
- }
939
- &:nth-child(4) {
940
- grid-column: span 5;
941
- }
942
- }
943
- }
944
- `}}
945
- `;const co=1e7,ot={fileName:null,fileSize:null,fileType:null,error:null},lo=t=>!(t>co);class uo extends o.Component{constructor(){super(...arguments),this.state=ot,this.handleFileLoad=e=>{const n=this.reader.result;this.props.prompt(n,{fileName:this.state.fileName})},this.handleFileChange=e=>{const n=this.input.files[0];if(n){if(!lo(n.size)){const r=this.props.componentInstanceProps?this.props.componentInstanceProps.fileSizeErrorLabel:"Attached file exceeds maximum file size.";this.setState({...ot,error:r}),this.input.value=null,this.props.prompt("",{fileName:""});return}this.setState({...ot,fileName:n.name,fileSize:n.size,fileType:n.type},()=>{this.reader.readAsDataURL(n)})}}}componentDidMount(){this.reader=new FileReader,this.reader.addEventListener("load",this.handleFileLoad,!1)}componentWillUnmount(){this.reader.removeEventListener("load",this.handleFileLoad)}render(){const{id:e,required:n,disabled:r,accessibility:s={},className:i="",title:a="",placeholder:c="",value:l="",...h}=this.props,u=this.state.fileName?o.createElement(It,null,this.state.fileName):this.props.componentInstanceProps&&this.props.componentInstanceProps.fileUploadHeader?o.createElement("em",null,this.props.componentInstanceProps.fileUploadHeader):null;return o.createElement(ho,{elementId:e,title:a,required:n,className:L(i,"humany-form-component-file"),id:e,disabled:r,value:l,...h},this.state.error&&o.createElement(mo,{className:"humany-file-error"},this.state.error),o.createElement(fo,{id:e,type:"file",placeholder:c,"aria-label":c,disabled:r,ref:d=>{this.input=d},onChange:this.handleFileChange,...s}),o.createElement(po,{htmlFor:e,role:"button"},a),u)}}uo.contextTypes={texts:()=>null};const ho=y(Jn)`
946
- font-weight: 300;
947
- em {
948
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
949
- }
950
- `,fo=y.input`
951
- width: 0px;
952
- height: 0.1px;
953
- opacity: 0;
954
- overflow: hidden;
955
- position: absolute;
956
- z-index: -1;
957
-
958
- &:focus-visible + label {
959
- ${W}
960
- background-color: transparent;
961
- }
962
- `,mo=y.div`
963
- color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.warning}};
964
- padding-bottom: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
965
- `,po=y.label`
966
- ${Fn}
967
- && {
968
- display: inline-block;
969
- margin: 0 ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.medium}} 0 0;
970
- color: #ffffff;
971
- }
972
- background-color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
973
- min-width: 100px;
974
- `;y.div`
975
- display: flex;
976
- align-items: center;
977
- flex-flow: row nowrap;
978
-
979
- > span {
980
- z-index: 3;
981
- white-space: nowrap;
982
- width: 100%;
983
- padding-left: ${t=>{var e;return(e=t.theme.sizes)==null?void 0:e.normal}};
984
- pointer-events: none;
985
- color: rgba(0, 0, 0, 0.4);
986
- }
987
-
988
- input {
989
- flex: none;
990
- margin-left: -100%;
991
- text-indent: 50px;
992
- }
993
- `;y.label`
994
- display: block;
995
- position: relative;
996
- padding-left: 35px;
997
- margin-bottom: 12px;
998
- cursor: pointer;
999
- user-select: none;
1000
- font-weight: 300;
1001
- white-space: normal;
1002
- word-break: break-word;
1003
-
1004
- input {
1005
- position: absolute;
1006
- opacity: 0;
1007
- cursor: pointer;
1008
-
1009
- &:checked {
1010
- ~ .check {
1011
- background-color: #ffffff;
1012
- border: 1px solid ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
1013
-
1014
- &:after {
1015
- display: block;
1016
- }
1017
- }
1018
- }
1019
-
1020
- &:focus-visible {
1021
- ~ .check {
1022
- ${W}
1023
- }
1024
- }
1025
- }
1026
- `;y.span`
1027
- position: absolute;
1028
- top: 0;
1029
- left: 0;
1030
- height: 18px;
1031
- width: 18px;
1032
- border-radius: 50%;
1033
- border: ${t=>t.theme.inputBorder};
1034
-
1035
- &:after {
1036
- content: '';
1037
- position: absolute;
1038
- display: none;
1039
- }
1040
-
1041
- &:after {
1042
- top: 5px;
1043
- left: 5px;
1044
- width: 8px;
1045
- height: 8px;
1046
- border-radius: 50%;
1047
- background: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
1048
- }
1049
-
1050
- && {
1051
- box-sizing: content-box;
1052
- }
1053
- `;y(re)`
1054
- ${Fn}
1055
- display: block;
1056
- background-color: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.primary}};
1057
- color: #ffffff;
1058
- margin: 0 0 0 auto;
1059
- min-width: 100px;
1060
- `;const se=t=>{if(t){const{Type:e,Content:n}=t;if(e&&n)return{type:e,content:n}}},gt=t=>t.map(e=>{const n={id:e.Id.toString(),title:e.Name,symbol:se(e.DefaultIcon),activeSymbol:e.ActiveIcon&&se(e.ActiveIcon),description:e.Description||e.Attributes&&e.Attributes.description||"",matches:e.GuidesCount};return e.Children&&e.Children.length&&(n.items=gt(e.Children)),n}),K=(t,e)=>t.filter(({Type:n})=>n===e).map(({Id:n,Title:r,Body:s})=>({id:n.toString(),title:r,body:s})),at=t=>t.map(({Id:e,Title:n,DefaultIcon:r,ListNotices:s,Notices:i})=>({id:e.toString(),title:n,symbol:se(r),defaultHeaderOptions:{visible:!!s.length},notifications:(s||[]).concat(i||[]).map(({Id:a,Title:c,Body:l,Type:h,Modified:u})=>({id:a.toString(),title:c,body:l,modified:u,expandable:h==="listNotice"}))})),ct=({Id:t,Title:e,DefaultIcon:n,Exits:[r],ExitType:s,ConfirmationText:i,ExpandFormAutomatically:a,Form:c,Description:l},h)=>{const{Adapter:u}=r||{Adapter:{}},{ClientName:d="",Settings:f={},CustomClientName:p=""}=u,g={id:t.toString(),title:e,description:l,symbol:se(n),clientName:d==="custom.adapter"?p:d,expanded:!0,inline:!0,body:{}};if(d.indexOf("phone")>-1||d.indexOf("freetext")>-1){const{displayTextBeforeClick:v,textBeforeClick:m}=f;v==="true"&&(g.expanded=!1,g.title=m),d.indexOf("phone.text")>-1?g.body.phoneNumber=f.phoneNumber:g.body.freetext=f.freetext}return(d.indexOf("chat.popup")>-1||d.indexOf("link")>-1||d==="custom.adapter"&&s==="custom")&&(g.body=f,g.body.confirmationFallback=i),d.indexOf("ace")>-1&&(g.body=f),c&&c.HasValueComponents&&(h?g.body.form=ne.fromLegacyForm(t.toString(),c,h).get():g.body.form=ne.fromLegacyForm(t.toString(),c).get(),a||(g.expanded=g.inline=!1)),g},pe=(t=[])=>t.map(({Id:e,Title:n,TotalMatches:r,Symbol:s,DefaultIcon:i,ActiveIcon:a})=>({id:e.toString(),title:n,matches:r,symbol:se(i||s),defaultIcon:se(i),activeIcon:se(a)})),lt=t=>t.map(({Id:e,Title:n,Tags:r,FirstPublishedDate:s,Modified:i})=>({id:e.toString(),title:n,tags:pe(r),published:s,modified:i})),go=(t,e)=>{switch(t){case j.MatchByCategory:case j.Match:{const n={guides:[],matches:0,topNotifications:[],middleNotifications:[],bottomNotifications:[],notificationLists:[],tags:[],byCategory:[]},{Matches:r,TotalMatches:s,Notices:i,NoticeLists:a,Tags:c,ByCategory:l}=e;return n.guides=lt(r),n.matches=s,n.byCategory=(l||[]).map(({Id:h,Matches:u,TotalMatches:d})=>({id:h,guides:lt(u),matches:d})),n.tags=pe(c),n.notificationLists=at(a||[]),n.topNotifications=K(i||[],"noticeRowTop"),n.middleNotifications=K(i||[],"noticeRowMiddle"),n.bottomNotifications=K(i||[],"footerNotice"),n}case j.Categories:{const{Children:n,GuidesCountTotal:r}=e;return{categories:gt(n||[]),matches:r}}case j.Guide:{const{Id:n,Title:r,Body:s,Related:i,Options:a,ConnectionId:c,ContactMethods:l,EnableFeedback:h,HandoverExists:u,FirstPublishedDate:d,Modified:f,ModifiedByDisplayName:p,FirstPublishedByDisplayName:g,Categories:v,Tags:m,SeoMetaDescription:b,SeoAllowIndex:w,Perspectives:E,PerspectiveKey:C,Translations:k}=e,I=C||Object.values(E).find(S=>S===c)||E.Default||null,P={guide:{id:n.toString(),title:r,body:s,modified:f,published:d,modifiedBy:p,publishedBy:g,connection:c,categories:v,hasHandover:u,allowFeedback:h,seoMetaDescription:b,seoAllowIndex:w,perspectives:E,perspective:I,translations:Object.keys(k||{}).reduce((S,T)=>(S[T]=k[T].toString(),S),{})},related:lt(i||[]),dialog:[],contactMethods:(l||[]).map(S=>ct(S)),tags:pe(m)};return(a||[]).forEach(({CanAccess:S,Description:T,ConnectionId:Z,Properties:O})=>{if(!S)return;const R={id:n.toString(),title:T,connection:Z,connectionKey:O.ConnectionKey,type:Pe.default,parent:{id:n.toString(),title:r,tags:pe(m)}};if(O.Type==="Guide"||O.Type==="Link")switch(O.Id&&(R.id=O.Id.toString()),O.Uri&&(R.href=O.Uri),O.Target&&(R.target=O.Target),O.Type){case"Guide":R.type=Pe.guide;break;case"Link":R.type=Pe.link;break}P.dialog.push(R)}),P}case j.Contacts:{const{Children:n,Matches:r,Notices:s,NoticeLists:i}=e;return{contactMethods:(r||[]).map(c=>ct(c)),categories:gt(n||[]),topNotifications:K(s||[],"noticeRowTop"),middleNotifications:K(s||[],"noticeRowMiddle"),bottomNotifications:K(s||[],"footerNotice"),notificationLists:at(i||[])}}case j.ContactMethod:{const{ContactMethod:n}=e;return ct(n||{})}case j.Tags:case j.TagsOnGuides:return pe(e||[]);case j.Notifications:{const{Notices:n,NoticeLists:r}=e;return{topNotifications:K(n||[],"noticeRowTop"),middleNotifications:K(n||[],"noticeRowMiddle"),bottomNotifications:K(n||[],"footerNotice"),notificationLists:at(r||[])}}default:return{}}};var Qn=(t=>(t.Guide="guide",t.Guides="guides",t.GuidesByCategory="guides-by-category",t.RowNotifications="row-notices",t.NotificationLists="notification-lists",t.GuideCategories="guide-categories",t.ContactMethodCategories="contact-method-categories",t.ContactMethod="contact-method",t.ContactMethods="contact-methods",t.Tags="tags",t.TagsOnGuides="tagsonguides",t))(Qn||{}),j=(t=>(t.Match="match",t.Categories="categories",t.Guide="guide",t.Contacts="contacts",t.ContactMethod="contact-method",t.MatchByCategory="match-by-category",t.Tags="tags",t.TagsOnGuides="tagsonguides",t.Notifications="notifications",t))(j||{});const mn=t=>{switch(t){case"guides":return"match";case"guides-by-category":return"match-by-category";case"guide":return"guide";case"guide-categories":return"categories";case"contact-method-categories":case"contact-methods":return"contacts";case"contact-method":return"contact-method";case"tags":return"tags";case"tagsonguides":return"tagsonguides";case"notification-lists":case"row-notices":return"notifications";default:throw"error"}},yo=async t=>{const{invoke:e}=t.get("$widget");return await e("renderState")===be.hidden};class ye{constructor(e,n){this.container=e,this.matchingClient=n,this.queries=new Map,this.lastTake=0,this.getUnresolvedQueries=()=>{let r=0;return this.queries.forEach((s,i)=>{s.some(c=>!c.resolved)&&(r=1)}),r},this.events=e.get("$widget").events,this.events.subscribe("widget:settings-updated",()=>this.queries=new Map),this.events.subscribe("widget:render-state-changed",(r,{next:s,previous:i})=>{i===be.hidden&&s===be.open&&this.fetchAllUnresolvedQueries()})}static getInstance(e,n="dataClient"){return we(this)(()=>e.getAsync(n).then(async r=>{let s=await e.getAsync("matchingClient");s||(s=await ln(e),e.registerAsync("matchingClient",()=>s));let i=r;return i||(i=new ye(e,s),e.registerAsync(n,()=>i)),i}))}fetch(e,n,r){return new Promise((s,i)=>{n.take&&(this.lastTake=+(n.take||0)),Br(n);const a=mn(e);let c=this.queries.get(a)||[],l=c.find(h=>Ae(h.params,n))||null;if(l&&(r!=null&&r.noCache)){const h=c.findIndex(u=>Ae(u.params,n));c=[...c.slice(0,h),...c.slice(h+1)],l=null}if(l){const h=c.indexOf(l);if(l.resolved?(this.events.dispatch("data-client:fetched",{params:n,type:a,response:l.data,unresolvedQueries:this.getUnresolvedQueries()}),this.track(l.data,a,l.error),l.data&&l.error?i({error:l.error}):s(l.data)):l.resolvers.push({resolve:s,reject:i}),c.splice(h,1),c.push(l),this.queries.set(a,c),!l.loading&&!l.resolved)return this.runQuery(a,n)}else return c.push({params:n,resolved:!1,loading:!0,data:{},resolvers:[{resolve:s,reject:i}]}),this.queries.set(a,c),this.runQuery(a,n)}).then(s=>Et(s))}read(e,n){const{select:r}=n,s=mn(e);return(this.queries.get(s)||[]).reduce((c,l)=>{if(typeof r=="function"){const h=r(l.data);h&&c.push(h)}else c.push(l.data);return c},[])}feedback(e,n,r){return this.matchingClient.giveFeedback(e,n,r)}setLoadingStatus(e,n,r){const s=this.queries.get(e)||[],i=s.find(a=>Ae(a.params,n));i&&(i.loading=r),this.queries.set(e,s)}async runQuery(e,n){const{searchPhrase:r="",categories:s="0",contactMethodCategoryId:i="0",contactMethodId:a="0",tagId:c=void 0,take:l=5,connection:h="",guideId:u,expandCategories:d="descendants",currentCategory:f,sorting:p="popularity-descending",guideIds:g=[]}=n,v=r.toString().trim();if(await yo(this.container))return Promise.resolve();switch(e){case"match":{const m=b=>{const[w,E]=b.split("-");return{type:new Map([["popularity","popularity"],["alphabetic","title"],["modified","lastModified"],["published","firstPublished"]]).get(w),direction:E}};return g.length?this.matchingClient.customRequest("guides","POST",{configuration:{ids:g,take:+l}}).then(b=>b&&this.handleResponse(b,e,n)):this.matchingClient.match(v,{categories:s==="0"?[]:Array.isArray(s)?s:[+s],take:+l,tags:c,sorting:m(p),ids:g}).then(b=>b&&this.handleResponse(b,e,n))}case"match-by-category":return this.matchingClient.match(v,{groupByCategory:!0,categories:s==="0"?[]:Array.isArray(s)?s:[+s],take:+l,tags:c}).then(m=>m&&this.handleResponse(m,e,n));case"guide":return this.matchingClient.getGuide(u,{connectionId:h}).then(m=>{m&&this.handleResponse(m,e,n)}).catch(m=>{const b={message:"Something went wrong.",status:m.status||400};b.status===404&&(b.message="The guide could not be found."),this.handleResponse({},e,n,b)});case"categories":return this.matchingClient.getCategories({phrase:v,expand:d,tags:c}).then(m=>m&&this.handleResponse(m,e,n));case"contacts":return u?this.matchingClient.contactMethods(+u,{phrase:v}).then(m=>m&&this.handleResponse(m,e,n)):this.matchingClient.contacts(+i,{phrase:v}).then(m=>m&&this.handleResponse(m,e,n));case"contact-method":return this.matchingClient.getContactMethod(+a,{guideId:u,currentCategory:f}).then(m=>m&&this.handleResponse(m,e,n));case"tags":return this.matchingClient.customRequest("tags","GET",{configuration:{take:999999,phrase:v,categories:s==="0"?[]:Array.isArray(s)?s:[+s]}}).then(m=>m&&this.handleResponse(m,e,n));case"tagsonguides":return this.matchingClient.customRequest("tagsonguides","GET",{configuration:{take:999999,phrase:v,categories:s==="0"?[]:Array.isArray(s)?s:[+s],tags:c}}).then(m=>m&&this.handleResponse(m,e,n));case"notifications":return this.matchingClient.customRequest("notices","GET",{configuration:{phrase:v,categories:s==="0"?[]:Array.isArray(s)?s:[+s]}}).then(m=>m&&this.handleResponse(m,e,n))}}handleResponse(e={},n,r,s){const i=this.queries.get(n)||[],a=i.find(c=>Ae(c.params,r));if(a){const c=s||go(n,e);this.track(c,n,s),a.resolvers.forEach(h=>{s?h.reject({error:c}):h.resolve(c)});const l=i.indexOf(a);l>-1&&i.splice(l,1),i.push({...a,error:s,resolvers:[],data:c,resolved:!0}),this.setLoadingStatus(n,r,!1),this.queries.set(n,i),s||this.events.dispatch("data-client:fetched",{type:n,params:r,response:c,unresolvedQueries:this.getUnresolvedQueries()})}}fetchAllUnresolvedQueries(){for(const[e,n]of this.queries)n.filter(r=>!r.resolved).forEach(r=>{this.runQuery(e,r.params)})}track(e={},n,r){const s=this.container.get("$widget");s&&!r?s.events.dispatch("tracking:service-client-response",{type:n,data:e}):s&&s.events.dispatch("tracking:service-client-error",{type:n,error:r})}static create(e){return e.getAsync("matchingClient").then(async n=>{if(n)return new ye(e,n);const r=await ln(e);return e.registerAsync("matchingClient",()=>r),new ye(e,r)})}getClient(){return this.matchingClient}}const pn="misc-behavior:hideBackValue",vo=async(t,e)=>{const n=(s,i)=>ye.getInstance(t).then(a=>a.fetch(Qn.ContactMethodCategories,{}).then(c=>{if(c){const{categories:l=[],contactMethods:h=[]}=c;if(i===null)return i=l.length===0&&h.length===1,Lt(s.container,pn,z.Functional).then(u=>u(i))}})),{events:r}=t.get("$widget");return r.subscribe("widget:render-state-changed",async(s,i)=>{if(s.target.state==="activated"&&i.next==="open"){const{hideBackOnSingleContactMethod:a}=e;let c;const l=t.get("$widget"),{name:h,implementation:u}=l;if(h.endsWith("_contact")?c=u.widgets.get(h.replace("_contact","")):h.endsWith("_contact-method")||(c=l),c){let d=null;const f=await Nt(c.container,pn),g=(await c.container.getAsync("components")).components().ofType("widget-header").select();typeof f=="boolean"?d=f:a&&await n(c,d),(a||typeof d=="boolean")&&(d&&g.actions.dispatch("show-back",!1),g.actions.watch("show-back",(v,m)=>m(d&&v?!1:v)))}}}),[]},bo=t=>t.reduce((e,n)=>{if(e)return e;const[r]=Array.from((n==null?void 0:n.getElementsByClassName("humany-quick-filter-dropdown"))||[]);return!!r},!1),wo=t=>t.reduce((e,n)=>{if(e)return e;const[r]=Array.from((n==null?void 0:n.getElementsByTagName("input"))||[]);return!!(r&&r===document.activeElement)},!1),Co=()=>Array.from(document.querySelectorAll('[data-component-type="guide-list"]')).reduce((t,e)=>(Array.from(e.getElementsByTagName("a")).forEach(r=>t.push(r)),t),[]),xo=async(t,e)=>{const{searchToGuideListArrowKeyNavigation:n=!1}=e;return n?t.getAsync("components").then(r=>{const{nodes:{all:s}}=r,i=s.filter(c=>c.type==="search").map(c=>c.id),a=[];return a.push({parent:window,type:"keydown",handler:c=>{var p,g,v,m;const l=[];i.forEach(b=>{const w=document.getElementById(b);w&&l.push(w)});const h=bo(l),u=wo(l),d=Co(),f=d.indexOf(document.activeElement);(c.key==="ArrowDown"||c.key==="ArrowUp")&&(u||f>-1)&&c.preventDefault(),c.key==="ArrowDown"&&u&&!h?d[0].focus():c.key==="ArrowUp"&&f===0?(g=(p=l[0])==null?void 0:p.getElementsByTagName("input")[0])==null||g.focus():c.key==="ArrowUp"&&f>-1?(v=d[f-1])==null||v.focus():c.key==="ArrowDown"&&f>-1&&((m=d[f+1])==null||m.focus())}}),a}):Promise.resolve([])};class Eo extends $t{constructor(e,n={}){super(e),this.settings=n,this.listeners=[]}async initialize(){this.listeners=await Promise.all([Promise.resolve(vo(this.container,this.settings)),Promise.resolve(fs(this.container,this.settings)),Promise.resolve(xo(this.container,this.settings))]).then(e=>{const n=[];return e.forEach(r=>r.forEach(s=>n.push(s))),n.forEach(({parent:r,type:s,handler:i})=>{r.addEventListener(s,i)}),n})}deactivate(){this.listeners.forEach(e=>{const{parent:n,handler:r,type:s}=e;n.removeEventListener(s,r)})}}exports.FavoritePlugin=cs;exports.LegacyResourcesPlugin=ds;exports.MiscBehaviorPlugin=Eo;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@telia-ace/knowledge-widget-core"),u=require("@telia-ace/widget-services"),P=require("@telia-ace/knowledge-resource-loader"),A=require("@telia-ace/knowledge-data-client"),L="favorites",E=async n=>await u.createStorageWriter(n,L,u.StorageCategory.Necessary,{medium:u.StorageMedium.Local}),k=async n=>await u.readStorage(n,L,u.StorageMedium.Local)||[],b=async(n,e)=>{const s=await E(e),o=await k(e);if(o.indexOf(n)>-1)return o;const a=o.concat(n);return s(a),a},x=async(n,e)=>{const s=await E(e),a=(await k(e)).filter(i=>i!==n);return s(a),a},M=async n=>{try{return await k(n)}catch{return[]}},T=async n=>((await E(n))([]),[]),v=(n,e)=>{const{updated:s}=e,{events:o}=n.get("$widget");o.dispatch("widget:favorites-updated",{updated:s})},B=n=>{let e=[];const s=()=>{M(n).then(t=>{e=t})},o=()=>e,a=async t=>{const r=await b(t,n);return e=r,v(n,{updated:r}),r},i=async()=>{const t=await T(n);return e=t,v(n,{updated:t}),t},c=async t=>{const r=await x(t,n);return e=r,v(n,{updated:r}),r};return s(),{add:a,get:o,clear:i,remove:c}};class O extends w.Plugin{constructor(e,s){super(e),this.settings=s,this.handler=B(e),e.register("favorites",this.handler)}}const D=n=>{const e=document.createElement("a");return e.href=n,`//${e.hostname}/`};class N extends w.Plugin{constructor(e,s={}){super(e),this.widget.events.subscribeOnce("widget:attached",()=>{var i,c;const{data:{projection:o}}=this.container.get("$settings");if(o){const t=D(o),r=new P.ResourceLoader;r.add(`${t}ClientLibraries/Supplementary/font-awesome-4.7.0/css/font-awesome.min.css`),r.add(`${t}${(i=this.container.parent)==null?void 0:i.name}/widgets.css`),r.load()}const{initialCss:a=""}=s;if(a.length){const t=document.createElement("style"),r=((c=window.webprovisionsEnvironmentVariables)==null?void 0:c.cspNonce)||void 0;r&&(t.nonce=r,t.setAttribute("nonce",r)),t.innerHTML=a,document.head.appendChild(t)}})}}const $=async(n,e)=>{const{denyAutoExpandContactMethods:s}=e;if(s){const o=new RegExp(s);w.extendComponent(n,"contact-list",a=>{a.properties(({contactMethods:i=[]})=>{const c=i.filter(({clientName:t})=>o.test(t));if(c.length)return c.forEach(t=>{t.expanded=!1,t.inline=!1}),{contactMethods:i}})})}return[]},C="misc-behavior:hideBackValue",q=async(n,e)=>{const s=(a,i)=>A.DataClient.getInstance(n).then(c=>c.fetch(A.DataType.ContactMethodCategories,{}).then(t=>{if(t){const{categories:r=[],contactMethods:g=[]}=t;if(i===null)return i=r.length===0&&g.length===1,u.createStorageWriter(a.container,C,u.StorageCategory.Functional).then(f=>f(i))}})),{events:o}=n.get("$widget");return o.subscribe("widget:render-state-changed",async(a,i)=>{if(a.target.state==="activated"&&i.next==="open"){const{hideBackOnSingleContactMethod:c}=e;let t;const r=n.get("$widget"),{name:g,implementation:f}=r;if(g.endsWith("_contact")?t=f.widgets.get(g.replace("_contact","")):g.endsWith("_contact-method")||(t=r),t){let d=null;const l=await u.readStorage(t.container,C),h=(await t.container.getAsync("components")).components().ofType("widget-header").select();typeof l=="boolean"?d=l:c&&await s(t,d),(c||typeof d=="boolean")&&(d&&h.actions.dispatch("show-back",!1),h.actions.watch("show-back",(m,p)=>p(d&&m?!1:m)))}}}),[]},H=n=>n.reduce((e,s)=>{if(e)return e;const[o]=Array.from((s==null?void 0:s.getElementsByClassName("humany-quick-filter-dropdown"))||[]);return!!o},!1),W=n=>n.reduce((e,s)=>{if(e)return e;const[o]=Array.from((s==null?void 0:s.getElementsByTagName("input"))||[]);return!!(o&&o===document.activeElement)},!1),R=()=>Array.from(document.querySelectorAll('[data-component-type="guide-list"]')).reduce((n,e)=>(Array.from(e.getElementsByTagName("a")).forEach(o=>n.push(o)),n),[]),G=async(n,e)=>{const{searchToGuideListArrowKeyNavigation:s=!1}=e;return s?n.getAsync("components").then(o=>{const{nodes:{all:a}}=o,i=a.filter(t=>t.type==="search").map(t=>t.id),c=[];return c.push({parent:window,type:"keydown",handler:t=>{var y,h,m,p;const r=[];i.forEach(F=>{const S=document.getElementById(F);S&&r.push(S)});const g=H(r),f=W(r),d=R(),l=d.indexOf(document.activeElement);(t.key==="ArrowDown"||t.key==="ArrowUp")&&(f||l>-1)&&t.preventDefault(),t.key==="ArrowDown"&&f&&!g?d[0].focus():t.key==="ArrowUp"&&l===0?(h=(y=r[0])==null?void 0:y.getElementsByTagName("input")[0])==null||h.focus():t.key==="ArrowUp"&&l>-1?(m=d[l-1])==null||m.focus():t.key==="ArrowDown"&&l>-1&&((p=d[l+1])==null||p.focus())}}),c}):Promise.resolve([])};class I extends w.Plugin{constructor(e,s={}){super(e),this.settings=s,this.listeners=[]}async initialize(){this.listeners=await Promise.all([Promise.resolve(q(this.container,this.settings)),Promise.resolve($(this.container,this.settings)),Promise.resolve(G(this.container,this.settings))]).then(e=>{const s=[];return e.forEach(o=>o.forEach(a=>s.push(a))),s.forEach(({parent:o,type:a,handler:i})=>{o.addEventListener(a,i)}),s})}deactivate(){this.listeners.forEach(e=>{const{parent:s,handler:o,type:a}=e;s.removeEventListener(a,o)})}}exports.FavoritePlugin=O;exports.LegacyResourcesPlugin=N;exports.MiscBehaviorPlugin=I;