@canonry/canonry 7.64.1 → 7.64.2
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/assets/assets/{AgentSetupPage-C9VnIbMS.js → AgentSetupPage-Cl9VXxLL.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-DD9_Y-qo.js +4 -0
- package/assets/assets/ProjectPage-CoaDuk54.js +9 -0
- package/assets/assets/{RunsPage-Cr0QSE4Q.js → RunsPage-BCySoVOJ.js} +1 -1
- package/assets/assets/{SettingsPage-K6tGAVHo.js → SettingsPage-CDncGwNQ.js} +1 -1
- package/assets/assets/{SiteHealthSection-DxhIqNDZ.js → SiteHealthSection-C4C2LBCJ.js} +2 -2
- package/assets/assets/{TrafficPage-lNcR4TvT.js → TrafficPage-4oknsJk1.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-D47VIFDK.js → TrafficSourceDetailPage-UQKbZgtR.js} +1 -1
- package/assets/assets/{format-helpers-Ce3RoH9T.js → format-helpers-B1eNfBmy.js} +2 -2
- package/assets/assets/{index-C2t4yW4t.js → index-Ci_T3fwM.js} +4 -4
- package/assets/assets/{index-DqhMdZUM.css → index-Da8t1_vu.css} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-D-dyJflK.js → react-sigma_core.esm.min-CIzyqOHN.js} +1 -1
- package/assets/assets/{service-C0U5Ude4.js → service-CTRAeUEv.js} +1 -1
- package/assets/index.html +3 -3
- package/dist/{chunk-WLCYVJGN.js → chunk-7KBFBFDS.js} +1 -1
- package/dist/{chunk-K5S5HXAK.js → chunk-PUHALZY7.js} +3 -3
- package/dist/{chunk-7U2SFOJN.js → chunk-RYH3XP6J.js} +1 -1
- package/dist/{cli-commands-CCGP2A2P.js → cli-commands-NBOP4CQW.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/{init-HNPTJIOS.js → init-RZY3NRFZ.js} +1 -1
- package/dist/{serve-ECMM256O.js → serve-Z722TPMP.js} +1 -1
- package/package.json +1 -1
- package/assets/assets/MeasurementPropertyPage-Bo4xKbWQ.js +0 -4
- package/assets/assets/ProjectPage-DuW9zWT9.js +0 -9
package/assets/assets/{react-sigma_core.esm.min-D-dyJflK.js → react-sigma_core.esm.min-CIzyqOHN.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{rt as n}from"./vendor-lucide-4KkDquAu.js";import{c as r,l as i}from"./SiteHealthSection-
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{rt as n}from"./vendor-lucide-4KkDquAu.js";import{c as r,l as i}from"./SiteHealthSection-C4C2LBCJ.js";var a=e(n(),1);function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(e){if(typeof e==`string`)return o(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function c(e){if(Array.isArray(e))return e}function l(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function u(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(e,t){return c(e)||l(e,t)||s(e,t)||u()}function f(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(c)throw a}}}}function p(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function m(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function h(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function g(e,t,n){return e[6]=t,e[7]=n,e}function _(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8];return e[0]=d*n+f*a+p*c,e[1]=d*r+f*o+p*l,e[2]=d*i+f*s+p*u,e[3]=m*n+h*a+g*c,e[4]=m*r+h*o+g*l,e[5]=m*i+h*s+g*u,e[6]=_*n+v*a+y*c,e[7]=_*r+v*o+y*l,e[8]=_*i+v*s+y*u,e}function v(e,t){var n=Math.cos(t),r=Math.sin(t);return{x:n*e.x+r*e.y,y:-r*e.x+n*e.y}}function y(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],a=e[3],o=e[4],s=e[6],c=e[7],l=t.x,u=t.y;return{x:l*r+u*a+s*n,y:l*i+u*o+c*n}}function b(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function x(e,t,n,r,i){var a=e.angle,o=e.ratio,s=e.x,c=e.y,l=t.width,u=t.height,d=p(),f=Math.min(l,u)-2*r,v=b(t,n);return i?(_(d,g(p(),s,c)),_(d,m(p(),o)),_(d,h(p(),a)),_(d,m(p(),l/f/2/v,u/f/2/v))):(_(d,m(p(),f/l*2*v,f/u*2*v)),_(d,h(p(),-a)),_(d,m(p(),1/o)),_(d,g(p(),-s,-c))),d}function S(e,t,n){var r=y(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,a=r.y;return 1/Math.sqrt(i**2+a**2)/n.width}function C(e,t,n,r,i){return[Math.floor(t/i*r),Math.floor(e.drawingBufferHeight/i-n/i*r)]}var w={black:`#000000`,silver:`#C0C0C0`,gray:`#808080`,grey:`#808080`,white:`#FFFFFF`,maroon:`#800000`,red:`#FF0000`,purple:`#800080`,fuchsia:`#FF00FF`,green:`#008000`,lime:`#00FF00`,olive:`#808000`,yellow:`#FFFF00`,navy:`#000080`,blue:`#0000FF`,teal:`#008080`,aqua:`#00FFFF`,darkblue:`#00008B`,mediumblue:`#0000CD`,darkgreen:`#006400`,darkcyan:`#008B8B`,deepskyblue:`#00BFFF`,darkturquoise:`#00CED1`,mediumspringgreen:`#00FA9A`,springgreen:`#00FF7F`,cyan:`#00FFFF`,midnightblue:`#191970`,dodgerblue:`#1E90FF`,lightseagreen:`#20B2AA`,forestgreen:`#228B22`,seagreen:`#2E8B57`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,limegreen:`#32CD32`,mediumseagreen:`#3CB371`,turquoise:`#40E0D0`,royalblue:`#4169E1`,steelblue:`#4682B4`,darkslateblue:`#483D8B`,mediumturquoise:`#48D1CC`,indigo:`#4B0082`,darkolivegreen:`#556B2F`,cadetblue:`#5F9EA0`,cornflowerblue:`#6495ED`,rebeccapurple:`#663399`,mediumaquamarine:`#66CDAA`,dimgray:`#696969`,dimgrey:`#696969`,slateblue:`#6A5ACD`,olivedrab:`#6B8E23`,slategray:`#708090`,slategrey:`#708090`,lightslategray:`#778899`,lightslategrey:`#778899`,mediumslateblue:`#7B68EE`,lawngreen:`#7CFC00`,chartreuse:`#7FFF00`,aquamarine:`#7FFFD4`,skyblue:`#87CEEB`,lightskyblue:`#87CEFA`,blueviolet:`#8A2BE2`,darkred:`#8B0000`,darkmagenta:`#8B008B`,saddlebrown:`#8B4513`,darkseagreen:`#8FBC8F`,lightgreen:`#90EE90`,mediumpurple:`#9370DB`,darkviolet:`#9400D3`,palegreen:`#98FB98`,darkorchid:`#9932CC`,yellowgreen:`#9ACD32`,sienna:`#A0522D`,brown:`#A52A2A`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,lightblue:`#ADD8E6`,greenyellow:`#ADFF2F`,paleturquoise:`#AFEEEE`,lightsteelblue:`#B0C4DE`,powderblue:`#B0E0E6`,firebrick:`#B22222`,darkgoldenrod:`#B8860B`,mediumorchid:`#BA55D3`,rosybrown:`#BC8F8F`,darkkhaki:`#BDB76B`,mediumvioletred:`#C71585`,indianred:`#CD5C5C`,peru:`#CD853F`,chocolate:`#D2691E`,tan:`#D2B48C`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,thistle:`#D8BFD8`,orchid:`#DA70D6`,goldenrod:`#DAA520`,palevioletred:`#DB7093`,crimson:`#DC143C`,gainsboro:`#DCDCDC`,plum:`#DDA0DD`,burlywood:`#DEB887`,lightcyan:`#E0FFFF`,lavender:`#E6E6FA`,darksalmon:`#E9967A`,violet:`#EE82EE`,palegoldenrod:`#EEE8AA`,lightcoral:`#F08080`,khaki:`#F0E68C`,aliceblue:`#F0F8FF`,honeydew:`#F0FFF0`,azure:`#F0FFFF`,sandybrown:`#F4A460`,wheat:`#F5DEB3`,beige:`#F5F5DC`,whitesmoke:`#F5F5F5`,mintcream:`#F5FFFA`,ghostwhite:`#F8F8FF`,salmon:`#FA8072`,antiquewhite:`#FAEBD7`,linen:`#FAF0E6`,lightgoldenrodyellow:`#FAFAD2`,oldlace:`#FDF5E6`,magenta:`#FF00FF`,deeppink:`#FF1493`,orangered:`#FF4500`,tomato:`#FF6347`,hotpink:`#FF69B4`,coral:`#FF7F50`,darkorange:`#FF8C00`,lightsalmon:`#FFA07A`,orange:`#FFA500`,lightpink:`#FFB6C1`,pink:`#FFC0CB`,gold:`#FFD700`,peachpuff:`#FFDAB9`,navajowhite:`#FFDEAD`,moccasin:`#FFE4B5`,bisque:`#FFE4C4`,mistyrose:`#FFE4E1`,blanchedalmond:`#FFEBCD`,papayawhip:`#FFEFD5`,lavenderblush:`#FFF0F5`,seashell:`#FFF5EE`,cornsilk:`#FFF8DC`,lemonchiffon:`#FFFACD`,floralwhite:`#FFFAF0`,snow:`#FFFAFA`,lightyellow:`#FFFFE0`,ivory:`#FFFFF0`},T=new Int8Array(4),E=new Int32Array(T.buffer,0,1),D=new Float32Array(T.buffer,0,1),O=/^\s*rgba?\s*\(/,k=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function A(e){var t=0,n=0,r=0,i=1,a=e.toLowerCase();if(a===`transparent`)return{r:0,g:0,b:0,a:0};if(a in w)return A(w[a]);if(e[0]===`#`)e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(O.test(e)){var o=e.match(k);o&&(t=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:t,g:n,b:r,a:i}}function j(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=A(e),r=n.r,i=n.g,a=n.b,o=n.a;return t?[r/255*o,i/255*o,a/255*o,o]:[r/255,i/255,a/255,o]}var M={};for(var N in w)M[N]=F(w[N]),M[w[N]]=M[N];function P(e,t,n,r,i){return E[0]=r<<24|n<<16|t<<8|e,i&&(E[0]&=4278190079),D[0]}function F(e){if(e=e.toLowerCase(),M[e]!==void 0)return M[e];var t=A(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=P(n,r,i,a,!0);return M[e]=o,o}function I(e,t){D[0]=F(e);var n=E[0];return t&&(n|=16777216),[n&255,n>>8&255,n>>16&255,n>>24&255]}function ee(e){var t=e>>>8&255,n=e>>>16&255,r=e>>>24&255;return((e&255)<<24|r<<16|n<<8|t)>>>0}function te(e,t,n,r){return(n<<24|t<<16|e<<8|r)>>>0}function L(e,t,n,r,i,a){var o=d(C(e,n,r,i,a),2),s=o[0],c=o[1],l=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,c,1,1,e.RGBA,e.UNSIGNED_BYTE,l);var u=d(l,4);return[u[0],u[1],u[2],u[3]]}function ne(e){var t=A(e),n=t.r,r=t.g,i=t.b,a=t.a;return`vec4(${(n/255).toFixed(6)}, ${(r/255).toFixed(6)}, ${(i/255).toFixed(6)}, ${a.toFixed(6)})`}function re(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ie(e){var t=re(e,`string`);return typeof t==`symbol`?t:t+``}function R(e,t,n){return(t=ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ae(Object(n),!0).forEach(function(t){R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function B(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,ie(r.key),r)}}function V(e,t,n){return t&&oe(e.prototype,t),n&&oe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function se(e){return se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},se(e)}function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ce=function(){return!!e})()}function le(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function ue(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return le(e)}function H(e,t,n){return t=se(t),ue(e,ce()?Reflect.construct(t,n||[],se(e).constructor):t.apply(e,n))}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},de(e,t)}function U(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&de(e,t)}function fe(e){if(Array.isArray(e))return o(e)}function pe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W(e){return fe(e)||pe(e)||s(e)||me()}function G(e){"@babel/helpers - typeof";return G=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},G(e)}function he(e){return G(e)===`object`&&e!==null&&`attribute`in e}function ge(){return{name:`circle`,glsl:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{G as t,U as n,W as r,rt as i}from"./vendor-lucide-4KkDquAu.js";import{n as a,r as o}from"./vendor-markdown-9SSeLNHZ.js";import{Ao as s,Fo as c,Go as l,Ho as u,Io as d,Jo as f,Ko as p,Lo as m,Ma as h,Mo as g,No as _,Po as v,Qo as y,Ra as b,Ro as x,Uo as S,Vo as C,Wo as w,Xo as T,Yo as E,Zo as D,a as O,jo as k,pt as A,qo as j,r as M,vt as N,zo as P}from"./ToneBadge-Cvv6Tkk7.js";import{x as F}from"./format-helpers-Ce3RoH9T.js";import{at as I,rt as L}from"./index-C2t4yW4t.js";var R=e(i(),1),z=o(),B=`Sources`,V={copy:`Copy answer`,copying:`Copying…`,copied:`Copied`,failed:`Could not copy. Select and copy the answer above.`};function H({previewLength:e,highlight:t}){return n=>{if(e!==void 0&&Number.isFinite(e)){let t=Math.max(0,Math.floor(e)),r={field:`value`,omitted:!1},i=e=>{if(e.type===`definition`)return!0;if(e.children)return e.children=e.children.filter(i),e.children.length>0;let n=e.type===`image`||e.type===`imageReference`?`alt`:`value`,a=e[n];if(a===void 0)return t>0;let o=Array.from(a);if(o.length===0)return t>0;if(t===0)return r.omitted=!0,!1;let s=o.length>t,c=o.slice(0,t);if(s&&!/\s/.test(o[t])){let e=c.length-1;for(;e>=0&&!/\s/.test(c[e]);)e--;e>=0&&e>t-40&&(c.length=e)}return r.omitted||=s,e[n]=c.join(``),t=s?0:t-c.length,c.length!==0&&(r.lastNode=e,r.field=n,!0)};i(n),r.omitted&&(r.lastNode?r.lastNode[r.field]=`${r.lastNode[r.field].trimEnd()}…`:n.children?.push({type:`paragraph`,children:[{type:`text`,value:`…`}]}))}if(t){let e=t=>{[`link`,`linkReference`,`code`,`inlineCode`].includes(t.type)||(t.type===`text`&&(t.data={...t.data,hName:`span`}),t.children?.forEach(e))};e(n)}}}function U({headingLevel:e}){return t=>{let n=[],r=e=>{e.type===`heading`&&e.depth&&n.push(e),e.children?.forEach(r)};r(t);let i=n.reduce((e,t)=>Math.min(e,t.depth),6);for(let t of n){let n=t.depth-i;t.depth=Math.min(6,e+n),t.data={...t.data,hProperties:{...t.data?.hProperties,"data-answer-heading-level":n+1}}}}}function W({answer:e}){let[t,n]=(0,R.useState)(`idle`),r=(0,R.useRef)(!1),i=async()=>{if(!r.current){r.current=!0,n(`copying`);try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}finally{r.current=!1}}};return(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3`,children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`min-h-11 px-2`,"aria-disabled":t===`copying`,"aria-busy":t===`copying`,onClick:()=>{i()},children:t===`copying`?V.copying:V.copy}),(0,z.jsx)(`span`,{role:`status`,className:`text-sm text-secondary`,children:t===`copied`?V.copied:t===`failed`?V.failed:``})]})}var G=(0,R.memo)(function({children:e,headingLevel:t=4,copyable:n=!1,highlightGroups:r,previewLength:i}){return(0,z.jsxs)(`div`,{className:`answer-markdown`,children:[(0,z.jsx)(a,{remarkPlugins:[[U,{headingLevel:t}],[H,{previewLength:i,highlight:!!r?.length}]],components:{p:({children:e})=>(0,z.jsx)(`p`,{className:`mb-3 whitespace-pre-wrap last:mb-0`,children:e}),ul:({children:e})=>(0,z.jsx)(`ul`,{className:`mb-3 ml-5 list-disc space-y-1`,children:e}),ol:({children:e,start:t})=>(0,z.jsx)(`ol`,{start:t,className:`mb-3 ml-5 list-decimal space-y-1`,children:e}),pre:({children:e})=>(0,z.jsx)(`pre`,{className:`mb-3 overflow-x-auto whitespace-pre-wrap`,children:e}),span:({children:e})=>(0,z.jsx)(`span`,{children:typeof e==`string`&&r?e.split(/(https?:\/\/[^\s<>]+)/i).map((e,t)=>t%2?e:(0,z.jsx)(R.Fragment,{children:L(e,r)},t)):e}),a:({children:e,href:t})=>{let n=I(t);return n?(0,z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`text-link underline`,children:e}):(0,z.jsx)(`span`,{children:e})},img:({alt:e})=>(0,z.jsx)(`span`,{children:e})},children:e}),n&&e.trim()?(0,z.jsx)(W,{answer:e},e):null]})}),K=`min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,q=`flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,J=e=>e.kind===`project`?`Whole site`:e.label,Y={allMarkets:`All markets`,browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:`Browse all properties`},ee=e=>e?.kind===`group`&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,X=e=>`${e} ${e===1?`property`:`properties`}`;function te({options:e,selected:i,onSelect:a,marketKey:o,label:s=`Measurement scope`,labelVisibility:c=`visible`,allowGroupSelect:l=!0}){let u=[...e].sort((e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0})||e.id.localeCompare(t.id)),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)([]),[h,g]=(0,R.useState)(!1),_=(0,R.useRef)(null),v=(0,R.useRef)(null),y=(0,R.useId)(),b=u.filter(e=>e.kind===`group`),x=new Map(b.map(e=>[e.id,e])),S=x.get(p.at(-1)??``),C=x.get(p.at(-2)??``),w=d.trim().toLocaleLowerCase(),T=b.filter(e=>!e.parentGroupIds?.some(e=>x.has(e))),E=u.filter(e=>e.kind===`property`),D=e=>(e.parentGroupIds??[]).map(e=>x.get(e)?.label).filter(Boolean).join(` · `),O=e=>`${J(e)} ${D(e)}`.toLocaleLowerCase().includes(w),k=e=>{let t=[...e.parentGroupIds??[]],n=new Set;for(;t.length;){let e=t.pop();if(e===S?.id)return!0;n.has(e)||(n.add(e),t.push(...x.get(e)?.parentGroupIds??[]))}return!1},A=(h?[]:S?b.filter(e=>w?k(e):e.parentGroupIds?.includes(S.id)):w?b:T).filter(O),j=u.find(e=>e.kind===`market`&&e.id===(o??(i.kind===`market`?i.id:void 0))),M=S&&j&&(S.marketKeys?.includes(j.id)||j.parentGroupIds?.includes(S.id))?j.id:void 0,N=l?M??ee(S):void 0,P=(S?E.filter(e=>e.parentGroupIds?.includes(S.id)&&(!N||e.marketKeys?.includes(N))):w||h||b.length===0?E:[]).filter(O),F=u.filter(e=>e.kind!==`market`||h||!l&&!S&&!w&&b.length>0||l&&S?.marketKeys?.length===1&&!w?!1:(S?w?k(e):e.parentGroupIds?.includes(S.id):w||!e.parentGroupIds?.some(e=>x.has(e)))&&O(e)),I=S||h?[]:u.filter(e=>e.kind===`project`&&O(e));(0,R.useEffect)(()=>{let e=e=>{_.current?.open&&e.target instanceof Node&&!_.current.contains(e.target)&&(_.current.open=!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let L=e=>{_.current&&(_.current.open=!1,_.current.querySelector(`summary`)?.focus());let t=l?e.kind===`property`?N:e.kind===`group`&&e.id===S?.id?M:void 0:void 0;t?a(e,t):a(e)},B=e=>{let t=[],n=x.get(e.parentGroupIds?.[0]??``);for(;n&&!t.includes(n.id)&&n.id!==e.id;)t.unshift(n.id),n=x.get(n.parentGroupIds?.[0]??``);return[...t,e.id]},V=()=>{let e=i.kind===`group`?x.get(i.id):void 0,t=x.get(j?.parentGroupIds?.[0]??``),n=(i.parentGroupIds??[]).flatMap(e=>{let t=x.get(e);return t?[B(t)]:[]}),r=n.find(e=>e.at(-1)===S?.id)??n.sort((e,t)=>t.length-e.length)[0]??[],a=t?B(t):i.marketKeys?.length?[]:r;m(e?B(e):a),g(i.kind===`property`&&a.length===0&&b.length>0),f(``)},H=e=>{m(B(e)),g(!1),f(``),v.current?.focus()},U=(e,t=J(e))=>(0,z.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,z.jsxs)(`button`,{type:`button`,className:q,"aria-label":e.kind===`group`&&!l?Y.browse(J(e)):Y.select(J(e)),"aria-current":i.kind===e.kind&&i.id===e.id?`true`:void 0,onClick:()=>e.kind===`group`&&!l?H(e):L(e),children:[(0,z.jsxs)(`span`,{className:`min-w-0 break-words`,children:[t,w&&D(e)?(0,z.jsx)(`span`,{className:`block text-[13px] text-secondary`,children:D(e)}):null]}),(0,z.jsx)(`span`,{className:`shrink-0 text-right text-[13px] text-secondary`,children:e.kind===`market`?l?`Query context`:`Market`:e.kind===`property`?`Property`:X(e.targetCount)})]}),l&&e.kind===`group`&&e.id!==S?.id&&u.some(t=>t.parentGroupIds?.includes(e.id))?(0,z.jsx)(`button`,{type:`button`,"aria-label":Y.browse(e.label),title:`Browse ${e.label}`,className:`flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,onClick:()=>H(e),children:(0,z.jsx)(n,{size:18,"aria-hidden":`true`})}):null]},`${e.kind}:${e.id}`),W=(e,t)=>t.length>0?(0,z.jsxs)(`section`,{"aria-label":e,className:`mt-2`,children:[(0,z.jsx)(`h3`,{className:`px-2 py-2 text-[13px] font-medium text-secondary`,children:e}),t.map(e=>U(e))]}):null,G=(e,t,n)=>t.length>0?(0,z.jsxs)(`details`,{open:n,className:`mt-2 border-y border-default`,children:[(0,z.jsxs)(`summary`,{className:`min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[e,` (`,t.length,`)`]}),t.map(e=>U(e))]},`${S?.id??`root`}:${e}`):null;return(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{id:`${y}-label`,className:c===`sr-only`?`sr-only`:`mb-1 block text-sm font-medium text-heading`,children:s}),(0,z.jsxs)(`details`,{ref:_,className:`relative`,onToggle:e=>{e.target===e.currentTarget&&e.currentTarget.open&&v.current?.focus()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.currentTarget.open=!1,e.currentTarget.querySelector(`summary`)?.focus())},children:[(0,z.jsxs)(`summary`,{id:`${y}-value`,"aria-labelledby":`${y}-label ${y}-value`,className:`${K} visibility-scope-trigger`,onClick:()=>{_.current?.open||V()},children:[`${J(i)}${i.kind===`group`?` · ${X(i.targetCount)}`:i.kind===`property`?` · ${u.find(e=>e.kind===`market`&&e.id===o)?.label??(i.marketKeys?.length?Y.allMarkets:`Property`)}`:i.kind===`market`?` · Market`:``}`,(0,z.jsx)(t,{size:16,"aria-hidden":`true`,className:`shrink-0 text-secondary`})]}),(0,z.jsxs)(`div`,{className:`visibility-scope-menu`,children:[S||h?(0,z.jsxs)(`div`,{className:`mb-2 border-b border-default pb-2`,children:[(0,z.jsx)(`button`,{type:`button`,className:q,"aria-label":`Back to ${C?.label??`all groups`}`,onClick:()=>{m(p.slice(0,-1)),g(!1),f(``),v.current?.focus()},children:(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(r,{size:16,"aria-hidden":`true`}),C?.label??`All groups`]})}),(0,z.jsx)(`p`,{className:`px-2 py-1 text-sm font-medium text-heading`,"aria-live":`polite`,children:S?.label??`All properties`})]}):null,(0,z.jsx)(`input`,{ref:v,type:`search`,"aria-label":`Search scopes`,className:K,placeholder:S?`Search within this group`:h?`Search properties`:`Search groups or properties`,value:d,onChange:e=>f(e.target.value)}),(0,z.jsxs)(`div`,{className:`mt-2 max-h-80 overflow-y-auto`,children:[l&&S&&!w?U(S,`All properties in this group`):null,I.map(e=>U(e)),S&&!w?G(`Subgroups`,A,!0):W(S?`Subgroups`:`Groups`,A),w?W(`Properties`,P):G(S&&A.length>0?`All properties`:`Properties`,P,!S||A.length===0),W(`Markets`,F),!S&&!h&&!w&&b.length>0&&E.length>0?(0,z.jsxs)(`button`,{type:`button`,className:`${q} mt-2 border-t border-default`,"aria-label":Y.browseAll,onClick:()=>{g(!0),v.current?.focus()},children:[(0,z.jsx)(`span`,{children:`All properties`}),(0,z.jsx)(n,{size:18,"aria-hidden":`true`})]}):null,w&&A.length+P.length+F.length+I.length===0?(0,z.jsx)(`p`,{className:`py-3 text-sm text-secondary`,children:`No matching scopes.`}):null]})]})]})]})}function ne(e){let t=e[0];return!t||e.every(e=>e.mode===t.mode&&e.scope.kind===t.scope.kind&&e.scope.key===t.scope.key&&e.queryClass===t.queryClass&&e.measurement.displayedRunId===t.measurement.displayedRunId)}function Z(e){return e.state===`unavailable`?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:`not_applicable`}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed},...e.unchecked===void 0?{}:{unchecked:e.unchecked}}}function Q(e){return e.kind===`exact`?e.url:e.kind===`prefix`?`https://${e.host}${e.pathPrefix===`/`?``:e.pathPrefix}/*`:`https://${e.host}/*`}function re(e){return e===`assigned`?`this-property`:e===`sibling`?`another-property`:e===`ownedUnmapped`?`owned-unassigned`:e===`external`?`external`:e===`ambiguous`?`multiple-properties`:`invalid-url`}function ie(e){return e===`assigned`?`positive`:e===`external`?`neutral`:e===`invalid`?`negative`:`caution`}function ae(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function oe(e,t,n){let r=new Map;if(!t)return r;let i=new Map(e.usageEdges.map(e=>[ae(e),e.targetKey])),a=new Map(e.assignments.map(e=>[`${e.targetKey}:${e.queryId}`,e.queryClass])),o=new Map(e.usageEdges.map(e=>[ae(e),a.get(`${e.targetKey}:${e.queryId}`)]));for(let e of t.evidence){if(n&&o.get(e.usageEdgeId)!==n)continue;let t=i.get(e.usageEdgeId);if(!t)continue;let a=r.get(t)??[];a.push({id:`${e.observationId}:${e.expectedSlotId}:${e.usageEdgeId}:${e.sourceUrl}`,kind:re(e.classification),query:e.queryText,provider:e.provider,location:e.location,url:e.sourceUrl,tone:ie(e.classification),historical:e.historical||e.bridged}),r.set(t,a)}return r}function se(e){if(e.flags>0)return{label:`Review`,tone:`caution`};let t=[e.mentionCoverage,e.citationCoverage].filter(e=>e.state===`unavailable`).map(e=>e.reason);return t.includes(`no_completed_run`)?{label:`Not measured`,tone:`neutral`}:t.includes(`plan_v1`)?{label:`Update setup`,tone:`caution`}:t.includes(`evidence_incomplete`)?{label:`Evidence incomplete`,tone:`caution`}:t.includes(`identity_ambiguous`)?{label:F.ambiguous,tone:`caution`}:t.includes(`no_population`)?{label:`No queries`,tone:`neutral`}:t.includes(`not_applicable`)?{label:`Not applicable`,tone:`neutral`}:{label:`Complete`,tone:`positive`}}function ce(e){return e===`complete`?{label:`Complete`,tone:`positive`}:e===`partial`?{label:`Partial`,tone:`caution`}:e===`queued`?{label:`Queued`,tone:`neutral`}:e===`running`?{label:`Running`,tone:`neutral`}:e===`failed`?{label:`Failed`,tone:`negative`}:{label:`Not measured`,tone:`neutral`}}function le(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):``}function ue(e){let t=e.nextAction.count??e.flags.total;if(e.nextAction.kind===`review_flags`)return`${t} flagged ${t===1?`result needs`:`results need`} review.`;if(e.nextAction.kind===`complete_setup`)return`Finish setup.`;if(e.nextAction.kind===`republish_setup`)return`Setup update required.`;if(e.nextAction.kind===`run_measurement`)return`Ready to measure.`}function de({overview:e,activePlan:t,report:n,reportState:r=n?`ready`:`loading`,sort:i}){if(t.plan.schemaVersion!==2||e.mode!==`active-v2`)throw Error(`The current overview requires an active version-two setup.`);if(e.scope.kind!==`all`&&e.scope.kind!==`group`)throw Error(`The current overview requires an All Properties or group scope.`);let a=t.plan,o=new Map(a.targets.map(e=>[e.stableKey,e])),s=new Map(a.querySnapshots.map(e=>[e.queryId,e.queryText])),c=new Map;for(let t of a.assignments){if(e.queryClass!==`all`&&t.queryClass!==e.queryClass)continue;let n=s.get(t.queryId);if(!n)continue;let r=c.get(t.targetKey)??new Set;r.add(n),c.set(t.targetKey,r)}let l=n?.revision===t.revision&&n.run?.id===e.measurement.displayedRunId?n:null,u=e.measurement.displayedRunId===void 0||l?`ready`:r===`error`||n!=null?`error`:`loading`,d=oe(a,l,e.queryClass===`all`?void 0:e.queryClass),f=new Map;for(let e of a.groups)for(let t of e.targetKeys)f.has(t)||f.set(t,e.label);let p=e.properties.items.map(e=>{let t=o.get(e.targetKey),n=d.get(e.targetKey)??[];return{id:e.targetKey,name:e.label,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage),status:se(e),providers:e.providers?.map(e=>({provider:e.provider,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage)})),market:f.get(e.targetKey),assignedQueries:[...c.get(e.targetKey)??[]],urls:t?.urlMatchers.map(Q)??[],evidence:n,evidenceState:u,historical:n.some(e=>e.historical)}}),m=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),h=e.properties.items.flatMap(e=>e.flags>0?[{id:`property:${e.targetKey}`,property:e.label,summary:`${e.flags} ${e.flags===1?`result needs`:`results need`} review.`,tone:`caution`,count:e.flags}]:[]);return{classReporting:`available`,latestMeasurement:{status:ce(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:le(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind===`group`?{kind:`group`,...e.scope.key?{key:e.scope.key}:{}}:{kind:`all`},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:Z(e.metrics.propertiesMentioned),mentionCoverage:Z(e.metrics.mentionCoverage),citationCoverage:Z(e.metrics.citationCoverage)},properties:p,...m?{shareOfVoice:m}:{}},propertyTotal:e.properties.totalEstimate??p.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...i?{sort:i}:{}},availableGroups:a.groups.map(e=>({id:e.stableKey,label:e.label})),...ue(e)?{nextActionText:ue(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:h}}function fe(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`web-${Date.now()}-${Math.random().toString(36).slice(2)}`}function $(e){return{"If-Match":e,"Idempotency-Key":fe()}}function pe(e){return e instanceof O&&(e.statusCode===404||e.statusCode===409||e.statusCode===412)}function me(e,t){return e instanceof O?t:(e instanceof Error?e.message.trim():``)||t}function he(e){let t=`Could not calculate assignment impact.`;if(!(e instanceof O)||e.code!==`VALIDATION_ERROR`)return t;let n=e.message.trim();return e.details?.displayToOperator===!0&&n?n:t}var ge={loadSetup:e=>N(()=>b({client:A,path:{name:e}})),loadDraft:e=>N(()=>h({client:A,path:{name:e}})),createDraft:(e,t)=>N(()=>c({client:A,path:{name:e},headers:{"Idempotency-Key":fe()},body:{expectedActiveRevision:t}})),importSitemap:(e,t,n)=>N(()=>P({client:A,path:{name:e},headers:$(t),body:n})),applySitemapSelection:(e,t,n,r)=>N(()=>_({client:A,path:{name:e},headers:$(t),body:{selections:n,selectedTargetKeys:r}})),previewAssignments:(e,t)=>N(()=>C({client:A,path:{name:e},body:t})),applyAssignments:(e,t,n)=>N(()=>s({client:A,path:{name:e},headers:$(t),body:n})),replaceAssignments:(e,t,n)=>N(()=>f({client:A,path:{name:e},headers:$(t),body:n})),applyPairedAssignments:(e,t,n,r)=>N(()=>g({client:A,path:{name:e},headers:$(t),body:{pairs:n,...r?{contextOverride:r}:{}}})),previewMarketRouting:(e,t)=>N(()=>S({client:A,path:{name:e},body:t})),routeMarkets:(e,t,n)=>N(()=>E({client:A,path:{name:e},headers:$(t),body:n})),removeAssignment:(e,t,n,r)=>N(()=>l({client:A,path:{name:e},headers:$(t),body:{targetKeys:n,queryId:r}})),excludeTarget:(e,t,n)=>N(()=>x({client:A,path:{name:e},headers:$(t),body:{targetKey:n,cleanup:`assignments-and-group-memberships`}})),upsertTarget:(e,t,n)=>N(()=>y({client:A,path:{name:e},headers:$(t),body:{target:n}})),upsertGroup:(e,t,n)=>N(()=>D({client:A,path:{name:e},headers:$(t),body:{group:n}})),removeGroup:(e,t,n)=>N(()=>j({client:A,path:{name:e},headers:$(t),body:{groupKey:n}})),upsertCompetitor:(e,t,n)=>N(()=>T({client:A,path:{name:e},headers:$(t),body:n})),removeCompetitor:(e,t,n,r)=>N(()=>p({client:A,path:{name:e},headers:$(t),body:{groupKey:n,competitorKey:r}})),previewGroupMembership:(e,t)=>N(()=>u({client:A,path:{name:e},body:t})),applyGroupMembership:(e,t,n)=>N(()=>k({client:A,path:{name:e},headers:$(t),body:n})),compilePreview:e=>N(()=>v({client:A,path:{name:e}})),diffPreview:e=>N(()=>d({client:A,path:{name:e}})),publish:(e,t,n)=>N(()=>w({client:A,path:{name:e},headers:$(t),body:n})),discard:(e,t)=>N(()=>m({client:A,path:{name:e},headers:$(t)}))};export{de as a,Y as c,G as d,me as i,te as l,he as n,ne as o,pe as r,Q as s,ge as t,B as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{G as t,U as n,W as r,rt as i}from"./vendor-lucide-4KkDquAu.js";import{n as a,r as o}from"./vendor-markdown-9SSeLNHZ.js";import{Ao as s,Fo as c,Go as l,Ho as u,Io as d,Jo as f,Ko as p,Lo as m,Ma as h,Mo as g,No as _,Po as v,Qo as y,Ra as b,Ro as x,Uo as S,Vo as C,Wo as w,Xo as T,Yo as E,Zo as D,a as O,jo as k,pt as A,qo as j,r as M,vt as N,zo as P}from"./ToneBadge-Cvv6Tkk7.js";import{x as F}from"./format-helpers-B1eNfBmy.js";import{at as I,rt as L}from"./index-Ci_T3fwM.js";var R=e(i(),1),z=o(),B=`Sources`,V={copy:`Copy answer`,copying:`Copying…`,copied:`Copied`,failed:`Could not copy. Select and copy the answer above.`};function H({previewLength:e,highlight:t}){return n=>{if(e!==void 0&&Number.isFinite(e)){let t=Math.max(0,Math.floor(e)),r={field:`value`,omitted:!1},i=e=>{if(e.type===`definition`)return!0;if(e.children)return e.children=e.children.filter(i),e.children.length>0;let n=e.type===`image`||e.type===`imageReference`?`alt`:`value`,a=e[n];if(a===void 0)return t>0;let o=Array.from(a);if(o.length===0)return t>0;if(t===0)return r.omitted=!0,!1;let s=o.length>t,c=o.slice(0,t);if(s&&!/\s/.test(o[t])){let e=c.length-1;for(;e>=0&&!/\s/.test(c[e]);)e--;e>=0&&e>t-40&&(c.length=e)}return r.omitted||=s,e[n]=c.join(``),t=s?0:t-c.length,c.length!==0&&(r.lastNode=e,r.field=n,!0)};i(n),r.omitted&&(r.lastNode?r.lastNode[r.field]=`${r.lastNode[r.field].trimEnd()}…`:n.children?.push({type:`paragraph`,children:[{type:`text`,value:`…`}]}))}if(t){let e=t=>{[`link`,`linkReference`,`code`,`inlineCode`].includes(t.type)||(t.type===`text`&&(t.data={...t.data,hName:`span`}),t.children?.forEach(e))};e(n)}}}function U({headingLevel:e}){return t=>{let n=[],r=e=>{e.type===`heading`&&e.depth&&n.push(e),e.children?.forEach(r)};r(t);let i=n.reduce((e,t)=>Math.min(e,t.depth),6);for(let t of n){let n=t.depth-i;t.depth=Math.min(6,e+n),t.data={...t.data,hProperties:{...t.data?.hProperties,"data-answer-heading-level":n+1}}}}}function W({answer:e}){let[t,n]=(0,R.useState)(`idle`),r=(0,R.useRef)(!1),i=async()=>{if(!r.current){r.current=!0,n(`copying`);try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}finally{r.current=!1}}};return(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3`,children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`min-h-11 px-2`,"aria-disabled":t===`copying`,"aria-busy":t===`copying`,onClick:()=>{i()},children:t===`copying`?V.copying:V.copy}),(0,z.jsx)(`span`,{role:`status`,className:`text-sm text-secondary`,children:t===`copied`?V.copied:t===`failed`?V.failed:``})]})}var G=(0,R.memo)(function({children:e,headingLevel:t=4,copyable:n=!1,highlightGroups:r,previewLength:i}){return(0,z.jsxs)(`div`,{className:`answer-markdown`,children:[(0,z.jsx)(a,{remarkPlugins:[[U,{headingLevel:t}],[H,{previewLength:i,highlight:!!r?.length}]],components:{p:({children:e})=>(0,z.jsx)(`p`,{className:`mb-3 whitespace-pre-wrap last:mb-0`,children:e}),ul:({children:e})=>(0,z.jsx)(`ul`,{className:`mb-3 ml-5 list-disc space-y-1`,children:e}),ol:({children:e,start:t})=>(0,z.jsx)(`ol`,{start:t,className:`mb-3 ml-5 list-decimal space-y-1`,children:e}),pre:({children:e})=>(0,z.jsx)(`pre`,{className:`mb-3 overflow-x-auto whitespace-pre-wrap`,children:e}),span:({children:e})=>(0,z.jsx)(`span`,{children:typeof e==`string`&&r?e.split(/(https?:\/\/[^\s<>]+)/i).map((e,t)=>t%2?e:(0,z.jsx)(R.Fragment,{children:L(e,r)},t)):e}),a:({children:e,href:t})=>{let n=I(t);return n?(0,z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`text-link underline`,children:e}):(0,z.jsx)(`span`,{children:e})},img:({alt:e})=>(0,z.jsx)(`span`,{children:e})},children:e}),n&&e.trim()?(0,z.jsx)(W,{answer:e},e):null]})}),K=`min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,q=`flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,J=e=>e.kind===`project`?`Whole site`:e.label,Y={allMarkets:`All markets`,browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:`Browse all properties`},ee=e=>e?.kind===`group`&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,X=e=>`${e} ${e===1?`property`:`properties`}`;function te({options:e,selected:i,onSelect:a,marketKey:o,label:s=`Measurement scope`,labelVisibility:c=`visible`,allowGroupSelect:l=!0}){let u=[...e].sort((e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0})||e.id.localeCompare(t.id)),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)([]),[h,g]=(0,R.useState)(!1),_=(0,R.useRef)(null),v=(0,R.useRef)(null),y=(0,R.useId)(),b=u.filter(e=>e.kind===`group`),x=new Map(b.map(e=>[e.id,e])),S=x.get(p.at(-1)??``),C=x.get(p.at(-2)??``),w=d.trim().toLocaleLowerCase(),T=b.filter(e=>!e.parentGroupIds?.some(e=>x.has(e))),E=u.filter(e=>e.kind===`property`),D=e=>(e.parentGroupIds??[]).map(e=>x.get(e)?.label).filter(Boolean).join(` · `),O=e=>`${J(e)} ${D(e)}`.toLocaleLowerCase().includes(w),k=e=>{let t=[...e.parentGroupIds??[]],n=new Set;for(;t.length;){let e=t.pop();if(e===S?.id)return!0;n.has(e)||(n.add(e),t.push(...x.get(e)?.parentGroupIds??[]))}return!1},A=(h?[]:S?b.filter(e=>w?k(e):e.parentGroupIds?.includes(S.id)):w?b:T).filter(O),j=u.find(e=>e.kind===`market`&&e.id===(o??(i.kind===`market`?i.id:void 0))),M=S&&j&&(S.marketKeys?.includes(j.id)||j.parentGroupIds?.includes(S.id))?j.id:void 0,N=l?M??ee(S):void 0,P=(S?E.filter(e=>e.parentGroupIds?.includes(S.id)&&(!N||e.marketKeys?.includes(N))):w||h||b.length===0?E:[]).filter(O),F=u.filter(e=>e.kind!==`market`||h||!l&&!S&&!w&&b.length>0||l&&S?.marketKeys?.length===1&&!w?!1:(S?w?k(e):e.parentGroupIds?.includes(S.id):w||!e.parentGroupIds?.some(e=>x.has(e)))&&O(e)),I=S||h?[]:u.filter(e=>e.kind===`project`&&O(e));(0,R.useEffect)(()=>{let e=e=>{_.current?.open&&e.target instanceof Node&&!_.current.contains(e.target)&&(_.current.open=!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let L=e=>{_.current&&(_.current.open=!1,_.current.querySelector(`summary`)?.focus());let t=l?e.kind===`property`?N:e.kind===`group`&&e.id===S?.id?M:void 0:void 0;t?a(e,t):a(e)},B=e=>{let t=[],n=x.get(e.parentGroupIds?.[0]??``);for(;n&&!t.includes(n.id)&&n.id!==e.id;)t.unshift(n.id),n=x.get(n.parentGroupIds?.[0]??``);return[...t,e.id]},V=()=>{let e=i.kind===`group`?x.get(i.id):void 0,t=x.get(j?.parentGroupIds?.[0]??``),n=(i.parentGroupIds??[]).flatMap(e=>{let t=x.get(e);return t?[B(t)]:[]}),r=n.find(e=>e.at(-1)===S?.id)??n.sort((e,t)=>t.length-e.length)[0]??[],a=t?B(t):i.marketKeys?.length?[]:r;m(e?B(e):a),g(i.kind===`property`&&a.length===0&&b.length>0),f(``)},H=e=>{m(B(e)),g(!1),f(``),v.current?.focus()},U=(e,t=J(e))=>(0,z.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,z.jsxs)(`button`,{type:`button`,className:q,"aria-label":e.kind===`group`&&!l?Y.browse(J(e)):Y.select(J(e)),"aria-current":i.kind===e.kind&&i.id===e.id?`true`:void 0,onClick:()=>e.kind===`group`&&!l?H(e):L(e),children:[(0,z.jsxs)(`span`,{className:`min-w-0 break-words`,children:[t,w&&D(e)?(0,z.jsx)(`span`,{className:`block text-[13px] text-secondary`,children:D(e)}):null]}),(0,z.jsx)(`span`,{className:`shrink-0 text-right text-[13px] text-secondary`,children:e.kind===`market`?l?`Query context`:`Market`:e.kind===`property`?`Property`:X(e.targetCount)})]}),l&&e.kind===`group`&&e.id!==S?.id&&u.some(t=>t.parentGroupIds?.includes(e.id))?(0,z.jsx)(`button`,{type:`button`,"aria-label":Y.browse(e.label),title:`Browse ${e.label}`,className:`flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,onClick:()=>H(e),children:(0,z.jsx)(n,{size:18,"aria-hidden":`true`})}):null]},`${e.kind}:${e.id}`),W=(e,t)=>t.length>0?(0,z.jsxs)(`section`,{"aria-label":e,className:`mt-2`,children:[(0,z.jsx)(`h3`,{className:`px-2 py-2 text-[13px] font-medium text-secondary`,children:e}),t.map(e=>U(e))]}):null,G=(e,t,n)=>t.length>0?(0,z.jsxs)(`details`,{open:n,className:`mt-2 border-y border-default`,children:[(0,z.jsxs)(`summary`,{className:`min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[e,` (`,t.length,`)`]}),t.map(e=>U(e))]},`${S?.id??`root`}:${e}`):null;return(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{id:`${y}-label`,className:c===`sr-only`?`sr-only`:`mb-1 block text-sm font-medium text-heading`,children:s}),(0,z.jsxs)(`details`,{ref:_,className:`relative`,onToggle:e=>{e.target===e.currentTarget&&e.currentTarget.open&&v.current?.focus()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.currentTarget.open=!1,e.currentTarget.querySelector(`summary`)?.focus())},children:[(0,z.jsxs)(`summary`,{id:`${y}-value`,"aria-labelledby":`${y}-label ${y}-value`,className:`${K} visibility-scope-trigger`,onClick:()=>{_.current?.open||V()},children:[`${J(i)}${i.kind===`group`?` · ${X(i.targetCount)}`:i.kind===`property`?` · ${u.find(e=>e.kind===`market`&&e.id===o)?.label??(i.marketKeys?.length?Y.allMarkets:`Property`)}`:i.kind===`market`?` · Market`:``}`,(0,z.jsx)(t,{size:16,"aria-hidden":`true`,className:`shrink-0 text-secondary`})]}),(0,z.jsxs)(`div`,{className:`visibility-scope-menu`,children:[S||h?(0,z.jsxs)(`div`,{className:`mb-2 border-b border-default pb-2`,children:[(0,z.jsx)(`button`,{type:`button`,className:q,"aria-label":`Back to ${C?.label??`all groups`}`,onClick:()=>{m(p.slice(0,-1)),g(!1),f(``),v.current?.focus()},children:(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(r,{size:16,"aria-hidden":`true`}),C?.label??`All groups`]})}),(0,z.jsx)(`p`,{className:`px-2 py-1 text-sm font-medium text-heading`,"aria-live":`polite`,children:S?.label??`All properties`})]}):null,(0,z.jsx)(`input`,{ref:v,type:`search`,"aria-label":`Search scopes`,className:K,placeholder:S?`Search within this group`:h?`Search properties`:`Search groups or properties`,value:d,onChange:e=>f(e.target.value)}),(0,z.jsxs)(`div`,{className:`mt-2 max-h-80 overflow-y-auto`,children:[l&&S&&!w?U(S,`All properties in this group`):null,I.map(e=>U(e)),S&&!w?G(`Subgroups`,A,!0):W(S?`Subgroups`:`Groups`,A),w?W(`Properties`,P):G(S&&A.length>0?`All properties`:`Properties`,P,!S||A.length===0),W(`Markets`,F),!S&&!h&&!w&&b.length>0&&E.length>0?(0,z.jsxs)(`button`,{type:`button`,className:`${q} mt-2 border-t border-default`,"aria-label":Y.browseAll,onClick:()=>{g(!0),v.current?.focus()},children:[(0,z.jsx)(`span`,{children:`All properties`}),(0,z.jsx)(n,{size:18,"aria-hidden":`true`})]}):null,w&&A.length+P.length+F.length+I.length===0?(0,z.jsx)(`p`,{className:`py-3 text-sm text-secondary`,children:`No matching scopes.`}):null]})]})]})]})}function ne(e){let t=e[0];return!t||e.every(e=>e.mode===t.mode&&e.scope.kind===t.scope.kind&&e.scope.key===t.scope.key&&e.queryClass===t.queryClass&&e.measurement.displayedRunId===t.measurement.displayedRunId)}function Z(e){return e.state===`unavailable`?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:`not_applicable`}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed},...e.unchecked===void 0?{}:{unchecked:e.unchecked}}}function Q(e){return e.kind===`exact`?e.url:e.kind===`prefix`?`https://${e.host}${e.pathPrefix===`/`?``:e.pathPrefix}/*`:`https://${e.host}/*`}function re(e){return e===`assigned`?`this-property`:e===`sibling`?`another-property`:e===`ownedUnmapped`?`owned-unassigned`:e===`external`?`external`:e===`ambiguous`?`multiple-properties`:`invalid-url`}function ie(e){return e===`assigned`?`positive`:e===`external`?`neutral`:e===`invalid`?`negative`:`caution`}function ae(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function oe(e,t,n){let r=new Map;if(!t)return r;let i=new Map(e.usageEdges.map(e=>[ae(e),e.targetKey])),a=new Map(e.assignments.map(e=>[`${e.targetKey}:${e.queryId}`,e.queryClass])),o=new Map(e.usageEdges.map(e=>[ae(e),a.get(`${e.targetKey}:${e.queryId}`)]));for(let e of t.evidence){if(n&&o.get(e.usageEdgeId)!==n)continue;let t=i.get(e.usageEdgeId);if(!t)continue;let a=r.get(t)??[];a.push({id:`${e.observationId}:${e.expectedSlotId}:${e.usageEdgeId}:${e.sourceUrl}`,kind:re(e.classification),query:e.queryText,provider:e.provider,location:e.location,url:e.sourceUrl,tone:ie(e.classification),historical:e.historical||e.bridged}),r.set(t,a)}return r}function se(e){if(e.flags>0)return{label:`Review`,tone:`caution`};let t=[e.mentionCoverage,e.citationCoverage].filter(e=>e.state===`unavailable`).map(e=>e.reason);return t.includes(`no_completed_run`)?{label:`Not measured`,tone:`neutral`}:t.includes(`plan_v1`)?{label:`Update setup`,tone:`caution`}:t.includes(`evidence_incomplete`)?{label:`Evidence incomplete`,tone:`caution`}:t.includes(`identity_ambiguous`)?{label:F.ambiguous,tone:`caution`}:t.includes(`no_population`)?{label:`No queries`,tone:`neutral`}:t.includes(`not_applicable`)?{label:`Not applicable`,tone:`neutral`}:{label:`Complete`,tone:`positive`}}function ce(e){return e===`complete`?{label:`Complete`,tone:`positive`}:e===`partial`?{label:`Partial`,tone:`caution`}:e===`queued`?{label:`Queued`,tone:`neutral`}:e===`running`?{label:`Running`,tone:`neutral`}:e===`failed`?{label:`Failed`,tone:`negative`}:{label:`Not measured`,tone:`neutral`}}function le(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):``}function ue(e){let t=e.nextAction.count??e.flags.total;if(e.nextAction.kind===`review_flags`)return`${t} flagged ${t===1?`result needs`:`results need`} review.`;if(e.nextAction.kind===`complete_setup`)return`Finish setup.`;if(e.nextAction.kind===`republish_setup`)return`Setup update required.`;if(e.nextAction.kind===`run_measurement`)return`Ready to measure.`}function de({overview:e,activePlan:t,report:n,reportState:r=n?`ready`:`loading`,sort:i}){if(t.plan.schemaVersion!==2||e.mode!==`active-v2`)throw Error(`The current overview requires an active version-two setup.`);if(e.scope.kind!==`all`&&e.scope.kind!==`group`)throw Error(`The current overview requires an All Properties or group scope.`);let a=t.plan,o=new Map(a.targets.map(e=>[e.stableKey,e])),s=new Map(a.querySnapshots.map(e=>[e.queryId,e.queryText])),c=new Map;for(let t of a.assignments){if(e.queryClass!==`all`&&t.queryClass!==e.queryClass)continue;let n=s.get(t.queryId);if(!n)continue;let r=c.get(t.targetKey)??new Set;r.add(n),c.set(t.targetKey,r)}let l=n?.revision===t.revision&&n.run?.id===e.measurement.displayedRunId?n:null,u=e.measurement.displayedRunId===void 0||l?`ready`:r===`error`||n!=null?`error`:`loading`,d=oe(a,l,e.queryClass===`all`?void 0:e.queryClass),f=new Map;for(let e of a.groups)for(let t of e.targetKeys)f.has(t)||f.set(t,e.label);let p=e.properties.items.map(e=>{let t=o.get(e.targetKey),n=d.get(e.targetKey)??[];return{id:e.targetKey,name:e.label,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage),status:se(e),providers:e.providers?.map(e=>({provider:e.provider,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage)})),market:f.get(e.targetKey),assignedQueries:[...c.get(e.targetKey)??[]],urls:t?.urlMatchers.map(Q)??[],evidence:n,evidenceState:u,historical:n.some(e=>e.historical)}}),m=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),h=e.properties.items.flatMap(e=>e.flags>0?[{id:`property:${e.targetKey}`,property:e.label,summary:`${e.flags} ${e.flags===1?`result needs`:`results need`} review.`,tone:`caution`,count:e.flags}]:[]);return{classReporting:`available`,latestMeasurement:{status:ce(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:le(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind===`group`?{kind:`group`,...e.scope.key?{key:e.scope.key}:{}}:{kind:`all`},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:Z(e.metrics.propertiesMentioned),mentionCoverage:Z(e.metrics.mentionCoverage),citationCoverage:Z(e.metrics.citationCoverage)},properties:p,...m?{shareOfVoice:m}:{}},propertyTotal:e.properties.totalEstimate??p.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...i?{sort:i}:{}},availableGroups:a.groups.map(e=>({id:e.stableKey,label:e.label})),...ue(e)?{nextActionText:ue(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:h}}function fe(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`web-${Date.now()}-${Math.random().toString(36).slice(2)}`}function $(e){return{"If-Match":e,"Idempotency-Key":fe()}}function pe(e){return e instanceof O&&(e.statusCode===404||e.statusCode===409||e.statusCode===412)}function me(e,t){return e instanceof O?t:(e instanceof Error?e.message.trim():``)||t}function he(e){let t=`Could not calculate assignment impact.`;if(!(e instanceof O)||e.code!==`VALIDATION_ERROR`)return t;let n=e.message.trim();return e.details?.displayToOperator===!0&&n?n:t}var ge={loadSetup:e=>N(()=>b({client:A,path:{name:e}})),loadDraft:e=>N(()=>h({client:A,path:{name:e}})),createDraft:(e,t)=>N(()=>c({client:A,path:{name:e},headers:{"Idempotency-Key":fe()},body:{expectedActiveRevision:t}})),importSitemap:(e,t,n)=>N(()=>P({client:A,path:{name:e},headers:$(t),body:n})),applySitemapSelection:(e,t,n,r)=>N(()=>_({client:A,path:{name:e},headers:$(t),body:{selections:n,selectedTargetKeys:r}})),previewAssignments:(e,t)=>N(()=>C({client:A,path:{name:e},body:t})),applyAssignments:(e,t,n)=>N(()=>s({client:A,path:{name:e},headers:$(t),body:n})),replaceAssignments:(e,t,n)=>N(()=>f({client:A,path:{name:e},headers:$(t),body:n})),applyPairedAssignments:(e,t,n,r)=>N(()=>g({client:A,path:{name:e},headers:$(t),body:{pairs:n,...r?{contextOverride:r}:{}}})),previewMarketRouting:(e,t)=>N(()=>S({client:A,path:{name:e},body:t})),routeMarkets:(e,t,n)=>N(()=>E({client:A,path:{name:e},headers:$(t),body:n})),removeAssignment:(e,t,n,r)=>N(()=>l({client:A,path:{name:e},headers:$(t),body:{targetKeys:n,queryId:r}})),excludeTarget:(e,t,n)=>N(()=>x({client:A,path:{name:e},headers:$(t),body:{targetKey:n,cleanup:`assignments-and-group-memberships`}})),upsertTarget:(e,t,n)=>N(()=>y({client:A,path:{name:e},headers:$(t),body:{target:n}})),upsertGroup:(e,t,n)=>N(()=>D({client:A,path:{name:e},headers:$(t),body:{group:n}})),removeGroup:(e,t,n)=>N(()=>j({client:A,path:{name:e},headers:$(t),body:{groupKey:n}})),upsertCompetitor:(e,t,n)=>N(()=>T({client:A,path:{name:e},headers:$(t),body:n})),removeCompetitor:(e,t,n,r)=>N(()=>p({client:A,path:{name:e},headers:$(t),body:{groupKey:n,competitorKey:r}})),previewGroupMembership:(e,t)=>N(()=>u({client:A,path:{name:e},body:t})),applyGroupMembership:(e,t,n)=>N(()=>k({client:A,path:{name:e},headers:$(t),body:n})),compilePreview:e=>N(()=>v({client:A,path:{name:e}})),diffPreview:e=>N(()=>d({client:A,path:{name:e}})),publish:(e,t,n)=>N(()=>w({client:A,path:{name:e},headers:$(t),body:n})),discard:(e,t)=>N(()=>m({client:A,path:{name:e},headers:$(t)}))};export{de as a,Y as c,G as d,me as i,te as l,he as n,ne as o,pe as r,Q as s,ge as t,B as u};
|
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-Ci_T3fwM.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-4KkDquAu.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-markdown-9SSeLNHZ.js">
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<link rel="modulepreload" crossorigin href="./assets/vendor-recharts-qIim36Mt.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-pEsPGDvT.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="./assets/ToneBadge-Cvv6Tkk7.js">
|
|
23
|
-
<link rel="modulepreload" crossorigin href="./assets/format-helpers-
|
|
23
|
+
<link rel="modulepreload" crossorigin href="./assets/format-helpers-B1eNfBmy.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="./assets/account-context-BL8j43iU.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="./assets/async-handler-Bj3TnIRw.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="./assets/query-client-Bf5Rr6po.js">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<link rel="modulepreload" crossorigin href="./assets/InfoTooltip-BbdxCAup.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="./assets/card-BKud0olB.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="./assets/vendor-yaml-Y43rmNgW.js">
|
|
32
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
32
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Da8t1_vu.css">
|
|
33
33
|
</head>
|
|
34
34
|
<body>
|
|
35
35
|
<div id="root"></div>
|
|
@@ -47,7 +47,7 @@ function queueServeHandoff() {
|
|
|
47
47
|
async function runPendingServeHandoff(format) {
|
|
48
48
|
if (!pendingServeHandoff) return;
|
|
49
49
|
pendingServeHandoff = false;
|
|
50
|
-
const { serveCommand } = await import("./serve-
|
|
50
|
+
const { serveCommand } = await import("./serve-Z722TPMP.js");
|
|
51
51
|
await serveCommand(format);
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -6732,7 +6732,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6732
6732
|
options: { access: stringOption() },
|
|
6733
6733
|
run: async (input) => {
|
|
6734
6734
|
if (input.positionals.length > 1) throw usageError("Expected at most one command group");
|
|
6735
|
-
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-K5EQZBOO.js"), import("./cli-commands-
|
|
6735
|
+
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-K5EQZBOO.js"), import("./cli-commands-NBOP4CQW.js")]);
|
|
6736
6736
|
printCliCatalog(REGISTERED_CLI_COMMANDS2, input.format, input.positionals[0], getString(input.values, "access"));
|
|
6737
6737
|
}
|
|
6738
6738
|
},
|
|
@@ -6781,7 +6781,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6781
6781
|
},
|
|
6782
6782
|
allowPositionals: false,
|
|
6783
6783
|
run: async (input) => {
|
|
6784
|
-
const { initCommand } = await import("./init-
|
|
6784
|
+
const { initCommand } = await import("./init-RZY3NRFZ.js");
|
|
6785
6785
|
await initCommand({
|
|
6786
6786
|
force: getBoolean(input.values, "force"),
|
|
6787
6787
|
ref: getString(input.values, "ref"),
|
|
@@ -6836,7 +6836,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6836
6836
|
allowPositionals: false,
|
|
6837
6837
|
run: async (input) => {
|
|
6838
6838
|
applyServerEnv(input.values);
|
|
6839
|
-
const { serveCommand } = await import("./serve-
|
|
6839
|
+
const { serveCommand } = await import("./serve-Z722TPMP.js");
|
|
6840
6840
|
await serveCommand(input.format);
|
|
6841
6841
|
}
|
|
6842
6842
|
},
|
|
@@ -5658,7 +5658,7 @@ function nonBlank(value) {
|
|
|
5658
5658
|
return trimmed ? trimmed : void 0;
|
|
5659
5659
|
}
|
|
5660
5660
|
function resolveBuildCommit(env = process.env) {
|
|
5661
|
-
const embedded = true ? "
|
|
5661
|
+
const embedded = true ? "45d071516abd1b73a0ae8d7802195473e730ff16" : void 0;
|
|
5662
5662
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
5663
5663
|
}
|
|
5664
5664
|
function resolveInstanceIdentity(env = process.env) {
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node --import tsx
|
|
2
2
|
import {
|
|
3
3
|
REGISTERED_CLI_COMMANDS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PUHALZY7.js";
|
|
5
5
|
import {
|
|
6
6
|
buildSetupState,
|
|
7
7
|
runPendingServeHandoff
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7KBFBFDS.js";
|
|
9
9
|
import "./chunk-6GO5VVAC.js";
|
|
10
10
|
import "./chunk-6AYOWQJ3.js";
|
|
11
11
|
import "./chunk-VJWDBFSL.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1095,8 +1095,8 @@ declare const googleMarketingProviderSchema: z.ZodEnum<{
|
|
|
1095
1095
|
type GoogleMarketingProvider = z.infer<typeof googleMarketingProviderSchema>;
|
|
1096
1096
|
|
|
1097
1097
|
declare const gbpReviewOriginSchema: z.ZodEnum<{
|
|
1098
|
-
gbp: "gbp";
|
|
1099
1098
|
places: "places";
|
|
1099
|
+
gbp: "gbp";
|
|
1100
1100
|
}>;
|
|
1101
1101
|
type GbpReviewOrigin = z.infer<typeof gbpReviewOriginSchema>;
|
|
1102
1102
|
|
|
@@ -6779,7 +6779,7 @@ declare const providerBatches: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
6779
6779
|
tableName: "provider_batches";
|
|
6780
6780
|
dataType: "string";
|
|
6781
6781
|
columnType: "SQLiteText";
|
|
6782
|
-
data: "unknown" | "failed" | "
|
|
6782
|
+
data: "unknown" | "failed" | "submitting" | "submitted" | "ended" | "ingested" | "cancelled";
|
|
6783
6783
|
driverParam: string;
|
|
6784
6784
|
notNull: true;
|
|
6785
6785
|
hasDefault: false;
|
|
@@ -6792,7 +6792,7 @@ declare const providerBatches: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
6792
6792
|
generated: undefined;
|
|
6793
6793
|
}, {}, {
|
|
6794
6794
|
length: number | undefined;
|
|
6795
|
-
$type: "unknown" | "failed" | "
|
|
6795
|
+
$type: "unknown" | "failed" | "submitting" | "submitted" | "ended" | "ingested" | "cancelled";
|
|
6796
6796
|
}>;
|
|
6797
6797
|
requestCount: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
6798
6798
|
name: "request_count";
|
|
@@ -28953,7 +28953,7 @@ declare const gbpReviews: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
28953
28953
|
tableName: "gbp_reviews";
|
|
28954
28954
|
dataType: "string";
|
|
28955
28955
|
columnType: "SQLiteText";
|
|
28956
|
-
data: "
|
|
28956
|
+
data: "places" | "gbp";
|
|
28957
28957
|
driverParam: string;
|
|
28958
28958
|
notNull: true;
|
|
28959
28959
|
hasDefault: false;
|
|
@@ -28966,7 +28966,7 @@ declare const gbpReviews: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
28966
28966
|
generated: undefined;
|
|
28967
28967
|
}, {}, {
|
|
28968
28968
|
length: number | undefined;
|
|
28969
|
-
$type: "
|
|
28969
|
+
$type: "places" | "gbp";
|
|
28970
28970
|
}>;
|
|
28971
28971
|
reviewName: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
28972
28972
|
name: "review_name";
|
|
@@ -29364,7 +29364,7 @@ declare const gbpReviewRatings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
29364
29364
|
tableName: "gbp_review_ratings";
|
|
29365
29365
|
dataType: "string";
|
|
29366
29366
|
columnType: "SQLiteText";
|
|
29367
|
-
data: "
|
|
29367
|
+
data: "places" | "gbp";
|
|
29368
29368
|
driverParam: string;
|
|
29369
29369
|
notNull: true;
|
|
29370
29370
|
hasDefault: false;
|
|
@@ -29377,7 +29377,7 @@ declare const gbpReviewRatings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
29377
29377
|
generated: undefined;
|
|
29378
29378
|
}, {}, {
|
|
29379
29379
|
length: number | undefined;
|
|
29380
|
-
$type: "
|
|
29380
|
+
$type: "places" | "gbp";
|
|
29381
29381
|
}>;
|
|
29382
29382
|
rating: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
29383
29383
|
name: "rating";
|
|
@@ -37039,8 +37039,8 @@ type ClassificationConfig = z.infer<typeof classificationConfigSchema>;
|
|
|
37039
37039
|
declare const seoInstallConfigSchema: z.ZodObject<{
|
|
37040
37040
|
enabled: z.ZodBoolean;
|
|
37041
37041
|
fundingMode: z.ZodEnum<{
|
|
37042
|
-
"self-hosted": "self-hosted";
|
|
37043
37042
|
hosted: "hosted";
|
|
37043
|
+
"self-hosted": "self-hosted";
|
|
37044
37044
|
}>;
|
|
37045
37045
|
policy: z.ZodObject<{
|
|
37046
37046
|
maxRunCostMicros: z.ZodNumber;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonry/canonry",
|
|
3
|
-
"version": "7.64.
|
|
3
|
+
"version": "7.64.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
|
|
6
6
|
"keywords": [
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{rt as t,tt as n}from"./vendor-lucide-4KkDquAu.js";import{r}from"./vendor-markdown-9SSeLNHZ.js";import{_ as i,b as a,d as o,f as s,g as c,p as l,u}from"./vendor-tanstack-pEsPGDvT.js";import{Lr as d,St as f,Tr as ee,at as p,jr as te,pt as m,r as h,si as ne,t as g,wr as _}from"./ToneBadge-Cvv6Tkk7.js";import{_ as v,a as y,b}from"./format-helpers-Ce3RoH9T.js";import{r as re}from"./account-context-BL8j43iU.js";import{$ as x,Q as S,Z as C,et as w,it as T,qt as ie,st as ae,tt as oe}from"./react-query-CsFtWT8r.js";import{f as E,h as D}from"./ChartPrimitives-CksxPvHn.js";import{t as O}from"./InfoTooltip-BbdxCAup.js";import{G as k,H as A,J as se,K as j,L as M,it as N,ln as P,on as ce,ot as F,sn as le,z as ue}from"./index-C2t4yW4t.js";import{c as I,d as de,r as L,s as fe,t as R,u as z}from"./service-C0U5Ude4.js";var B=e(t(),1),V=r(),H={heading:`Names that count as this Property`,help:`An answer mentions this Property when its text contains one of these names as whole words. Source titles and source links never count, but a link in the answer whose text is one of these names does. Qualified names are longer forms, such as the name with its street or city, for a name that other places share.`,names:`Names`,qualifiedNames:`Qualified names`,noNames:`No names are set, so answers can cite this Property but never mention it.`,edit:`Edit names`,save:`Save to draft`,saving:`Saving…`,cancel:`Cancel`,namesHint:`One name per line.`,qualifiedHint:`One per line. Each must include one of the names above plus more words, such as a street or city.`,qualifiedNote:`With qualified names set, an answer that uses only a plain name counts as a mention only when it also cites this Property’s own page. Otherwise it is left out as not tied to one property.`,draftOnly:`Saving changes the draft only. Nothing is measured differently until the setup is published.`,saved:`Saved to the draft. Publish the setup to start using these names.`,pending:`Name changes are saved in the draft and not published yet.`,review:`Review and publish`,noChanges:`No changes to save.`,staleDraft:`The draft is based on an older published setup. Open measurement setup to restart it before editing names.`,missingFromDraft:`This Property is not included in the current draft. Open measurement setup to review it.`,conflict:`The draft changed in another session. The latest names are loaded; review them and save again.`,failed:`Could not save these names. Try again.`};function U(e){return[...new Set(e.split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(Boolean))]}function W(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function G(e,t){return W(e.aliases,t.aliases)&&W(e.identityAliases??[],t.identityAliases??[])}function pe(e,t,n){let{identityAliases:r,...i}=e;return n.length>0?{...i,aliases:t,identityAliases:n}:{...i,aliases:t}}function me({label:e,names:t}){return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-heading`,children:e}),(0,V.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,V.jsx)(`li`,{className:`text-sm text-secondary`,children:e},e))})]})}function he({id:e,issues:t}){return t.length===0?null:(0,V.jsx)(`ul`,{id:e,className:`mt-2 space-y-1`,"aria-label":`Name warnings`,children:t.map(e=>(0,V.jsx)(`li`,{className:`text-sm text-caution`,children:_(e)},`${e.field}:${e.index}`))})}function ge({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:o,service:s=R}){let{canWrite:c}=re(),l=(0,B.useId)(),d=a({...S({client:m,path:{name:e}}),enabled:c}),f=a({...ae({client:m,path:{name:e}}),enabled:c}),p=d.data?.draft?.authoring.targets.find(e=>e.stableKey===t),ne=n.identityAliases??[],g=p!==void 0&&d.data?.draft?.baseActiveRevision===r&&!G(p,n),_=!d.isFetching&&!f.isPending,v=f.data,y=(0,B.useMemo)(()=>v?te(v):o,[v,o]),[b,x]=(0,B.useState)(!1),[C,w]=(0,B.useState)(``),[T,ie]=(0,B.useState)(``),[oe,E]=(0,B.useState)(n),[D,k]=(0,B.useState)(null),A=`${e}\u0000${t}`,[se,j]=(0,B.useState)(A);se!==A&&(j(A),x(!1),w(``),ie(``),E(n),k(null));let N=(0,B.useRef)(A);N.current=A;let P=(0,B.useMemo)(()=>U(C),[C]),ce=(0,B.useMemo)(()=>U(T),[T]),F=(0,B.useMemo)(()=>ee({aliases:P,identityAliases:ce,brandNames:y}),[P,ce,y]),le=F.filter(e=>e.field===`aliases`),ue=F.filter(e=>e.field===`identityAliases`);function I(e){w(e.aliases.join(`
|
|
3
|
-
`)),ie((e.identityAliases??[]).join(`
|
|
4
|
-
`)),E({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function de(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function fe(){I(g?p:n),k(null),x(!0)}function z(e){e&&I(e),k({tone:`negative`,text:H.conflict,review:!1})}let W=i({mutationFn:async i=>{let a=await s.loadDraft(e);if(!a.draft){if(G(i.names,n))return{outcome:`unchanged`};if(!G(i.base,n))return{outcome:`conflict`,latest:n};await s.createDraft(e,r),a=await s.loadDraft(e)}let o=a.draft;if(!o||!a.etag)throw Error(H.failed);if(o.baseActiveRevision!==r)return{outcome:`stale`};let c=o.authoring.targets.find(e=>e.stableKey===t);return!c||c.status!==`included`?{outcome:`missing`}:G(i.names,c)?{outcome:`unchanged`}:G(i.base,c)?(await s.upsertTarget(e,a.etag,pe(c,i.names.aliases,i.names.identityAliases)),{outcome:`saved`}):{outcome:`conflict`,latest:c}},meta:{skipGlobalErrorToast:!0},onSuccess:(e,t)=>{if(t.openFor===N.current)switch(e.outcome){case`saved`:x(!1),k({tone:`positive`,text:H.saved,review:!0});return;case`unchanged`:x(!1),k({tone:`positive`,text:H.noChanges,review:!1});return;case`stale`:k({tone:`negative`,text:H.staleDraft,review:!0});return;case`missing`:k({tone:`negative`,text:H.missingFromDraft,review:!0});return;case`conflict`:z(e.latest),d.refetch();return}},onError:(e,t)=>{t.openFor===N.current&&(L(e)?(z(null),d.refetch().then(e=>{e.isSuccess&&z(de(e.data))})):k({tone:`negative`,text:H.failed,review:!1}))}}),ge=(0,V.jsx)(u,{to:`/projects/$projectName/portfolio`,params:{projectName:e},className:`text-link underline-offset-2 hover:underline`,children:H.review}),K=n.aliases.length+ne.length;return(0,V.jsxs)(`section`,{"aria-labelledby":`property-names`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`h2`,{id:`property-names`,className:`text-base font-semibold text-heading`,children:H.heading}),(0,V.jsx)(O,{text:H.help})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[K,` `,K===1?`name`:`names`]}),c&&!b?(0,V.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,disabled:!_,onClick:fe,children:H.edit}):null]})]}),D?(0,V.jsxs)(`p`,{role:D.tone===`negative`?`alert`:`status`,className:`mb-3 text-sm ${D.tone===`negative`?`text-negative`:`text-positive`}`,children:[D.text,D.review?(0,V.jsxs)(V.Fragment,{children:[` `,ge]}):null]}):g&&!b?(0,V.jsxs)(`p`,{role:`status`,className:`mb-3 text-sm text-caution`,children:[H.pending,` `,ge]}):null,b?(0,V.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!W.isPending&&W.mutate({names:{aliases:P,identityAliases:ce},base:oe,openFor:A})},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`${l}-names`,className:`block text-sm font-medium text-heading`,children:H.names}),(0,V.jsx)(`p`,{id:`${l}-names-hint`,className:`text-sm text-secondary`,children:H.namesHint}),(0,V.jsx)(`textarea`,{id:`${l}-names`,className:`mt-1 min-h-24 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-sm text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${l}-names-hint${le.length?` ${l}-names-issues`:``}`,value:C,onChange:e=>w(e.target.value)}),(0,V.jsx)(he,{id:`${l}-names-issues`,issues:le}),P.length===0?(0,V.jsx)(`p`,{className:`mt-2 text-sm text-caution`,children:H.noNames}):null]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`${l}-qualified`,className:`block text-sm font-medium text-heading`,children:H.qualifiedNames}),(0,V.jsx)(`p`,{id:`${l}-qualified-hint`,className:`text-sm text-secondary`,children:H.qualifiedHint}),(0,V.jsx)(`textarea`,{id:`${l}-qualified`,className:`mt-1 min-h-20 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-sm text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${l}-qualified-hint ${l}-qualified-note${ue.length?` ${l}-qualified-issues`:``}`,value:T,onChange:e=>ie(e.target.value)}),(0,V.jsx)(he,{id:`${l}-qualified-issues`,issues:ue}),(0,V.jsx)(`p`,{id:`${l}-qualified-note`,className:`mt-2 max-w-3xl text-sm text-secondary`,children:H.qualifiedNote})]}),(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:H.draftOnly}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(M,{type:`submit`,className:`h-11 px-4 text-sm md:h-11`,disabled:W.isPending,children:W.isPending?H.saving:H.save}),(0,V.jsx)(h,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-sm md:h-11`,disabled:W.isPending,onClick:()=>{x(!1),k(null)},children:H.cancel})]})]}):K===0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:H.noNames}):(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[n.aliases.length>0?(0,V.jsx)(me,{label:H.names,names:n.aliases}):null,ne.length>0?(0,V.jsx)(me,{label:H.qualifiedNames,names:ne}):null]})]})}var K=50,q={branded:{headline:`When they know your name`,technical:`Branded queries`},"non-brand":{headline:`When they don't`,technical:`Non-brand queries`}},_e={plan_v1:`Setup update required`,no_completed_run:`No completed measurement yet`,no_population:`No queries of this type are assigned`,evidence_incomplete:`Source evidence is incomplete`,identity_ambiguous:b,not_applicable:`Not applicable for this Property`},ve={complete:{label:`Measured`,tone:`positive`},partial:{label:`Partly measured`,tone:`caution`},running:{label:`Measuring now`,tone:`neutral`},queued:{label:`Measurement queued`,tone:`neutral`},failed:{label:`Measurement failed`,tone:`negative`},not_measured:{label:`Not measured`,tone:`neutral`}},J={assigned:{label:`Matches this Property`,tone:`positive`},sibling:{label:`Matches another Property`,tone:`caution`},ownedUnmapped:{label:`Site URL not in a Property`,tone:`caution`},external:{label:`External URL`,tone:`neutral`},ambiguous:{label:`Matches multiple Properties`,tone:`caution`},invalid:{label:`Invalid URL`,tone:`negative`}};function Y(e){return[...e].sort((e,t)=>Number(t.classification===`assigned`)-Number(e.classification===`assigned`))}function ye(e){return`${e.expectedSlotId}:${e.usageEdgeId}`}function be({row:e}){return e.mentioned===null?(0,V.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,V.jsx)(g,{tone:`neutral`,children:`Not measured`}),(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:`No mention signal for this Property`})]}):!e.mentioned&&e.mentionIdentity===`wrong-subject`?(0,V.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,V.jsx)(g,{tone:`neutral`,children:`Not mentioned`}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted`,children:[F.label,(0,V.jsx)(O,{text:F.property})]})]}):(0,V.jsx)(g,{tone:e.mentioned?`positive`:`neutral`,children:e.mentioned?`Mentioned`:`Not mentioned`})}var xe=`—`;function Se({row:e}){return e.cited===null?(0,V.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,V.jsx)(g,{tone:`neutral`,children:`Not measured`}),(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:`Sources were not fully captured`})]}):(0,V.jsx)(g,{tone:e.cited?`positive`:`neutral`,children:e.cited?`Cited`:`Not cited`})}function Ce({row:e}){return e.cited===null&&e.sources.length===0?(0,V.jsx)(`p`,{className:`py-2 text-sm text-secondary`,children:`The sources for this answer were not fully captured, so none can be shown.`}):e.sources.length===0?(0,V.jsx)(`p`,{className:`py-2 text-sm text-secondary`,children:`This answer returned no source URLs at all.`}):(0,V.jsxs)(`details`,{className:`mt-2`,"data-answer-sources":!0,children:[(0,V.jsxs)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-sm text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[z,` (`,e.sources.length,`)`]}),(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,V.jsxs)(`caption`,{className:`sr-only`,children:[`Source URLs for `,e.queryText]}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Match`}),(0,V.jsx)(`th`,{children:`URL`})]})}),(0,V.jsx)(`tbody`,{children:Y(e.sources).map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(g,{tone:J[e.classification].tone,children:J[e.classification].label})}),(0,V.jsx)(`td`,{children:(0,V.jsx)(N,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function we({project:e,targetKey:t,resultId:n}){let r=a({...T({client:m,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,V.jsx)(`p`,{className:`py-2 text-sm text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,V.jsx)(`p`,{className:`py-2 text-sm text-secondary`,role:`alert`,children:`Could not load this answer.`});let i=r.data?.answer;return i==null||i.trim()===``?(0,V.jsx)(`p`,{className:`py-2 text-sm text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,V.jsx)(`div`,{className:`py-2`,children:(0,V.jsx)(de,{headingLevel:4,copyable:!0,children:i})})}function Te(e){return _e[e.reason]??`Not measured`}function X({metric:e,signal:t,emphasis:n=!1}){if(e.state===`unavailable`)return(0,V.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5`,children:[(0,V.jsx)(`span`,{className:n?`text-lg font-semibold text-secondary`:`text-sm font-medium text-secondary`,children:`Not measured`}),(0,V.jsx)(`span`,{className:`text-sm text-secondary`,children:Te(e)})]});let r=d(e.value),i=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,a=y(e,t);return(0,V.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5 tabular-nums`,children:[(0,V.jsx)(`span`,{className:n?`text-lg font-semibold text-heading`:`text-sm font-medium text-primary`,children:r}),i?(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:i}):null,a?(0,V.jsx)(`span`,{className:`text-xs text-muted`,children:a}):null]})}function Ee(e,t,n){return C({client:m,path:{name:e},query:{scope:`property`,targetKey:t,queryClass:n}})}function De(e){return e?.properties.items.at(0)}function Oe({measuredAt:e,unmeasuredReason:t,queryClass:n}){let r=e===void 0?null:e===null?`No completed check yet`:`Measured ${E(D(e))}`;return r===null&&t===void 0?null:(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[[r,t].filter(Boolean).join(` · `),r!==null&&t===void 0?` · ${q[n].technical.toLocaleLowerCase()} only`:``]})}function ke({project:e,groups:t}){return t.length===0?null:(0,V.jsxs)(`section`,{"aria-labelledby":`property-market`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Competitive comparison`}),(0,V.jsxs)(`h2`,{id:`property-market`,className:`text-base font-semibold text-heading`,children:[`Measured at the market level`,(0,V.jsx)(O,{text:`Competitors are attached to a market rather than to a single Property, because one building has nobody to be compared against. Share of voice and competitor pressure are reported for the market this Property sits in.`})]})]}),(0,V.jsx)(h,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,V.jsx)(u,{to:`/projects/$projectName`,params:{projectName:e},search:e=>j(A(e),{measurementScope:`project`}),children:`Open measurement overview`})})]}),(0,V.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,V.jsxs)(`li`,{className:`rounded-md border border-default px-3 py-1.5 text-sm text-strong`,children:[e.label,(0,V.jsxs)(`span`,{className:`ml-2 text-xs text-muted`,children:[e.competitors.length,` `,e.competitors.length===1?`competitor`:`competitors`]})]},e.stableKey))})]})}function Z({label:e,metric:t,signal:n,failed:r=!1}){if(t===void 0)return(0,V.jsxs)(`div`,{className:`aeo-hero-row`,children:[(0,V.jsx)(`p`,{className:`aeo-hero-row-label`,children:e}),(0,V.jsx)(`p`,{className:`aeo-hero-row-value text-base font-semibold text-secondary`,children:r?`Unavailable`:`…`}),r?(0,V.jsx)(`div`,{}):(0,V.jsx)(`div`,{className:`aeo-hero-row-bar`,"aria-hidden":`true`}),(0,V.jsx)(`p`,{className:`aeo-hero-row-detail`,children:r?`Could not be loaded`:`Loading`})]});if(t.state===`unavailable`){let n=Te(t);return(0,V.jsxs)(`div`,{className:`aeo-hero-row`,children:[(0,V.jsx)(`p`,{className:`aeo-hero-row-label`,children:e}),(0,V.jsx)(`p`,{className:`aeo-hero-row-value text-base font-semibold text-secondary`,children:`Not measured`}),(0,V.jsx)(`div`,{}),(0,V.jsx)(`p`,{className:`aeo-hero-row-detail`,children:n===`Not measured`?``:n})]})}let{figure:i,sign:a}=v(d(t.value)),o=t.numerator===void 0||t.denominator===void 0?null:`${t.numerator} of ${t.denominator}`,s=y(t,n);return(0,V.jsxs)(`div`,{className:`aeo-hero-row`,children:[(0,V.jsx)(`p`,{className:`aeo-hero-row-label`,children:e}),(0,V.jsxs)(`p`,{className:`aeo-hero-row-value text-heading`,children:[i,a?(0,V.jsx)(`span`,{className:`text-faint`,children:a}):null]}),(0,V.jsx)(`div`,{className:`aeo-hero-row-bar`,"aria-hidden":`true`,children:(0,V.jsx)(`div`,{className:`metric-card-bar-fill progress-fill-neutral`,style:{width:`${t.value*100}%`}})}),(0,V.jsxs)(`p`,{className:`aeo-hero-row-detail tabular-nums`,children:[o??``,s?(0,V.jsx)(`span`,{className:`block`,children:s}):null]})]})}function Ae({branded:e,nonBrand:t,brandedFailed:n=!1,nonBrandFailed:r=!1}){return(0,V.jsxs)(`section`,{"aria-labelledby":`property-coverage-hero`,children:[(0,V.jsx)(`h2`,{id:`property-coverage-hero`,className:`sr-only`,children:`Coverage for this Property`}),(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Non-brand · the demand to earn`}),(0,V.jsx)(Z,{label:`Mentioned`,metric:t?.mentionCoverage,signal:`mentioned`,failed:r}),(0,V.jsx)(Z,{label:`Cited`,metric:t?.citationCoverage,signal:`cited`,failed:r})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Branded · already named`}),(0,V.jsx)(Z,{label:`Mentioned`,metric:e?.mentionCoverage,signal:`mentioned`,failed:n}),(0,V.jsx)(Z,{label:`Cited`,metric:e?.citationCoverage,signal:`cited`,failed:n})]})]})]})}function je({branded:e,nonBrand:t,brandedError:n,nonBrandError:r,onRetry:i}){return(0,V.jsxs)(`section`,{"aria-labelledby":`property-brand-contrast`,children:[(0,V.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`The gap`}),(0,V.jsxs)(`h2`,{id:`property-brand-contrast`,className:`text-base font-semibold text-heading`,children:[`Named versus not named`,(0,V.jsx)(O,{text:`Branded queries already contain your name, so an answer engine has an easy path back to you. Non-brand queries describe the need instead, and that is the demand you have to earn. Each row is measured only over the queries assigned to this Property in that class; a class with no assigned query reads Not measured rather than 0%.`})]})]})}),(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[560px]`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`Mention and citation coverage for this Property, split by query class`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Query type`}),(0,V.jsx)(`th`,{children:`Mentioned in the answer`}),(0,V.jsx)(`th`,{children:`Cited as a source`})]})}),(0,V.jsx)(`tbody`,{children:[{queryClass:`branded`,row:e,isError:n},{queryClass:`non-brand`,row:t,isError:r}].map(({queryClass:e,row:t,isError:n})=>(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`block font-medium text-heading`,children:q[e].headline}),(0,V.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted`,children:q[e].technical}),t&&n?(0,V.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-caution`,children:[(0,V.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,V.jsxs)(h,{type:`button`,size:`sm`,variant:`ghost`,className:`h-11 px-3 text-sm md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]}):null]}),t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(X,{metric:t.mentionCoverage,signal:`mentioned`,emphasis:!0})}),(0,V.jsx)(`td`,{children:(0,V.jsx)(X,{metric:t.citationCoverage,signal:`cited`,emphasis:!0})})]}):n?(0,V.jsx)(`td`,{colSpan:2,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-secondary`,children:[(0,V.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,V.jsxs)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]})}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`span`,{className:`text-sm text-secondary`,children:`Loading…`})}),(0,V.jsx)(`td`,{children:(0,V.jsx)(`span`,{className:`text-sm text-secondary`,children:`Loading…`})})]})]},e))})]})})]})}function Me({row:e,queryClass:t,isError:n}){return(0,V.jsxs)(`section`,{"aria-labelledby":`property-providers`,className:`page-section-divider`,children:[(0,V.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,V.jsx)(`div`,{children:(0,V.jsxs)(`h2`,{id:`property-providers`,className:`text-base font-semibold text-heading`,children:[`Which engines answer for this Property`,(0,V.jsx)(O,{text:`Each row is measured over the queries that engine actually answered for this Property, so the rows are a split of the same population rather than parts that add up to the Property total. An engine that answered nothing for this Property is absent instead of shown at 0%.`})]})})}),e===void 0&&n?(0,V.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`Details for `,q[t].technical.toLocaleLowerCase(),` are unavailable. Retry that query type above.`]}):e===void 0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:`Loading…`}):e.providers.length===0?(0,V.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`No answer engine has measured `,q[t].technical.toLocaleLowerCase(),` for this Property.`,e.mentionCoverage.state===`unavailable`?` ${Te(e.mentionCoverage)}.`:``]}):(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[520px]`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`Per-engine mention and citation coverage`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Engine`}),(0,V.jsx)(`th`,{children:`Mentioned`}),(0,V.jsx)(`th`,{children:`Cited`})]})}),(0,V.jsx)(`tbody`,{children:e.providers.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`font-medium text-heading`,children:e.provider}),(0,V.jsx)(`td`,{children:(0,V.jsx)(X,{metric:e.mentionCoverage,signal:`mentioned`})}),(0,V.jsx)(`td`,{children:(0,V.jsx)(X,{metric:e.citationCoverage,signal:`cited`})})]},e.provider))})]})})]})}function Ne(e){let t=e.questions.join(` · `);return e.questionsTruncated?`${t} +${e.questionTotal-e.questions.length} more`:t}function Pe({project:e,targetKey:t,queryClass:n}){let r=a({...w({client:m,path:{name:e},query:{targetKey:t,queryClass:n}})});if(r.isPending||r.isError)return null;let i=r.data?.competitors??[],o=r.data?.basis;return(0,V.jsxs)(`section`,{"aria-labelledby":`property-named-instead`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsx)(`div`,{children:(0,V.jsxs)(`h2`,{id:`property-named-instead`,className:`text-base font-semibold text-heading`,children:[`Named instead of this Property`,(0,V.jsx)(O,{text:`Counted from the answers that did not name this Property, so a name here is one an engine recommended in its place. Occurrences count answers, not positions: an engine naming the same rival in two answers counts twice, and one naming it twice in a single answer counts once.`})]})}),i.length>0?(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[r.data?.total??i.length,` named`]}):null]}),i.length===0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:`No rival was named in the answers this Property missed. Nothing to compete with here yet.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`Names the engines gave instead of this Property`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Named`}),(0,V.jsx)(`th`,{children:`Answers`}),(0,V.jsx)(`th`,{children:`Engines`}),(0,V.jsx)(`th`,{children:`Queries`})]})}),(0,V.jsx)(`tbody`,{children:i.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`text-strong`,children:e.name}),(0,V.jsx)(`td`,{className:`tabular-nums text-secondary`,children:e.occurrences}),(0,V.jsxs)(`td`,{className:`text-secondary`,children:[e.providers.join(`, `),e.providersTruncated?` +${e.providerTotal-e.providers.length}`:``]}),(0,V.jsx)(`td`,{className:`text-right`,children:(0,V.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,V.jsx)(`span`,{className:`tabular-nums text-secondary`,children:e.questionTotal}),(0,V.jsx)(O,{text:Ne(e)})]})})]},e.name))})]})}),o?.state===`available`?(0,V.jsxs)(`p`,{className:`supporting-copy mt-2`,children:[o.targetMissResults,` of `,o.answeredResults,` answers to `,q[n].technical.toLocaleLowerCase(),` did not name this Property.`]}):null]})]})}function Fe({questions:e,queryClass:t}){return(0,V.jsxs)(`section`,{"aria-labelledby":`property-questions`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsx)(`div`,{children:(0,V.jsxs)(`h2`,{id:`property-questions`,className:`text-base font-semibold text-heading`,children:[q[t].technical,` assigned to this Property`]})}),(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` assigned`]})]}),e.length===0?(0,V.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`No `,q[t].technical.toLocaleLowerCase(),` are assigned. Add one in advanced measurement setup to measure this class.`]}):(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`Queries assigned to this Property`}),(0,V.jsx)(`thead`,{children:(0,V.jsx)(`tr`,{children:(0,V.jsx)(`th`,{children:`Query`})})}),(0,V.jsx)(`tbody`,{children:e.map(e=>(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{className:`text-secondary`,children:e})},e))})]})})]})}function Ie({urls:e}){return(0,V.jsxs)(`section`,{"aria-labelledby":`property-urls`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsx)(`div`,{children:(0,V.jsxs)(`h2`,{id:`property-urls`,className:`text-base font-semibold text-heading`,children:[`URLs that count as this Property`,(0,V.jsx)(O,{text:`A cited source URL is credited to this Property when it matches one of these. The most specific matcher wins, so a URL covered by two Properties at the same specificity is flagged for review instead of being credited to either.`})]})}),(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` configured`]})]}),e.length===0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:`No URLs are configured for this Property.`}):(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`URL matchers configured for this Property`}),(0,V.jsx)(`thead`,{children:(0,V.jsx)(`tr`,{children:(0,V.jsx)(`th`,{children:`URL`})})}),(0,V.jsx)(`tbody`,{children:e.map(e=>(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{className:`break-all text-secondary`,children:e})},e))})]})})]})}var Q={heading:`Cited on other queries`,help:`Answers to queries assigned to other properties that still cited one of this Property’s own pages. This Property was not measured on those queries, so these answers are not in its Mentioned or Cited rates.`,notCounted:`not in this Property’s rates`,empty:`No answer to a query assigned elsewhere cited this Property’s pages in the displayed measurement.`,loadError:`Citations from other queries could not be loaded.`,partlySaved:`Sources partly saved`};function Le({project:e,targetKey:t,queryClass:n,runId:r,targetLabels:i}){let[a,o]=(0,B.useState)(new Set),s={client:m,path:{name:e},query:{targetKey:t,queryClass:n,shape:ne[`other-queries`],limit:K,...r?{runId:r}:{}}},l=c({...oe(s),initialPageParam:s,getNextPageParam:e=>e.otherQueries?.nextCursor?{path:s.path,query:{...s.query,cursor:e.otherQueries.nextCursor}}:void 0}),d=l.data?.pages??[];if(d[0]?.measurement.state===`not_measured`)return null;let f=d.flatMap(e=>e.otherQueries?.items??[]),ee=d[0]?.otherQueries?.totalEstimate??f.length,p=e=>`${e.expectedSlotId}:${e.queryClass}`,te=q[n].technical.toLocaleLowerCase();return(0,V.jsxs)(`section`,{"aria-labelledby":`property-other-queries`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`h2`,{id:`property-other-queries`,className:`text-base font-semibold text-heading`,children:Q.heading}),(0,V.jsx)(O,{text:Q.help})]}),l.data?(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[ee,` `,ee===1?`answer`:`answers`,` · `,te,` · `,Q.notCounted]}):null]}),l.isPending?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:`Loading…`}):l.isError&&f.length===0?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-secondary`,children:[(0,V.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,V.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,onClick:()=>{l.refetch()},children:`Retry`})]}):f.length===0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:Q.empty}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table min-w-[640px]`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`Answers to other properties’ queries that cited this Property’s pages`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Query`}),(0,V.jsx)(`th`,{children:`Assigned to`}),(0,V.jsx)(`th`,{children:`Pages cited`}),(0,V.jsx)(`th`,{children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Answer`})})]})}),(0,V.jsx)(`tbody`,{children:f.map(t=>{let n=p(t),r=a.has(n),s=`property-other-query-${encodeURIComponent(n)}`;return(0,V.jsxs)(B.Fragment,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{className:`text-secondary`,children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-heading`,children:t.queryText}),(0,V.jsx)(`span`,{className:`mt-1 block text-xs text-muted`,children:[t.provider,t.location].filter(Boolean).join(` · `)})]}),(0,V.jsx)(`td`,{children:(0,V.jsx)(`ul`,{className:`space-y-1`,children:t.assignedTargetKeys.map(t=>(0,V.jsx)(`li`,{children:(0,V.jsx)(u,{to:`/projects/$projectName/properties/$targetKey`,params:{projectName:e,targetKey:t},search:A,className:`text-sm text-link hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:i.get(t)??t})},t))})}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`ul`,{className:`space-y-1`,children:t.sources.map(e=>(0,V.jsx)(`li`,{className:`min-w-0`,children:(0,V.jsx)(N,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,V.jsxs)(`span`,{className:`mt-1 block text-xs text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,V.jsx)(`span`,{className:`mt-1 block text-xs text-muted`,children:Q.partlySaved})]}),(0,V.jsx)(`td`,{className:`text-right`,children:(0,V.jsx)(h,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":r,"aria-label":r?`Hide the answer for ${t.queryText}`:`Read the answer for ${t.queryText}`,"aria-controls":r?s:void 0,onClick:()=>o(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t}),children:r?`Hide answer`:`Read answer`})})]}),r?(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{id:s,colSpan:4,className:`bg-surface-subtle px-4`,children:(0,V.jsx)(we,{project:e,targetKey:t.assignedTargetKeys[0],resultId:t.observationId})})}):null]},n)})})]})}),l.hasNextPage?(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-sm text-secondary`,children:[(0,V.jsxs)(`span`,{children:[`Showing `,f.length,` of `,ee]}),(0,V.jsx)(h,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,disabled:l.isFetchingNextPage,onClick:()=>{l.fetchNextPage()},children:l.isFetchingNextPage?`Loading…`:`Show ${K} more`})]}):null]})]})}function Re(e,t){let n=[e.marketKey?t??`the selected market`:null,e.provider?`the ${e.provider} answer engine`:null,e.model?`the ${e.model} model`:null,e.location?`location ${e.location}`:null,e.from||e.to?`a date range`:null,e.measurementRunId?`a saved check`:null].filter(e=>e!==null);return n.length===0?null:`AI Visibility is filtered to ${n.join(`, `)}. This page shows the latest measurement for ${I.allMarkets.toLocaleLowerCase()} and answer engines.`}function ze(){let{projectName:e,targetKey:t}=l({strict:!1}),r=o(),i=s({strict:!1}),d=(0,B.useMemo)(()=>k(i),[i]),[ee,te]=(0,B.useState)(new Set),_=e??``,v=t??``,y=!!_&&!!v,b=(0,B.useMemo)(()=>le(`portfolio`,ce(p())),[]),S=y&&b,{canWrite:C}=re(),w=a({...x({client:m,path:{name:_}}),enabled:S}),T=w.data?.active?.plan,ae=T?.schemaVersion===2?T:null,E=d.queryClass===`branded`||d.queryClass===`non-brand`?d.queryClass:null,D=e=>ae?.assignments.some(t=>t.targetKey===v&&t.queryClass===e)??!1,M=E??(!D(`non-brand`)&&D(`branded`)?`branded`:`non-brand`);(0,B.useEffect)(()=>{ae&&!E&&r({to:`.`,replace:!0,search:e=>j(e,{queryClass:M})})},[ae,E,M,r]);let N=a({...Ee(_,v,`branded`),enabled:S}),F=a({...Ee(_,v,`non-brand`),enabled:S}),I=De(N.data),de=De(F.data),L=M===`branded`?N.data:F.data,R=M===`branded`?I:de,H=(M===`branded`?N.isError:F.isError)&&R===void 0,U=L?.measurement.displayedRunId;P(_,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:v,queryClass:M,limit:10,...U?{runId:U}:{}}});let W=R?.mentionCoverage.state===`unavailable`?Te(R.mentionCoverage):void 0,G=L===void 0?void 0:L.measurement.completedAt??null,pe=L!==void 0&&(L.measurement.state===`not_measured`||L.nextAction.kind===`run_measurement`),me=e=>j(A(e),{measurementScope:`property`,measurementScopeKey:v,queryClass:M,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),he=a({...ie({client:m,path:{name:_},query:se(k(me(i)))}),enabled:S&&pe,retry:!1}).data,_e=he!==void 0&&he.selection.measurement.measuredRevision!==null&&(he.populations.find(e=>e.queryClass===M)?.summary.queryCount??0)>0,J={client:m,path:{name:_},query:{targetKey:v,queryClass:M,shape:ne.answers,limit:K,...U?{runId:U}:{}}},Y=c({...oe(J),enabled:S&&L!==void 0,initialPageParam:J,getNextPageParam:e=>e.answers?.nextCursor?{path:J.path,query:{...J.query,cursor:e.answers.nextCursor}}:void 0}),X=w.data?.active??null,Z=X?.plan.schemaVersion===2?X.plan:null,Ne=X!==null&&Z===null,Q=Z?.targets.find(e=>e.stableKey===v)??null,ze=Re(d,Z?.reportingScopes?.find(e=>e.stableKey===d.marketKey)?.label),Be=(0,B.useMemo)(()=>{if(!Z)return[];let e=new Map(Z.querySnapshots.map(e=>[e.queryId,e.queryText]));return[...new Set(Z.assignments.filter(e=>e.targetKey===v&&e.queryClass===M).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[Z,v,M]),Ve=(0,B.useMemo)(()=>Q?.urlMatchers.map(fe)??[],[Q]),He=(0,B.useMemo)(()=>new Map((Z?.targets??[]).map(e=>[e.stableKey,e.label])),[Z]),Ue=(0,B.useMemo)(()=>Z?.groups.filter(e=>e.targetKeys.includes(v))??[],[Z,v]),$=(0,B.useMemo)(()=>(Y.data?.pages??[]).flatMap(e=>e.answers?.items??[]),[Y.data]),We=Y.data?.pages[0]?.answers?.totalEstimate??$.length,Ge=(Y.data?.pages??[]).length>0&&(Y.data?.pages??[]).every(e=>e.answers===void 0),Ke=Y.data?.pages[0]?.measurement.state,qe=(0,V.jsxs)(u,{to:`/projects/$projectName`,params:{projectName:_},search:A,className:`inline-flex items-center gap-1 text-xs text-muted hover:text-strong`,children:[(0,V.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!y)return(0,V.jsx)(`div`,{className:`page-container`,children:(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`Missing project name or Property key in URL.`})});if(!b)return(0,V.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,V.jsx)(`p`,{className:`text-sm text-muted`,children:`This view is not available here.`})]});if(w.isPending&&!w.isError)return(0,V.jsx)(`div`,{className:`page-container`,children:(0,V.jsxs)(`div`,{role:`status`,"aria-live":`polite`,children:[(0,V.jsx)(`span`,{className:`sr-only`,children:`Loading Property`}),(0,V.jsx)(`div`,{className:`h-32 animate-pulse rounded-md bg-surface-subtle`,"aria-hidden":`true`})]})});let Je=w.isError&&w.data===void 0,Ye=N.isError&&N.data===void 0,Xe=F.isError&&F.data===void 0;return Je||Ye&&Xe?(0,V.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-negative`,children:`Could not load this Property.`}),(0,V.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,onClick:()=>{w.refetch(),N.refetch(),F.refetch()},children:`Try again`})]}):!Z||!Q?(0,V.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,V.jsx)(`p`,{role:`status`,className:`text-sm text-secondary`,children:Z?`This Property is not in the published setup. It may have been renamed or removed.`:`A Property page needs a published advanced measurement setup. Republish setup from the project Portfolio tab.`}),(0,V.jsx)(h,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,children:(0,V.jsx)(u,{to:`/projects/$projectName/portfolio`,params:{projectName:_},children:C?Ne?`Republish setup`:`Open measurement setup`:`View measurement setup`})})]}):(0,V.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,V.jsxs)(`div`,{className:`page-header`,children:[(0,V.jsxs)(`div`,{className:`page-header-left`,children:[qe,(0,V.jsx)(`h1`,{className:`page-title mt-2`,children:Q.label}),(0,V.jsxs)(`p`,{className:`page-subtitle`,children:[`Property in `,_,ze?(0,V.jsxs)(V.Fragment,{children:[` · Filters not applied `,(0,V.jsx)(O,{text:ze})]}):null]})]}),(0,V.jsxs)(`div`,{className:`page-header-right`,children:[L?(0,V.jsx)(g,{tone:ve[L.measurement.state].tone,children:ve[L.measurement.state].label}):null,R&&R.flags>0?(0,V.jsxs)(g,{tone:`caution`,children:[R.flags,` flagged`]}):null]})]}),(0,V.jsx)(Ae,{branded:I,nonBrand:de,brandedFailed:Ye,nonBrandFailed:Xe}),(0,V.jsx)(je,{branded:I,nonBrand:de,brandedError:N.isError,nonBrandError:F.isError,onRetry:e=>{e===`branded`?N.refetch():F.refetch()}}),pe?(0,V.jsxs)(`section`,{className:`flex flex-wrap items-center justify-between gap-3 border-y border-default py-4`,"aria-label":`Measurement next step`,children:[(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:f()?ue:C?`Run a measurement from the project overview to collect this Property’s coverage and source evidence.${_e?` AI Visibility still shows the last results.`:``}`:`This Property needs a new measurement before coverage and source evidence are available.`}),(0,V.jsx)(h,{asChild:!0,type:`button`,className:`h-11 px-4 text-sm md:h-11`,children:(0,V.jsx)(u,{to:`/projects/$projectName`,params:{projectName:_},search:_e?me:A,children:_e?`See the last results`:C?`Go to AI Visibility`:`View AI Visibility`})})]}):null,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4 border-y border-default py-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{htmlFor:`property-query-class`,className:`block text-sm font-medium text-heading`,children:`Query type`}),(0,V.jsxs)(`select`,{id:`property-query-class`,value:M,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>j(e,{queryClass:t})})},className:`h-11 rounded-md border border-default bg-surface px-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-mono-400`,children:[(0,V.jsx)(`option`,{value:`non-brand`,children:q[`non-brand`].technical}),(0,V.jsx)(`option`,{value:`branded`,children:q.branded.technical})]})]}),(0,V.jsx)(Oe,{measuredAt:G,unmeasuredReason:W,queryClass:M})]}),(0,V.jsx)(Me,{row:R,queryClass:M,isError:H}),(0,V.jsx)(Pe,{project:_,targetKey:v,queryClass:M}),(0,V.jsx)(Fe,{questions:Be,queryClass:M}),(0,V.jsx)(ge,{projectName:_,targetKey:v,published:Q,activeRevision:X.revision,publishedBrandNames:Z.identities.projectBrand.names}),(0,V.jsx)(Ie,{urls:Ve}),(0,V.jsx)(ke,{project:_,groups:Ue}),(0,V.jsxs)(`section`,{"aria-labelledby":`property-evidence`,className:`page-section-divider`,children:[(0,V.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,V.jsx)(`div`,{children:(0,V.jsxs)(`h2`,{id:`property-evidence`,className:`text-base font-semibold text-heading`,children:[`Answers the engines gave`,(0,V.jsx)(O,{text:`One row per answer an engine gave for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent: an answer can name this Property without linking it, or link it without naming it. Answers that did neither are listed first, because those are what a gap is made of. Where the answer text was not stored the mention reads Not measured, never a zero. Open a row to read what the engine actually said, followed by the source URLs it returned, this Property's own first. The answer is where a miss becomes actionable: a query this Property was not named in may still have named a sibling building.`})]})}),$.length>0?(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[$.length,` of `,We]}):null]}),H?(0,V.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`Evidence for `,q[M].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):Y.isPending&&$.length===0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:`Loading evidence…`}):Y.isError&&$.length===0?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-secondary`,children:[(0,V.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,V.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,onClick:()=>{Y.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:f()?ue:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-caution`,children:`This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected.`}):$.length===0?(0,V.jsx)(`p`,{className:`text-sm text-secondary`,children:`No answers matched this Property in the displayed measurement.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`property-answer-table-container overflow-x-auto rounded-md border border-default`,children:(0,V.jsxs)(`table`,{className:`evidence-table property-evidence-table`,children:[(0,V.jsx)(`caption`,{className:`sr-only`,children:`Answers measured for this Property`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Query`}),(0,V.jsx)(`th`,{children:`Mentioned in the answer`}),(0,V.jsx)(`th`,{children:`Cited as a source`}),(0,V.jsx)(`th`,{children:`Sources`}),(0,V.jsx)(`th`,{children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Sources detail`})})]})}),(0,V.jsx)(`tbody`,{children:$.map(e=>{let t=ye(e),n=ee.has(t),r=`property-answer-${encodeURIComponent(t)}`;return(0,V.jsxs)(B.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`property-answer-summary`,children:[(0,V.jsxs)(`td`,{className:`text-secondary`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-heading`,children:e.queryText}),(0,V.jsx)(`span`,{className:`mt-1 block text-xs text-muted`,children:[e.provider,e.location].filter(Boolean).join(` · `)}),e.historical||e.bridged?(0,V.jsx)(`span`,{className:`mt-1 flex`,children:(0,V.jsx)(g,{tone:`caution`,children:`Historical`})}):null]}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Mentioned`}),(0,V.jsx)(be,{row:e})]}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Cited`}),(0,V.jsx)(Se,{row:e})]}),(0,V.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,V.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:z}),e.cited===null?xe:e.sources.length]}),(0,V.jsx)(`td`,{className:`text-right`,children:(0,V.jsx)(h,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":n,"aria-label":n?`Hide the answer for ${e.queryText}`:`Read the answer for ${e.queryText}`,"aria-controls":n?r:void 0,onClick:()=>te(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n}),children:n?`Hide answer`:`Read answer`})})]}),n?(0,V.jsx)(`tr`,{className:`property-answer-detail`,children:(0,V.jsxs)(`td`,{id:r,colSpan:5,className:`bg-surface-subtle px-4`,children:[(0,V.jsx)(we,{project:_,targetKey:v,resultId:e.observationId}),(0,V.jsx)(Ce,{row:e})]})}):null]},t)})})]})}),Y.hasNextPage?(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-sm text-secondary`,children:[(0,V.jsxs)(`span`,{children:[`Showing `,$.length,` of `,We]}),Y.isFetchNextPageError?(0,V.jsx)(`span`,{role:`alert`,children:`Could not load more evidence.`}):null,(0,V.jsx)(h,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-sm md:h-11`,disabled:Y.isFetchingNextPage,onClick:()=>{Y.fetchNextPage()},children:Y.isFetchingNextPage?`Loading…`:Y.isFetchNextPageError?`Retry more evidence`:`Show ${K} more`})]}):null]})]}),L?(0,V.jsx)(Le,{project:_,targetKey:v,queryClass:M,runId:U,targetLabels:He}):null]})}export{J as EVIDENCE_LABELS,ze as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};
|