@canonry/canonry 7.90.0 → 7.90.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{ct as n}from"./vendor-lucide-Bo69m9KC.js";import{h as r,m as i}from"./SiteHealthSection-BZhulwSy.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.
1
+ import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{ct as n}from"./vendor-lucide-Bo69m9KC.js";import{h as r,m as i}from"./SiteHealthSection-CRwvLfHd.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:`
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-BrHemYsG.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-DdG9gR0r.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-lucide-Bo69m9KC.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-BiRP51B0.js">
@@ -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-TVODHNFU.js");
50
+ const { serveCommand } = await import("./serve-VVG3VYMU.js");
51
51
  await serveCommand(format);
52
52
  }
53
53
 
@@ -7133,7 +7133,7 @@ var SYSTEM_CLI_COMMANDS = [
7133
7133
  options: { access: stringOption() },
7134
7134
  run: async (input) => {
7135
7135
  if (input.positionals.length > 1) throw usageError("Expected at most one command group");
7136
- const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-BTRNR2UP.js"), import("./cli-commands-5ISZA43S.js")]);
7136
+ const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-BTRNR2UP.js"), import("./cli-commands-EXWAMK7Z.js")]);
7137
7137
  printCliCatalog(REGISTERED_CLI_COMMANDS2, input.format, input.positionals[0], getString(input.values, "access"));
7138
7138
  }
7139
7139
  },
@@ -7182,7 +7182,7 @@ var SYSTEM_CLI_COMMANDS = [
7182
7182
  },
7183
7183
  allowPositionals: false,
7184
7184
  run: async (input) => {
7185
- const { initCommand } = await import("./init-K4623VOY.js");
7185
+ const { initCommand } = await import("./init-2WZWYSDW.js");
7186
7186
  await initCommand({
7187
7187
  force: getBoolean(input.values, "force"),
7188
7188
  ref: getString(input.values, "ref"),
@@ -7237,7 +7237,7 @@ var SYSTEM_CLI_COMMANDS = [
7237
7237
  allowPositionals: false,
7238
7238
  run: async (input) => {
7239
7239
  applyServerEnv(input.values);
7240
- const { serveCommand } = await import("./serve-TVODHNFU.js");
7240
+ const { serveCommand } = await import("./serve-VVG3VYMU.js");
7241
7241
  await serveCommand(input.format);
7242
7242
  }
7243
7243
  },
@@ -5974,7 +5974,7 @@ function nonBlank(value) {
5974
5974
  return trimmed ? trimmed : void 0;
5975
5975
  }
5976
5976
  function resolveBuildCommit(env = process.env) {
5977
- const embedded = true ? "c97db3b634ae1944197825d1b93afaee2b7f41ad" : void 0;
5977
+ const embedded = true ? "5b7cd7625b3f0674d78f92e2665fb351f76d51e3" : void 0;
5978
5978
  return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
5979
5979
  }
5980
5980
  function resolveInstanceIdentity(env = process.env) {
@@ -22443,6 +22443,11 @@ async function createServer(opts) {
22443
22443
  if (basePath && !url.startsWith(basePath)) {
22444
22444
  return reply.status(404).send({ error: "Not found", path: request.url });
22445
22445
  }
22446
+ const assetsPrefix = `${basePath ?? "/"}assets/`;
22447
+ if (url.startsWith(assetsPrefix) || decodedUrl.startsWith(assetsPrefix)) {
22448
+ const error = notFound("Asset", url);
22449
+ return reply.status(error.statusCode).send(error.toJSON());
22450
+ }
22446
22451
  if (fs5.existsSync(indexPath)) {
22447
22452
  const html = fs5.readFileSync(indexPath, "utf-8");
22448
22453
  return sendSpaDocument(reply, html);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  REGISTERED_CLI_COMMANDS
3
- } from "./chunk-C2XWWIJZ.js";
3
+ } from "./chunk-T7OH3YPX.js";
4
4
  import "./chunk-6GO5VVAC.js";
5
5
  import "./chunk-VJWDBFSL.js";
6
6
  import "./chunk-L2MDMZFT.js";
package/dist/cli.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node --import tsx
2
2
  import {
3
3
  REGISTERED_CLI_COMMANDS
4
- } from "./chunk-C2XWWIJZ.js";
4
+ } from "./chunk-T7OH3YPX.js";
5
5
  import "./chunk-6GO5VVAC.js";
6
6
  import {
7
7
  buildSetupState,
8
8
  runPendingServeHandoff
9
- } from "./chunk-YPJCZD5H.js";
9
+ } from "./chunk-CHTADAEC.js";
10
10
  import "./chunk-VJWDBFSL.js";
11
11
  import "./chunk-L2MDMZFT.js";
12
12
  import "./chunk-TSENU4GG.js";
package/dist/index.d.ts CHANGED
@@ -1349,8 +1349,8 @@ declare const seoCompetitorSchema: z.ZodObject<{
1349
1349
  }, z.core.$strict>;
1350
1350
  type SeoCompetitor = z.infer<typeof seoCompetitorSchema>;
1351
1351
  declare const seoKeywordGapModeSchema: z.ZodEnum<{
1352
- shared: "shared";
1353
1352
  missing: "missing";
1353
+ shared: "shared";
1354
1354
  }>;
1355
1355
  type SeoKeywordGapMode = z.infer<typeof seoKeywordGapModeSchema>;
1356
1356
  /** Missing means absent from the provider's database result for this pair, never a fresh Google rank check. */
@@ -1380,8 +1380,8 @@ declare const seoKeywordGapSchema: z.ZodObject<{
1380
1380
  keywordDifficulty: z.ZodNullable<z.ZodNumber>;
1381
1381
  cpcUsd: z.ZodNullable<z.ZodNumber>;
1382
1382
  kind: z.ZodEnum<{
1383
- shared: "shared";
1384
1383
  missing: "missing";
1384
+ shared: "shared";
1385
1385
  outranked: "outranked";
1386
1386
  }>;
1387
1387
  rankGap: z.ZodNullable<z.ZodNumber>;
@@ -1677,8 +1677,8 @@ declare const seoResultsSchema: z.ZodObject<{
1677
1677
  keywordDifficulty: z.ZodNullable<z.ZodNumber>;
1678
1678
  cpcUsd: z.ZodNullable<z.ZodNumber>;
1679
1679
  kind: z.ZodEnum<{
1680
- shared: "shared";
1681
1680
  missing: "missing";
1681
+ shared: "shared";
1682
1682
  outranked: "outranked";
1683
1683
  }>;
1684
1684
  rankGap: z.ZodNullable<z.ZodNumber>;
@@ -2277,7 +2277,7 @@ declare const seoJobs: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2277
2277
  tableName: "seo_jobs";
2278
2278
  dataType: "string";
2279
2279
  columnType: "SQLiteText";
2280
- data: "queued" | "running" | "partial" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2280
+ data: "partial" | "queued" | "running" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2281
2281
  driverParam: string;
2282
2282
  notNull: true;
2283
2283
  hasDefault: false;
@@ -2290,7 +2290,7 @@ declare const seoJobs: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2290
2290
  generated: undefined;
2291
2291
  }, {}, {
2292
2292
  length: number | undefined;
2293
- $type: "queued" | "running" | "partial" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2293
+ $type: "partial" | "queued" | "running" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2294
2294
  }>;
2295
2295
  cancelRequested: drizzle_orm_sqlite_core.SQLiteColumn<{
2296
2296
  name: "cancel_requested";
@@ -2454,7 +2454,7 @@ declare const seoTasks: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2454
2454
  tableName: "seo_tasks";
2455
2455
  dataType: "string";
2456
2456
  columnType: "SQLiteText";
2457
- data: "queued" | "running" | "partial" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2457
+ data: "partial" | "queued" | "running" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2458
2458
  driverParam: string;
2459
2459
  notNull: true;
2460
2460
  hasDefault: false;
@@ -2467,7 +2467,7 @@ declare const seoTasks: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2467
2467
  generated: undefined;
2468
2468
  }, {}, {
2469
2469
  length: number | undefined;
2470
- $type: "queued" | "running" | "partial" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2470
+ $type: "partial" | "queued" | "running" | "failed" | "completed" | "cancelled" | "reconciliation-required";
2471
2471
  }>;
2472
2472
  leaseOwner: drizzle_orm_sqlite_core.SQLiteColumn<{
2473
2473
  name: "lease_owner";
@@ -6185,7 +6185,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6185
6185
  tableName: "query_snapshots";
6186
6186
  dataType: "string";
6187
6187
  columnType: "SQLiteText";
6188
- data: "complete" | "partial" | "failed" | "unsupported";
6188
+ data: "partial" | "unsupported" | "complete" | "failed";
6189
6189
  driverParam: string;
6190
6190
  notNull: false;
6191
6191
  hasDefault: false;
@@ -6198,7 +6198,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6198
6198
  generated: undefined;
6199
6199
  }, {}, {
6200
6200
  length: number | undefined;
6201
- $type: "complete" | "partial" | "failed" | "unsupported";
6201
+ $type: "partial" | "unsupported" | "complete" | "failed";
6202
6202
  }>;
6203
6203
  sourceCount: drizzle_orm_sqlite_core.SQLiteColumn<{
6204
6204
  name: "source_count";
@@ -6565,7 +6565,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6565
6565
  parserVersion: string;
6566
6566
  };
6567
6567
  completion: {
6568
- status: "complete" | "partial" | "failed" | "pending";
6568
+ status: "partial" | "complete" | "failed" | "pending";
6569
6569
  finishReason: string | null;
6570
6570
  upstreamStatus: string | null;
6571
6571
  upstreamRequestId: string | null;
@@ -6670,7 +6670,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6670
6670
  parserVersion: string;
6671
6671
  };
6672
6672
  completion: {
6673
- status: "complete" | "partial" | "failed" | "pending";
6673
+ status: "partial" | "complete" | "failed" | "pending";
6674
6674
  finishReason: string | null;
6675
6675
  upstreamStatus: string | null;
6676
6676
  upstreamRequestId: string | null;
@@ -12427,7 +12427,7 @@ declare const siteAuditSnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns
12427
12427
  weight: number;
12428
12428
  sharePct: number | null;
12429
12429
  avgScore: number;
12430
- status: "partial" | "fail" | "pass";
12430
+ status: "fail" | "partial" | "pass";
12431
12431
  pagesPassing: number;
12432
12432
  pagesPartial: number;
12433
12433
  pagesFailing: number;
@@ -12449,7 +12449,7 @@ declare const siteAuditSnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns
12449
12449
  weight: number;
12450
12450
  sharePct: number | null;
12451
12451
  avgScore: number;
12452
- status: "partial" | "fail" | "pass";
12452
+ status: "fail" | "partial" | "pass";
12453
12453
  pagesPassing: number;
12454
12454
  pagesPartial: number;
12455
12455
  pagesFailing: number;
@@ -28903,7 +28903,7 @@ declare const discoverySessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<
28903
28903
  data: {
28904
28904
  domain: string;
28905
28905
  hits: number;
28906
- competitorType: "unknown" | "direct-competitor" | "ota-aggregator" | "editorial-media" | "other";
28906
+ competitorType: "unknown" | "other" | "direct-competitor" | "ota-aggregator" | "editorial-media";
28907
28907
  evaluator?: {
28908
28908
  provider: string;
28909
28909
  requestedModel: string;
@@ -28925,7 +28925,7 @@ declare const discoverySessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<
28925
28925
  $type: {
28926
28926
  domain: string;
28927
28927
  hits: number;
28928
- competitorType: "unknown" | "direct-competitor" | "ota-aggregator" | "editorial-media" | "other";
28928
+ competitorType: "unknown" | "other" | "direct-competitor" | "ota-aggregator" | "editorial-media";
28929
28929
  evaluator?: {
28930
28930
  provider: string;
28931
28931
  requestedModel: string;
@@ -29847,7 +29847,7 @@ declare const researchRunQueries: drizzle_orm_sqlite_core.SQLiteTableWithColumns
29847
29847
  parserVersion: string;
29848
29848
  };
29849
29849
  completion: {
29850
- status: "complete" | "partial" | "failed" | "pending";
29850
+ status: "partial" | "complete" | "failed" | "pending";
29851
29851
  finishReason: string | null;
29852
29852
  upstreamStatus: string | null;
29853
29853
  upstreamRequestId: string | null;
@@ -29952,7 +29952,7 @@ declare const researchRunQueries: drizzle_orm_sqlite_core.SQLiteTableWithColumns
29952
29952
  parserVersion: string;
29953
29953
  };
29954
29954
  completion: {
29955
- status: "complete" | "partial" | "failed" | "pending";
29955
+ status: "partial" | "complete" | "failed" | "pending";
29956
29956
  finishReason: string | null;
29957
29957
  upstreamStatus: string | null;
29958
29958
  upstreamRequestId: string | null;
@@ -30386,7 +30386,7 @@ declare const domainClassifications: drizzle_orm_sqlite_core.SQLiteTableWithColu
30386
30386
  tableName: "domain_classifications";
30387
30387
  dataType: "string";
30388
30388
  columnType: "SQLiteText";
30389
- data: "unknown" | "direct-competitor" | "ota-aggregator" | "editorial-media" | "other";
30389
+ data: "unknown" | "other" | "direct-competitor" | "ota-aggregator" | "editorial-media";
30390
30390
  driverParam: string;
30391
30391
  notNull: true;
30392
30392
  hasDefault: false;
@@ -30399,7 +30399,7 @@ declare const domainClassifications: drizzle_orm_sqlite_core.SQLiteTableWithColu
30399
30399
  generated: undefined;
30400
30400
  }, {}, {
30401
30401
  length: number | undefined;
30402
- $type: "unknown" | "direct-competitor" | "ota-aggregator" | "editorial-media" | "other";
30402
+ $type: "unknown" | "other" | "direct-competitor" | "ota-aggregator" | "editorial-media";
30403
30403
  }>;
30404
30404
  hits: drizzle_orm_sqlite_core.SQLiteColumn<{
30405
30405
  name: "hits";
@@ -34557,7 +34557,7 @@ declare const adsOperationSteps: drizzle_orm_sqlite_core.SQLiteTableWithColumns<
34557
34557
  tableName: "ads_operation_steps";
34558
34558
  dataType: "string";
34559
34559
  columnType: "SQLiteText";
34560
- data: "unknown" | "failed" | "active" | "pending" | "executing" | "rollback_executing" | "rolled_back" | "rollback_failed";
34560
+ data: "unknown" | "active" | "failed" | "pending" | "executing" | "rollback_executing" | "rolled_back" | "rollback_failed";
34561
34561
  driverParam: string;
34562
34562
  notNull: true;
34563
34563
  hasDefault: false;
@@ -34570,7 +34570,7 @@ declare const adsOperationSteps: drizzle_orm_sqlite_core.SQLiteTableWithColumns<
34570
34570
  generated: undefined;
34571
34571
  }, {}, {
34572
34572
  length: number | undefined;
34573
- $type: "unknown" | "failed" | "active" | "pending" | "executing" | "rollback_executing" | "rolled_back" | "rollback_failed";
34573
+ $type: "unknown" | "active" | "failed" | "pending" | "executing" | "rollback_executing" | "rolled_back" | "rollback_failed";
34574
34574
  }>;
34575
34575
  providerUpdatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
34576
34576
  name: "provider_updated_at";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-OVUFIG22.js";
6
+ } from "./chunk-YFZHRYCM.js";
7
7
  import "./chunk-TA4L7U2M.js";
8
8
  import "./chunk-NKGQCCUS.js";
9
9
  import "./chunk-DF4B6OGX.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  buildSetupState,
9
9
  queueServeHandoff
10
- } from "./chunk-YPJCZD5H.js";
10
+ } from "./chunk-CHTADAEC.js";
11
11
  import "./chunk-VJWDBFSL.js";
12
12
  import "./chunk-DZO6CATO.js";
13
13
  import "./chunk-LQWMNDZR.js";
@@ -9,7 +9,7 @@ import {
9
9
  allowsKeylessFirstRunSetup,
10
10
  createServer,
11
11
  waitForServerRuntimeStartup
12
- } from "./chunk-OVUFIG22.js";
12
+ } from "./chunk-YFZHRYCM.js";
13
13
  import "./chunk-TA4L7U2M.js";
14
14
  import "./chunk-NKGQCCUS.js";
15
15
  import "./chunk-DF4B6OGX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "7.90.0",
3
+ "version": "7.90.1",
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{ct as t,ot as n}from"./vendor-lucide-Bo69m9KC.js";import{r}from"./vendor-markdown-BiRP51B0.js";import{_ as i,b as a,d as o,f as s,g as c,p as l,u}from"./vendor-tanstack-tBjrfzKu.js";import{$r as d,Ct as f,Kr as p,Pi as ee,ci as m,mt as h,ot as te,qr as g,r as _,t as v}from"./ToneBadge-B3rD6bDF.js";import{g as y,i as b,y as x}from"./format-helpers-ByAY4dv0.js";import{r as ne}from"./account-context-GstYbqpX.js";import{_t as S,ct as re,dn as C,dt as w,lt as ie,mt as T,st as E,ut as D}from"./react-query-B8JD_K7g.js";import{f as O,h as k}from"./ChartPrimitives-Cs2iavxU.js";import{t as A}from"./InfoTooltip-CNLlIWeP.js";import{G as j,H as M,I as ae,J as oe,L as N,Y as P,Z as se,ct as F,dn as ce,ln as le,ot as I,pn as ue,z as de}from"./index-BrHemYsG.js";import{c as L,r as R,s as fe,t as z}from"./service-SgtD5EOS.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-heading-14 text-heading`,children:e}),(0,V.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,V.jsx)(`li`,{className:`text-label-14 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-label-14 text-caution`,children:p(e)},`${e.field}:${e.index}`))})}function ge({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:o,service:s=z}){let{canWrite:c}=ne(),l=(0,B.useId)(),f=a({...re({client:h,path:{name:e}}),enabled:c}),p=a({...S({client:h,path:{name:e}}),enabled:c}),ee=f.data?.draft?.authoring.targets.find(e=>e.stableKey===t),m=n.identityAliases??[],te=ee!==void 0&&f.data?.draft?.baseActiveRevision===r&&!G(ee,n),v=!f.isFetching&&!p.isPending,y=p.data,b=(0,B.useMemo)(()=>y?d(y):o,[y,o]),[x,C]=(0,B.useState)(!1),[w,ie]=(0,B.useState)(``),[T,E]=(0,B.useState)(``),[D,O]=(0,B.useState)(n),[k,j]=(0,B.useState)(null),M=`${e}\u0000${t}`,[ae,oe]=(0,B.useState)(M);ae!==M&&(oe(M),C(!1),ie(``),E(``),O(n),j(null));let N=(0,B.useRef)(M);N.current=M;let P=(0,B.useMemo)(()=>U(w),[w]),se=(0,B.useMemo)(()=>U(T),[T]),F=(0,B.useMemo)(()=>g({aliases:P,identityAliases:se,brandNames:b}),[P,se,b]),ce=F.filter(e=>e.field===`aliases`),le=F.filter(e=>e.field===`identityAliases`);function I(e){ie(e.aliases.join(`
3
- `)),E((e.identityAliases??[]).join(`
4
- `)),O({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function ue(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function L(){I(te?ee:n),j(null),C(!0)}function fe(e){e&&I(e),j({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`:C(!1),j({tone:`positive`,text:H.saved,review:!0});return;case`unchanged`:C(!1),j({tone:`positive`,text:H.noChanges,review:!1});return;case`stale`:j({tone:`negative`,text:H.staleDraft,review:!0});return;case`missing`:j({tone:`negative`,text:H.missingFromDraft,review:!0});return;case`conflict`:fe(e.latest),f.refetch();return}},onError:(e,t)=>{t.openFor===N.current&&(R(e)?(fe(null),f.refetch().then(e=>{e.isSuccess&&fe(ue(e.data))})):j({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+m.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-heading-16 text-heading`,children:H.heading}),(0,V.jsx)(A,{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&&!x?(0,V.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:!v,onClick:L,children:H.edit}):null]})]}),k?(0,V.jsxs)(`p`,{role:k.tone===`negative`?`alert`:`status`,className:`mb-3 text-copy-14 ${k.tone===`negative`?`text-negative`:`text-positive`}`,children:[k.text,k.review?(0,V.jsxs)(V.Fragment,{children:[` `,ge]}):null]}):te&&!x?(0,V.jsxs)(`p`,{role:`status`,className:`mb-3 text-copy-14 text-caution`,children:[H.pending,` `,ge]}):null,x?(0,V.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!W.isPending&&W.mutate({names:{aliases:P,identityAliases:se},base:D,openFor:M})},children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`${l}-names`,className:`block text-label-14-strong text-heading`,children:H.names}),(0,V.jsx)(`p`,{id:`${l}-names-hint`,className:`text-copy-14 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-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${l}-names-hint${ce.length?` ${l}-names-issues`:``}`,value:w,onChange:e=>ie(e.target.value)}),(0,V.jsx)(he,{id:`${l}-names-issues`,issues:ce}),P.length===0?(0,V.jsx)(`p`,{className:`mt-2 text-copy-14 text-caution`,children:H.noNames}):null]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:`${l}-qualified`,className:`block text-label-14-strong text-heading`,children:H.qualifiedNames}),(0,V.jsx)(`p`,{id:`${l}-qualified-hint`,className:`text-copy-14 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-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${l}-qualified-hint ${l}-qualified-note${le.length?` ${l}-qualified-issues`:``}`,value:T,onChange:e=>E(e.target.value)}),(0,V.jsx)(he,{id:`${l}-qualified-issues`,issues:le}),(0,V.jsx)(`p`,{id:`${l}-qualified-note`,className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:H.qualifiedNote})]}),(0,V.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:H.draftOnly}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(de,{type:`submit`,className:`h-11 px-4 text-label-14 md:h-11`,disabled:W.isPending,children:W.isPending?H.saving:H.save}),(0,V.jsx)(_,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:W.isPending,onClick:()=>{C(!1),j(null)},children:H.cancel})]})]}):K===0?(0,V.jsx)(`p`,{className:`text-copy-14 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,m.length>0?(0,V.jsx)(me,{label:H.qualifiedNames,names:m}):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:x,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)(v,{tone:`neutral`,children:`Not measured`}),(0,V.jsx)(`span`,{className:`text-label-12 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)(v,{tone:`neutral`,children:`Not mentioned`}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-label-12 text-muted`,children:[F.label,(0,V.jsx)(A,{text:F.property})]})]}):(0,V.jsx)(v,{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)(v,{tone:`neutral`,children:`Not measured`}),(0,V.jsx)(`span`,{className:`text-label-12 text-muted`,children:`Sources were not fully captured`})]}):(0,V.jsx)(v,{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-copy-14 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-copy-14 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-label-14 text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[ae,` (`,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)(v,{tone:J[e.classification].tone,children:J[e.classification].label})}),(0,V.jsx)(`td`,{children:(0,V.jsx)(I,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function we({project:e,targetKey:t,resultId:n}){let r=a({...T({client:h,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,V.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,V.jsx)(`p`,{className:`py-2 text-copy-14 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-copy-14 text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,V.jsx)(`div`,{className:`py-2`,children:(0,V.jsx)(N,{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-label-18-strong text-secondary`:`text-label-14-strong text-secondary`,children:`Not measured`}),(0,V.jsx)(`span`,{className:`text-label-14 text-secondary`,children:Te(e)})]});let r=m(e.value),i=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,a=b(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-label-18-strong text-heading`:`text-label-14-strong text-primary`,children:r}),i?(0,V.jsx)(`span`,{className:`text-label-12 text-muted`,children:i}):null,a?(0,V.jsx)(`span`,{className:`-ml-2 flex`,children:(0,V.jsx)(A,{tone:`caution`,placement:`bottom`,label:a.label,text:a.text})}):null]})}function Ee(e,t,n){return E({client:h,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 ${O(k(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-heading-16 text-heading`,children:[`Measured at the market level`,(0,V.jsx)(A,{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)(_,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,V.jsx)(u,{to:`/projects/$projectName`,params:{projectName:e},search:e=>P(j(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-label-14 text-strong`,children:[e.label,(0,V.jsxs)(`span`,{className:`ml-2 text-label-12 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-copy-16-strong 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-copy-16-strong 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}=y(m(t.value)),o=t.numerator===void 0||t.denominator===void 0?null:`${t.numerator} of ${t.denominator}`,s=b(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:(0,V.jsx)(A,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):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-heading-16 text-heading`,children:[`Named versus not named`,(0,V.jsx)(A,{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 text-label-14-strong text-heading`,children:q[e].headline}),(0,V.jsx)(`span`,{className:`mt-0.5 block text-label-12 text-muted`,children:q[e].technical}),t&&n?(0,V.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-label-14 text-caution`,children:[(0,V.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,V.jsxs)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-11 px-3 text-button-14 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-label-14 text-secondary`,children:[(0,V.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,V.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 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-label-14 text-secondary`,children:`Loading…`})}),(0,V.jsx)(`td`,{children:(0,V.jsx)(`span`,{className:`text-label-14 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-heading-16 text-heading`,children:[`Which engines answer for this Property`,(0,V.jsx)(A,{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-copy-14 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-copy-14 text-secondary`,children:`Loading…`}):e.providers.length===0?(0,V.jsxs)(`p`,{className:`text-copy-14 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:`text-label-14-strong 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({...D({client:h,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-heading-16 text-heading`,children:[`Named instead of this Property`,(0,V.jsx)(A,{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-copy-14 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)(A,{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-heading-16 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-copy-14 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-heading-16 text-heading`,children:[`URLs that count as this Property`,(0,V.jsx)(A,{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-copy-14 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:h,path:{name:e},query:{targetKey:t,queryClass:n,shape:ee[`other-queries`],limit:K,...r?{runId:r}:{}}},l=c({...w(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??[]),p=d[0]?.otherQueries?.totalEstimate??f.length,m=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-heading-16 text-heading`,children:Q.heading}),(0,V.jsx)(A,{text:Q.help})]}),l.data?(0,V.jsxs)(`p`,{className:`supporting-copy`,children:[p,` `,p===1?`answer`:`answers`,` · `,te,` · `,Q.notCounted]}):null]}),l.isPending?(0,V.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):l.isError&&f.length===0?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,V.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,V.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{l.refetch()},children:`Retry`})]}):f.length===0?(0,V.jsx)(`p`,{className:`text-copy-14 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=m(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-label-14-strong text-heading`,children:t.queryText}),(0,V.jsx)(`span`,{className:`mt-1 block text-label-12 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:j,className:`text-label-14 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)(I,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,V.jsxs)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,V.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:Q.partlySaved})]}),(0,V.jsx)(`td`,{className:`text-right`,children:(0,V.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse: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-label-14 text-secondary`,children:[(0,V.jsxs)(`span`,{children:[`Showing `,f.length,` of `,p]}),(0,V.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 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 ${L.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)(()=>oe(i),[i]),[p,m]=(0,B.useState)(new Set),g=e??``,y=t??``,b=!!g&&!!y,x=(0,B.useMemo)(()=>ce(`portfolio`,le(te())),[]),S=b&&x,{canWrite:re}=ne(),T=a({...ie({client:h,path:{name:g}}),enabled:S}),E=T.data?.active?.plan,D=E?.schemaVersion===2?E:null,O=d.queryClass===`branded`||d.queryClass===`non-brand`?d.queryClass:null,k=e=>D?.assignments.some(t=>t.targetKey===y&&t.queryClass===e)??!1,N=O??(!k(`non-brand`)&&k(`branded`)?`branded`:`non-brand`);(0,B.useEffect)(()=>{D&&!O&&r({to:`.`,replace:!0,search:e=>P(e,{queryClass:N})})},[D,O,N,r]);let F=a({...Ee(g,y,`branded`),enabled:S}),I=a({...Ee(g,y,`non-brand`),enabled:S}),de=De(F.data),L=De(I.data),R=N===`branded`?F.data:I.data,z=N===`branded`?de:L,H=(N===`branded`?F.isError:I.isError)&&z===void 0,U=R?.measurement.displayedRunId;ue(g,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:y,queryClass:N,limit:10,...U?{runId:U}:{}}});let W=z?.mentionCoverage.state===`unavailable`?Te(z.mentionCoverage):void 0,G=R===void 0?void 0:R.measurement.completedAt??null,pe=R!==void 0&&(R.measurement.state===`not_measured`||R.nextAction.kind===`run_measurement`),me=e=>P(j(e),{measurementScope:`property`,measurementScopeKey:y,queryClass:N,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),he=a({...C({client:h,path:{name:g},query:se(oe(me(i)))}),enabled:S&&pe,retry:!1}).data,_e=he!==void 0&&he.selection.measurement.measuredRevision!==null&&(he.populations.find(e=>e.queryClass===N)?.summary.queryCount??0)>0,J={client:h,path:{name:g},query:{targetKey:y,queryClass:N,shape:ee.answers,limit:K,...U?{runId:U}:{}}},Y=c({...w(J),enabled:S&&R!==void 0,initialPageParam:J,getNextPageParam:e=>e.answers?.nextCursor?{path:J.path,query:{...J.query,cursor:e.answers.nextCursor}}:void 0}),X=T.data?.active??null,Z=X?.plan.schemaVersion===2?X.plan:null,Ne=X!==null&&Z===null,Q=Z?.targets.find(e=>e.stableKey===y)??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===y&&e.queryClass===N).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[Z,y,N]),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(y))??[],[Z,y]),$=(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:g},search:j,className:`inline-flex items-center gap-1 text-label-12 text-muted hover:text-strong`,children:[(0,V.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!b)return(0,V.jsx)(`div`,{className:`page-container`,children:(0,V.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or Property key in URL.`})});if(!x)return(0,V.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,V.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`This view is not available here.`})]});if(T.isPending&&!T.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=T.isError&&T.data===void 0,Ye=F.isError&&F.data===void 0,Xe=I.isError&&I.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-copy-14 text-negative`,children:`Could not load this Property.`}),(0,V.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{T.refetch(),F.refetch(),I.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-copy-14 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)(_,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,V.jsx)(u,{to:`/projects/$projectName/portfolio`,params:{projectName:g},children:re?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 `,g,ze?(0,V.jsxs)(V.Fragment,{children:[` · Filters not applied `,(0,V.jsx)(A,{text:ze})]}):null]})]}),(0,V.jsxs)(`div`,{className:`page-header-right`,children:[R?(0,V.jsx)(v,{tone:ve[R.measurement.state].tone,children:ve[R.measurement.state].label}):null,z&&z.flags>0?(0,V.jsxs)(v,{tone:`caution`,children:[z.flags,` flagged`]}):null]})]}),(0,V.jsx)(Ae,{branded:de,nonBrand:L,brandedFailed:Ye,nonBrandFailed:Xe}),(0,V.jsx)(je,{branded:de,nonBrand:L,brandedError:F.isError,nonBrandError:I.isError,onRetry:e=>{e===`branded`?F.refetch():I.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-copy-14 text-secondary`,children:f()?M:re?`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)(_,{asChild:!0,type:`button`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,V.jsx)(u,{to:`/projects/$projectName`,params:{projectName:g},search:_e?me:j,children:_e?`See the last results`:re?`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-label-14-strong text-heading`,children:`Query type`}),(0,V.jsxs)(`select`,{id:`property-query-class`,value:N,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>P(e,{queryClass:t})})},className:`h-11 rounded-md border border-default bg-surface px-3 text-label-14 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:N})]}),(0,V.jsx)(Me,{row:z,queryClass:N,isError:H}),(0,V.jsx)(Pe,{project:g,targetKey:y,queryClass:N}),(0,V.jsx)(Fe,{questions:Be,queryClass:N}),(0,V.jsx)(ge,{projectName:g,targetKey:y,published:Q,activeRevision:X.revision,publishedBrandNames:Z.identities.projectBrand.names}),(0,V.jsx)(Ie,{urls:Ve}),(0,V.jsx)(ke,{project:g,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-heading-16 text-heading`,children:[`Answers the engines gave`,(0,V.jsx)(A,{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-copy-14 text-secondary`,children:[`Evidence for `,q[N].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):Y.isPending&&$.length===0?(0,V.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading evidence…`}):Y.isError&&$.length===0?(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,V.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,V.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{Y.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,V.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:f()?M:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,V.jsx)(`p`,{role:`alert`,className:`text-copy-14 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-copy-14 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=p.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-heading-14 text-heading`,children:e.queryText}),(0,V.jsx)(`span`,{className:`mt-1 block text-label-12 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)(v,{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:ae}),e.cited===null?xe:e.sources.length]}),(0,V.jsx)(`td`,{className:`text-right`,children:(0,V.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse: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:()=>m(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:g,targetKey:y,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-label-14 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)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:Y.isFetchingNextPage,onClick:()=>{Y.fetchNextPage()},children:Y.isFetchingNextPage?`Loading…`:Y.isFetchNextPageError?`Retry more evidence`:`Show ${K} more`})]}):null]})]}),R?(0,V.jsx)(Le,{project:g,targetKey:y,queryClass:N,runId:U,targetLabels:He}):null]})}export{J as EVIDENCE_LABELS,ze as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ct as t}from"./vendor-lucide-Bo69m9KC.js";import{r as n}from"./vendor-markdown-BiRP51B0.js";import{u as r}from"./vendor-tanstack-tBjrfzKu.js";import{Ji as i,_ as a,_n as o,b as s,gn as c,r as l,t as u,v as d,z as f,zt as p}from"./ToneBadge-B3rD6bDF.js";import{t as m}from"./async-handler-Bj3TnIRw.js";import{d as h}from"./query-client-DjRrRIsq.js";import{t as g}from"./card-CgdGerYK.js";import{$ as _,R as v,cn as y,h as b,in as x,nt as S,rt as C}from"./index-BrHemYsG.js";var w=e(t(),1),T=n();function E({onSaved:e}){let[t,n]=(0,w.useState)(``),[r,i]=(0,w.useState)(``),[s,c]=(0,w.useState)(!1),[u,f]=(0,w.useState)(null),[g,_]=(0,w.useState)(!1),v=t.trim().length>0&&r.trim().length>0,y=typeof window>`u`?void 0:p(window.location,window.__CANONRY_CONFIG__?.basePath),b=y?d(y):void 0,x=y?a(y):void 0;async function S(){if(v){c(!0),f(null),_(!1);try{await o({clientId:t.trim(),clientSecret:r.trim()}),n(``),i(``),_(!0),h({title:`Google OAuth app updated`,detail:`Dashboard Google credentials were saved.`,tone:`positive`,dedupeKey:`settings:google-oauth`,dedupeMode:`replace`}),e()}catch(e){f(e instanceof Error?e.message:`Failed to update Google OAuth credentials`)}finally{c(!1)}}}return(0,T.jsxs)(`div`,{className:`mt-3 material-base p-3 space-y-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-id`,children:`Client ID`}),(0,T.jsxs)(`a`,{href:`https://console.cloud.google.com/apis/credentials`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:[`Google Cloud `,`↗`]})]}),(0,T.jsx)(`input`,{id:`google-client-id`,type:`text`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client ID`,value:t,onChange:e=>n(e.target.value)})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-secret`,children:`Client secret`}),(0,T.jsx)(`input`,{id:`google-client-secret`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client secret`,value:r,onChange:e=>i(e.target.value)})]}),b&&x&&(0,T.jsxs)(`div`,{className:`material-base px-3 py-2`,children:[(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Authorized redirect URIs`}),(0,T.jsxs)(`dl`,{className:`mt-1 space-y-2 text-label-12`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-muted`,children:`Search Console and Business Profile`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`code`,{className:`block break-all text-strong`,children:b})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-muted`,children:`Google Ads and Tag Manager`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`code`,{className:`block break-all text-strong`,children:x})})]})]})]}),u&&(0,T.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:u}),g&&(0,T.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Google OAuth credentials updated.`}),(0,T.jsx)(l,{type:`button`,size:`sm`,disabled:!v||s,onClick:m(S),children:s?`Saving...`:`Save Google OAuth app`})]})}function D(e){let t=e.replace(/^Error:\s*/,``).replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`Unknown error`}function O(){let[e,t]=(0,w.useState)(null),[n,r]=(0,w.useState)(null),[a,o]=(0,w.useState)(!1),[c,d]=(0,w.useState)(`localhost`),[p,_]=(0,w.useState)(`9222`),[v,y]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{f().then(e=>{t(e),r(null)}).catch(e=>{let t=i(e);t.includes(`501`)||r(t)})},[]),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Browser provider`}),(0,T.jsx)(`h2`,{children:`ChatGPT (CDP)`})]}),(0,T.jsx)(u,{tone:e?.connected?`positive`:`caution`,children:e?.connected?`Connected`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 ${n?`text-negative`:`text-secondary`}`,role:n?`alert`:void 0,children:n?(0,T.jsxs)(T.Fragment,{children:[`Could not check Chrome: `,D(n),`. Check that Chrome is running with remote debugging, then configure the endpoint.`]}):e?.connected?`Chrome is available for this provider.`:`Connect Chrome to enable this provider.`}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[e?.endpoint&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Endpoint`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:e.endpoint})]}),e?.browserVersion&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Browser`}),(0,T.jsx)(`dd`,{className:`text-label-12`,children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Tabs`}),(0,T.jsx)(`dd`,{children:e.targets.map(e=>(0,T.jsxs)(`span`,{className:`mr-2`,children:[e.name,`: `,e.alive?`● alive`:`○ idle`]},e.name))})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(!a),children:a?`Cancel`:e?.connected?`Update endpoint`:`Configure`})}),a&&(0,T.jsxs)(`form`,{className:`mt-3 flex flex-col gap-2`,onSubmit:m(async e=>{e.preventDefault(),y(!0);try{await s(c,parseInt(p,10)||9222);let e=await f();t(e),r(null),o(!1),h({title:`CDP endpoint saved`,detail:`${c}:${parseInt(p,10)||9222} is now configured.`,tone:`positive`,dedupeKey:`settings:cdp`,dedupeMode:`replace`})}catch(e){r(i(e))}finally{y(!1)}}),children:[(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(`input`,{className:`flex-1 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`localhost`,value:c,onChange:e=>d(e.target.value),"aria-label":`CDP host`}),(0,T.jsx)(`input`,{className:`w-24 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`9222`,value:p,onChange:e=>_(e.target.value),"aria-label":`CDP port`})]}),(0,T.jsx)(`div`,{children:(0,T.jsx)(l,{type:`submit`,size:`sm`,disabled:v,children:v?`Saving…`:`Save endpoint`})})]})]})}var k={apiStatus:{label:`API`,state:`checking`,detail:`Checking service health`},workerStatus:{label:`Worker`,state:`checking`,detail:`Checking service health`}};function A(e){return e.name===`openrouter`||e.kind===`model-gateway`||e.kind===`answer-service`}function j(e){let t=e.displayName??e.name;return e.kind===`answer-service`?{connected:`${t} connected. Projects use it only where you choose its profiles.`,choose:`Choose project profiles`}:{connected:`${t} connected. Choose the models for each project.`,choose:`Choose project models`}}function M(){return(0,T.jsx)(v,{title:`Settings`,children:(0,T.jsx)(N,{})})}function N(){let e=C(),{dashboard:t}=S(),n=t?.settings??e?.dashboard?.settings,i=_(!e,e?.health).data??e?.health??k,[a,o]=(0,w.useState)(null),[s,d]=(0,w.useState)(new Set),[f,p]=(0,w.useState)(``),[v,D]=(0,w.useState)(!1),[M,N]=(0,w.useState)(!1),[P,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(!1);if(!n)return null;let H=t?.projects??e?.dashboard?.projects??[],U=f||H[0]?.project.name;return(0,T.jsxs)(`div`,{className:`page-container`,children:[(0,T.jsx)(`div`,{className:`page-header`,children:(0,T.jsxs)(`div`,{className:`page-header-left`,children:[(0,T.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,T.jsx)(`p`,{className:`page-subtitle`,children:`Connections and answer engines.`})]})}),(0,T.jsxs)(`section`,{className:`space-y-6`,children:[(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Answer engines`}),(0,T.jsx)(`h2`,{children:`Providers`})]})}),(0,T.jsx)(`div`,{className:`divide-y divide-default border-y border-default`,children:n.providerStatuses.map(e=>(0,T.jsxs)(`div`,{id:`provider-${e.name}`,className:`scroll-mt-24 py-4`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:e.displayName??e.name}),(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:e.detail})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(u,{tone:e.state===`ready`?`positive`:`caution`,children:e.state===`ready`?`Ready`:`Not connected`}),(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(a===e.name?null:e.name),children:a===e.name?`Cancel`:e.state===`ready`?`Update`:`Configure`})]})]}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[!A(e)&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Model`}),(0,T.jsxs)(`dd`,{className:`text-label-12-mono`,children:[e.model??e.defaultModel??`unknown`,!e.model&&e.defaultModel&&(0,T.jsx)(`span`,{className:`ml-1 font-sans text-muted`,children:`(default)`})]})]}),e.quota&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Concurrency`}),(0,T.jsx)(`dd`,{children:e.quota.maxConcurrency})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Rate limit`}),(0,T.jsxs)(`dd`,{children:[e.quota.maxRequestsPerMinute,`/min · `,e.quota.maxRequestsPerDay,`/day`]})]})]})]})]}),a===e.name&&(0,T.jsx)(b,{providerName:e.name,keyUrl:e.keyUrl,modelHint:e.modelHint,...e.kind?{kind:e.kind}:{},onSaved:()=>{o(null),A(e)&&d(t=>new Set([...t,e.name]))}}),A(e)&&(e.state===`ready`||s.has(e.name))&&(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-3`,children:[(0,T.jsx)(`p`,{role:s.has(e.name)?`status`:void 0,className:`w-full text-copy-14 text-secondary`,children:j(e).connected}),H.length>1&&(0,T.jsxs)(`label`,{className:`text-label-14 text-secondary`,children:[`Project`,(0,T.jsx)(`select`,{className:`setup-input ml-2`,value:U,onChange:e=>p(e.target.value),children:H.map(e=>(0,T.jsx)(`option`,{value:e.project.name,children:e.project.displayName??e.project.name},e.project.name))})]}),(0,T.jsx)(l,{type:`button`,variant:`outline`,asChild:!0,children:U?(0,T.jsx)(r,{to:`/projects/$projectName/settings`,params:{projectName:U},hash:`answer-engines`,children:j(e).choose}):(0,T.jsx)(r,{to:`/setup`,children:`Create a project`})})]})]},e.name))})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Connections`}),(0,T.jsx)(`h2`,{children:`Search and browser`})]})}),(0,T.jsxs)(`div`,{className:`settings-grid`,children:[(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Google`}),(0,T.jsx)(`h2`,{children:`Google OAuth`})]}),(0,T.jsx)(u,{tone:n.google.state===`ready`?`positive`:`caution`,children:n.google.state===`ready`?`Ready`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:n.google.detail}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Auth model`}),(0,T.jsx)(`dd`,{children:`One app credential set for Search Console, Business Profile, Google Ads, and Tag Manager`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Storage`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:`~/.canonry/config.yaml`})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>D(!v),children:v?`Cancel`:n.google.state===`ready`?`Update OAuth app`:`Configure Google OAuth`})}),v&&(0,T.jsx)(E,{onSaved:()=>{D(!1)}})]}),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Bing`}),(0,T.jsx)(`h2`,{children:`Webmaster Tools`})]}),(0,T.jsx)(u,{tone:n.bing.state===`ready`?`positive`:`caution`,children:n.bing.state===`ready`?`Ready`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:n.bing.detail}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Auth model`}),(0,T.jsx)(`dd`,{children:`API key authentication. OAuth is not required.`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Storage`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:`~/.canonry/config.yaml`})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>N(!M),children:M?`Cancel`:n.bing.state===`ready`?`Update API key`:`Configure Bing`})}),M&&(0,T.jsxs)(`div`,{className:`mt-3 material-base p-3 space-y-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`bing-api-key`,children:`API key`}),(0,T.jsx)(`a`,{href:`https://www.bing.com/webmasters/`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:`Bing Webmaster Tools`})]}),(0,T.jsx)(`input`,{id:`bing-api-key`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Bing Webmaster Tools API key`,value:P,onChange:e=>F(e.target.value)})]}),(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Used for project-level Bing connections.`}),R&&(0,T.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:R}),B&&(0,T.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Bing API key updated.`}),(0,T.jsx)(l,{type:`button`,size:`sm`,disabled:!P.trim()||I,onClick:m(async()=>{if(P.trim()){L(!0),z(null),V(!1);try{await c(P.trim()),F(``),V(!0),N(!1),h({title:`Bing API key updated`,detail:`Dashboard Bing credentials were saved.`,tone:`positive`,dedupeKey:`settings:bing`,dedupeMode:`replace`})}catch(e){z(e instanceof Error?e.message:`Failed to update Bing API key`)}finally{L(!1)}}}),children:I?`Saving...`:`Save Bing API key`})]})]}),(0,T.jsx)(O,{})]})]}),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Service health`}),(0,T.jsx)(`h2`,{children:`API and worker`})]})}),(0,T.jsxs)(`div`,{className:`compact-stack`,children:[(0,T.jsxs)(`div`,{className:`health-row`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`run-row-title`,children:`API`}),i.apiStatus.state!==`ok`&&(0,T.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:x(i.apiStatus)})]}),(0,T.jsx)(u,{tone:y(i.apiStatus),title:x(i.apiStatus),children:i.apiStatus.state===`ok`?`Healthy`:`Attention`})]}),(0,T.jsxs)(`div`,{className:`health-row`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`run-row-title`,children:`Worker`}),i.workerStatus.state!==`ok`&&(0,T.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:x(i.workerStatus)})]}),(0,T.jsx)(u,{tone:y(i.workerStatus),title:x(i.workerStatus),children:i.workerStatus.state===`ok`?`Healthy`:i.workerStatus.state===`disabled`?`Disabled`:`Attention`})]})]})]})]}),(0,T.jsxs)(`details`,{className:`page-section`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong`,children:`Self-hosting details`}),(0,T.jsxs)(g,{className:`surface-card mt-3`,children:[(0,T.jsx)(`ul`,{className:`detail-list`,children:n.selfHostNotes.map(e=>(0,T.jsx)(`li`,{children:e},e))}),(0,T.jsx)(`p`,{className:`supporting-copy`,children:n.bootstrapNote})]})]})]})}export{M as SettingsPage};