blocfeed 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/{chunk-E3YSP5LQ.cjs → chunk-WAMNK7BQ.cjs} +1 -1
- package/dist/{chunk-GJW5E4AF.js → chunk-XF3APCYE.js} +1 -1
- package/dist/engine.cjs +1 -1
- package/dist/engine.js +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.d.cts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/passive.cjs +1 -1
- package/dist/passive.js +1 -1
- package/dist/script.js +34 -33
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.22.0 — 2026-05-07
|
|
4
|
+
|
|
5
|
+
### New: hosted feedback iframe for non-React stacks
|
|
6
|
+
|
|
7
|
+
Script-tag installs can now render the full BlocFeed feedback panel
|
|
8
|
+
without bundling React. Add data-feedback="true" and a floating trigger
|
|
9
|
+
button appears; clicking it opens the panel hosted at
|
|
10
|
+
https://blocfeed.com/embed/<blocfeed_id>.
|
|
11
|
+
|
|
12
|
+
<script async
|
|
13
|
+
src="https://cdn.jsdelivr.net/npm/blocfeed@0/dist/script.js"
|
|
14
|
+
data-blocfeed-id="bf_xxx"
|
|
15
|
+
data-feedback="true"></script>
|
|
16
|
+
|
|
17
|
+
Customizable via data-feedback-color, data-feedback-label,
|
|
18
|
+
data-feedback-position. data-embed-origin overrides the default
|
|
19
|
+
https://blocfeed.com host (useful for self-hosted deployments and
|
|
20
|
+
local dev).
|
|
21
|
+
|
|
22
|
+
The parent script bridges screenshot capture for the iframe via
|
|
23
|
+
postMessage, dynamically importing html-to-image only when a screenshot
|
|
24
|
+
is actually requested. Voice feedback uses getUserMedia inside the
|
|
25
|
+
iframe (browser prompts for microphone access against blocfeed.com).
|
|
26
|
+
|
|
27
|
+
Element picker, video recording, and behavioral signal annotation
|
|
28
|
+
remain React-only — use blocfeed/passive or the React widget for those.
|
|
29
|
+
|
|
30
|
+
Customers who want to react to a successful submission (custom toast,
|
|
31
|
+
analytics call, etc.) can listen for the
|
|
32
|
+
`blocfeed-embed/submit-success` postMessage themselves; the parent
|
|
33
|
+
script only logs to the console in v1.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
3
37
|
## 0.21.0 — 2026-05-07
|
|
4
38
|
|
|
5
39
|
### New: tracking-only modes for non-React stacks
|
|
@@ -880,5 +880,5 @@
|
|
|
880
880
|
animation: none;
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
`;function Kn(){if(!T()||document.getElementById($n))return;let e=document.createElement("style");e.id=$n,e.textContent=mi,document.head.appendChild(e);}var Ae=[],Me=[],Xn=20,jn=15,et=[],Yn=typeof console<"u"?{log:console.log?.bind(console),warn:console.warn?.bind(console),error:console.error?.bind(console),info:console.info?.bind(console),debug:console.debug?.bind(console)}:{},tt=typeof globalThis<"u"&&typeof globalThis.fetch=="function"?globalThis.fetch:void 0,nt=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.open:void 0,ot=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.send:void 0,Bt=new Set,At=false,Mt=false,rt=false,gi=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function bi(e){if(e instanceof Error)return e.name&&e.name!=="Error"?`${e.name}: ${e.message}`:e.message||String(e);if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function hi(e,t){let n=t.map(bi).join(" "),o=t.find(i=>i instanceof Error),r={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(o?.stack&&(r.stack=o.stack.slice(0,2e3)),Ae.push(r);Ae.length>Xn;)Ae.shift();}function Ft(e){let t=e.url.toLowerCase();for(let n of et)if(t.includes(n))return;for(Me.push(e);Me.length>jn;)Me.shift();}function Gn(e={}){if(rt||!T())return;rt=true,Xn=e.consoleLimit??20,jn=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?et=t.map(n=>n.toLowerCase()):et=[...gi],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let o of n){let r=Yn[o];r&&(Bt.add(o),console[o]=(...i)=>{hi(o,i),r.apply(console,i);});}}if(e.network!==false&&tt){let n=tt;At=true,window.fetch=async function(r,i){let c=typeof r=="string"?r:r instanceof URL?r.toString():r.url,s=(i?.method??"GET").toUpperCase(),a=Date.now();try{let l=await n.call(window,r,i);return l.ok||Ft({url:c.slice(0,500),method:s,status:l.status,statusText:l.statusText,timestamp:a,durationMs:Date.now()-a}),l}catch(l){throw Ft({url:c.slice(0,500),method:s,status:0,statusText:l instanceof Error?l.message:"Network error",timestamp:a,durationMs:Date.now()-a}),l}};}if(e.network!==false&&nt&&ot){let n=nt,o=ot;Mt=true,XMLHttpRequest.prototype.open=function(r,i,...c){return this.__bf_method=r.toUpperCase(),this.__bf_url=String(i),n.apply(this,[r,i,...c])},XMLHttpRequest.prototype.send=function(...r){let i=this.__bf_method||"GET",c=this.__bf_url||"",s=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let a={url:c.slice(0,500),method:i,status:this.status,timestamp:s,durationMs:Date.now()-s};this.statusText&&(a.statusText=this.statusText),Ft(a);}},{once:true}),o.apply(this,r)};}}function Jn(){if(rt){for(let e of Bt){let t=Yn[e];t&&(console[e]=t);}Bt.clear(),At&&tt&&(window.fetch=tt,At=false),Mt&&nt&&ot&&(XMLHttpRequest.prototype.open=nt,XMLHttpRequest.prototype.send=ot,Mt=false),et=[],rt=false;}}function Qn(){return {consoleLogs:[...Ae],networkErrors:[...Me]}}function xc(){Ae=[],Me=[];}var vi=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]{1,8}[A-Za-z0-9_.=-]{30,400}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:\s"']{1,100}:[^@\s"']{1,200}@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]{1,8}[A-Za-z0-9/+=]{30,200}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]{1,8}[A-Za-z0-9/+=]{30,600}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,200}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,200}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,200}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,100}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,100}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,100}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,100}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,200}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,200}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,200}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,100}\.[a-zA-Z0-9_-]{22,100}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]{1,8}[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,60}_SECRET_KEY["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_secret",pattern:/[A-Z_]{2,60}_SECRET["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_password",pattern:/[A-Z_]{2,60}_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,60}_PRIVATE_KEY["'=:\s]{1,8}[^\s"']{8,400}/}],ge=[],Lt=0,It=false;function yi(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function wi(e,t,n,o){if(ge.some(c=>c.rule===e&&c.source===t))return;let i={rule:e,source:t,hint:yi(n),timestamp:Date.now()};o&&(i.location=o),ge.push(i);}function Ie(e,t,n,o){for(let{name:r,pattern:i}of n){let c=i.exec(e);c&&wi(r,t,c[0],o);}}function xi(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);Ie(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);Ie(n,"hydration",e,"__NUXT__");}}catch{}}function Ei(e){try{document.querySelectorAll("script:not([src])").forEach((n,o)=>{let r=n.textContent;r&&r.length>0&&Ie(r,"scripts",e,`inline-script[${o}]`);});}catch{}}function ki(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let o=n.getAttribute("content"),r=n.getAttribute("name")||n.getAttribute("property")||"";o&&o.length>10&&Ie(o,"meta",e,r?`meta[${r}]`:void 0);});}catch{}}function Si(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let o=n.attributes;for(let r=0;r<o.length;r++){let i=o[r];i.name.startsWith("data-")&&i.value.length>10&&Ie(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Zn(e={}){if(It||!T()||(It=true,e.secretScan===false))return;let t=[...vi,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{Lt=Date.now(),n.includes("hydration")&&xi(t),n.includes("scripts")&&Ei(t),n.includes("meta")&&ki(t),n.includes("dom")&&Si(t);let o=e.notify??"both";ge.length>0&&(o==="console"||o==="both")&&console.warn(`[BlocFeed Security] Found ${ge.length} potential secret(s) exposed in client code:`,ge.map(r=>`${r.rule} (${r.source}${r.location?`: ${r.location}`:""})`));},100);}function Nt(){return {findings:[...ge],scannedAt:Lt}}function Sc(){ge=[],Lt=0,It=false;}var eo={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove",voiceButton:"Voice",voiceStopButton:"Stop",voiceRecordingText:"Recording\u2026",voiceTranscribingText:"Transcribing\u2026",voiceDeniedText:"Microphone access was denied",voiceErrorText:"Voice transcription failed. Please type instead.",voiceEmptyText:"No speech detected. Try again or type instead."};function to(e){return e?{...eo,...e}:eo}function Dt(){let e=react.useContext(Qe);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo,track:Fe}}function q(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function O({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function no({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function oo({size:e=16}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function io({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){return n?jsxRuntime.jsxs("button",{className:q(e),type:"button",onClick:t,"aria-label":o,children:[i?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]}):null}function V(){let[e,t]=react.useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return react.useEffect(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),o=r=>t(r.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}var Bi={duration:.18,ease:"easeOut"},Ai={duration:0};function so({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?Ai:Bi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",animate:a?{}:{scale:c?1:[1,1.2,1],boxShadow:c?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"dot")})}var Ni={duration:.18,ease:"easeOut"},lo={duration:0};function fo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?lo:Ni;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsxs(framerMotion.motion.div,{className:q(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:l,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:a?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a?0:4},transition:l,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxRuntime.jsxs(framerMotion.motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:a?{}:{y:[0,-3,0]},transition:a?lo:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:16})},"success"):jsxRuntime.jsx(no,{size:16}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${r} queued`,children:r})]})]},"bubble")})}var Hi={duration:.2,ease:"easeOut"},Ui={duration:0};function mo(e){return e==="bottom-left"||e==="top-left"}function zi(e){return `bf-trigger-edge ${mo(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function go({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=mo(e),l=V(),m=l?Ui:Hi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:zi(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:c?140:22,height:c?40:90},exit:{width:0,opacity:0},transition:m,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:m,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.span,{animate:{rotate:l||c?0:a?-90:90,opacity:c?1:.6},transition:m,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",animate:{opacity:c?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[a?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"edge-tab")})}var qi={duration:.18,ease:"easeOut"},$i={duration:0};function ho({delay:e,hovered:t,reduced:n}){return n?null:jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function yo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?$i:qi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(ho,{delay:0,hovered:c,reduced:a}),jsxRuntime.jsx(ho,{delay:.7,hovered:c,reduced:a}),jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"pulse-ring")})}var Yi={duration:.18,ease:"easeOut"},Gi={duration:0};function Ji(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Eo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?Gi:Yi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsxs(framerMotion.motion.button,{className:Ji(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:a?0:5},animate:{opacity:c?1:.65,y:0},exit:{opacity:0,y:a?0:5},transition:l,whileTap:{scale:.95},children:[i?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${r} queued`,children:r})]}),!a&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:c?1:0},transition:l})]},"minimal")})}var ea={duration:.18,ease:"easeOut"},ta={duration:0};function So({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?ta:ea;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.9},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{style:{display:"inline-flex",flexShrink:0},animate:a?{}:c?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:c||a?l:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsxRuntime.jsx(oo,{size:16})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-8},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"icon-pop")})}var ia={duration:.18,ease:"easeOut"},aa={duration:0};function Co({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?aa:ia;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:a?{}:{opacity:c?1:[.5,1,.5],boxShadow:c?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),!c&&!a&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"beacon")})}var ua={duration:.18,ease:"easeOut"},fa={duration:0};function Bo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),[a,l]=react.useState(0),m=V(),b=m?fa:ua,d=react.useRef(null);react.useEffect(()=>{if(d.current&&(clearInterval(d.current),d.current=null),!n||c||m){l(c||m?o.length:0);return}let u=8,p=o.length*2+u*2,f=0;return d.current=setInterval(()=>{f=(f+1)%p,f<=o.length?l(f):f<=o.length+u?l(o.length):f<=o.length*2+u?l(o.length*2+u-f):l(0);},100),()=>{d.current&&(clearInterval(d.current),d.current=null);}},[n,c,m,o]);let h=o.slice(0,a);return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:m?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:m?0:5},transition:b,whileTap:{scale:.95},style:{minWidth:"44px"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:b,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxRuntime.jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[h,jsxRuntime.jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"typewriter")})}function Ao(e){switch(e){case "dot":return so;case "bubble":return fo;case "edge-tab":return go;case "pulse-ring":return yo;case "minimal":return Eo;case "icon-pop":return So;case "beacon":return Co;case "typewriter":return Bo;default:return io}}function Mo(e,t,n){return Math.max(t,Math.min(n,e))}function ha(e,t,n="bottom-right"){let r=window.innerWidth,i=window.innerHeight,c;c=Mo(e.x,12,Math.max(12,r-t-12));let s=e.y+e.height+12,a=Math.max(12,e.y-240);return {top:s+240<=i?s:a,left:c}}function va(e){let{rect:t}=e,n={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsxRuntime.jsx("div",{className:"bf-highlight",style:n,"aria-hidden":"true"})}function ya(e){let t=react.useRef(null);return react.useEffect(()=>{if(!e||!t.current)return;let n=t.current,o=n.querySelector(".bf-textarea");o?.focus();let r=c=>{if(c.key!=="Tab")return;let s=n.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(s.length===0)return;let a=s[0],l=s[s.length-1];c.shiftKey&&document.activeElement===a?(c.preventDefault(),l.focus()):!c.shiftKey&&document.activeElement===l&&(c.preventDefault(),a.focus());},i=c=>{let s=c.target;s&&(n.contains(s)||(c.stopImmediatePropagation(),o?.focus()));};return document.addEventListener("keydown",r,{capture:true}),document.addEventListener("focusin",i,{capture:true}),()=>{document.removeEventListener("keydown",r,{capture:true}),document.removeEventListener("focusin",i,{capture:true});}},[e]),t}function wa(e,t){return e?typeof e=="function"?e(t):e.some(n=>n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n):true}var Ut=new Set,Io=false;function xa(){if(Io||typeof window>"u")return;Io=true;let e=history.pushState,t=history.replaceState,n=()=>{for(let o of Ut)o();};history.pushState=function(...o){e.apply(this,o),setTimeout(n,0);},history.replaceState=function(...o){t.apply(this,o),setTimeout(n,0);};}function Ea(e){let[t,n]=react.useState(()=>typeof window<"u"?window.location.pathname:"/");return react.useEffect(()=>{if(typeof window>"u")return;let o=()=>n(window.location.pathname);return window.addEventListener("popstate",o),xa(),Ut.add(o),()=>{window.removeEventListener("popstate",o),Ut.delete(o);}},[]),wa(e,t)}function ka(e){let[t,n]=react.useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return react.useEffect(()=>{if(e!=="auto"){n(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),r=i=>n(i.matches?"dark":"light");return n(o.matches?"dark":"light"),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}var Sa=["bug","feature","ux","general"],_a={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function Oe(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),o=t%60;return `${n}:${String(o).padStart(2,"0")}`}function Ta(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ca(e){let{state:t,controller:n,start:o,stop:r,clearSelection:i,submit:c}=Dt(),s=e.config.ui?.position,a=to(e.config.ui?.strings),l=e.config.ui?.branding!==false,[m,b]=react.useState(null),[d,h]=react.useState(""),[u,p]=react.useState(e.config.capture?.element??true),[f,g]=react.useState(e.config.capture?.fullPage??false),[v,C]=react.useState(null),[_,E]=react.useState(void 0),z=e.config.ui?.categories??Sa,H=e.config.recording?.enabled===true&&wt(),F=e.config.recording?.maxDurationMs??3e4,M=n.getConfig().voice,se=M?.enabled===true&&Et(),ue=M?.maxDurationMs??6e4,[y,S]=react.useState(false),[L,N]=react.useState(0);react.useEffect(()=>{let w=window.setTimeout(()=>{let W=Nt();N(W.findings.length);},500);return ()=>window.clearTimeout(w)},[]),react.useImperativeHandle(e.handleRef,()=>({open:o,close:r,submit:w=>c(w),startRecording:()=>n.startRecording(),stopRecording:()=>n.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,r,c,n,t.phase]);let I=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",R=ya(I),[G,te]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&te(on());},[t.phase]);let[He,ce]=react.useState(false),B=react.useRef(t.phase);react.useEffect(()=>{if(B.current==="success"&&t.phase==="idle"){ce(true);let w=window.setTimeout(()=>ce(false),1500);return ()=>window.clearTimeout(w)}B.current=t.phase;},[t.phase]),react.useEffect(()=>{let w=e.config.ui?.shortcut;if(!w)return;let W=w.toLowerCase().split("+").map(ee=>ee.trim()),Z=W[W.length-1]||"",fe=new Set(W.slice(0,-1)),Vt=ee=>{let Oo=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(fe.has("mod")){if(Oo?!ee.metaKey:!ee.ctrlKey)return}else if(fe.has("ctrl")&&!ee.ctrlKey||(fe.has("meta")||fe.has("cmd"))&&!ee.metaKey)return;fe.has("shift")&&!ee.shiftKey||(fe.has("alt")||fe.has("option"))&&!ee.altKey||ee.key.toLowerCase()===Z&&(ee.preventDefault(),t.phase==="idle"?o():r());};return document.addEventListener("keydown",Vt),()=>document.removeEventListener("keydown",Vt)},[e.config.ui?.shortcut,t.phase,o,r]),react.useEffect(()=>n.subscribeHover(b),[n]),react.useEffect(()=>{let w=n.__unsafeGetSelectedElement();if(!w||t.phase==="idle"||t.phase==="picking"){C(null);return}let W=()=>{C(Ce(w.getBoundingClientRect()));};W();let Z=()=>W();return window.addEventListener("scroll",Z,{capture:true,passive:true}),window.addEventListener("resize",Z,{passive:true}),()=>{window.removeEventListener("scroll",Z,{capture:true}),window.removeEventListener("resize",Z);}},[n,t.phase,t.selection?.selector]),react.useEffect(()=>{t.phase==="review"&&(h(""),p(e.config.capture?.element??true),g(e.config.capture?.fullPage??false),E(void 0),oe(null));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),react.useEffect(()=>{if(t.phase!=="success")return;let w=window.setTimeout(()=>r(),1200);return ()=>window.clearTimeout(w)},[t.phase,r]);let A=t.phase==="capturing"||t.phase==="submitting",U=t.phase==="picking"?m?.rect??null:v??t.selection?.rect??null,ne=react.useMemo(()=>U?ha(U,360,s):null,[U?.x,U?.y,U?.width,U?.height,s]),Q=t.lastError?.message,j=react.useCallback(()=>{let w={capture:{element:u,fullPage:f}};_&&(w.category=_),c(d,w);},[c,d,u,f,_]),lt=react.useCallback(w=>{(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&d.trim().length>0&&!A&&(w.preventDefault(),j());},[j,d,A]),[ye,oe]=react.useState(null),No=react.useCallback(async()=>{if(t.voiceRecording){n.stopVoice();return}oe(null);let w=await n.startVoice();if(w?.text)h(W=>W?W+" "+w.text:w.text);else if(w?.warning)oe(a.voiceEmptyText);else if(!w){let W=n.getState().lastError;if(W){let Z=W.message?.toLowerCase()??"";Z.includes("denied")||Z.includes("permission")||Z.includes("not allowed")?oe(a.voiceDeniedText):oe(a.voiceErrorText);}}},[t.voiceRecording,n,a]),Do=Ao(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Do,{position:s,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??a.triggerLabel,queueCount:G,showSuccess:He}),t.phase!=="idle"&&t.phase!=="recording"&&jsxRuntime.jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsxRuntime.jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>r()}),U&&jsxRuntime.jsx(va,{rect:U}),t.phase==="picking"&&jsxRuntime.jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{id:"bf-hint-text",children:a.hintText}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),"aria-label":a.cancelButton,children:a.cancelButton})]}),I&&ne&&jsxRuntime.jsxs("div",{ref:R,className:"bf-panel",style:{left:ne.left,top:ne.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxRuntime.jsxs("div",{className:"bf-panelHeader",children:[jsxRuntime.jsx("div",{className:"bf-title",id:"bf-panel-title",children:a.panelTitle}),jsxRuntime.jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:A,"aria-label":a.rePickButton,children:a.rePickButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.closeButton,children:a.closeButton})]})]}),jsxRuntime.jsxs("div",{className:"bf-panelBody",children:[jsxRuntime.jsx("textarea",{className:"bf-textarea",placeholder:a.textareaPlaceholder,value:d,onChange:w=>h(w.target.value),onKeyDown:lt,disabled:A,"aria-label":a.panelTitle}),z.length>0&&jsxRuntime.jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:z.map(w=>jsxRuntime.jsx("button",{type:"button",className:`bf-pill${_===w?" bf-pill-active":""}`,onClick:()=>E(_===w?void 0:w),disabled:A,children:a[_a[w]]},w))}),jsxRuntime.jsxs("div",{className:"bf-row",role:"group","aria-label":a.screenshotElement,children:[jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:w=>p(w.target.checked),disabled:A}),a.screenshotElement]}),jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:f,onChange:w=>g(w.target.checked),disabled:A}),a.screenshotFullPage]})]}),se&&t.phase==="review"&&!t.voiceTranscribing&&jsxRuntime.jsx("button",{type:"button",className:`bf-voice-btn${t.voiceRecording?" bf-voice-btn-active":""}`,onClick:No,disabled:A,"aria-label":t.voiceRecording?a.voiceStopButton:a.voiceButton,children:t.voiceRecording?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),a.voiceRecordingText," ",Oe(t.voiceElapsedMs??0)," / ",Oe(ue)," \u2014 ",a.voiceStopButton]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"bf-mic-icon",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[jsxRuntime.jsx("rect",{x:"9",y:"1",width:"6",height:"11",rx:"3"}),jsxRuntime.jsx("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),jsxRuntime.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),jsxRuntime.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),a.voiceButton]})}),t.voiceTranscribing&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.voiceTranscribingText]}),ye&&!t.voiceRecording&&!t.voiceTranscribing&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:ye}),H&&t.phase==="review"&&!t.video&&jsxRuntime.jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>n.startRecording(),disabled:A,"aria-label":a.recordButton,children:[jsxRuntime.jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),a.recordButton]}),t.video&&t.phase==="review"&&jsxRuntime.jsxs("div",{className:"bf-video-preview",children:[jsxRuntime.jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsxRuntime.jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>n.removeVideo(),"aria-label":a.removeVideoButton,children:"\xD7"}),jsxRuntime.jsxs("div",{className:"bf-video-meta",children:[a.videoPreviewLabel," (",Oe(t.video.durationMs),", ",Ta(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.capturingText]}),t.phase==="submitting"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.submittingText]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:a.successText}),t.phase==="error"&&Q&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:Q}),jsxRuntime.jsxs("div",{className:"bf-actions",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.cancelButton,children:a.cancelButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:j,disabled:A||d.trim().length===0,"aria-label":a.sendButton,children:a.sendButton})]})]}),l&&jsxRuntime.jsxs("div",{className:"bf-watermark",children:[(()=>{let w=_t();return w?jsxRuntime.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-my-feedback-link",children:"View my feedback"}):null})(),jsxRuntime.jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})]})]})]}),t.phase==="recording"&&jsxRuntime.jsxs("div",{className:`bf-recording-bar bf-pos-${s}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"bf-recording-bar-timer",children:[a.recordingText," ",Oe(t.recordingElapsedMs??0)," / ",Oe(F)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>n.stopRecording(),"aria-label":a.stopRecordButton,children:a.stopRecordButton})]}),t.phase==="success"&&jsxRuntime.jsxs("div",{className:"bf-toast",role:"status","aria-live":"polite",children:[a.toastText,(()=>{let w=_t();return w?jsxRuntime.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-toast-link",children:"View my feedback"}):null})()]}),L>0&&!y&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>S(true),"aria-label":"Dismiss",children:"\xD7"}),jsxRuntime.jsx("strong",{children:"Security Warning"}),L," potential secret",L>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Ra=react.forwardRef(function(t,n){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[r,i]=react.useState(null),c=Ea(o.ui?.showOn),s=ka(o.ui?.theme?.mode),a=!!o.diagnostics;react.useEffect(()=>{if(a)return Gn(o.diagnostics),()=>Jn()},[a]);let l=!!o.security;react.useEffect(()=>{l&&Zn(o.security);},[l]);let m=react.useRef(t.config?.metadata?.enrich);m.current=t.config?.metadata?.enrich;let b=react.useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async d=>{let h=m.current,u=h?await h(d):{},p=Qn(),f=Nt(),g=yt();return {...u,...p.consoleLogs.length>0?{_consoleLogs:p.consoleLogs}:{},...p.networkErrors.length>0?{_networkErrors:p.networkErrors}:{},...f.findings.length>0?{_securityFindings:f.findings}:{},...g.length>0?{_clickEvents:g}:{}}}}}},[]);return react.useEffect(()=>{Kn();let d=document.createElement("div");d.setAttribute("data-blocfeed-ui-root","true"),d.setAttribute("data-blocfeed-ui","true"),d.setAttribute("data-bf-theme",s);let h=o.ui?.zIndex;typeof h=="number"&&d.style.setProperty("--bf-z",String(h));let u=o.ui?.theme;u&&(u.accentColor&&d.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&d.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&d.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&d.style.setProperty("--bf-font",u.fontFamily));let p=g=>g.stopPropagation(),f=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend"];for(let g of f)d.addEventListener(g,p);try{document.body.appendChild(d);}catch{return}return i(d),()=>{for(let g of f)d.removeEventListener(g,p);d.remove(),i(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,s]),!c||!r?null:reactDom.createPortal(jsxRuntime.jsx(Pt,{blocfeed_id:o.blocfeed_id,...b?{config:b}:{},children:jsxRuntime.jsx(Ca,{config:o,handleRef:n})}),r)});var Vn="0.21.0",pd={init(e){ke(e);},identify(e){Un(e);},track:Fe};
|
|
883
|
+
`;function Kn(){if(!T()||document.getElementById($n))return;let e=document.createElement("style");e.id=$n,e.textContent=mi,document.head.appendChild(e);}var Ae=[],Me=[],Xn=20,jn=15,et=[],Yn=typeof console<"u"?{log:console.log?.bind(console),warn:console.warn?.bind(console),error:console.error?.bind(console),info:console.info?.bind(console),debug:console.debug?.bind(console)}:{},tt=typeof globalThis<"u"&&typeof globalThis.fetch=="function"?globalThis.fetch:void 0,nt=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.open:void 0,ot=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.send:void 0,Bt=new Set,At=false,Mt=false,rt=false,gi=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function bi(e){if(e instanceof Error)return e.name&&e.name!=="Error"?`${e.name}: ${e.message}`:e.message||String(e);if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function hi(e,t){let n=t.map(bi).join(" "),o=t.find(i=>i instanceof Error),r={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(o?.stack&&(r.stack=o.stack.slice(0,2e3)),Ae.push(r);Ae.length>Xn;)Ae.shift();}function Ft(e){let t=e.url.toLowerCase();for(let n of et)if(t.includes(n))return;for(Me.push(e);Me.length>jn;)Me.shift();}function Gn(e={}){if(rt||!T())return;rt=true,Xn=e.consoleLimit??20,jn=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?et=t.map(n=>n.toLowerCase()):et=[...gi],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let o of n){let r=Yn[o];r&&(Bt.add(o),console[o]=(...i)=>{hi(o,i),r.apply(console,i);});}}if(e.network!==false&&tt){let n=tt;At=true,window.fetch=async function(r,i){let c=typeof r=="string"?r:r instanceof URL?r.toString():r.url,s=(i?.method??"GET").toUpperCase(),a=Date.now();try{let l=await n.call(window,r,i);return l.ok||Ft({url:c.slice(0,500),method:s,status:l.status,statusText:l.statusText,timestamp:a,durationMs:Date.now()-a}),l}catch(l){throw Ft({url:c.slice(0,500),method:s,status:0,statusText:l instanceof Error?l.message:"Network error",timestamp:a,durationMs:Date.now()-a}),l}};}if(e.network!==false&&nt&&ot){let n=nt,o=ot;Mt=true,XMLHttpRequest.prototype.open=function(r,i,...c){return this.__bf_method=r.toUpperCase(),this.__bf_url=String(i),n.apply(this,[r,i,...c])},XMLHttpRequest.prototype.send=function(...r){let i=this.__bf_method||"GET",c=this.__bf_url||"",s=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let a={url:c.slice(0,500),method:i,status:this.status,timestamp:s,durationMs:Date.now()-s};this.statusText&&(a.statusText=this.statusText),Ft(a);}},{once:true}),o.apply(this,r)};}}function Jn(){if(rt){for(let e of Bt){let t=Yn[e];t&&(console[e]=t);}Bt.clear(),At&&tt&&(window.fetch=tt,At=false),Mt&&nt&&ot&&(XMLHttpRequest.prototype.open=nt,XMLHttpRequest.prototype.send=ot,Mt=false),et=[],rt=false;}}function Qn(){return {consoleLogs:[...Ae],networkErrors:[...Me]}}function xc(){Ae=[],Me=[];}var vi=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]{1,8}[A-Za-z0-9_.=-]{30,400}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:\s"']{1,100}:[^@\s"']{1,200}@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]{1,8}[A-Za-z0-9/+=]{30,200}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]{1,8}[A-Za-z0-9/+=]{30,600}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,200}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,200}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,200}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,100}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,100}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,100}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,100}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,200}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,200}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,200}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,100}\.[a-zA-Z0-9_-]{22,100}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]{1,8}[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,60}_SECRET_KEY["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_secret",pattern:/[A-Z_]{2,60}_SECRET["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_password",pattern:/[A-Z_]{2,60}_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,60}_PRIVATE_KEY["'=:\s]{1,8}[^\s"']{8,400}/}],ge=[],Lt=0,It=false;function yi(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function wi(e,t,n,o){if(ge.some(c=>c.rule===e&&c.source===t))return;let i={rule:e,source:t,hint:yi(n),timestamp:Date.now()};o&&(i.location=o),ge.push(i);}function Ie(e,t,n,o){for(let{name:r,pattern:i}of n){let c=i.exec(e);c&&wi(r,t,c[0],o);}}function xi(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);Ie(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);Ie(n,"hydration",e,"__NUXT__");}}catch{}}function Ei(e){try{document.querySelectorAll("script:not([src])").forEach((n,o)=>{let r=n.textContent;r&&r.length>0&&Ie(r,"scripts",e,`inline-script[${o}]`);});}catch{}}function ki(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let o=n.getAttribute("content"),r=n.getAttribute("name")||n.getAttribute("property")||"";o&&o.length>10&&Ie(o,"meta",e,r?`meta[${r}]`:void 0);});}catch{}}function Si(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let o=n.attributes;for(let r=0;r<o.length;r++){let i=o[r];i.name.startsWith("data-")&&i.value.length>10&&Ie(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Zn(e={}){if(It||!T()||(It=true,e.secretScan===false))return;let t=[...vi,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{Lt=Date.now(),n.includes("hydration")&&xi(t),n.includes("scripts")&&Ei(t),n.includes("meta")&&ki(t),n.includes("dom")&&Si(t);let o=e.notify??"both";ge.length>0&&(o==="console"||o==="both")&&console.warn(`[BlocFeed Security] Found ${ge.length} potential secret(s) exposed in client code:`,ge.map(r=>`${r.rule} (${r.source}${r.location?`: ${r.location}`:""})`));},100);}function Nt(){return {findings:[...ge],scannedAt:Lt}}function Sc(){ge=[],Lt=0,It=false;}var eo={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove",voiceButton:"Voice",voiceStopButton:"Stop",voiceRecordingText:"Recording\u2026",voiceTranscribingText:"Transcribing\u2026",voiceDeniedText:"Microphone access was denied",voiceErrorText:"Voice transcription failed. Please type instead.",voiceEmptyText:"No speech detected. Try again or type instead."};function to(e){return e?{...eo,...e}:eo}function Dt(){let e=react.useContext(Qe);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo,track:Fe}}function q(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function O({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function no({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function oo({size:e=16}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function io({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){return n?jsxRuntime.jsxs("button",{className:q(e),type:"button",onClick:t,"aria-label":o,children:[i?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]}):null}function V(){let[e,t]=react.useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return react.useEffect(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),o=r=>t(r.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}var Bi={duration:.18,ease:"easeOut"},Ai={duration:0};function so({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?Ai:Bi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",animate:a?{}:{scale:c?1:[1,1.2,1],boxShadow:c?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"dot")})}var Ni={duration:.18,ease:"easeOut"},lo={duration:0};function fo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?lo:Ni;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsxs(framerMotion.motion.div,{className:q(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:l,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:a?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a?0:4},transition:l,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxRuntime.jsxs(framerMotion.motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:a?{}:{y:[0,-3,0]},transition:a?lo:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:16})},"success"):jsxRuntime.jsx(no,{size:16}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${r} queued`,children:r})]})]},"bubble")})}var Hi={duration:.2,ease:"easeOut"},Ui={duration:0};function mo(e){return e==="bottom-left"||e==="top-left"}function zi(e){return `bf-trigger-edge ${mo(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function go({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=mo(e),l=V(),m=l?Ui:Hi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:zi(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:c?140:22,height:c?40:90},exit:{width:0,opacity:0},transition:m,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:m,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.span,{animate:{rotate:l||c?0:a?-90:90,opacity:c?1:.6},transition:m,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",animate:{opacity:c?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[a?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"edge-tab")})}var qi={duration:.18,ease:"easeOut"},$i={duration:0};function ho({delay:e,hovered:t,reduced:n}){return n?null:jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function yo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?$i:qi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(ho,{delay:0,hovered:c,reduced:a}),jsxRuntime.jsx(ho,{delay:.7,hovered:c,reduced:a}),jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"pulse-ring")})}var Yi={duration:.18,ease:"easeOut"},Gi={duration:0};function Ji(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Eo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?Gi:Yi;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsxs(framerMotion.motion.button,{className:Ji(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:a?0:5},animate:{opacity:c?1:.65,y:0},exit:{opacity:0,y:a?0:5},transition:l,whileTap:{scale:.95},children:[i?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${r} queued`,children:r})]}),!a&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:c?1:0},transition:l})]},"minimal")})}var ea={duration:.18,ease:"easeOut"},ta={duration:0};function So({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?ta:ea;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.9},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{style:{display:"inline-flex",flexShrink:0},animate:a?{}:c?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:c||a?l:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsxRuntime.jsx(oo,{size:16})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-8},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"icon-pop")})}var ia={duration:.18,ease:"easeOut"},aa={duration:0};function Co({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),a=V(),l=a?aa:ia;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:a?{}:{opacity:c?1:[.5,1,.5],boxShadow:c?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),!c&&!a&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:c&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"beacon")})}var ua={duration:.18,ease:"easeOut"},fa={duration:0};function Bo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=react.useState(false),[a,l]=react.useState(0),m=V(),b=m?fa:ua,d=react.useRef(null);react.useEffect(()=>{if(d.current&&(clearInterval(d.current),d.current=null),!n||c||m){l(c||m?o.length:0);return}let u=8,p=o.length*2+u*2,f=0;return d.current=setInterval(()=>{f=(f+1)%p,f<=o.length?l(f):f<=o.length+u?l(o.length):f<=o.length*2+u?l(o.length*2+u-f):l(0);},100),()=>{d.current&&(clearInterval(d.current),d.current=null);}},[n,c,m,o]);let h=o.slice(0,a);return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:m?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:m?0:5},transition:b,whileTap:{scale:.95},style:{minWidth:"44px"},children:i?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:b,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(O,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxRuntime.jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[h,jsxRuntime.jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),r>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"typewriter")})}function Ao(e){switch(e){case "dot":return so;case "bubble":return fo;case "edge-tab":return go;case "pulse-ring":return yo;case "minimal":return Eo;case "icon-pop":return So;case "beacon":return Co;case "typewriter":return Bo;default:return io}}function Mo(e,t,n){return Math.max(t,Math.min(n,e))}function ha(e,t,n="bottom-right"){let r=window.innerWidth,i=window.innerHeight,c;c=Mo(e.x,12,Math.max(12,r-t-12));let s=e.y+e.height+12,a=Math.max(12,e.y-240);return {top:s+240<=i?s:a,left:c}}function va(e){let{rect:t}=e,n={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsxRuntime.jsx("div",{className:"bf-highlight",style:n,"aria-hidden":"true"})}function ya(e){let t=react.useRef(null);return react.useEffect(()=>{if(!e||!t.current)return;let n=t.current,o=n.querySelector(".bf-textarea");o?.focus();let r=c=>{if(c.key!=="Tab")return;let s=n.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(s.length===0)return;let a=s[0],l=s[s.length-1];c.shiftKey&&document.activeElement===a?(c.preventDefault(),l.focus()):!c.shiftKey&&document.activeElement===l&&(c.preventDefault(),a.focus());},i=c=>{let s=c.target;s&&(n.contains(s)||(c.stopImmediatePropagation(),o?.focus()));};return document.addEventListener("keydown",r,{capture:true}),document.addEventListener("focusin",i,{capture:true}),()=>{document.removeEventListener("keydown",r,{capture:true}),document.removeEventListener("focusin",i,{capture:true});}},[e]),t}function wa(e,t){return e?typeof e=="function"?e(t):e.some(n=>n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n):true}var Ut=new Set,Io=false;function xa(){if(Io||typeof window>"u")return;Io=true;let e=history.pushState,t=history.replaceState,n=()=>{for(let o of Ut)o();};history.pushState=function(...o){e.apply(this,o),setTimeout(n,0);},history.replaceState=function(...o){t.apply(this,o),setTimeout(n,0);};}function Ea(e){let[t,n]=react.useState(()=>typeof window<"u"?window.location.pathname:"/");return react.useEffect(()=>{if(typeof window>"u")return;let o=()=>n(window.location.pathname);return window.addEventListener("popstate",o),xa(),Ut.add(o),()=>{window.removeEventListener("popstate",o),Ut.delete(o);}},[]),wa(e,t)}function ka(e){let[t,n]=react.useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return react.useEffect(()=>{if(e!=="auto"){n(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),r=i=>n(i.matches?"dark":"light");return n(o.matches?"dark":"light"),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}var Sa=["bug","feature","ux","general"],_a={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function Oe(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),o=t%60;return `${n}:${String(o).padStart(2,"0")}`}function Ta(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ca(e){let{state:t,controller:n,start:o,stop:r,clearSelection:i,submit:c}=Dt(),s=e.config.ui?.position,a=to(e.config.ui?.strings),l=e.config.ui?.branding!==false,[m,b]=react.useState(null),[d,h]=react.useState(""),[u,p]=react.useState(e.config.capture?.element??true),[f,g]=react.useState(e.config.capture?.fullPage??false),[v,C]=react.useState(null),[_,E]=react.useState(void 0),z=e.config.ui?.categories??Sa,H=e.config.recording?.enabled===true&&wt(),F=e.config.recording?.maxDurationMs??3e4,M=n.getConfig().voice,se=M?.enabled===true&&Et(),ue=M?.maxDurationMs??6e4,[y,S]=react.useState(false),[L,N]=react.useState(0);react.useEffect(()=>{let w=window.setTimeout(()=>{let W=Nt();N(W.findings.length);},500);return ()=>window.clearTimeout(w)},[]),react.useImperativeHandle(e.handleRef,()=>({open:o,close:r,submit:w=>c(w),startRecording:()=>n.startRecording(),stopRecording:()=>n.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,r,c,n,t.phase]);let I=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",R=ya(I),[G,te]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&te(on());},[t.phase]);let[He,ce]=react.useState(false),B=react.useRef(t.phase);react.useEffect(()=>{if(B.current==="success"&&t.phase==="idle"){ce(true);let w=window.setTimeout(()=>ce(false),1500);return ()=>window.clearTimeout(w)}B.current=t.phase;},[t.phase]),react.useEffect(()=>{let w=e.config.ui?.shortcut;if(!w)return;let W=w.toLowerCase().split("+").map(ee=>ee.trim()),Z=W[W.length-1]||"",fe=new Set(W.slice(0,-1)),Vt=ee=>{let Oo=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(fe.has("mod")){if(Oo?!ee.metaKey:!ee.ctrlKey)return}else if(fe.has("ctrl")&&!ee.ctrlKey||(fe.has("meta")||fe.has("cmd"))&&!ee.metaKey)return;fe.has("shift")&&!ee.shiftKey||(fe.has("alt")||fe.has("option"))&&!ee.altKey||ee.key.toLowerCase()===Z&&(ee.preventDefault(),t.phase==="idle"?o():r());};return document.addEventListener("keydown",Vt),()=>document.removeEventListener("keydown",Vt)},[e.config.ui?.shortcut,t.phase,o,r]),react.useEffect(()=>n.subscribeHover(b),[n]),react.useEffect(()=>{let w=n.__unsafeGetSelectedElement();if(!w||t.phase==="idle"||t.phase==="picking"){C(null);return}let W=()=>{C(Ce(w.getBoundingClientRect()));};W();let Z=()=>W();return window.addEventListener("scroll",Z,{capture:true,passive:true}),window.addEventListener("resize",Z,{passive:true}),()=>{window.removeEventListener("scroll",Z,{capture:true}),window.removeEventListener("resize",Z);}},[n,t.phase,t.selection?.selector]),react.useEffect(()=>{t.phase==="review"&&(h(""),p(e.config.capture?.element??true),g(e.config.capture?.fullPage??false),E(void 0),oe(null));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),react.useEffect(()=>{if(t.phase!=="success")return;let w=window.setTimeout(()=>r(),1200);return ()=>window.clearTimeout(w)},[t.phase,r]);let A=t.phase==="capturing"||t.phase==="submitting",U=t.phase==="picking"?m?.rect??null:v??t.selection?.rect??null,ne=react.useMemo(()=>U?ha(U,360,s):null,[U?.x,U?.y,U?.width,U?.height,s]),Q=t.lastError?.message,j=react.useCallback(()=>{let w={capture:{element:u,fullPage:f}};_&&(w.category=_),c(d,w);},[c,d,u,f,_]),lt=react.useCallback(w=>{(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&d.trim().length>0&&!A&&(w.preventDefault(),j());},[j,d,A]),[ye,oe]=react.useState(null),No=react.useCallback(async()=>{if(t.voiceRecording){n.stopVoice();return}oe(null);let w=await n.startVoice();if(w?.text)h(W=>W?W+" "+w.text:w.text);else if(w?.warning)oe(a.voiceEmptyText);else if(!w){let W=n.getState().lastError;if(W){let Z=W.message?.toLowerCase()??"";Z.includes("denied")||Z.includes("permission")||Z.includes("not allowed")?oe(a.voiceDeniedText):oe(a.voiceErrorText);}}},[t.voiceRecording,n,a]),Do=Ao(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Do,{position:s,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??a.triggerLabel,queueCount:G,showSuccess:He}),t.phase!=="idle"&&t.phase!=="recording"&&jsxRuntime.jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsxRuntime.jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>r()}),U&&jsxRuntime.jsx(va,{rect:U}),t.phase==="picking"&&jsxRuntime.jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{id:"bf-hint-text",children:a.hintText}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),"aria-label":a.cancelButton,children:a.cancelButton})]}),I&&ne&&jsxRuntime.jsxs("div",{ref:R,className:"bf-panel",style:{left:ne.left,top:ne.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxRuntime.jsxs("div",{className:"bf-panelHeader",children:[jsxRuntime.jsx("div",{className:"bf-title",id:"bf-panel-title",children:a.panelTitle}),jsxRuntime.jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:A,"aria-label":a.rePickButton,children:a.rePickButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.closeButton,children:a.closeButton})]})]}),jsxRuntime.jsxs("div",{className:"bf-panelBody",children:[jsxRuntime.jsx("textarea",{className:"bf-textarea",placeholder:a.textareaPlaceholder,value:d,onChange:w=>h(w.target.value),onKeyDown:lt,disabled:A,"aria-label":a.panelTitle}),z.length>0&&jsxRuntime.jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:z.map(w=>jsxRuntime.jsx("button",{type:"button",className:`bf-pill${_===w?" bf-pill-active":""}`,onClick:()=>E(_===w?void 0:w),disabled:A,children:a[_a[w]]},w))}),jsxRuntime.jsxs("div",{className:"bf-row",role:"group","aria-label":a.screenshotElement,children:[jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:w=>p(w.target.checked),disabled:A}),a.screenshotElement]}),jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:f,onChange:w=>g(w.target.checked),disabled:A}),a.screenshotFullPage]})]}),se&&t.phase==="review"&&!t.voiceTranscribing&&jsxRuntime.jsx("button",{type:"button",className:`bf-voice-btn${t.voiceRecording?" bf-voice-btn-active":""}`,onClick:No,disabled:A,"aria-label":t.voiceRecording?a.voiceStopButton:a.voiceButton,children:t.voiceRecording?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),a.voiceRecordingText," ",Oe(t.voiceElapsedMs??0)," / ",Oe(ue)," \u2014 ",a.voiceStopButton]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"bf-mic-icon",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[jsxRuntime.jsx("rect",{x:"9",y:"1",width:"6",height:"11",rx:"3"}),jsxRuntime.jsx("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),jsxRuntime.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),jsxRuntime.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),a.voiceButton]})}),t.voiceTranscribing&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.voiceTranscribingText]}),ye&&!t.voiceRecording&&!t.voiceTranscribing&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:ye}),H&&t.phase==="review"&&!t.video&&jsxRuntime.jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>n.startRecording(),disabled:A,"aria-label":a.recordButton,children:[jsxRuntime.jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),a.recordButton]}),t.video&&t.phase==="review"&&jsxRuntime.jsxs("div",{className:"bf-video-preview",children:[jsxRuntime.jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsxRuntime.jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>n.removeVideo(),"aria-label":a.removeVideoButton,children:"\xD7"}),jsxRuntime.jsxs("div",{className:"bf-video-meta",children:[a.videoPreviewLabel," (",Oe(t.video.durationMs),", ",Ta(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.capturingText]}),t.phase==="submitting"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.submittingText]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:a.successText}),t.phase==="error"&&Q&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:Q}),jsxRuntime.jsxs("div",{className:"bf-actions",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.cancelButton,children:a.cancelButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:j,disabled:A||d.trim().length===0,"aria-label":a.sendButton,children:a.sendButton})]})]}),l&&jsxRuntime.jsxs("div",{className:"bf-watermark",children:[(()=>{let w=_t();return w?jsxRuntime.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-my-feedback-link",children:"View my feedback"}):null})(),jsxRuntime.jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})]})]})]}),t.phase==="recording"&&jsxRuntime.jsxs("div",{className:`bf-recording-bar bf-pos-${s}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"bf-recording-bar-timer",children:[a.recordingText," ",Oe(t.recordingElapsedMs??0)," / ",Oe(F)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>n.stopRecording(),"aria-label":a.stopRecordButton,children:a.stopRecordButton})]}),t.phase==="success"&&jsxRuntime.jsxs("div",{className:"bf-toast",role:"status","aria-live":"polite",children:[a.toastText,(()=>{let w=_t();return w?jsxRuntime.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-toast-link",children:"View my feedback"}):null})()]}),L>0&&!y&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>S(true),"aria-label":"Dismiss",children:"\xD7"}),jsxRuntime.jsx("strong",{children:"Security Warning"}),L," potential secret",L>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Ra=react.forwardRef(function(t,n){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[r,i]=react.useState(null),c=Ea(o.ui?.showOn),s=ka(o.ui?.theme?.mode),a=!!o.diagnostics;react.useEffect(()=>{if(a)return Gn(o.diagnostics),()=>Jn()},[a]);let l=!!o.security;react.useEffect(()=>{l&&Zn(o.security);},[l]);let m=react.useRef(t.config?.metadata?.enrich);m.current=t.config?.metadata?.enrich;let b=react.useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async d=>{let h=m.current,u=h?await h(d):{},p=Qn(),f=Nt(),g=yt();return {...u,...p.consoleLogs.length>0?{_consoleLogs:p.consoleLogs}:{},...p.networkErrors.length>0?{_networkErrors:p.networkErrors}:{},...f.findings.length>0?{_securityFindings:f.findings}:{},...g.length>0?{_clickEvents:g}:{}}}}}},[]);return react.useEffect(()=>{Kn();let d=document.createElement("div");d.setAttribute("data-blocfeed-ui-root","true"),d.setAttribute("data-blocfeed-ui","true"),d.setAttribute("data-bf-theme",s);let h=o.ui?.zIndex;typeof h=="number"&&d.style.setProperty("--bf-z",String(h));let u=o.ui?.theme;u&&(u.accentColor&&d.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&d.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&d.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&d.style.setProperty("--bf-font",u.fontFamily));let p=g=>g.stopPropagation(),f=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend"];for(let g of f)d.addEventListener(g,p);try{document.body.appendChild(d);}catch{return}return i(d),()=>{for(let g of f)d.removeEventListener(g,p);d.remove(),i(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,s]),!c||!r?null:reactDom.createPortal(jsxRuntime.jsx(Pt,{blocfeed_id:o.blocfeed_id,...b?{config:b}:{},children:jsxRuntime.jsx(Ca,{config:o,handleRef:n})}),r)});var Vn="0.22.0",pd={init(e){ke(e);},identify(e){Un(e);},track:Fe};
|
|
884
884
|
exports.A=Zn;exports.B=Nt;exports.C=Sc;exports.D=Dt;exports.E=Ra;exports.F=Vn;exports.G=pd;exports.a=T;exports.b=Gt;exports.c=en;exports.d=tn;exports.e=ht;exports.f=nn;exports.g=za;exports.h=on;exports.i=yt;exports.j=ar;exports.k=wt;exports.l=xt;exports.m=Et;exports.n=kt;exports.o=wr;exports.p=_t;exports.q=xn;exports.r=Un;exports.s=Fe;exports.t=Be;exports.u=qn;exports.v=Pt;exports.w=Gn;exports.x=Jn;exports.y=Qn;exports.z=xc;
|
|
@@ -880,5 +880,5 @@ import {createContext,forwardRef,useState,useEffect,useRef,useMemo,useImperative
|
|
|
880
880
|
animation: none;
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
`;function Kn(){if(!T()||document.getElementById($n))return;let e=document.createElement("style");e.id=$n,e.textContent=mi,document.head.appendChild(e);}var Ae=[],Me=[],Xn=20,jn=15,et=[],Yn=typeof console<"u"?{log:console.log?.bind(console),warn:console.warn?.bind(console),error:console.error?.bind(console),info:console.info?.bind(console),debug:console.debug?.bind(console)}:{},tt=typeof globalThis<"u"&&typeof globalThis.fetch=="function"?globalThis.fetch:void 0,nt=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.open:void 0,ot=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.send:void 0,Bt=new Set,At=false,Mt=false,rt=false,gi=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function bi(e){if(e instanceof Error)return e.name&&e.name!=="Error"?`${e.name}: ${e.message}`:e.message||String(e);if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function hi(e,t){let n=t.map(bi).join(" "),o=t.find(i=>i instanceof Error),r={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(o?.stack&&(r.stack=o.stack.slice(0,2e3)),Ae.push(r);Ae.length>Xn;)Ae.shift();}function Ft(e){let t=e.url.toLowerCase();for(let n of et)if(t.includes(n))return;for(Me.push(e);Me.length>jn;)Me.shift();}function Gn(e={}){if(rt||!T())return;rt=true,Xn=e.consoleLimit??20,jn=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?et=t.map(n=>n.toLowerCase()):et=[...gi],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let o of n){let r=Yn[o];r&&(Bt.add(o),console[o]=(...i)=>{hi(o,i),r.apply(console,i);});}}if(e.network!==false&&tt){let n=tt;At=true,window.fetch=async function(r,i){let c=typeof r=="string"?r:r instanceof URL?r.toString():r.url,s=(i?.method??"GET").toUpperCase(),a=Date.now();try{let l=await n.call(window,r,i);return l.ok||Ft({url:c.slice(0,500),method:s,status:l.status,statusText:l.statusText,timestamp:a,durationMs:Date.now()-a}),l}catch(l){throw Ft({url:c.slice(0,500),method:s,status:0,statusText:l instanceof Error?l.message:"Network error",timestamp:a,durationMs:Date.now()-a}),l}};}if(e.network!==false&&nt&&ot){let n=nt,o=ot;Mt=true,XMLHttpRequest.prototype.open=function(r,i,...c){return this.__bf_method=r.toUpperCase(),this.__bf_url=String(i),n.apply(this,[r,i,...c])},XMLHttpRequest.prototype.send=function(...r){let i=this.__bf_method||"GET",c=this.__bf_url||"",s=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let a={url:c.slice(0,500),method:i,status:this.status,timestamp:s,durationMs:Date.now()-s};this.statusText&&(a.statusText=this.statusText),Ft(a);}},{once:true}),o.apply(this,r)};}}function Jn(){if(rt){for(let e of Bt){let t=Yn[e];t&&(console[e]=t);}Bt.clear(),At&&tt&&(window.fetch=tt,At=false),Mt&&nt&&ot&&(XMLHttpRequest.prototype.open=nt,XMLHttpRequest.prototype.send=ot,Mt=false),et=[],rt=false;}}function Qn(){return {consoleLogs:[...Ae],networkErrors:[...Me]}}function xc(){Ae=[],Me=[];}var vi=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]{1,8}[A-Za-z0-9_.=-]{30,400}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:\s"']{1,100}:[^@\s"']{1,200}@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]{1,8}[A-Za-z0-9/+=]{30,200}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]{1,8}[A-Za-z0-9/+=]{30,600}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,200}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,200}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,200}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,100}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,100}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,100}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,100}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,200}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,200}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,200}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,100}\.[a-zA-Z0-9_-]{22,100}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]{1,8}[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,60}_SECRET_KEY["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_secret",pattern:/[A-Z_]{2,60}_SECRET["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_password",pattern:/[A-Z_]{2,60}_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,60}_PRIVATE_KEY["'=:\s]{1,8}[^\s"']{8,400}/}],ge=[],Lt=0,It=false;function yi(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function wi(e,t,n,o){if(ge.some(c=>c.rule===e&&c.source===t))return;let i={rule:e,source:t,hint:yi(n),timestamp:Date.now()};o&&(i.location=o),ge.push(i);}function Ie(e,t,n,o){for(let{name:r,pattern:i}of n){let c=i.exec(e);c&&wi(r,t,c[0],o);}}function xi(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);Ie(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);Ie(n,"hydration",e,"__NUXT__");}}catch{}}function Ei(e){try{document.querySelectorAll("script:not([src])").forEach((n,o)=>{let r=n.textContent;r&&r.length>0&&Ie(r,"scripts",e,`inline-script[${o}]`);});}catch{}}function ki(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let o=n.getAttribute("content"),r=n.getAttribute("name")||n.getAttribute("property")||"";o&&o.length>10&&Ie(o,"meta",e,r?`meta[${r}]`:void 0);});}catch{}}function Si(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let o=n.attributes;for(let r=0;r<o.length;r++){let i=o[r];i.name.startsWith("data-")&&i.value.length>10&&Ie(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Zn(e={}){if(It||!T()||(It=true,e.secretScan===false))return;let t=[...vi,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{Lt=Date.now(),n.includes("hydration")&&xi(t),n.includes("scripts")&&Ei(t),n.includes("meta")&&ki(t),n.includes("dom")&&Si(t);let o=e.notify??"both";ge.length>0&&(o==="console"||o==="both")&&console.warn(`[BlocFeed Security] Found ${ge.length} potential secret(s) exposed in client code:`,ge.map(r=>`${r.rule} (${r.source}${r.location?`: ${r.location}`:""})`));},100);}function Nt(){return {findings:[...ge],scannedAt:Lt}}function Sc(){ge=[],Lt=0,It=false;}var eo={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove",voiceButton:"Voice",voiceStopButton:"Stop",voiceRecordingText:"Recording\u2026",voiceTranscribingText:"Transcribing\u2026",voiceDeniedText:"Microphone access was denied",voiceErrorText:"Voice transcription failed. Please type instead.",voiceEmptyText:"No speech detected. Try again or type instead."};function to(e){return e?{...eo,...e}:eo}function Dt(){let e=useContext(Qe);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo,track:Fe}}function q(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function O({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function no({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function oo({size:e=16}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function io({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){return n?jsxs("button",{className:q(e),type:"button",onClick:t,"aria-label":o,children:[i?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]}):null}function V(){let[e,t]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),o=r=>t(r.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}var Bi={duration:.18,ease:"easeOut"},Ai={duration:0};function so({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?Ai:Bi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:a?{}:{scale:c?1:[1,1.2,1],boxShadow:c?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"dot")})}var Ni={duration:.18,ease:"easeOut"},lo={duration:0};function fo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?lo:Ni;return jsx(AnimatePresence,{mode:"wait",children:n&&jsxs(motion.div,{className:q(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:l,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.div,{initial:{opacity:0,y:a?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a?0:4},transition:l,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxs(motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:a?{}:{y:[0,-3,0]},transition:a?lo:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:16})},"success"):jsx(no,{size:16}),r>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${r} queued`,children:r})]})]},"bubble")})}var Hi={duration:.2,ease:"easeOut"},Ui={duration:0};function mo(e){return e==="bottom-left"||e==="top-left"}function zi(e){return `bf-trigger-edge ${mo(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function go({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=mo(e),l=V(),m=l?Ui:Hi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:zi(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:c?140:22,height:c?40:90},exit:{width:0,opacity:0},transition:m,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:m,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:l||c?0:a?-90:90,opacity:c?1:.6},transition:m,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[c&&jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsx(motion.span,{"aria-hidden":"true",animate:{opacity:c?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[a?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"edge-tab")})}var qi={duration:.18,ease:"easeOut"},$i={duration:0};function ho({delay:e,hovered:t,reduced:n}){return n?null:jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function yo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?$i:qi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(ho,{delay:0,hovered:c,reduced:a}),jsx(ho,{delay:.7,hovered:c,reduced:a}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"pulse-ring")})}var Yi={duration:.18,ease:"easeOut"},Gi={duration:0};function Ji(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Eo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?Gi:Yi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsxs(motion.button,{className:Ji(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:a?0:5},animate:{opacity:c?1:.65,y:0},exit:{opacity:0,y:a?0:5},transition:l,whileTap:{scale:.95},children:[i?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:o}),r>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${r} queued`,children:r})]}),!a&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:c?1:0},transition:l})]},"minimal")})}var ea={duration:.18,ease:"easeOut"},ta={duration:0};function So({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?ta:ea;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.9},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:a?{}:c?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:c||a?l:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(oo,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-8},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"icon-pop")})}var ia={duration:.18,ease:"easeOut"},aa={duration:0};function Co({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?aa:ia;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:a?{}:{opacity:c?1:[.5,1,.5],boxShadow:c?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),!c&&!a&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"beacon")})}var ua={duration:.18,ease:"easeOut"},fa={duration:0};function Bo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),[a,l]=useState(0),m=V(),b=m?fa:ua,d=useRef(null);useEffect(()=>{if(d.current&&(clearInterval(d.current),d.current=null),!n||c||m){l(c||m?o.length:0);return}let u=8,p=o.length*2+u*2,f=0;return d.current=setInterval(()=>{f=(f+1)%p,f<=o.length?l(f):f<=o.length+u?l(o.length):f<=o.length*2+u?l(o.length*2+u-f):l(0);},100),()=>{d.current&&(clearInterval(d.current),d.current=null);}},[n,c,m,o]);let h=o.slice(0,a);return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:m?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:m?0:5},transition:b,whileTap:{scale:.95},style:{minWidth:"44px"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:b,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[h,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"typewriter")})}function Ao(e){switch(e){case "dot":return so;case "bubble":return fo;case "edge-tab":return go;case "pulse-ring":return yo;case "minimal":return Eo;case "icon-pop":return So;case "beacon":return Co;case "typewriter":return Bo;default:return io}}function Mo(e,t,n){return Math.max(t,Math.min(n,e))}function ha(e,t,n="bottom-right"){let r=window.innerWidth,i=window.innerHeight,c;c=Mo(e.x,12,Math.max(12,r-t-12));let s=e.y+e.height+12,a=Math.max(12,e.y-240);return {top:s+240<=i?s:a,left:c}}function va(e){let{rect:t}=e,n={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsx("div",{className:"bf-highlight",style:n,"aria-hidden":"true"})}function ya(e){let t=useRef(null);return useEffect(()=>{if(!e||!t.current)return;let n=t.current,o=n.querySelector(".bf-textarea");o?.focus();let r=c=>{if(c.key!=="Tab")return;let s=n.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(s.length===0)return;let a=s[0],l=s[s.length-1];c.shiftKey&&document.activeElement===a?(c.preventDefault(),l.focus()):!c.shiftKey&&document.activeElement===l&&(c.preventDefault(),a.focus());},i=c=>{let s=c.target;s&&(n.contains(s)||(c.stopImmediatePropagation(),o?.focus()));};return document.addEventListener("keydown",r,{capture:true}),document.addEventListener("focusin",i,{capture:true}),()=>{document.removeEventListener("keydown",r,{capture:true}),document.removeEventListener("focusin",i,{capture:true});}},[e]),t}function wa(e,t){return e?typeof e=="function"?e(t):e.some(n=>n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n):true}var Ut=new Set,Io=false;function xa(){if(Io||typeof window>"u")return;Io=true;let e=history.pushState,t=history.replaceState,n=()=>{for(let o of Ut)o();};history.pushState=function(...o){e.apply(this,o),setTimeout(n,0);},history.replaceState=function(...o){t.apply(this,o),setTimeout(n,0);};}function Ea(e){let[t,n]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let o=()=>n(window.location.pathname);return window.addEventListener("popstate",o),xa(),Ut.add(o),()=>{window.removeEventListener("popstate",o),Ut.delete(o);}},[]),wa(e,t)}function ka(e){let[t,n]=useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return useEffect(()=>{if(e!=="auto"){n(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),r=i=>n(i.matches?"dark":"light");return n(o.matches?"dark":"light"),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}var Sa=["bug","feature","ux","general"],_a={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function Oe(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),o=t%60;return `${n}:${String(o).padStart(2,"0")}`}function Ta(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ca(e){let{state:t,controller:n,start:o,stop:r,clearSelection:i,submit:c}=Dt(),s=e.config.ui?.position,a=to(e.config.ui?.strings),l=e.config.ui?.branding!==false,[m,b]=useState(null),[d,h]=useState(""),[u,p]=useState(e.config.capture?.element??true),[f,g]=useState(e.config.capture?.fullPage??false),[v,C]=useState(null),[_,E]=useState(void 0),z=e.config.ui?.categories??Sa,H=e.config.recording?.enabled===true&&wt(),F=e.config.recording?.maxDurationMs??3e4,M=n.getConfig().voice,se=M?.enabled===true&&Et(),ue=M?.maxDurationMs??6e4,[y,S]=useState(false),[L,N]=useState(0);useEffect(()=>{let w=window.setTimeout(()=>{let W=Nt();N(W.findings.length);},500);return ()=>window.clearTimeout(w)},[]),useImperativeHandle(e.handleRef,()=>({open:o,close:r,submit:w=>c(w),startRecording:()=>n.startRecording(),stopRecording:()=>n.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,r,c,n,t.phase]);let I=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",R=ya(I),[G,te]=useState(0);useEffect(()=>{t.phase==="idle"&&te(on());},[t.phase]);let[He,ce]=useState(false),B=useRef(t.phase);useEffect(()=>{if(B.current==="success"&&t.phase==="idle"){ce(true);let w=window.setTimeout(()=>ce(false),1500);return ()=>window.clearTimeout(w)}B.current=t.phase;},[t.phase]),useEffect(()=>{let w=e.config.ui?.shortcut;if(!w)return;let W=w.toLowerCase().split("+").map(ee=>ee.trim()),Z=W[W.length-1]||"",fe=new Set(W.slice(0,-1)),Vt=ee=>{let Oo=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(fe.has("mod")){if(Oo?!ee.metaKey:!ee.ctrlKey)return}else if(fe.has("ctrl")&&!ee.ctrlKey||(fe.has("meta")||fe.has("cmd"))&&!ee.metaKey)return;fe.has("shift")&&!ee.shiftKey||(fe.has("alt")||fe.has("option"))&&!ee.altKey||ee.key.toLowerCase()===Z&&(ee.preventDefault(),t.phase==="idle"?o():r());};return document.addEventListener("keydown",Vt),()=>document.removeEventListener("keydown",Vt)},[e.config.ui?.shortcut,t.phase,o,r]),useEffect(()=>n.subscribeHover(b),[n]),useEffect(()=>{let w=n.__unsafeGetSelectedElement();if(!w||t.phase==="idle"||t.phase==="picking"){C(null);return}let W=()=>{C(Ce(w.getBoundingClientRect()));};W();let Z=()=>W();return window.addEventListener("scroll",Z,{capture:true,passive:true}),window.addEventListener("resize",Z,{passive:true}),()=>{window.removeEventListener("scroll",Z,{capture:true}),window.removeEventListener("resize",Z);}},[n,t.phase,t.selection?.selector]),useEffect(()=>{t.phase==="review"&&(h(""),p(e.config.capture?.element??true),g(e.config.capture?.fullPage??false),E(void 0),oe(null));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),useEffect(()=>{if(t.phase!=="success")return;let w=window.setTimeout(()=>r(),1200);return ()=>window.clearTimeout(w)},[t.phase,r]);let A=t.phase==="capturing"||t.phase==="submitting",U=t.phase==="picking"?m?.rect??null:v??t.selection?.rect??null,ne=useMemo(()=>U?ha(U,360,s):null,[U?.x,U?.y,U?.width,U?.height,s]),Q=t.lastError?.message,j=useCallback(()=>{let w={capture:{element:u,fullPage:f}};_&&(w.category=_),c(d,w);},[c,d,u,f,_]),lt=useCallback(w=>{(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&d.trim().length>0&&!A&&(w.preventDefault(),j());},[j,d,A]),[ye,oe]=useState(null),No=useCallback(async()=>{if(t.voiceRecording){n.stopVoice();return}oe(null);let w=await n.startVoice();if(w?.text)h(W=>W?W+" "+w.text:w.text);else if(w?.warning)oe(a.voiceEmptyText);else if(!w){let W=n.getState().lastError;if(W){let Z=W.message?.toLowerCase()??"";Z.includes("denied")||Z.includes("permission")||Z.includes("not allowed")?oe(a.voiceDeniedText):oe(a.voiceErrorText);}}},[t.voiceRecording,n,a]),Do=Ao(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(Do,{position:s,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??a.triggerLabel,queueCount:G,showSuccess:He}),t.phase!=="idle"&&t.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>r()}),U&&jsx(va,{rect:U}),t.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:a.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),"aria-label":a.cancelButton,children:a.cancelButton})]}),I&&ne&&jsxs("div",{ref:R,className:"bf-panel",style:{left:ne.left,top:ne.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxs("div",{className:"bf-panelHeader",children:[jsx("div",{className:"bf-title",id:"bf-panel-title",children:a.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:A,"aria-label":a.rePickButton,children:a.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.closeButton,children:a.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:a.textareaPlaceholder,value:d,onChange:w=>h(w.target.value),onKeyDown:lt,disabled:A,"aria-label":a.panelTitle}),z.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:z.map(w=>jsx("button",{type:"button",className:`bf-pill${_===w?" bf-pill-active":""}`,onClick:()=>E(_===w?void 0:w),disabled:A,children:a[_a[w]]},w))}),jsxs("div",{className:"bf-row",role:"group","aria-label":a.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:w=>p(w.target.checked),disabled:A}),a.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:f,onChange:w=>g(w.target.checked),disabled:A}),a.screenshotFullPage]})]}),se&&t.phase==="review"&&!t.voiceTranscribing&&jsx("button",{type:"button",className:`bf-voice-btn${t.voiceRecording?" bf-voice-btn-active":""}`,onClick:No,disabled:A,"aria-label":t.voiceRecording?a.voiceStopButton:a.voiceButton,children:t.voiceRecording?jsxs(Fragment,{children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),a.voiceRecordingText," ",Oe(t.voiceElapsedMs??0)," / ",Oe(ue)," \u2014 ",a.voiceStopButton]}):jsxs(Fragment,{children:[jsxs("svg",{className:"bf-mic-icon",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[jsx("rect",{x:"9",y:"1",width:"6",height:"11",rx:"3"}),jsx("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),a.voiceButton]})}),t.voiceTranscribing&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.voiceTranscribingText]}),ye&&!t.voiceRecording&&!t.voiceTranscribing&&jsx("div",{className:"bf-error",role:"alert",children:ye}),H&&t.phase==="review"&&!t.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>n.startRecording(),disabled:A,"aria-label":a.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),a.recordButton]}),t.video&&t.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>n.removeVideo(),"aria-label":a.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[a.videoPreviewLabel," (",Oe(t.video.durationMs),", ",Ta(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.capturingText]}),t.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.submittingText]}),t.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:a.successText}),t.phase==="error"&&Q&&jsx("div",{className:"bf-error",role:"alert",children:Q}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.cancelButton,children:a.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:j,disabled:A||d.trim().length===0,"aria-label":a.sendButton,children:a.sendButton})]})]}),l&&jsxs("div",{className:"bf-watermark",children:[(()=>{let w=_t();return w?jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-my-feedback-link",children:"View my feedback"}):null})(),jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})]})]})]}),t.phase==="recording"&&jsxs("div",{className:`bf-recording-bar bf-pos-${s}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{className:"bf-recording-bar-timer",children:[a.recordingText," ",Oe(t.recordingElapsedMs??0)," / ",Oe(F)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>n.stopRecording(),"aria-label":a.stopRecordButton,children:a.stopRecordButton})]}),t.phase==="success"&&jsxs("div",{className:"bf-toast",role:"status","aria-live":"polite",children:[a.toastText,(()=>{let w=_t();return w?jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-toast-link",children:"View my feedback"}):null})()]}),L>0&&!y&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>S(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),L," potential secret",L>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Ra=forwardRef(function(t,n){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[r,i]=useState(null),c=Ea(o.ui?.showOn),s=ka(o.ui?.theme?.mode),a=!!o.diagnostics;useEffect(()=>{if(a)return Gn(o.diagnostics),()=>Jn()},[a]);let l=!!o.security;useEffect(()=>{l&&Zn(o.security);},[l]);let m=useRef(t.config?.metadata?.enrich);m.current=t.config?.metadata?.enrich;let b=useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async d=>{let h=m.current,u=h?await h(d):{},p=Qn(),f=Nt(),g=yt();return {...u,...p.consoleLogs.length>0?{_consoleLogs:p.consoleLogs}:{},...p.networkErrors.length>0?{_networkErrors:p.networkErrors}:{},...f.findings.length>0?{_securityFindings:f.findings}:{},...g.length>0?{_clickEvents:g}:{}}}}}},[]);return useEffect(()=>{Kn();let d=document.createElement("div");d.setAttribute("data-blocfeed-ui-root","true"),d.setAttribute("data-blocfeed-ui","true"),d.setAttribute("data-bf-theme",s);let h=o.ui?.zIndex;typeof h=="number"&&d.style.setProperty("--bf-z",String(h));let u=o.ui?.theme;u&&(u.accentColor&&d.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&d.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&d.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&d.style.setProperty("--bf-font",u.fontFamily));let p=g=>g.stopPropagation(),f=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend"];for(let g of f)d.addEventListener(g,p);try{document.body.appendChild(d);}catch{return}return i(d),()=>{for(let g of f)d.removeEventListener(g,p);d.remove(),i(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,s]),!c||!r?null:createPortal(jsx(Pt,{blocfeed_id:o.blocfeed_id,...b?{config:b}:{},children:jsx(Ca,{config:o,handleRef:n})}),r)});var Vn="0.21.0",pd={init(e){ke(e);},identify(e){Un(e);},track:Fe};
|
|
883
|
+
`;function Kn(){if(!T()||document.getElementById($n))return;let e=document.createElement("style");e.id=$n,e.textContent=mi,document.head.appendChild(e);}var Ae=[],Me=[],Xn=20,jn=15,et=[],Yn=typeof console<"u"?{log:console.log?.bind(console),warn:console.warn?.bind(console),error:console.error?.bind(console),info:console.info?.bind(console),debug:console.debug?.bind(console)}:{},tt=typeof globalThis<"u"&&typeof globalThis.fetch=="function"?globalThis.fetch:void 0,nt=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.open:void 0,ot=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.send:void 0,Bt=new Set,At=false,Mt=false,rt=false,gi=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function bi(e){if(e instanceof Error)return e.name&&e.name!=="Error"?`${e.name}: ${e.message}`:e.message||String(e);if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function hi(e,t){let n=t.map(bi).join(" "),o=t.find(i=>i instanceof Error),r={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(o?.stack&&(r.stack=o.stack.slice(0,2e3)),Ae.push(r);Ae.length>Xn;)Ae.shift();}function Ft(e){let t=e.url.toLowerCase();for(let n of et)if(t.includes(n))return;for(Me.push(e);Me.length>jn;)Me.shift();}function Gn(e={}){if(rt||!T())return;rt=true,Xn=e.consoleLimit??20,jn=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?et=t.map(n=>n.toLowerCase()):et=[...gi],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let o of n){let r=Yn[o];r&&(Bt.add(o),console[o]=(...i)=>{hi(o,i),r.apply(console,i);});}}if(e.network!==false&&tt){let n=tt;At=true,window.fetch=async function(r,i){let c=typeof r=="string"?r:r instanceof URL?r.toString():r.url,s=(i?.method??"GET").toUpperCase(),a=Date.now();try{let l=await n.call(window,r,i);return l.ok||Ft({url:c.slice(0,500),method:s,status:l.status,statusText:l.statusText,timestamp:a,durationMs:Date.now()-a}),l}catch(l){throw Ft({url:c.slice(0,500),method:s,status:0,statusText:l instanceof Error?l.message:"Network error",timestamp:a,durationMs:Date.now()-a}),l}};}if(e.network!==false&&nt&&ot){let n=nt,o=ot;Mt=true,XMLHttpRequest.prototype.open=function(r,i,...c){return this.__bf_method=r.toUpperCase(),this.__bf_url=String(i),n.apply(this,[r,i,...c])},XMLHttpRequest.prototype.send=function(...r){let i=this.__bf_method||"GET",c=this.__bf_url||"",s=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let a={url:c.slice(0,500),method:i,status:this.status,timestamp:s,durationMs:Date.now()-s};this.statusText&&(a.statusText=this.statusText),Ft(a);}},{once:true}),o.apply(this,r)};}}function Jn(){if(rt){for(let e of Bt){let t=Yn[e];t&&(console[e]=t);}Bt.clear(),At&&tt&&(window.fetch=tt,At=false),Mt&&nt&&ot&&(XMLHttpRequest.prototype.open=nt,XMLHttpRequest.prototype.send=ot,Mt=false),et=[],rt=false;}}function Qn(){return {consoleLogs:[...Ae],networkErrors:[...Me]}}function xc(){Ae=[],Me=[];}var vi=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]{1,8}[A-Za-z0-9_.=-]{30,400}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:\s"']{1,100}:[^@\s"']{1,200}@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]{1,8}[A-Za-z0-9/+=]{30,200}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]{1,8}[A-Za-z0-9/+=]{30,600}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,200}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,200}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,200}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,100}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,100}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,100}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,100}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,200}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,200}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,200}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,100}\.[a-zA-Z0-9_-]{22,100}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]{1,8}[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,60}_SECRET_KEY["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_secret",pattern:/[A-Z_]{2,60}_SECRET["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_password",pattern:/[A-Z_]{2,60}_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,60}_PRIVATE_KEY["'=:\s]{1,8}[^\s"']{8,400}/}],ge=[],Lt=0,It=false;function yi(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function wi(e,t,n,o){if(ge.some(c=>c.rule===e&&c.source===t))return;let i={rule:e,source:t,hint:yi(n),timestamp:Date.now()};o&&(i.location=o),ge.push(i);}function Ie(e,t,n,o){for(let{name:r,pattern:i}of n){let c=i.exec(e);c&&wi(r,t,c[0],o);}}function xi(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);Ie(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);Ie(n,"hydration",e,"__NUXT__");}}catch{}}function Ei(e){try{document.querySelectorAll("script:not([src])").forEach((n,o)=>{let r=n.textContent;r&&r.length>0&&Ie(r,"scripts",e,`inline-script[${o}]`);});}catch{}}function ki(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let o=n.getAttribute("content"),r=n.getAttribute("name")||n.getAttribute("property")||"";o&&o.length>10&&Ie(o,"meta",e,r?`meta[${r}]`:void 0);});}catch{}}function Si(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let o=n.attributes;for(let r=0;r<o.length;r++){let i=o[r];i.name.startsWith("data-")&&i.value.length>10&&Ie(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Zn(e={}){if(It||!T()||(It=true,e.secretScan===false))return;let t=[...vi,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{Lt=Date.now(),n.includes("hydration")&&xi(t),n.includes("scripts")&&Ei(t),n.includes("meta")&&ki(t),n.includes("dom")&&Si(t);let o=e.notify??"both";ge.length>0&&(o==="console"||o==="both")&&console.warn(`[BlocFeed Security] Found ${ge.length} potential secret(s) exposed in client code:`,ge.map(r=>`${r.rule} (${r.source}${r.location?`: ${r.location}`:""})`));},100);}function Nt(){return {findings:[...ge],scannedAt:Lt}}function Sc(){ge=[],Lt=0,It=false;}var eo={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove",voiceButton:"Voice",voiceStopButton:"Stop",voiceRecordingText:"Recording\u2026",voiceTranscribingText:"Transcribing\u2026",voiceDeniedText:"Microphone access was denied",voiceErrorText:"Voice transcription failed. Please type instead.",voiceEmptyText:"No speech detected. Try again or type instead."};function to(e){return e?{...eo,...e}:eo}function Dt(){let e=useContext(Qe);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo,track:Fe}}function q(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function O({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function no({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function oo({size:e=16}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function io({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){return n?jsxs("button",{className:q(e),type:"button",onClick:t,"aria-label":o,children:[i?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]}):null}function V(){let[e,t]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),o=r=>t(r.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}var Bi={duration:.18,ease:"easeOut"},Ai={duration:0};function so({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?Ai:Bi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:a?{}:{scale:c?1:[1,1.2,1],boxShadow:c?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"dot")})}var Ni={duration:.18,ease:"easeOut"},lo={duration:0};function fo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?lo:Ni;return jsx(AnimatePresence,{mode:"wait",children:n&&jsxs(motion.div,{className:q(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:l,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.div,{initial:{opacity:0,y:a?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a?0:4},transition:l,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxs(motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:a?{}:{y:[0,-3,0]},transition:a?lo:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:16})},"success"):jsx(no,{size:16}),r>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${r} queued`,children:r})]})]},"bubble")})}var Hi={duration:.2,ease:"easeOut"},Ui={duration:0};function mo(e){return e==="bottom-left"||e==="top-left"}function zi(e){return `bf-trigger-edge ${mo(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function go({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=mo(e),l=V(),m=l?Ui:Hi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:zi(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:c?140:22,height:c?40:90},exit:{width:0,opacity:0},transition:m,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:m,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:l||c?0:a?-90:90,opacity:c?1:.6},transition:m,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[c&&jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsx(motion.span,{"aria-hidden":"true",animate:{opacity:c?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[a?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"edge-tab")})}var qi={duration:.18,ease:"easeOut"},$i={duration:0};function ho({delay:e,hovered:t,reduced:n}){return n?null:jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function yo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?$i:qi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(ho,{delay:0,hovered:c,reduced:a}),jsx(ho,{delay:.7,hovered:c,reduced:a}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"pulse-ring")})}var Yi={duration:.18,ease:"easeOut"},Gi={duration:0};function Ji(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Eo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?Gi:Yi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsxs(motion.button,{className:Ji(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:a?0:5},animate:{opacity:c?1:.65,y:0},exit:{opacity:0,y:a?0:5},transition:l,whileTap:{scale:.95},children:[i?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:o}),r>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${r} queued`,children:r})]}),!a&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:c?1:0},transition:l})]},"minimal")})}var ea={duration:.18,ease:"easeOut"},ta={duration:0};function So({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?ta:ea;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.9},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:a?{}:c?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:c||a?l:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(oo,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-8},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"icon-pop")})}var ia={duration:.18,ease:"easeOut"},aa={duration:0};function Co({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),a=V(),l=a?aa:ia;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:a?{}:{opacity:c?1:[.5,1,.5],boxShadow:c?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:c||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),!c&&!a&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsx(AnimatePresence,{mode:"wait",children:c&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:o},"label")}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"beacon")})}var ua={duration:.18,ease:"easeOut"},fa={duration:0};function Bo({position:e,onClick:t,isVisible:n,label:o,queueCount:r,showSuccess:i}){let[c,s]=useState(false),[a,l]=useState(0),m=V(),b=m?fa:ua,d=useRef(null);useEffect(()=>{if(d.current&&(clearInterval(d.current),d.current=null),!n||c||m){l(c||m?o.length:0);return}let u=8,p=o.length*2+u*2,f=0;return d.current=setInterval(()=>{f=(f+1)%p,f<=o.length?l(f):f<=o.length+u?l(o.length):f<=o.length*2+u?l(o.length*2+u-f):l(0);},100),()=>{d.current&&(clearInterval(d.current),d.current=null);}},[n,c,m,o]);let h=o.slice(0,a);return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:q(e),type:"button",onClick:t,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),"aria-label":o,initial:{opacity:0,y:m?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:m?0:5},transition:b,whileTap:{scale:.95},style:{minWidth:"44px"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:b,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(O,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[h,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),r>0&&jsx("span",{className:"bf-badge","aria-label":`${r} queued`,children:r})]})},"typewriter")})}function Ao(e){switch(e){case "dot":return so;case "bubble":return fo;case "edge-tab":return go;case "pulse-ring":return yo;case "minimal":return Eo;case "icon-pop":return So;case "beacon":return Co;case "typewriter":return Bo;default:return io}}function Mo(e,t,n){return Math.max(t,Math.min(n,e))}function ha(e,t,n="bottom-right"){let r=window.innerWidth,i=window.innerHeight,c;c=Mo(e.x,12,Math.max(12,r-t-12));let s=e.y+e.height+12,a=Math.max(12,e.y-240);return {top:s+240<=i?s:a,left:c}}function va(e){let{rect:t}=e,n={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsx("div",{className:"bf-highlight",style:n,"aria-hidden":"true"})}function ya(e){let t=useRef(null);return useEffect(()=>{if(!e||!t.current)return;let n=t.current,o=n.querySelector(".bf-textarea");o?.focus();let r=c=>{if(c.key!=="Tab")return;let s=n.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(s.length===0)return;let a=s[0],l=s[s.length-1];c.shiftKey&&document.activeElement===a?(c.preventDefault(),l.focus()):!c.shiftKey&&document.activeElement===l&&(c.preventDefault(),a.focus());},i=c=>{let s=c.target;s&&(n.contains(s)||(c.stopImmediatePropagation(),o?.focus()));};return document.addEventListener("keydown",r,{capture:true}),document.addEventListener("focusin",i,{capture:true}),()=>{document.removeEventListener("keydown",r,{capture:true}),document.removeEventListener("focusin",i,{capture:true});}},[e]),t}function wa(e,t){return e?typeof e=="function"?e(t):e.some(n=>n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n):true}var Ut=new Set,Io=false;function xa(){if(Io||typeof window>"u")return;Io=true;let e=history.pushState,t=history.replaceState,n=()=>{for(let o of Ut)o();};history.pushState=function(...o){e.apply(this,o),setTimeout(n,0);},history.replaceState=function(...o){t.apply(this,o),setTimeout(n,0);};}function Ea(e){let[t,n]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let o=()=>n(window.location.pathname);return window.addEventListener("popstate",o),xa(),Ut.add(o),()=>{window.removeEventListener("popstate",o),Ut.delete(o);}},[]),wa(e,t)}function ka(e){let[t,n]=useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return useEffect(()=>{if(e!=="auto"){n(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),r=i=>n(i.matches?"dark":"light");return n(o.matches?"dark":"light"),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}var Sa=["bug","feature","ux","general"],_a={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function Oe(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),o=t%60;return `${n}:${String(o).padStart(2,"0")}`}function Ta(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ca(e){let{state:t,controller:n,start:o,stop:r,clearSelection:i,submit:c}=Dt(),s=e.config.ui?.position,a=to(e.config.ui?.strings),l=e.config.ui?.branding!==false,[m,b]=useState(null),[d,h]=useState(""),[u,p]=useState(e.config.capture?.element??true),[f,g]=useState(e.config.capture?.fullPage??false),[v,C]=useState(null),[_,E]=useState(void 0),z=e.config.ui?.categories??Sa,H=e.config.recording?.enabled===true&&wt(),F=e.config.recording?.maxDurationMs??3e4,M=n.getConfig().voice,se=M?.enabled===true&&Et(),ue=M?.maxDurationMs??6e4,[y,S]=useState(false),[L,N]=useState(0);useEffect(()=>{let w=window.setTimeout(()=>{let W=Nt();N(W.findings.length);},500);return ()=>window.clearTimeout(w)},[]),useImperativeHandle(e.handleRef,()=>({open:o,close:r,submit:w=>c(w),startRecording:()=>n.startRecording(),stopRecording:()=>n.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,r,c,n,t.phase]);let I=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",R=ya(I),[G,te]=useState(0);useEffect(()=>{t.phase==="idle"&&te(on());},[t.phase]);let[He,ce]=useState(false),B=useRef(t.phase);useEffect(()=>{if(B.current==="success"&&t.phase==="idle"){ce(true);let w=window.setTimeout(()=>ce(false),1500);return ()=>window.clearTimeout(w)}B.current=t.phase;},[t.phase]),useEffect(()=>{let w=e.config.ui?.shortcut;if(!w)return;let W=w.toLowerCase().split("+").map(ee=>ee.trim()),Z=W[W.length-1]||"",fe=new Set(W.slice(0,-1)),Vt=ee=>{let Oo=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(fe.has("mod")){if(Oo?!ee.metaKey:!ee.ctrlKey)return}else if(fe.has("ctrl")&&!ee.ctrlKey||(fe.has("meta")||fe.has("cmd"))&&!ee.metaKey)return;fe.has("shift")&&!ee.shiftKey||(fe.has("alt")||fe.has("option"))&&!ee.altKey||ee.key.toLowerCase()===Z&&(ee.preventDefault(),t.phase==="idle"?o():r());};return document.addEventListener("keydown",Vt),()=>document.removeEventListener("keydown",Vt)},[e.config.ui?.shortcut,t.phase,o,r]),useEffect(()=>n.subscribeHover(b),[n]),useEffect(()=>{let w=n.__unsafeGetSelectedElement();if(!w||t.phase==="idle"||t.phase==="picking"){C(null);return}let W=()=>{C(Ce(w.getBoundingClientRect()));};W();let Z=()=>W();return window.addEventListener("scroll",Z,{capture:true,passive:true}),window.addEventListener("resize",Z,{passive:true}),()=>{window.removeEventListener("scroll",Z,{capture:true}),window.removeEventListener("resize",Z);}},[n,t.phase,t.selection?.selector]),useEffect(()=>{t.phase==="review"&&(h(""),p(e.config.capture?.element??true),g(e.config.capture?.fullPage??false),E(void 0),oe(null));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),useEffect(()=>{if(t.phase!=="success")return;let w=window.setTimeout(()=>r(),1200);return ()=>window.clearTimeout(w)},[t.phase,r]);let A=t.phase==="capturing"||t.phase==="submitting",U=t.phase==="picking"?m?.rect??null:v??t.selection?.rect??null,ne=useMemo(()=>U?ha(U,360,s):null,[U?.x,U?.y,U?.width,U?.height,s]),Q=t.lastError?.message,j=useCallback(()=>{let w={capture:{element:u,fullPage:f}};_&&(w.category=_),c(d,w);},[c,d,u,f,_]),lt=useCallback(w=>{(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&d.trim().length>0&&!A&&(w.preventDefault(),j());},[j,d,A]),[ye,oe]=useState(null),No=useCallback(async()=>{if(t.voiceRecording){n.stopVoice();return}oe(null);let w=await n.startVoice();if(w?.text)h(W=>W?W+" "+w.text:w.text);else if(w?.warning)oe(a.voiceEmptyText);else if(!w){let W=n.getState().lastError;if(W){let Z=W.message?.toLowerCase()??"";Z.includes("denied")||Z.includes("permission")||Z.includes("not allowed")?oe(a.voiceDeniedText):oe(a.voiceErrorText);}}},[t.voiceRecording,n,a]),Do=Ao(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(Do,{position:s,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??a.triggerLabel,queueCount:G,showSuccess:He}),t.phase!=="idle"&&t.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>r()}),U&&jsx(va,{rect:U}),t.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:a.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),"aria-label":a.cancelButton,children:a.cancelButton})]}),I&&ne&&jsxs("div",{ref:R,className:"bf-panel",style:{left:ne.left,top:ne.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxs("div",{className:"bf-panelHeader",children:[jsx("div",{className:"bf-title",id:"bf-panel-title",children:a.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:A,"aria-label":a.rePickButton,children:a.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.closeButton,children:a.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:a.textareaPlaceholder,value:d,onChange:w=>h(w.target.value),onKeyDown:lt,disabled:A,"aria-label":a.panelTitle}),z.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:z.map(w=>jsx("button",{type:"button",className:`bf-pill${_===w?" bf-pill-active":""}`,onClick:()=>E(_===w?void 0:w),disabled:A,children:a[_a[w]]},w))}),jsxs("div",{className:"bf-row",role:"group","aria-label":a.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:w=>p(w.target.checked),disabled:A}),a.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:f,onChange:w=>g(w.target.checked),disabled:A}),a.screenshotFullPage]})]}),se&&t.phase==="review"&&!t.voiceTranscribing&&jsx("button",{type:"button",className:`bf-voice-btn${t.voiceRecording?" bf-voice-btn-active":""}`,onClick:No,disabled:A,"aria-label":t.voiceRecording?a.voiceStopButton:a.voiceButton,children:t.voiceRecording?jsxs(Fragment,{children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),a.voiceRecordingText," ",Oe(t.voiceElapsedMs??0)," / ",Oe(ue)," \u2014 ",a.voiceStopButton]}):jsxs(Fragment,{children:[jsxs("svg",{className:"bf-mic-icon",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[jsx("rect",{x:"9",y:"1",width:"6",height:"11",rx:"3"}),jsx("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),a.voiceButton]})}),t.voiceTranscribing&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.voiceTranscribingText]}),ye&&!t.voiceRecording&&!t.voiceTranscribing&&jsx("div",{className:"bf-error",role:"alert",children:ye}),H&&t.phase==="review"&&!t.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>n.startRecording(),disabled:A,"aria-label":a.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),a.recordButton]}),t.video&&t.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>n.removeVideo(),"aria-label":a.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[a.videoPreviewLabel," (",Oe(t.video.durationMs),", ",Ta(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.capturingText]}),t.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.submittingText]}),t.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:a.successText}),t.phase==="error"&&Q&&jsx("div",{className:"bf-error",role:"alert",children:Q}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>r(),disabled:A,"aria-label":a.cancelButton,children:a.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:j,disabled:A||d.trim().length===0,"aria-label":a.sendButton,children:a.sendButton})]})]}),l&&jsxs("div",{className:"bf-watermark",children:[(()=>{let w=_t();return w?jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-my-feedback-link",children:"View my feedback"}):null})(),jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})]})]})]}),t.phase==="recording"&&jsxs("div",{className:`bf-recording-bar bf-pos-${s}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{className:"bf-recording-bar-timer",children:[a.recordingText," ",Oe(t.recordingElapsedMs??0)," / ",Oe(F)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>n.stopRecording(),"aria-label":a.stopRecordButton,children:a.stopRecordButton})]}),t.phase==="success"&&jsxs("div",{className:"bf-toast",role:"status","aria-live":"polite",children:[a.toastText,(()=>{let w=_t();return w?jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-toast-link",children:"View my feedback"}):null})()]}),L>0&&!y&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>S(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),L," potential secret",L>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Ra=forwardRef(function(t,n){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[r,i]=useState(null),c=Ea(o.ui?.showOn),s=ka(o.ui?.theme?.mode),a=!!o.diagnostics;useEffect(()=>{if(a)return Gn(o.diagnostics),()=>Jn()},[a]);let l=!!o.security;useEffect(()=>{l&&Zn(o.security);},[l]);let m=useRef(t.config?.metadata?.enrich);m.current=t.config?.metadata?.enrich;let b=useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async d=>{let h=m.current,u=h?await h(d):{},p=Qn(),f=Nt(),g=yt();return {...u,...p.consoleLogs.length>0?{_consoleLogs:p.consoleLogs}:{},...p.networkErrors.length>0?{_networkErrors:p.networkErrors}:{},...f.findings.length>0?{_securityFindings:f.findings}:{},...g.length>0?{_clickEvents:g}:{}}}}}},[]);return useEffect(()=>{Kn();let d=document.createElement("div");d.setAttribute("data-blocfeed-ui-root","true"),d.setAttribute("data-blocfeed-ui","true"),d.setAttribute("data-bf-theme",s);let h=o.ui?.zIndex;typeof h=="number"&&d.style.setProperty("--bf-z",String(h));let u=o.ui?.theme;u&&(u.accentColor&&d.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&d.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&d.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&d.style.setProperty("--bf-font",u.fontFamily));let p=g=>g.stopPropagation(),f=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend"];for(let g of f)d.addEventListener(g,p);try{document.body.appendChild(d);}catch{return}return i(d),()=>{for(let g of f)d.removeEventListener(g,p);d.remove(),i(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,s]),!c||!r?null:createPortal(jsx(Pt,{blocfeed_id:o.blocfeed_id,...b?{config:b}:{},children:jsx(Ca,{config:o,handleRef:n})}),r)});var Vn="0.22.0",pd={init(e){ke(e);},identify(e){Un(e);},track:Fe};
|
|
884
884
|
export{Zn as A,Nt as B,Sc as C,Dt as D,Ra as E,Vn as F,pd as G,T as a,Gt as b,en as c,tn as d,ht as e,nn as f,za as g,on as h,yt as i,ar as j,wt as k,xt as l,Et as m,kt as n,wr as o,_t as p,xn as q,Un as r,Fe as s,Be as t,qn as u,Pt as v,Gn as w,Jn as x,Qn as y,xc as z};
|
package/dist/engine.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkWAMNK7BQ_cjs=require('./chunk-WAMNK7BQ.cjs');function s(o){if(o?.aborted)throw new Error("Aborted")}async function v(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await v(o);return {dataUrl:o,mime:t,width:e,height:r}}function U(o){return {async captureElement(t,e){if(!chunkWAMNK7BQ_cjs.a())throw new Error("captureElement can only run in the browser");s(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return s(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!chunkWAMNK7BQ_cjs.a())throw new Error("captureFullPage can only run in the browser");s(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),i=Math.min(1,t.maxDimension/Math.max(r,n)),c={width:Math.max(1,Math.round(r*i)),height:Math.max(1,Math.round(n*i)),scale:t.pixelRatio},a=t.mime==="image/jpeg"?await o.domToJpeg(e,{...c,quality:t.quality??.92}):await o.domToPng(e,c);return s(t.signal),await l(a,t.mime)}}}function O(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(e),c=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)c[a]=i.charCodeAt(a);return new Blob([c],{type:n})}Object.defineProperty(exports,"clearClickEvents",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.j}});Object.defineProperty(exports,"clearDiagnostics",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.z}});Object.defineProperty(exports,"clearQueue",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.g}});Object.defineProperty(exports,"clearSecurityFindings",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.C}});Object.defineProperty(exports,"collectMetadata",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.d}});Object.defineProperty(exports,"createBlocFeedController",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.u}});Object.defineProperty(exports,"createHtmlToImageAdapter",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.b}});Object.defineProperty(exports,"dequeueAll",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.f}});Object.defineProperty(exports,"drainClickEvents",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.i}});Object.defineProperty(exports,"drainDiagnostics",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.y}});Object.defineProperty(exports,"enqueue",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.e}});Object.defineProperty(exports,"getMyFeedbackUrl",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.p}});Object.defineProperty(exports,"getQueueSize",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.h}});Object.defineProperty(exports,"getSecurityFindings",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.B}});Object.defineProperty(exports,"getViewerToken",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.o}});Object.defineProperty(exports,"installDiagnostics",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.w}});Object.defineProperty(exports,"isRecordingSupported",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.k}});Object.defineProperty(exports,"isVoiceSupported",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.m}});Object.defineProperty(exports,"runCapture",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.c}});Object.defineProperty(exports,"runSecretScan",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.A}});Object.defineProperty(exports,"startRecording",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.l}});Object.defineProperty(exports,"startVoiceRecording",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.n}});Object.defineProperty(exports,"transcribeAudio",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.q}});Object.defineProperty(exports,"uninstallDiagnostics",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.x}});exports.createModernScreenshotAdapter=U;exports.dataUrlToBlob=O;
|
package/dist/engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-XF3APCYE.js';export{j as clearClickEvents,z as clearDiagnostics,g as clearQueue,C as clearSecurityFindings,d as collectMetadata,u as createBlocFeedController,b as createHtmlToImageAdapter,f as dequeueAll,i as drainClickEvents,y as drainDiagnostics,e as enqueue,p as getMyFeedbackUrl,h as getQueueSize,B as getSecurityFindings,o as getViewerToken,w as installDiagnostics,k as isRecordingSupported,m as isVoiceSupported,c as runCapture,A as runSecretScan,l as startRecording,n as startVoiceRecording,q as transcribeAudio,x as uninstallDiagnostics}from'./chunk-XF3APCYE.js';function s(o){if(o?.aborted)throw new Error("Aborted")}async function v(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await v(o);return {dataUrl:o,mime:t,width:e,height:r}}function U(o){return {async captureElement(t,e){if(!a())throw new Error("captureElement can only run in the browser");s(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return s(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!a())throw new Error("captureFullPage can only run in the browser");s(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),i=Math.min(1,t.maxDimension/Math.max(r,n)),c={width:Math.max(1,Math.round(r*i)),height:Math.max(1,Math.round(n*i)),scale:t.pixelRatio},a$1=t.mime==="image/jpeg"?await o.domToJpeg(e,{...c,quality:t.quality??.92}):await o.domToPng(e,c);return s(t.signal),await l(a$1,t.mime)}}}function O(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(e),c=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)c[a]=i.charCodeAt(a);return new Blob([c],{type:n})}export{U as createModernScreenshotAdapter,O as dataUrlToBlob};
|
package/dist/main.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var
|
|
2
|
+
'use strict';var chunkWAMNK7BQ_cjs=require('./chunk-WAMNK7BQ.cjs');Object.defineProperty(exports,"BehavioralTracker",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.t}});Object.defineProperty(exports,"BlocFeed",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.G}});Object.defineProperty(exports,"BlocFeedProvider",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.v}});Object.defineProperty(exports,"BlocFeedWidget",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.E}});Object.defineProperty(exports,"SDK_VERSION",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.F}});Object.defineProperty(exports,"track",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.s}});Object.defineProperty(exports,"useBlocFeed",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.D}});
|
package/dist/main.d.cts
CHANGED
|
@@ -110,7 +110,7 @@ declare function track(name: string, properties?: TrackProperties, options?: Tra
|
|
|
110
110
|
* Pinned at publish time. Sent with the heartbeat so the dashboard can
|
|
111
111
|
* surface SDK version drift to customers.
|
|
112
112
|
*/
|
|
113
|
-
declare const SDK_VERSION = "0.
|
|
113
|
+
declare const SDK_VERSION = "0.22.0";
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Non-React entry point. Mirrors the shape of the rest of the SDK exports;
|
package/dist/main.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ declare function track(name: string, properties?: TrackProperties, options?: Tra
|
|
|
110
110
|
* Pinned at publish time. Sent with the heartbeat so the dashboard can
|
|
111
111
|
* surface SDK version drift to customers.
|
|
112
112
|
*/
|
|
113
|
-
declare const SDK_VERSION = "0.
|
|
113
|
+
declare const SDK_VERSION = "0.22.0";
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Non-React entry point. Mirrors the shape of the rest of the SDK exports;
|
package/dist/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{t as BehavioralTracker,G as BlocFeed,v as BlocFeedProvider,E as BlocFeedWidget,F as SDK_VERSION,s as track,D as useBlocFeed}from'./chunk-
|
|
2
|
+
export{t as BehavioralTracker,G as BlocFeed,v as BlocFeedProvider,E as BlocFeedWidget,F as SDK_VERSION,s as track,D as useBlocFeed}from'./chunk-XF3APCYE.js';
|
package/dist/passive.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkWAMNK7BQ_cjs=require('./chunk-WAMNK7BQ.cjs'),react=require('react');function a(e){e.user?.id&&chunkWAMNK7BQ_cjs.r(e.user.id);let i=new chunkWAMNK7BQ_cjs.t({blocfeedId:e.blocfeed_id,...e.config!==void 0?{config:e.config}:{},...e.extraSdkFeatures!==void 0?{extraSdkFeatures:e.extraSdkFeatures}:{}});return i.install(),i}function u(e){return react.useEffect(()=>{let i=a({blocfeed_id:e.blocfeed_id,...e.user!==void 0?{user:e.user}:{},...e.config!==void 0?{config:e.config}:{}});return ()=>{i.uninstall();}},[e.blocfeed_id]),null}var r=null,g={init(e){r||(r=a(e));},identify(e,i){chunkWAMNK7BQ_cjs.r(e);},track(e,i){chunkWAMNK7BQ_cjs.s(e,i);},uninstall(){r&&(r.uninstall(),r=null);}};function v(){return r}function k(){r&&(r.uninstall(),r=null);}Object.defineProperty(exports,"SDK_VERSION",{enumerable:true,get:function(){return chunkWAMNK7BQ_cjs.F}});exports.BlocFeed=g;exports.BlocFeedPassive=u;exports.__getStandaloneTrackerForTesting=v;exports.__resetStandaloneTrackerForTesting=k;
|