@nyaruka/temba-components 0.142.0 → 0.142.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/temba-components.js +2 -2
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/utils.js +5 -12
- package/out-tsc/src/utils.js.map +1 -1
- package/out-tsc/test/nodes/split_by_run_result.test.js +1 -2
- package/out-tsc/test/nodes/split_by_run_result.test.js.map +1 -1
- package/package.json +2 -2
- package/src/utils.ts +5 -12
- package/test/nodes/split_by_run_result.test.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v0.142.1](https://github.com/nyaruka/temba-components/compare/v0.142.0...v0.142.1)
|
|
8
|
+
|
|
9
|
+
- Fix rule arguments being incorrectly split for single-operand operators [`#856`](https://github.com/nyaruka/temba-components/pull/856)
|
|
10
|
+
- Bump serialize-javascript from 6.0.2 to 7.0.3 [`#849`](https://github.com/nyaruka/temba-components/pull/849)
|
|
11
|
+
|
|
7
12
|
#### [v0.142.0](https://github.com/nyaruka/temba-components/compare/v0.141.1...v0.142.0)
|
|
8
13
|
|
|
14
|
+
> 26 February 2026
|
|
15
|
+
|
|
9
16
|
- Add canvas zoom with all functionality working correctly [`#845`](https://github.com/nyaruka/temba-components/pull/845)
|
|
10
17
|
- Add max width constraint to reflow layout [`#847`](https://github.com/nyaruka/temba-components/pull/847)
|
|
11
18
|
- Replace reflow Save button with auto-save countdown [`#846`](https://github.com/nyaruka/temba-components/pull/846)
|
package/dist/temba-components.js
CHANGED
|
@@ -37,7 +37,7 @@ const ht=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)
|
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2017 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/}function gt(t){return mt({...t,state:!0,attribute:!1})}var ft,vt,bt,yt,xt,_t,wt,kt,Ct,St,At,Et,$t,Tt,Dt,Mt,It,Ot,zt=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},Lt=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Pt=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let o=0;o<t.length;o++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(o);return e},Rt="0123456789abcdef".split(""),Nt=[-2147483648,8388608,32768,128],Bt=[24,16,8,0],Ft=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],qt=[];class Ut{constructor(t=!1,e=!1){ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),xt.set(this,void 0),_t.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),Ct.set(this,void 0),St.set(this,void 0),At.set(this,void 0),Et.set(this,void 0),$t.set(this,void 0),Tt.set(this,void 0),Dt.set(this,void 0),Mt.set(this,void 0),It.set(this,0),Ot.set(this,void 0),this.init(t,e)}init(t,e){e?(qt[0]=qt[16]=qt[1]=qt[2]=qt[3]=qt[4]=qt[5]=qt[6]=qt[7]=qt[8]=qt[9]=qt[10]=qt[11]=qt[12]=qt[13]=qt[14]=qt[15]=0,zt(this,vt,qt)):zt(this,vt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(zt(this,_t,3238371032),zt(this,wt,914150663),zt(this,kt,812702999),zt(this,Ct,4144912697),zt(this,St,4290775857),zt(this,At,1750603025),zt(this,Et,1694076839),zt(this,$t,3204075428)):(zt(this,_t,1779033703),zt(this,wt,3144134277),zt(this,kt,1013904242),zt(this,Ct,2773480762),zt(this,St,1359893119),zt(this,At,2600822924),zt(this,Et,528734635),zt(this,$t,1541459225)),zt(this,ft,zt(this,Ot,zt(this,bt,zt(this,Dt,0)))),zt(this,yt,zt(this,Tt,!1)),zt(this,xt,!0),zt(this,Mt,t)}update(t){if(Lt(this,yt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=Lt(this,vt);for(;i<o;){let t;if(Lt(this,Tt)&&(zt(this,Tt,!1),n[0]=Lt(this,ft),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=Lt(this,Ot);i<o&&t<64;++i)n[t>>2]|=e[i]<<Bt[3&t++];else for(t=Lt(this,Ot);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Bt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Bt[3&t++],n[t>>2]|=(128|63&o)<<Bt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Bt[3&t++],n[t>>2]|=(128|o>>6&63)<<Bt[3&t++],n[t>>2]|=(128|63&o)<<Bt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Bt[3&t++],n[t>>2]|=(128|o>>12&63)<<Bt[3&t++],n[t>>2]|=(128|o>>6&63)<<Bt[3&t++],n[t>>2]|=(128|63&o)<<Bt[3&t++])}zt(this,It,t),zt(this,bt,Lt(this,bt)+(t-Lt(this,Ot))),t>=64?(zt(this,ft,n[16]),zt(this,Ot,t-64),this.hash(),zt(this,Tt,!0)):zt(this,Ot,t)}return Lt(this,bt)>4294967295&&(zt(this,Dt,Lt(this,Dt)+(Lt(this,bt)/4294967296|0)),zt(this,bt,Lt(this,bt)%4294967296)),this}finalize(){if(Lt(this,yt))return;zt(this,yt,!0);const t=Lt(this,vt),e=Lt(this,It);t[16]=Lt(this,ft),t[e>>2]|=Nt[3&e],zt(this,ft,t[16]),e>=56&&(Lt(this,Tt)||this.hash(),t[0]=Lt(this,ft),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=Lt(this,Dt)<<3|Lt(this,bt)>>>29,t[15]=Lt(this,bt)<<3,this.hash()}hash(){let t=Lt(this,_t),e=Lt(this,wt),i=Lt(this,kt),o=Lt(this,Ct),n=Lt(this,St),s=Lt(this,At),r=Lt(this,Et),a=Lt(this,$t);const l=Lt(this,vt);let d,c,h,u,p,m,g,f,v,b;for(let t=16;t<64;++t)u=l[t-15],d=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+d+l[t-7]+c|0;b=e&i;for(let y=0;y<64;y+=4)Lt(this,xt)?(Lt(this,Mt)?(g=300032,u=l[0]-1413257819,a=u-150054599|0,o=u+24177077|0):(g=704751109,u=l[0]-210244248,a=u-1521486534|0,o=u+143694565|0),zt(this,xt,!1)):(d=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,h=g^t&i^b,m=n&s^~n&r,u=a+c+m+Ft[y]+l[y],p=d+h,a=o+u|0,o=u+p|0),d=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,h=f^o&e^g,m=a&n^~a&s,u=r+c+m+Ft[y+1]+l[y+1],p=d+h,r=i+u|0,i=u+p|0,d=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&o,h=v^i&t^f,m=r&a^~r&n,u=s+c+m+Ft[y+2]+l[y+2],p=d+h,s=e+u|0,e=u+p|0,d=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=e&i,h=b^e&o^v,m=s&r^~s&a,u=n+c+m+Ft[y+3]+l[y+3],p=d+h,n=t+u|0,t=u+p|0;zt(this,_t,Lt(this,_t)+t|0),zt(this,wt,Lt(this,wt)+e|0),zt(this,kt,Lt(this,kt)+i|0),zt(this,Ct,Lt(this,Ct)+o|0),zt(this,St,Lt(this,St)+n|0),zt(this,At,Lt(this,At)+s|0),zt(this,Et,Lt(this,Et)+r|0),zt(this,$t,Lt(this,$t)+a|0)}hex(){this.finalize();const t=Lt(this,_t),e=Lt(this,wt),i=Lt(this,kt),o=Lt(this,Ct),n=Lt(this,St),s=Lt(this,At),r=Lt(this,Et),a=Lt(this,$t);let l=Rt[t>>28&15]+Rt[t>>24&15]+Rt[t>>20&15]+Rt[t>>16&15]+Rt[t>>12&15]+Rt[t>>8&15]+Rt[t>>4&15]+Rt[15&t]+Rt[e>>28&15]+Rt[e>>24&15]+Rt[e>>20&15]+Rt[e>>16&15]+Rt[e>>12&15]+Rt[e>>8&15]+Rt[e>>4&15]+Rt[15&e]+Rt[i>>28&15]+Rt[i>>24&15]+Rt[i>>20&15]+Rt[i>>16&15]+Rt[i>>12&15]+Rt[i>>8&15]+Rt[i>>4&15]+Rt[15&i]+Rt[o>>28&15]+Rt[o>>24&15]+Rt[o>>20&15]+Rt[o>>16&15]+Rt[o>>12&15]+Rt[o>>8&15]+Rt[o>>4&15]+Rt[15&o]+Rt[n>>28&15]+Rt[n>>24&15]+Rt[n>>20&15]+Rt[n>>16&15]+Rt[n>>12&15]+Rt[n>>8&15]+Rt[n>>4&15]+Rt[15&n]+Rt[s>>28&15]+Rt[s>>24&15]+Rt[s>>20&15]+Rt[s>>16&15]+Rt[s>>12&15]+Rt[s>>8&15]+Rt[s>>4&15]+Rt[15&s]+Rt[r>>28&15]+Rt[r>>24&15]+Rt[r>>20&15]+Rt[r>>16&15]+Rt[r>>12&15]+Rt[r>>8&15]+Rt[r>>4&15]+Rt[15&r];return Lt(this,Mt)||(l+=Rt[a>>28&15]+Rt[a>>24&15]+Rt[a>>20&15]+Rt[a>>16&15]+Rt[a>>12&15]+Rt[a>>8&15]+Rt[a>>4&15]+Rt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=Lt(this,_t),e=Lt(this,wt),i=Lt(this,kt),o=Lt(this,Ct),n=Lt(this,St),s=Lt(this,At),r=Lt(this,Et),a=Lt(this,$t),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return Lt(this,Mt)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer(Lt(this,Mt)?28:32),e=new DataView(t);return e.setUint32(0,Lt(this,_t)),e.setUint32(4,Lt(this,wt)),e.setUint32(8,Lt(this,kt)),e.setUint32(12,Lt(this,Ct)),e.setUint32(16,Lt(this,St)),e.setUint32(20,Lt(this,At)),e.setUint32(24,Lt(this,Et)),Lt(this,Mt)||e.setUint32(28,Lt(this,$t)),t}}function jt(t){const e=new Ut;return e.update(t),parseInt(e.hex().substring(0,8),16)}ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,xt=new WeakMap,_t=new WeakMap,wt=new WeakMap,kt=new WeakMap,Ct=new WeakMap,St=new WeakMap,At=new WeakMap,Et=new WeakMap,$t=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Mt=new WeakMap,It=new WeakMap,Ot=new WeakMap;const Ht=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Vt=[];for(let t=0;t<256;++t)Vt.push((t+256).toString(16).slice(1));function Wt(t,e=0){return(Vt[t[e+0]]+Vt[t[e+1]]+Vt[t[e+2]]+Vt[t[e+3]]+"-"+Vt[t[e+4]]+Vt[t[e+5]]+"-"+Vt[t[e+6]]+Vt[t[e+7]]+"-"+Vt[t[e+8]]+Vt[t[e+9]]+"-"+Vt[t[e+10]]+Vt[t[e+11]]+Vt[t[e+12]]+Vt[t[e+13]]+Vt[t[e+14]]+Vt[t[e+15]]).toLowerCase()}let Zt;const Yt=new Uint8Array(16);function Gt(){if(!Zt){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Zt=crypto.getRandomValues.bind(crypto)}return Zt(Yt)}var Kt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xt(t,e,i){if(Kt.randomUUID&&!e&&!t)return Kt.randomUUID();const o=(t=t||{}).random??t.rng?.()??Gt();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){if((i=i||0)<0||i+16>e.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[i+t]=o[t];return e}return Wt(o)}const Qt={};function Jt(t,e,i){let o;if(t)o=te(t.random??t.rng?.()??Gt(),t.msecs,t.seq,e,i);else{const t=Date.now(),n=Gt();!function(t,e,i){t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=i[6]<<23|i[7]<<16|i[8]<<8|i[9],t.msecs=e):(t.seq=t.seq+1|0,0===t.seq&&t.msecs++)}(Qt,t,n),o=te(n,Qt.msecs,Qt.seq,e,i)}return e??Wt(o)}function te(t,e,i,o,n=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(o){if(n<0||n+16>o.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`)}else o=new Uint8Array(16),n=0;return e??=Date.now(),i??=127*t[6]<<24|t[7]<<16|t[8]<<8|t[9],o[n++]=e/1099511627776&255,o[n++]=e/4294967296&255,o[n++]=e/16777216&255,o[n++]=e/65536&255,o[n++]=e/256&255,o[n++]=255&e,o[n++]=112|i>>>28&15,o[n++]=i>>>20&255,o[n++]=128|i>>>14&63,o[n++]=i>>>6&255,o[n++]=i<<2&255|3&t[10],o[n++]=t[11],o[n++]=t[12],o[n++]=t[13],o[n++]=t[14],o[n++]=t[15],o}const ee="/api/v2/media.json",ie=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=jt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Pt)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Ht.apply(this,e)}hex(t){return function(t){var e="#";return t.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}(this.rgb(t))}};var oe;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(oe||(oe={}));const ne=(t,e="",i=[])=>{""!==e?"object"!=typeof t?console.log("%c"+t,e,...i):console.log("%c"+JSON.stringify(t,null,2),e):console.log(t)},se=(t={})=>{var e;let i=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!i){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(i=t.value)}const o=i?{"X-CSRFToken":i}:{},n=null===(e=window.workspace)||void 0===e?void 0:e.uuid;return n&&(o["X-Temba-Workspace"]=n),o["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{"X-Temba-Service-Org"===e&&delete o["X-Temba-Workspace"],o[e]=t[e]})),o},re=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:se(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.status<200||t.status>=300?n(t):t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}o({controller:e,body:i,json:n,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{n(t)}))})),ae=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i.trim()},le=(t,e=null,i={})=>new Promise(((o,n)=>{re(t,e,i).then((t=>{o({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),de=async(t,e={})=>{if(!t)return new Promise((t=>t([])));let i=[],o=t;for(;o;){const t=await le(o,null,e);t.results&&(i=i.concat(t.results)),o=t.next}return i},ce=t=>new Promise(((e,i)=>{re(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),he=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await ce(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},ue=(t,e,i={},o=null)=>{const n=se(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("X-Temba-Toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},pe=(t,e)=>ue(t,JSON.stringify(e),!1,"application/json"),me=(t,e,i={})=>new Promise(((o,n)=>{ue(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===ee?e:"Server failure")})).catch((t=>{n(t)}))})),ge=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:ge(e):null}return null},fe=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ve=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},be=(t,e,i="and")=>((t,e="and")=>{if(0===t.length)return"";if(1===t.length)return t[0];if(2===t.length)return"object"==typeof t[0]?V`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" ");if("object"==typeof t[0])return t.map(((i,o)=>o<t.length-1?V`${i}, `:V`${e} ${i}`));const i=t.slice(0,-1),o=t[t.length-1];return i.join(", ")+", "+e+" "+o})(t.map(e),i),ye=(t,e,i=void 0)=>{if(!i){const t=document.location.pathname;i=t.substring(0,t.indexOf("/",1))}const o=new Date;o.setTime(o.getTime()+2592e6),document.cookie=`${t}=${e};expires=${o.toUTCString()};path=${i}`},xe=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};function _e(t,e){return(i,o)=>{mt()(i,o);const n="connectedCallback",s="updated",r=i[n],a=i[s];i[n]=function(){const i=xe(t);null!==i?this[o]="true"===i||"false"!==i&&i:void 0!==e&&(this[o]=e),r&&r.call(this)},i[s]=function(e){e.has(o)&&ye(t,this[o]),a&&a.call(this,e)}}}var we;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(we||(we={}));const ke=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),Ce=t=>{let e=(t=t.trim()).match(/(([\p{L}\p{N}]+-[\p{L}\p{N}]+)|([\p{L}\p{N}]+))/gu)||[];if(1==e.length&&(e=t.match(/[\p{L}\p{N}]+/gu)),0==e.length)return"?";if(1==e.length)return e[0].substring(0,2).toUpperCase();const i=e.map((t=>t.substring(0,1))),o=i.filter(((t,e)=>t==t.toUpperCase()||0==e));return o.length>=2?(o[0]+o[1]).toUpperCase():(i[0]+i[1]).toUpperCase()},Se=(t,e,i)=>{i/=100;const o=e*Math.min(i,1-i)/100,n=e=>{const n=(e+t/30)%12,s=i-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`},Ae=(t,e)=>{const i=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/);if(i){let[t,o,n,s]=i.slice(1).map(((t,e)=>e<3?parseInt(t):parseFloat(t)));return t=Math.max(0,Math.floor(t*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),n=Math.max(0,Math.floor(n*(1-e))),void 0!==i[4]?`rgba(${t},${o},${n},${s})`:`rgb(${t},${o},${n})`}if(t.startsWith("#")){let i=t.replace("#","");3===i.length&&(i=i.split("").map((t=>t+t)).join(""));const o=parseInt(i,16);let n=o>>16&255,s=o>>8&255,r=255&o;return n=Math.max(0,Math.floor(n*(1-e))),s=Math.max(0,Math.floor(s*(1-e))),r=Math.max(0,Math.floor(r*(1-e))),`rgb(${n},${s},${r})`}return t},Ee=(t,e)=>t.left+t.width/2-e.width/2,$e=(t,e)=>t.top+t.height/2-e.height/2,Te=t=>{const{name:e,existingCategories:i,existingExits:o,existingCases:n,caseConfig:s}=t,r=i.find((t=>t.name===e)),a=r?o.find((t=>t.uuid===r.exit_uuid)):null,l=r&&n?n.find((t=>t.category_uuid===r.uuid)):null,d=(null==r?void 0:r.uuid)||Xt(),c=(null==a?void 0:a.uuid)||Xt(),h=(null==l?void 0:l.uuid)||Xt(),u={category:{uuid:d,name:e,exit_uuid:c},exit:{uuid:c,destination_uuid:(null==a?void 0:a.destination_uuid)||null}};return s&&(u.case={uuid:h,type:s.type,arguments:s.arguments,category_uuid:d}),u},De=(t,e,i=[],o=[],n=[])=>{const s=Te({name:"Success",existingCategories:i,existingExits:o,existingCases:n,caseConfig:e}),r=Te({name:"Failure",existingCategories:i,existingExits:o});return{router:{type:"switch",categories:[s.category,r.category],default_category_uuid:r.category.uuid,operand:t,cases:s.case?[s.case]:[]},exits:[s.exit,r.exit]}},Me=t=>["No Response","Other","All Responses","Timeout"].includes(t),Ie=(t,e)=>{const i=e.find((e=>e.uuid===t));return!!i&&Me(i.name)},Oe=(t,e,i,o)=>{const n=e(t);if(!n)return"";if(0===n.operands)return n.categoryName||"";const s=(i||"").trim(),r=(o||"").trim(),a=t=>t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():"";switch(t){case"has_any_word":case"has_all_words":case"has_phrase":case"has_only_phrase":case"has_beginning":default:return s?a(s):"";case"has_pattern":return s;case"has_number_eq":return s?`= ${s}`:"";case"has_number_lt":return s?`< ${s}`:"";case"has_number_lte":return s?`≤ ${s}`:"";case"has_number_gt":return s?`> ${s}`:"";case"has_number_gte":return s?`≥ ${s}`:"";case"has_number_between":return s&&r?`${s} - ${r}`:"";case"has_date_lt":case"has_date_lte":if(s){const t=s.match(/^(today)\s*([+-])\s*(\d+)$/i);if(t){const[,e,i,o]=t;return`Before ${e} ${i} ${o} ${"1"===o?"day":"days"}`}return`Before ${s}`}return"";case"has_date_gt":case"has_date_gte":if(s){const t=s.match(/^(today)\s*([+-])\s*(\d+)$/i);if(t){const[,e,i,o]=t;return`After ${e} ${i} ${o} ${"1"===o?"day":"days"}`}return`After ${s}`}return"";case"has_date_eq":if(s){const t=s.match(/^(today)\s*([+-])\s*(\d+)$/i);if(t){const[,e,i,o]=t;return`${e} ${i} ${o} ${"1"===o?"day":"days"}`}return s}return""}},ze=(t,e,i,o=[],n=[],s=[])=>{const r=[],a=[],l=[],d=o.filter((t=>!Me(t.name))),c=new Map;e.forEach(((t,e)=>{const h=t.category.trim().toLowerCase(),u=t.category.trim();let p=c.get(h);if(!p){let t=d.find((t=>t.name.toLowerCase()===h));const e=Array.from(c.keys()).length;if(!t&&e<d.length){const i=d[e];i&&!Ie(i.uuid,o)&&(t=i)}const i=t?n.find((e=>e.uuid===t.exit_uuid)):null;let s=(null==i?void 0:i.uuid)||Xt(),l=(null==t?void 0:t.uuid)||Xt();Ie(l,o)&&(l=Xt(),s=Xt()),p={uuid:l,name:u,exit_uuid:s},c.set(h,p),r.push({uuid:l,name:u,exit_uuid:s}),a.push({uuid:s,destination_uuid:(null==i?void 0:i.destination_uuid)||null})}let m=s[e];!m&&s.length>0&&(m=s.find((e=>{const i=o.find((t=>t.uuid===e.category_uuid));return e.type===t.operator&&(null==i?void 0:i.name.toLowerCase())===h})));const g=(null==m?void 0:m.uuid)||Xt(),f=i(t.operator);let v=[];v=f?0===f.operands?[]:2===f.operands?t.value.split(" ").filter((t=>t.trim())):t.value&&t.value.trim()?t.value.trim().split(/\s+/).filter((t=>t.length>0)):[]:t.value&&t.value.trim()?t.value.trim().split(/\s+/).filter((t=>t.length>0)):[],l.push({uuid:g,type:t.operator,arguments:v,category_uuid:p.uuid})}));const h=e.length>0?"Other":"All Responses";let u=o.find((t=>t.name===h));if(!u){const t=e.length>0?"All Responses":"Other";u=o.find((e=>e.name===t))}const p=u?n.find((t=>t.uuid===u.exit_uuid)):null,m=(null==p?void 0:p.uuid)||Xt(),g=(null==u?void 0:u.uuid)||Xt();r.push({uuid:g,name:h,exit_uuid:m}),a.push({uuid:m,destination_uuid:(null==p?void 0:p.destination_uuid)||null});const f=r.find((t=>"Other"===t.name||"All Responses"===t.name));return{router:{type:"switch",categories:r,default_category_uuid:null==f?void 0:f.uuid,operand:t,cases:l},exits:a}},Le=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),Pe=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];ne(t.tagName,oe.PURPLE,[i?"<first-updated>":"<updated>",o])}},Re=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&ne(t.tagName,oe.GREEN,void 0!==i?[e,i]:[e])};class Ne extends dt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),Pe(this,t,!0)}updated(t){super.updated(t),Pe(this,t,!1)}getHeaders(){return this.service?{"X-Temba-Service-Org":this.service}:{}}fireEvent(t){return Re(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&Re(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const o=i.closest(t);return o||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}t([mt({type:String})],Ne.prototype,"service",void 0);
|
|
40
|
+
*/}function gt(t){return mt({...t,state:!0,attribute:!1})}var ft,vt,bt,yt,xt,_t,wt,kt,Ct,St,At,Et,$t,Tt,Dt,Mt,It,Ot,zt=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},Lt=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Pt=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let o=0;o<t.length;o++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(o);return e},Rt="0123456789abcdef".split(""),Nt=[-2147483648,8388608,32768,128],Bt=[24,16,8,0],Ft=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],qt=[];class Ut{constructor(t=!1,e=!1){ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),xt.set(this,void 0),_t.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),Ct.set(this,void 0),St.set(this,void 0),At.set(this,void 0),Et.set(this,void 0),$t.set(this,void 0),Tt.set(this,void 0),Dt.set(this,void 0),Mt.set(this,void 0),It.set(this,0),Ot.set(this,void 0),this.init(t,e)}init(t,e){e?(qt[0]=qt[16]=qt[1]=qt[2]=qt[3]=qt[4]=qt[5]=qt[6]=qt[7]=qt[8]=qt[9]=qt[10]=qt[11]=qt[12]=qt[13]=qt[14]=qt[15]=0,zt(this,vt,qt)):zt(this,vt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(zt(this,_t,3238371032),zt(this,wt,914150663),zt(this,kt,812702999),zt(this,Ct,4144912697),zt(this,St,4290775857),zt(this,At,1750603025),zt(this,Et,1694076839),zt(this,$t,3204075428)):(zt(this,_t,1779033703),zt(this,wt,3144134277),zt(this,kt,1013904242),zt(this,Ct,2773480762),zt(this,St,1359893119),zt(this,At,2600822924),zt(this,Et,528734635),zt(this,$t,1541459225)),zt(this,ft,zt(this,Ot,zt(this,bt,zt(this,Dt,0)))),zt(this,yt,zt(this,Tt,!1)),zt(this,xt,!0),zt(this,Mt,t)}update(t){if(Lt(this,yt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=Lt(this,vt);for(;i<o;){let t;if(Lt(this,Tt)&&(zt(this,Tt,!1),n[0]=Lt(this,ft),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=Lt(this,Ot);i<o&&t<64;++i)n[t>>2]|=e[i]<<Bt[3&t++];else for(t=Lt(this,Ot);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Bt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Bt[3&t++],n[t>>2]|=(128|63&o)<<Bt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Bt[3&t++],n[t>>2]|=(128|o>>6&63)<<Bt[3&t++],n[t>>2]|=(128|63&o)<<Bt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Bt[3&t++],n[t>>2]|=(128|o>>12&63)<<Bt[3&t++],n[t>>2]|=(128|o>>6&63)<<Bt[3&t++],n[t>>2]|=(128|63&o)<<Bt[3&t++])}zt(this,It,t),zt(this,bt,Lt(this,bt)+(t-Lt(this,Ot))),t>=64?(zt(this,ft,n[16]),zt(this,Ot,t-64),this.hash(),zt(this,Tt,!0)):zt(this,Ot,t)}return Lt(this,bt)>4294967295&&(zt(this,Dt,Lt(this,Dt)+(Lt(this,bt)/4294967296|0)),zt(this,bt,Lt(this,bt)%4294967296)),this}finalize(){if(Lt(this,yt))return;zt(this,yt,!0);const t=Lt(this,vt),e=Lt(this,It);t[16]=Lt(this,ft),t[e>>2]|=Nt[3&e],zt(this,ft,t[16]),e>=56&&(Lt(this,Tt)||this.hash(),t[0]=Lt(this,ft),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=Lt(this,Dt)<<3|Lt(this,bt)>>>29,t[15]=Lt(this,bt)<<3,this.hash()}hash(){let t=Lt(this,_t),e=Lt(this,wt),i=Lt(this,kt),o=Lt(this,Ct),n=Lt(this,St),s=Lt(this,At),r=Lt(this,Et),a=Lt(this,$t);const l=Lt(this,vt);let d,c,h,u,p,m,g,f,v,b;for(let t=16;t<64;++t)u=l[t-15],d=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+d+l[t-7]+c|0;b=e&i;for(let y=0;y<64;y+=4)Lt(this,xt)?(Lt(this,Mt)?(g=300032,u=l[0]-1413257819,a=u-150054599|0,o=u+24177077|0):(g=704751109,u=l[0]-210244248,a=u-1521486534|0,o=u+143694565|0),zt(this,xt,!1)):(d=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,h=g^t&i^b,m=n&s^~n&r,u=a+c+m+Ft[y]+l[y],p=d+h,a=o+u|0,o=u+p|0),d=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,h=f^o&e^g,m=a&n^~a&s,u=r+c+m+Ft[y+1]+l[y+1],p=d+h,r=i+u|0,i=u+p|0,d=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&o,h=v^i&t^f,m=r&a^~r&n,u=s+c+m+Ft[y+2]+l[y+2],p=d+h,s=e+u|0,e=u+p|0,d=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=e&i,h=b^e&o^v,m=s&r^~s&a,u=n+c+m+Ft[y+3]+l[y+3],p=d+h,n=t+u|0,t=u+p|0;zt(this,_t,Lt(this,_t)+t|0),zt(this,wt,Lt(this,wt)+e|0),zt(this,kt,Lt(this,kt)+i|0),zt(this,Ct,Lt(this,Ct)+o|0),zt(this,St,Lt(this,St)+n|0),zt(this,At,Lt(this,At)+s|0),zt(this,Et,Lt(this,Et)+r|0),zt(this,$t,Lt(this,$t)+a|0)}hex(){this.finalize();const t=Lt(this,_t),e=Lt(this,wt),i=Lt(this,kt),o=Lt(this,Ct),n=Lt(this,St),s=Lt(this,At),r=Lt(this,Et),a=Lt(this,$t);let l=Rt[t>>28&15]+Rt[t>>24&15]+Rt[t>>20&15]+Rt[t>>16&15]+Rt[t>>12&15]+Rt[t>>8&15]+Rt[t>>4&15]+Rt[15&t]+Rt[e>>28&15]+Rt[e>>24&15]+Rt[e>>20&15]+Rt[e>>16&15]+Rt[e>>12&15]+Rt[e>>8&15]+Rt[e>>4&15]+Rt[15&e]+Rt[i>>28&15]+Rt[i>>24&15]+Rt[i>>20&15]+Rt[i>>16&15]+Rt[i>>12&15]+Rt[i>>8&15]+Rt[i>>4&15]+Rt[15&i]+Rt[o>>28&15]+Rt[o>>24&15]+Rt[o>>20&15]+Rt[o>>16&15]+Rt[o>>12&15]+Rt[o>>8&15]+Rt[o>>4&15]+Rt[15&o]+Rt[n>>28&15]+Rt[n>>24&15]+Rt[n>>20&15]+Rt[n>>16&15]+Rt[n>>12&15]+Rt[n>>8&15]+Rt[n>>4&15]+Rt[15&n]+Rt[s>>28&15]+Rt[s>>24&15]+Rt[s>>20&15]+Rt[s>>16&15]+Rt[s>>12&15]+Rt[s>>8&15]+Rt[s>>4&15]+Rt[15&s]+Rt[r>>28&15]+Rt[r>>24&15]+Rt[r>>20&15]+Rt[r>>16&15]+Rt[r>>12&15]+Rt[r>>8&15]+Rt[r>>4&15]+Rt[15&r];return Lt(this,Mt)||(l+=Rt[a>>28&15]+Rt[a>>24&15]+Rt[a>>20&15]+Rt[a>>16&15]+Rt[a>>12&15]+Rt[a>>8&15]+Rt[a>>4&15]+Rt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=Lt(this,_t),e=Lt(this,wt),i=Lt(this,kt),o=Lt(this,Ct),n=Lt(this,St),s=Lt(this,At),r=Lt(this,Et),a=Lt(this,$t),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return Lt(this,Mt)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer(Lt(this,Mt)?28:32),e=new DataView(t);return e.setUint32(0,Lt(this,_t)),e.setUint32(4,Lt(this,wt)),e.setUint32(8,Lt(this,kt)),e.setUint32(12,Lt(this,Ct)),e.setUint32(16,Lt(this,St)),e.setUint32(20,Lt(this,At)),e.setUint32(24,Lt(this,Et)),Lt(this,Mt)||e.setUint32(28,Lt(this,$t)),t}}function jt(t){const e=new Ut;return e.update(t),parseInt(e.hex().substring(0,8),16)}ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,xt=new WeakMap,_t=new WeakMap,wt=new WeakMap,kt=new WeakMap,Ct=new WeakMap,St=new WeakMap,At=new WeakMap,Et=new WeakMap,$t=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Mt=new WeakMap,It=new WeakMap,Ot=new WeakMap;const Ht=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Vt=[];for(let t=0;t<256;++t)Vt.push((t+256).toString(16).slice(1));function Wt(t,e=0){return(Vt[t[e+0]]+Vt[t[e+1]]+Vt[t[e+2]]+Vt[t[e+3]]+"-"+Vt[t[e+4]]+Vt[t[e+5]]+"-"+Vt[t[e+6]]+Vt[t[e+7]]+"-"+Vt[t[e+8]]+Vt[t[e+9]]+"-"+Vt[t[e+10]]+Vt[t[e+11]]+Vt[t[e+12]]+Vt[t[e+13]]+Vt[t[e+14]]+Vt[t[e+15]]).toLowerCase()}let Zt;const Yt=new Uint8Array(16);function Gt(){if(!Zt){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Zt=crypto.getRandomValues.bind(crypto)}return Zt(Yt)}var Kt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xt(t,e,i){if(Kt.randomUUID&&!e&&!t)return Kt.randomUUID();const o=(t=t||{}).random??t.rng?.()??Gt();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){if((i=i||0)<0||i+16>e.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[i+t]=o[t];return e}return Wt(o)}const Qt={};function Jt(t,e,i){let o;if(t)o=te(t.random??t.rng?.()??Gt(),t.msecs,t.seq,e,i);else{const t=Date.now(),n=Gt();!function(t,e,i){t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=i[6]<<23|i[7]<<16|i[8]<<8|i[9],t.msecs=e):(t.seq=t.seq+1|0,0===t.seq&&t.msecs++)}(Qt,t,n),o=te(n,Qt.msecs,Qt.seq,e,i)}return e??Wt(o)}function te(t,e,i,o,n=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(o){if(n<0||n+16>o.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`)}else o=new Uint8Array(16),n=0;return e??=Date.now(),i??=127*t[6]<<24|t[7]<<16|t[8]<<8|t[9],o[n++]=e/1099511627776&255,o[n++]=e/4294967296&255,o[n++]=e/16777216&255,o[n++]=e/65536&255,o[n++]=e/256&255,o[n++]=255&e,o[n++]=112|i>>>28&15,o[n++]=i>>>20&255,o[n++]=128|i>>>14&63,o[n++]=i>>>6&255,o[n++]=i<<2&255|3&t[10],o[n++]=t[11],o[n++]=t[12],o[n++]=t[13],o[n++]=t[14],o[n++]=t[15],o}const ee="/api/v2/media.json",ie=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=jt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Pt)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Ht.apply(this,e)}hex(t){return function(t){var e="#";return t.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}(this.rgb(t))}};var oe;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(oe||(oe={}));const ne=(t,e="",i=[])=>{""!==e?"object"!=typeof t?console.log("%c"+t,e,...i):console.log("%c"+JSON.stringify(t,null,2),e):console.log(t)},se=(t={})=>{var e;let i=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!i){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(i=t.value)}const o=i?{"X-CSRFToken":i}:{},n=null===(e=window.workspace)||void 0===e?void 0:e.uuid;return n&&(o["X-Temba-Workspace"]=n),o["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{"X-Temba-Service-Org"===e&&delete o["X-Temba-Workspace"],o[e]=t[e]})),o},re=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:se(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.status<200||t.status>=300?n(t):t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}o({controller:e,body:i,json:n,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{n(t)}))})),ae=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i.trim()},le=(t,e=null,i={})=>new Promise(((o,n)=>{re(t,e,i).then((t=>{o({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),de=async(t,e={})=>{if(!t)return new Promise((t=>t([])));let i=[],o=t;for(;o;){const t=await le(o,null,e);t.results&&(i=i.concat(t.results)),o=t.next}return i},ce=t=>new Promise(((e,i)=>{re(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),he=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await ce(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},ue=(t,e,i={},o=null)=>{const n=se(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("X-Temba-Toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},pe=(t,e)=>ue(t,JSON.stringify(e),!1,"application/json"),me=(t,e,i={})=>new Promise(((o,n)=>{ue(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===ee?e:"Server failure")})).catch((t=>{n(t)}))})),ge=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:ge(e):null}return null},fe=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ve=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},be=(t,e,i="and")=>((t,e="and")=>{if(0===t.length)return"";if(1===t.length)return t[0];if(2===t.length)return"object"==typeof t[0]?V`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" ");if("object"==typeof t[0])return t.map(((i,o)=>o<t.length-1?V`${i}, `:V`${e} ${i}`));const i=t.slice(0,-1),o=t[t.length-1];return i.join(", ")+", "+e+" "+o})(t.map(e),i),ye=(t,e,i=void 0)=>{if(!i){const t=document.location.pathname;i=t.substring(0,t.indexOf("/",1))}const o=new Date;o.setTime(o.getTime()+2592e6),document.cookie=`${t}=${e};expires=${o.toUTCString()};path=${i}`},xe=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};function _e(t,e){return(i,o)=>{mt()(i,o);const n="connectedCallback",s="updated",r=i[n],a=i[s];i[n]=function(){const i=xe(t);null!==i?this[o]="true"===i||"false"!==i&&i:void 0!==e&&(this[o]=e),r&&r.call(this)},i[s]=function(e){e.has(o)&&ye(t,this[o]),a&&a.call(this,e)}}}var we;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(we||(we={}));const ke=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),Ce=t=>{let e=(t=t.trim()).match(/(([\p{L}\p{N}]+-[\p{L}\p{N}]+)|([\p{L}\p{N}]+))/gu)||[];if(1==e.length&&(e=t.match(/[\p{L}\p{N}]+/gu)),0==e.length)return"?";if(1==e.length)return e[0].substring(0,2).toUpperCase();const i=e.map((t=>t.substring(0,1))),o=i.filter(((t,e)=>t==t.toUpperCase()||0==e));return o.length>=2?(o[0]+o[1]).toUpperCase():(i[0]+i[1]).toUpperCase()},Se=(t,e,i)=>{i/=100;const o=e*Math.min(i,1-i)/100,n=e=>{const n=(e+t/30)%12,s=i-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`},Ae=(t,e)=>{const i=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/);if(i){let[t,o,n,s]=i.slice(1).map(((t,e)=>e<3?parseInt(t):parseFloat(t)));return t=Math.max(0,Math.floor(t*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),n=Math.max(0,Math.floor(n*(1-e))),void 0!==i[4]?`rgba(${t},${o},${n},${s})`:`rgb(${t},${o},${n})`}if(t.startsWith("#")){let i=t.replace("#","");3===i.length&&(i=i.split("").map((t=>t+t)).join(""));const o=parseInt(i,16);let n=o>>16&255,s=o>>8&255,r=255&o;return n=Math.max(0,Math.floor(n*(1-e))),s=Math.max(0,Math.floor(s*(1-e))),r=Math.max(0,Math.floor(r*(1-e))),`rgb(${n},${s},${r})`}return t},Ee=(t,e)=>t.left+t.width/2-e.width/2,$e=(t,e)=>t.top+t.height/2-e.height/2,Te=t=>{const{name:e,existingCategories:i,existingExits:o,existingCases:n,caseConfig:s}=t,r=i.find((t=>t.name===e)),a=r?o.find((t=>t.uuid===r.exit_uuid)):null,l=r&&n?n.find((t=>t.category_uuid===r.uuid)):null,d=(null==r?void 0:r.uuid)||Xt(),c=(null==a?void 0:a.uuid)||Xt(),h=(null==l?void 0:l.uuid)||Xt(),u={category:{uuid:d,name:e,exit_uuid:c},exit:{uuid:c,destination_uuid:(null==a?void 0:a.destination_uuid)||null}};return s&&(u.case={uuid:h,type:s.type,arguments:s.arguments,category_uuid:d}),u},De=(t,e,i=[],o=[],n=[])=>{const s=Te({name:"Success",existingCategories:i,existingExits:o,existingCases:n,caseConfig:e}),r=Te({name:"Failure",existingCategories:i,existingExits:o});return{router:{type:"switch",categories:[s.category,r.category],default_category_uuid:r.category.uuid,operand:t,cases:s.case?[s.case]:[]},exits:[s.exit,r.exit]}},Me=t=>["No Response","Other","All Responses","Timeout"].includes(t),Ie=(t,e)=>{const i=e.find((e=>e.uuid===t));return!!i&&Me(i.name)},Oe=(t,e,i,o)=>{const n=e(t);if(!n)return"";if(0===n.operands)return n.categoryName||"";const s=(i||"").trim(),r=(o||"").trim(),a=t=>t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():"";switch(t){case"has_any_word":case"has_all_words":case"has_phrase":case"has_only_phrase":case"has_beginning":default:return s?a(s):"";case"has_pattern":return s;case"has_number_eq":return s?`= ${s}`:"";case"has_number_lt":return s?`< ${s}`:"";case"has_number_lte":return s?`≤ ${s}`:"";case"has_number_gt":return s?`> ${s}`:"";case"has_number_gte":return s?`≥ ${s}`:"";case"has_number_between":return s&&r?`${s} - ${r}`:"";case"has_date_lt":case"has_date_lte":if(s){const t=s.match(/^(today)\s*([+-])\s*(\d+)$/i);if(t){const[,e,i,o]=t;return`Before ${e} ${i} ${o} ${"1"===o?"day":"days"}`}return`Before ${s}`}return"";case"has_date_gt":case"has_date_gte":if(s){const t=s.match(/^(today)\s*([+-])\s*(\d+)$/i);if(t){const[,e,i,o]=t;return`After ${e} ${i} ${o} ${"1"===o?"day":"days"}`}return`After ${s}`}return"";case"has_date_eq":if(s){const t=s.match(/^(today)\s*([+-])\s*(\d+)$/i);if(t){const[,e,i,o]=t;return`${e} ${i} ${o} ${"1"===o?"day":"days"}`}return s}return""}},ze=(t,e,i,o=[],n=[],s=[])=>{const r=[],a=[],l=[],d=o.filter((t=>!Me(t.name))),c=new Map;e.forEach(((t,e)=>{const h=t.category.trim().toLowerCase(),u=t.category.trim();let p=c.get(h);if(!p){let t=d.find((t=>t.name.toLowerCase()===h));const e=Array.from(c.keys()).length;if(!t&&e<d.length){const i=d[e];i&&!Ie(i.uuid,o)&&(t=i)}const i=t?n.find((e=>e.uuid===t.exit_uuid)):null;let s=(null==i?void 0:i.uuid)||Xt(),l=(null==t?void 0:t.uuid)||Xt();Ie(l,o)&&(l=Xt(),s=Xt()),p={uuid:l,name:u,exit_uuid:s},c.set(h,p),r.push({uuid:l,name:u,exit_uuid:s}),a.push({uuid:s,destination_uuid:(null==i?void 0:i.destination_uuid)||null})}let m=s[e];!m&&s.length>0&&(m=s.find((e=>{const i=o.find((t=>t.uuid===e.category_uuid));return e.type===t.operator&&(null==i?void 0:i.name.toLowerCase())===h})));const g=(null==m?void 0:m.uuid)||Xt(),f=i(t.operator);let v=[];v=f?0===f.operands?[]:2===f.operands?t.value.split(" ").filter((t=>t.trim())):t.value&&t.value.trim()?[t.value.trim()]:[]:t.value&&t.value.trim()?[t.value.trim()]:[],l.push({uuid:g,type:t.operator,arguments:v,category_uuid:p.uuid})}));const h=e.length>0?"Other":"All Responses";let u=o.find((t=>t.name===h));if(!u){const t=e.length>0?"All Responses":"Other";u=o.find((e=>e.name===t))}const p=u?n.find((t=>t.uuid===u.exit_uuid)):null,m=(null==p?void 0:p.uuid)||Xt(),g=(null==u?void 0:u.uuid)||Xt();r.push({uuid:g,name:h,exit_uuid:m}),a.push({uuid:m,destination_uuid:(null==p?void 0:p.destination_uuid)||null});const f=r.find((t=>"Other"===t.name||"All Responses"===t.name));return{router:{type:"switch",categories:r,default_category_uuid:null==f?void 0:f.uuid,operand:t,cases:l},exits:a}},Le=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),Pe=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];ne(t.tagName,oe.PURPLE,[i?"<first-updated>":"<updated>",o])}},Re=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&ne(t.tagName,oe.GREEN,void 0!==i?[e,i]:[e])};class Ne extends dt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),Pe(this,t,!0)}updated(t){super.updated(t),Pe(this,t,!1)}getHeaders(){return this.service?{"X-Temba-Service-Org":this.service}:{}}fireEvent(t){return Re(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&Re(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const o=i.closest(t);return o||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}t([mt({type:String})],Ne.prototype,"service",void 0);
|
|
41
41
|
/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2017 Google LLC
|
|
@@ -8409,7 +8409,7 @@ background: #ccc;
|
|
|
8409
8409
|
${this.renderUploader()}
|
|
8410
8410
|
</div>
|
|
8411
8411
|
</div>
|
|
8412
|
-
</div>`}}t([mt({type:String,attribute:!1})],Ih.prototype,"endpoint",void 0),t([mt({type:Boolean})],Ih.prototype,"pendingDrop",void 0),t([mt({type:Boolean})],Ih.prototype,"ignoreDrops",void 0),t([mt({type:String})],Ih.prototype,"icon",void 0),t([mt({type:String})],Ih.prototype,"accept",void 0),t([mt({type:Number})],Ih.prototype,"max",void 0),t([mt({type:Array})],Ih.prototype,"attachments",void 0),t([mt({type:Boolean,attribute:!1})],Ih.prototype,"uploading",void 0);let Oh="dev";try{Oh="0.142.
|
|
8412
|
+
</div>`}}t([mt({type:String,attribute:!1})],Ih.prototype,"endpoint",void 0),t([mt({type:Boolean})],Ih.prototype,"pendingDrop",void 0),t([mt({type:Boolean})],Ih.prototype,"ignoreDrops",void 0),t([mt({type:String})],Ih.prototype,"icon",void 0),t([mt({type:String})],Ih.prototype,"accept",void 0),t([mt({type:Number})],Ih.prototype,"max",void 0),t([mt({type:Array})],Ih.prototype,"attachments",void 0),t([mt({type:Boolean,attribute:!1})],Ih.prototype,"uploading",void 0);let Oh="dev";try{Oh="0.142.1"}catch(t){}const zh=Oh,Lh="undefined"!=typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);function Ph(t){return 0!==t.button||!(!Lh||!t.ctrlKey)}function Rh(t){if(t.dependency){const e=t.dependency.name||t.dependency.key;return`Cannot find a ${t.dependency.type} for ${e}`}return t.description}const Nh=20;function Bh(t){const e=Math.round(t/Nh)*Nh;return Math.max(e,0)}const Fh=(t,e)=>V`<div style="display:flex;items-align:center;">
|
|
8413
8413
|
${e?V`<temba-icon name=${e} style="margin-right:0.5em"></temba-icon>`:null}
|
|
8414
8414
|
<div
|
|
8415
8415
|
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px;"
|