@constructor-io/constructorio-ui-pia 2.10.3 → 2.10.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.
|
@@ -54,7 +54,7 @@ Error generating stack: `+i.message+`
|
|
|
54
54
|
|
|
55
55
|
crc-32/crc32.js:
|
|
56
56
|
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
|
57
|
-
*/class Sp extends Error{constructor(o){super(`Request failed with status ${o}`);Ie(this,"status");this.name="AgentRequestError",this.status=o}}function kc({itemId:r,threadId:a,variationId:o,question:s,isStreaming:f=!1,options:h,parameters:d={}}){const{apiKey:m,agentServiceUrl:p,clientId:c,sessionId:g,userId:b,segments:y,version:_}=h;if(!p)throw new Error("Agent service URL is required");let E=`${p}/v1/item_questions`;s&&(E+=`/${encodeURIComponent(s)}/answer`),f&&(E+="/streaming");const w=new URL(E);return w.searchParams.append("item_id",r),w.searchParams.append("key",m),a&&w.searchParams.append("thread_id",a),o&&w.searchParams.append("variation_id",o),c&&w.searchParams.append("i",c),g!=null&&w.searchParams.append("s",String(g)),b&&w.searchParams.append("ui",b),_&&w.searchParams.append("c",_),y!=null&&y.length&&y.forEach(A=>w.searchParams.append("us",A)),Object.entries(d).forEach(([A,S])=>{S!==void 0&&w.searchParams.append(A,String(S))}),w.toString()}function I_(r){const a={};return r.numResults!==void 0&&(a.num_results=r.numResults),a}class G_{constructor(a){Ie(this,"options");this.options=a}async getSuggestedQuestions({itemId:a,variationId:o,threadId:s,parameters:f={},requestParameters:h={}}){if(!a)throw new Error("Item ID is required");if(!this.options.apiKey)throw new Error("API key is required");const d=kc({itemId:a,variationId:o,threadId:s,options:this.options,parameters:{...h,...I_(f)}});try{const m=await fetch(d);if(!m.ok)throw new Sp(m.status);return await m.json()}catch(m){throw m instanceof Error?m:new Error(String(m))}}async getAnswerResults({itemId:a,variationId:o,threadId:s,question:f,parameters:h={}}){if(!a)throw new Error("Item ID is required");if(!f)throw new Error("Question is required");if(!this.options.apiKey)throw new Error("API key is required");const d=kc({itemId:a,threadId:s,variationId:o,question:f,options:this.options,parameters:h});try{const m=await fetch(d);if(!m.ok)throw new Sp(m.status);return await m.json()}catch(m){throw m instanceof Error?m:new Error(String(m))}}async getAnswerResultsStream({itemId:a,threadId:o,variationId:s,question:f,parameters:h,onStart:d,onMessage:m,onEnd:p}){if(!a)throw new Error("Item ID is required");if(!f)throw new Error("Question is required");if(!this.options.apiKey)throw new Error("API key is required");const c=kc({itemId:a,threadId:o,variationId:s,question:f,isStreaming:!0,options:this.options,parameters:h});try{const g=new EventSource(c);g.addEventListener("open",b=>{const y=JSON.parse(b.data);d&&d(y)}),g.addEventListener("message",b=>{const y=JSON.parse(b.data);m&&m(y)}),g.addEventListener("end",b=>{const y=JSON.parse(b.data);p&&p(y),g.close()}),g.onerror=()=>{throw g.close(),new Error("Unexpected error occurred. Please try again.")}}catch(g){const b=g instanceof Error?g.message:String(g);throw new Error(b)}}}const Dg="2.10.3";class V_{constructor(a){Ie(this,"options");Ie(this,"search");Ie(this,"browse");Ie(this,"recommendations");Ie(this,"tracker");Ie(this,"quizzes");Ie(this,"agent");const o=typeof window>"u"||typeof document>"u",s={version:a.version||`cio-ui-pia-${Dg}`,serviceUrl:a.serviceUrl||"https://ac.cnstrc.com",quizzesServiceUrl:a.quizzesServiceUrl||"https://quizzes.cnstrc.com",agentServiceUrl:a.agentServiceUrl||"https://agent.cnstrc.com",...o&&{clientId:a.clientId||"this-is-a-random-client-id"},sendTrackingEvents:a.sendTrackingEvents!==void 0?a.sendTrackingEvents:!0,beaconMode:a.beaconMode!==void 0?a.beaconMode:!0,networkParameters:a.networkParameters||{},...a},f=new j_(s),{clientId:h,sessionId:d}=f.agent.options;this.options={...s,clientId:h,sessionId:d},this.search=f.search,this.browse=f.browse,this.recommendations=f.recommendations,this.tracker=f.tracker,this.quizzes=f.quizzes,this.agent=new G_(this.options)}}function Q_(r,a){const{value:o,matched_terms:s,data:f,...h}=r;if(!f||typeof f!="object"||!f.id||!o)return null;const{id:d,variation_id:m,description:p,url:c,image_url:g,price:b,sale_price:y,rating:_,reviews_count:E,tags:w,sl_campaign_id:A,sl_campaign_owner:S,badge:C,...N}=f;let O=g;if(a&&g)try{O=a(g)}catch{O=g}return{id:d,name:o,matchedTerms:s,variationId:m,description:p,url:c,imageUrl:O,price:b,salePrice:y,rating:_,reviewsCount:E,tags:w,slCampaignId:A,slCampaignOwner:S,badge:C,data:{...N},...h}}function Y_(r,a){var f,h;if(!((h=(f=r==null?void 0:r.item_results)==null?void 0:f.response)!=null&&h.results))return null;const{results:o}=r.item_results.response;if(!Array.isArray(o)||o.length===0)return null;const s=o.map(d=>Q_(d,a)).filter(d=>d!==null);return s.length>0?s:null}const $_=async({client:r,itemId:a,question:o,variationId:s,threadId:f,parameters:h})=>await r.agent.getAnswerResults({itemId:a,variationId:s,threadId:f,question:o,parameters:h});function X_({itemId:r,variationId:a,threadId:o,cioClient:s,parameters:f,formatImageUrl:h}){const[d,m]=F.useState(null),[p,c]=F.useState(!1),[g,b]=F.useState(null),y=F.useMemo(()=>Y_(d,h),[d,h]),_=F.useCallback(E=>{s&&(c(!0),b(null),m(null),$_({client:s,itemId:r,question:E,variationId:a,threadId:o,parameters:f}).then(w=>{m(w),b(null)}).catch(w=>{b(w instanceof Error?w:new Error("Error fetching answer")),m(null)}).finally(()=>{c(!1)}))},[s,r,a,o,f]);return{data:d,items:y,isLoading:p,error:g,getAnswer:_}}const P_=async({client:r,itemId:a,variationId:o,threadId:s,parameters:f,requestParameters:h})=>(await r.agent.getSuggestedQuestions({itemId:a,variationId:o,threadId:s,parameters:f,requestParameters:h})).questions;function Z_({itemId:r,variationId:a,threadId:o,cioClient:s,parameters:f,requestParameters:h}){const[d,m]=F.useState([]),[p,c]=F.useState(!1),[g,b]=F.useState(null),y=JSON.stringify(h),_=F.useCallback(()=>{s&&(c(!0),b(null),P_({client:s,itemId:r,variationId:a,threadId:o,parameters:f,requestParameters:h}).then(E=>{m(E),b(null)}).catch(E=>{b(E instanceof Error?E:new Error("Error fetching questions"))}).finally(()=>{c(!1)}))},[s,r,a,o,f==null?void 0:f.numResults,y]);return F.useEffect(()=>{_()},[_]),{data:d,isLoading:p,error:g,getSuggestedQuestions:_}}function K_(r){const{apiKey:a,itemId:o,variationId:s,threadId:f,cioClient:h,suggestedQuestionsParameters:d,parameters:m,formatImageUrl:p}=r,[c]=F.useState(()=>crypto.randomUUID()),g=f||c,b=F.useMemo(()=>h||new V_({apiKey:a,sendTrackingEvents:!0,version:`cio-ui-pia-${Dg}`}),[a,h]),y=Z_({itemId:o,variationId:s,threadId:g,cioClient:b,parameters:d,requestParameters:m}),_=X_({itemId:o,variationId:s,threadId:g,cioClient:b,parameters:m,formatImageUrl:p});return{cioClient:b,threadId:g,suggestedQuestions:y,answers:_}}function J_({pia:r,itemId:a,isConversation:o,callbacks:s,tracking:f}){var ce,ie;const{suggestedQuestions:h,answers:d,threadId:m}=r,{getAnswer:p}=d,c=F.useMemo(()=>({itemId:a,threadId:m}),[a,m]),[g,b]=F.useState(""),[y,_]=F.useState([]),[E,w]=F.useState([]),A=F.useRef(0),S=F.useRef((ce=d.data)==null?void 0:ce.value),C=F.useRef(!1),N=F.useRef(d),O=F.useRef(s),H=F.useRef(c),k=F.useRef(f),R=F.useRef(""),x=F.useRef("user");F.useEffect(()=>{O.current=s},[s]),F.useEffect(()=>{H.current=c},[c]),F.useEffect(()=>{k.current=f},[f]),F.useEffect(()=>{N.current=d},[d]);const L=F.useCallback((q,Q)=>{if(x.current=Q,R.current=q,C.current=!1,b(q),p(q),o){A.current+=1;const J=A.current;w(ae=>[...ae,{id:J,question:q,answer:"",source:Q}])}},[p,o]),M=F.useCallback(q=>{var Q,J,ae;(Q=k.current)==null||Q.trackQuestionSubmit(q),(ae=(J=O.current)==null?void 0:J.onQuestionSubmit)==null||ae.call(J,q,H.current,"user"),L(q,"user")},[L]),G=F.useCallback(q=>{var Q,J,ae;(Q=k.current)==null||Q.trackQuestionClick(q),(ae=(J=O.current)==null?void 0:J.onQuestionSubmit)==null||ae.call(J,q,H.current,"suggestion"),L(q,"suggestion")},[L]),I=F.useCallback(()=>{var q,Q,J;(q=k.current)==null||q.trackFocus(),(J=(Q=O.current)==null?void 0:Q.onFocus)==null||J.call(Q,H.current)},[]),ee=F.useCallback(q=>{var Q,J,ae,ue;(J=k.current)==null||J.trackAnswerFeedback(q,(Q=N.current.data)==null?void 0:Q.qna_result_id),(ue=(ae=O.current)==null?void 0:ae.onFeedback)==null||ue.call(ae,q)},[]),ne=F.useCallback(()=>{b(""),_(h.data),w([]),S.current=void 0},[h.data]);F.useEffect(()=>{b(""),_([]),w([]),S.current=void 0},[a]),F.useEffect(()=>{_(h.data)},[h.data]),F.useEffect(()=>{var q,Q;(q=d.data)!=null&&q.follow_up_questions&&_(d.data.follow_up_questions),d.data&&R.current&&!C.current&&(C.current=!0,(Q=k.current)==null||Q.trackAnswerView(R.current,d.data,d.items))},[d.data,d.items]),F.useEffect(()=>{var ae,ue,de,me,Te;const q=((ae=d.data)==null?void 0:ae.value)??"";if(!q||q===S.current)return;S.current=q;const Q=(ue=d.data)==null?void 0:ue.thread_id,J=(de=d.data)==null?void 0:de.qna_result_id;if(o)w(pe=>{var _e,he;if(pe.length===0)return pe;const ze=[...pe];return ze[ze.length-1]={...ze[ze.length-1],answer:q,items:d.items,threadId:Q,qnaResultId:J},(he=(_e=O.current)==null?void 0:_e.onAnswer)==null||he.call(_e,ze,H.current),ze});else{const pe={id:A.current,question:R.current,answer:q,source:x.current,items:d.items,threadId:Q,qnaResultId:J};(Te=(me=O.current)==null?void 0:me.onAnswer)==null||Te.call(me,[pe],H.current)}},[o,d.data,d.items]);const oe=((ie=d.data)==null?void 0:ie.value)??"",B=d.items??null,Z=d.error||h.error,le=d.isLoading||h.isLoading;return{currentQuestion:g,displayedQuestions:y,conversationHistory:E,currentAnswer:oe,currentItems:B,isLoading:le,error:Z,context:c,handleSubmitQuestion:M,handleQuestionClick:G,handleInputFocus:I,handleFeedback:ee,resetState:ne}}var Ra=(r=>(r.UP="up",r.DOWN="down",r))(Ra||{});function F_({cioClient:r,itemId:a,itemName:o,variationId:s,threadId:f}){const h=r==null?void 0:r.tracker,d=F.useMemo(()=>({itemId:a,itemName:o,...s&&{variationId:s},...f&&{threadId:f}}),[a,o,s,f]),m=F.useCallback(S=>S.map(C=>({question:C.value})),[]),p=F.useCallback((S,C)=>{h==null||h.trackProductInsightsAgentViews({...d,questions:m(S),viewTimespans:C})},[h,d,m]),c=F.useCallback(S=>{h==null||h.trackProductInsightsAgentView({...d,questions:m(S)})},[h,d,m]),g=F.useCallback(()=>{h==null||h.trackProductInsightsAgentOutOfView(d)},[h,d]),b=F.useCallback(()=>{h==null||h.trackProductInsightsAgentFocus(d)},[h,d]),y=F.useCallback(S=>{h==null||h.trackProductInsightsAgentQuestionClick({...d,question:S})},[h,d]),_=F.useCallback(S=>{h==null||h.trackProductInsightsAgentQuestionSubmit({...d,question:S})},[h,d]),E=F.useCallback((S,C,N)=>{h==null||h.trackProductInsightsAgentAnswerView({...d,question:S,answerText:C.value,qnaResultId:C.qna_result_id,...N&&N.length>0&&{items:N.map(O=>({itemId:O.id,itemName:O.name}))},...C.follow_up_questions&&C.follow_up_questions.length>0&&{followUpQuestions:C.follow_up_questions.map(O=>({value:O.value}))}})},[h,d]),w=F.useCallback((S,C)=>{const N=S===Ra.UP?"thumbs_up":"thumbs_down";h==null||h.trackProductInsightsAgentAnswerFeedback({...d,feedbackLabel:N,...C&&{qnaResultId:C}})},[h,d]),A=F.useCallback((S,C,N,O)=>{h==null||h.trackProductInsightsAgentResultClick({itemId:S.id,itemName:S.name,...S.variationId&&{variationId:S.variationId},question:N,seedItemId:a,seedItemName:o,...s&&{seedVariationId:s},...O&&{qnaResultId:O},...f&&{threadId:f},position:C})},[h,a,o,s,f]);return F.useMemo(()=>({trackViews:p,trackView:c,trackOutOfView:g,trackFocus:b,trackQuestionClick:y,trackQuestionSubmit:_,trackAnswerView:E,trackAnswerFeedback:w,trackResultClick:A}),[p,c,g,b,y,_,E,w,A])}const W_=300*1e3;function e1({tracking:r,questions:a}){const o=F.useRef(null),s=F.useRef(null),f=F.useRef(null),h=F.useRef([]),d=F.useRef(null),m=F.useRef(a),p=F.useRef(r);F.useEffect(()=>{const _=m.current.length===0&&a.length>0;m.current=a,_&&d.current&&p.current.trackView(a)},[a]),F.useEffect(()=>{p.current=r},[r]);const c=F.useCallback(()=>{d.current&&(h.current.push({start:d.current,end:new Date().toISOString()}),d.current=null),h.current.length>0&&m.current.length>0&&(p.current.trackViews(m.current,[...h.current]),h.current=[])},[]),g=F.useCallback(_=>{const E=new IntersectionObserver(([A])=>{A.isIntersecting?(d.current=new Date().toISOString(),m.current.length>0&&p.current.trackView(m.current)):d.current&&(h.current.push({start:d.current,end:new Date().toISOString()}),d.current=null,p.current.trackOutOfView())},{threshold:.5});E.observe(_),s.current=E,f.current=setInterval(c,W_);const w=()=>{document.visibilityState==="hidden"&&c()};return document.addEventListener("visibilitychange",w),()=>{E.disconnect(),f.current&&clearInterval(f.current),document.removeEventListener("visibilitychange",w),c()}},[c]),b=F.useRef(null),y=F.useCallback(_=>{b.current&&(b.current(),b.current=null),o.current=_,_&&(b.current=g(_))},[g]);return F.useEffect(()=>()=>{b.current&&(b.current(),b.current=null)},[]),{containerRef:y}}function t1({callbacks:r,context:a}){const o=F.useRef(r),s=F.useRef(a),f=F.useRef(!1),h=F.useRef(!1),d=F.useRef(null);return F.useEffect(()=>{o.current=r},[r]),F.useEffect(()=>{s.current=a},[a]),F.useEffect(()=>()=>{var p;(p=d.current)==null||p.disconnect()},[]),{containerRef:F.useCallback(p=>{if(d.current&&(d.current.disconnect(),d.current=null),!p)return;f.current=!1,h.current=!1;const c=new IntersectionObserver(([g])=>{var b,y,_,E;g.isIntersecting&&!f.current?(f.current=!0,(y=(b=o.current)==null?void 0:b.onView)==null||y.call(b,s.current)):!g.isIntersecting&&f.current&&!h.current&&(h.current=!0,(E=(_=o.current)==null?void 0:_.onOutOfView)==null||E.call(_,s.current),c.disconnect())},{threshold:.5});c.observe(p),d.current=c},[])}}function n1(){return U.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U.createElement("path",{d:"M12.0004 2C6.4804 2 2.0004 6.48 2.0004 12C2.0004 17.52 6.4804 22 12.0004 22C17.5204 22 22.0004 17.52 22.0004 12C22.0004 6.48 17.5204 2 12.0004 2ZM13.0004 17H11.0004V15H13.0004V17ZM13.0004 13H11.0004V7H13.0004V13Z",fill:"#F1923A"}))}function i1(){return U.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U.createElement("path",{d:"M11.7633 4.23329C10.7966 3.26663 9.46992 2.66663 7.99659 2.66663C5.04992 2.66663 2.66992 5.05329 2.66992 7.99996C2.66992 10.9466 5.04992 13.3333 7.99659 13.3333C10.4833 13.3333 12.5566 11.6333 13.1499 9.33329H11.7633C11.2166 10.8866 9.73659 12 7.99659 12C5.78992 12 3.99659 10.2066 3.99659 7.99996C3.99659 5.79329 5.78992 3.99996 7.99659 3.99996C9.10326 3.99996 10.0899 4.45996 10.8099 5.18663L8.66326 7.33329H13.3299V2.66663L11.7633 4.23329Z",fill:"white"}))}function Ug({message:r,onRetry:a=void 0}){return U.createElement("div",{className:"cio-pia-error-block-container","data-testid":"error-block"},U.createElement("div",{className:"cio-pia-error-block-warning-icon-container","data-testid":"error-block-warning-icon"},U.createElement(n1,null)),U.createElement("div",{className:"cio-pia-error-block-text-container"},U.createElement("p",{className:"cio-pia-error-block-text"},r),a&&U.createElement("button",{type:"button",onClick:a,className:"cio-pia-error-block-retry-button"},U.createElement(i1,null),"Retry")))}const Ep=U.createElement("div",{className:"cio-pia-loading-skeleton","data-testid":"loading-skeleton"},U.createElement("div",{className:"skeleton-bar"}),U.createElement("div",{className:"skeleton-bar"}),U.createElement("div",{className:"skeleton-bar skeleton-short"}));function Lg({componentOverride:r}={}){return U.createElement(Ye,{props:{skeleton:Ep},override:r==null?void 0:r.reactNode},Ep)}/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function wp(r,a){(a==null||a>r.length)&&(a=r.length);for(var o=0,s=Array(a);o<a;o++)s[o]=r[o];return s}function r1(r){if(Array.isArray(r))return r}function a1(r,a){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var s,f,h,d,m=[],p=!0,c=!1;try{if(h=(o=o.call(r)).next,a!==0)for(;!(p=(s=h.call(o)).done)&&(m.push(s.value),m.length!==a);p=!0);}catch(g){c=!0,f=g}finally{try{if(!p&&o.return!=null&&(d=o.return(),Object(d)!==d))return}finally{if(c)throw f}}return m}}function l1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
+
*/class Sp extends Error{constructor(o){super(`Request failed with status ${o}`);Ie(this,"status");this.name="AgentRequestError",this.status=o}}function kc({itemId:r,threadId:a,variationId:o,question:s,isStreaming:f=!1,options:h,parameters:d={}}){const{apiKey:m,agentServiceUrl:p,clientId:c,sessionId:g,userId:b,segments:y,version:_}=h;if(!p)throw new Error("Agent service URL is required");let E=`${p}/v1/item_questions`;s&&(E+=`/${encodeURIComponent(s)}/answer`),f&&(E+="/streaming");const w=new URL(E);return w.searchParams.append("item_id",r),w.searchParams.append("key",m),a&&w.searchParams.append("thread_id",a),o&&w.searchParams.append("variation_id",o),c&&w.searchParams.append("i",c),g!=null&&w.searchParams.append("s",String(g)),b&&w.searchParams.append("ui",b),_&&w.searchParams.append("c",_),y!=null&&y.length&&y.forEach(A=>w.searchParams.append("us",A)),Object.entries(d).forEach(([A,S])=>{S!==void 0&&w.searchParams.append(A,String(S))}),w.toString()}function I_(r){const a={};return r.numResults!==void 0&&(a.num_results=r.numResults),a}class G_{constructor(a){Ie(this,"options");this.options=a}async getSuggestedQuestions({itemId:a,variationId:o,threadId:s,parameters:f={},requestParameters:h={}}){if(!a)throw new Error("Item ID is required");if(!this.options.apiKey)throw new Error("API key is required");const d=kc({itemId:a,variationId:o,threadId:s,options:this.options,parameters:{...h,...I_(f)}});try{const m=await fetch(d);if(!m.ok)throw new Sp(m.status);return await m.json()}catch(m){throw m instanceof Error?m:new Error(String(m))}}async getAnswerResults({itemId:a,variationId:o,threadId:s,question:f,parameters:h={}}){if(!a)throw new Error("Item ID is required");if(!f)throw new Error("Question is required");if(!this.options.apiKey)throw new Error("API key is required");const d=kc({itemId:a,threadId:s,variationId:o,question:f,options:this.options,parameters:h});try{const m=await fetch(d);if(!m.ok)throw new Sp(m.status);return await m.json()}catch(m){throw m instanceof Error?m:new Error(String(m))}}async getAnswerResultsStream({itemId:a,threadId:o,variationId:s,question:f,parameters:h,onStart:d,onMessage:m,onEnd:p}){if(!a)throw new Error("Item ID is required");if(!f)throw new Error("Question is required");if(!this.options.apiKey)throw new Error("API key is required");const c=kc({itemId:a,threadId:o,variationId:s,question:f,isStreaming:!0,options:this.options,parameters:h});try{const g=new EventSource(c);g.addEventListener("open",b=>{const y=JSON.parse(b.data);d&&d(y)}),g.addEventListener("message",b=>{const y=JSON.parse(b.data);m&&m(y)}),g.addEventListener("end",b=>{const y=JSON.parse(b.data);p&&p(y),g.close()}),g.onerror=()=>{throw g.close(),new Error("Unexpected error occurred. Please try again.")}}catch(g){const b=g instanceof Error?g.message:String(g);throw new Error(b)}}}const Dg="2.10.4";class V_{constructor(a){Ie(this,"options");Ie(this,"search");Ie(this,"browse");Ie(this,"recommendations");Ie(this,"tracker");Ie(this,"quizzes");Ie(this,"agent");const o=typeof window>"u"||typeof document>"u",s={version:a.version||`cio-ui-pia-${Dg}`,serviceUrl:a.serviceUrl||"https://ac.cnstrc.com",quizzesServiceUrl:a.quizzesServiceUrl||"https://quizzes.cnstrc.com",agentServiceUrl:a.agentServiceUrl||"https://agent.cnstrc.com",...o&&{clientId:a.clientId||"this-is-a-random-client-id"},sendTrackingEvents:a.sendTrackingEvents!==void 0?a.sendTrackingEvents:!0,beaconMode:a.beaconMode!==void 0?a.beaconMode:!0,networkParameters:a.networkParameters||{},...a},f=new j_(s),{clientId:h,sessionId:d}=f.agent.options;this.options={...s,clientId:h,sessionId:d},this.search=f.search,this.browse=f.browse,this.recommendations=f.recommendations,this.tracker=f.tracker,this.quizzes=f.quizzes,this.agent=new G_(this.options)}}function Q_(r,a){const{value:o,matched_terms:s,data:f,...h}=r;if(!f||typeof f!="object"||!f.id||!o)return null;const{id:d,variation_id:m,description:p,url:c,image_url:g,price:b,sale_price:y,rating:_,reviews_count:E,tags:w,sl_campaign_id:A,sl_campaign_owner:S,badge:C,...N}=f;let O=g;if(a&&g)try{O=a(g)}catch{O=g}return{id:d,name:o,matchedTerms:s,variationId:m,description:p,url:c,imageUrl:O,price:b,salePrice:y,rating:_,reviewsCount:E,tags:w,slCampaignId:A,slCampaignOwner:S,badge:C,data:{...N},...h}}function Y_(r,a){var f,h;if(!((h=(f=r==null?void 0:r.item_results)==null?void 0:f.response)!=null&&h.results))return null;const{results:o}=r.item_results.response;if(!Array.isArray(o)||o.length===0)return null;const s=o.map(d=>Q_(d,a)).filter(d=>d!==null);return s.length>0?s:null}const $_=async({client:r,itemId:a,question:o,variationId:s,threadId:f,parameters:h})=>await r.agent.getAnswerResults({itemId:a,variationId:s,threadId:f,question:o,parameters:h});function X_({itemId:r,variationId:a,threadId:o,cioClient:s,parameters:f,formatImageUrl:h}){const[d,m]=F.useState(null),[p,c]=F.useState(!1),[g,b]=F.useState(null),y=F.useMemo(()=>Y_(d,h),[d,h]),_=F.useCallback(E=>{s&&(c(!0),b(null),m(null),$_({client:s,itemId:r,question:E,variationId:a,threadId:o,parameters:f}).then(w=>{m(w),b(null)}).catch(w=>{b(w instanceof Error?w:new Error("Error fetching answer")),m(null)}).finally(()=>{c(!1)}))},[s,r,a,o,f]);return{data:d,items:y,isLoading:p,error:g,getAnswer:_}}const P_=async({client:r,itemId:a,variationId:o,threadId:s,parameters:f,requestParameters:h})=>(await r.agent.getSuggestedQuestions({itemId:a,variationId:o,threadId:s,parameters:f,requestParameters:h})).questions;function Z_({itemId:r,variationId:a,threadId:o,cioClient:s,parameters:f,requestParameters:h}){const[d,m]=F.useState([]),[p,c]=F.useState(!1),[g,b]=F.useState(null),y=JSON.stringify(h),_=F.useCallback(()=>{s&&(c(!0),b(null),P_({client:s,itemId:r,variationId:a,threadId:o,parameters:f,requestParameters:h}).then(E=>{m(E),b(null)}).catch(E=>{b(E instanceof Error?E:new Error("Error fetching questions"))}).finally(()=>{c(!1)}))},[s,r,a,o,f==null?void 0:f.numResults,y]);return F.useEffect(()=>{_()},[_]),{data:d,isLoading:p,error:g,getSuggestedQuestions:_}}function K_(r){const{apiKey:a,itemId:o,variationId:s,threadId:f,cioClient:h,suggestedQuestionsParameters:d,parameters:m,formatImageUrl:p}=r,[c]=F.useState(()=>crypto.randomUUID()),g=f||c,b=F.useMemo(()=>h||new V_({apiKey:a,sendTrackingEvents:!0,version:`cio-ui-pia-${Dg}`}),[a,h]),y=Z_({itemId:o,variationId:s,threadId:g,cioClient:b,parameters:d,requestParameters:m}),_=X_({itemId:o,variationId:s,threadId:g,cioClient:b,parameters:m,formatImageUrl:p});return{cioClient:b,threadId:g,suggestedQuestions:y,answers:_}}function J_({pia:r,itemId:a,isConversation:o,callbacks:s,tracking:f}){var ce,ie;const{suggestedQuestions:h,answers:d,threadId:m}=r,{getAnswer:p}=d,c=F.useMemo(()=>({itemId:a,threadId:m}),[a,m]),[g,b]=F.useState(""),[y,_]=F.useState([]),[E,w]=F.useState([]),A=F.useRef(0),S=F.useRef((ce=d.data)==null?void 0:ce.value),C=F.useRef(!1),N=F.useRef(d),O=F.useRef(s),H=F.useRef(c),k=F.useRef(f),R=F.useRef(""),x=F.useRef("user");F.useEffect(()=>{O.current=s},[s]),F.useEffect(()=>{H.current=c},[c]),F.useEffect(()=>{k.current=f},[f]),F.useEffect(()=>{N.current=d},[d]);const L=F.useCallback((q,Q)=>{if(x.current=Q,R.current=q,C.current=!1,b(q),p(q),o){A.current+=1;const J=A.current;w(ae=>[...ae,{id:J,question:q,answer:"",source:Q}])}},[p,o]),M=F.useCallback(q=>{var Q,J,ae;(Q=k.current)==null||Q.trackQuestionSubmit(q),(ae=(J=O.current)==null?void 0:J.onQuestionSubmit)==null||ae.call(J,q,H.current,"user"),L(q,"user")},[L]),G=F.useCallback(q=>{var Q,J,ae;(Q=k.current)==null||Q.trackQuestionClick(q),(ae=(J=O.current)==null?void 0:J.onQuestionSubmit)==null||ae.call(J,q,H.current,"suggestion"),L(q,"suggestion")},[L]),I=F.useCallback(()=>{var q,Q,J;(q=k.current)==null||q.trackFocus(),(J=(Q=O.current)==null?void 0:Q.onFocus)==null||J.call(Q,H.current)},[]),ee=F.useCallback(q=>{var Q,J,ae,ue;(J=k.current)==null||J.trackAnswerFeedback(q,(Q=N.current.data)==null?void 0:Q.qna_result_id),(ue=(ae=O.current)==null?void 0:ae.onFeedback)==null||ue.call(ae,q)},[]),ne=F.useCallback(()=>{b(""),_(h.data),w([]),S.current=void 0},[h.data]);F.useEffect(()=>{b(""),_([]),w([]),S.current=void 0},[a]),F.useEffect(()=>{_(h.data)},[h.data]),F.useEffect(()=>{var q,Q;(q=d.data)!=null&&q.follow_up_questions&&_(d.data.follow_up_questions),d.data&&R.current&&!C.current&&(C.current=!0,(Q=k.current)==null||Q.trackAnswerView(R.current,d.data,d.items))},[d.data,d.items]),F.useEffect(()=>{var ae,ue,de,me,Te;const q=((ae=d.data)==null?void 0:ae.value)??"";if(!q||q===S.current)return;S.current=q;const Q=(ue=d.data)==null?void 0:ue.thread_id,J=(de=d.data)==null?void 0:de.qna_result_id;if(o)w(pe=>{var _e,he;if(pe.length===0)return pe;const ze=[...pe];return ze[ze.length-1]={...ze[ze.length-1],answer:q,items:d.items,threadId:Q,qnaResultId:J},(he=(_e=O.current)==null?void 0:_e.onAnswer)==null||he.call(_e,ze,H.current),ze});else{const pe={id:A.current,question:R.current,answer:q,source:x.current,items:d.items,threadId:Q,qnaResultId:J};(Te=(me=O.current)==null?void 0:me.onAnswer)==null||Te.call(me,[pe],H.current)}},[o,d.data,d.items]);const oe=((ie=d.data)==null?void 0:ie.value)??"",B=d.items??null,Z=d.error||h.error,le=d.isLoading||h.isLoading;return{currentQuestion:g,displayedQuestions:y,conversationHistory:E,currentAnswer:oe,currentItems:B,isLoading:le,error:Z,context:c,handleSubmitQuestion:M,handleQuestionClick:G,handleInputFocus:I,handleFeedback:ee,resetState:ne}}var Ra=(r=>(r.UP="up",r.DOWN="down",r))(Ra||{});function F_({cioClient:r,itemId:a,itemName:o,variationId:s,threadId:f}){const h=r==null?void 0:r.tracker,d=F.useMemo(()=>({itemId:a,itemName:o,...s&&{variationId:s},...f&&{threadId:f}}),[a,o,s,f]),m=F.useCallback(S=>S.map(C=>({question:C.value})),[]),p=F.useCallback((S,C)=>{h==null||h.trackProductInsightsAgentViews({...d,questions:m(S),viewTimespans:C})},[h,d,m]),c=F.useCallback(S=>{h==null||h.trackProductInsightsAgentView({...d,questions:m(S)})},[h,d,m]),g=F.useCallback(()=>{h==null||h.trackProductInsightsAgentOutOfView(d)},[h,d]),b=F.useCallback(()=>{h==null||h.trackProductInsightsAgentFocus(d)},[h,d]),y=F.useCallback(S=>{h==null||h.trackProductInsightsAgentQuestionClick({...d,question:S})},[h,d]),_=F.useCallback(S=>{h==null||h.trackProductInsightsAgentQuestionSubmit({...d,question:S})},[h,d]),E=F.useCallback((S,C,N)=>{h==null||h.trackProductInsightsAgentAnswerView({...d,question:S,answerText:C.value,qnaResultId:C.qna_result_id,...N&&N.length>0&&{items:N.map(O=>({itemId:O.id,itemName:O.name}))},...C.follow_up_questions&&C.follow_up_questions.length>0&&{followUpQuestions:C.follow_up_questions.map(O=>({value:O.value}))}})},[h,d]),w=F.useCallback((S,C)=>{const N=S===Ra.UP?"thumbs_up":"thumbs_down";h==null||h.trackProductInsightsAgentAnswerFeedback({...d,feedbackLabel:N,...C&&{qnaResultId:C}})},[h,d]),A=F.useCallback((S,C,N,O)=>{h==null||h.trackProductInsightsAgentResultClick({itemId:S.id,itemName:S.name,...S.variationId&&{variationId:S.variationId},question:N,seedItemId:a,seedItemName:o,...s&&{seedVariationId:s},...O&&{qnaResultId:O},...f&&{threadId:f},position:C})},[h,a,o,s,f]);return F.useMemo(()=>({trackViews:p,trackView:c,trackOutOfView:g,trackFocus:b,trackQuestionClick:y,trackQuestionSubmit:_,trackAnswerView:E,trackAnswerFeedback:w,trackResultClick:A}),[p,c,g,b,y,_,E,w,A])}const W_=300*1e3;function e1({tracking:r,questions:a}){const o=F.useRef(null),s=F.useRef(null),f=F.useRef(null),h=F.useRef([]),d=F.useRef(null),m=F.useRef(a),p=F.useRef(r);F.useEffect(()=>{const _=m.current.length===0&&a.length>0;m.current=a,_&&d.current&&p.current.trackView(a)},[a]),F.useEffect(()=>{p.current=r},[r]);const c=F.useCallback(()=>{d.current&&(h.current.push({start:d.current,end:new Date().toISOString()}),d.current=null),h.current.length>0&&m.current.length>0&&(p.current.trackViews(m.current,[...h.current]),h.current=[])},[]),g=F.useCallback(_=>{const E=new IntersectionObserver(([A])=>{A.isIntersecting?(d.current=new Date().toISOString(),m.current.length>0&&p.current.trackView(m.current)):d.current&&(h.current.push({start:d.current,end:new Date().toISOString()}),d.current=null,p.current.trackOutOfView())},{threshold:.5});E.observe(_),s.current=E,f.current=setInterval(c,W_);const w=()=>{document.visibilityState==="hidden"&&c()};return document.addEventListener("visibilitychange",w),()=>{E.disconnect(),f.current&&clearInterval(f.current),document.removeEventListener("visibilitychange",w),c()}},[c]),b=F.useRef(null),y=F.useCallback(_=>{b.current&&(b.current(),b.current=null),o.current=_,_&&(b.current=g(_))},[g]);return F.useEffect(()=>()=>{b.current&&(b.current(),b.current=null)},[]),{containerRef:y}}function t1({callbacks:r,context:a}){const o=F.useRef(r),s=F.useRef(a),f=F.useRef(!1),h=F.useRef(!1),d=F.useRef(null);return F.useEffect(()=>{o.current=r},[r]),F.useEffect(()=>{s.current=a},[a]),F.useEffect(()=>()=>{var p;(p=d.current)==null||p.disconnect()},[]),{containerRef:F.useCallback(p=>{if(d.current&&(d.current.disconnect(),d.current=null),!p)return;f.current=!1,h.current=!1;const c=new IntersectionObserver(([g])=>{var b,y,_,E;g.isIntersecting&&!f.current?(f.current=!0,(y=(b=o.current)==null?void 0:b.onView)==null||y.call(b,s.current)):!g.isIntersecting&&f.current&&!h.current&&(h.current=!0,(E=(_=o.current)==null?void 0:_.onOutOfView)==null||E.call(_,s.current),c.disconnect())},{threshold:.5});c.observe(p),d.current=c},[])}}function n1(){return U.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U.createElement("path",{d:"M12.0004 2C6.4804 2 2.0004 6.48 2.0004 12C2.0004 17.52 6.4804 22 12.0004 22C17.5204 22 22.0004 17.52 22.0004 12C22.0004 6.48 17.5204 2 12.0004 2ZM13.0004 17H11.0004V15H13.0004V17ZM13.0004 13H11.0004V7H13.0004V13Z",fill:"#F1923A"}))}function i1(){return U.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U.createElement("path",{d:"M11.7633 4.23329C10.7966 3.26663 9.46992 2.66663 7.99659 2.66663C5.04992 2.66663 2.66992 5.05329 2.66992 7.99996C2.66992 10.9466 5.04992 13.3333 7.99659 13.3333C10.4833 13.3333 12.5566 11.6333 13.1499 9.33329H11.7633C11.2166 10.8866 9.73659 12 7.99659 12C5.78992 12 3.99659 10.2066 3.99659 7.99996C3.99659 5.79329 5.78992 3.99996 7.99659 3.99996C9.10326 3.99996 10.0899 4.45996 10.8099 5.18663L8.66326 7.33329H13.3299V2.66663L11.7633 4.23329Z",fill:"white"}))}function Ug({message:r,onRetry:a=void 0}){return U.createElement("div",{className:"cio-pia-error-block-container","data-testid":"error-block"},U.createElement("div",{className:"cio-pia-error-block-warning-icon-container","data-testid":"error-block-warning-icon"},U.createElement(n1,null)),U.createElement("div",{className:"cio-pia-error-block-text-container"},U.createElement("p",{className:"cio-pia-error-block-text"},r),a&&U.createElement("button",{type:"button",onClick:a,className:"cio-pia-error-block-retry-button"},U.createElement(i1,null),"Retry")))}const Ep=U.createElement("div",{className:"cio-pia-loading-skeleton","data-testid":"loading-skeleton"},U.createElement("div",{className:"skeleton-bar"}),U.createElement("div",{className:"skeleton-bar"}),U.createElement("div",{className:"skeleton-bar skeleton-short"}));function Lg({componentOverride:r}={}){return U.createElement(Ye,{props:{skeleton:Ep},override:r==null?void 0:r.reactNode},Ep)}/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function wp(r,a){(a==null||a>r.length)&&(a=r.length);for(var o=0,s=Array(a);o<a;o++)s[o]=r[o];return s}function r1(r){if(Array.isArray(r))return r}function a1(r,a){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var s,f,h,d,m=[],p=!0,c=!1;try{if(h=(o=o.call(r)).next,a!==0)for(;!(p=(s=h.call(o)).done)&&(m.push(s.value),m.length!==a);p=!0);}catch(g){c=!0,f=g}finally{try{if(!p&&o.return!=null&&(d=o.return(),Object(d)!==d))return}finally{if(c)throw f}}return m}}function l1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
58
58
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s1(r,a){return r1(r)||a1(r,a)||o1(r,a)||l1()}function o1(r,a){if(r){if(typeof r=="string")return wp(r,a);var o={}.toString.call(r).slice(8,-1);return o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set"?Array.from(r):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?wp(r,a):void 0}}const Bg=Object.entries,Tp=Object.setPrototypeOf,u1=Object.isFrozen,c1=Object.getPrototypeOf,f1=Object.getOwnPropertyDescriptor;let Ht=Object.freeze,jt=Object.seal,Ca=Object.create,Hg=typeof Reflect<"u"&&Reflect,Qc=Hg.apply,Yc=Hg.construct;Ht||(Ht=function(a){return a});jt||(jt=function(a){return a});Qc||(Qc=function(a,o){for(var s=arguments.length,f=new Array(s>2?s-2:0),h=2;h<s;h++)f[h-2]=arguments[h];return a.apply(o,f)});Yc||(Yc=function(a){for(var o=arguments.length,s=new Array(o>1?o-1:0),f=1;f<o;f++)s[f-1]=arguments[f];return new a(...s)});const Aa=Et(Array.prototype.forEach),d1=Et(Array.prototype.lastIndexOf),Ap=Et(Array.prototype.pop),xa=Et(Array.prototype.push),h1=Et(Array.prototype.splice),pr=Array.isArray,Ul=Et(String.prototype.toLowerCase),qc=Et(String.prototype.toString),xp=Et(String.prototype.match),Nl=Et(String.prototype.replace),Cp=Et(String.prototype.indexOf),m1=Et(String.prototype.trim),p1=Et(Number.prototype.toString),g1=Et(Boolean.prototype.toString),Rp=typeof BigInt>"u"?null:Et(BigInt.prototype.toString),kp=typeof Symbol>"u"?null:Et(Symbol.prototype.toString),Mt=Et(Object.prototype.hasOwnProperty),zl=Et(Object.prototype.toString),Ot=Et(RegExp.prototype.test),Br=y1(TypeError);function Et(r){return function(a){a instanceof RegExp&&(a.lastIndex=0);for(var o=arguments.length,s=new Array(o>1?o-1:0),f=1;f<o;f++)s[f-1]=arguments[f];return Qc(r,a,s)}}function y1(r){return function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return Yc(r,o)}}function Qe(r,a){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ul;if(Tp&&Tp(r,null),!pr(a))return r;let s=a.length;for(;s--;){let f=a[s];if(typeof f=="string"){const h=o(f);h!==f&&(u1(a)||(a[s]=h),f=h)}r[f]=!0}return r}function v1(r){for(let a=0;a<r.length;a++)Mt(r,a)||(r[a]=null);return r}function Ft(r){const a=Ca(null);for(const s of Bg(r)){var o=s1(s,2);const f=o[0],h=o[1];Mt(r,f)&&(pr(h)?a[f]=v1(h):h&&typeof h=="object"&&h.constructor===Object?a[f]=Ft(h):a[f]=h)}return a}function b1(r){switch(typeof r){case"string":return r;case"number":return p1(r);case"boolean":return g1(r);case"bigint":return Rp?Rp(r):"0";case"symbol":return kp?kp(r):"Symbol()";case"undefined":return zl(r);case"function":case"object":{if(r===null)return zl(r);const a=r,o=ai(a,"toString");if(typeof o=="function"){const s=o(a);return typeof s=="string"?s:zl(s)}return zl(r)}default:return zl(r)}}function ai(r,a){for(;r!==null;){const s=f1(r,a);if(s){if(s.get)return Et(s.get);if(typeof s.value=="function")return Et(s.value)}r=c1(r)}function o(){return null}return o}function _1(r){try{return Ot(r,""),!0}catch{return!1}}const qp=Ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Nc=Ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),zc=Ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),S1=Ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Oc=Ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),E1=Ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Np=Ht(["#text"]),zp=Ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Mc=Ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Op=Ht(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),oo=Ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),w1=jt(/{{[\w\W]*|^[\w\W]*}}/g),T1=jt(/<%[\w\W]*|^[\w\W]*%>/g),A1=jt(/\${[\w\W]*/g),x1=jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),C1=jt(/^aria-[\-\w]+$/),Mp=jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),R1=jt(/^(?:\w+script|data):/i),k1=jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q1=jt(/^html$/i),N1=jt(/^[a-z][.\w]*(-[.\w]+)+$/i),Dp=jt(/<[/\w!]/g),Up=jt(/<[/\w]/g),z1=jt(/<\/no(script|embed|frames)/i),O1=jt(/\/>/i),wn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},M1=function(){return typeof window>"u"?null:window},D1=function(a,o){if(typeof a!="object"||typeof a.createPolicy!="function")return null;let s=null;const f="data-tt-policy-suffix";o&&o.hasAttribute(f)&&(s=o.getAttribute(f));const h="dompurify"+(s?"#"+s:"");try{return a.createPolicy(h,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},Lp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},mr=function(a,o,s,f){return Mt(a,o)&&pr(a[o])?Qe(f.base?Ft(f.base):{},a[o],f.transform):s};function jg(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M1();const a=fe=>jg(fe);if(a.version="3.4.12",a.removed=[],!r||!r.document||r.document.nodeType!==wn.document||!r.Element)return a.isSupported=!1,a;let o=r.document;const s=o,f=s.currentScript;r.DocumentFragment;const h=r.HTMLTemplateElement,d=r.Node,m=r.Element,p=r.NodeFilter,c=r.NamedNodeMap;c===void 0&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;const g=r.DOMParser,b=r.trustedTypes,y=m.prototype,_=ai(y,"cloneNode"),E=ai(y,"remove"),w=ai(y,"nextSibling"),A=ai(y,"childNodes"),S=ai(y,"parentNode"),C=ai(y,"shadowRoot"),N=ai(y,"attributes"),O=d&&d.prototype?ai(d.prototype,"nodeType"):null,H=d&&d.prototype?ai(d.prototype,"nodeName"):null;if(typeof h=="function"){const fe=o.createElement("template");fe.content&&fe.content.ownerDocument&&(o=fe.content.ownerDocument)}let k,R="",x,L=!1,M=0;const G=function(){if(M>0)throw Br('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},I=function(z){G(),M++;try{return k.createHTML(z)}finally{M--}},ee=function(z){G(),M++;try{return k.createScriptURL(z)}finally{M--}},ne=function(){return L||(x=D1(b,f),L=!0),x},oe=o,B=oe.implementation,Z=oe.createNodeIterator,le=oe.createDocumentFragment,ce=oe.getElementsByTagName,ie=s.importNode;let q=Lp();a.isSupported=typeof Bg=="function"&&typeof S=="function"&&B&&B.createHTMLDocument!==void 0;const Q=w1,J=T1,ae=A1,ue=x1,de=C1,me=R1,Te=k1,pe=N1;let ze=Mp,_e=null;const he=Qe({},[...qp,...Nc,...zc,...Oc,...Np]);let Ee=null;const Be=Qe({},[...zp,...Mc,...Op,...oo]);let ke=Object.seal(Ca(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yt=null,en=null;const wt=Object.seal(Ca(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qt=!0,Yt=!0,An=!1,Di=!0,tn=!1,rt=!0,xn=!1,Ui=!1,si=null,Vn=null,oi=!1,It=!1,Qn=!1,Yn=!1,dn=!0,qt=!1;const hn="user-content-";let Tt=!0,yr=!1,$n={},$t=null;const Xn=Qe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Pn=null;const Zn=Qe({},["audio","video","img","source","image","track"]);let nn=null;const ui=Qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mn="http://www.w3.org/1998/Math/MathML",ci="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let Kn=Xt,fi=!1,Na=null;const Yl=Qe({},[mn,ci,Xt],qc),za=Ht(["mi","mo","mn","ms","mtext"]);let Qr=Qe({},za);const Yr=Ht(["annotation-xml"]);let vr=Qe({},Yr);const $l=Qe({},["title","style","font","a","script"]);let Li=null;const Jn=["application/xhtml+xml","text/html"],At="text/html";let Me=null,pn=null;const Oa=o.createElement("form"),Xl=function(z){return z instanceof RegExp||z instanceof Function},Ma=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===z)return;(!z||typeof z!="object")&&(z={}),z=Ft(z),Li=Jn.indexOf(z.PARSER_MEDIA_TYPE)===-1?At:z.PARSER_MEDIA_TYPE,Me=Li==="application/xhtml+xml"?qc:Ul,_e=mr(z,"ALLOWED_TAGS",he,{transform:Me}),Ee=mr(z,"ALLOWED_ATTR",Be,{transform:Me}),Na=mr(z,"ALLOWED_NAMESPACES",Yl,{transform:qc}),nn=mr(z,"ADD_URI_SAFE_ATTR",ui,{transform:Me,base:ui}),Pn=mr(z,"ADD_DATA_URI_TAGS",Zn,{transform:Me,base:Zn}),$t=mr(z,"FORBID_CONTENTS",Xn,{transform:Me}),yt=mr(z,"FORBID_TAGS",Ft({}),{transform:Me}),en=mr(z,"FORBID_ATTR",Ft({}),{transform:Me}),$n=Mt(z,"USE_PROFILES")?z.USE_PROFILES&&typeof z.USE_PROFILES=="object"?Ft(z.USE_PROFILES):z.USE_PROFILES:!1,Qt=z.ALLOW_ARIA_ATTR!==!1,Yt=z.ALLOW_DATA_ATTR!==!1,An=z.ALLOW_UNKNOWN_PROTOCOLS||!1,Di=z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,tn=z.SAFE_FOR_TEMPLATES||!1,rt=z.SAFE_FOR_XML!==!1,xn=z.WHOLE_DOCUMENT||!1,It=z.RETURN_DOM||!1,Qn=z.RETURN_DOM_FRAGMENT||!1,Yn=z.RETURN_TRUSTED_TYPE||!1,oi=z.FORCE_BODY||!1,dn=z.SANITIZE_DOM!==!1,qt=z.SANITIZE_NAMED_PROPS||!1,Tt=z.KEEP_CONTENT!==!1,yr=z.IN_PLACE||!1,ze=_1(z.ALLOWED_URI_REGEXP)?z.ALLOWED_URI_REGEXP:Mp,Kn=typeof z.NAMESPACE=="string"?z.NAMESPACE:Xt,Qr=Mt(z,"MATHML_TEXT_INTEGRATION_POINTS")&&z.MATHML_TEXT_INTEGRATION_POINTS&&typeof z.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ft(z.MATHML_TEXT_INTEGRATION_POINTS):Qe({},za),vr=Mt(z,"HTML_INTEGRATION_POINTS")&&z.HTML_INTEGRATION_POINTS&&typeof z.HTML_INTEGRATION_POINTS=="object"?Ft(z.HTML_INTEGRATION_POINTS):Qe({},Yr);const Y=Mt(z,"CUSTOM_ELEMENT_HANDLING")&&z.CUSTOM_ELEMENT_HANDLING&&typeof z.CUSTOM_ELEMENT_HANDLING=="object"?Ft(z.CUSTOM_ELEMENT_HANDLING):Ca(null);if(ke=Ca(null),Mt(Y,"tagNameCheck")&&Xl(Y.tagNameCheck)&&(ke.tagNameCheck=Y.tagNameCheck),Mt(Y,"attributeNameCheck")&&Xl(Y.attributeNameCheck)&&(ke.attributeNameCheck=Y.attributeNameCheck),Mt(Y,"allowCustomizedBuiltInElements")&&typeof Y.allowCustomizedBuiltInElements=="boolean"&&(ke.allowCustomizedBuiltInElements=Y.allowCustomizedBuiltInElements),jt(ke),tn&&(Yt=!1),Qn&&(It=!0),$n&&(_e=Qe({},Np),Ee=Ca(null),$n.html===!0&&(Qe(_e,qp),Qe(Ee,zp)),$n.svg===!0&&(Qe(_e,Nc),Qe(Ee,Mc),Qe(Ee,oo)),$n.svgFilters===!0&&(Qe(_e,zc),Qe(Ee,Mc),Qe(Ee,oo)),$n.mathMl===!0&&(Qe(_e,Oc),Qe(Ee,Op),Qe(Ee,oo))),wt.tagCheck=null,wt.attributeCheck=null,Mt(z,"ADD_TAGS")&&(typeof z.ADD_TAGS=="function"?wt.tagCheck=z.ADD_TAGS:pr(z.ADD_TAGS)&&(_e===he&&(_e=Ft(_e)),Qe(_e,z.ADD_TAGS,Me))),Mt(z,"ADD_ATTR")&&(typeof z.ADD_ATTR=="function"?wt.attributeCheck=z.ADD_ATTR:pr(z.ADD_ATTR)&&(Ee===Be&&(Ee=Ft(Ee)),Qe(Ee,z.ADD_ATTR,Me))),Mt(z,"ADD_URI_SAFE_ATTR")&&pr(z.ADD_URI_SAFE_ATTR)&&Qe(nn,z.ADD_URI_SAFE_ATTR,Me),Mt(z,"FORBID_CONTENTS")&&pr(z.FORBID_CONTENTS)&&($t===Xn&&($t=Ft($t)),Qe($t,z.FORBID_CONTENTS,Me)),Mt(z,"ADD_FORBID_CONTENTS")&&pr(z.ADD_FORBID_CONTENTS)&&($t===Xn&&($t=Ft($t)),Qe($t,z.ADD_FORBID_CONTENTS,Me)),Tt&&(_e["#text"]=!0),xn&&Qe(_e,["html","head","body"]),_e.table&&(Qe(_e,["tbody"]),delete yt.tbody),z.TRUSTED_TYPES_POLICY){if(typeof z.TRUSTED_TYPES_POLICY.createHTML!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const se=k;k=z.TRUSTED_TYPES_POLICY;try{R=I("")}catch(ge){throw k=se,ge}}else z.TRUSTED_TYPES_POLICY===null?(k=void 0,R=""):(k===void 0&&(k=ne()),k&&typeof R=="string"&&(R=I("")));Ht&&Ht(z),pn=z},Da=Qe({},[...Nc,...zc,...S1]),Bi=Qe({},[...Oc,...E1]),Ua=function(z,Y,se){return Y.namespaceURI===Xt?z==="svg":Y.namespaceURI===mn?z==="svg"&&(se==="annotation-xml"||Qr[se]):!!Da[z]},Hi=function(z,Y,se){return Y.namespaceURI===Xt?z==="math":Y.namespaceURI===ci?z==="math"&&vr[se]:!!Bi[z]},ji=function(z,Y,se){return Y.namespaceURI===ci&&!vr[se]||Y.namespaceURI===mn&&!Qr[se]?!1:!Bi[z]&&($l[z]||!Da[z])},br=function(z){let Y=S(z);(!Y||!Y.tagName)&&(Y={namespaceURI:Kn,tagName:"template"});const se=Ul(z.tagName),ge=Ul(Y.tagName);return Na[z.namespaceURI]?z.namespaceURI===ci?Ua(se,Y,ge):z.namespaceURI===mn?Hi(se,Y,ge):z.namespaceURI===Xt?ji(se,Y,ge):!!(Li==="application/xhtml+xml"&&Na[z.namespaceURI]):!1},Pt=function(z){xa(a.removed,{element:z});try{S(z).removeChild(z)}catch{if(E(z),!S(z))throw Br("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ct=function(z){Dn(z);const Y=A(z);if(Y){const ge=[];Aa(Y,Ae=>{xa(ge,Ae)}),Aa(ge,Ae=>{try{E(Ae)}catch{}})}const se=N(z);if(se)for(let ge=se.length-1;ge>=0;--ge){const Ae=se[ge],Ce=Ae&&Ae.name;if(typeof Ce=="string")try{z.removeAttribute(Ce)}catch{}}},Fn=function(z,Y){try{xa(a.removed,{attribute:Y.getAttributeNode(z),from:Y})}catch{xa(a.removed,{attribute:null,from:Y})}if(Y.removeAttribute(z),z==="is")if(It||Qn)try{Pt(Y)}catch{}else try{Y.setAttribute(z,"")}catch{}},Pl=function(z){const Y=N(z);if(Y)for(let se=Y.length-1;se>=0;--se){const ge=Y[se],Ae=ge&&ge.name;if(!(typeof Ae!="string"||Ee[Me(Ae)]))try{z.removeAttribute(Ae)}catch{}}},Dn=function(z){const Y=[z];for(;Y.length>0;){const se=Y.pop();(O?O(se):se.nodeType)===wn.element&&Pl(se);const Ae=A(se);if(Ae)for(let Ce=Ae.length-1;Ce>=0;--Ce)Y.push(Ae[Ce])}},Ii=function(z){if(!rt)return;const Y=[z];for(;Y.length>0;){const se=Y.pop(),ge=O?O(se):se.nodeType;if(ge===wn.processingInstruction||ge===wn.comment&&Ot(Up,se.data)){try{E(se)}catch{}continue}if(ge===wn.element){const Ce=se,st=Me(H?H(se):se.nodeName);try{Ce.hasAttribute&&Ce.hasAttribute("patchsrc")&&Ce.removeAttribute("patchsrc"),Ce.hasAttribute&&Ce.hasAttribute("for")&&st!=="label"&&st!=="output"&&Ce.removeAttribute("for")}catch{}}const Ae=A(se);if(Ae)for(let Ce=Ae.length-1;Ce>=0;--Ce)Y.push(Ae[Ce])}},Zl=function(z){let Y=null,se=null;if(oi)z="<remove></remove>"+z;else{const Ce=xp(z,/^[\r\n\t ]+/);se=Ce&&Ce[0]}Li==="application/xhtml+xml"&&Kn===Xt&&(z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+z+"</body></html>");const ge=k?I(z):z;if(Kn===Xt)try{Y=new g().parseFromString(ge,Li)}catch{}if(!Y||!Y.documentElement){Y=B.createDocument(Kn,"template",null);try{Y.documentElement.innerHTML=fi?R:ge}catch{}}const Ae=Y.body||Y.documentElement;return z&&se&&Ae.insertBefore(o.createTextNode(se),Ae.childNodes[0]||null),Kn===Xt?ce.call(Y,xn?"html":"body")[0]:xn?Y.documentElement:Ae},La=function(z){return Z.call(z.ownerDocument||z,z,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},_r=function(z){return z=Nl(z,Q," "),z=Nl(z,J," "),z=Nl(z,ae," "),z},Ba=function(z){var Y;z.normalize();const se=Z.call(z.ownerDocument||z,z,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null);let ge=se.nextNode();for(;ge;)ge.data=_r(ge.data),ge=se.nextNode();const Ae=(Y=z.querySelectorAll)===null||Y===void 0?void 0:Y.call(z,"template");Ae&&Aa(Ae,Ce=>{Un(Ce.content)&&Ba(Ce.content)})},di=function(z){const Y=H?H(z):null;return typeof Y!="string"||Me(Y)!=="form"?!1:typeof z.nodeName!="string"||typeof z.textContent!="string"||typeof z.removeChild!="function"||z.attributes!==N(z)||typeof z.removeAttribute!="function"||typeof z.setAttribute!="function"||typeof z.namespaceURI!="string"||typeof z.insertBefore!="function"||typeof z.hasChildNodes!="function"||z.nodeType!==O(z)||z.childNodes!==A(z)},Un=function(z){if(!O||typeof z!="object"||z===null)return!1;try{return O(z)===wn.documentFragment}catch{return!1}},Zt=function(z){if(!O||typeof z!="object"||z===null)return!1;try{return typeof O(z)=="number"}catch{return!1}};function ft(fe,z,Y){fe.length!==0&&Aa(fe,se=>{se.call(a,z,Y,pn)})}const Kl=function(z,Y){return!!(rt&&z.hasChildNodes()&&!Zt(z.firstElementChild)&&Ot(Dp,z.textContent)&&Ot(Dp,z.innerHTML)||rt&&z.namespaceURI===Xt&&Y==="style"&&Zt(z.firstElementChild)||z.nodeType===wn.processingInstruction||rt&&z.nodeType===wn.comment&&Ot(Up,z.data))},So=function(z,Y){if(!yt[Y]&&Jl(Y)&&(ke.tagNameCheck instanceof RegExp&&Ot(ke.tagNameCheck,Y)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(Y)))return!1;if(Tt&&!$t[Y]){const se=S(z),ge=A(z);if(ge&&se){const Ae=ge.length;for(let Ce=Ae-1;Ce>=0;--Ce){const st=yr?ge[Ce]:_(ge[Ce],!0);se.insertBefore(st,w(z))}}}return Pt(z),!0},$r=function(z,Y){if(ft(q.beforeSanitizeElements,z,null),z!==Y&&S(z)===null)return!0;if(di(z))return Pt(z),!0;const se=Me(H?H(z):z.nodeName);if(ft(q.uponSanitizeElement,z,{tagName:se,allowedTags:_e}),z!==Y&&S(z)===null)return!0;if(Kl(z,se))return Pt(z),!0;if(yt[se]||!(wt.tagCheck instanceof Function&&wt.tagCheck(se))&&!_e[se]){const Ae=So(z,se);return Ae===!1&&ft(q.afterSanitizeElements,z,null),Ae}if((O?O(z):z.nodeType)===wn.element&&!br(z)||(se==="noscript"||se==="noembed"||se==="noframes")&&Ot(z1,z.innerHTML))return Pt(z),!0;if(tn&&z.nodeType===wn.text){const Ae=_r(z.textContent);z.textContent!==Ae&&(xa(a.removed,{element:z.cloneNode()}),z.textContent=Ae)}return ft(q.afterSanitizeElements,z,null),!1},Ha=function(z,Y,se){if(en[Y]||rt&&Y==="patchsrc"||rt&&Y==="for"&&z!=="label"&&z!=="output"||dn&&(Y==="id"||Y==="name")&&(se in o||se in Oa))return!1;const ge=Ee[Y]||wt.attributeCheck instanceof Function&&wt.attributeCheck(Y,z);if(!(Yt&&Ot(ue,Y))){if(!(Qt&&Ot(de,Y))){if(ge){if(!nn[Y]){if(!Ot(ze,Nl(se,Te,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&z!=="script"&&Cp(se,"data:")===0&&Pn[z])){if(!(An&&!Ot(me,Nl(se,Te,"")))){if(se)return!1}}}}}else if(!(Jl(z)&&(ke.tagNameCheck instanceof RegExp&&Ot(ke.tagNameCheck,z)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(z))&&(ke.attributeNameCheck instanceof RegExp&&Ot(ke.attributeNameCheck,Y)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(Y,z))||Y==="is"&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&Ot(ke.tagNameCheck,se)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(se))))return!1}}return!0},Xr=Qe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Jl=function(z){return!Xr[Ul(z)]&&Ot(pe,z)},rn=function(z,Y,se,ge){if(k&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!se)switch(b.getAttributeType(z,Y)){case"TrustedHTML":return I(ge);case"TrustedScriptURL":return ee(ge)}return ge},ja=function(z,Y,se,ge){try{se?z.setAttributeNS(se,Y,ge):z.setAttribute(Y,ge),di(z)?Pt(z):Ap(a.removed)}catch{Fn(Y,z)}},Ia=function(z){ft(q.beforeSanitizeAttributes,z,null);const Y=z.attributes;if(!Y||di(z))return;const se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee,forceKeepAttr:void 0};let ge=Y.length;const Ae=Me(z.nodeName);for(;ge--;){const Ce=Y[ge],st=Ce.name,Nt=Ce.namespaceURI,Gt=Ce.value,ot=Me(st),Kt=Gt;let xt=st==="value"?Kt:m1(Kt);if(se.attrName=ot,se.attrValue=xt,se.keepAttr=!0,se.forceKeepAttr=void 0,ft(q.uponSanitizeAttribute,z,se),xt=se.attrValue,qt&&(ot==="id"||ot==="name")&&Cp(xt,hn)!==0&&(Fn(st,z),xt=hn+xt),rt&&Ot(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xt)){Fn(st,z);continue}if(ot==="attributename"&&xp(xt,"href")){Fn(st,z);continue}if(!se.forceKeepAttr){if(!se.keepAttr){Fn(st,z);continue}if(!Di&&Ot(O1,xt)){Fn(st,z);continue}if(tn&&(xt=_r(xt)),!Ha(Ae,ot,xt)){Fn(st,z);continue}xt=rn(Ae,ot,Nt,xt),xt!==Kt&&ja(z,st,Nt,xt)}}ft(q.afterSanitizeAttributes,z,null)},Gi=function(z){let Y=null;const se=La(z);for(ft(q.beforeSanitizeShadowDOM,z,null);Y=se.nextNode();)if(ft(q.uponSanitizeShadowNode,Y,null),$r(Y,z),Ia(Y),Un(Y.content)&&Gi(Y.content),(O?O(Y):Y.nodeType)===wn.element){const Ae=C(Y);Un(Ae)&&(Wn(Ae),Gi(Ae))}ft(q.afterSanitizeShadowDOM,z,null)},Wn=function(z){const Y=[{node:z,shadow:null}];for(;Y.length>0;){const se=Y.pop();if(se.shadow){Gi(se.shadow);continue}const ge=se.node,Ce=(O?O(ge):ge.nodeType)===wn.element,st=A(ge);if(st)for(let Nt=st.length-1;Nt>=0;--Nt)Y.push({node:st[Nt],shadow:null});if(Ce){const Nt=H?H(ge):null;if(typeof Nt=="string"&&Me(Nt)==="template"){const Gt=ge.content;Un(Gt)&&Y.push({node:Gt,shadow:null})}}if(Ce){const Nt=C(ge);Un(Nt)&&Y.push({node:null,shadow:Nt},{node:Nt,shadow:null})}}};return a.sanitize=function(fe){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,se=null,ge=null,Ae=null;if(fi=!fe,fi&&(fe="<!-->"),typeof fe!="string"&&!Zt(fe)&&(fe=b1(fe),typeof fe!="string"))throw Br("dirty is not a string, aborting");if(!a.isSupported)return fe;Ui?(_e=si,Ee=Vn):Ma(z),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(_e=Ft(_e)),q.uponSanitizeAttribute.length>0&&(Ee=Ft(Ee)),a.removed=[];const Ce=yr&&typeof fe!="string"&&Zt(fe);if(Ce){Ii(fe);const ot=H?H(fe):fe.nodeName;if(typeof ot=="string"){const Kt=Me(ot);if(!_e[Kt]||yt[Kt])throw ct(fe),Br("root node is forbidden and cannot be sanitized in-place")}if(di(fe))throw ct(fe),Br("root node is clobbered and cannot be sanitized in-place");try{Wn(fe)}catch(Kt){throw ct(fe),Kt}}else if(Zt(fe))Y=Zl("<!---->"),se=Y.ownerDocument.importNode(fe,!0),se.nodeType===wn.element&&se.nodeName==="BODY"||se.nodeName==="HTML"?Y=se:Y.appendChild(se),Wn(se);else{if(!It&&!tn&&!xn&&fe.indexOf("<")===-1)return k&&Yn?I(fe):fe;if(Y=Zl(fe),!Y)return It?null:Yn?R:""}Y&&oi&&Pt(Y.firstChild);const st=Ce?fe:Y,Nt=La(st);try{for(;ge=Nt.nextNode();)$r(ge,st),Ia(ge),Un(ge.content)&&Gi(ge.content)}catch(ot){throw Ce&&(ct(fe),Aa(a.removed,Kt=>{Kt.element&&Dn(Kt.element)})),ot}if(Ce)return Aa(a.removed,ot=>{ot.element&&Dn(ot.element)}),tn&&Ba(fe),fe;if(It){if(tn&&Ba(Y),Qn)for(Ae=le.call(Y.ownerDocument);Y.firstChild;)Ae.appendChild(Y.firstChild);else Ae=Y;return(Ee.shadowroot||Ee.shadowrootmode)&&(Ae=ie.call(s,Ae,!0)),Ae}let Gt=xn?Y.outerHTML:Y.innerHTML;return xn&&_e["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Ot(q1,Y.ownerDocument.doctype.name)&&(Gt="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
|
|
59
59
|
`+Gt),tn&&(Gt=_r(Gt)),k&&Yn?I(Gt):Gt},a.setConfig=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(fe),Ui=!0,si=_e,Vn=Ee},a.clearConfig=function(){pn=null,Ui=!1,si=null,Vn=null,k=x,R=""},a.isValidAttribute=function(fe,z,Y){pn||Ma({});const se=Me(fe),ge=Me(z);return Ha(se,ge,Y)},a.addHook=function(fe,z){typeof z=="function"&&Mt(q,fe)&&xa(q[fe],z)},a.removeHook=function(fe,z){if(Mt(q,fe)){if(z!==void 0){const Y=d1(q[fe],z);return Y===-1?void 0:h1(q[fe],Y,1)[0]}return Ap(q[fe])}},a.removeHooks=function(fe){Mt(q,fe)&&(q[fe]=[])},a.removeAllHooks=function(){q=Lp()},a}var Ig=jg();function df(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Vr=df();function Gg(r){Vr=r}var Bl={exec:()=>null};function Ze(r,a=""){let o=typeof r=="string"?r:r.source;const s={replace:(f,h)=>{let d=typeof h=="string"?h:h.source;return d=d.replace(Wt.caret,"$1"),o=o.replace(f,d),s},getRegex:()=>new RegExp(o,a)};return s}var Wt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},U1=/^(?:[ \t]*(?:\n|$))+/,L1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,B1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ql=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,H1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hf=/(?:[*+-]|\d{1,9}[.)])/,Vg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Qg=Ze(Vg).replace(/bull/g,hf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),j1=Ze(Vg).replace(/bull/g,hf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,I1=/^[^\n]+/,pf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,G1=Ze(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),V1=Ze(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hf).getRegex(),bo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",gf=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Q1=Ze("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",gf).replace("tag",bo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yg=Ze(mf).replace("hr",Ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bo).getRegex(),Y1=Ze(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Yg).getRegex(),yf={blockquote:Y1,code:L1,def:G1,fences:B1,heading:H1,hr:Ql,html:Q1,lheading:Qg,list:V1,newline:U1,paragraph:Yg,table:Bl,text:I1},Bp=Ze("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bo).getRegex(),$1={...yf,lheading:j1,table:Bp,paragraph:Ze(mf).replace("hr",Ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bo).getRegex()},X1={...yf,html:Ze(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gf).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Bl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ze(mf).replace("hr",Ql).replace("heading",` *#{1,6} *[^
|
|
60
60
|
]`).replace("lheading",Qg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},P1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Z1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$g=/^( {2,}|\\)\n(?!\s*$)/,K1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_o=/[\p{P}\p{S}]/u,vf=/[\s\p{P}\p{S}]/u,Xg=/[^\s\p{P}\p{S}]/u,J1=Ze(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vf).getRegex(),Pg=/(?!~)[\p{P}\p{S}]/u,F1=/(?!~)[\s\p{P}\p{S}]/u,W1=/(?:[^\s\p{P}\p{S}]|~)/u,eS=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Zg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,tS=Ze(Zg,"u").replace(/punct/g,_o).getRegex(),nS=Ze(Zg,"u").replace(/punct/g,Pg).getRegex(),Kg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",iS=Ze(Kg,"gu").replace(/notPunctSpace/g,Xg).replace(/punctSpace/g,vf).replace(/punct/g,_o).getRegex(),rS=Ze(Kg,"gu").replace(/notPunctSpace/g,W1).replace(/punctSpace/g,F1).replace(/punct/g,Pg).getRegex(),aS=Ze("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Xg).replace(/punctSpace/g,vf).replace(/punct/g,_o).getRegex(),lS=Ze(/\\(punct)/,"gu").replace(/punct/g,_o).getRegex(),sS=Ze(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),oS=Ze(gf).replace("(?:-->|$)","-->").getRegex(),uS=Ze("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",oS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,cS=Ze(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",mo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Jg=Ze(/^!?\[(label)\]\[(ref)\]/).replace("label",mo).replace("ref",pf).getRegex(),Fg=Ze(/^!?\[(ref)\](?:\[\])?/).replace("ref",pf).getRegex(),fS=Ze("reflink|nolink(?!\\()","g").replace("reflink",Jg).replace("nolink",Fg).getRegex(),bf={_backpedal:Bl,anyPunctuation:lS,autolink:sS,blockSkip:eS,br:$g,code:Z1,del:Bl,emStrongLDelim:tS,emStrongRDelimAst:iS,emStrongRDelimUnd:aS,escape:P1,link:cS,nolink:Fg,punctuation:J1,reflink:Jg,reflinkSearch:fS,tag:uS,text:K1,url:Bl},dS={...bf,link:Ze(/^!?\[(label)\]\((.*?)\)/).replace("label",mo).getRegex(),reflink:Ze(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mo).getRegex()},$c={...bf,emStrongRDelimAst:rS,emStrongLDelim:nS,url:Ze(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},hS={...$c,br:Ze($g).replace("{2,}","*").getRegex(),text:Ze($c.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uo={normal:yf,gfm:$1,pedantic:X1},Ol={normal:bf,gfm:$c,breaks:hS,pedantic:dS},mS={"&":"&","<":"<",">":">",'"':""","'":"'"},Hp=r=>mS[r];function li(r,a){if(a){if(Wt.escapeTest.test(r))return r.replace(Wt.escapeReplace,Hp)}else if(Wt.escapeTestNoEncode.test(r))return r.replace(Wt.escapeReplaceNoEncode,Hp);return r}function jp(r){try{r=encodeURI(r).replace(Wt.percentDecode,"%")}catch{return null}return r}function Ip(r,a){var h;const o=r.replace(Wt.findPipe,(d,m,p)=>{let c=!1,g=m;for(;--g>=0&&p[g]==="\\";)c=!c;return c?"|":" |"}),s=o.split(Wt.splitPipe);let f=0;if(s[0].trim()||s.shift(),s.length>0&&!((h=s.at(-1))!=null&&h.trim())&&s.pop(),a)if(s.length>a)s.splice(a);else for(;s.length<a;)s.push("");for(;f<s.length;f++)s[f]=s[f].trim().replace(Wt.slashPipe,"|");return s}function Ml(r,a,o){const s=r.length;if(s===0)return"";let f=0;for(;f<s&&r.charAt(s-f-1)===a;)f++;return r.slice(0,s-f)}function pS(r,a){if(r.indexOf(a[1])===-1)return-1;let o=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===a[0])o++;else if(r[s]===a[1]&&(o--,o<0))return s;return o>0?-2:-1}function Gp(r,a,o,s,f){const h=a.href,d=a.title||null,m=r[1].replace(f.other.outputLinkReplace,"$1");s.state.inLink=!0;const p={type:r[0].charAt(0)==="!"?"image":"link",raw:o,href:h,title:d,text:m,tokens:s.inlineTokens(m)};return s.state.inLink=!1,p}function gS(r,a,o){const s=r.match(o.other.indentCodeCompensation);if(s===null)return a;const f=s[1];return a.split(`
|
package/lib/cjs/styles.css
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@import '@constructor-io/constructorio-ui-components/styles.css';
|
|
2
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');
|
|
3
2
|
@import './components/SuggestedQuestion/SuggestedQuestionStyles.css';
|
|
4
3
|
@import './components/SuggestedQuestionsContainer/SuggestedQuestionsContainerStyles.css';
|
|
5
4
|
@import './components/Input/InputStyles.css';
|
package/lib/cjs/version.js
CHANGED
package/lib/mjs/styles.css
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@import '@constructor-io/constructorio-ui-components/styles.css';
|
|
2
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');
|
|
3
2
|
@import './components/SuggestedQuestion/SuggestedQuestionStyles.css';
|
|
4
3
|
@import './components/SuggestedQuestionsContainer/SuggestedQuestionsContainerStyles.css';
|
|
5
4
|
@import './components/Input/InputStyles.css';
|
package/lib/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.10.
|
|
1
|
+
export default '2.10.4';
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.10.
|
|
1
|
+
declare const _default: "2.10.4";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED