@telia-ace/widget-runtime-flamingo 1.1.123-rc.8 → 1.1.123
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-Cz3Sz1kR.mjs → index-DPP20EVG.mjs} +430 -431
- package/{index-VZwzuJ8Y.js → index-PiwZOlQl.js} +29 -29
- package/index.js +1 -1
- package/index.mjs +4 -4
- package/package.json +1 -1
- package/{render-C2BAGuUX.mjs → render-3WYwVT0N.mjs} +12 -12
- package/{render-C5X01J2f.js → render-dq0_cXIY.js} +4 -4
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";const Mt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},ss=i=>{const t=i.container||i;return{info:(e,...s)=>Mt(t,"info",e,...s),warn:(e,...s)=>Mt(t,"warning",e,...s),error:(e,...s)=>Mt(t,"error",e,...s)}};var st=(i=>(i.Implementation="implementation",i.Widget="widget",i))(st||{}),N=(i=>(i.Pre="pre",i.Post="post",i))(N||{});const is=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function oe(i,t){return typeof i>"u"?t:i}let ns=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:st.Widget,stage:N.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:oe(e.scope,st.Widget),stage:oe(e.stage,N.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Ee=i=>{const t=new ns({});return i(t),t.get()};Ee(i=>{i.createCommand("types.register",{scope:st.Implementation,stage:N.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:N.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:N.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:N.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=is(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ss(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function rs(i){const t={};return[].filter.call(i.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=i.getAttribute(e)),t}const os=(i,t,e)=>{const s=rs(i);e({sourceDOMElement:i,eventType:t,data:s})};function ae(i,t,e){i.forEach(s=>{s.dataset.attached!=="true"&&(os(s,t,e),s.dataset.monitored="true")})}function as(i,t,e){const s=i.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{ae(o.triggerElements,t,e)});const n=i.container.get("triggerElements");n&&ae(n,t,e)}Ee(i=>{i.createCommand("ready",{scope:st.Implementation,stage:N.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})});const Dt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},cs=i=>{const t=i.container||i;return{info:(e,...s)=>Dt(t,"info",e,...s),warn:(e,...s)=>Dt(t,"warning",e,...s),error:(e,...s)=>Dt(t,"error",e,...s)}};var yt=(i=>(i.Implementation="implementation",i.Widget="widget",i))(yt||{}),T=(i=>(i.Pre="pre",i.Post="post",i))(T||{});const hs=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function ce(i,t){return typeof i>"u"?t:i}class ls{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:yt.Widget,stage:T.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:ce(e.scope,yt.Widget),stage:ce(e.stage,T.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const Ft=i=>{const t=new ls({});return i(t),t.get()};Ft(i=>{i.createCommand("types.register",{scope:yt.Implementation,stage:T.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:T.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:T.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:T.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=hs(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){cs(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});var Ce=(i=>(i.Activating="activating",i.Loading="loading",i.Activated="activated",i.Deactivating="deactivating",i.Deactivated="deactivated",i))(Ce||{});class ds{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const xt=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),Q=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>Q.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>Q.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>Q.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>Q.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let v=Q;v.log=(...i)=>xt(console.log,...i);v.warn=(...i)=>xt(console.warn,...i);v.error=(...i)=>xt(console.error,...i);v.info=(...i)=>xt(console.info,...i);const Oe=i=>{let t={},e,s;if(typeof i!="object"||i===null)return i;t=Array.isArray(i)?[]:{};for(s in i)e=i[s],t[s]=typeof e=="object"&&e!==null?Oe(e):e;return t};function he(i){let t=0;if(i.length===0)return t.toString();for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let us=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&v.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),n=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const lt=new WeakMap;function A(i,t=5e3,e=1e3){return lt.has(i)||lt.set(i,new us(t,e)),s=>new Promise((n,r)=>{const o=lt.get(i);o.add(s,n,r,()=>{o.tasks.length||lt.delete(i)})})}const ps=(i,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let n=!1;return()=>{n||(i.get("$widget").events.dispatch("widget:data-loaded",{element:t}),n=!0)}})();if(!e())return s();new MutationObserver((n,r)=>{n.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},gs=(i,t)=>{i.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),n=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,l)=>{const d=l.getAttribute&&l.getAttribute("data-name");return d&&s.indexOf(d)>-1&&c.push(d),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!n&&s.length===0&&(n=!0,ps(i,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},S=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function ot(){return S()+S()+"-"+S()+"-"+S()+"-"+S()+"-"+S()+S()+S()}class ms{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:n,value:r,target:o})=>t===o&&e(t,n,r))}}const Se=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let K=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new fs(this.platform,this)}},Kt=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new At(t,new K(t).withId(e.id),s);const[n,r]=Se(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}};class fs{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new At(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}}const ys=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,n(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>({...d,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let At=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new Kt(this.platform,c,this.ns);return ys(h,e,l).then(d=>{const{data:u={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:o.fn(u,p,l)).then(b=>{n[c.id]=b})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};Ft(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let Wt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=ot(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&v.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})),()=>{s.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(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const Pe=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);Pe(o,t,e)}},Et=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];Pe(n,t,e)}},pt=(i,t)=>{const e=[];return Et(i,t,s=>{e.push(s)}),e},ke=(i,t,e)=>{let s;return Et(i,t,n=>{if(e(n))return s=n,!0}),s};let vs=class{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=pt(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=pt(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=pt(t,e)})}query(t={}){const e=[];return Et(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return ke(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}};class bs{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}}const ws=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},$s=i=>i.map(([t,e])=>[ws(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),Lt=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),E=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(Lt(i)&&Lt(e))for(const s in e)Lt(e[s])?(i[s]||Object.assign(i,{[s]:{}}),E(i[s],e[s])):Object.assign(i,{[s]:e[s]});return E(i,...t)},_s=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),xs=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=$s(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},g=d.context&&!p.context,b=d.properties&&!p.properties,x=d.layout&&!p.layout;a.set(l,{context:p.context||g,properties:p.properties||b,layout:p.layout||x}),b&&(l.attributes.properties={}),x&&(l.attributes.layout={}),g&&(l.attributes.context=E({},(u=l.parent)==null?void 0:u.attributes.context));const ht=[],Pt=[],kt=[];if(l.changesets.forEach($=>{const[_,Nt]=$;_s(Nt.breakpoints,i.breakpoints)&&(b&&(typeof _.properties=="function"?ht.push(_.properties):E(l.attributes.properties,_.properties)),x&&(typeof _.layout=="function"?Pt.push(_.layout):E(l.attributes.layout,_.layout)),g&&(typeof _.context=="function"?kt.push(_.context):E(l.attributes.context,_.context)))}),ht.forEach($=>{E(l.attributes.properties,$(l.attributes.properties))}),Pt.forEach($=>{E(l.attributes.layout,$(l.attributes.layout))}),kt.forEach($=>{E(l.attributes.context,$(l.attributes.context))}),g||d.recursive){const $=i.getBranch(l),_=d.recursive?d:{context:!!g};l.getChildren($).forEach(Nt=>{c(Nt,_)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class G{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new bs,this.events=t.events.createChild(this);const s=new Wt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new vs(s,this.switches,this.events);const n=this.processNode=xs(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
|
|
1
|
+
"use strict";const Dt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},is=i=>{const t=i.container||i;return{info:(e,...s)=>Dt(t,"info",e,...s),warn:(e,...s)=>Dt(t,"warning",e,...s),error:(e,...s)=>Dt(t,"error",e,...s)}};var st=(i=>(i.Implementation="implementation",i.Widget="widget",i))(st||{}),N=(i=>(i.Pre="pre",i.Post="post",i))(N||{});const ns=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function ae(i,t){return typeof i>"u"?t:i}let rs=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:st.Widget,stage:N.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:ae(e.scope,st.Widget),stage:ae(e.stage,N.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Ce=i=>{const t=new rs({});return i(t),t.get()};Ce(i=>{i.createCommand("types.register",{scope:st.Implementation,stage:N.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:N.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:N.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:N.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=ns(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){is(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function os(i){const t={};return[].filter.call(i.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=i.getAttribute(e)),t}const as=(i,t,e)=>{const s=os(i);e({sourceDOMElement:i,eventType:t,data:s})};function ce(i,t,e){i.forEach(s=>{s.dataset.attached!=="true"&&(as(s,t,e),s.dataset.monitored="true")})}function cs(i,t,e){const s=i.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{ce(o.triggerElements,t,e)});const n=i.container.get("triggerElements");n&&ce(n,t,e)}Ce(i=>{i.createCommand("ready",{scope:st.Implementation,stage:N.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})});const Lt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},hs=i=>{const t=i.container||i;return{info:(e,...s)=>Lt(t,"info",e,...s),warn:(e,...s)=>Lt(t,"warning",e,...s),error:(e,...s)=>Lt(t,"error",e,...s)}};var vt=(i=>(i.Implementation="implementation",i.Widget="widget",i))(vt||{}),T=(i=>(i.Pre="pre",i.Post="post",i))(T||{});const ls=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function he(i,t){return typeof i>"u"?t:i}class ds{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:vt.Widget,stage:T.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:he(e.scope,vt.Widget),stage:he(e.stage,T.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const Ft=i=>{const t=new ds({});return i(t),t.get()};Ft(i=>{i.createCommand("types.register",{scope:vt.Implementation,stage:T.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:T.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:T.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:T.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=ls(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){hs(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});var Oe=(i=>(i.Activating="activating",i.Loading="loading",i.Activated="activated",i.Deactivating="deactivating",i.Deactivated="deactivated",i))(Oe||{});class us{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const At=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),ot=class Q{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>Q.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>Q.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>Q.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>Q.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};ot.log=(...i)=>At(console.log,...i);ot.warn=(...i)=>At(console.warn,...i);ot.error=(...i)=>At(console.error,...i);ot.info=(...i)=>At(console.info,...i);let b=ot;const Se=i=>{let t={},e,s;if(typeof i!="object"||i===null)return i;t=Array.isArray(i)?[]:{};for(s in i)e=i[s],t[s]=typeof e=="object"&&e!==null?Se(e):e;return t};function le(i){let t=0;if(i.length===0)return t.toString();for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let ps=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&b.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),n=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const dt=new WeakMap;function A(i,t=5e3,e=1e3){return dt.has(i)||dt.set(i,new ps(t,e)),s=>new Promise((n,r)=>{const o=dt.get(i);o.add(s,n,r,()=>{o.tasks.length||dt.delete(i)})})}const gs=(i,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let n=!1;return()=>{n||(i.get("$widget").events.dispatch("widget:data-loaded",{element:t}),n=!0)}})();if(!e())return s();new MutationObserver((n,r)=>{n.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},ms=(i,t)=>{i.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),n=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,l)=>{const d=l.getAttribute&&l.getAttribute("data-name");return d&&s.indexOf(d)>-1&&c.push(d),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!n&&s.length===0&&(n=!0,gs(i,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},S=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function at(){return S()+S()+"-"+S()+"-"+S()+"-"+S()+"-"+S()+S()+S()}class fs{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:n,value:r,target:o})=>t===o&&e(t,n,r))}}const Pe=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let F=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new ys(this.platform,this)}},Gt=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new Et(t,new F(t).withId(e.id),s);const[n,r]=Pe(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}},ys=class{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new Et(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}};const vs=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,n(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>({...d,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let Et=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new Gt(this.platform,c,this.ns);return vs(h,e,l).then(d=>{const{data:u={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:o.fn(u,p,l)).then(v=>{n[c.id]=v})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};Ft(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let qt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=at(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&b.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})),()=>{s.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(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const ke=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);ke(o,t,e)}},Ct=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];ke(n,t,e)}},gt=(i,t)=>{const e=[];return Ct(i,t,s=>{e.push(s)}),e},Ne=(i,t,e)=>{let s;return Ct(i,t,n=>{if(e(n))return s=n,!0}),s};class bs{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=gt(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=gt(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=gt(t,e)})}query(t={}){const e=[];return Ct(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return Ne(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}}let ws=class{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}};const $s=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},_s=i=>i.map(([t,e])=>[$s(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),It=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),E=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(It(i)&&It(e))for(const s in e)It(e[s])?(i[s]||Object.assign(i,{[s]:{}}),E(i[s],e[s])):Object.assign(i,{[s]:e[s]});return E(i,...t)},xs=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),As=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=_s(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},g=d.context&&!p.context,v=d.properties&&!p.properties,x=d.layout&&!p.layout;a.set(l,{context:p.context||g,properties:p.properties||v,layout:p.layout||x}),v&&(l.attributes.properties={}),x&&(l.attributes.layout={}),g&&(l.attributes.context=E({},(u=l.parent)==null?void 0:u.attributes.context));const lt=[],kt=[],Nt=[];if(l.changesets.forEach($=>{const[_,Mt]=$;xs(Mt.breakpoints,i.breakpoints)&&(v&&(typeof _.properties=="function"?lt.push(_.properties):E(l.attributes.properties,_.properties)),x&&(typeof _.layout=="function"?kt.push(_.layout):E(l.attributes.layout,_.layout)),g&&(typeof _.context=="function"?Nt.push(_.context):E(l.attributes.context,_.context)))}),lt.forEach($=>{E(l.attributes.properties,$(l.attributes.properties))}),kt.forEach($=>{E(l.attributes.layout,$(l.attributes.layout))}),Nt.forEach($=>{E(l.attributes.context,$(l.attributes.context))}),g||d.recursive){const $=i.getBranch(l),_=d.recursive?d:{context:!!g};l.getChildren($).forEach(Mt=>{c(Mt,_)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class G{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new ws,this.events=t.events.createChild(this);const s=new qt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new bs(s,this.switches,this.events);const n=this.processNode=As(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
|
|
2
2
|
${o.map(a=>`${a.name||"<no name>"} (${a.id})
|
|
3
|
-
`)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[u,p]=c;l.match(o.node)&&(u.properties&&d.push(a.writeProperties(u.properties,p)),u.context&&d.push(a.writeContext(u.context,p)),u.layout&&d.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new
|
|
3
|
+
`)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[u,p]=c;l.match(o.node)&&(u.properties&&d.push(a.writeProperties(u.properties,p)),u.context&&d.push(a.writeContext(u.context,p)),u.layout&&d.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new qt(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new F(this)}actions(t,e){return new Et(this,t,e)}write(t){const{provider:e,target:s,attributes:n,options:r={},removable:o}=t,a=t.key||at(),h={changeset:[n,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,n,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};n.properties&&(l=c.writeProperties(n.properties,r,o)),n.context&&(l=c.writeContext(n.context,r,o)),n.layout&&(l=c.writeContext(n.layout,r,o)),h.removes.push(l)}}),()=>{if(o){h.removes.forEach(l=>l());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const Es=i=>{if(Array.isArray(i)){const[t,...e]=i;return{definitionId:t,overrides:e}}return{definitionId:i,overrides:[]}},bt=(i,t,e,s,n,r)=>{e.forEach(o=>{const a=Es(o),h=s[a.definitionId];if(a.definitionId==="view"){const c=i.createNode("view");c.name="view",Object.keys(n).forEach(l=>{const d=n[l];bt(i,c,[d.entry],s,n,l)}),t.appendChild(c),a.overrides.forEach(l=>{l.properties&&c.writeProperties(l.properties,{breakpoints:l.breakpoints}),l.context&&c.writeContext(l.context,{breakpoints:l.breakpoints}),l.layout&&c.writeLayout(l.layout,{breakpoints:l.breakpoints})})}else if(i.getComponentHandler(h.type)){const c=i.getComponentHandler(h.type);c&&c(a,{platform:i,node:t,references:e,definitions:s,views:n,branch:r})}else{const c=s[a.definitionId];if(process.env.NODE_ENV!=="production"&&!c){b.error(`No definition found for component type '${a.definitionId}'.`);return}const l=i.createNode(c.type);l.name=a.definitionId,l.tags=c.tags||[],c.properties&&l.writeProperties(c.properties),c.context&&l.writeContext(c.context),c.layout&&l.writeLayout(c.layout),t.appendChild(l,r),a.overrides.forEach(d=>{const u={breakpoints:d.breakpoints};d.properties&&l.writeProperties(d.properties,u),d.context&&l.writeContext(d.context,u),d.layout&&l.writeLayout(d.layout,u)}),c.children&&bt(i,l,c.children,s,n)}})},Me=(i,t)=>{const{entry:e,components:s,breakpoints:n,views:r}=t,o=[];return Object.keys(n).forEach(a=>{const h=n[a],c=window.matchMedia(h);c.matches&&i.breakpoints.push(a);const l=d=>{d.matches?i.addBreakpoint(a):i.removeBreakpoint(a)};c.addListener(l),o.push(()=>c.removeListener(l))}),bt(i,i.nodes.root,[e],s,r),()=>o.forEach(a=>{a()})},Jt=(i,t)=>({id:i.id,type:i.type,name:i.name,branch:t||"default"}),De=(i,t,e,s=at(),n={})=>i.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new F(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const l=a[c.id];return l?Promise.resolve(l.controller):G.getInstance(i).then(d=>new Gt(d,c,s))};r.events.subscribe("components:node-enter",(c,{node:l})=>{o.match(l)&&h(l).then(d=>{Promise.resolve(e(d)).then(u=>{a[l.id]={dispose:u,controller:d}})})}),r.events.subscribe("components:node-exit",(c,{node:l})=>{const d=a[l.id];d&&(d.dispose&&d.dispose(),n.reuseController||(d.controller.dispose(),delete a[l.id]))})});class Cs{constructor(t){this.aliases=new Map,this.components=new Map,this.logger=new b;const{events:e}=t.get("$widget");this.events=e}getComponent(t){const e=this.aliases.get(t),s=this.components.get(e||t)||null;return process.env.NODE_ENV!=="production"&&(s||this.logger.warn(e||t,`Unable to resolve component: "${e||t}". You most likely forgot to register the required plugin for: ${e||t}.`)),s}registerComponent(t,e){return this.components.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.components.delete(t)}}registerResolver(t,e){return this.events.subscribe("component-resolver:resolve",(s,n)=>{if(n===t){const r=this.getComponent(t);e(r)}})}registerAlias(t,e){return this.aliases.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.aliases.delete(t)}}}var w=(i=>(i.open="open",i.closed="closed",i.hidden="hidden",i))(w||{});const Yt=Object.freeze(Object.defineProperty({__proto__:null,ActionResolver:fs,ActionsController:Et,ComponentNode:qt,ComponentNodeController:Gt,ComponentPlatform:G,ComponentQuery:F,ComponentResolver:Cs,WidgetRenderState:w,asDescriptor:Jt,createChildren:bt,createComponentModel:Me,createEventSubscriber:Pe,extendComponent:De,findComponent:Ne,findVisibleComponents:gt,traverseComponents:Ct},Symbol.toStringTag,{value:"Module"}));var f=(i=>(i.Cookie="cookie",i.Local="local",i.Session="session",i))(f||{}),Y=(i=>(i.Tenant="tenant",i.Implementation="implementation",i.Widget="widget",i))(Y||{}),m=(i=>(i.Necessary="necessary",i.Functional="functional",i.Analytical="analytical",i.Marketing="marketing",i))(m||{});const P=(i,t,e,s={})=>de(i,e).then(n=>(process.env.NODE_ENV!=="production"&&n&&b.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
|
|
4
4
|
Key: ${t}
|
|
5
5
|
Category: ${JSON.stringify(e)}
|
|
6
|
-
Options: ${JSON.stringify(s)}`),r=>(
|
|
6
|
+
Options: ${JSON.stringify(s)}`),r=>(Xt(i),de(i,e).then(o=>{if(o){process.env.NODE_ENV!=="production"&&b.warn(`storageWriter: Attempted to write to storage using unallowed category.
|
|
7
7
|
Key: ${t}
|
|
8
8
|
Category: ${JSON.stringify(e)}
|
|
9
9
|
Value: ${JSON.stringify(r)}
|
|
10
|
-
Options: ${JSON.stringify(s)}`);return}const{scope:a=Y.Widget,medium:h=f.Session,duration:c}=s,l=
|
|
10
|
+
Options: ${JSON.stringify(s)}`);return}const{scope:a=Y.Widget,medium:h=f.Session,duration:c}=s,l=Ss();return l[a][t]=Qt(r,e,c),h===f.Cookie?Ms(i,l):Ls(i,h,l)})))),O=(i,t,e=f.Session)=>(Xt(i),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===f.Cookie?Ns(i).then(s=>$t(s,t)):Ds(i,e).then(s=>$t(s,t))),W=i=>!!Object.entries(i).filter(([t,e])=>typeof e<"u").length,Rt=i=>Object.entries(i).filter(([t,e])=>typeof e<"u").forEach(([t,{value:e}])=>{typeof e>"u"&&delete i[t]}),Le=(i,t)=>{const e={tenant:{...i.tenant,...t.tenant},implementation:{...i.implementation,...t.implementation},widget:{...i.widget,...t.widget}};return Rt(e.tenant),Rt(e.implementation),Rt(e.widget),e},Os=i=>Object.entries(i).reduce((t,e)=>{const[s,n]=e;return Object.entries(n).forEach(r=>{const[o,{expiration:a}]=r;a&&t.push(a)}),t},[]).slice().sort((t,e)=>new Date(e).valueOf()-new Date(t).valueOf()).shift()||St(),Ot=i=>{const{name:t,implementation:{name:e,tenant:s}}=i.get("$widget");return[`humany_${s}`,`humany_${le(s+e)}`,`humany_${le(s+e+t)}`]},Tt=i=>{const t=new RegExp(`(?:^|;)\\s?${i}=(.*?)(?:;|$)`,"i"),e=document.cookie.match(t);return e&&e[1]&&JSON.parse(e[1])||void 0},jt=(i,t,e)=>{const s=`${i}=${JSON.stringify(t).trim()}`,n=`expires=${new Date(e).toUTCString()}`,r="path=/",o="SameSite=None;Secure";return document.cookie=`${s}; ${n}; ${r}; ${o}`},Zt=i=>{const[t,e,s]=Ot(i),n=Tt(t)||{},r=Tt(e)||{},o=Tt(s)||{};return{tenant:n,implementation:r,widget:o}},Ie=(i,t)=>{const e=Zt(i),s=Le(e,t),[n,r,o]=Ot(i),{tenant:a,implementation:h,widget:c}=s,l=Os(t),d=St({days:-1});jt(n,a,W(a)?l:d),jt(r,h,W(h)?l:d),jt(o,c,W(c)?l:d)},wt=(i,t)=>{const[e,s,n]=Ot(i),r=t.getItem(e)||"{}",o=t.getItem(s)||"{}",a=t.getItem(n)||"{}";return{tenant:JSON.parse(r),implementation:JSON.parse(o),widget:JSON.parse(a)}},Kt=(i,t,e)=>{const s=wt(i,t),n=Le(s,e),[r,o,a]=Ot(i),{tenant:h,implementation:c,widget:l}=n;W(h)?t.setItem(r,JSON.stringify(h)):t.removeItem(r),W(c)?t.setItem(o,JSON.stringify(c)):t.removeItem(o),W(l)?t.setItem(a,JSON.stringify(l)):t.removeItem(a);const{events:d}=i.get("$widget");d.dispatch("storage:changed",{})},Ss=()=>({tenant:{},implementation:{},widget:{}}),Ps=i=>i?!!i&&new Date>new Date(i):!1,$t=(i,t)=>{const e=i.widget[t]||i.implementation[t]||i.tenant[t];return e==null?void 0:e.value},Qt=(i,t,e)=>e?{value:i,category:t,expiration:typeof e=="object"?St(e):e}:{value:i,category:t},mt=(i,t)=>{const e=Se(i);return Object.entries(e).forEach(([s,n])=>{Object.entries(n).forEach(([r,o])=>{const{expiration:a,category:h}=o;(Ps(a)||ks(t,h))&&(n[r]=Qt(void 0,h,a))})}),e},de=(i,t)=>O(i,"storagePolicy",f.Cookie).then((e=[m.Necessary])=>!!t&&e.indexOf(t)===-1),ks=(i=[m.Necessary],t)=>!!t&&i.indexOf(t)===-1,Xt=i=>{const t=Zt(i),e=wt(i,window.localStorage),s=wt(i,sessionStorage),n=$t(t,"storagePolicy"),[r,o,a]=[t,e,s].map(h=>mt(h,n));Ie(i,r),Kt(i,window.localStorage,o),Kt(i,window.sessionStorage,a)},St=(i={days:30})=>{const{days:t=0,hours:e=0,minutes:s=0,seconds:n=0}=i,r=new Date;return r.setTime(r.getTime()+e*60*60*1e3),r.setTime(r.getTime()+t*24*60*60*1e3),r.setTime(r.getTime()+s*60*1e3),r.setTime(r.getTime()+n*1e3),r.toISOString()},Ns=i=>A(document)(()=>Zt(i)),Ms=(i,t)=>A(document)(()=>Ie(i,t)),Ds=(i,t)=>{const e=t===f.Local?window.localStorage:window.sessionStorage;return A(e)(()=>wt(i,e))},Ls=(i,t,e)=>{const s=t===f.Local?window.localStorage:window.sessionStorage;return A(s)(()=>Kt(i,s,e))};let ft=class{constructor(){this.memory={tenant:{},implementation:{},widget:{}}}async setItem(t,e,s={}){return A(this)(()=>{const n=mt(this.memory,[m.Necessary]),{scope:r=Y.Tenant,expiration:o}=s;n[r][t]=Qt(e,m.Necessary,(o==null?void 0:o.toISOString())||St()),this.memory=n,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
|
|
11
11
|
Key: ${t}
|
|
12
12
|
Value: ${JSON.stringify(e)}
|
|
13
13
|
Options: ${JSON.stringify(s)}
|
|
14
|
-
Memory: ${JSON.stringify(n)}`)})}async getItem(t){return A(this)(()=>{const e=
|
|
14
|
+
Memory: ${JSON.stringify(n)}`)})}async getItem(t){return A(this)(()=>{const e=mt(this.memory,[m.Necessary]);process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value fetched from legacy memory storage.
|
|
15
15
|
Key: ${t}
|
|
16
|
-
Memory: ${JSON.stringify(e)}`);const s
|
|
16
|
+
Memory: ${JSON.stringify(e)}`);const s=$t(e,t);return this.memory=e,s})}async removeItem(t){return A(this)(()=>{const e=mt(this.memory,[m.Necessary]);delete e.tenant[t],delete e.implementation[t],delete e.widget[t],this.memory=e,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value removed from memory.
|
|
17
17
|
Key: ${t}
|
|
18
|
-
Memory: ${JSON.stringify(e)}`)})}async clear(){return Promise.resolve()}},
|
|
19
|
-
Passed consent: ${JSON.stringify(s)}`);return}if(Array.isArray(s)&&!s.every(r=>typeof r=="number"||typeof r=="string")){process.env.NODE_ENV!=="production"&&
|
|
20
|
-
Passed consent: ${JSON.stringify(s)}`);return}const n=[m.Necessary,m.Functional,m.Analytical,m.Marketing].filter((r,o,a)=>typeof s=="number"?s>o:typeof s=="string"?a.indexOf(s)+1>o:Array.isArray(s)?s.findIndex(h=>h===o+1||h===r)>-1:!0);return n.indexOf(m.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&
|
|
21
|
-
Passed consent: ${JSON.stringify(s)}`),n.unshift(m.Necessary)),P(t.container,"storagePolicy",m.Necessary,{medium:f.Cookie,scope:Y.Tenant,duration:{days:365}}).then(r=>r(n)).then(()=>{
|
|
18
|
+
Memory: ${JSON.stringify(e)}`)})}async clear(){return Promise.resolve()}},Is=class{constructor(){this.cookies=new ft,this.session=new ft,this.local=new ft}};Ft(i=>{i.createCommand("storage",t=>(e={})=>{const{consent:s}=e;if(typeof s<"u"){if(typeof s!="number"&&typeof s!="string"&&!Array.isArray(s)){process.env.NODE_ENV!=="production"&&b.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.
|
|
19
|
+
Passed consent: ${JSON.stringify(s)}`);return}if(Array.isArray(s)&&!s.every(r=>typeof r=="number"||typeof r=="string")){process.env.NODE_ENV!=="production"&&b.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.
|
|
20
|
+
Passed consent: ${JSON.stringify(s)}`);return}const n=[m.Necessary,m.Functional,m.Analytical,m.Marketing].filter((r,o,a)=>typeof s=="number"?s>o:typeof s=="string"?a.indexOf(s)+1>o:Array.isArray(s)?s.findIndex(h=>h===o+1||h===r)>-1:!0);return n.indexOf(m.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent does not include category: '${m.Necessary}'. Consent has to atleast include the '${m.Necessary}' category.
|
|
21
|
+
Passed consent: ${JSON.stringify(s)}`),n.unshift(m.Necessary)),P(t.container,"storagePolicy",m.Necessary,{medium:f.Cookie,scope:Y.Tenant,duration:{days:365}}).then(r=>r(n)).then(()=>{Xt(t.container),t.events.dispatch("storage:policy-changed",n)})}})});const Rs=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:m,StorageMedium:f,StorageProvider:Is,StorageScope:Y,StorageService:ft,createStorageWriter:P,readStorage:O},Symbol.toStringTag,{value:"Module"})),Ts=i=>{const t=(n,r)=>{n&&(r?n.classList.add("ace-tabbing"):n.classList.remove("ace-tabbing"))},e=n=>{n.key==="Tab"?t(i,!0):n.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")||t(i,!1)},s=n=>{document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")&&document.activeElement.classList.contains("ace-tabbing")||t(i,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",s),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",s)}};function js(i,t){const{widgetName:e,label:s="",ariaLabel:n="",tooltip:r=""}=t;return i.classList.add("ace-widget-trigger"),i.classList.add(`ace-widget_${e}`),s.length&&i.classList.add("trigger-has-text"),n.length&&!i.getAttribute("aria-label")&&i.setAttribute("aria-label",n),n.length&&!i.getAttribute("tabindex")&&i.setAttribute("tabindex","0"),r.length&&!i.getAttribute("title")&&i.setAttribute("title",r),Ts(i)}function Us(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.remove("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.remove("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}function Hs(i){i instanceof HTMLElement?(i.classList.remove("ace-trigger-active"),i.classList.add("ace-trigger-loading")):i instanceof Array&&i.forEach(t=>{t.classList.remove("ace-trigger-active"),t.classList.add("ace-trigger-loading")})}function Re(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.add("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.add("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2019 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const
|
|
25
|
+
*/const yt=globalThis,te=yt.ShadowRoot&&(yt.ShadyCSS===void 0||yt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ee=Symbol(),ue=new WeakMap;let Te=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ee)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(te&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=ue.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&ue.set(e,t))}return t}toString(){return this.cssText}};const Vs=i=>new Te(typeof i=="string"?i:i+"",void 0,ee),se=(i,...t)=>{const e=i.length===1?i[0]:t.reduce(((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1]),i[0]);return new Te(e,i,ee)},zs=(i,t)=>{if(te)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),n=yt.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},pe=te?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Vs(e)})(i):i;/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/const{is:
|
|
29
|
+
*/const{is:Bs,defineProperty:Ws,getOwnPropertyDescriptor:qs,getOwnPropertyNames:Js,getOwnPropertySymbols:Ks,getPrototypeOf:Fs}=Object,M=globalThis,ge=M.trustedTypes,Gs=ge?ge.emptyScript:"",Ut=M.reactiveElementPolyfillSupport,tt=(i,t)=>i,_t={toAttribute(i,t){switch(t){case Boolean:i=i?Gs:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ie=(i,t)=>!Bs(i,t),me={attribute:!0,type:String,converter:_t,reflect:!1,useDefault:!1,hasChanged:ie};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),M.litPropertyMetadata??(M.litPropertyMetadata=new WeakMap);let z=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=me){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Ws(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:r}=qs(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:n,set(o){const a=n==null?void 0:n.call(this);r==null||r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??me}static _$Ei(){if(this.hasOwnProperty(tt("elementProperties")))return;const t=Fs(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(tt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tt("properties"))){const e=this.properties,s=[...Js(e),...Ks(e)];for(const n of s)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(pe(n))}else t!==void 0&&e.push(pe(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return zs(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var r;const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:_t).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r,o;const s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const a=s.getPropertyOptions(n),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:_t;this._$Em=n;const c=h.fromAttribute(e,a.type);this[n]=c??((o=this._$Ej)==null?void 0:o.get(n))??c,this._$Em=null}}requestUpdate(t,e,s){var n;if(t!==void 0){const r=this.constructor,o=this[t];if(s??(s=r.getPropertyOptions(t)),!((s.hasChanged??ie)(o,e)||s.useDefault&&s.reflect&&o===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n){const{wrapped:a}=o,h=this[r];a!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)})),this.update(e)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var n;return(n=s.hostUpdated)==null?void 0:n.call(s)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[tt("elementProperties")]=new Map,z[tt("finalized")]=new Map,Ut==null||Ut({ReactiveElement:z}),(M.reactiveElementVersions??(M.reactiveElementVersions=[])).push("2.1.1");/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/const et=globalThis,
|
|
34
|
-
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
35
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
33
|
+
*/const et=globalThis,xt=et.trustedTypes,fe=xt?xt.createPolicy("lit-html",{createHTML:i=>i}):void 0,je="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Ue="?"+k,Ys=`<${Ue}>`,V=document,it=()=>V.createComment(""),nt=i=>i===null||typeof i!="object"&&typeof i!="function",ne=Array.isArray,Zs=i=>ne(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Ht=`[
|
|
34
|
+
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ye=/-->/g,ve=/>/g,I=RegExp(`>|${Ht}(?:([^\\s"'>=/]+)(${Ht}*=${Ht}*(?:[^
|
|
35
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),be=/'/g,we=/"/g,He=/^(?:script|style|textarea|title)$/i,Qs=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),X=Qs(1),D=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),$e=new WeakMap,j=V.createTreeWalker(V,129);function Ve(i,t){if(!ne(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return fe!==void 0?fe.createHTML(t):t}const Xs=(i,t)=>{const e=i.length-1,s=[];let n,r=t===2?"<svg>":t===3?"<math>":"",o=Z;for(let a=0;a<e;a++){const h=i[a];let c,l,d=-1,u=0;for(;u<h.length&&(o.lastIndex=u,l=o.exec(h),l!==null);)u=o.lastIndex,o===Z?l[1]==="!--"?o=ye:l[1]!==void 0?o=ve:l[2]!==void 0?(He.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=I):l[3]!==void 0&&(o=I):o===I?l[0]===">"?(o=n??Z,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?I:l[3]==='"'?we:be):o===we||o===be?o=I:o===ye||o===ve?o=Z:(o=I,n=void 0);const p=o===I&&i[a+1].startsWith("/>")?" ":"";r+=o===Z?h+Ys:d>=0?(s.push(c),h.slice(0,d)+je+h.slice(d)+k+p):h+k+(d===-2?a:p)}return[Ve(i,r+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class rt{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,l]=Xs(t,e);if(this.el=rt.createElement(c,s),j.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(n=j.nextNode())!==null&&h.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const d of n.getAttributeNames())if(d.endsWith(je)){const u=l[o++],p=n.getAttribute(d).split(k),g=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?ei:g[1]==="?"?si:g[1]==="@"?ii:Pt}),n.removeAttribute(d)}else d.startsWith(k)&&(h.push({type:6,index:r}),n.removeAttribute(d));if(He.test(n.tagName)){const d=n.textContent.split(k),u=d.length-1;if(u>0){n.textContent=xt?xt.emptyScript:"";for(let p=0;p<u;p++)n.append(d[p],it()),j.nextNode(),h.push({type:2,index:++r});n.append(d[u],it())}}}else if(n.nodeType===8)if(n.data===Ue)h.push({type:2,index:r});else{let d=-1;for(;(d=n.data.indexOf(k,d+1))!==-1;)h.push({type:7,index:r}),d+=k.length-1}r++}}static createElement(t,e){const s=V.createElement("template");return s.innerHTML=t,s}}function J(i,t,e=i,s){var o,a;if(t===D)return t;let n=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=nt(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=n:e._$Cl=n),n!==void 0&&(t=J(i,n._$AS(i,t.values),n,s)),t}class ti{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=((t==null?void 0:t.creationScope)??V).importNode(e,!0);j.currentNode=n;let r=j.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new ct(r,r.nextSibling,this,t):h.type===1?c=new h.ctor(r,h.name,h.strings,this,t):h.type===6&&(c=new ni(r,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(r=j.nextNode(),o++)}return j.currentNode=V,n}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class ct{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),nt(t)?t===y||t==null||t===""?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==D&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Zs(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==y&&nt(this._$AH)?this._$AA.nextSibling.data=t:this.T(V.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=rt.createElement(Ve(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{const o=new ti(n,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=$e.get(t.strings);return e===void 0&&$e.set(t.strings,e=new rt(t)),e}k(t){ne(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const r of t)n===e.length?e.push(s=new ct(this.O(it()),this.O(it()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Pt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,n){const r=this.strings;let o=!1;if(r===void 0)t=J(this,t,e,0),o=!nt(t)||t!==this._$AH&&t!==D,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=J(this,a[s+h],e,h),c===D&&(c=this._$AH[h]),o||(o=!nt(c)||c!==this._$AH[h]),c===y?t=y:t!==y&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!n&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ei extends Pt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}}class si extends Pt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}}class ii extends Pt{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??y)===D)return;const s=this._$AH,n=t===y&&s!==y||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==y&&(s===y||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ni{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const Vt=et.litHtmlPolyfillSupport;Vt==null||Vt(rt,ct),(et.litHtmlVersions??(et.litHtmlVersions=[])).push("3.3.1");const ri=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let n=s._$litPart$;if(n===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=n=new ct(t.insertBefore(it(),r),r,void 0,e??{})}return n._$AI(i),n};/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/const
|
|
39
|
+
*/const H=globalThis;let q=class extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ri(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return D}};var Ee;q._$litElement$=!0,q.finalized=!0,(Ee=H.litElementHydrateSupport)==null||Ee.call(H,{LitElement:q});const zt=H.litElementPolyfillSupport;zt==null||zt({LitElement:q});(H.litElementVersions??(H.litElementVersions=[])).push("4.2.1");/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/const
|
|
43
|
+
*/const oi={attribute:!0,type:String,converter:_t,reflect:!1,hasChanged:ie},ai=(i=oi,t,e)=>{const{kind:s,metadata:n}=e;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),r.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,i)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,i)}}throw Error("Unsupported decorator location: "+s)};function K(i){return(t,e)=>typeof e=="object"?ai(i,t,e):((s,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,s),o?Object.getOwnPropertyDescriptor(n,r):void 0})(i,t,e)}/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/function C(i){return
|
|
47
|
+
*/function C(i){return K({...i,state:!0,attribute:!1})}/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const
|
|
51
|
+
*/const ze={ATTRIBUTE:1,CHILD:2},Be=i=>(...t)=>({_$litDirective$:i,values:t});let We=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2018 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/const
|
|
55
|
+
*/const ci=Be(class extends We{constructor(i){var t;if(super(i),i.type!==ze.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter((t=>i[t])).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((r=>r!==""))));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return D}}),ut=(i,t,e)=>{i&&e.style.setProperty(t,i)},qe=(i,t)=>{var e,s,n,r;ut((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),ut((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),ut((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),ut((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var hi=Object.defineProperty,ht=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&hi(t,e,n),n};const oe=class oe extends q{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var e;const t=((e=this.container)==null?void 0:e.get("$settings"))??{};t!=null&&t.branding&&qe(t.branding,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-BG1RS3tz.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?X`<telia-icon
|
|
56
56
|
class="trigger-icon"
|
|
57
57
|
svg=${r.svg}
|
|
58
58
|
size="lg"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
class="trigger-custom-icon"
|
|
61
61
|
style="background: url(${n}) no-repeat center center;background-size: contain;"
|
|
62
62
|
></i>`;default:return y}}}render(){return X`<button
|
|
63
|
-
class=${
|
|
63
|
+
class=${ci({trigger:!0,active:this.active,rendered:this.loaded})}
|
|
64
64
|
@click=${this._toggleActive}
|
|
65
65
|
>
|
|
66
66
|
${this.icon}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
/>
|
|
92
92
|
</svg>
|
|
93
93
|
</span>
|
|
94
|
-
</button>`}};
|
|
94
|
+
</button>`}};oe.styles=[se`
|
|
95
95
|
:host {
|
|
96
96
|
--voca-rem-multiplier: 0.625;
|
|
97
97
|
display: block;
|
|
@@ -159,11 +159,11 @@
|
|
|
159
159
|
align-items: center;
|
|
160
160
|
fill: var(--trigger-text-color, var(--text-on-primary-background));
|
|
161
161
|
}
|
|
162
|
-
`];let L=re;ct([F({attribute:!1})],L.prototype,"symbol");ct([F({attribute:!1})],L.prototype,"container");ct([C()],L.prototype,"active");ct([C()],L.prototype,"loaded");ct([C()],L.prototype,"icon");var U=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(U||{});const hi=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",qe=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",li=async(i,t,e,s,n,r=!1)=>{var l,d;const o=hi(e,s),a=qe(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",L);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},di="modals";class ui{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===U.Badge&&Us(e),Promise.resolve().then(()=>require("./render-C5X01J2f.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===U.Badge){const r=this.options.triggerOptions.openTooltip;Ie(e,r)}gs(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,di,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=Ts(e,{label:n,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const ut="changesets",pi=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class ne{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,ut,m.Necessary,{medium:f.Local}).then(e=>new ne(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,ut,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:pi(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,ut,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,ut,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new K(t,a)})}})}))}}const gi=i=>{const{container:t}=i;return ne.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new G(i,n),o=Ne(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Ce.Deactivating&&o()}),r})},mi=i=>Promise.resolve().then(()=>Is).then(({StorageProvider:t})=>new t),fi=i=>Promise.resolve().then(()=>Gt).then(({ActionResolver:t})=>new t(i)),yi=i=>Promise.resolve().then(()=>Gt).then(({ComponentResolver:t})=>new t(i)),vi=i=>Promise.resolve().then(()=>Gt).then(()=>gi(i.get("$widget"))),zt="$settings",Bt="open",$e="activeStickyWidget";class bi extends ds{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>mi(this.container)),this.container.registerFactory("settings",()=>O(this.container,zt,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),as(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>yi(this.container)),this.container.registerAsync("actionResolver",()=>fi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>vi(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=ot(),triggerDOMElement:r,withRenderState:o}=t,h=qe(e)===U.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await li(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>b.querySelectorAll("[data-loading=true]").length===0,[b]=this.widget.container.get("widgetDOMElements"),x=(kt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},ht={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(b,ht)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(b,x)=>{x.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===U.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==U.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:b})=>{d.render().then(()=>this.renderState()).then(x=>b&&b.action&&b.action==="hide"?x===w.open?this.hide():this.open():x===w.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===U.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new ui(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),P(this.container,zt,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,zt,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return O(this.container,Bt,f.Session).then((e=w.closed)=>e)}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?w.open:t==="close"?w.closed:w.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===w.open),s!==w.hidden?s===w.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([P(this.container,Bt,m.Necessary,{medium:f.Session}),P(this.container,Bt,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?Ie(s,r):js(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,$e,f.Local).then(e=>e===this.widget.name?P(this.container,$e,m.Necessary,{medium:f.Local,scope:Y.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
162
|
+
`];let L=oe;ht([K({attribute:!1})],L.prototype,"symbol");ht([K({attribute:!1})],L.prototype,"container");ht([C()],L.prototype,"active");ht([C()],L.prototype,"loaded");ht([C()],L.prototype,"icon");var U=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(U||{});const li=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",Je=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",di=async(i,t,e,s,n,r=!1)=>{var l,d;const o=li(e,s),a=Je(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",L);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},ui="modals";class pi{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===U.Badge&&Hs(e),Promise.resolve().then(()=>require("./render-dq0_cXIY.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===U.Badge){const r=this.options.triggerOptions.openTooltip;Re(e,r)}ms(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,ui,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=js(e,{label:n,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const pt="changesets",gi=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class re{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,pt,m.Necessary,{medium:f.Local}).then(e=>new re(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,pt,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:gi(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,pt,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,pt,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new F(t,a)})}})}))}}const mi=i=>{const{container:t}=i;return re.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new G(i,n),o=Me(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Oe.Deactivating&&o()}),r})},fi=i=>Promise.resolve().then(()=>Rs).then(({StorageProvider:t})=>new t),yi=i=>Promise.resolve().then(()=>Yt).then(({ActionResolver:t})=>new t(i)),vi=i=>Promise.resolve().then(()=>Yt).then(({ComponentResolver:t})=>new t(i)),bi=i=>Promise.resolve().then(()=>Yt).then(()=>mi(i.get("$widget"))),Bt="$settings",Wt="open",_e="activeStickyWidget";class wi extends us{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>fi(this.container)),this.container.registerFactory("settings",()=>O(this.container,Bt,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),cs(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>vi(this.container)),this.container.registerAsync("actionResolver",()=>yi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>bi(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=at(),triggerDOMElement:r,withRenderState:o}=t,h=Je(e)===U.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await di(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>v.querySelectorAll("[data-loading=true]").length===0,[v]=this.widget.container.get("widgetDOMElements"),x=(Nt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},lt={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(v,lt)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(v,x)=>{x.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===U.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==U.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:v})=>{d.render().then(()=>this.renderState()).then(x=>v&&v.action&&v.action==="hide"?x===w.open?this.hide():this.open():x===w.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===U.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new pi(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),P(this.container,Bt,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,Bt,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return O(this.container,Wt,f.Session).then((e=w.closed)=>e)}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?w.open:t==="close"?w.closed:w.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===w.open),s!==w.hidden?s===w.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([P(this.container,Wt,m.Necessary,{medium:f.Session}),P(this.container,Wt,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?Re(s,r):Us(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,_e,f.Local).then(e=>e===this.widget.name?P(this.container,_e,m.Necessary,{medium:f.Local,scope:Y.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
163
163
|
* @license
|
|
164
164
|
* Copyright 2021 Google LLC
|
|
165
165
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
166
|
-
*/let
|
|
166
|
+
*/let Ke=class extends Event{constructor(t,e,s,n){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=s,this.subscribe=n??!1}};/**
|
|
167
167
|
* @license
|
|
168
168
|
* Copyright 2021 Google LLC
|
|
169
169
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -171,19 +171,19 @@
|
|
|
171
171
|
* @license
|
|
172
172
|
* Copyright 2021 Google LLC
|
|
173
173
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
174
|
-
*/let
|
|
174
|
+
*/let xe=class{constructor(t,e,s,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const r=e;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Ke(this.context,this.host,this.t,this.subscribe))}};/**
|
|
175
175
|
* @license
|
|
176
176
|
* Copyright 2021 Google LLC
|
|
177
177
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
178
|
-
*/class
|
|
178
|
+
*/class $i{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:s}]of this.subscriptions)e(this.o,s)},t!==void 0&&(this.value=t)}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:n}=this.subscriptions.get(t);t(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
179
179
|
* @license
|
|
180
180
|
* Copyright 2021 Google LLC
|
|
181
181
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
182
|
-
*/class
|
|
182
|
+
*/class _i extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}}class B extends $i{constructor(t,e,s){var n,r;super(e.context!==void 0?e.initialValue:s),this.onContextRequest=o=>{if(o.context!==this.context)return;const a=o.contextTarget??o.composedPath()[0];a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context||(o.contextTarget??o.composedPath()[0])===this.host)return;const a=new Set;for(const[h,{consumerHost:c}]of this.subscriptions)a.has(h)||(a.add(h),c.dispatchEvent(new Ke(this.context,c,h,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(r=(n=this.host).addController)==null||r.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new _i(this.context,this.host))}}/**
|
|
183
183
|
* @license
|
|
184
184
|
* Copyright 2022 Google LLC
|
|
185
185
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
186
|
-
*/function
|
|
186
|
+
*/function xi({context:i,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer((function(){new xe(this,{context:i,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new xe(n,{context:i,callback:r=>{n[s]=r},subscribe:t})}))}}const Fe="children",Ge="descriptor",Ye="container",Ze="context",Qe="layout",Xe="properties";class ts{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,e){if(!this._container||!this._descriptor)return;const s=await G.getInstance(this._container),n=new F(s).withId(this._descriptor.id);await s.actions(n,this._descriptor.type||at()).dispatch(t,e)}}const Ai=async(i,t)=>{const e=i.properties().provider;let s={},n="";Array.isArray(e)?(n=e[0],s=e[1]):n=e||"";const r=await t.getAsync(n);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(i.node.id,s),{provider:r,settings:s}},Ei=async(i,t)=>{const{provider:e,settings:s={}}=await Ai(i,t);return{addResource:(n,r)=>e.addResource(n,r),getData:(n,r)=>e.getData(n,r,s)}};class es{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const n=this.resources.get(t);if(!n)throw new Error(`Unable to get EntityProvider for "${t}"`);return await n.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const Ae=i=>({title:i.Title,id:i.Id.toString()});class Ci extends es{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const n=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${n}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?Ae(c):null}}),this.addResource("items",{query:async(e,s)=>{const r=t.get("$widget").name,o=s.projection||"",d=await(await fetch(`${o}/guides?client=&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(d.Matches||[]).map(u=>Ae(u)),totalItems:(d==null?void 0:d.TotalMatches)||0}}})}}const Oi=async i=>{i.registerAsync("guideProvider",()=>new Ci(i))},Si=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),De(i,t,s||(()=>{}),t,n))),Pi=i=>{const t={};return Object.keys(i).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=i[e])}),t},ss=(i,t)=>{const e=Pi(t);Object.entries(e).forEach(([s,n])=>{i.style.setProperty(s.replace("css-",""),n)})};var ki=Object.defineProperty,R=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&ki(t,e,n),n};const Ni=i=>{const e=class e extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new B(this,Ge,void 0),this._childrenProvider=new B(this,Fe,[]),this._propertiesProvider=new B(this,Xe,{}),this._contextProvider=new B(this,Ze,{}),this._layoutProvider=new B(this,Qe,{}),this.actions=new ts(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),G.getInstance(this.container).then(async n=>{var o,a;const r=n.nodes.get(this.entry);if(r){this._propertyChangeListener=n.events.subscribe("components:properties-changed",(u,p)=>{r.id===p.node.id&&this._setProperties(p.node.attributes.properties)}),this._contextChangeListener=n.events.subscribe("components:context-changed",(u,p)=>{r.id===p.node.id&&this._setContext(p.node.attributes.context)}),this._layoutChangeListener=n.events.subscribe("components:layout-changed",(u,p)=>{r.id===p.node.id&&this._setLayout(p.node.attributes.layout)});const h="default";this._unmountNode=r.mount(this.container),this._setDescriptor(Jt(r,h)),this._setProperties(r.attributes.properties),this._setContext(r.attributes.context),this._setLayout(this.layout);const c=r.getChildren(h).map(u=>Jt(u));this._childrenProvider.setValue(c);const l=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const d=l.getComponent(((a=this.descriptor)==null?void 0:a.type)||"");d.then&&d.then(u=>{this.component=u.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),ss(this.renderRoot.host,this.properties)}_setProperties(n){this._propertiesProvider.setValue(n),this.properties=n}_setContext(n){this._contextProvider.setValue(n),this.context=n}_setLayout(n){this._layoutProvider.setValue(n),this.layout=n}_setDescriptor(n){this.descriptor=n,this._descriptorProvider.setValue(n),this.actions.setDescriptor(n)}};e.styles=[i.styles??[],se`
|
|
187
187
|
:host {
|
|
188
188
|
font-family: var(--font-family);
|
|
189
189
|
grid-column: span var(--width);
|
|
@@ -195,4 +195,4 @@
|
|
|
195
195
|
* {
|
|
196
196
|
box-sizing: border-box;
|
|
197
197
|
}
|
|
198
|
-
`];let t=e;return R([
|
|
198
|
+
`];let t=e;return R([xi({context:Ye}),K({attribute:!1})],t.prototype,"container"),R([K()],t.prototype,"entry"),R([C()],t.prototype,"descriptor"),R([C()],t.prototype,"component"),R([C()],t.prototype,"context"),R([C()],t.prototype,"layout"),R([C()],t.prototype,"properties"),t};exports.ActionsController=ts;exports.DataProvider=es;exports.E=y;exports.GuideProviderPlugin=Oi;exports.T=D;exports.Widget=wi;exports.WidgetComponent=Ni;exports.appendStyleFromProperties=ss;exports.childrenContext=Fe;exports.containerContext=Ye;exports.contextCtx=Ze;exports.createDataProvider=Ei;exports.createLitComponent=Si;exports.descriptorContext=Ge;exports.e=Be;exports.i=We;exports.i$1=q;exports.i$2=B;exports.i$3=se;exports.layoutCtx=Qe;exports.mapBranding=qe;exports.n=K;exports.ot=w;exports.propertiesCtx=Xe;exports.r=C;exports.st=G;exports.t=ze;exports.x=X;
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-PiwZOlQl.js");exports.ActionsController=t.ActionsController;exports.DataProvider=t.DataProvider;exports.GridWidget=t.Widget;exports.GuideProviderPlugin=t.GuideProviderPlugin;exports.Widget=t.Widget;exports.WidgetComponent=t.WidgetComponent;exports.childrenContext=t.childrenContext;exports.containerContext=t.containerContext;exports.contextCtx=t.contextCtx;exports.createDataProvider=t.createDataProvider;exports.createWebComponent=t.createLitComponent;exports.descriptorContext=t.descriptorContext;exports.layoutCtx=t.layoutCtx;exports.propertiesCtx=t.propertiesCtx;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, D as o,
|
|
1
|
+
import { A as a, D as o, g as r, G as s, g as i, W as n, h as d, c as C, k as c, q as x, u as p, j as g, l, p as W } from "./index-DPP20EVG.mjs";
|
|
2
2
|
export {
|
|
3
3
|
a as ActionsController,
|
|
4
4
|
o as DataProvider,
|
|
@@ -11,7 +11,7 @@ export {
|
|
|
11
11
|
c as contextCtx,
|
|
12
12
|
x as createDataProvider,
|
|
13
13
|
p as createWebComponent,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
g as descriptorContext,
|
|
15
|
+
l as layoutCtx,
|
|
16
|
+
W as propertiesCtx
|
|
17
17
|
};
|