arcy.js 0.1.3 → 0.1.4
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/dist/{arcy.chat.24c8e3d6804c.js → arcy.chat.f698fce59921.js} +121 -101
- package/dist/{arcy.legacy.4e373458bb24.js → arcy.legacy.061d3b544569.js} +2 -2
- package/dist/arcy.loader.js +1 -1
- package/dist/{arcy.modern.336f518dd090.js → arcy.modern.d30bb13c138a.js} +2 -2
- package/dist/{arcy.picker.73f47221b73c.js → arcy.picker.b7e531503cf2.js} +15 -15
- package/dist/{chat-HNE6525R.js → chat-VOYR3S25.js} +33 -6
- package/dist/{chunk-7VVKR3AO.js → chunk-GDGE3HLE.js} +2 -1
- package/dist/design-mode.cjs +2 -0
- package/dist/design-mode.d.ts +19 -1
- package/dist/design-mode.js +1 -1
- package/dist/index.cjs +54 -14
- package/dist/index.js +8 -3
- package/dist/{picker-JPESE6JJ.js → picker-GPZ2GHB4.js} +2 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
(function(){'use strict';/* arcy.js — https://arcyai.com */
|
|
2
|
-
var be="__arcyPicker";function Se(e){return {v:1,core:e,selector:null,selectorCandidates:[],ordinal:1,precision:3,dynamicText:false}}function L(e){if(e.parentElement!==null)return e.parentElement;let t=e.parentNode;return t!==null&&"host"in t?t.host:null}function Te(e,t){let n=e;for(;n!==null;){if(n.matches(t))return n;n=L(n);}return null}function ve(e,t){let n=t;for(;n!==null;){if(n===e)return true;n=L(n);}return false}var Ce=100;function O(e,t=0){let n=[],r=e.querySelectorAll("*");for(let i=0;i<r.length;i+=1){let o=r[i];n.push(o),o.shadowRoot!==null&&t<Ce&&n.push(...O(o.shadowRoot,t+1));}return n}function $(e,t,n=0){let r=Array.from(e.querySelectorAll(t)),i=e.querySelectorAll("*");for(let o=0;o<i.length;o+=1){let a=i[o];a.shadowRoot!==null&&n<Ce&&r.push(...$(a.shadowRoot,t,n+1));}return r}var Ae=[/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b\d(?:[ -]?\d){12,18}\b/g],j="[masked]";function N(e){return Ae.some(t=>(t.lastIndex=0,t.test(e)))}var re=4096,ut=100,ft=64;function q(e){if(!e)return;let t=e.slice(0,re);if(e.length>re){let r=t.search(/\s\S*$/);t=r===-1?t.slice(0,re-ut):t.slice(0,r);}let n=t.replace(/\s+/g," ").trim();if(n){for(let r of Ae)n=n.replace(r,j);return n.slice(0,80)}}function z(e){return !(e.length===0||e.length>64||e.includes(":")||e.startsWith("radix-")||/^\d+$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))}var dt=new Set(["button","input","select","textarea","label","summary"]),mt=new Set(["button","link","menuitem","tab","option"]);function oe(e){let t=e.tagName.toLowerCase();if(dt.has(t)||t==="a"&&e.hasAttribute("href"))return true;let n=e.getAttribute("role");if(n!==null&&mt.has(n))return true;let r=e.getAttribute("contenteditable");return r===""||r==="true"}function ie(e){let t=e;for(;t!==null&&t!==t.ownerDocument.documentElement;){if(oe(t))return t;t=L(t);}return e}var pt=["data-testid","data-test","data-cy","id","name","aria-label"],gt=["data-testid","data-test","data-cy"],ht=64;function wt(e){for(let t of gt){let n=e.getAttribute(t);if(n===null)continue;let r=n.trim();if(!(r===""||r.length>ht)&&!N(r))return r}}var yt=new Set(["navigation","main","banner","contentinfo","search","form","region","dialog"]);function Et(e){let t=L(e);for(;t!==null;){let n=t.tagName.toLowerCase();if(n==="body"||n==="html")return;for(let i of pt){let o=t.getAttribute(i);if(o===null||i==="id"&&!z(o))continue;let a=q(o);if(a!==void 0)return {tag:n,attr:i,value:a}}let r=t.getAttribute("role");if(r!==null&&yt.has(r))return {tag:n,attr:"role",value:r};t=L(t);}}function bt(e){let t=0,n=e.previousElementSibling;for(;n!==null;)n.tagName===e.tagName&&(t+=1),n=n.previousElementSibling;return t}function Y(e){let t={tag:e.tagName.toLowerCase(),siblingIndex:bt(e)},n=q(e.textContent);n!==void 0&&(t.text=n);let r=q(e.getAttribute("aria-label"));r!==void 0&&(t.ariaLabel=r);let i=q(e.getAttribute("placeholder"));i!==void 0&&(t.placeholder=i);let o=e.getAttribute("id");o!==null&&z(o)&&!N(o)&&(t.id=o);let a=e.getAttribute("role");if(a!==null){let u=a.trim();u!==""&&u.length<=ft&&!N(u)&&(t.role=u);}let s=wt(e);s!==void 0&&(t.testId=s);let l=Et(e);return l!==void 0&&(t.ancestorTag=l.tag,t.ancestorAttr=l.attr,t.ancestorValue=l.value),t}function St(e){return e.getClientRects().length>0}var Tt=50,vt=40,Ct=10,At=15,Rt=15,xt=10,_t=10,It=10,Nt=5,kt=5,Lt=.6,Pt=.7,Dt={1:.3,2:.45,3:.6,4:.75,5:.9};function K(e){return e.split(j).join(" ").replace(/\s+/g," ").trim()}function Mt(e,t){if(t===void 0)return 0;let n=K(e),r=K(t);return n===""||r===""?0:r===n?1:r.includes(n)||n.includes(r)?Lt:0}function U(e,t){return t===e?1:0}function se(e){return e.includes(j)&&K(e)===""}function Ft(e,t,n){let r=0,i=0,o=(a,s)=>{r+=a,i+=a*s;};if(e.testId!==void 0&&o(Tt,U(e.testId,t.testId)),e.text!==void 0&&K(e.text)!==""&&o(n?Ct:vt,Mt(e.text,t.text)),e.ariaLabel!==void 0&&!se(e.ariaLabel)&&o(At,U(e.ariaLabel,t.ariaLabel)),e.placeholder!==void 0&&!se(e.placeholder)&&o(_t,U(e.placeholder,t.placeholder)),e.id!==void 0&&o(Rt,U(e.id,t.id)),e.role!==void 0&&o(Nt,U(e.role,t.role)),o(xt,t.tag===e.tag?1:0),o(kt,t.siblingIndex===e.siblingIndex?1:0),e.ancestorAttr!==void 0&&e.ancestorValue!==void 0&&!se(e.ancestorValue)){let a=0;t.ancestorAttr===e.ancestorAttr&&t.ancestorValue===e.ancestorValue&&(a=t.ancestorTag===e.ancestorTag?1:Pt),o(It,a);}return r===0?0:i/r}function Ot(e,t){if(e.selector===null)return null;try{return $(t,e.selector)}catch{return null}}function $t(e,t){let n=e.core.tag,r=[];for(let i of O(t))(i.tagName.toLowerCase()===n||oe(i))&&r.push(i);return r}function Re(e,t){if(t.length===0)return {status:"not_found",reason:"no_candidates",matchCount:0};let n=Dt[e.precision],r=false,i=[];for(let a of t){if(!St(a))continue;r=true;let s=Ft(e.core,Y(a),e.dynamicText);s>=n&&i.push({element:a,score:s});}if(i=i.filter((a,s)=>{let l=i[s+1];return l===void 0?true:!(ve(a.element,l.element)&&a.score<=l.score)}),i.length===0)return {status:"not_found",reason:r?"below_threshold":"not_visible",matchCount:0};let o=e.ordinal>=1?i[e.ordinal-1]:void 0;return o===void 0?{status:"not_found",reason:"ordinal_out_of_range",matchCount:i.length}:{status:"matched",element:o.element,score:o.score,matchCount:i.length}}function xe(e,t){try{let n=Ot(e,t);if(n!==null&&n.length>0){let r=Re(e,n);if(r.status==="matched"||r.reason==="ordinal_out_of_range")return r}return Re(e,$t(e,t))}catch{return {status:"not_found",reason:"error",matchCount:0}}}var Ut=1,Z=2,Ht=5,Bt=["data-testid","data-test","data-cy"],Wt=["name","for","aria-label"],Xt=new Set(["flex","grid","block","hidden","inline","contents","table","isolate","static","fixed","absolute","relative","sticky","visible","invisible","truncate","italic","uppercase","lowercase","capitalize","antialiased","container","border","rounded","shadow","ring","outline","transition","underline","grow","shrink","sr-only"]),Vt=/^-?(?:p|px|py|pt|pr|pb|pl|m|mx|my|mt|mr|mb|ml|gap|space|w|h|min-w|min-h|max-w|max-h|inset|top|right|bottom|left|z|text|font|leading|tracking|bg|border|rounded|shadow|opacity|flex|grid|col|row|order|basis|justify|items|content|self|place|overflow|object|aspect|size|translate|scale|rotate|duration|delay|ease|transition|ring|outline|fill|stroke|divide|decoration|cursor|select|list|align|whitespace|break|animate|blur|backdrop)-(.+)$/,Gt=new Set(["xs","sm","md","lg","xl","full","auto","none","center","start","end","between","around","evenly","baseline","stretch","wrap","nowrap","reverse","col","row","bold","semibold","medium","normal","light","thin","black","white","transparent","current","scroll","clip","ellipsis","pointer","left","right","top","bottom","middle","justify","screen","fit","min","max","visible","hidden","dashed","dotted","solid","double","in","out","border","background","foreground","muted","primary","secondary","accent","destructive","card","popover","input"]);function qt(e){let t=e.startsWith("!")?e.slice(1):e;if(t.includes(":")||t.includes("[")||t.includes("]")||t.includes("/")||Xt.has(t))return true;let n=Vt.exec(t);if(n===null)return false;let r=n[1];return /\d/.test(r)?true:r.split("-").every(i=>Gt.has(i))}var jt=["css-","sc-","jss-"];function zt(e){for(let n of jt)if(e.startsWith(n))return true;let t=e.split(/[_-]/).pop()??"";return t.length>=5&&/\d/.test(t)&&/[a-z]/.test(t)&&/[A-Z]/.test(t)}function Yt(e){let t=O(e),n=new Map;for(let r of t){let i=r.classList;for(let o=0;o<i.length;o+=1){let a=i[o];n.set(a,(n.get(a)??0)+1);}}return {counts:n,total:t.length}}var Kt=10,Zt=.02;function Jt(e){return Math.max(Kt,Math.ceil(e*Zt))}var Qt=80;function ae(e,t){let n=e.getAttribute(t);return n===null||n.trim()===""||n.length>Qt||/[\n\r\t\f]/.test(n)||N(n)?null:n}function ce(e,t){return `[${e}="${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"]`}function _e(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t=e.replace(/[^a-zA-Z0-9_\u00A0-\uFFFF-]/g,n=>"\\"+n);return /^\d/.test(t)?t=`\\3${t[0]} ${t.slice(1)}`:/^-\d/.test(t)?t=`-\\3${t[1]} ${t.slice(2)}`:t==="-"&&(t="\\-"),t}function en(e,t,n){let r;try{r=$(e,t);}catch{return null}return r.includes(n)?r.length:null}var tn="http://www.w3.org/1999/xhtml";function Ie(e){try{return nn(e)}catch{return {candidates:[],autoSelector:null}}}function nn(e){let t=e.ownerDocument,n=e.namespaceURI===null||e.namespaceURI===tn?e.tagName.toLowerCase():e.tagName,r=[];for(let c of Bt){let f=ae(e,c);f!==null&&r.push({selector:ce(c,f),tier:Ut});}let i=e.getAttribute("id");i!==null&&z(i)&&!N(i)&&r.push({selector:`#${_e(i)}`,tier:Z});for(let c of Wt){let f=ae(e,c);f!==null&&r.push({selector:ce(c,f),tier:Z});}let o=ae(e,"role");if(o!==null&&r.push({selector:`${n}${ce("role",o)}`,tier:Z}),e.classList.length>0){let{counts:c,total:f}=Yt(t),m=Jt(f),p=e.classList,g=new Set;for(let d=0;d<p.length;d+=1){let h=p[d];g.has(h)||(g.add(h),!(qt(h)||zt(h)||N(h))&&((c.get(h)??0)>m||r.push({selector:`${n}.${_e(h)}`,tier:Ht})));}}let a=[];for(let c of r){let f=en(t,c.selector,e);f!==null&&a.push({selector:c.selector,tier:c.tier,matchCount:f});}a.sort((c,f)=>c.tier-f.tier||c.matchCount-f.matchCount);let s=a.slice(0,5),l=s[0],u=l!==void 0&&l.tier<=Z&&l.matchCount===1?l.selector:null;return {candidates:s.map(c=>c.selector),autoSelector:u}}function x(e){typeof console<"u"&&console.warn&&console.warn(`[arcy] ${e}`);}function rn(e){try{let n=e.currentScript?.nonce;if(typeof n=="string"&&n.length>0)return n;let r=e.getElementsByTagName("script");for(let i=0;i<r.length;i++){let o=r[i].nonce;if(typeof o=="string"&&o.length>0)return o}return null}catch{return null}}var on=typeof document<"u"?rn(document):null;function an(){return on}function Ne(e){let t=an();if(t)try{e.nonce=t,e.setAttribute("nonce",t);}catch{}}var Le="arcy-widget",k="data-arcy",cn="2147483000",ln=[["position","fixed"],["inset","0"],["z-index",cn],["pointer-events","none"],["background","transparent"],["border","0"],["box-shadow","none"],["outline","0"]],un=[["margin","0"],["padding","0"]],ke="data-arcy-style",H=new Map;function fn(e=Le){let t=H.get(e);return t!==void 0&&t.host.isConnected}function Pe(e={}){if(typeof document>"u")return null;let t=e.id??Le,n=e.container;if(fn(t))return x("This ARCY surface is already on this page. Ignoring the second mount."),null;H.delete(t);let r=n??document.body??document.documentElement;if(!r)return x("The page has no <body> to mount into yet. The widget will not render."),null;if(!n){let i=document.querySelectorAll(`[${k}]`);for(let o=0;o<i.length;o+=1)if(i[o]?.id===t)return x("Another copy of ARCY is already on this page. Ignoring this one."),null}try{let i=document.createElement("div");i.id=t,i.setAttribute(k,"");for(let[l,u]of ln)i.style.setProperty(l,u,"important");for(let[l,u]of un)i.style.setProperty(l,u);let o=i,a=!1;try{i.attachShadow&&(o=i.attachShadow({mode:"closed"}),a=!0);}catch{}r.appendChild(i),mn(i);let s={host:i,root:o,isolated:a,destroy(){try{i.parentNode&&i.parentNode.removeChild(i);}catch{}H.get(t)===s&&H.delete(t);}};return H.set(t,s),s}catch(i){return x(`The widget could not mount. ${String(i)}`),null}}var dn=["pointerdown","pointerup","pointercancel","mousedown","mouseup","click","dblclick","auxclick","contextmenu","touchstart","touchend","touchcancel","focusin","focusout","keydown","keyup","keypress","beforeinput","input","change","compositionstart","compositionupdate","compositionend","cut","copy","paste"];function mn(e){let t=n=>{try{n.stopPropagation();}catch{}};for(let n of dn)try{e.addEventListener(n,t);}catch{}try{e.addEventListener("mousedown",n=>{n.defaultPrevented||pn(e.ownerDocument,e);});}catch{}}function pn(e,t){try{let n=e.activeElement;if(!n||n===t||t.contains(n)||n===e.body||n===e.documentElement)return;let r=n.blur;typeof r=="function"&&r.call(n);}catch{}}function De(e,t){if(!e.isolated)return false;try{let n=e.root.querySelector(`[${ke}]`);if(n)return n.textContent=`${n.textContent??""}
|
|
3
|
-
${t}`,!0;let r=e.host.ownerDocument.createElement("style");return Ne(r),r.setAttribute(ke,""),r.textContent=t,e.root.appendChild(r),!0}catch(n){return x(`The widget could not apply its styles. ${String(n)}`),false}}var Be="[modern-screenshot]",_=typeof window<"u",
|
|
2
|
+
var be="__arcyPicker";function Se(e){return {v:1,core:e,selector:null,selectorCandidates:[],ordinal:1,precision:3,dynamicText:false}}function D(e){if(e.parentElement!==null)return e.parentElement;let t=e.parentNode;return t!==null&&"host"in t?t.host:null}function Te(e,t){let n=e;for(;n!==null;){if(n.matches(t))return n;n=D(n);}return null}function Ae(e,t){let n=t;for(;n!==null;){if(n===e)return true;n=D(n);}return false}var Ce=100;function F(e,t=0){let n=[],r=e.querySelectorAll("*");for(let i=0;i<r.length;i+=1){let o=r[i];n.push(o),o.shadowRoot!==null&&t<Ce&&n.push(...F(o.shadowRoot,t+1));}return n}function U(e,t,n=0){let r=Array.from(e.querySelectorAll(t)),i=e.querySelectorAll("*");for(let o=0;o<i.length;o+=1){let a=i[o];a.shadowRoot!==null&&n<Ce&&r.push(...U(a.shadowRoot,t,n+1));}return r}var Re=[/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b\d(?:[ -]?\d){12,18}\b/g],q="[masked]";function N(e){return Re.some(t=>(t.lastIndex=0,t.test(e)))}var re=4096,ft=100,dt=64;function j(e){if(!e)return;let t=e.slice(0,re);if(e.length>re){let r=t.search(/\s\S*$/);t=r===-1?t.slice(0,re-ft):t.slice(0,r);}let n=t.replace(/\s+/g," ").trim();if(n){for(let r of Re)n=n.replace(r,q);return n.slice(0,80)}}function z(e){return !(e.length===0||e.length>64||e.includes(":")||e.startsWith("radix-")||/^\d+$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))}var mt=new Set(["button","input","select","textarea","label","summary"]),pt=new Set(["button","link","menuitem","tab","option"]);function oe(e){let t=e.tagName.toLowerCase();if(mt.has(t)||t==="a"&&e.hasAttribute("href"))return true;let n=e.getAttribute("role");if(n!==null&&pt.has(n))return true;let r=e.getAttribute("contenteditable");return r===""||r==="true"}function ie(e){let t=e;for(;t!==null&&t!==t.ownerDocument.documentElement;){if(oe(t))return t;t=D(t);}return e}var gt=["data-testid","data-test","data-cy","id","name","aria-label"],ht=["data-testid","data-test","data-cy"],Et=64;function yt(e){for(let t of ht){let n=e.getAttribute(t);if(n===null)continue;let r=n.trim();if(!(r===""||r.length>Et)&&!N(r))return r}}var wt=new Set(["navigation","main","banner","contentinfo","search","form","region","dialog"]);function bt(e){let t=D(e);for(;t!==null;){let n=t.tagName.toLowerCase();if(n==="body"||n==="html")return;for(let i of gt){let o=t.getAttribute(i);if(o===null||i==="id"&&!z(o))continue;let a=j(o);if(a!==void 0)return {tag:n,attr:i,value:a}}let r=t.getAttribute("role");if(r!==null&&wt.has(r))return {tag:n,attr:"role",value:r};t=D(t);}}function St(e){let t=0,n=e.previousElementSibling;for(;n!==null;)n.tagName===e.tagName&&(t+=1),n=n.previousElementSibling;return t}function Y(e){let t={tag:e.tagName.toLowerCase(),siblingIndex:St(e)},n=j(e.textContent);n!==void 0&&(t.text=n);let r=j(e.getAttribute("aria-label"));r!==void 0&&(t.ariaLabel=r);let i=j(e.getAttribute("placeholder"));i!==void 0&&(t.placeholder=i);let o=e.getAttribute("id");o!==null&&z(o)&&!N(o)&&(t.id=o);let a=e.getAttribute("role");if(a!==null){let u=a.trim();u!==""&&u.length<=dt&&!N(u)&&(t.role=u);}let s=yt(e);s!==void 0&&(t.testId=s);let l=bt(e);return l!==void 0&&(t.ancestorTag=l.tag,t.ancestorAttr=l.attr,t.ancestorValue=l.value),t}function Tt(e){return e.getClientRects().length>0}var At=50,Ct=40,Rt=10,vt=15,xt=15,_t=10,It=10,Nt=10,kt=5,Dt=5,Lt=.6,Mt=.7,Pt={1:.3,2:.45,3:.6,4:.75,5:.9};function K(e){return e.split(q).join(" ").replace(/\s+/g," ").trim()}function Ot(e,t){if(t===void 0)return 0;let n=K(e),r=K(t);return n===""||r===""?0:r===n?1:r.includes(n)||n.includes(r)?Lt:0}function $(e,t){return t===e?1:0}function se(e){return e.includes(q)&&K(e)===""}function Ft(e,t,n){let r=0,i=0,o=(a,s)=>{r+=a,i+=a*s;};if(e.testId!==void 0&&o(At,$(e.testId,t.testId)),e.text!==void 0&&K(e.text)!==""&&o(n?Rt:Ct,Ot(e.text,t.text)),e.ariaLabel!==void 0&&!se(e.ariaLabel)&&o(vt,$(e.ariaLabel,t.ariaLabel)),e.placeholder!==void 0&&!se(e.placeholder)&&o(It,$(e.placeholder,t.placeholder)),e.id!==void 0&&o(xt,$(e.id,t.id)),e.role!==void 0&&o(kt,$(e.role,t.role)),o(_t,t.tag===e.tag?1:0),o(Dt,t.siblingIndex===e.siblingIndex?1:0),e.ancestorAttr!==void 0&&e.ancestorValue!==void 0&&!se(e.ancestorValue)){let a=0;t.ancestorAttr===e.ancestorAttr&&t.ancestorValue===e.ancestorValue&&(a=t.ancestorTag===e.ancestorTag?1:Mt),o(Nt,a);}return r===0?0:i/r}function Ut(e,t){if(e.selector===null)return null;try{return U(t,e.selector)}catch{return null}}function $t(e,t){let n=e.core.tag,r=[];for(let i of F(t))(i.tagName.toLowerCase()===n||oe(i))&&r.push(i);return r}function ve(e,t){if(t.length===0)return {status:"not_found",reason:"no_candidates",matchCount:0};let n=Pt[e.precision],r=false,i=[];for(let a of t){if(!Tt(a))continue;r=true;let s=Ft(e.core,Y(a),e.dynamicText);s>=n&&i.push({element:a,score:s});}if(i=i.filter((a,s)=>{let l=i[s+1];return l===void 0?true:!(Ae(a.element,l.element)&&a.score<=l.score)}),i.length===0)return {status:"not_found",reason:r?"below_threshold":"not_visible",matchCount:0};let o=e.ordinal>=1?i[e.ordinal-1]:void 0;return o===void 0?{status:"not_found",reason:"ordinal_out_of_range",matchCount:i.length}:{status:"matched",element:o.element,score:o.score,matchCount:i.length}}function xe(e,t){try{let n=Ut(e,t);if(n!==null&&n.length>0){let r=ve(e,n);if(r.status==="matched"||r.reason==="ordinal_out_of_range")return r}return ve(e,$t(e,t))}catch{return {status:"not_found",reason:"error",matchCount:0}}}var Ht=1,Z=2,Bt=5,Wt=["data-testid","data-test","data-cy"],Xt=["name","for","aria-label"],Gt=new Set(["flex","grid","block","hidden","inline","contents","table","isolate","static","fixed","absolute","relative","sticky","visible","invisible","truncate","italic","uppercase","lowercase","capitalize","antialiased","container","border","rounded","shadow","ring","outline","transition","underline","grow","shrink","sr-only"]),Vt=/^-?(?:p|px|py|pt|pr|pb|pl|m|mx|my|mt|mr|mb|ml|gap|space|w|h|min-w|min-h|max-w|max-h|inset|top|right|bottom|left|z|text|font|leading|tracking|bg|border|rounded|shadow|opacity|flex|grid|col|row|order|basis|justify|items|content|self|place|overflow|object|aspect|size|translate|scale|rotate|duration|delay|ease|transition|ring|outline|fill|stroke|divide|decoration|cursor|select|list|align|whitespace|break|animate|blur|backdrop)-(.+)$/,jt=new Set(["xs","sm","md","lg","xl","full","auto","none","center","start","end","between","around","evenly","baseline","stretch","wrap","nowrap","reverse","col","row","bold","semibold","medium","normal","light","thin","black","white","transparent","current","scroll","clip","ellipsis","pointer","left","right","top","bottom","middle","justify","screen","fit","min","max","visible","hidden","dashed","dotted","solid","double","in","out","border","background","foreground","muted","primary","secondary","accent","destructive","card","popover","input"]);function qt(e){let t=e.startsWith("!")?e.slice(1):e;if(t.includes(":")||t.includes("[")||t.includes("]")||t.includes("/")||Gt.has(t))return true;let n=Vt.exec(t);if(n===null)return false;let r=n[1];return /\d/.test(r)?true:r.split("-").every(i=>jt.has(i))}var zt=["css-","sc-","jss-"];function Yt(e){for(let n of zt)if(e.startsWith(n))return true;let t=e.split(/[_-]/).pop()??"";return t.length>=5&&/\d/.test(t)&&/[a-z]/.test(t)&&/[A-Z]/.test(t)}function Kt(e){let t=F(e),n=new Map;for(let r of t){let i=r.classList;for(let o=0;o<i.length;o+=1){let a=i[o];n.set(a,(n.get(a)??0)+1);}}return {counts:n,total:t.length}}var Zt=10,Jt=.02;function Qt(e){return Math.max(Zt,Math.ceil(e*Jt))}var en=80;function ae(e,t){let n=e.getAttribute(t);return n===null||n.trim()===""||n.length>en||/[\n\r\t\f]/.test(n)||N(n)?null:n}function ce(e,t){return `[${e}="${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"]`}function _e(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t=e.replace(/[^a-zA-Z0-9_\u00A0-\uFFFF-]/g,n=>"\\"+n);return /^\d/.test(t)?t=`\\3${t[0]} ${t.slice(1)}`:/^-\d/.test(t)?t=`-\\3${t[1]} ${t.slice(2)}`:t==="-"&&(t="\\-"),t}function tn(e,t,n){let r;try{r=U(e,t);}catch{return null}return r.includes(n)?r.length:null}var nn="http://www.w3.org/1999/xhtml";function Ie(e){try{return rn(e)}catch{return {candidates:[],autoSelector:null}}}function rn(e){let t=e.ownerDocument,n=e.namespaceURI===null||e.namespaceURI===nn?e.tagName.toLowerCase():e.tagName,r=[];for(let c of Wt){let f=ae(e,c);f!==null&&r.push({selector:ce(c,f),tier:Ht});}let i=e.getAttribute("id");i!==null&&z(i)&&!N(i)&&r.push({selector:`#${_e(i)}`,tier:Z});for(let c of Xt){let f=ae(e,c);f!==null&&r.push({selector:ce(c,f),tier:Z});}let o=ae(e,"role");if(o!==null&&r.push({selector:`${n}${ce("role",o)}`,tier:Z}),e.classList.length>0){let{counts:c,total:f}=Kt(t),m=Qt(f),p=e.classList,g=new Set;for(let d=0;d<p.length;d+=1){let h=p[d];g.has(h)||(g.add(h),!(qt(h)||Yt(h)||N(h))&&((c.get(h)??0)>m||r.push({selector:`${n}.${_e(h)}`,tier:Bt})));}}let a=[];for(let c of r){let f=tn(t,c.selector,e);f!==null&&a.push({selector:c.selector,tier:c.tier,matchCount:f});}a.sort((c,f)=>c.tier-f.tier||c.matchCount-f.matchCount);let s=a.slice(0,5),l=s[0],u=l!==void 0&&l.tier<=Z&&l.matchCount===1?l.selector:null;return {candidates:s.map(c=>c.selector),autoSelector:u}}function x(e){typeof console<"u"&&console.warn&&console.warn(`[arcy] ${e}`);}function on(e){try{let n=e.currentScript?.nonce;if(typeof n=="string"&&n.length>0)return n;let r=e.getElementsByTagName("script");for(let i=0;i<r.length;i++){let o=r[i].nonce;if(typeof o=="string"&&o.length>0)return o}return null}catch{return null}}var sn=typeof document<"u"?on(document):null;function cn(){return sn}function Ne(e){let t=cn();if(t)try{e.nonce=t,e.setAttribute("nonce",t);}catch{}}var De="arcy-widget",k="data-arcy",ln="2147483000",un=[["position","fixed"],["inset","0"],["z-index",ln],["pointer-events","none"],["background","transparent"],["border","0"],["box-shadow","none"],["outline","0"]],fn=[["margin","0"],["padding","0"]],ke="data-arcy-style",H=new Map;function dn(e=De){let t=H.get(e);return t!==void 0&&t.host.isConnected}function Le(e={}){if(typeof document>"u")return null;let t=e.id??De,n=e.container;if(dn(t))return x("This ARCY surface is already on this page. Ignoring the second mount."),null;H.delete(t);let r=n??document.body??document.documentElement;if(!r)return x("The page has no <body> to mount into yet. The widget will not render."),null;if(!n){let i=document.querySelectorAll(`[${k}]`);for(let o=0;o<i.length;o+=1)if(i[o]?.id===t)return x("Another copy of ARCY is already on this page. Ignoring this one."),null}try{let i=document.createElement("div");i.id=t,i.setAttribute(k,"");for(let[l,u]of un)i.style.setProperty(l,u,"important");for(let[l,u]of fn)i.style.setProperty(l,u);let o=i,a=!1;try{i.attachShadow&&(o=i.attachShadow({mode:"closed"}),a=!0);}catch{}r.appendChild(i),pn(i);let s={host:i,root:o,isolated:a,destroy(){try{i.parentNode&&i.parentNode.removeChild(i);}catch{}H.get(t)===s&&H.delete(t);}};return H.set(t,s),s}catch(i){return x(`The widget could not mount. ${String(i)}`),null}}var mn=["pointerdown","pointerup","pointercancel","mousedown","mouseup","click","dblclick","auxclick","contextmenu","touchstart","touchend","touchcancel","focusin","focusout","keydown","keyup","keypress","beforeinput","input","change","compositionstart","compositionupdate","compositionend","cut","copy","paste"];function pn(e){let t=n=>{try{n.stopPropagation();}catch{}};for(let n of mn)try{e.addEventListener(n,t);}catch{}try{e.addEventListener("mousedown",n=>{n.defaultPrevented||gn(e.ownerDocument,e);});}catch{}}function gn(e,t){try{let n=e.activeElement;if(!n||n===t||t.contains(n)||n===e.body||n===e.documentElement)return;let r=n.blur;typeof r=="function"&&r.call(n);}catch{}}function Me(e,t){if(!e.isolated)return false;try{let n=e.root.querySelector(`[${ke}]`);if(n)return n.textContent=`${n.textContent??""}
|
|
3
|
+
${t}`,!0;let r=e.host.ownerDocument.createElement("style");return Ne(r),r.setAttribute(ke,""),r.textContent=t,e.root.appendChild(r),!0}catch(n){return x(`The widget could not apply its styles. ${String(n)}`),false}}var Be="[modern-screenshot]",_=typeof window<"u",hn=_&&"Worker"in window,fe=_?window.navigator?.userAgent:"",We=fe.includes("Chrome"),J=fe.includes("AppleWebKit")&&!We,de=fe.includes("Firefox"),En=e=>e&&"__CONTEXT__"in e,yn=e=>e.constructor.name==="CSSFontFaceRule",wn=e=>e.constructor.name==="CSSImportRule",bn=e=>e.constructor.name==="CSSLayerBlockRule",R=e=>e.nodeType===1,G=e=>typeof e.className=="object",Xe=e=>e.tagName==="image",Sn=e=>e.tagName==="use",B=e=>R(e)&&typeof e.style<"u"&&!G(e),Tn=e=>e.nodeType===8,An=e=>e.nodeType===3,M=e=>e.tagName==="IMG",Q=e=>e.tagName==="VIDEO",Cn=e=>e.tagName==="CANVAS",Rn=e=>e.tagName==="TEXTAREA",vn=e=>e.tagName==="INPUT",xn=e=>e.tagName==="STYLE",_n=e=>e.tagName==="SCRIPT",In=e=>e.tagName==="SELECT",Nn=e=>e.tagName==="SLOT",kn=e=>e.tagName==="IFRAME",Dn=(...e)=>console.warn(Be,...e);function Ln(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}var le=e=>e.startsWith("data:");function Ge(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(_&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!_)return e;let n=ee().implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function ee(e){return (e&&R(e)?e?.ownerDocument:e)??window.document}var te="http://www.w3.org/2000/svg";function Mn(e,t,n){let r=ee(n).createElementNS(te,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Pn(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function On(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(new Error(`Failed read blob to ${t}`)),i.readAsDataURL(e);})}var Fn=e=>On(e,"dataUrl");function L(e,t){let n=ee(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function W(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:o,onWarn:a}=t??{},s=typeof e=="string"?L(e,ee(i)):e,l=null,u=null;function c(){n(s),l&&clearTimeout(l),u?.();}if(r&&(l=setTimeout(c,r)),Q(s)){let f=s.currentSrc||s.src;if(!f)return s.poster?W(s.poster,t).then(n):c();if(s.readyState>=2)return c();let m=c,p=g=>{a?.("Failed video load",f,g),o?.(g),c();};u=()=>{s.removeEventListener("loadeddata",m),s.removeEventListener("error",p);},s.addEventListener("loadeddata",m,{once:true}),s.addEventListener("error",p,{once:true});}else {let f=Xe(s)?s.href.baseVal:s.currentSrc||s.src;if(!f)return c();let m=async()=>{if(M(s)&&"decode"in s)try{await s.decode();}catch(g){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||f,g);}c();},p=g=>{a?.("Failed image load",s.dataset.originalSrc||f,g),c();};if(M(s)&&s.complete)return m();u=()=>{s.removeEventListener("load",m),s.removeEventListener("error",p);},s.addEventListener("load",m,{once:true}),s.addEventListener("error",p,{once:true});}})}async function Un(e,t){B(e)&&(M(e)||Q(e)?await W(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>W(r,t)))));}var Ve=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return ()=>(t+=1,`u${n()}${t}`)})();function je(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var Pe=0;function $n(e){let t=`${Be}[#${Pe}]`;return Pe++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&Dn(...n)}}function Hn(e){return {cache:e?"no-cache":"force-cache"}}async function qe(e,t){return En(e)?e:Bn(e,{...t,autoDestruct:true})}async function Bn(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},o=!!t?.debug,a=t?.features??true,s=e.ownerDocument??(_?window.document:void 0),l=e.ownerDocument?.defaultView??(_?window:void 0),u=new Map,c={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:o,fetch:{requestInit:Hn(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:false,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:false,...t,__CONTEXT__:true,log:$n(o),node:e,ownerDocument:s,ownerWindow:l,dpi:n===1?null:96*n,svgStyleElement:ze(s),svgDefsElement:s?.createElementNS(te,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:hn&&r&&i?i:0})].map(()=>{try{let p=new Worker(r);return p.onmessage=async g=>{let{url:d,result:h}=g.data;h?u.get(d)?.resolve?.(h):u.get(d)?.reject?.(new Error(`Error receiving message from worker: ${d}`));},p.onmessageerror=g=>{let{url:d}=g.data;u.get(d)?.reject?.(new Error(`Error receiving message from worker: ${d}`));},p}catch(p){return c.log.warn("Failed to new Worker",p),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Ln(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:a,isEnable:p=>p==="restoreScrollPosition"?typeof a=="boolean"?false:a[p]??false:typeof a=="boolean"?a:a[p]??true,shadowRoots:[]};c.log.time("wait until load"),await Un(e,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:f,height:m}=Wn(e,c);return c.width=f,c.height=m,c}function ze(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
|
|
4
4
|
.______background-clip--text {
|
|
5
5
|
background-clip: text;
|
|
6
6
|
-webkit-background-clip: text;
|
|
7
7
|
}
|
|
8
|
-
`);return t.appendChild(n),t}function
|
|
9
|
-
`),b=s.get(
|
|
10
|
-
`));}else {let l=Array.from(n.styleSheets).filter(p=>{try{return "cssRules"in p&&!!p.cssRules.length}catch(g){return t.log.warn(`Error while reading CSS rules from ${p.href}`,g),false}}),u=n.implementation.createHTMLDocument(""),c=u.createElement("style");u.head.appendChild(c);let f=c.sheet;await Promise.all(l.flatMap(p=>Array.from(p.cssRules).map(async g=>{if(
|
|
8
|
+
`);return t.appendChild(n),t}function Wn(e,t){let{width:n,height:r}=t;if(R(e)&&(!n||!r)){let i=e.getBoundingClientRect();n=n||i.width||Number(e.getAttribute("width"))||0,r=r||i.height||Number(e.getAttribute("height"))||0;}return {width:n,height:r}}async function Xn(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:o}=t;n.time("image to canvas");let a=await W(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:l}=Gn(e.ownerDocument,t),u=()=>{try{l?.drawImage(a,0,0,s.width,s.height);}catch(c){t.log.warn("Failed to drawImage",c);}};if(u(),t.isEnable("fixSvgXmlDecode"))for(let c=0;c<i;c++)await new Promise(f=>{setTimeout(()=>{l?.clearRect(0,0,s.width,s.height),u(),f();},c+o);});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Gn(e,t){let{width:n,height:r,scale:i,backgroundColor:o,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*i),s.height=Math.floor(r*i),s.style.width=`${n}px`,s.style.height=`${r}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));let l=s.getContext("2d");return l&&o&&(l.fillStyle=o,l.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:l}}function Ye(e,t){if(e.ownerDocument)try{let o=e.toDataURL();if(o!=="data:,")return L(o,e.ownerDocument)}catch(o){t.log.warn("Failed to clone canvas",o);}let n=e.cloneNode(false),r=e.getContext("2d"),i=n.getContext("2d");try{return r&&i&&i.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(o){t.log.warn("Failed to clone canvas",o);}return n}function Vn(e,t){try{if(e?.contentDocument?.documentElement)return me(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n);}return e.cloneNode(false)}function jn(e){let t=e.cloneNode(false);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function qn(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return L(e.poster,e.ownerDocument);let n=e.cloneNode(false);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let i=true;if(await W(n,{onError:()=>i=false,onWarn:t.log.warn}),!i)return e.poster?L(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(a=>{n.addEventListener("seeked",a,{once:true});});let o=r.createElement("canvas");o.width=e.offsetWidth,o.height=e.offsetHeight;try{let a=o.getContext("2d");a&&a.drawImage(n,0,0,o.width,o.height);}catch(a){return t.log.warn("Failed to clone video",a),e.poster?L(e.poster,e.ownerDocument):n}return Ye(o,t)}return n}function zn(e,t){return Cn(e)?Ye(e,t):kn(e)?Vn(e,t):M(e)?jn(e):Q(e)?qn(e,t):e.cloneNode(false)}function Yn(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${Ve()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t);}catch(r){e.log.warn("Failed to getSandBox",r);}}return t}var Kn=["width","height","-webkit-text-fill-color"],Zn=["stroke","fill"];function Ke(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),o=G(e)&&i!=="svg",a=o?Zn.map(d=>[d,e.getAttribute(d)]).filter(([,d])=>d!==null):[],s=[o&&"svg",i,a.map((d,h)=>`${d}=${h}`).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);let u=Yn(n)?.contentWindow;if(!u)return new Map;let c=u?.document,f,m;o?(f=c.createElementNS(te,"svg"),m=f.ownerDocument.createElementNS(f.namespaceURI,i),a.forEach(([d,h])=>{m.setAttributeNS(null,d,h);}),f.appendChild(m)):f=m=c.createElement(i),m.textContent=" ",c.body.appendChild(f);let p=u.getComputedStyle(m,t),g=new Map;for(let d=p.length,h=0;h<d;h++){let w=p.item(h);Kn.includes(w)||g.set(w,p.getPropertyValue(w));}return c.body.removeChild(f),r.set(s,g),g}function Ze(e,t,n){let r=new Map,i=[],o=new Map;if(n)for(let s of n)a(s);else for(let s=e.length,l=0;l<s;l++){let u=e.item(l);a(u);}for(let s=i.length,l=0;l<s;l++)o.get(i[l])?.forEach((u,c)=>r.set(c,u));function a(s){let l=e.getPropertyValue(s),u=e.getPropertyPriority(s),c=s.lastIndexOf("-"),f=c>-1?s.substring(0,c):void 0;if(f){let m=o.get(f);m||(m=new Map,o.set(f,m)),m.set(s,[l,u]);}t.get(s)===l&&!u||(f?i.push(f):r.set(s,[l,u]));}return r}function Jn(e,t,n,r){let{ownerWindow:i,includeStyleProperties:o,currentParentNodeStyle:a}=r,s=t.style,l=i.getComputedStyle(e),u=Ke(e,null,r);a?.forEach((f,m)=>{u.delete(m);});let c=Ze(l,u,o);c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),n&&(c.delete("position"),c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),c.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),We&&(c.has("font-kerning")||c.set("font-kerning",["normal",""]),(c.get("overflow-x")?.[0]==="hidden"||c.get("overflow-y")?.[0]==="hidden")&&c.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&c.set("text-overflow",["clip",""]));for(let f=s.length,m=0;m<f;m++)s.removeProperty(s.item(m));return c.forEach(([f,m],p)=>{s.setProperty(p,f,m);}),c}function Qn(e,t){(Rn(e)||vn(e)||In(e))&&t.setAttribute("value",e.value);}var er=["::before","::after"],tr=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function nr(e,t,n,r,i){let{ownerWindow:o,svgStyleElement:a,svgStyles:s,currentNodeStyle:l}=r;if(!a||!o)return;function u(c){let f=o.getComputedStyle(e,c),m=f.getPropertyValue("content");if(!m||m==="none")return;i?.(m),m=m.replace(/(')|(")|(counter\(.+\))/g,"");let p=[Ve()],g=Ke(e,c,r);l?.forEach((S,A)=>{g.delete(A);});let d=Ze(f,g,r.includeStyleProperties);d.delete("content"),d.delete("-webkit-locale"),d.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let h=[`content: '${m}';`];if(d.forEach(([S,A],C)=>{h.push(`${C}: ${S}${A?" !important":""};`);}),h.length===1)return;try{t.className=[t.className,...p].join(" ");}catch(S){r.log.warn("Failed to copyPseudoClass",S);return}let w=h.join(`
|
|
9
|
+
`),b=s.get(w);b||(b=[],s.set(w,b)),b.push(`.${p[0]}${c}`);}er.forEach(u),n&&tr.forEach(u);}var Oe=new Set(["symbol"]);async function Fe(e,t,n,r,i){if(R(n)&&(xn(n)||_n(n))||r.filter&&!r.filter(n))return;Oe.has(t.nodeName)||Oe.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;let o=await me(n,r,false,i);r.isEnable("restoreScrollPosition")&&rr(e,o),t.appendChild(o);}async function Ue(e,t,n,r){let i=e.firstChild;R(e)&&e.shadowRoot&&(i=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let o=i;o;o=o.nextSibling)if(!Tn(o))if(R(o)&&Nn(o)&&typeof o.assignedNodes=="function"){let a=o.assignedNodes();for(let s=0;s<a.length;s++)await Fe(e,t,a[s],n,r);}else await Fe(e,t,o,n,r);}function rr(e,t){if(!B(e)||!B(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:i}=t.style,o=new DOMMatrix(i),{a,b:s,c:l,d:u}=o;o.a=1,o.b=0,o.c=0,o.d=1,o.translateSelf(-r,-n),o.a=a,o.b=s,o.c=l,o.d=u,t.style.transform=o.toString();}function or(e,t){let{backgroundColor:n,width:r,height:i,style:o}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),i&&a.setProperty("height",`${i}px`,"important"),o)for(let s in o)a[s]=o[s];}var ir=/^[\w-:]+$/;async function me(e,t,n=false,r){let{ownerDocument:i,ownerWindow:o,fontFamilies:a,onCloneEachNode:s}=t;if(i&&An(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&o&&R(e)&&(B(e)||G(e))){let u=await zn(e,t);if(t.isEnable("removeAbnormalAttributes")){let d=u.getAttributeNames();for(let h=d.length,w=0;w<h;w++){let b=d[w];ir.test(b)||u.removeAttribute(b);}}let c=t.currentNodeStyle=Jn(e,u,n,t);n&&or(u,t);let f=false;if(t.isEnable("copyScrollbar")){let d=[c.get("overflow-x")?.[0],c.get("overflow-y")?.[0]];f=d.includes("scroll")||(d.includes("auto")||d.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);}let m=c.get("text-transform")?.[0],p=je(c.get("font-family")?.[0]),g=p?d=>{m==="uppercase"?d=d.toUpperCase():m==="lowercase"?d=d.toLowerCase():m==="capitalize"&&(d=d[0].toUpperCase()+d.substring(1)),p.forEach(h=>{let w=a.get(h);w||a.set(h,w=new Set),d.split("").forEach(b=>w.add(b));});}:void 0;return nr(e,u,f,t,g),Qn(e,u),Q(e)||await Ue(e,u,t,g),await s?.(u),u}let l=e.cloneNode(false);return await Ue(e,l,t),await s?.(l),l}function sr(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove();}catch(t){e.log.warn("Failed to destroyContext",t);}e.sandbox=void 0;}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[];}function ar(e){let{url:t,timeout:n,responseType:r,...i}=e,o=new AbortController,a=n?setTimeout(()=>o.abort(),n):void 0;return fetch(t,{signal:o.signal,...i}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(r){case "arrayBuffer":return s.arrayBuffer();case "dataUrl":return s.blob().then(Fn);default:return s.text()}}).finally(()=>clearTimeout(a))}function X(e,t){let{url:n,requestType:r="text",responseType:i="text",imageDom:o}=t,a=n,{timeout:s,acceptOfImage:l,requests:u,fetchFn:c,fetch:{requestInit:f,bypassingCache:m,placeholderImage:p},font:g,workers:d,fontFamilies:h}=e;r==="image"&&(J||de)&&e.drawImageCount++;let w=u.get(n);if(!w){m&&m instanceof RegExp&&m.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let b=r.startsWith("font")&&g&&g.minify,S=new Set;b&&r.split(";")[1].split(",").forEach(I=>{h.has(I)&&h.get(I).forEach(V=>S.add(V));});let A=b&&S.size,C={url:a,timeout:s,responseType:A?"arrayBuffer":i,headers:r==="image"?{accept:l}:void 0,...f};w={type:r,resolve:void 0,reject:void 0,response:null},w.response=(async()=>{if(c&&r==="image"){let T=await c(n);if(T)return T}return !J&&n.startsWith("http")&&d.length?new Promise((T,I)=>{d[u.size&d.length-1].postMessage({rawUrl:n,...C}),w.resolve=T,w.reject=I;}):ar(C)})().catch(T=>{if(u.delete(n),r==="image"&&p)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof p=="string"?p:p(o);throw T}),u.set(n,w);}return w.response}async function Je(e,t,n,r){if(!Qe(e))return e;for(let[i,o]of cr(e,t))try{let a=await X(n,{url:o,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(lr(i),`$1${a}$3`);}catch(a){n.log.warn("Failed to fetch css data url",i,a);}return e}function Qe(e){return /url\((['"]?)([^'"]+?)\1\)/.test(e)}var et=/url\((['"]?)([^'"]+?)\1\)/g;function cr(e,t){let n=[];return e.replace(et,(r,i,o)=>(n.push([o,Ge(o,t)]),r)),n.filter(([r])=>!le(r))}function lr(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}var ur=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function fr(e,t){return ur.map(n=>{let r=e.getPropertyValue(n);return !r||r==="none"?null:((J||de)&&t.drawImageCount++,Je(r,null,t,true).then(i=>{!i||r===i||e.setProperty(n,i,e.getPropertyPriority(n));}))}).filter(Boolean)}function dr(e,t){if(M(e)){let n=e.currentSrc||e.src;if(!le(n))return [X(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=n,e.src=r||"");})];(J||de)&&t.drawImageCount++;}else if(G(e)&&!le(e.href.baseVal)){let n=e.href.baseVal;return [X(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=n,e.href.baseVal=r||"");})]}return []}function mr(e,t){let{ownerDocument:n,svgDefsElement:r}=t,i=e.getAttribute("href")??e.getAttribute("xlink:href");if(!i)return [];let[o,a]=i.split("#");if(a){let s=`#${a}`,l=t.shadowRoots.reduce((u,c)=>u??c.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(o&&e.setAttribute("href",s),r?.querySelector(s))return [];if(l)return r?.appendChild(l.cloneNode(true)),[];if(o)return [X(t,{url:o,responseType:"text"}).then(u=>{r?.insertAdjacentHTML("beforeend",u);})]}return []}function tt(e,t){let{tasks:n}=t;R(e)&&((M(e)||Xe(e))&&n.push(...dr(e,t)),Sn(e)&&n.push(...mr(e,t))),B(e)&&n.push(...fr(e.style,t)),e.childNodes.forEach(r=>{tt(r,t);});}async function pr(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:i,fontCssTexts:o,tasks:a,font:s}=t;if(!(!n||!r||!i.size))if(s&&s.cssText){let l=He(s.cssText,t);r.appendChild(n.createTextNode(`${l}
|
|
10
|
+
`));}else {let l=Array.from(n.styleSheets).filter(p=>{try{return "cssRules"in p&&!!p.cssRules.length}catch(g){return t.log.warn(`Error while reading CSS rules from ${p.href}`,g),false}}),u=n.implementation.createHTMLDocument(""),c=u.createElement("style");u.head.appendChild(c);let f=c.sheet;await Promise.all(l.flatMap(p=>Array.from(p.cssRules).map(async g=>{if(wn(g)){let d=g.href,h="";try{h=await X(t,{url:d,requestType:"text",responseType:"text"});}catch(b){t.log.warn(`Error fetch remote css import from ${d}`,b);}let w=h.replace(et,(b,S,A)=>b.replace(A,Ge(A,d)));for(let b of hr(w))try{f.insertRule(b,f.cssRules.length);}catch(S){t.log.warn("Error inserting rule from remote css import",{rule:b,error:S});}}}))),f.cssRules.length&&l.push(f);let m=[];l.forEach(p=>{ue(p.cssRules,m);}),m.filter(p=>yn(p)&&Qe(p.style.getPropertyValue("src"))&&je(p.style.getPropertyValue("font-family"))?.some(g=>i.has(g))).forEach(p=>{let g=p,d=o.get(g.cssText);d?r.appendChild(n.createTextNode(`${d}
|
|
11
11
|
`)):a.push(Je(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,t).then(h=>{h=He(h,t),o.set(g.cssText,h),r.appendChild(n.createTextNode(`${h}
|
|
12
|
-
`));}));});}}var
|
|
12
|
+
`));}));});}}var gr=/(\/\*[\s\S]*?\*\/)/g,$e=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function hr(e){if(e==null)return [];let t=[],n=e.replace(gr,"");for(;;){let o=$e.exec(n);if(!o)break;t.push(o[0]);}n=n.replace($e,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let o=r.exec(n);if(o)i.lastIndex=r.lastIndex;else if(o=i.exec(n),o)r.lastIndex=i.lastIndex;else break;t.push(o[0]);}return t}var Er=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,yr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function He(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(yr,i=>{for(;;){let[o,,a]=Er.exec(i)||[];if(!a)return "";if(a===r)return `src: ${o};`}}):e}function ue(e,t=[]){for(let n of Array.from(e))bn(n)?t.push(...ue(n.cssRules)):"cssRules"in n?ue(n.cssRules,t):t.push(n);return t}var wr=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function br(e){return wr.test(e.innerHTML)}async function Sr(e,t){let n=await qe(e,t);if(R(n.node)&&G(n.node)&&!br(n.node))return n.node;let{ownerDocument:r,log:i,tasks:o,svgStyleElement:a,svgDefsElement:s,svgStyles:l,font:u,progress:c,autoDestruct:f,onCloneNode:m,onEmbedNode:p,onCreateForeignObjectSvg:g}=n;i.time("clone node");let d=await me(n.node,n,true);if(a&&r){let A="";l.forEach((C,T)=>{A+=`${C.join(`,
|
|
13
13
|
`)} {
|
|
14
14
|
${T}
|
|
15
15
|
}
|
|
16
|
-
`;}),a.appendChild(r.createTextNode(
|
|
17
|
-
.${
|
|
16
|
+
`;}),a.appendChild(r.createTextNode(A));}i.timeEnd("clone node"),await m?.(d),u!==false&&R(d)&&(i.time("embed web font"),await pr(d,n),i.timeEnd("embed web font")),i.time("embed node"),tt(d,n);let h=o.length,w=0,b=async()=>{for(;;){let A=o.pop();if(!A)break;try{await A;}catch(C){n.log.warn("Failed to run task",C);}c?.(++w,h);}};c?.(w,h),await Promise.all([...Array.from({length:4})].map(b)),i.timeEnd("embed node"),await p?.(d);let S=Tr(d,n);return s&&S.insertBefore(s,S.children[0]),a&&S.insertBefore(a,S.children[0]),f&&sr(n),await g?.(S),S}function Tr(e,t){let{width:n,height:r}=t,i=Mn(n,r,e.ownerDocument),o=i.ownerDocument.createElementNS(i.namespaceURI,"foreignObject");return o.setAttributeNS(null,"x","0%"),o.setAttributeNS(null,"y","0%"),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.append(e),i.appendChild(o),i}async function nt(e,t){let n=await qe(e,t),r=await Sr(n),i=Pn(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=ze(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(te,"defs"),n.svgStyles.clear());let o=L(i,r.ownerDocument);return await Xn(o,n)}var rt=8e3;var Ar=.25,Cr=160,Rr=28,vr=1600,xr=1200,_r=2,Ir=26e5,Nr=36e5,kr=rt,Dr=[/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b\d(?:[ -]?\d){12,18}\b/g],it="[masked]",Lr="#f04e23";function pe(e){let t=e;for(let n of Dr)n.lastIndex=0,t=t.replace(n,it);return t}function ot(e){return Math.min(Math.max(e*Ar,Rr),Cr)}function Mr(e,t,n){let r=ot(e.width),i=ot(e.height),o=Math.max(0,e.left-r),a=Math.max(0,e.top-i),s=Math.min(t,e.left+e.width+r),l=Math.min(n,e.top+e.height+i),u=Math.min(s-o,vr),c=Math.min(l-a,xr);return s-o>u&&(o+=(s-o-u)/2),l-a>c&&(a+=(l-a-c)/2),{left:o,top:a,width:Math.max(0,u),height:Math.max(0,c)}}function Pr(e){if(e instanceof HTMLTextAreaElement)return true;if(!(e instanceof HTMLInputElement))return false;let t=e.type;return t!=="checkbox"&&t!=="radio"&&t!=="hidden"&&t!=="file"}function Or(e){return !(e instanceof Element&&e.hasAttribute(k))}function Fr(e){let t=e.ownerDocument??e,n=t.defaultView,r=t.createTreeWalker(e,(n?.NodeFilter??NodeFilter).SHOW_ELEMENT|(n?.NodeFilter??NodeFilter).SHOW_TEXT),i=[],o=r.currentNode;for(;o;){if(o.nodeType===3){let a=o.nodeValue;if(a&&a.trim()){let s=pe(a);s!==a&&(o.nodeValue=s);}}else if(o instanceof Element||o.tagName){let a=o;if(a.hasAttribute(k))i.push(a);else if(Pr(a)){let s=a instanceof HTMLInputElement&&a.type==="password",l=a.getAttribute("value")??a.value??"",u=s&&l?it:pe(l);a instanceof HTMLTextAreaElement?(a.textContent=u,a.value=u):(a.setAttribute("value",u),a.value=u);let c=a.getAttribute("placeholder");c&&a.setAttribute("placeholder",pe(c));}}o=r.nextNode();}for(let a of i)a.parentNode?.removeChild(a);}function Ur(e,t,n,r){e.save(),e.strokeStyle=Lr,e.lineWidth=2*r;let i=r;e.strokeRect((t.left-n.left)*r+i,(t.top-n.top)*r+i,t.width*r-i*2,t.height*r-i*2),e.restore();}function $r(e,t){let n=Math.min(e.devicePixelRatio||1,_r),r=t.width*t.height;return r<=0?1:Math.max(.5,Math.min(n,Math.sqrt(Ir/r)))}function Hr(e,t){let n=t.createElement("canvas");n.width=Math.max(1,Math.round(e.width/2)),n.height=Math.max(1,Math.round(e.height/2));let r=n.getContext("2d");return r?(r.drawImage(e,0,0,n.width,n.height),n):null}async function st(e){try{let t=e.ownerDocument,n=t.defaultView;if(!n||!t.documentElement||!e.isConnected)return null;let r=e.getBoundingClientRect(),i={left:r.left,top:r.top,width:r.width,height:r.height};if(i.width<=0||i.height<=0)return null;let o=Mr(i,n.innerWidth,n.innerHeight);if(o.width<=0||o.height<=0)return null;let a=$r(n,o),s=-(o.left+(n.scrollX||0)),l=-(o.top+(n.scrollY||0)),u=await nt(t.documentElement,{width:o.width,height:o.height,scale:a,backgroundColor:"#ffffff",timeout:kr,filter:Or,onCloneNode:m=>{Fr(m);},font:{preferredFormat:"woff2"},style:{transform:`translate(${s}px, ${l}px)`,transformOrigin:"top left",width:`${n.innerWidth}px`,minHeight:`${n.innerHeight}px`,margin:"0",overflow:"visible"}}),c=u.getContext("2d");if(!c)return null;Ur(c,i,o,a);let f=u.toDataURL("image/png");if(f.length>Nr){let m=Hr(u,t);if(!m)return null;f=m.toDataURL("image/png");}return f}catch{return null}}var Br="arcy-picker",v="arcy-picker-banner",ct="arcy-picker-highlight",Wr=`
|
|
17
|
+
.${v} {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
gap: 10px;
|
|
@@ -26,17 +26,17 @@ ${t}`,!0;let r=e.host.ownerDocument.createElement("style");return Ne(r),r.setAtt
|
|
|
26
26
|
box-shadow: 0 8px 24px rgba(16, 24, 40, 0.28);
|
|
27
27
|
white-space: nowrap;
|
|
28
28
|
}
|
|
29
|
-
.${
|
|
29
|
+
.${v}__title {
|
|
30
30
|
font-weight: 600;
|
|
31
31
|
margin-right: 2px;
|
|
32
32
|
}
|
|
33
|
-
.${
|
|
33
|
+
.${v}__status {
|
|
34
34
|
max-width: 260px;
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
text-overflow: ellipsis;
|
|
37
37
|
color: #d0d5dd;
|
|
38
38
|
}
|
|
39
|
-
.${
|
|
39
|
+
.${v} button {
|
|
40
40
|
appearance: none;
|
|
41
41
|
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
42
42
|
border-radius: 999px;
|
|
@@ -46,14 +46,14 @@ ${t}`,!0;let r=e.host.ownerDocument.createElement("style");return Ne(r),r.setAtt
|
|
|
46
46
|
padding: 4px 12px;
|
|
47
47
|
cursor: pointer;
|
|
48
48
|
}
|
|
49
|
-
.${
|
|
49
|
+
.${v} button:hover {
|
|
50
50
|
background: rgba(255, 255, 255, 0.1);
|
|
51
51
|
}
|
|
52
|
-
.${
|
|
52
|
+
.${v} button.is-active {
|
|
53
53
|
background: #f04e23;
|
|
54
54
|
border-color: #f04e23;
|
|
55
55
|
}
|
|
56
|
-
.${
|
|
56
|
+
.${ct} {
|
|
57
57
|
border-radius: 3px;
|
|
58
58
|
}
|
|
59
|
-
`;function
|
|
59
|
+
`;function at(e,t,n=[]){e.style.setProperty("position","absolute","important"),e.style.setProperty("pointer-events",t,"important");for(let[r,i]of n)e.style.setProperty(r,i,"important");}var Xr=[["box-sizing","border-box"],["border","2px solid #f04e23"],["background","rgba(240, 78, 35, 0.08)"]],Gr=[["left","50%"],["bottom","24px"]],Vr=[["transform","translateX(-50%)"]];function jr(e){let{text:t,tag:n}=e.core;return t?`Sent "${t}" to ARCY`:`Sent <${n}> to ARCY`}function lt(e){let t=Le({id:Br});if(!t)return null;let n=t.host.ownerDocument,r="pick",i=false,o=null,a=0;Me(t,Wr);let s=n.createElement("div");s.className=ct,at(s,"none");for(let[E,y]of Xr)s.style.setProperty(E,y);d();let l=n.createElement("div");l.className=v,at(l,"auto",Gr);for(let[E,y]of Vr)l.style.setProperty(E,y);let u=n.createElement("span");u.className=`${v}__title`,u.textContent="ARCY element picker";let c=n.createElement("button");c.type="button",c.textContent="Pick";let f=n.createElement("button");f.type="button",f.textContent="Browse";let m=n.createElement("span");m.className=`${v}__status`,m.textContent="Click the element you want this step to target.";let p=n.createElement("button");p.type="button",p.textContent="Exit",l.append(u,c,f,m,p),t.root.append(s,l);function g(E){r=E,c.classList.toggle("is-active",E==="pick"),f.classList.toggle("is-active",E==="browse"),m.textContent=E==="pick"?"Click the element you want this step to target.":"Browsing. Clicks work normally; switch back to pick.",E==="browse"&&d();}function d(){s.style.setProperty("display","none","important");}function h(E){try{let y=E.getBoundingClientRect();if(y.width===0&&y.height===0){d();return}s.style.setProperty("left",`${y.left}px`,"important"),s.style.setProperty("top",`${y.top}px`,"important"),s.style.setProperty("width",`${y.width}px`,"important"),s.style.setProperty("height",`${y.height}px`,"important"),s.style.setProperty("display","block","important");}catch{d();}}function w(E){return E instanceof Element&&Te(E,`[${k}]`)!==null}function b(E){if(typeof E.composedPath=="function"){let y=E.composedPath();if(y.length>0)return y[0]}return E.target}function S(){return t!==null&&t.host.isConnected?false:(ne(),true)}let A=E=>{try{if(S()||r!=="pick")return;let y=b(E);if(w(y)||!(y instanceof Element)){o=null,d();return}o=ie(y),h(o);}catch{}},C=()=>{try{if(S()||r!=="pick")return;o&&o.isConnected?h(o):d();}catch{}},T=E=>{try{if(S()||r!=="pick"||w(b(E)))return;E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation();}catch{}},I=E=>{try{if(S()||r!=="pick")return;let y=b(E);if(w(y)||(E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation(),!(y instanceof Element)))return;let P=ie(y),O=Se(Y(P)),Ee=Ie(P);O.selector=Ee.autoSelector,O.selectorCandidates=Ee.candidates,m.textContent=jr(O),o=P,h(P);let ye=0;try{ye=xe(O,n).matchCount;}catch{}if(e.onPick(O,ye),e.screenshotsEnabled===!1)return;let ut=++a;st(P).then(we=>{if(!(!we||i||ut!==a))try{e.onScreenshot?.(we);}catch{}});}catch(y){x(`The element picker could not read that element. ${String(y)}`);}};function V(E){if(!(E instanceof Element))return false;let y=E.tagName;return y==="INPUT"||y==="TEXTAREA"||y==="SELECT"?true:E.isContentEditable===true}let ge=E=>{try{if(S())return;let y=E;if(!y.altKey||y.code!=="KeyS"&&y.key.toLowerCase()!=="s"||V(b(y)))return;y.preventDefault(),g(r==="pick"?"browse":"pick");}catch{}};function ne(){if(!i){i=true;try{n.removeEventListener("pointerdown",T,!0),n.removeEventListener("mousedown",T,!0),n.removeEventListener("mouseup",T,!0),n.removeEventListener("auxclick",T,!0),n.removeEventListener("click",I,!0),n.removeEventListener("mousemove",A,!0),n.removeEventListener("keydown",ge,!0),n.defaultView?.removeEventListener("scroll",C,!0),n.defaultView?.removeEventListener("resize",C);}catch{}t?.destroy(),t=null;}}let he=E=>{try{E.preventDefault();}catch{}};return l.addEventListener("pointerdown",he),l.addEventListener("mousedown",he),c.addEventListener("click",()=>g("pick")),f.addEventListener("click",()=>g("browse")),p.addEventListener("click",()=>{ne();try{e.onExit();}catch{}}),n.addEventListener("pointerdown",T,true),n.addEventListener("mousedown",T,true),n.addEventListener("mouseup",T,true),n.addEventListener("auxclick",T,true),n.addEventListener("click",I,true),n.addEventListener("mousemove",A,true),n.addEventListener("keydown",ge,true),n.defaultView?.addEventListener("scroll",C,true),n.defaultView?.addEventListener("resize",C),g("pick"),{destroy:ne}}var zr={contract:2,mount:e=>{try{return lt(e)}catch{return null}}};if(typeof window<"u")try{window[be]=zr;}catch{}})();
|
|
@@ -2703,25 +2703,45 @@ var CHAT_CSS = TOOLTIP_CSS + `
|
|
|
2703
2703
|
min-height: 34px;
|
|
2704
2704
|
}
|
|
2705
2705
|
|
|
2706
|
+
/* Painted in the operator's brand, not in neutral grey (D1478). These pills
|
|
2707
|
+
are the first thing a visitor is invited to touch, and a grey outline on a
|
|
2708
|
+
welcome screen reads as chrome rather than as an offer. Tinted rather than
|
|
2709
|
+
filled, the same brand-on-brand-wash pair the transcript already uses for a
|
|
2710
|
+
pressed rating: up to five of these sit in one row, and five solid brand
|
|
2711
|
+
buttons would fight both each other and the send button below them. The
|
|
2712
|
+
brand colour therefore lands on the border, on the wash behind the label,
|
|
2713
|
+
and on the label itself, all derived from the one token the operator set. */
|
|
2706
2714
|
.${STARTER_CLASS} {
|
|
2707
2715
|
appearance: none;
|
|
2708
2716
|
text-align: left;
|
|
2709
2717
|
font: inherit;
|
|
2710
2718
|
font-size: 12.5px;
|
|
2719
|
+
font-weight: 500;
|
|
2711
2720
|
cursor: pointer;
|
|
2712
2721
|
padding: 7px 13px;
|
|
2713
2722
|
border-radius: 999px;
|
|
2714
|
-
border: 1px solid color-mix(in srgb, var(--_arcy-
|
|
2715
|
-
background: transparent;
|
|
2716
|
-
color:
|
|
2723
|
+
border: 1px solid color-mix(in srgb, var(--_arcy-brand-bg, #101828) 28%, transparent);
|
|
2724
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 8%, transparent);
|
|
2725
|
+
color: var(--_arcy-brand-bg, #101828);
|
|
2717
2726
|
max-width: 100%;
|
|
2718
2727
|
transition: background 120ms ease, border-color 120ms ease;
|
|
2719
2728
|
-webkit-tap-highlight-color: transparent;
|
|
2720
2729
|
}
|
|
2721
2730
|
|
|
2722
2731
|
.${STARTER_CLASS}:hover {
|
|
2723
|
-
background: color-mix(in srgb, var(--_arcy-
|
|
2724
|
-
border-color: color-mix(in srgb, var(--_arcy-
|
|
2732
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 16%, transparent);
|
|
2733
|
+
border-color: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 48%, transparent);
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
.${STARTER_CLASS}:active {
|
|
2737
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 24%, transparent);
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/* Brand rather than "currentColor", so the ring stays the same colour on a
|
|
2741
|
+
pill whose label the host page has managed to restyle. */
|
|
2742
|
+
.${STARTER_CLASS}:focus-visible {
|
|
2743
|
+
outline: 2px solid var(--_arcy-brand-bg, #101828);
|
|
2744
|
+
outline-offset: 2px;
|
|
2725
2745
|
}
|
|
2726
2746
|
|
|
2727
2747
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -3496,7 +3516,7 @@ function mount(context) {
|
|
|
3496
3516
|
historyDrawer.close();
|
|
3497
3517
|
},
|
|
3498
3518
|
onSelect: (conversationId) => {
|
|
3499
|
-
if ((context.getConversationId?.() ?? "") === conversationId) {
|
|
3519
|
+
if ((context.getConversationId?.() ?? "") === conversationId && !transcript.isEmpty()) {
|
|
3500
3520
|
historyDrawer.close();
|
|
3501
3521
|
return;
|
|
3502
3522
|
}
|
|
@@ -3720,11 +3740,13 @@ function mount(context) {
|
|
|
3720
3740
|
renderWelcome();
|
|
3721
3741
|
};
|
|
3722
3742
|
let catalogRequested = false;
|
|
3743
|
+
let catalogAudience = null;
|
|
3723
3744
|
const requestFlowCatalog = () => {
|
|
3724
3745
|
if (catalogRequested) return true;
|
|
3725
3746
|
const sessionToken = context.getSessionToken?.();
|
|
3726
3747
|
if (!sessionToken) return false;
|
|
3727
3748
|
catalogRequested = true;
|
|
3749
|
+
catalogAudience = widget()?.audience || null;
|
|
3728
3750
|
void fetchFlowCatalog({
|
|
3729
3751
|
apiBase: context.apiBase,
|
|
3730
3752
|
sessionToken,
|
|
@@ -3795,6 +3817,11 @@ function mount(context) {
|
|
|
3795
3817
|
fillCard.reposition();
|
|
3796
3818
|
},
|
|
3797
3819
|
refreshChrome() {
|
|
3820
|
+
const audience = widget()?.audience || null;
|
|
3821
|
+
if (catalogRequested && audience !== null && catalogAudience !== null && audience !== catalogAudience && transcript.isEmpty()) {
|
|
3822
|
+
catalogRequested = false;
|
|
3823
|
+
starterFlowsPending = true;
|
|
3824
|
+
}
|
|
3798
3825
|
if (!requestFlowCatalog() && starterFlowsPending) {
|
|
3799
3826
|
settleStarterFlows([]);
|
|
3800
3827
|
}
|
|
@@ -8,6 +8,7 @@ var DESIGN_MODE_READY = "arcy:design-mode:ready";
|
|
|
8
8
|
var DESIGN_MODE_PICK = "arcy:design-mode:pick";
|
|
9
9
|
var DESIGN_MODE_EXIT = "arcy:design-mode:exit";
|
|
10
10
|
var DESIGN_MODE_SCREENSHOT = "arcy:design-mode:screenshot";
|
|
11
|
+
var SCREENSHOT_RENDER_BUDGET_MS = 8e3;
|
|
11
12
|
var TAG_MAX = 64;
|
|
12
13
|
var ROUTE_MAX = 2048;
|
|
13
14
|
var SELECTOR_MAX = 512;
|
|
@@ -119,4 +120,4 @@ function readDesignModeMessage(data) {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
export { DESIGN_MODE_EXIT, DESIGN_MODE_PICK, DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_SCREENSHOT, readDesignModeMessage };
|
|
123
|
+
export { DESIGN_MODE_EXIT, DESIGN_MODE_PICK, DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_SCREENSHOT, SCREENSHOT_RENDER_BUDGET_MS, readDesignModeMessage };
|
package/dist/design-mode.cjs
CHANGED
|
@@ -15,6 +15,7 @@ var DESIGN_MODE_READY = "arcy:design-mode:ready";
|
|
|
15
15
|
var DESIGN_MODE_PICK = "arcy:design-mode:pick";
|
|
16
16
|
var DESIGN_MODE_EXIT = "arcy:design-mode:exit";
|
|
17
17
|
var DESIGN_MODE_SCREENSHOT = "arcy:design-mode:screenshot";
|
|
18
|
+
var SCREENSHOT_RENDER_BUDGET_MS = 8e3;
|
|
18
19
|
var TAG_MAX = 64;
|
|
19
20
|
var ROUTE_MAX = 2048;
|
|
20
21
|
var SELECTOR_MAX = 512;
|
|
@@ -132,4 +133,5 @@ exports.DESIGN_MODE_PROTOCOL = DESIGN_MODE_PROTOCOL;
|
|
|
132
133
|
exports.DESIGN_MODE_READY = DESIGN_MODE_READY;
|
|
133
134
|
exports.DESIGN_MODE_SCREENSHOT = DESIGN_MODE_SCREENSHOT;
|
|
134
135
|
exports.MASK = MASK;
|
|
136
|
+
exports.SCREENSHOT_RENDER_BUDGET_MS = SCREENSHOT_RENDER_BUDGET_MS;
|
|
135
137
|
exports.readDesignModeMessage = readDesignModeMessage;
|
package/dist/design-mode.d.ts
CHANGED
|
@@ -145,6 +145,24 @@ declare const DESIGN_MODE_EXIT = "arcy:design-mode:exit";
|
|
|
145
145
|
* so this needed no `DESIGN_MODE_PROTOCOL` bump to add.
|
|
146
146
|
*/
|
|
147
147
|
declare const DESIGN_MODE_SCREENSHOT = "arcy:design-mode:screenshot";
|
|
148
|
+
/**
|
|
149
|
+
* How long the widget may spend rasterizing before it gives up on a
|
|
150
|
+
* screenshot, in milliseconds. Part of the wire contract, not an internal
|
|
151
|
+
* detail of `screenshot.ts`, because the receiver has to wait at least this
|
|
152
|
+
* long before deciding no screenshot is coming (D1476).
|
|
153
|
+
*
|
|
154
|
+
* It lives here so both halves read one number. When they did not, the
|
|
155
|
+
* dashboard closed the picker tab two seconds after the pick while the
|
|
156
|
+
* rasterizer was still working, and every screenshot on a page of ordinary
|
|
157
|
+
* weight was lost: the tab died mid-render and the message was never posted.
|
|
158
|
+
* The gap opened the day the rasterizer changed (ADR 0157). The old one
|
|
159
|
+
* copied a property list onto absolutely positioned boxes and finished in
|
|
160
|
+
* well under a second; the one that replaced it clones the whole document
|
|
161
|
+
* with its computed styles, its pseudo-elements and its web fonts embedded as
|
|
162
|
+
* data URLs, which on a real marketing page takes several. Nobody revisited
|
|
163
|
+
* the two seconds, because nothing in either file mentioned the other.
|
|
164
|
+
*/
|
|
165
|
+
declare const SCREENSHOT_RENDER_BUDGET_MS = 8000;
|
|
148
166
|
interface DesignModeReady {
|
|
149
167
|
type: typeof DESIGN_MODE_READY;
|
|
150
168
|
protocol: number;
|
|
@@ -194,4 +212,4 @@ type DesignModeMessage = DesignModeReady | DesignModePick | DesignModeExit | Des
|
|
|
194
212
|
*/
|
|
195
213
|
declare function readDesignModeMessage(data: unknown): DesignModeMessage | null;
|
|
196
214
|
|
|
197
|
-
export { DESIGN_MODE_EXIT, DESIGN_MODE_PICK, DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_SCREENSHOT, type DesignModeExit, type DesignModeMessage, type DesignModePick, type DesignModeReady, type DesignModeScreenshot, MASK, readDesignModeMessage };
|
|
215
|
+
export { DESIGN_MODE_EXIT, DESIGN_MODE_PICK, DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_SCREENSHOT, type DesignModeExit, type DesignModeMessage, type DesignModePick, type DesignModeReady, type DesignModeScreenshot, MASK, SCREENSHOT_RENDER_BUDGET_MS, readDesignModeMessage };
|
package/dist/design-mode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DESIGN_MODE_EXIT, DESIGN_MODE_PICK, DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_SCREENSHOT, readDesignModeMessage } from './chunk-
|
|
1
|
+
export { DESIGN_MODE_EXIT, DESIGN_MODE_PICK, DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_SCREENSHOT, SCREENSHOT_RENDER_BUDGET_MS, readDesignModeMessage } from './chunk-GDGE3HLE.js';
|
|
2
2
|
export { MASK } from './chunk-NY3NXM2V.js';
|
package/dist/index.cjs
CHANGED
|
@@ -352,6 +352,19 @@ var init_contract = __esm({
|
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
354
|
|
|
355
|
+
// src/picker/message.ts
|
|
356
|
+
var DESIGN_MODE_PROTOCOL, DESIGN_MODE_READY, DESIGN_MODE_PICK, DESIGN_MODE_EXIT, DESIGN_MODE_SCREENSHOT, SCREENSHOT_RENDER_BUDGET_MS;
|
|
357
|
+
var init_message = __esm({
|
|
358
|
+
"src/picker/message.ts"() {
|
|
359
|
+
DESIGN_MODE_PROTOCOL = 2;
|
|
360
|
+
DESIGN_MODE_READY = "arcy:design-mode:ready";
|
|
361
|
+
DESIGN_MODE_PICK = "arcy:design-mode:pick";
|
|
362
|
+
DESIGN_MODE_EXIT = "arcy:design-mode:exit";
|
|
363
|
+
DESIGN_MODE_SCREENSHOT = "arcy:design-mode:screenshot";
|
|
364
|
+
SCREENSHOT_RENDER_BUDGET_MS = 8e3;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
|
|
355
368
|
// src/shell/host.ts
|
|
356
369
|
function isMounted(id = HOST_ID) {
|
|
357
370
|
const shell = shells.get(id);
|
|
@@ -4420,7 +4433,7 @@ function mount(context) {
|
|
|
4420
4433
|
historyDrawer.close();
|
|
4421
4434
|
},
|
|
4422
4435
|
onSelect: (conversationId) => {
|
|
4423
|
-
if ((context.getConversationId?.() ?? "") === conversationId) {
|
|
4436
|
+
if ((context.getConversationId?.() ?? "") === conversationId && !transcript.isEmpty()) {
|
|
4424
4437
|
historyDrawer.close();
|
|
4425
4438
|
return;
|
|
4426
4439
|
}
|
|
@@ -4644,11 +4657,13 @@ function mount(context) {
|
|
|
4644
4657
|
renderWelcome();
|
|
4645
4658
|
};
|
|
4646
4659
|
let catalogRequested = false;
|
|
4660
|
+
let catalogAudience = null;
|
|
4647
4661
|
const requestFlowCatalog = () => {
|
|
4648
4662
|
if (catalogRequested) return true;
|
|
4649
4663
|
const sessionToken = context.getSessionToken?.();
|
|
4650
4664
|
if (!sessionToken) return false;
|
|
4651
4665
|
catalogRequested = true;
|
|
4666
|
+
catalogAudience = widget()?.audience || null;
|
|
4652
4667
|
void fetchFlowCatalog({
|
|
4653
4668
|
apiBase: context.apiBase,
|
|
4654
4669
|
sessionToken,
|
|
@@ -4719,6 +4734,11 @@ function mount(context) {
|
|
|
4719
4734
|
fillCard.reposition();
|
|
4720
4735
|
},
|
|
4721
4736
|
refreshChrome() {
|
|
4737
|
+
const audience = widget()?.audience || null;
|
|
4738
|
+
if (catalogRequested && audience !== null && catalogAudience !== null && audience !== catalogAudience && transcript.isEmpty()) {
|
|
4739
|
+
catalogRequested = false;
|
|
4740
|
+
starterFlowsPending = true;
|
|
4741
|
+
}
|
|
4722
4742
|
if (!requestFlowCatalog() && starterFlowsPending) {
|
|
4723
4743
|
settleStarterFlows([]);
|
|
4724
4744
|
}
|
|
@@ -5071,25 +5091,45 @@ var init_chat = __esm({
|
|
|
5071
5091
|
min-height: 34px;
|
|
5072
5092
|
}
|
|
5073
5093
|
|
|
5094
|
+
/* Painted in the operator's brand, not in neutral grey (D1478). These pills
|
|
5095
|
+
are the first thing a visitor is invited to touch, and a grey outline on a
|
|
5096
|
+
welcome screen reads as chrome rather than as an offer. Tinted rather than
|
|
5097
|
+
filled, the same brand-on-brand-wash pair the transcript already uses for a
|
|
5098
|
+
pressed rating: up to five of these sit in one row, and five solid brand
|
|
5099
|
+
buttons would fight both each other and the send button below them. The
|
|
5100
|
+
brand colour therefore lands on the border, on the wash behind the label,
|
|
5101
|
+
and on the label itself, all derived from the one token the operator set. */
|
|
5074
5102
|
.${STARTER_CLASS} {
|
|
5075
5103
|
appearance: none;
|
|
5076
5104
|
text-align: left;
|
|
5077
5105
|
font: inherit;
|
|
5078
5106
|
font-size: 12.5px;
|
|
5107
|
+
font-weight: 500;
|
|
5079
5108
|
cursor: pointer;
|
|
5080
5109
|
padding: 7px 13px;
|
|
5081
5110
|
border-radius: 999px;
|
|
5082
|
-
border: 1px solid color-mix(in srgb, var(--_arcy-
|
|
5083
|
-
background: transparent;
|
|
5084
|
-
color:
|
|
5111
|
+
border: 1px solid color-mix(in srgb, var(--_arcy-brand-bg, #101828) 28%, transparent);
|
|
5112
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 8%, transparent);
|
|
5113
|
+
color: var(--_arcy-brand-bg, #101828);
|
|
5085
5114
|
max-width: 100%;
|
|
5086
5115
|
transition: background 120ms ease, border-color 120ms ease;
|
|
5087
5116
|
-webkit-tap-highlight-color: transparent;
|
|
5088
5117
|
}
|
|
5089
5118
|
|
|
5090
5119
|
.${STARTER_CLASS}:hover {
|
|
5091
|
-
background: color-mix(in srgb, var(--_arcy-
|
|
5092
|
-
border-color: color-mix(in srgb, var(--_arcy-
|
|
5120
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 16%, transparent);
|
|
5121
|
+
border-color: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 48%, transparent);
|
|
5122
|
+
}
|
|
5123
|
+
|
|
5124
|
+
.${STARTER_CLASS}:active {
|
|
5125
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 24%, transparent);
|
|
5126
|
+
}
|
|
5127
|
+
|
|
5128
|
+
/* Brand rather than "currentColor", so the ring stays the same colour on a
|
|
5129
|
+
pill whose label the host page has managed to restyle. */
|
|
5130
|
+
.${STARTER_CLASS}:focus-visible {
|
|
5131
|
+
outline: 2px solid var(--_arcy-brand-bg, #101828);
|
|
5132
|
+
outline-offset: 2px;
|
|
5093
5133
|
}
|
|
5094
5134
|
|
|
5095
5135
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -8723,6 +8763,7 @@ var init_screenshot = __esm({
|
|
|
8723
8763
|
"src/picker/screenshot.ts"() {
|
|
8724
8764
|
init_dist();
|
|
8725
8765
|
init_host();
|
|
8766
|
+
init_message();
|
|
8726
8767
|
CROP_MARGIN_RATIO = 0.25;
|
|
8727
8768
|
CROP_MARGIN_MAX_PX = 160;
|
|
8728
8769
|
CROP_MARGIN_MIN_PX = 28;
|
|
@@ -8731,7 +8772,7 @@ var init_screenshot = __esm({
|
|
|
8731
8772
|
OUTPUT_MAX_DPR = 2;
|
|
8732
8773
|
OUTPUT_MAX_PIXELS = 26e5;
|
|
8733
8774
|
DATA_URL_SOFT_MAX = 36e5;
|
|
8734
|
-
RENDER_TIMEOUT_MS =
|
|
8775
|
+
RENDER_TIMEOUT_MS = SCREENSHOT_RENDER_BUDGET_MS;
|
|
8735
8776
|
PII_PATTERNS2 = [
|
|
8736
8777
|
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,
|
|
8737
8778
|
/\b\d{3}-\d{2}-\d{4}\b/g,
|
|
@@ -9169,13 +9210,7 @@ function normalizeRoute(href, base) {
|
|
|
9169
9210
|
|
|
9170
9211
|
// src/picker/activate.ts
|
|
9171
9212
|
init_warn();
|
|
9172
|
-
|
|
9173
|
-
// src/picker/message.ts
|
|
9174
|
-
var DESIGN_MODE_PROTOCOL = 2;
|
|
9175
|
-
var DESIGN_MODE_READY = "arcy:design-mode:ready";
|
|
9176
|
-
var DESIGN_MODE_PICK = "arcy:design-mode:pick";
|
|
9177
|
-
var DESIGN_MODE_EXIT = "arcy:design-mode:exit";
|
|
9178
|
-
var DESIGN_MODE_SCREENSHOT = "arcy:design-mode:screenshot";
|
|
9213
|
+
init_message();
|
|
9179
9214
|
|
|
9180
9215
|
// src/picker/notice.ts
|
|
9181
9216
|
init_host();
|
|
@@ -13114,6 +13149,11 @@ function createArcyInternals(internalOptions = {}) {
|
|
|
13114
13149
|
welcomeMessage: text(raw?.welcomeMessage),
|
|
13115
13150
|
inputPlaceholder: text(raw?.inputPlaceholder),
|
|
13116
13151
|
welcomeHeadline: text(raw?.welcomeHeadline),
|
|
13152
|
+
// Which copy the three texts above are (ADR 0195). Shape-checked like
|
|
13153
|
+
// everything else read out of the bootstrap (ADR 0050), and anything
|
|
13154
|
+
// that is not one of the two audiences reads as the empty string, which
|
|
13155
|
+
// the panel treats as "not known yet" and never as a change.
|
|
13156
|
+
audience: raw?.audience === "identified" || raw?.audience === "anonymous" ? raw.audience : "",
|
|
13117
13157
|
// Re-checked here rather than trusted: a rewritten bootstrap must not
|
|
13118
13158
|
// be able to turn a camera prompt on for an operator who never did
|
|
13119
13159
|
// (ADR 0050, ADR 0102).
|