@rr0/ufoathome 0.132.0 → 0.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist-embed-interview/InterviewMessages_es-BJHVnSkP.js +1 -0
  2. package/dist-embed-interview/InterviewMessages_fr-Dhtz904e.js +1 -0
  3. package/dist-embed-interview/InterviewMessages_it-D0Dff5zn.js +1 -0
  4. package/dist-embed-interview/rr0-interview.mjs +6 -6
  5. package/dist-embed-scene/rr0-scene.mjs +58 -58
  6. package/dist-embed-scene/sightingSchema-DfbuP60Y.js +1 -0
  7. package/dist-embed-sighting/{CoverageAssessor-CZfxbN9A.js → CoverageAssessor-Dd6oOWlq.js} +1 -1
  8. package/dist-embed-sighting/{SightingMessages_es-OXYzPf-m.js → SightingMessages_es-CxoccMw6.js} +1 -1
  9. package/dist-embed-sighting/SightingMessages_fr-CdqAz1Hz.js +1 -0
  10. package/dist-embed-sighting/{SightingMessages_it-B9f92W5s.js → SightingMessages_it-CkQVXDPv.js} +1 -1
  11. package/dist-embed-sighting/rr0-sighting.mjs +311 -254
  12. package/dist-embed-sighting/sightingSchema-DfbuP60Y.js +1 -0
  13. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-DOGYqP24.js → AdsbLolArchiveProvider-DU2U8NdB.js} +1 -1
  14. package/dist-embed-sighting-editor/{BeamEditor-rgFtq8yH.js → BeamEditor-CCsp2xr2.js} +1 -1
  15. package/dist-embed-sighting-editor/{BeamSystem-CGcP-5uL.js → BeamSystem-BnI9L86u.js} +1 -1
  16. package/dist-embed-sighting-editor/{BodyEditor-TjnivtCI.js → BodyEditor-DtBz9fVX.js} +2 -2
  17. package/dist-embed-sighting-editor/CaseEditorMessages_es-BrH54rIz.js +1 -0
  18. package/dist-embed-sighting-editor/CaseEditorMessages_fr-DF-qjRtx.js +1 -0
  19. package/dist-embed-sighting-editor/CaseEditorMessages_it-Cb_U9B3i.js +1 -0
  20. package/dist-embed-sighting-editor/{ContrailSystem-C7wqDUfk.js → ContrailSystem-DugiVtAv.js} +1 -1
  21. package/dist-embed-sighting-editor/{CoverageAssessor-BbvPELCG.js → CoverageAssessor-DXVjXoUX.js} +1 -1
  22. package/dist-embed-sighting-editor/GLTFLoader-DLQh4lKb.js +1 -0
  23. package/dist-embed-sighting-editor/{HeadlightSystem-Dyh8W52L.js → HeadlightSystem-BEWiubrn.js} +1 -1
  24. package/dist-embed-sighting-editor/{HynekAssessor-TsYamQ6r.js → HynekAssessor-Bc2SulU3.js} +1 -1
  25. package/dist-embed-sighting-editor/InterviewEditorElement-bUyn6irj.js +229 -0
  26. package/dist-embed-sighting-editor/InterviewMessages_en-CRvWVmlL.js +1 -0
  27. package/dist-embed-sighting-editor/InterviewMessages_es-BJHVnSkP.js +1 -0
  28. package/dist-embed-sighting-editor/InterviewMessages_fr-Dhtz904e.js +1 -0
  29. package/dist-embed-sighting-editor/InterviewMessages_it-D0Dff5zn.js +1 -0
  30. package/dist-embed-sighting-editor/{LaserBeam-BxHm8xkN.js → LaserBeam-B6u7y0-E.js} +1 -1
  31. package/dist-embed-sighting-editor/{LaunchEditor-DrBVJxSe.js → LaunchEditor-qoB8RSgQ.js} +1 -1
  32. package/dist-embed-sighting-editor/ModelSource-CnDfgMtY.js +1 -0
  33. package/dist-embed-sighting-editor/{ModelThumbnails-BXnPtOMG.js → ModelThumbnails-CYHW7hxV.js} +1 -1
  34. package/dist-embed-sighting-editor/{ModelViewer-CMxc0zPv.js → ModelViewer-BzHV3bjz.js} +1 -1
  35. package/dist-embed-sighting-editor/RailwaySystem-CzPTp4PW.js +41 -0
  36. package/dist-embed-sighting-editor/{RoadMarkings-BHKxo_8h.js → RoadMarkings-BWoz2Cuq.js} +1 -1
  37. package/dist-embed-sighting-editor/{SceneNames_es-BQyea_Xf.js → SceneNames_es-7RR79EmC.js} +1 -1
  38. package/dist-embed-sighting-editor/{SceneNames_fr-DKRWoM54.js → SceneNames_fr-Da_S9KXa.js} +1 -1
  39. package/dist-embed-sighting-editor/{SceneNames_it-BcASO5PP.js → SceneNames_it-BwFZROII.js} +1 -1
  40. package/dist-embed-sighting-editor/SightingEditorMessages_es-Dw15ohkc.js +12 -0
  41. package/dist-embed-sighting-editor/SightingEditorMessages_fr-DmH_cDSV.js +12 -0
  42. package/dist-embed-sighting-editor/SightingEditorMessages_it-DcdM8wve.js +12 -0
  43. package/dist-embed-sighting-editor/{SightingFileEditor-BoJcuWFQ.js → SightingFileEditor-LAzFduCJ.js} +18 -17
  44. package/dist-embed-sighting-editor/{TraceSystem-DMeO0tBV.js → TraceSystem-Dgxizn7s.js} +2 -2
  45. package/dist-embed-sighting-editor/{WaterSystem-BFrSxN_o.js → WaterSystem-Bv5uZSRK.js} +1 -1
  46. package/dist-embed-sighting-editor/interviewSchema-7rMvPyAl.js +1 -0
  47. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +1199 -539
  48. package/dist-embed-sighting-editor/sightingSchema-DfbuP60Y.js +1 -0
  49. package/dist-embed-sighting-editor/surroundingsSources-B1931yh4.js +1 -0
  50. package/dist-embed-sighting-editor/{trafficRuntime-DqMAn7zG.js → trafficRuntime-STzu7-Xp.js} +1 -1
  51. package/package.json +1 -1
  52. package/dist-embed-interview/InterviewMessages_es-CNKjrohj.js +0 -1
  53. package/dist-embed-interview/InterviewMessages_fr-BP99Pg7g.js +0 -1
  54. package/dist-embed-interview/InterviewMessages_it-DTIrw8wW.js +0 -1
  55. package/dist-embed-scene/sightingSchema-DZCs9lw3.js +0 -1
  56. package/dist-embed-sighting/SightingMessages_fr-ylqIoox7.js +0 -1
  57. package/dist-embed-sighting/sightingSchema-DZCs9lw3.js +0 -1
  58. package/dist-embed-sighting-editor/CaseEditorMessages_es-DwO2w2Vc.js +0 -1
  59. package/dist-embed-sighting-editor/CaseEditorMessages_fr-iFzha0wM.js +0 -1
  60. package/dist-embed-sighting-editor/CaseEditorMessages_it-CjdJSAvo.js +0 -1
  61. package/dist-embed-sighting-editor/GLTFLoader-DoH7iy3g.js +0 -1
  62. package/dist-embed-sighting-editor/InterviewEditorElement-BLlyEu8-.js +0 -100
  63. package/dist-embed-sighting-editor/InterviewMessages_en-yw5Qfw-6.js +0 -1
  64. package/dist-embed-sighting-editor/InterviewMessages_es-CNKjrohj.js +0 -1
  65. package/dist-embed-sighting-editor/InterviewMessages_fr-BP99Pg7g.js +0 -1
  66. package/dist-embed-sighting-editor/InterviewMessages_it-DTIrw8wW.js +0 -1
  67. package/dist-embed-sighting-editor/ModelSource-BUjV4b8R.js +0 -1
  68. package/dist-embed-sighting-editor/RailwaySystem-BEdXiuce.js +0 -41
  69. package/dist-embed-sighting-editor/SightingEditorMessages_es-D6t0QFbB.js +0 -12
  70. package/dist-embed-sighting-editor/SightingEditorMessages_fr-O5O1g-Ii.js +0 -12
  71. package/dist-embed-sighting-editor/SightingEditorMessages_it-BaBliW7B.js +0 -12
  72. package/dist-embed-sighting-editor/interviewSchema-m_h5f8H0.js +0 -1
  73. package/dist-embed-sighting-editor/sightingSchema-DZCs9lw3.js +0 -1
  74. package/dist-embed-sighting-editor/surroundingsSources-DKH8MbhE.js +0 -1
@@ -0,0 +1 @@
1
+ const e={title:"Título",time:"Fecha",by:"Entrevistador",medium:"Medio",witness:"Testigo",witnessNone:"—",summary:"Descripción",transcript:"Transcripción",transcriptHint:"Dirección del archivo de transcripción anonimizada (opcional)",summaryTab:"Resumen",fileTab:"Archivo",importFile:"Cargar un archivo (JSON, texto, WebVTT, SRT)",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"Cargar",saveButton:"Guardar",loading:"Cargando la transcripción…",invalid:"Este texto aún no es JSON válido: la entrevista conserva la última transcripción que entendió.",notATranscript:"Ese archivo no es una transcripción de entrevista (no tiene turnos de palabra).",loadFailed:"No se pudo leer esa transcripción.",editorLabel:"Transcripción de la entrevista en JSON",byHint:"Identificadores de personas de RR0, separados por comas",exchangesTab:"Intercambios",exchangesEmpty:"Todavía no se ha dicho nada.",redacted:"Pasaje eliminado",proofreadAll:"Revisado por todos.",proofreadPending:"Aún no revisado por: {names}",play:"Reproducir",pause:"Pausa",recordings:"Grabaciones ({n})",recordingsTitle:"Grabaciones",recordingKind:"Tipo",recordingAudio:"Audio",recordingVideo:"Vídeo",recordingFile:"Archivo",recordingOffset:"Desfase (s)",recordingRemove:"Quitar",recordingAdd:"Añadir una grabación",close:"Cerrar",noRecording:"Sin grabación: añada el archivo de audio o vídeo de la entrevista para poder escucharla.",redactSelection:"Retirar la selección",redactedWords:"pasaje retirado · {n} palabra(s)",redactAll:"Retirar todo",restoreAll:"Restablecer todo",editTurn:"Modificar",deleteTurn:"Eliminar este turno de palabra",saveTurn:"Guardar",cancelTurn:"Cancelar",turnEditHint:"⟦ … ⟧ marca un pasaje retirado",selectionOnePassage:"La selección debe caber en un solo pasaje no retirado.",selectionNone:"Seleccione palabras de un pasaje para retirarlas.",reviewedBy:"{name} ha revisado",linkMoment:"Vincular a un momento…",momentLabel:"Momento {k} · {text}",unlinkMoment:"Quitar este vínculo",noMoments:"La observación aún no tiene momentos con nombre.",redactReason:"retirado en la revisión",roles:{interviewer:"Entrevistador",interviewee:"Entrevistado",witness:"Testigo"}};export{e as interviewMessages_es};
@@ -0,0 +1 @@
1
+ const e={title:"Titre",time:"Date",by:"Enquêteur",medium:"Moyen",witness:"Témoin",witnessNone:"—",summary:"Description",transcript:"Transcription",transcriptHint:"Adresse du fichier de transcription anonymisée (facultative)",summaryTab:"Résumé",fileTab:"Fichier",importFile:"Charger un fichier (JSON, texte, WebVTT, SRT)",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"Charger",saveButton:"Sauver",loading:"Chargement de la transcription…",invalid:"Ce texte n'est pas encore du JSON valide : l'interview garde la dernière transcription qu'elle a comprise.",notATranscript:"Ce fichier n'est pas une transcription d'interview (il n'a pas de tours de parole).",loadFailed:"Cette transcription n'a pas pu être lue.",editorLabel:"Transcription de l'interview en JSON",byHint:"Identifiants de personnes RR0, séparés par des virgules",exchangesTab:"Échanges",exchangesEmpty:"Rien n'a encore été dit.",redacted:"Passage retiré",proofreadAll:"Relu par tous les participants.",proofreadPending:"Pas encore relu par : {names}",play:"Lecture",pause:"Pause",recordings:"Enregistrements ({n})",recordingsTitle:"Enregistrements",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Vidéo",recordingFile:"Fichier",recordingOffset:"Décalage (s)",recordingRemove:"Retirer",recordingAdd:"Ajouter un enregistrement",close:"Fermer",noRecording:"Aucun enregistrement : ajoutez le fichier audio ou vidéo de l'entretien pour pouvoir l'écouter.",redactSelection:"Retirer la sélection",redactedWords:"passage retiré · {n} mot(s)",redactAll:"Retirer tout",restoreAll:"Rétablir tout",editTurn:"Modifier",deleteTurn:"Supprimer ce tour de parole",saveTurn:"Enregistrer",cancelTurn:"Annuler",turnEditHint:"⟦ … ⟧ marque un passage retiré",selectionOnePassage:"La sélection doit tenir dans un seul passage non retiré.",selectionNone:"Sélectionnez des mots d'un passage pour les retirer.",reviewedBy:"{name} a relu",linkMoment:"Relier à un moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Retirer ce lien",noMoments:"L'observation n'a pas encore de moment nommé.",redactReason:"retiré à la relecture",roles:{interviewer:"Intervieweur",interviewee:"Interviewé",witness:"Témoin"}};export{e as interviewMessages_fr};
@@ -0,0 +1 @@
1
+ const i={title:"Titolo",time:"Data",by:"Intervistatore",medium:"Mezzo",witness:"Testimone",witnessNone:"—",summary:"Descrizione",transcript:"Trascrizione",transcriptHint:"Indirizzo del file di trascrizione anonimizzata (facoltativo)",summaryTab:"Riepilogo",fileTab:"File",importFile:"Carica un file (JSON, testo, WebVTT, SRT)",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"Carica",saveButton:"Salva",loading:"Caricamento della trascrizione…",invalid:"Questo testo non è ancora JSON valido: l'intervista conserva l'ultima trascrizione che ha capito.",notATranscript:"Quel file non è una trascrizione di intervista (non ha turni di parola).",loadFailed:"Impossibile leggere quella trascrizione.",editorLabel:"Trascrizione dell'intervista in JSON",byHint:"Identificatori di persone RR0, separati da virgole",exchangesTab:"Scambi",exchangesEmpty:"Non è stato ancora detto nulla.",redacted:"Passaggio rimosso",proofreadAll:"Rivisto da tutti.",proofreadPending:"Non ancora rivisto da: {names}",play:"Riproduci",pause:"Pausa",recordings:"Registrazioni ({n})",recordingsTitle:"Registrazioni",recordingKind:"Tipo",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Scarto (s)",recordingRemove:"Rimuovi",recordingAdd:"Aggiungi una registrazione",close:"Chiudi",noRecording:"Nessuna registrazione: aggiungi il file audio o video dell'intervista per poterla ascoltare.",redactSelection:"Rimuovi la selezione",redactedWords:"passaggio rimosso · {n} parola/e",redactAll:"Rimuovi tutto",restoreAll:"Ripristina tutto",editTurn:"Modifica",deleteTurn:"Elimina questo turno",saveTurn:"Salva",cancelTurn:"Annulla",turnEditHint:"⟦ … ⟧ indica un passaggio rimosso",selectionOnePassage:"La selezione deve restare in un solo passaggio non rimosso.",selectionNone:"Seleziona parole di un passaggio per rimuoverle.",reviewedBy:"{name} ha riletto",linkMoment:"Collega a un momento…",momentLabel:"Momento {k} · {text}",unlinkMoment:"Rimuovi questo collegamento",noMoments:"L'osservazione non ha ancora momenti con nome.",redactReason:"rimosso in rilettura",roles:{interviewer:"Intervistatore",interviewee:"Intervistato",witness:"Testimone"}};export{i as interviewMessages_it};
@@ -1,11 +1,11 @@
1
- class b{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const t of this.preferences){const s=e[t]??e[b.base(t)];if(s)return s}const r=new Set(this.preferences.map(t=>b.base(t)));for(const[t,s]of Object.entries(e))if(s&&r.has(b.base(t)))return s;return Object.values(e).find(t=>t)??void 0}write(e,r,t){const s=r?.trim()?r.trim():void 0;if(e===void 0||typeof e=="string")return s;const i={...e},c=Object.keys(i).find(o=>o===t)??Object.keys(i).find(o=>b.base(o)===b.base(t))??t;return s===void 0?delete i[c]:i[c]=s,Object.keys(i).length===0?void 0:i}static base(e){return e.toLowerCase().split("-")[0]}}class A{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(e,r){return`${e}.${r.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}.json`}static fromFile(e,r){return e?.[r]!==void 0&&e[r].live!==!0}}class k extends Error{constructor(e,r,t){super(`${e}: ${r}${t===void 0?"":` (HTTP ${t})`}`),this.kind=e,this.url=r,this.status=t,this.name="SightingFetchError"}}class M{static async recording(e){const r=await M.json(e);for(const t of A.NAMES){const s=r?.frozen?.[t];if(!(!s?.src||s.live))try{const i=await M.json(new URL(s.src,new URL(e,location.href)).href);for(const c of A.KEYS[t])i[c]!==void 0&&(r[c]=i[c])}catch{}}return r}static async json(e){const r=new URL(e,location.href);if(location.protocol==="https:"&&r.protocol==="http:")throw new k("mixed-content",e);let t;try{t=await fetch(e)}catch{throw await this.diagnose(e,r)}if(!t.ok)throw new k("status",e,t.status);try{return await t.json()}catch{throw new k("malformed",e)}}static async diagnose(e,r){if(r.origin===location.origin)return new k("unreachable",e);try{return await fetch(e,{mode:"no-cors"}),new k("cors",e)}catch{return new k("unreachable",e)}}}function $(d,e){for(const r of d){const t=r.toLowerCase().split("-")[0];if(e.includes(t))return t}return"en"}class z{static preferencesFor(e){const r=navigator.languages??[],t=this.declaredFor(e);return t?[t,...r]:r}static declaredFor(e){for(let r=e;r;){const t=r.closest("[lang]")?.getAttribute("lang")?.trim();if(t)return t;const s=r.getRootNode();r=s instanceof ShadowRoot?s.host:void 0}}}const x="modulepreload",j=function(d,e){return new URL(d,e).href},O={},T=function(e,r,t){let s=Promise.resolve();if(r&&r.length>0){let c=function(h){return Promise.all(h.map(a=>Promise.resolve(a).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),w=p?.nonce||p?.getAttribute("nonce");s=c(r.map(h=>{if(h=j(h,t),h in O)return;O[h]=!0;const a=h.endsWith(".css"),f=a?'[rel="stylesheet"]':"";if(!!t)for(let g=o.length-1;g>=0;g--){const E=o[g];if(E.href===h&&(!a||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":x,a||(l.as="script"),l.crossOrigin="",l.href=h,w&&l.setAttribute("nonce",w),document.head.appendChild(l),a)return new Promise((g,E)=>{l.addEventListener("load",g),l.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(c){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=c,window.dispatchEvent(o),!o.defaultPrevented)throw c}return s.then(c=>{for(const o of c||[])o.status==="rejected"&&i(o.reason);return e().catch(i)})},U=["en","fr","es","it"],H={en:()=>T(()=>Promise.resolve().then(()=>F),void 0,import.meta.url).then(d=>d.interviewMessages_en),fr:()=>T(()=>import("./InterviewMessages_fr-BP99Pg7g.js"),[],import.meta.url).then(d=>d.interviewMessages_fr),es:()=>T(()=>import("./InterviewMessages_es-CNKjrohj.js"),[],import.meta.url).then(d=>d.interviewMessages_es),it:()=>T(()=>import("./InterviewMessages_it-DTIrw8wW.js"),[],import.meta.url).then(d=>d.interviewMessages_it)};function V(d){return H[d]()}const R={title:"Title",time:"When",by:"Interviewer",medium:"Medium",witness:"Witness",witnessNone:"—",summary:"Description",transcript:"Transcript",transcriptHint:"Address of the anonymised transcript file (optional)",summaryTab:"Summary",fileTab:"File",importFile:"Load a file (JSON, text, WebVTT, SRT)",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load",saveButton:"Save",loading:"Loading the transcript…",invalid:"This text is not valid JSON yet: the interview keeps the last transcript it understood.",notATranscript:"That file is not an interview transcript (it has no segments).",loadFailed:"That transcript could not be read.",editorLabel:"Interview transcript as JSON",byHint:"RR0 people ids, separated by commas",exchangesTab:"Exchanges",exchangesEmpty:"Nothing was said yet.",redacted:"Passage removed",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}},F=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:R},Symbol.toStringTag,{value:"Module"})),P="interviewseek";class u{static isProofread(e){const r=Object.keys(e.speakers);return r.length>0&&r.every(t=>{const s=e.proofreading?.[t]?.status;return s==="approved"||s==="covered"})}static said(e){return e.parts?e.parts.map(r=>"redacted"in r?"…":u.plain(r.text)).join(" "):e.redacted?void 0:u.plain(e.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(e){return/[<&]/.test(e)?e.replace(/<br\s*\/?>/gi,`
2
- `).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(r,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(r,t)=>String.fromCodePoint(Number(t))).replace(/&(\w+);/g,(r,t)=>u.ENTITIES[t.toLowerCase()]??r):e}static sightingsOf(e){return[e.interviewOf].flat().filter(r=>typeof r=="string")}static passagesAbout(e,r){const t=u.sightingsOf(e),s=[];return e.segments.forEach((i,c)=>{for(const o of i.refs??[]){if(o.sighting===void 0?!t.includes(r):o.sighting!==r)continue;const p=u.said(i);s.push({index:c,speaker:i.speaker,at:o.at,...p!==void 0?{text:p}:{},...o.range?{range:o.range}:{}})}}),s.sort((i,c)=>i.at-c.at||i.index-c.index)}static clock(e,r=!1){const t=Math.round(e*10),s=Math.floor(t/10),i=p=>String(p).padStart(2,"0"),c=Math.floor(s/3600),o=`${c>0||r?i(Math.floor(s/60)%60):Math.floor(s/60)}:${i(s%60)}`;return`${c>0?`${c}:`:""}${o}${r||t%10!==0?`.${t%10}`:""}`}static speakerName(e,r){const t=e.speakers[r];if(!t)return r;const s=typeof t.title=="string"?t.title:t.title?Object.values(t.title)[0]:void 0;return s||t.by&&u.agentName(t.by)||t.role}static agentName(e){if("people"in e){const[r,...t]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...t,r].join(" ")}return"org"in e?e.org:e.title??""}static stamp(e){const r=Math.round(e*1e3),t=(s,i=2)=>String(s).padStart(i,"0");return`${t(Math.floor(r/36e5))}:${t(Math.floor(r/6e4)%60)}:${t(Math.floor(r/1e3)%60)}.${t(r%1e3,3)}`}static toVtt(e){const r=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=e.segments.filter(i=>i.start!==void 0);return`WEBVTT
1
+ class b{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const r of this.preferences){const s=e[r]??e[b.base(r)];if(s)return s}const t=new Set(this.preferences.map(r=>b.base(r)));for(const[r,s]of Object.entries(e))if(s&&t.has(b.base(r)))return s;return Object.values(e).find(r=>r)??void 0}write(e,t,r){const s=t?.trim()?t.trim():void 0;if(e===void 0||typeof e=="string")return s;const n={...e},c=Object.keys(n).find(i=>i===r)??Object.keys(n).find(i=>b.base(i)===b.base(r))??r;return s===void 0?delete n[c]:n[c]=s,Object.keys(n).length===0?void 0:n}static base(e){return e.toLowerCase().split("-")[0]}}class S{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(e,t){return`${e}.${t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static fromFile(e,t){return e?.[t]!==void 0&&e[t].live!==!0}}class k extends Error{constructor(e,t,r){super(`${e}: ${t}${r===void 0?"":` (HTTP ${r})`}`),this.kind=e,this.url=t,this.status=r,this.name="SightingFetchError"}}class M{static async recording(e){const t=await M.json(e);for(const r of S.NAMES){const s=t?.frozen?.[r];if(!(!s?.src||s.live))try{const n=await M.json(new URL(s.src,new URL(e,location.href)).href);for(const c of S.KEYS[r])n[c]!==void 0&&(t[c]=n[c])}catch{}}return t}static async json(e){const t=new URL(e,location.href);if(location.protocol==="https:"&&t.protocol==="http:")throw new k("mixed-content",e);let r;try{r=await fetch(e)}catch{throw await this.diagnose(e,t)}if(!r.ok)throw new k("status",e,r.status);try{return await r.json()}catch{throw new k("malformed",e)}}static async diagnose(e,t){if(t.origin===location.origin)return new k("unreachable",e);try{return await fetch(e,{mode:"no-cors"}),new k("cors",e)}catch{return new k("unreachable",e)}}}function $(h,e){for(const t of h){const r=t.toLowerCase().split("-")[0];if(e.includes(r))return r}return"en"}class z{static preferencesFor(e){const t=navigator.languages??[],r=this.declaredFor(e);return r?[r,...t]:t}static declaredFor(e){for(let t=e;t;){const r=t.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=t.getRootNode();t=s instanceof ShadowRoot?s.host:void 0}}}const x="modulepreload",j=function(h,e){return new URL(h,e).href},O={},L=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){let c=function(p){return Promise.all(p.map(o=>Promise.resolve(o).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const i=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),w=d?.nonce||d?.getAttribute("nonce");s=c(t.map(p=>{if(p=j(p,r),p in O)return;O[p]=!0;const o=p.endsWith(".css"),f=o?'[rel="stylesheet"]':"";if(!!r)for(let g=i.length-1;g>=0;g--){const E=i[g];if(E.href===p&&(!o||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${f}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":x,o||(l.as="script"),l.crossOrigin="",l.href=p,w&&l.setAttribute("nonce",w),document.head.appendChild(l),o)return new Promise((g,E)=>{l.addEventListener("load",g),l.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function n(c){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=c,window.dispatchEvent(i),!i.defaultPrevented)throw c}return s.then(c=>{for(const i of c||[])i.status==="rejected"&&n(i.reason);return e().catch(n)})},H=["en","fr","es","it"],U={en:()=>L(()=>Promise.resolve().then(()=>F),void 0,import.meta.url).then(h=>h.interviewMessages_en),fr:()=>L(()=>import("./InterviewMessages_fr-Dhtz904e.js"),[],import.meta.url).then(h=>h.interviewMessages_fr),es:()=>L(()=>import("./InterviewMessages_es-BJHVnSkP.js"),[],import.meta.url).then(h=>h.interviewMessages_es),it:()=>L(()=>import("./InterviewMessages_it-D0Dff5zn.js"),[],import.meta.url).then(h=>h.interviewMessages_it)};function V(h){return U[h]()}const R={title:"Title",time:"When",by:"Interviewer",medium:"Medium",witness:"Witness",witnessNone:"—",summary:"Description",transcript:"Transcript",transcriptHint:"Address of the anonymised transcript file (optional)",summaryTab:"Summary",fileTab:"File",importFile:"Load a file (JSON, text, WebVTT, SRT)",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load",saveButton:"Save",loading:"Loading the transcript…",invalid:"This text is not valid JSON yet: the interview keeps the last transcript it understood.",notATranscript:"That file is not an interview transcript (it has no segments).",loadFailed:"That transcript could not be read.",editorLabel:"Interview transcript as JSON",byHint:"RR0 people ids, separated by commas",exchangesTab:"Exchanges",exchangesEmpty:"Nothing was said yet.",redacted:"Passage removed",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",play:"Play",pause:"Pause",recordings:"Recordings ({n})",recordingsTitle:"Recordings",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Offset (s)",recordingRemove:"Remove",recordingAdd:"Add a recording",close:"Close",noRecording:"No recording: add the audio or video file of the interview to listen to it.",redactSelection:"Take out the selection",redactedWords:"passage taken out · {n} word(s)",redactAll:"Take all out",restoreAll:"Restore all",editTurn:"Edit",deleteTurn:"Delete this turn",saveTurn:"Save",cancelTurn:"Cancel",turnEditHint:"⟦ … ⟧ marks a passage taken out",selectionOnePassage:"The selection has to stay within one passage not taken out.",selectionNone:"Select words of a passage to take them out.",reviewedBy:"{name} has proofread",linkMoment:"Link to a moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Remove this link",noMoments:"The observation has no named moment yet.",redactReason:"taken out at proofreading",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}},F=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:R},Symbol.toStringTag,{value:"Module"})),P="interviewseek";class u{static isProofread(e){const t=Object.keys(e.speakers);return t.length>0&&t.every(r=>{const s=e.proofreading?.[r]?.status;return s==="approved"||s==="covered"})}static said(e){return e.parts?e.parts.map(t=>"redacted"in t?"…":u.plain(t.text)).join(" "):e.redacted?void 0:u.plain(e.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(e){return/[<&]/.test(e)?e.replace(/<br\s*\/?>/gi,`
2
+ `).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(Number(r))).replace(/&(\w+);/g,(t,r)=>u.ENTITIES[r.toLowerCase()]??t):e}static sightingsOf(e){return[e.interviewOf].flat().filter(t=>typeof t=="string")}static passagesAbout(e,t){const r=u.sightingsOf(e),s=[];return e.segments.forEach((n,c)=>{for(const i of n.refs??[]){if(i.sighting===void 0?!r.includes(t):i.sighting!==t)continue;const d=u.said(n);s.push({index:c,speaker:n.speaker,at:i.at,...d!==void 0?{text:d}:{},...i.range?{range:i.range}:{}})}}),s.sort((n,c)=>n.at-c.at||n.index-c.index)}static clock(e,t=!1){const r=Math.round(e*10),s=Math.floor(r/10),n=d=>String(d).padStart(2,"0"),c=Math.floor(s/3600),i=`${c>0||t?n(Math.floor(s/60)%60):Math.floor(s/60)}:${n(s%60)}`;return`${c>0?`${c}:`:""}${i}${t||r%10!==0?`.${r%10}`:""}`}static speakerName(e,t){const r=e.speakers[t];if(!r)return t;const s=typeof r.title=="string"?r.title:r.title?Object.values(r.title)[0]:void 0;return s||r.by&&u.agentName(r.by)||r.role}static agentName(e){if("people"in e){const[t,...r]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...r,t].join(" ")}return"org"in e?e.org:e.title??""}static stamp(e){const t=Math.round(e*1e3),r=(s,n=2)=>String(s).padStart(n,"0");return`${r(Math.floor(t/36e5))}:${r(Math.floor(t/6e4)%60)}:${r(Math.floor(t/1e3)%60)}.${r(t%1e3,3)}`}static toVtt(e){const t=n=>n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=e.segments.filter(n=>n.start!==void 0);return`WEBVTT
3
3
 
4
- ${t.map((i,c)=>{const o=t[c+1],p=i.end??o?.start??i.start+5,w=o&&o.start<p?Math.max(i.start,o.start):p;return`${u.stamp(i.start)} --> ${u.stamp(w)}
5
- <v ${r(u.speakerName(e,i.speaker))}>${r(u.said(i)??"[…]")}`}).join(`
4
+ ${r.map((n,c)=>{const i=r[c+1],d=n.end??i?.start??n.start+5,w=i&&i.start<d?Math.max(n.start,i.start):d;return`${u.stamp(n.start)} --> ${u.stamp(w)}
5
+ <v ${t(u.speakerName(e,n.speaker))}>${t(u.said(n)??"[…]")}`}).join(`
6
6
 
7
7
  `)}
8
- `}}class n{static svg(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor"/></svg>`}static outline(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=n.outline(n.BOOKMARK);static MILESTONES_ON=n.solid(n.BOOKMARK);static PICTURES_OFF=n.outline(`${n.PICTURE}${n.PICTURE_HILLS}`);static PICTURES_ON=n.solid(`${n.PICTURE}${n.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=n.outline(`${n.TRACE_LINE}${n.TRACE_MARK}`);static TRACES_ON=n.solid(`${n.TRACE_LINE}${n.TRACE_MARK}`);static MAP_OFF=n.outline(`${n.PIN}${n.PIN_HOLE}`);static MAP_ON=n.solid(`${n.PIN}${n.PIN_HOLE}`);static SHARE=n.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=n.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=n.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=n.svg("M7.4 5v14l11-7z");static PAUSE=n.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=n.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=n.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=n.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=n.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const C="rr0-interview",B=`
8
+ `}}class a{static svg(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor"/></svg>`}static outline(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=a.outline(a.BOOKMARK);static MILESTONES_ON=a.solid(a.BOOKMARK);static PICTURES_OFF=a.outline(`${a.PICTURE}${a.PICTURE_HILLS}`);static PICTURES_ON=a.solid(`${a.PICTURE}${a.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=a.outline(`${a.TRACE_LINE}${a.TRACE_MARK}`);static TRACES_ON=a.solid(`${a.TRACE_LINE}${a.TRACE_MARK}`);static MAP_OFF=a.outline(`${a.PIN}${a.PIN_HOLE}`);static MAP_ON=a.solid(`${a.PIN}${a.PIN_HOLE}`);static SHARE=a.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=a.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=a.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=a.svg("M7.4 5v14l11-7z");static PAUSE=a.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=a.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=a.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=a.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=a.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const C="rr0-interview",B=`
9
9
  rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
10
10
  rr0-interview [hidden] { display: none !important; }
11
11
  rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
@@ -32,4 +32,4 @@ rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
32
32
  rr0-interview .turn .ref { font: inherit; font-size: .8em; cursor: pointer; border: 1px solid var(--rr0-interview-line); border-radius: 999px; background: transparent; color: inherit;
33
33
  padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
34
34
  rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
35
- `;class S extends HTMLElement{messages=R;said=new b(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(e,r,t){e==="src"&&t!==r&&this.isConnected&&this.load()}connectedCallback(){S.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(e){this.loadToken++,this.json=e,this.draw()}set documentUrl(e){this.base=e}static styleRoot(e){const r=e instanceof ShadowRoot?e:document.head;if(r.querySelector("style[data-rr0-interview]"))return;const t=document.createElement("style");t.dataset.rr0Interview="",t.textContent=B,r.append(t)}async load(){const e=this.getAttribute("src"),r=++this.loadToken;if(this.loading=e??void 0,!e)return;const t=new URL(e,location.href).href;let s;try{s=await M.json(t)}catch{s=void 0}r===this.loadToken&&(this.base=t,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,r=z.preferencesFor(this),t=$(r,U),s=t==="en"?R:await V(t);e===this.localeToken&&(this.said=new b(r),this.messages=s,this.draw())}speakerName(e,r){const t=u.speakerName(e,r),s=e.speakers?.[r]?.role;return t===s&&s in this.messages.roles?this.messages.roles[s]:t}seek(e){const r=this.json,t={sighting:e.sighting??u.sightingsOf(r)[0],at:e.at};this.dispatchEvent(new CustomEvent(P,{bubbles:!0,composed:!0,detail:t}));const s=this.getAttribute("player");if(!s)return;const c=this.getRootNode().getElementById?.(s);typeof c?.seekTo=="function"&&(c.scrollIntoView?.({block:"center",behavior:"smooth"}),c.seekTo(t.at,t.sighting))}gap(e,r){const t=document.createElement(r),s=document.createElement("span");s.className="bar";const i=`${this.messages.redacted} : ${this.said.read(e)??""}`;return s.dataset.tip=i,s.tabIndex=0,s.setAttribute("role","img"),s.setAttribute("aria-label",i),t.append(s),t}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const r=document.createElement("template");r.innerHTML=e;for(const t of r.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(t.tagName)){t.remove();continue}for(const s of[...t.attributes])if(/^on/i.test(s.name)||/^\s*javascript:/i.test(s.value))t.removeAttribute(s.name);else if(["href","src"].includes(s.name))try{s.value=new URL(s.value,this.base??location.href).href}catch{}}return[...r.content.childNodes]}draw(){const e=this.messages,r=this.json;this.blocks.clear();const t=Array.isArray(r?.segments)?r.segments:[];if(!r||t.length===0){this.status.hidden=!0;const a=document.createElement("p");a.textContent=e.exchangesEmpty,this.turns.replaceChildren(a);return}const s=r.speakers??{},i=Object.keys(s);if(r.proofreading){const a=i.filter(f=>!["approved","covered"].includes(r.proofreading?.[f]?.status??""));this.status.textContent=a.length===0?e.proofreadAll:e.proofreadPending.replace("{names}",a.map(f=>this.speakerName(r,f)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const c=[];let o,p=!1,w,h;t.forEach((a,f)=>{const L=a.redacted?JSON.stringify(a.redacted.reason):void 0;if(L!==void 0&&w?.reason===L){this.blocks.set(f,w.block),a.speaker!==h&&(h=void 0);return}const l=document.createElement("div");l.className="turn",l.dataset.segment=String(f);const g=document.createElement("div");g.className="who";const E=document.createElement("span");if(E.textContent=a.redacted?"":this.speakerName(r,a.speaker),a.start!==void 0&&(l.dataset.time=u.clock(a.start,!0)),h!==a.speaker&&(o=document.createElement("div"),o.className="intervention",o.style.setProperty("--speaker-hue",String((Math.max(0,i.indexOf(a.speaker))*67+210)%360)),c.push(o),p=!1),a.redacted||(p&&l.classList.add("goes-on"),p=!0),o.append(l),h=a.speaker,g.append(E),a.redacted){l.classList.add("is-redacted");const v=this.gap(a.redacted.reason,"p");v.className="redacted",w={block:l,reason:L},l.append(g,v)}else{const v=document.createElement("p");if(v.className="said",a.parts){let N="";for(const m of a.parts){const y="redacted"in m?"▮":u.plain(m.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(N)&&/^[\p{L}\p{N}(«“▮]/u.test(y)&&v.append(" "),"redacted"in m?v.append(this.gap(m.redacted.reason,"span")):v.append(...this.saidNodes(m.text)),N=y}}else v.append(...this.saidNodes(a.text??""));w=void 0,l.append(g,v)}if(a.refs?.length){const v=document.createElement("div");v.className="refs";for(const N of a.refs){const m=document.createElement("button");m.type="button",m.className="ref",m.innerHTML=n.PLAY,m.append(u.clock(N.at,!0)),m.addEventListener("click",()=>this.seek(N)),v.append(m)}l.append(v)}this.blocks.set(f,l)}),this.turns.replaceChildren(...c)}revealSegment(e){const r=this.blocks.get(e);r&&(r.scrollIntoView?.({block:"center"}),r.classList.add("flash"),window.setTimeout(()=>r.classList.remove("flash"),1600))}}function _(){customElements.get(C)||customElements.define(C,S)}_();
35
+ `;class y extends HTMLElement{messages=R;said=new b(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(e,t,r){e==="src"&&r!==t&&this.isConnected&&this.load()}connectedCallback(){y.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(e){this.loadToken++,this.json=e,this.draw()}set documentUrl(e){this.base=e}static styleRoot(e){const t=e instanceof ShadowRoot?e:document.head;if(t.querySelector("style[data-rr0-interview]"))return;const r=document.createElement("style");r.dataset.rr0Interview="",r.textContent=B,t.append(r)}async load(){const e=this.getAttribute("src"),t=++this.loadToken;if(this.loading=e??void 0,!e)return;const r=new URL(e,location.href).href;let s;try{s=await M.json(r)}catch{s=void 0}t===this.loadToken&&(this.base=r,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,t=z.preferencesFor(this),r=$(t,H),s=r==="en"?R:await V(r);e===this.localeToken&&(this.said=new b(t),this.messages=s,this.draw())}speakerName(e,t){const r=u.speakerName(e,t),s=e.speakers?.[t]?.role;return r===s&&s in this.messages.roles?this.messages.roles[s]:r}seek(e,t){const r=this.json,s=t?u.said(t):void 0,n={sighting:e.sighting??u.sightingsOf(r)[0],at:e.at,...s?{quote:s}:{}};this.dispatchEvent(new CustomEvent(P,{bubbles:!0,composed:!0,detail:n}));const c=this.getAttribute("player");if(!c)return;const d=this.getRootNode().getElementById?.(c);typeof d?.seekTo=="function"&&(d.scrollIntoView?.({block:"center",behavior:"smooth"}),d.seekTo(n.at,n.sighting))}gap(e,t){const r=document.createElement(t),s=document.createElement("span");s.className="bar";const n=`${this.messages.redacted} : ${this.said.read(e)??""}`;return s.dataset.tip=n,s.tabIndex=0,s.setAttribute("role","img"),s.setAttribute("aria-label",n),r.append(s),r}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const t=document.createElement("template");t.innerHTML=e;for(const r of t.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(r.tagName)){r.remove();continue}for(const s of[...r.attributes])if(/^on/i.test(s.name)||/^\s*javascript:/i.test(s.value))r.removeAttribute(s.name);else if(["href","src"].includes(s.name))try{s.value=new URL(s.value,this.base??location.href).href}catch{}}return[...t.content.childNodes]}draw(){const e=this.messages,t=this.json;this.blocks.clear();const r=Array.isArray(t?.segments)?t.segments:[];if(!t||r.length===0){this.status.hidden=!0;const o=document.createElement("p");o.textContent=e.exchangesEmpty,this.turns.replaceChildren(o);return}const s=t.speakers??{},n=Object.keys(s);if(t.proofreading){const o=n.filter(f=>!["approved","covered"].includes(t.proofreading?.[f]?.status??""));this.status.textContent=o.length===0?e.proofreadAll:e.proofreadPending.replace("{names}",o.map(f=>this.speakerName(t,f)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const c=[];let i,d=!1,w,p;r.forEach((o,f)=>{const N=o.redacted?JSON.stringify(o.redacted.reason):void 0;if(N!==void 0&&w?.reason===N){this.blocks.set(f,w.block),o.speaker!==p&&(p=void 0);return}const l=document.createElement("div");l.className="turn",l.dataset.segment=String(f);const g=document.createElement("div");g.className="who";const E=document.createElement("span");if(E.textContent=o.redacted?"":this.speakerName(t,o.speaker),o.start!==void 0&&(l.dataset.time=u.clock(o.start,!0)),p!==o.speaker&&(i=document.createElement("div"),i.className="intervention",i.style.setProperty("--speaker-hue",String((Math.max(0,n.indexOf(o.speaker))*67+210)%360)),c.push(i),d=!1),o.redacted||(d&&l.classList.add("goes-on"),d=!0),i.append(l),p=o.speaker,g.append(E),o.redacted){l.classList.add("is-redacted");const v=this.gap(o.redacted.reason,"p");v.className="redacted",w={block:l,reason:N},l.append(g,v)}else{const v=document.createElement("p");if(v.className="said",o.parts){let T="";for(const m of o.parts){const A="redacted"in m?"▮":u.plain(m.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(T)&&/^[\p{L}\p{N}(«“▮]/u.test(A)&&v.append(" "),"redacted"in m?v.append(this.gap(m.redacted.reason,"span")):v.append(...this.saidNodes(m.text)),T=A}}else v.append(...this.saidNodes(o.text??""));w=void 0,l.append(g,v)}if(o.refs?.length){const v=document.createElement("div");v.className="refs";for(const T of o.refs){const m=document.createElement("button");m.type="button",m.className="ref",m.innerHTML=a.PLAY,m.append(u.clock(T.at,!0)),m.addEventListener("click",()=>this.seek(T,o)),v.append(m)}l.append(v)}this.blocks.set(f,l)}),this.turns.replaceChildren(...c)}revealSegment(e){const t=this.blocks.get(e);t&&(t.scrollIntoView?.({block:"center"}),t.classList.add("flash"),window.setTimeout(()=>t.classList.remove("flash"),1600))}}function D(){customElements.get(C)||customElements.define(C,y)}D();