@things-factory/survey 0.0.0-stage → 10.1.316

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.
Files changed (81) hide show
  1. package/dist-client/index.d.ts +1 -0
  2. package/dist-client/index.js +2 -0
  3. package/dist-client/pages/my-surveys.d.ts +24 -0
  4. package/dist-client/pages/my-surveys.js +256 -0
  5. package/dist-client/pages/survey-editor.d.ts +62 -0
  6. package/dist-client/pages/survey-editor.js +668 -0
  7. package/dist-client/pages/survey-list.d.ts +15 -0
  8. package/dist-client/pages/survey-list.js +150 -0
  9. package/dist-client/pages/survey-trustee.d.ts +21 -0
  10. package/dist-client/pages/survey-trustee.js +170 -0
  11. package/dist-client/route.d.ts +1 -0
  12. package/dist-client/route.js +17 -0
  13. package/dist-client/utils/survey-api.d.ts +16 -0
  14. package/dist-client/utils/survey-api.js +46 -0
  15. package/dist-client/utils/survey-result.d.ts +4 -0
  16. package/dist-client/utils/survey-result.js +79 -0
  17. package/dist-client/utils/survey-secret.d.ts +40 -0
  18. package/dist-client/utils/survey-secret.js +154 -0
  19. package/dist-server/index.d.ts +2 -0
  20. package/dist-server/index.js +27 -0
  21. package/dist-server/role-tasks.d.ts +2 -0
  22. package/dist-server/role-tasks.js +16 -0
  23. package/dist-server/service/index.d.ts +16 -0
  24. package/dist-server/service/index.js +30 -0
  25. package/dist-server/service/refusal.d.ts +57 -0
  26. package/dist-server/service/refusal.js +66 -0
  27. package/dist-server/service/survey/ballot-route.d.ts +1 -0
  28. package/dist-server/service/survey/ballot-route.js +30 -0
  29. package/dist-server/service/survey/ballot-worker.d.ts +1 -0
  30. package/dist-server/service/survey/ballot-worker.js +19 -0
  31. package/dist-server/service/survey/index.d.ts +10 -0
  32. package/dist-server/service/survey/index.js +14 -0
  33. package/dist-server/service/survey/survey-answer.d.ts +23 -0
  34. package/dist-server/service/survey/survey-answer.js +99 -0
  35. package/dist-server/service/survey/survey-attributes.d.ts +16 -0
  36. package/dist-server/service/survey/survey-attributes.js +39 -0
  37. package/dist-server/service/survey/survey-ballot.d.ts +14 -0
  38. package/dist-server/service/survey/survey-ballot.js +61 -0
  39. package/dist-server/service/survey/survey-class-key.d.ts +20 -0
  40. package/dist-server/service/survey/survey-class-key.js +92 -0
  41. package/dist-server/service/survey/survey-question.d.ts +27 -0
  42. package/dist-server/service/survey/survey-question.js +113 -0
  43. package/dist-server/service/survey/survey-resolver.d.ts +37 -0
  44. package/dist-server/service/survey/survey-resolver.js +492 -0
  45. package/dist-server/service/survey/survey-respondent.d.ts +17 -0
  46. package/dist-server/service/survey/survey-respondent.js +81 -0
  47. package/dist-server/service/survey/survey-rules.d.ts +169 -0
  48. package/dist-server/service/survey/survey-rules.js +299 -0
  49. package/dist-server/service/survey/survey-secret.d.ts +133 -0
  50. package/dist-server/service/survey/survey-secret.js +347 -0
  51. package/dist-server/service/survey/survey-service.d.ts +83 -0
  52. package/dist-server/service/survey/survey-service.js +384 -0
  53. package/dist-server/service/survey/survey-trustee.d.ts +25 -0
  54. package/dist-server/service/survey/survey-trustee.js +119 -0
  55. package/dist-server/service/survey/survey-types.d.ts +91 -0
  56. package/dist-server/service/survey/survey-types.js +319 -0
  57. package/dist-server/service/survey/survey.d.ts +47 -0
  58. package/dist-server/service/survey/survey.js +214 -0
  59. package/dist-shared/ballot.d.ts +54 -0
  60. package/dist-shared/ballot.js +146 -0
  61. package/dist-shared/blind-rsa.d.ts +18 -0
  62. package/dist-shared/blind-rsa.js +127 -0
  63. package/dist-shared/elgamal.d.ts +20 -0
  64. package/dist-shared/elgamal.js +54 -0
  65. package/dist-shared/group.d.ts +22 -0
  66. package/dist-shared/group.js +112 -0
  67. package/dist-shared/proofs.d.ts +20 -0
  68. package/dist-shared/proofs.js +94 -0
  69. package/dist-shared/threshold.d.ts +39 -0
  70. package/dist-shared/threshold.js +98 -0
  71. package/dist-shared/verify.d.ts +13 -0
  72. package/dist-shared/verify.js +73 -0
  73. package/package.json +63 -4
  74. package/things-factory.config.js +15 -0
  75. package/translations/en.json +202 -0
  76. package/translations/es.json +202 -0
  77. package/translations/ja.json +202 -0
  78. package/translations/ko.json +202 -0
  79. package/translations/ms.json +202 -0
  80. package/translations/zh.json +202 -0
  81. package/README.md +0 -3
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verificationKeyOf = exports.publicKeyOf = exports.shareMatches = void 0;
4
+ exports.deal = deal;
5
+ exports.shareFor = shareFor;
6
+ exports.committedShare = committedShare;
7
+ exports.dealingStands = dealingStands;
8
+ exports.sealShare = sealShare;
9
+ exports.openShare = openShare;
10
+ exports.partialOf = partialOf;
11
+ exports.partialStands = partialStands;
12
+ exports.lagrangeAtZero = lagrangeAtZero;
13
+ exports.combine = combine;
14
+ const group_1 = require("./group");
15
+ const proofs_1 = require("./proofs");
16
+ function deal(threshold, context) {
17
+ if (!Number.isInteger(threshold) || threshold < 1)
18
+ throw new Error('a threshold of one or more');
19
+ const coefficients = Array.from({ length: threshold }, () => (0, group_1.randomScalar)());
20
+ const commitments = coefficients.map(group_1.gPow);
21
+ return { coefficients, commitments, proof: (0, proofs_1.proveKnowsLog)(commitments[0], coefficients[0], context) };
22
+ }
23
+ /** f(j) - the share for key holder j (1-based). */
24
+ function shareFor(coefficients, j) {
25
+ let out = 0n;
26
+ for (let k = coefficients.length - 1; k >= 0; k--)
27
+ out = (0, group_1.mod)(out * BigInt(j) + coefficients[k], group_1.Q);
28
+ return out;
29
+ }
30
+ /** g^{f(j)} from a dealer's commitments - what a share must match. */
31
+ function committedShare(commitments, j) {
32
+ let out = 1n;
33
+ let power = 1n;
34
+ for (const c of commitments) {
35
+ out = (out * (0, group_1.modPow)(c, power, group_1.P)) % group_1.P;
36
+ power = (0, group_1.mod)(power * BigInt(j), group_1.Q);
37
+ }
38
+ return out;
39
+ }
40
+ const shareMatches = (commitments, j, share) => (0, group_1.gPow)(share) === committedShare(commitments, j);
41
+ exports.shareMatches = shareMatches;
42
+ function dealingStands(commitments, proof, threshold, context) {
43
+ return commitments.length === threshold && commitments.every(group_1.isElement) && (0, proofs_1.verifyKnowsLog)(commitments[0], proof, context);
44
+ }
45
+ /** The survey's public key - the product of every dealer's g^{a_0}. */
46
+ const publicKeyOf = (dealers) => dealers.reduce((out, commitments) => (out * commitments[0]) % group_1.P, 1n);
47
+ exports.publicKeyOf = publicKeyOf;
48
+ /** Key holder j's verification key g^{s_j}, s_j being the sum of the shares dealt to j. */
49
+ const verificationKeyOf = (dealers, j) => dealers.reduce((out, commitments) => (out * committedShare(commitments, j)) % group_1.P, 1n);
50
+ exports.verificationKeyOf = verificationKeyOf;
51
+ const maskOf = (k, context) => (0, group_1.hashToScalar)('share-mask', context, k);
52
+ function sealShare(transportKey, share, context) {
53
+ const k = (0, group_1.randomScalar)();
54
+ return { u: (0, group_1.hex)((0, group_1.gPow)(k)), v: (0, group_1.hex)((0, group_1.mod)(share + maskOf((0, group_1.modPow)(transportKey, k, group_1.P), context), group_1.Q)) };
55
+ }
56
+ function openShare(transportSecret, sealed, context) {
57
+ const u = (0, group_1.fromHex)(sealed.u);
58
+ if (!(0, group_1.isElement)(u))
59
+ throw new Error('not a sealed share of this group');
60
+ return (0, group_1.mod)((0, group_1.fromHex)(sealed.v) - maskOf((0, group_1.modPow)(u, transportSecret, group_1.P), context), group_1.Q);
61
+ }
62
+ /** Key holder j's part of decrypting a ciphertext, with the proof it is theirs to give. */
63
+ function partialOf(c, index, secretShare, context) {
64
+ const d = (0, group_1.modPow)(c.a, secretShare, group_1.P);
65
+ return { index, d: (0, group_1.hex)(d), proof: (0, proofs_1.proveSameLog)((0, group_1.gPow)(secretShare), c.a, d, secretShare, context) };
66
+ }
67
+ function partialStands(c, partial, verificationKey, context) {
68
+ try {
69
+ const d = (0, group_1.fromHex)(partial.d);
70
+ return (0, group_1.isElement)(d) && (0, proofs_1.verifySameLog)(verificationKey, c.a, d, partial.proof, context);
71
+ }
72
+ catch {
73
+ return false;
74
+ }
75
+ }
76
+ /** λ_j at 0 for the holders in `indices`. */
77
+ function lagrangeAtZero(indices, j) {
78
+ let num = 1n;
79
+ let den = 1n;
80
+ for (const m of indices) {
81
+ if (m === j)
82
+ continue;
83
+ num = (0, group_1.mod)(num * BigInt(m), group_1.Q);
84
+ den = (0, group_1.mod)(den * BigInt(m - j), group_1.Q);
85
+ }
86
+ return (0, group_1.mod)(num * (0, group_1.invQ)(den), group_1.Q);
87
+ }
88
+ /** g^m from t partial decryptions - the sum is opened, nothing else. */
89
+ function combine(c, partials) {
90
+ const indices = partials.map(one => one.index);
91
+ if (new Set(indices).size !== indices.length)
92
+ throw new Error('a key holder counted twice');
93
+ let ax = 1n;
94
+ for (const one of partials)
95
+ ax = (ax * (0, group_1.modPow)((0, group_1.fromHex)(one.d), lagrangeAtZero(indices, one.index), group_1.P)) % group_1.P;
96
+ return (c.b * (0, group_1.invP)(ax)) % group_1.P;
97
+ }
98
+ //# sourceMappingURL=threshold.js.map
@@ -0,0 +1,13 @@
1
+ type Row = Record<string, any>;
2
+ export interface Check {
3
+ ok: boolean;
4
+ problems: string[];
5
+ checked: number;
6
+ }
7
+ /**
8
+ * Checks a secret survey's count from its bulletin alone: every token signed by its class key and used once, every
9
+ * ballot's proofs, no class over its issued tokens, the sums recomputed, every partial proven, and the result the
10
+ * decryption of the sums.
11
+ */
12
+ export declare function checkBulletin(bulletin: Row, progress?: (done: number, of: number) => void): Promise<Check>;
13
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkBulletin = checkBulletin;
4
+ /*
5
+ * Checking a secret survey's count from its bulletin alone (operato-survey design §6-5) - pure, so the browser, a
6
+ * verifier's own script and the tests run the same check.
7
+ */
8
+ const ballot_1 = require("./ballot");
9
+ const blind_rsa_1 = require("./blind-rsa");
10
+ const elgamal_1 = require("./elgamal");
11
+ const group_1 = require("./group");
12
+ const threshold_1 = require("./threshold");
13
+ const ballotContext = (surveyId, serial) => `survey:${surveyId}|ballot|${serial}`;
14
+ const tallyContext = (surveyId) => `survey:${surveyId}|tally`;
15
+ /**
16
+ * Checks a secret survey's count from its bulletin alone: every token signed by its class key and used once, every
17
+ * ballot's proofs, no class over its issued tokens, the sums recomputed, every partial proven, and the result the
18
+ * decryption of the sums.
19
+ */
20
+ async function checkBulletin(bulletin, progress) {
21
+ const problems = [];
22
+ const questions = bulletin.questions;
23
+ const h = (0, group_1.fromHex)(bulletin.publicKey);
24
+ const keys = new Map(bulletin.classKeys.map((one) => [one.weightClass, { n: (0, group_1.fromHex)(one.modulus), e: (0, group_1.fromHex)(one.exponent) }]));
25
+ const serials = new Set();
26
+ const cells = [];
27
+ const facts = bulletin.facts;
28
+ for (const [index, ballot] of bulletin.ballots.entries()) {
29
+ progress?.(index, bulletin.ballots.length);
30
+ await new Promise(resolve => setTimeout(resolve, 0));
31
+ const key = keys.get(ballot.weightClass);
32
+ if (!key || !(0, blind_rsa_1.verifyToken)(key, (0, blind_rsa_1.tokenMessage)(bulletin.surveyId, ballot.serial), (0, group_1.fromHex)(ballot.signature)))
33
+ problems.push(`token:${ballot.receipt}`);
34
+ if (serials.has(ballot.serial))
35
+ problems.push(`serial-twice:${ballot.serial}`);
36
+ serials.add(ballot.serial);
37
+ const opened = (0, ballot_1.openedCells)(h, questions, ballot.sealed, ballotContext(bulletin.surveyId, ballot.serial));
38
+ if (opened.problem)
39
+ problems.push(`proof:${ballot.receipt}`);
40
+ else
41
+ cells.push({ rate: facts?.figure === 'WEIGHTED' ? Number(facts.rates?.[ballot.weightClass] ?? 1) : 1, cells: opened.cells });
42
+ }
43
+ if (facts) {
44
+ for (const [weightClass, count] of Object.entries(facts.cast ?? {}))
45
+ if (count > (facts.issued?.[weightClass] ?? 0))
46
+ problems.push(`over-issued:${weightClass}`);
47
+ const sums = (0, ballot_1.weightedSums)(cells, questions).map(row => row.map(elgamal_1.cipherJson));
48
+ if (JSON.stringify(sums) !== JSON.stringify(bulletin.sums))
49
+ problems.push('sums');
50
+ }
51
+ if (bulletin.result && bulletin.sums) {
52
+ const dealers = bulletin.trustees.map((one) => one.dealing.commitments.map(group_1.fromHex));
53
+ const decrypted = bulletin.trustees.filter((one) => one.partials);
54
+ for (const one of decrypted) {
55
+ const vk = (0, threshold_1.verificationKeyOf)(dealers, one.seq);
56
+ const fine = bulletin.sums.every((row, n) => row.every((cell, k) => (0, threshold_1.partialStands)((0, elgamal_1.cipherOf)(cell), one.partials[n][k], vk, tallyContext(bulletin.surveyId))));
57
+ if (!fine)
58
+ problems.push(`partial:${one.seq}`);
59
+ }
60
+ const used = decrypted.slice(0, bulletin.threshold);
61
+ const figures = facts.figure === 'WEIGHTED' ? bulletin.result.weighted : bulletin.result.unweighted;
62
+ questions.forEach((question, n) => {
63
+ (0, ballot_1.cellsOf)(question).forEach((key, k) => {
64
+ const value = (0, elgamal_1.discreteLog)((0, threshold_1.combine)((0, elgamal_1.cipherOf)(bulletin.sums[n][k]), used.map((one) => one.partials[n][k])), (0, ballot_1.boundOf)(question, facts.ballots, facts.maxRate));
65
+ if (value !== figures?.[n]?.counts?.[key])
66
+ problems.push(`result:${question.id}:${key}`);
67
+ });
68
+ });
69
+ }
70
+ progress?.(bulletin.ballots.length, bulletin.ballots.length);
71
+ return { ok: !problems.length, problems, checked: bulletin.ballots.length };
72
+ }
73
+ //# sourceMappingURL=verify.js.map
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@things-factory/survey",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "10.1.316",
4
+ "main": "dist-server/index.js",
5
+ "browser": "dist-client/index.js",
6
+ "files": [
7
+ "dist-client",
8
+ "dist-server",
9
+ "dist-shared",
10
+ "things-factory.config.js",
11
+ "translations",
12
+ "!**/*.map",
13
+ "!**/*.test.*",
14
+ "!**/*.spec.*",
15
+ "!**/test/**",
16
+ "!**/tests/**",
17
+ "!**/__tests__/**",
18
+ "!**/*.tsbuildinfo",
19
+ "!**/.DS_Store"
20
+ ],
21
+ "things-factory": true,
22
+ "license": "MIT",
23
+ "author": "heartyoh <heartyoh@hatiolab.com>",
24
+ "description": "Surveys - named surveys, and secret weighted surveys whose answers nobody can tie to a person and whose count is checked without opening any answer (operato-survey)",
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "@things-factory:registry": "https://registry.npmjs.org"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/hatiolab/things-factory.git",
32
+ "directory": "packages/survey"
33
+ },
34
+ "scripts": {
35
+ "build": "npm run build:server && npm run build:client",
36
+ "build:server": "npm run build:shared && npm run clean:server && npx tsc --p ./server/tsconfig.json",
37
+ "clean:server": "rm -rf dist-server",
38
+ "clean": "npm run clean:server && npm run clean:client && rm -rf dist-shared",
39
+ "test": "npm run build:server && node --import ./test/resolve-ts-siblings.mjs --test test/*.test.ts test/*.test.mjs",
40
+ "copy:files": "copyfiles -e \"./client/**/*.{ts,js,json}\" -u 1 \"./client/**/*\" dist-client",
41
+ "build:client": "npm run build:shared && npm run clean:client && npm run copy:files && npx tsc --p ./client/tsconfig.json",
42
+ "clean:client": "rm -rf dist-client",
43
+ "build:shared": "npx tsc -p tsconfig.shared.json"
44
+ },
45
+ "dependencies": {
46
+ "@noble/hashes": "^1.1.5",
47
+ "@operato/graphql": "^10.29.69",
48
+ "@operato/i18n": "^10.0.0",
49
+ "@operato/input": "^10.29.69",
50
+ "@operato/layout": "^10.29.49",
51
+ "@operato/popup": "^10.29.39",
52
+ "@operato/shell": "^10.29.69",
53
+ "@operato/styles": "^10.29.1",
54
+ "@things-factory/auth-base": "^10.1.316",
55
+ "@things-factory/env": "^10.1.298",
56
+ "@things-factory/organization": "^10.1.316",
57
+ "@things-factory/shell": "^10.1.304",
58
+ "graphql-tag": "^2.12.6",
59
+ "lit": "^3.1.2"
60
+ },
61
+ "devDependencies": {
62
+ "@things-factory/conventions": "^10.1.304"
63
+ },
64
+ "gitHead": "8bdf4ae696ae7ec9c21312485f86f212052bb10a"
65
+ }
@@ -0,0 +1,15 @@
1
+ import route from './dist-client/route.js'
2
+
3
+ /*
4
+ * Surveys (operato-survey design §9) - the operator's list and editor, each person's own surveys, and a key holder's page. The host
5
+ * application puts them in its menu.
6
+ */
7
+ export default {
8
+ route,
9
+ routes: [
10
+ { tagname: 'survey-list', page: 'survey-list' },
11
+ { tagname: 'survey-editor', page: 'survey-editor' },
12
+ { tagname: 'my-surveys', page: 'my-surveys' },
13
+ { tagname: 'survey-trustee', page: 'survey-trustee' }
14
+ ]
15
+ }
@@ -0,0 +1,202 @@
1
+ {
2
+ "title.survey-list": "Surveys",
3
+ "title.survey-editor": "Survey",
4
+ "title.my-surveys": "My surveys",
5
+ "button.survey-new": "New survey",
6
+ "button.survey-open": "Open",
7
+ "button.survey-close": "Close",
8
+ "button.survey-count": "Count",
9
+ "button.survey-publish": "Publish",
10
+ "button.survey-cancel": "Cancel survey",
11
+ "button.survey-delete": "Delete",
12
+ "button.survey-add-question": "Add question",
13
+ "button.survey-back": "Back to list",
14
+ "button.survey-submit": "Submit answers",
15
+ "label.survey-name": "Title",
16
+ "label.survey-description": "Description",
17
+ "label.survey-level": "Secrecy",
18
+ "label.survey-level-named": "Named",
19
+ "label.survey-level-secret": "Secret",
20
+ "label.survey-status": "Status",
21
+ "label.survey-status-draft": "Draft",
22
+ "label.survey-status-keying": "Making keys",
23
+ "label.survey-status-open": "Open",
24
+ "label.survey-status-closed": "Closed",
25
+ "label.survey-status-decrypting": "Decrypting",
26
+ "label.survey-status-counted": "Counted",
27
+ "label.survey-status-published": "Published",
28
+ "label.survey-status-cancelled": "Cancelled",
29
+ "label.survey-closes-at": "Closes",
30
+ "label.survey-asked": "Asked",
31
+ "label.survey-result-readers": "Who reads the result",
32
+ "label.survey-readers-respondents": "Everyone asked",
33
+ "label.survey-readers-operators": "Operators only",
34
+ "label.survey-min-group": "Smallest group shown",
35
+ "label.survey-audience": "Who is asked",
36
+ "label.survey-excluded": "Not asked",
37
+ "label.survey-everyone": "Everyone working here",
38
+ "label.survey-department": "Department",
39
+ "label.survey-role": "Role",
40
+ "label.survey-person": "Person",
41
+ "label.survey-questions": "Questions",
42
+ "label.survey-kind-single": "Pick one",
43
+ "label.survey-kind-multi": "Pick several",
44
+ "label.survey-kind-scale": "Scale",
45
+ "label.survey-kind-allocate": "Split a total",
46
+ "label.survey-prompt": "Question",
47
+ "label.survey-scale-min": "Lowest",
48
+ "label.survey-scale-max": "Highest",
49
+ "label.survey-max-picks": "Most choices",
50
+ "label.survey-allocate-total": "Total",
51
+ "label.survey-published": "Published result",
52
+ "label.survey-count": "Count",
53
+ "label.survey-answer-sheets": "Who answered what",
54
+ "label.survey-respondent": "Respondent",
55
+ "label.survey-figure-weighted": "Weighted",
56
+ "text.survey-none": "No surveys yet.",
57
+ "text.my-surveys-none": "No survey asks you now.",
58
+ "text.survey-confirm-open": "Open \"{name}\"? The people it asks are listed now, and the survey can no longer be edited.",
59
+ "text.survey-confirm-publish": "Publish the result of \"{name}\"?",
60
+ "text.survey-confirm-cancel": "Cancel \"{name}\"?",
61
+ "text.survey-confirm-delete": "Delete the draft \"{name}\"?",
62
+ "text.survey-confirm-submit": "Submit your answers? They cannot be changed afterwards.",
63
+ "text.survey-add-audience": "Add whom to ask",
64
+ "text.survey-add-excluded": "Leave someone out",
65
+ "text.survey-options-one-per-line": "One choice per line",
66
+ "text.survey-secret-min-group": "A secret survey shows no figure from fewer than five people.",
67
+ "text.survey-taken-of-asked": "{taken} of {asked} answered",
68
+ "text.survey-count-not-published": "Only operators see this count until it is published.",
69
+ "text.survey-result-withheld": "{responded} answered - fewer than the smallest group shown, so no figure is published.",
70
+ "text.survey-result-responded": "{responded} answered",
71
+ "text.survey-scale-average": "Average {average}",
72
+ "text.survey-named-notice": "This is a named survey: the operators see who answered what.",
73
+ "text.survey-answered": "You have answered.",
74
+ "text.survey-pick-up-to": "Pick up to {count}.",
75
+ "text.survey-allocate-total": "Split {total} - now {sum}.",
76
+ "error.survey-unknown": "No such survey in this domain.",
77
+ "error.survey-step-not-now": "This survey is not at a step where that can be done.",
78
+ "error.survey-level-unknown": "A survey is named or secret.",
79
+ "error.survey-name-required": "Give the survey a title.",
80
+ "error.survey-no-questions": "A survey asks at least one question.",
81
+ "error.survey-question-prompt-required": "Question {seq} says nothing.",
82
+ "error.survey-question-kind-unknown": "Question {seq}: {kind} is not a question kind.",
83
+ "error.survey-question-scale-invalid": "Question {seq}: a scale runs from a lower whole number to a higher one.",
84
+ "error.survey-question-options-too-few": "Question {seq} offers at least two choices.",
85
+ "error.survey-question-option-blank": "Question {seq} has a blank choice.",
86
+ "error.survey-question-option-duplicate": "Question {seq} has two choices with the same key.",
87
+ "error.survey-question-max-picks-invalid": "Question {seq}: how many may be chosen is between 1 and {options}.",
88
+ "error.survey-question-total-invalid": "Question {seq}: the total to split is a whole number above zero.",
89
+ "error.survey-readers-required": "Choose who reads the published result.",
90
+ "error.survey-figure-unknown": "The published figure is weighted or unweighted.",
91
+ "error.survey-closes-at-past": "The closing time must be later than now.",
92
+ "error.survey-nobody-asked": "The audience names nobody working here.",
93
+ "error.survey-not-asked": "This survey does not ask you.",
94
+ "error.survey-answered": "You have already answered this survey.",
95
+ "error.survey-answer-missing": "Question {seq} is not answered.",
96
+ "error.survey-answer-invalid": "The answer to question {seq} does not fit it.",
97
+ "error.survey-not-named": "Only a named survey keeps who answered what.",
98
+ "title.survey-trustee": "Key holding",
99
+ "button.survey-keying": "Make the key",
100
+ "text.survey-confirm-keying": "Start making the key of \"{name}\"? Its key holders are named and its questions are fixed from now on.",
101
+ "button.survey-add-class": "Add class",
102
+ "button.survey-add-condition": "Add condition",
103
+ "button.survey-class-preview": "Count per class",
104
+ "button.survey-check-count": "Check the count",
105
+ "button.survey-check-receipt": "Check my receipt",
106
+ "button.survey-resend": "Send again",
107
+ "button.survey-trustee-transport": "Make my key file",
108
+ "button.survey-trustee-deal": "Deal my shares",
109
+ "button.survey-trustee-confirm": "Check the shares I received",
110
+ "button.survey-trustee-decrypt": "Open my part of the sums",
111
+ "label.survey-trustee-invited": "Named",
112
+ "label.survey-trustee-keyed": "Key file made",
113
+ "label.survey-trustee-dealt": "Shares dealt",
114
+ "label.survey-trustee-confirmed": "Shares checked",
115
+ "label.survey-trustee-decrypted": "Opened my part",
116
+ "label.survey-figure-unweighted": "Unweighted",
117
+ "label.survey-attr-tenure-years": "Years of service",
118
+ "label.survey-basis-date": "Attributes read on",
119
+ "label.survey-class-label": "Class name",
120
+ "label.survey-class-rate": "Rate",
121
+ "label.survey-cond-at-least": "at least",
122
+ "label.survey-cond-below": "below",
123
+ "label.survey-cond-true": "is yes",
124
+ "label.survey-cond-false": "is no",
125
+ "label.survey-key-file": "Key file",
126
+ "label.survey-passphrase": "Passphrase",
127
+ "label.survey-published-figure": "Published figure",
128
+ "label.survey-trustee-threshold": "Key holders needed to decrypt",
129
+ "label.survey-trustees": "Key holders",
130
+ "label.survey-weighting": "Weighting",
131
+ "label.survey-weighting-off": "One person, one vote",
132
+ "label.survey-weighting-on": "Weighted by class",
133
+ "text.survey-add-trustee": "Add a key holder",
134
+ "text.survey-answer-every-question": "Answer every question first.",
135
+ "text.survey-ballot-pending": "Your ballot was sealed and signed but has not been received yet.",
136
+ "text.survey-ballot-received": "Your ballot was received.",
137
+ "text.survey-bulletin-hash": "Bulletin fingerprint {hash}…",
138
+ "text.survey-check-failed": "The check found problems: {problems}",
139
+ "text.survey-check-ok": "Checked {count} ballots - the count holds.",
140
+ "text.survey-checking": "Checking {done} / {of}…",
141
+ "text.survey-class-rest": "Everyone not in a class above.",
142
+ "text.survey-key-file-needed": "Choose your key file and enter its passphrase first.",
143
+ "text.survey-key-file-other": "This key file belongs to another survey or key holder.",
144
+ "text.survey-key-file-saved": "Your key file was saved. Keep it and its passphrase - without them you cannot take part in the count.",
145
+ "text.survey-key-file-unreadable": "The key file does not open with this passphrase.",
146
+ "text.survey-passphrase-short": "Use a passphrase of at least eight characters.",
147
+ "text.survey-receipt": "Receipt {receipt}…",
148
+ "text.survey-receipt-listed": "Your ballot is on the bulletin.",
149
+ "text.survey-receipt-missing": "Your ballot is not on the bulletin - tell the operators.",
150
+ "text.survey-sealing": "Sealing your ballot…",
151
+ "text.survey-secret-notice": "This is a secret survey: nobody, operators included, can tie your answers to you. Only the final result is published.",
152
+ "text.survey-share-mismatch": "The share from key holder {dealer} does not match - tell the operators before going on.",
153
+ "text.survey-threshold-of": "{threshold} of {count} needed to decrypt",
154
+ "text.survey-token-taken": "You took your ballot token.",
155
+ "text.survey-trustee-intro": "Your key file and passphrase stay with you - the server never sees your secret. Keep both until the count is done.",
156
+ "text.survey-trustee-mine": "I am key holder {seq} - {step}",
157
+ "text.survey-trustee-none": "You hold no survey key.",
158
+ "text.survey-trustee-waiting": "Nothing for you to do now - waiting for the others or for the survey to move on.",
159
+ "text.survey-trustees-note": "Each key holder keeps a part of the key; this many of them together open the sums and nothing else.",
160
+ "text.survey-weighting-note": "Classes are read on the basis day; a person goes to the first class whose conditions hold. Every class needs at least the smallest group.",
161
+ "text.survey-working": "Working…",
162
+ "error.survey-weight-classes-too-few": "A weighting has at least two classes.",
163
+ "error.survey-weight-class-key-invalid": "Every class has its own key.",
164
+ "error.survey-weight-rate-invalid": "The rate of class {class} is a whole number of one or more.",
165
+ "error.survey-weight-attribute-unknown": "Class {class}: no attribute {attribute} is registered here.",
166
+ "error.survey-weight-condition-invalid": "Class {class}: a condition is one of equals, at least, below.",
167
+ "error.survey-weight-last-class-open": "The last class takes everyone left - it has no condition.",
168
+ "error.survey-weight-class-small": "Class {class} holds {size} - fewer than the smallest group of {min}.",
169
+ "error.survey-weight-unmatched": "{count} people asked fit no class.",
170
+ "error.survey-basis-date-required": "A weighted survey names the day attributes are read on.",
171
+ "error.survey-figure-required": "A weighted survey chooses the one set of figures it publishes.",
172
+ "error.survey-not-secret": "This is not a secret survey.",
173
+ "error.survey-not-trustee": "You are not a key holder of this survey.",
174
+ "error.survey-trustees-invalid": "Name the key holders and how many it takes to decrypt - at least one, at most all.",
175
+ "error.survey-trustees-not-ready": "The other key holders have not reached this step yet.",
176
+ "error.survey-trustee-step-done": "This step is not yours to take now.",
177
+ "error.survey-trustee-proof-invalid": "What was sent does not check out.",
178
+ "error.survey-keying-incomplete": "The key holders have not finished making the key.",
179
+ "error.survey-ballot-invalid": "This ballot does not check out.",
180
+ "error.survey-ballot-used": "This ballot token has been used.",
181
+ "error.survey-ballots-exceed-issued": "Class {class} holds more ballots than tokens issued to it - the count stops.",
182
+ "error.survey-decrypt-failed": "The sums did not open.",
183
+ "label.survey-rounds": "Rounds and publishing",
184
+ "label.survey-publish-top": "Publish only the top",
185
+ "label.survey-top-names": "By rank only",
186
+ "label.survey-top-figures": "With their figures",
187
+ "text.survey-top-choose": "How the top is shown",
188
+ "label.survey-follows": "Round before",
189
+ "label.survey-follows-none": "None",
190
+ "label.survey-carry-top": "Choices taken from it",
191
+ "label.survey-succession-depth": "Succession down to rank",
192
+ "text.survey-withdrawn-note": "Mark the choices of the round before that withdrew - only their names are shown here, never their ranks.",
193
+ "button.survey-carry-forward": "Take the choices",
194
+ "text.survey-top-place": "{rank}. {label}",
195
+ "error.survey-top-too-few": "Question {seq}: only {left} choices are left for a top {k}.",
196
+ "error.survey-top-tie": "Question {seq}: a tie across place {k} - who is in the top is not decided by this survey.",
197
+ "error.survey-top-figures-required": "Choose whether the top is published with its figures or by rank only.",
198
+ "error.survey-carry-unset": "Name the round before and how many choices to take from it.",
199
+ "error.survey-follows-not-counted": "The round before is not counted yet.",
200
+ "error.survey-carry-no-choices": "The round before has no question with choices first.",
201
+ "error.survey-succession-exhausted": "Not enough choices are left down to rank {depth}."
202
+ }