1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1d40e0f0-ba4b-4c4b-b97f-dcfd76d61e97",t._sentryDebugIdIdentifier="sentry-dbid-1d40e0f0-ba4b-4c4b-b97f-dcfd76d61e97")}catch(t){}}(),(self["webpackChunkorq_web"]=self["webpackChunkorq_web"]||[]).push([[4855],{25870:function(t,e,s){s.d(e,{A:function(){return y}});var i=function(){var t=this,e=t._self._c;return e("span",{staticClass:"agent-skill-icon",attrs:{"aria-hidden":"true"}},[e(t.iconComponent,{tag:"component",attrs:{size:t.size}})],1)},a=[],o=s(63242),n=s(6369),r=s(49662),l=s(38784),c=s(10093),u=s(57900),d=s(46529),h=s(99980),p=s(90686),m=s(21280);const g={"database-search-outline":n.A,"file-document-edit-outline":r.A,"image-edit-outline":l.A,"image-search-outline":c.A,"link-variant":u.A,"movie-edit-outline":d.A,"pencil-outline":h.A,"tag-multiple-outline":p.A,"text-box-edit-outline":m.A};var f={props:{icon:{type:String,default:""},size:{type:Number,default:24}},computed:{iconComponent(){return g[this.normalizedIcon]||o.A},normalizedIcon(){return`${this.icon||""}`.trim()}},name:"AgentSkillIcon"},v=f,C=s(81656),b=(0,C.A)(v,i,a,!1,null,"b5bd040e",null),y=b.exports},84223:function(t,e,s){s.d(e,{A:function(){return u}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"autosize-textarea"},[e("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.text,expression:"text"}],ref:"textarea",staticClass:"input",style:t.textareaStyle,attrs:{name:"query",rows:t.minRows,placeholder:t.shownPlaceholder},domProps:{value:t.text},on:{input:[function(e){e.target.composing||(t.text=e.target.value)},t.onInput],focus:t.onFocus,blur:t.onBlur}},"textarea",t.$attrs,!1),t.$listeners)),t._t("default"),t.isIconShown?e("ai-icon",{staticClass:"ai-icon",attrs:{size:20}}):t._e()],2)},a=[],o=s(63242),n={inheritAttrs:!1,props:{initialText:{type:String,default:""},minRows:{type:Number,default:4},maxRows:{type:Number,default:8},lineHeight:{type:Number,default:24},paddingRight:{type:Number,default:50},placeholder:{type:String,default:"Ask AI to search our database for you..."},showIcon:{type:Boolean,default:!1}},mounted(){this.adjustHeight()},data(){return{text:this.initialText,overflowY:"hidden",paddingTop:9,paddingBottom:9,isFocused:!1}},computed:{textareaStyle(){return{width:"100%",resize:"none","padding-right":this.paddingRight+"px","padding-left":this.isIconShown?"40px":"12px",overflowY:this.overflowY,position:"relative"}},isIconShown(){return this.showIcon&&!this.isFocused&&!this.text},shownPlaceholder(){return this.showIcon?this.isIconShown?this.placeholder:"":this.placeholder}},methods:{onInput(t){this.adjustHeight(),this.$emit("input",t)},onFocus(){this.isFocused=!0},onBlur(){this.isFocused=!1},clearText(){this.text="",this.$refs.textarea.blur()},adjustHeight(){this.$nextTick(()=>{const t=this.$refs.textarea;if(!t)return;t.style.height="auto";const e=this.paddingTop+this.paddingBottom,s=e+this.minRows*this.lineHeight,i=t.scrollHeight,a=e+this.maxRows*this.lineHeight;t.style.height=`${Math.max(s,Math.min(i,a))}px`,this.overflowY=i>a?"scroll":"hidden"})}},components:{AiIcon:o.A}},r=n,l=s(81656),c=(0,l.A)(r,i,a,!1,null,"48535fc4",null),u=c.exports},7359:function(t,e,s){s.d(e,{A:function(){return h}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"place-input"},[t.label?e("label",{staticClass:"label",class:[t.labelClasses,{disabled:t.disabled}],attrs:{for:t.id}},[t._v(t._s(t.label))]):t._e(),e("place-multiselect",{ref:"input",class:[t.classes,t.multiselectClasses],attrs:{value:t.value,loading:t.loading,"search-query":t.searchQuery,placeholder:t.placeholder,multiple:t.multiple,id:t.id,options:t.options,"track-by":"id",label:"full_address_en",disabled:t.disabled,"always-show-value":!0},on:{open:t.searchDefaultOptions,"search-change":t.onSearchChange,select:t.onPlaceSelect,clear:t.clearPlace,close:t.clearPlaceOptions,remove:t.placeRemove}}),t.error?e("div",{staticClass:"error"},[t._v(t._s(t.error))]):t._e(),t.helpText?e("div",{staticClass:"help-text text-sm"},[t._v(t._s(t.helpText))]):t._e()],1)},a=[],o=(s(18111),s(22489),s(61701),s(13579),s(38221)),n=s.n(o),r=s(9689),l={props:{label:{type:String,default:""},value:[Object,String,Array],placeholder:{type:String,default:"All Places"},error:{type:String,default:""},showDefaultOptions:{type:Boolean,default:!1},onlyAncestralPlaces:{type:Boolean,default:!1},allowFreeInput:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},id:{type:String,default:"place"},multiselectClasses:{type:String,default:""},labelClasses:{type:String,default:""},helpText:{type:String,default:""}},data(){const t=56;return{loading:!1,options:[],searchQuery:"",optionHeight:t}},computed:{classes(){return{"has-error":!!this.error}}},methods:{onSearchChange(t){this.options=[],this.searchQuery=t,this.$store.commit("setPlaceAlternativesState",[]),t?(this.loading=!0,this.searchPlaces(t)):this.searchDefaultOptions()},searchPlaces:n()(function(t){this.$store.dispatch("searchPlaceAlternativesAction",{query:t,onlyAncestralPlaces:this.onlyAncestralPlaces}).then(t=>{this.searchQuery&&this.setOptionsFromResponse(t),this.loading=!1})},300),searchDefaultOptions(){this.showDefaultOptions&&this.$store.dispatch("getCommonPlaceAlternativesAction").then(t=>{this.setOptionsFromResponse(t)})},setOptionsFromResponse(t){const e={isAddCustom:!0,full_address_en:this.searchQuery,address_en:this.searchQuery,customOptionLabel:`Search "${this.searchQuery}" in by text match`};if(t&&t.length){let s=t.filter(t=>t.place_id).map(t=>({id:t.place_id,full_address_en:t.display_text,display_text_short:t.display_text_short,address_en:t.address_en,parents:t.parents,level_name:t.level_name,level:t.level}));if(this.allowFreeInput&&this.searchQuery&&!s.some(t=>t.full_address_en.toLowerCase()===this.searchQuery.toLowerCase())){const t=s.length>this.$refs.input.visibleItemsCount-1?this.$refs.input.visibleItemsCount-1:s.length;s.splice(t,0,e)}this.options=s}else this.allowFreeInput?this.options=[e]:this.options=[]},onPlaceSelect(t){this.$emit("select",t)},clearPlace(){this.multiple?this.$emit("clear"):this.onPlaceSelect({})},clearPlaceOptions(){this.$store.commit("setPlaceAlternativesState",[])},placeRemove(t){this.$emit("remove",t)}},components:{PlaceMultiselect:r.A}},c=l,u=s(81656),d=(0,u.A)(c,i,a,!1,null,"4b7d0a2a",null),h=d.exports},21127:function(t,e,s){s.d(e,{A:function(){return f}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"surname-input"},[e("mcr-multiselect",{ref:"surname-input",attrs:{value:t.value,classes:t.classes,id:t.id,clearable:t.allowRemove,"clear-aria-label":"Clear selected surname","is-clear-visible":Boolean(t.value&&(t.value.name_ch||t.value.length)&&t.allowRemove),placeholder:t.defaultPlaceholder,searchable:!0,"internal-search":!1,preserveSearch:!1,clearOnSelect:!0,"show-no-options":!0,"show-no-results":t.searchR
1an,options:t.clanOptions,"hide-selected":!1,"track-by":"name_ch",label:"name_ch",openDirection:"bottom",selectLabel:"",selectedLabel:"",deselectLabel:"",loading:t.clansSearchLoadingState,multiple:t.multiple,"custom-label":t.customLabel},on:{open:t.onOpen,"search-change":t.onSearchChange,select:t.onClanSelect,remove:t.onClanRemove,clear:t.clearClan,close:t.onClose},scopedSlots:t._u([{key:"option",fn:function(s){return[e("span",{staticClass:"chinese-name"},[t._v(t._s(t.getChineseNameDisplay(s.option)))]),e("span",{staticClass:"english-name"},[t._v(t._s(t.getEnglishNameDisplay(s.option)))])]}},{key:"singleLabel",fn:function(s){return e("span",{},[s.option&&s.option.name_ch?[e("span",{staticClass:"chinese-name"},[t._v(t._s(t.getChineseNameDisplay(s.option)))]),e("span",{staticClass:"english-name"},[t._v(t._s(t.getEnglishNameDisplay(s.option)))])]:e("span",[t._v(t._s(t.defaultPlaceholder))])],2)}}])},[e("span",{staticClass:"input-helper",attrs:{slot:"noResult"},slot:"noResult"},[t._v("No elements found.")]),e("span",{staticClass:"input-helper",attrs:{slot:"noOptions"},slot:"noOptions"},[t._v("Start typing to search...")]),t.clansSearchLoadingState?e("div",{staticClass:"loading-after-list",attrs:{slot:"afterList"},slot:"afterList"},[e("span",{staticClass:"input-helper"},[t._v("Searching...")])]):t._e()]),t.error?e("div",{staticClass:"error"},[t._v(t._s(t.error))]):t._e()],1)},a=[],o=(s(44114),s(95691)),n=s(13321),r=s(38221),l=s.n(r),c=s(55808),u=s.n(c),d=s(95353),h={props:{value:{type:[Object,Array]},error:{type:String,default:""},placeholder:{type:String,default:""},showDefaultLabel:{type:Boolean,default:!1},allowSpellingSelect:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},allowRemove:{type:Boolean,default:!0},id:{type:String,default:"clan-surname"}},data(){return{searchRan:!1,searchQuery:""}},computed:{...(0,d.L8)(["clansSearchState","clansSearchLoadingState"]),classes(){return{"has-error":!!this.error,bordered:!0}
1},clanOptions(){if(this.allowSpellingSelect&&this.clansSearchState&&this.clansSearchState.length>1&&this.searchQuery){const t=u()(this.searchQuery);return[{name_ch:t,display:`${t} (all translations)`},...this.clansSearchState]}return this.clansSearchState},defaultPlaceholder(){return this.placeholder?this.placeholder:this.showDefaultLabel?"All Clan Surnames":""}},methods:{isMultiselectOpened(){return this.$refs["surname-input"]&&this.$refs["surname-input"].isOpen},onOpen(){const t=this.value&&this.value.alias,e=this.value&&this.value.name_ch;return t||e&&!(0,n.TO)(e)?this.$refs["surname-input"].updateSearch(t||e):this.onSearchChange()},onClose(){this.clearClanOptions()},onSearchChange(t){this.searchRan=!1,this.searchQuery=t,this.$store.commit("setClansSearchState",[]),t&&(this.$store.commit("setClansSearchLoadingState",!0),this.searchClan(t))},searchClan:l()(function(t){this.$store.dispatch("searchClansAction",{q:t,limit:20}).then(t=>{this.$store.commit("mutateSearchAllSourcesOptionsFacetsState",{clans:t.objects}),this.$store.commit("mutateSourcesTextSearchOptionsState",{clans:t.objects}),this.searchRan=!0})},200),clearClanOptions(){this.$store.commit("setClansSearchState",[])},onClanSelect(t){this.$emit("select",t)},onClanRemove(t){this.$emit("remove",t)},clearClan(){this.multiple?this.$emit("clear",{}):this.$emit("select",{})},getChineseNameDisplay(t){return t.name_hant&&t.name_ch!==t.name_hant?`${t.name_ch} / ${t.name_hant}`:t.display||t.name_ch},getEnglishNameDisplay(t){let e=[t.pinyin];const s=t.pinyin&&t.pinyin.toLowerCase(),i=t.alias&&t.alias.toLowerCase();s&&i&&s!==i&&t.name_ch!==i&&t.name_hant!==i&&e.push(t.alias);const a=e.join(" / ");return a||""},customLabel(t,e){const s=this.getChineseNameDisplay(t),i=this.getEnglishNameDisplay(t);return`${s} ${i}`}},name:"SurnameInput",components:{McrMultiselect:o.A}},p=h,m=s(81656),g=(0,m.A)(p,i,a,!1,null,"2e67900d",null),f=g.exports},76352:function(t,e,s){s.d(e,{A:function(){return yt}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"editor-wrapper input",on:{drop:function(e){return e.preventDefault(),t.onDrop.apply(null,arguments)}}},[t.editor?e("div",{staticClass:"main-toolbar"},[e("div",{staticClass:"editor-toolbar",class:{collapsed:t.toolbarCollapsed}},[e("mcr-button",{staticClass:"small white",class:{active:t.isActive("bold")},on:{click:t.toggleBold}},[e("strong",[t._v("B")])]),e("mcr-button",{staticClass:"small white",class:{active:t.isActive("italic")},on:{click:t.toggleItalic}},[e("em",[t._v("I")])]),t.allowHighlight?e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Highlight"},expression:"{content: 'Highlight'}"},{name:"click-outside",rawName:"v-click-outside",value:t.closeHighlightPalette,expression:"closeHighlightPalette"}],ref:"highlightButton",staticClass:"small white highlight-button",class:{active:t.isActive("highlight")},on:{click:t.openHighlightPalette}},[e("marker-icon",{attrs:{size:16}}),e("div",{staticClass:"color-preview",style:{backgroundColor:t.highlightColor},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.openHighlightPalette.apply(null,arguments)}}}),t.showHighlightPalette?e("highlight-color-picker",{attrs:{colors:t.highlightColors,"active-color":t.highlightColor},on:{select:t.setHighlightColor,clear:t.clearHighlight}}):t._e()],1):t._e(),t.allowImages?e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Attach file"},expression:"{content: 'Attach file'}"}],staticClass:"small white",on:{click:t.triggerFilePicker}},[e("paperclip-icon",{attrs:{size:18}}),t._v(" "),e("span",{staticClass:"text"},[t._v("Attach")])],1):t._e(),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"}],staticClass:"small white",class:{active:t.isActive("bulletList")},on:{click:t.toggleBulletList}},[e("list-icon",{attrs:{size:24}})],1),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"}],staticClass:"small white",class:{active:t.isActive("orderedList")},on:{click:t.toggleOrderedList}},[e("list-numbered-icon",{attrs:{size:24}})],1),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"}],staticClass:"small white",class:{active:t.isInTable},on:{click:function(e){t.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}}},[e("table-icon",{attrs:{size:24}})],1),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"},{name:"tooltip",rawName:"v-tooltip",value:t.linkButtonTooltip,expression:"linkButtonTooltip"}],staticClass:"small white",class:{active:t.isRegularLinkActive},attrs:{disabled:!t.showLinkButton},on:{click:t.setLink}},[e("link-icon",{attrs:{size:24}}),e("span",{staticClass:"text"},[t._v("Link")])],1),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"},{name:"tooltip",rawName:"v-tooltip",value:t.popupButtonTooltip,expression:"popupButtonTooltip"}],staticClass:"small white",class:{active:t.isPopupLinkActive},attrs:{disabled:!t.showLinkButton},on:{click:t.addPopupLink}},[e("link-plus-icon",{attrs:{size:24}}),e("span",{staticClass:"text"},[t._v("Popup Note")])],1),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"},{name:"tooltip",rawName:"v-tooltip",value:t.unlinkButtonTooltip,expression:"unlinkButtonTooltip"}],staticClass:"small white",attrs:{disabled:!t.showUnlinkButton},on:{click:t.unsetLink}},[e("link-off-icon",{attrs:{size:24}}),e("span",{staticClass:"text"},[t._v("Clear")])],1),t._t("extra-actions"),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().und
1o().run()}}},[e("span",{staticClass:"text"},[t._v("Undo")])]),e("mcr-button",{directives:[{name:"show",rawName:"v-show",value:!t.toolbarCollapsed,expression:"!toolbarCollapsed"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().redo().run()}}},[e("span",{staticClass:"text"},[t._v("Redo")])]),e("mcr-button",{staticClass:"small white toolbar-toggle",attrs:{"aria-label":t.toolbarCollapsed?"Expand toolbar":"Collapse toolbar"},on:{click:t.toggleToolbar}},[t.toolbarCollapsed?e("chevron-down-icon",{attrs:{size:20}}):e("chevron-up-icon",{attrs:{size:20}})],1)],2),e("transition",{attrs:{name:"expand"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.isInTable,expression:"isInTable"}],staticClass:"editor-toolbar table-toolbar"},[e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Add column before"},expression:"{content: 'Add column before'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().addColumnBefore().run()}}},[e("table-column-plus-before-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Add column after"},expression:"{content: 'Add column after'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().addColumnAfter().run()}}},[e("table-column-plus-after-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Delete column"},expression:"{content: 'Delete column'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().deleteColumn().run()}}},[e("table-column-remove-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Add row before"},expression:"{content: 'Add row before'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().addRowBefore().run()}}},[e("table-row-plus-before-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Add row after"},expression:"{content: 'Add row after'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().addRowAfter().run()}}},[e("table-row-plus-after-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Delete row"},expression:"{content: 'Delete row'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().deleteRow().run()}}},[e("table-row-remove-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Merge cells"},expression:"{content: 'Merge cells'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().mergeCells().run()}}},[e("table-merge-cells-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Split cell"},expression:"{content: 'Split cell'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().splitCell().run()}}},[e("table-split-cell-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Toggle header column"},expression:"{content: 'Toggle header column'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().toggleHeaderColumn().run()}}},[e("table-column-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Toggle header row"},expression:"{content: 'Toggle header row'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().toggleHeaderRow().run()}}},[e("table-row-icon")],1),e("mcr-button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Delete table"},expression:"{content: 'Delete table'}"}],staticClass:"small white",on:{click:function(e){t.editor.chain().focus().deleteTable().run()}}},[e("table-remove-icon")],1)],1)])],1):t._e(),t.editor?e("editor-content",{staticClass:"main-content",attrs:{editor:t.editor}}):t._e(),t.allowImages?e("input",{ref:"fileInput",staticClass:"sr-only",attrs:{type:"file",multiple:""},on:{change:t.onFilePicked}}):t._e()],1)},a=[],o=(s(74423),s(44114),s(18111),s(22489),s(20116),s(7588),s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698),s(77984)),n=s(13321),r=s(27846),l=s(98005),c=s(34084),u=s(27369),d=s(86596),h=s(37332),p=s(17296),m=s(75481),g=s(83754),f=s(80291),v=s(70869),C=s(85747),b=s(53316),y=s(54430),_=s(60435),S=s(77171),w=s(29528),A=s(64103),k=s(28400),I=s(50643),x=s(69942),D=s(82640),L=s(6353),T=s(26305),$=s(72961),P=s(98832),R=s(68249),M=s(42845);function O(t){return(0,n.$f)(16)}const B=R.Ay.extend({addOptions(){return{...this.parent?.(),md5:O,onPopupLinkClick:null}},addAttributes(){return{...this.parent?.(),href:{default:null},"data-popup-id":{default:null,parseHTML:t=>t.getAttribute("data-popup-id"),renderHTML:t=>t["data-popup-id"]?{"data-popup-id":t["data-popup-id"]}:{}},"data-popup-message":{default:null,parseHTML:t=>t.getAttribute("data-popup-message"),renderHTML:t=>t["data-popup-message"]?{"data-popup-message":t["data-popup-message"]}:{}},class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}},renderHTML({HTMLAttributes:t}){return["a",t,0]},addProseMirrorPlugins(){return[new M.k_({key:new M.hs("handlePopupLinkClick"),props:{handleClick:(t,e,s)=>{let i=s.target;i&&3===i.nodeType&&(i=i.parentElement);const a=i&&i.closest&&i.closest("a");if(a){const e=a.getAttribute("data-popup-message"),i=a.getAttribute("data-popup-id"),o=a.getAttribute("href");return e||i?(s.preventDefault(),this.options.onPopupLinkClick?.({message:e,id:i,href:o,view:t})):o&&this.options.openOnClick&&(s.preventDefault(),window.open(o,"_blank")),!0}return!1}}})]}});var N,E,H=B,F=H,U=s(81656),z=(0,U.A)(F,N,E,!1,null,null,null),j=z.exports,V=s(24127),W=s(53230),Q=s(88077),q=s(94589);const Y=Q.bP.create({name:"filePlaceholder",group:"block",atom:!0,addAttributes(){return{id:{default:null},name:{default:null},progress:{default:0},url:{default:null},attachmentId:{default:null},status:{default:"uploading"}}},parseHTML(){return[{tag:"file-placeholder"}]},renderHTML({HTMLAttributes:t}){const e={...t};return e.attachmentId&&(e["data-attachment-id"]=e.attachmentId),["file-placeholder",e]},addNodeView(){return({node:t,getPos:e,editor:s})=>{const i=t.attrs.attachmentId;let a=null,o=null,n=null;const r=()=>{n&&(n.remove(),n=null)},l=t=>{o&&(n||(n=document.createElement("div"),n.className="error",o.appendChild(n)),n.textContent=t)},c=t=>{a&&(a.disabled=t,a.textContent=t?"Transcribingâ¦":"Transcribe")},u=async()=>
1{if(i){r(),c(!0);try{const a=await V.A.research.transcribeNoteAsset({assetId:i}),o=a?.text;if(o&&s&&"function"===typeof e){const i=e()+t.nodeSize;s.chain().focus().insertContentAt(i,{type:"paragraph",content:[{type:"text",text:o}]}).run()}}catch(a){console.error("Transcribe error",a);const t=a&&a.response&&a.response.data&&a.response.data.error||"Transcription failed. Please try again.";l(t)}finally{c(!1)}}},d=t=>{if(!t)return!1;const e=t.split("."),s=e.length>1?e.pop().toLowerCase():"";return W.A.audioExtensions.includes(s)},h=document.createElement("div");h.className="file-placeholder",t.attrs.attachmentId&&(h.dataset.attachmentId=t.attrs.attachmentId);const p=document.createElement("div");p.className="name",p.textContent=t.attrs.name||"Uploadingâ¦";const m=document.createElement("div");m.className="bar";const g=document.createElement("div");if(g.className="progress",g.style.width=`${t.attrs.progress}%`,m.appendChild(g),h.appendChild(p),h.appendChild(m),"error"===t.attrs.status){const e=document.createElement("div");e.textContent=`â Failed to upload ${t.attrs.name}`,h.classList.add("error"),h.appendChild(e)}else if("done"===t.attrs.status){h.classList.add("done");const e=document.createElement("a");e.href=t.attrs.url,e.textContent=t.attrs.name,e.rel="noopener noreferrer",e.target="_blank",e.className="file-link",h.innerHTML="",h.appendChild(e),d(t.attrs.name)&&(o=document.createElement("div"),o.className="transcribe-wrap",a=document.createElement("button"),a.type="button",a.className="transcribe-btn",a.textContent="Transcribe",a.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),u()}),o.appendChild(a),h.appendChild(o))}return{dom:h,transcribe:u}}}}),G=q.Ay.extend({addAttributes(){return{...this.parent?.(),id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},filename:{default:null,parseHTML:t=>t.getAttribute("data-filename"),renderHTML:t=>t.filename?{"data-filename":t.filename}:{}},width:{default:null,parseHTML:t=>t.getAttribute("width"),renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>t.getAttribute("height")||null,renderHTML:t=>t.height?{height:t.height}:{}},"data-loading":{default:null,parseHTML:t=>t.getAttribute("data-loading"),renderHTML:t=>t["data-loading"]?{"data-loading":t["data-loading"]}:{}}}},addNodeView(){return({node:t,getPos:e,editor:s,update:i})=>{const a=document.createElement("div");a.className="resizable-image-wrapper";const o=document.createElement("img");o.src=t.attrs.src,o.onload=()=>{if(!t.attrs.width||!t.attrs.height){const t=o.offsetWidth,i=o.offsetHeight;s.chain().focus().setNodeSelection(e()).updateAttributes("image",{width:t,height:i}).run()}},o.draggable=!1,t.attrs.width&&(o.style.width=`${t.attrs.width}px`,o.setAttribute("width",t.attrs.width)),t.attrs.height&&(o.style.height=`${t.attrs.height}px`,o.setAttribute("height",t.attrs.height));const n=document.createElement("div");n.className="image-loader",t.attrs["data-loading"]||(n.style.display="none");const r=document.createElement("div");r.className="resize-handle resize-handle-br";const l=document.createElement("div");l.className="resize-handle resize-handle-tl",r.style.display="none",l.style.display="none";const c=()=>{const{from:t,to:i}=s.state.selection,o=e?.(),n=o>=t&&o<i;n?(a.classList.add("selected"),r.style.display="block",l.style.display="block"):(a.classList.remove("selected"),r.style.display="none",l.style.display="none")},u=()=>{t.attrs["data-loading"]?(n.style.display="flex",o.classList.add("loading")):(n.style.display="none",o.classList.remove("loading"))};u();const d=()=>c();s.on("selectionUpdate",d),c(),a.style.touchAction="none",o.style.touchAction="none";const h=(t,i)=>{t.preventDefault(),t.stopPropagation();const a=t.clientX,n=o.getBoundingClientRect().width,r=o.getBoundingClientRect().height,l=r/n,c=t=>{t.preventDefault();const e=t.clientX-a,s=Math.max(50,"tl"===i?n-e:n+e),r=Math.round(s*l);o.style.width=`${s}px`,o.style.height=`${r}px`},u=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",u);const t=o.offsetWidth,i=o.offsetHeight;s.chain().focus().setNodeSelection(e()).updateAttributes("image",{width:t,height:i}).run()};window.addEventListener("pointermove",c,{passive:!1}),window.addEventListener("pointerup",u),window.addEventListener("pointercancel",u)};return r.addEventListener("pointerdown",t=>h(t,"br")),l.addEventListener("pointerdown",t=>h(t,"tl")),a.appendChild(o),a.appendChild(n),a.appendChild(r),a.appendChild(l),{dom:a,update:e=>e.type===t.type&&(t=e,o.src=e.attrs.src,e.attrs.width&&(o.style.width=`${e.attrs.width}px`,o.setAttribute("width",e.attrs.width)),e.attrs.height&&(o.style.height=`${e.attrs.height}px`,o.setAttribute("height",e.attrs.height)),u(),c(),!0),destroy(){s.off("selectionUpdate",d)}}}}});var J=function(){var t=this,e=t._self._c;return e("div",{staticClass:"color-picker",on:{click:function(t){t.stopPropagation()}}},[e("span",{staticClass:"color-swatch clear",attrs:{role:"button",tabindex:"0","aria-label":"Clear highlight"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.$emit("clear")},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.$emit("clear"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.stopPropagation(),e.preventDefault(),t.$emit("clear"))}]}}),t._l(t.colors,function(s){return e("span",{key:s,staticClass:"color-swatch",class:{active:t.activeColor===s},style:{backgroundColor:s},attrs:{role:"button",tabindex:"0","aria-label":"Select highlight color"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.$emit("select",s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.$emit("select",s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.stopPropagation(),e.preventDefault(),t.$emit("select",s))}]}})})],2)},X=[],K={name:"HighlightColorPicker",props:{colors:{type:Array,required:!0},activeColor:{type:String,required:!0}}}
1,Z=K,tt=(0,U.A)(Z,J,X,!1,null,"28217594",null),et=tt.exports,st=s(24260);const it={default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}};class at extends c.Qg{constructor(t,e){super(t,e),this.syncClass(t)}update(t){const e=super.update(t);return e&&this.syncClass(t),e}syncClass(t){this.table.className=t.attrs.class||""}}const ot=st.A.extend({addAttributes(){return{...this.parent?.(),class:it}}}),nt=c.XI.extend({addAttributes(){return{...this.parent?.(),class:it}}}),rt=c.Hj.extend({addAttributes(){return{class:it}}}),lt=c.nA.extend({addAttributes(){return{...this.parent?.(),class:it}}}),ct=c.A0.extend({addAttributes(){return{...this.parent?.(),class:it}}});s(79577),s(16632),s(34226),s(9486),s(20456),s(64979);const ut=t=>t?"string"===typeof t?t:`${t.url||t.attachment||t.href||t.src||""}`.trim():"",dt=t=>/^https?:\/\//i.test(`${t||""}`.trim()),ht=t=>/^data:image\/[^;,]+;base64,/i.test(`${t||""}`.trim()),pt=t=>/^(blob:|filesystem:)/i.test(`${t||""}`.trim()),mt=({src:t,assetUrls:e=[],processingSrcs:s=[],uploadedSrcs:i=[]}={})=>{const a=`${t||""}`.trim();return!(!a||pt(a))&&(!(!dt(a)&&!ht(a))&&![...e,...s,...i].includes(a))},gt=(t,e="pasted-image.png")=>{const s=`${t||""}`.trim();if(!s)return e;if(ht(s)){const t=s.match(/^data:(image\/[^;,]+);base64,/i)?.[1]||"",e=t.split("/")[1]||"png";return`pasted-image.${e.replace("jpeg","jpg")}`}const i=s.split("?")[0].split("#")[0],a=i.split("/").filter(Boolean).pop()||"";let o=a;try{o=decodeURIComponent(a)}catch{o=a}return o=o.trim(),o||e},ft=(t,e=gt(t))=>{const s=`${t||""}`.match(/^data:(image\/[^;,]+);base64,(.+)$/i);if(!s)throw new Error("Invalid image data URL.");const i=s[1],a=atob(s[2]),o=new Uint8Array(a.length);for(let n=0;n<a.length;n+=1)o[n]=a.charCodeAt(n);return new File([o],e,{type:i})};var vt={props:{value:{type:String,default:""},valueJson:{type:Object},placeholder:{type:String,default:"Write your story hereâ¦"},withJson:{type:Boolean,default:!1},openLinks:{type:Boolean,default:!1},allowHighlight:{type:Boolean,default:!1},allowImages:{type:Boolean,default:!1},assetUrls:{type:Array,default:()=>[]},uploadFile:Function,uploadImageUrl:Function},data(){return{editor:null,toolbarCollapsed:this.$store.getters.windowWidthState<this.$breakpoints.tablet,highlightColor:"#fef08a",highlightColors:["#fef08a","#bbf7d0","#bfdbfe","#fecaca","#fbcfe8","#fed7aa"],showHighlightPalette:!1,processingImageSrcs:new Set,uploadedImageSrcs:new Set}},watch:{value(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t,!1)},isMobile:{immediate:!0,handler(t){!t&&this.toolbarCollapsed&&(this.toolbarCollapsed=!1)}}},mounted(){const t=[u.A.configure({link:!1,paragraph:!1}),ot,j.configure({autolink:!0,linkOnPaste:!0,openOnClick:this.openLinks,onPopupLinkClick:({message:t,id:e,href:s})=>{this.$store.commit("setGlossaryWikiDataState",{content:t}),this.$store.commit("setGlossaryWikiNaturalIdState",null)}}),l.A.configure({placeholder:this.placeholder}),c.R0.configure({table:!1,tableRow:!1,tableCell:!1,tableHeader:!1}),nt.configure({resizable:!0,View:at}),rt,lt,ct,r.f4.configure({multicolor:!0})];this.allowImages&&(t.push(G.configure({inline:!0,allowBase64:!0,resizeIconSize:18,minWidth:50,maxWidth:800})),t.push(Y));const e=this.valueJson&&Object.keys(this.valueJson).length>0?this.valueJson:this.value;this.editor=new d.KE({content:e,extensions:t,onUpdate:()=>{const t=this.editor.getJSON(),e=this.editor.getHTML(),s=this.withJson?{json:t,html:e}:e;this.$emit("input",s),this.processInsertedImages()},onFocus:({editor:t,event:e})=>{this.$emit("focus",e)},onBlur:({editor:t,event:e})=>{this.$emit("blur",e)},onSelectionUpdate:()=>{this.syncHighlightColor()}}),this.handlePasteImage(),this.syncHighlightColor()},destroyed(){this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.editor=null},computed:{showLinkButton(){return this.editor&&!1===this.editor.state.selection.empty},showUnlinkButton(){return this.editor&&this.editor.isActive("link")},isPopupLinkActive(){if(!this.editor)return!1;const t=this.editor.getAttributes("link").class||"";return t.split(/\s+/).includes("popup-trigger")},isRegularLinkActive(){if(!this.editor)return!1;const t=this.editor.getAttributes("link").class||"";return!!this.editor.getAttributes("link").href&&!t.split(/\s+/).includes("popup-trigger")},linkButtonTooltip(){if(!this.showLinkButton)return{content:"Select text to turn it into a clickable link",triggers:["click","hover"]}},popupButtonTooltip(){if(!this.showLinkButton)return{content:"Select text to attach a popup note",triggers:["click","hover"]}},unlinkButtonTooltip(){const t=this.showUnlinkButton?["hover"]:["click","hover"];return{content:"Remove link or popup from selected text",triggers:t}},isInTable(){return this.editor&&this.editor.isActive("table")},isMobile(){return this.$store.getters.windowWidthState<this.$breakpoints.tablet}},methods:{toggleBold(){this.editor.chain().focus().toggleBold().run()},toggleItalic(){this.editor.chain().focus().toggleItalic().run()}
1,openHighlightPalette(){this.editor&&(this.showHighlightPalette=!0)},setHighlightColor(t){this.highlightColor=t;const{to:e}=this.editor.state.selection;this.selectionIsEmpty()?this.editor.chain().focus().setHighlight({color:t}).run():(this.editor.chain().focus().extendMarkRange("highlight").setHighlight({color:t}).setTextSelection(e).run(),this.clearStoredHighlight()),this.showHighlightPalette=!1},clearHighlight(){const{to:t}=this.editor.state.selection;this.selectionIsEmpty()?this.editor.chain().focus().unsetHighlight().run():this.editor.chain().focus().unsetHighlight().setTextSelection(t).run(),this.clearStoredHighlight(),this.showHighlightPalette=!1},selectionIsEmpty(){if(!this.editor)return!0;const{from:t,to:e}=this.editor.state.selection;return t===e},clearStoredHighlight(){const t=this.editor.state.storedMarks||this.editor.state.selection.$from.marks(),e=t.filter(t=>"highlight"!==t.type.name);this.editor.view.dispatch(this.editor.state.tr.setStoredMarks(e))},syncHighlightColor(){if(!this.editor)return;const t=this.editor.getAttributes("highlight").color;t&&(this.highlightColor=t)}
1,closeHighlightPalette(){this.showHighlightPalette=!1},toggleBulletList(){this.editor.chain().focus().toggleBulletList().run()},toggleOrderedList(){this.editor.chain().focus().toggleOrderedList().run()},isActive(t){return this.editor.isActive(t)},triggerFilePicker(){this.$refs.fileInput?.click()},onFilePicked(t){const e=t.target.files;e&&e.length&&(this.insertFiles(e),t.target.value="")},setLink(){const t=this.promptForUrl();if(null===t)return;if(""===t)return void this.unsetLink();this.editor.chain().focus().extendMarkRange("link").setLink({href:t}).run();const{to:e}=this.editor.state.selection;this.editor.chain().focus().setTextSelection(e).unsetMark("link").run()},promptForUrl(){const t=this.editor.getAttributes("link").href||"",e=window.prompt("Enter the URL (e.g. https://example.com)",t);return e&&/^https?:\/\//i.test(e)||""===e?e:(e&&this.$toasted.error("Please include http:// or https://. The link wasnât saved."),null)},unsetLink(){this.editor.chain().focus().unsetLink().run()},addPopupLink(){const t=this.editor.getAttributes("link"),e=t.class||"",s=e.split(/\s+/).includes("popup-trigger"),{from:i,to:a}=this.editor.state.selection;if(i===a)return;const o=this.editor.state.doc.textBetween(i,a," ");let n="";s&&(n=t["data-popup-message"]||"");const r=window.prompt("Enter the popup message:",n);if(null===r)return;if(""===r)return void this.unsetLink();const l="popup-"+this.editor.extensionManager.extensions.find(t=>"link"===t.name).options.md5(r).slice(0,8);this.editor.chain().focus().insertContentAt({from:i,to:a},{type:"text",text:o,marks:[{type:"link",attrs:{href:"#",class:"popup-trigger","data-popup-id":l,"data-popup-message":r}}]}).setTextSelection(a).unsetMark("link").run()},handlePasteImage(){this.editor.view.dom.addEventListener("paste",t=>{let e=!1;const s=t.clipboardData?.items||[];for(const i of s)if(i.type.startsWith("image/")&&(e=!0,this.allowImages)){const t=i.getAsFile();t&&this.insertAndUploadImage(t)}e&&t.preventDefault()})},onDrop(t){if(!this.allowImages)return;const e=Array.from(t.dataTransfer.files),{left:s,top:i}={left:t.clientX,top:t.clientY},a=this.editor.view.posAtCoords({left:s,top:i})?.pos;e.forEach(t=>this.insertAndUploadImage(t,a))},insertFiles(t,e=null){if(!t||!t.length)return;const s=e??this.editor?.state?.selection?.from;Array.from(t).forEach(t=>this.insertAndUploadImage(t,s))},toggleToolbar(){this.toolbarCollapsed=!this.toolbarCollapsed},insertAndUploadImage(t,e=null){const s=(0,n.$f)(),i=t.type.startsWith("image/"),a=e??this.editor.state.selection.from;let o=null;i?(o=URL.createObjectURL(t),this.editor.chain().focus().insertContentAt(a,[{type:"image",attrs:{src:o,id:s,filename:t.name,"data-loading":"true"}},{type:"paragraph"},{type:"paragraph"}]).run()):this.editor.chain().focus().insertContentAt(a,{type:"filePlaceholder",attrs:{id:s,name:t.name,progress:0,status:"uploading"}}).run(),this.uploadFile(t,t=>{this.updateProgress(s,t)}).then(t=>{this.replaceNodeById(s,t)}).catch(()=>{this.markErrorById(s)}).finally(()=>{o&&URL.revokeObjectURL(o)})},processInsertedImages(){if(!this.allowImages||!this.uploadFile||!this.editor)return;const t=[];this.editor.state.doc.descendants(e=>{if("image"!==e.type.name||e.attrs["data-loading"])return!0;const s=`${e.attrs.src||""}`.trim();if(dt(s)&&!this.uploadImageUrl)return!0;const i=mt({src:s,assetUrls:this.assetUrls,processingSrcs:Array.from(this.processingImageSrcs),uploadedSrcs:Array.from(this.uploadedImageSrcs)});return i&&!t.includes(s)&&t.push(s),!0}),t.forEach(t=>this.uploadInsertedImageSrc(t))},async uploadInsertedImageSrc(t){if(this.processingImageSrcs.has(t))return;const e=(0,n.$f)(),s=gt(t);this.processingImageSrcs.add(t),this.markImageNodesUploadingBySrc(t,e,s);try{const i=await this.uploadImageSource(t,s),a=ut(i);a&&this.uploadedImageSrcs.add(a),this.replaceNodeById(e,i)}catch(i){this.clearImageUploadStateById(e,t);const s=i?.response?.data?.error||i?.response?.data?.detail||"Image was not uploaded.";this.$toasted?.error(s)}finally{this.processingImageSrcs.delete(t)}},async uploadImageSource(t,e){if(dt(t)&&this.uploadImageUrl)return this.uploadImageUrl(t);if(ht(t)){const s=ft(t,e);return this.uploadFile(s,()=>{})}throw new Error("Unsupported image source.")},markImageNodesUploadingBySrc(t,e,s){const{state:i,view:a,schema:o}=this.editor,n=i.tr;i.doc.descendants((i,a)=>
1{if("image"===i.type.name&&i.attrs.src===t&&!i.attrs["data-loading"]){const t=o.nodes.image.create({...i.attrs,id:e,filename:s,"data-loading":"true"});n.replaceWith(a,a+i.nodeSize,t)}return!0}),n.docChanged&&a.dispatch(n)},replaceNodeById(t,e){const{state:s,view:i,schema:a}=this.editor,o=s.tr,n="object"===typeof e&&null!==e,r=ut(e),l=n?e.id:null,c=n?e.name:null;s.doc.descendants((e,s)=>{if(e.attrs.id===t){if("image"===e.type.name){r&&this.uploadedImageSrcs.add(r);const i=a.nodes.image.create({...e.attrs,src:r,id:t,"data-loading":null});o.replaceWith(s,s+e.nodeSize,i)}else if("filePlaceholder"===e.type.name){const t=a.nodes.filePlaceholder.create({id:e.attrs.id,attachmentId:l||e.attrs.attachmentId,name:c||e.attrs.name,url:r,status:"done"});o.replaceWith(s,s+e.nodeSize,t)}return!1}return!0}),i.dispatch(o)},clearImageUploadStateById(t,e){const{state:s,view:i,schema:a}=this.editor,o=s.tr;s.doc.descendants((s,i)=>{if("image"===s.type.name&&s.attrs.id===t){const t=a.nodes.image.create({...s.attrs,src:e,id:null,"data-loading":null});o.replaceWith(i,i+s.nodeSize,t)}return!0}),o.docChanged&&i.dispatch(o)},markErrorById(t){const{state:e,view:s,schema:i}=this.editor,a=e.tr;e.doc.descendants((e,s)=>{if(e.attrs.id===t){if("image"===e.type.name){const t=i.text(`[Image upload failed: ${e.attrs.filename}]`);a.replaceWith(s,s+e.nodeSize,t)}else if("filePlaceholder"===e.type.name){const t=i.nodes.filePlaceholder.create({...e.attrs,status:"error"});a.replaceWith(s,s+e.nodeSize,t)}return!1}return!0}),s.dispatch(a)},updateProgress(t,e){const{state:s,view:i,schema:a}=this.editor,o=s.tr;s.doc.descendants((s,i)=>{if(s.attrs.id===t&&"filePlaceholder"===s.type.name){const t=a.nodes.filePlaceholder.create({...s.attrs,progress:e});return o.replaceWith(i,i+s.nodeSize,t),!1}return!0}),i.dispatch(o)}},components:{McrButton:o.A,LinkIcon:f.A,LinkPlusIcon:C.A,LinkOffIcon:v.A,EditorContent:d.$Z,ListIcon:m.A,ListNumberedIcon:g.A,TableIcon:I.A,TableMergeCellsIcon:k.A,TableSplitCellIcon:P.A,TableColumnPlusAfterIcon:S.A,TableColumnPlusBeforeIcon:w.A,TableColumnRemoveIcon:A.A,TableRowPlusAfterIcon:L.A,TableRowPlusBeforeIcon:T.A,TableRowRemoveIcon:$.A,TableRowIcon:D.A,TableColumnIcon:_.A,TableRemoveIcon:x.A,MarkerIcon:b.A,PaperclipIcon:y.A,ChevronDownIcon:h.A,ChevronUpIcon:p.A,HighlightColorPicker:et}},Ct=vt,bt=(0,U.A)(Ct,i,a,!1,null,"0fcfee4e",null),yt=bt.exports},88110:function(t,e,s){s.d(e,{A:function(){return c}});var i=function(){var t=this,e=t._self._c;return t.sessions.length?e("ol",{staticClass:"skill-session-chain-confirm-list"},t._l(t.sessions,function(s,i){return e("li",{key:s.id,staticClass:"skill-session-chain-confirm-list-item text-sm"},[e("span",{staticClass:"skill-session-chain-confirm-list-number",attrs:{"aria-hidden":"true"}},[t._v(t._s(i+1))]),e("span",{staticClass:"skill-session-chain-confirm-list-content"},[e("span",{staticClass:"skill-session-chain-confirm-list-title"},[t._v(t._s(t.getSessionTitle(s)))]),s.skill_name?e("span",{staticClass:"skill-session-chain-confirm-list-skill supplemental"},[t._v(" "+t._s(s.skill_name)+" ")]):t._e()])])}),0):t._e()},a=[],o={props:{sessions:{type:Array,default:()=>[]}},methods:{getSessionTitle(t){return t?.title||t?.skill_name||t?.skill_type||"Skill Session"}},name:"SkillSessionChainConfirmList"},n=o,r=s(81656),l=(0,r.A)(n,i,a,!1,null,"2c03306c",null),c=l.exports},25346:function(t,e,s){s.d(e,{A:function(){return f}});var i=function(){var t=this,e=t._self._c;return t.sessionId&&t.isSessionOpen?e("div",{staticClass:"skill-session-control",class:{"row-control":t.rowControl}},[t.isSessionOpen?e("v-dropdown",{staticClass:"session-control-dropdown",attrs:{"auto-hide":!0,offset:8,placement:t.placement}},[e("button",{staticClass:"session-control-button",attrs:{type:"button","aria-label":"Session controls"}},[e("dots-vertical-icon",{attrs:{size:20,"aria-hidden":"true"}})],1),e("div",{staticClass:"popover-content session-control-menu",attrs:{slot:"popper"},slot:"popper"},[e("button",{directives:[{name:"close-popper",rawName:"v-close-popper",value:!0,expression:"true"}],staticClass:"session-control-item",attrs:{type:"button",disabled:t.isUpdating},on:{click:t.closeSession}},[e("lock-outline-icon",{attrs:{size:18,"aria-hidden":"true"}}),t._v(" "+t._s(t.isUpdating?"Closing...":"Close session")+" ")],1),t.showCloseChain?e("button",{directives:[{name:"close-popper",rawName:"v-close-popper",value:!0,expression:"true"}],staticClass:"session-control-item",attrs:{type:"button",disabled:t.isUpdating},on:{click:t.openCloseSessionChainConfirm}},[e("link-lock-icon",{attrs:{size:18,"aria-hidden":"true"}}),t._v(" "+t._s(t.isUpdating?"Closing...":"Close Chain")+" ")],1):t._e(),t.showReset?e("button",{directives:[{name:"close-popper",rawName:"v-close-popper",value:!0,expression:"true"}],staticClass:"session-control-item",attrs:{type:"button",disabled:t.isUpdating},on:{click:t.resetSession}},[e("restore-icon",{attrs:{size:18,"aria-hidden":"true"}}),t._v(" "+t._s(t.isUpdating?"Resetting...":"Reset session")+" ")],1):t._e()])]):t._e(),e("modal",{attrs:{name:t.closeSessionChainConfirmModalName,classes:"clear_modal"}}
1,[e("delete-confirm-modal-content",{attrs:{"modal-name":t.closeSessionChainConfirmModalName,loading:t.isUpdating},on:{confirm:t.closeSessionChain}},[e("h5",[t._v(t._s(t.closeSessionChainConfirmationMessage))]),t.closeSessionChainFetchErrorMessage?e("div",{staticClass:"input-error text-sm",attrs:{role:"alert"}},[t._v(" "+t._s(t.closeSessionChainFetchErrorMessage)+" ")]):t._e(),t.closeSessionChainLoading?e("div",{staticClass:"text-sm supplemental"},[t._v("Loading sessions...")]):e("skill-session-chain-confirm-list",{attrs:{sessions:t.closeSessionChainSessions}})],1)],1)],1):t._e()},a=[],o=(s(18111),s(61701),s(24127)),n=s(55950),r=s(14003),l=s(42128),c=s(27168),u=s(18169),d=s(88110),h={props:{placement:{type:String,default:"bottom-end"},rowControl:{type:Boolean,default:!1},session:{type:Object,required:!0},showReset:{type:Boolean,default:!1},showCloseChain:{type:Boolean,default:!1},closeChainConfirmationMessage:{type:String,default:""},closeChainSessions:{type:Array,default:()=>[]}},data(){return{isUpdating:!1,closeSessionChainLoading:!1,closeSessionChainFetchErrorMessage:"",fetchedCloseChainSessions:[]}},computed:{isSessionOpen(){return!1!==this.session?.is_open},sessionId(){return`${this.session?.id||""}`.trim()},closeSessionChainConfirmModalName(){return`skill-session-control-close-chain-${this.sessionId}`},closeSessionChainSessions(){const t=this.closeChainSessions.length?this.closeChainSessions:this.fetchedCloseChainSessions;return t.map((t,e)=>({session:t,index:e})).sort((t,e)=>{const s=this.getSessionCreatedAtTime(t.session),i=this.getSessionCreatedAtTime(e.session);return s===i?t.index-e.index:s-i}).map(t=>t.session)},closeSessionChainSessionsCount(){return this.closeSessionChainSessions.length},closeSessionChainConfirmationMessage(){if(this.closeChainConfirmationMessage)return this.closeChainConfirmationMessage;if(this.closeSessionChainSessionsCount){const t=1===this.closeSessionChainSessionsCount?"chained session":"chained sessions";return`Are you sure you want to close ${this.closeSessionChainSessionsCount} ${t}?`}return"Are you sure you want to close this and all sessions in the chain?"}},methods:{getSessionUpdateErrorMessage(t){return t?.response?.data?.detail||t?.response?.data?.message||"Unable to update this session. Please try again."},updateSessionOpenState(t){return!this.sessionId||this.isUpdating?Promise.resolve():(this.isUpdating=!0,o.A.agentSkill.patchAgentSession({session_id:this.sessionId,is_open:t}).then(e=>{this.$emit("session-updated",e||{...this.session,is_open:t})}).catch(t=>{this.$emit("session-control-error",this.getSessionUpdateErrorMessage(t))}).finally(()=>{this.isUpdating=!1}))},closeSession(){return this.updateSessionOpenState(!1)},openCloseSessionChainConfirm(){return this.sessionId?(this.closeSessionChainFetchErrorMessage="",this.closeChainSessions.length?(this.$modal.show(this.closeSessionChainConfirmModalName),Promise.resolve()):(this.closeSessionChainLoading=!0,this.$modal.show(this.closeSessionChainConfirmModalName),o.A.agentSkill.getAgentSessionRelatedSessions({session_id:this.sessionId}).then(t=>{this.fetchedCloseChainSessions=Array.isArray(t)?t:[]}).catch(t=>{this.fetchedCloseChainSessions=[],this.closeSessionChainFetchErrorMessage=this.getSessionUpdateErrorMessage(t)}).finally(()=>{this.closeSessionChainLoading=!1}))):Promise.resolve()},resetSession(){return!this.sessionId||this.isUpdating?Promise.resolve():(this.isUpdating=!0,o.A.agentSkill.resetAgentSession({session_id:this.sessionId}).then(t=>{this.$emit("session-updated",t||this.session)}).catch(t=>{this.$emit("session-control-error",this.getSessionUpdateErrorMessage(t))}).finally(()=>{this.isUpdating=!1}))},closeSessionChain(){return!this.sessionId||this.isUpdating||this.closeSessionChainLoading?Promise.resolve():(this.isUpdating=!0,o.A.agentSkill.closeAgentSessionChain({session_id:this.sessionId}).then(t=>{this.$modal.hide(this.closeSessionChainConfirmModalName),this.$emit("session-chain-closed",t)}).catch(t=>{this.$emit("session-control-error",this.getSessionUpdateErrorMessage(t))}).finally(()=>{this.isUpdating=!1}))},getSessionCreatedAtTime(t){const e=new Date(t?.created_at);return Number.isNaN(e.getTime())?Number.POSITIVE_INFINITY:e.getTime()}},components:{DeleteConfirmModalContent:u.A,DotsVerticalIcon:n.A,LinkLockIcon:r.A,LockOutlineIcon:l.A,RestoreIcon:c.A,SkillSessionChainConfirmList:d.A}},p=h,m=s(81656),g=(0,m.A)(p,i,a,!1,null,"58793112",null),f=g.exports},65245:function(t,e,s){s.d(e,{A:function(){return C}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"skill-session-row"},[e("router-link",{staticClass:"skill-session-link",attrs:{to:t.route}},[e("div",{staticClass:"skill-session-number text-sm bold",attrs:{"aria-hidden":"true"}},[t._v(t._s(t.index))]),e("div",{staticClass:"skill-session-main"},[e("div",{staticClass:"text-sm bold skill-session-title"},[t._v(t._s(t.sessionTitle))]),t.showSkillName&&t.session.skill_name?e("div",{staticClass:"text-sm supplemental skill-session-skill-name"},[e("creation-icon",{attrs:{size:16,"aria-hidden":"true"}}),e("span",[t._v(t._s(t.session.skill_name))])],1):t._e(),e("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.formattedSessionDateTime},expression:"{content: formattedSessionDateTime}"}],staticClass:"text-sm supplemental skill-session-date"},[e("calendar-clock-outline-icon",{attrs:{size:16,"aria-hidden":"true"}}),e("span",[t._v(t._s(t.formattedSessionDate))])],1),t.showOwner&&t.ownerEmail?e("div",{staticClass:"text-sm supplemental skill-session-owner"},[e("account-outline-icon",{attrs:{size:16,"aria-hidden":"true"}}),e("span",[t._v(t._s(t.ownerEmail))])],1):t._e(),t.showClient&&t.clientLabel?e("div",{staticClass:"text-sm supplemental skill-session-client",class:{bold:t.highlightClient}},[e("account-box-outline-icon",{attrs:{size:16,"aria-hidden":"true"}}),e("span",[t._v(t._s(t.clientLabel))])],1):t._e()]),e("div",{staticClass:"skill-session-meta"},[t.isCurrentSession?e("span",{staticClass:"chip slim outlined"},[t._v("Current")]):t._e(),t.session.is_processing?e("span",{staticClass:"chip slim orange"},[t._v("Processing")]):t._e(),t.session.has_changes?e("span",{staticClass:"chip slim outlined"},[t._v("Unsaved changes")]):t._e(),t.feedbackLabel?e("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.feedbackLabel},expression:"{content: feedbackLabel}"}],staticClass:"chip slim outlined skill-session-indicator skill-session-feedback-indicator",class:t.feedbackIndicatorClass,attrs:{role:"img","aria-label":t.feedbackLabel}},[e(t.feedbackIcon,{tag:"component",attrs:{size:18,"aria-hidden":"true"}})],1):t._e(),t.session.has_artifact?e("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:t.artifactLabel},expression:"{content: artifactLabel}"}],staticClass:"chip slim outlined skill-session-indicator",attrs:{role:"img","aria-label":t.artifactLabel}},[e("package-variant-closed-icon",{attrs:{size:18,"aria-hidden":"true"}})],1):t._e(),t.session.has_output?e("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Has output"},expression:"{content: 'Has output'}"}],staticClass:"chip slim outlined skill-session-indicator",attrs:{role:"img","aria-label":"Has output"}},[e("export-icon",{attrs:{size:18,"aria-hidden":"true"}})],1):t._e(),t.session.errors?e("span",{staticClass:"chip slim red"}
1,[t._v("Error")]):t._e()])]),t.showControl&&t.session.is_open?e("skill-session-control",{attrs:{"row-control":"",session:t.session,"show-close-chain":""},on:{"session-chain-closed":function(e){return t.$emit("session-chain-closed",e)},"session-updated":function(e){return t.$emit("session-updated",e)},"session-control-error":function(e){return t.$emit("session-control-error",e)}}}):t._e()],1)},a=[],o=s(44380),n=s(45797),r=s(20148),l=s(63242),c=s(26190),u=s(93770),d=s(57368),h=s(84035),p=s(25346),m={props:{index:{type:Number,required:!0},route:{type:Object,required:!0},highlightClient:{type:Boolean,default:!1},isCurrentSession:{type:Boolean,default:!1},session:{type:Object,required:!0},showControl:{type:Boolean,default:!1},showClient:{type:Boolean,default:!1},showOwner:{type:Boolean,default:!1},showSkillName:{type:Boolean,default:!1}},computed:{sessionTitle(){return this.session.title||this.session.skill_name||this.session.skill_type||"Skill Session"},artifactLabel(){const t=`${this.session.artifact_name||""}`.trim();return t?`Has ${t}`:"Has artifact"},sessionDate(){return this.session.created_at||this.session.updated_at},formattedSessionDate(){return this.formatDisplayDate(this.sessionDate)},formattedSessionDateTime(){return this.formatFullDate(this.sessionDate)},ownerEmail(){return`${this.session.owner?.email||""}`.trim()},clientLabel(){const t=this.session.research_client||{};return`${t.name||"Unnamed client"}`.trim()},feedbackLabel(){return"positive"===this.session.feedback?"Positive feedback":"negative"===this.session.feedback?"Negative feedback":""},feedbackIcon(){return"positive"===this.session.feedback?"thumb-up-outline-icon":"thumb-down-outline-icon"},feedbackIndicatorClass(){return{positive:"positive"===this.session.feedback,negative:"negative"===this.session.feedback}}},methods:{formatDisplayDate(t){const e=this.getValidDate(t);if(!e)return t?`${t}`:"N/A";const s=this.formatTime(e);if(this.isToday(e))return s;const i=[e.toLocaleString("en-US",{month:"long"}),e.toLocaleString("en-US",{day:"2-digit"})],a=this.isCurrentYear(e)?i.join(" "):`${i.join(" ")}, ${e.getFullYear()}`;return`${s} ${a}`},formatFullDate(t){const e=this.getValidDate(t);return e?`${this.formatTime(e)} ${e.toLocaleString("en-US",{month:"long"})} ${e.toLocaleString("en-US",{day:"2-digit"})}, ${e.getFullYear()}`:t?`${t}`:"Date unavailable"},formatTime(t){const e=`${t.getHours()}`.padStart(2,"0"),s=`${t.getMinutes()}`.padStart(2,"0");return`${e}:${s}`},isCurrentYear(t){return t.getFullYear()===(new Date).getFullYear()},isToday(t){const e=new Date;return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()},getValidDate(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}},name:"SkillSessionListItem",components:{AccountBoxOutlineIcon:o.A,AccountOutlineIcon:n.A,CalendarClockOutlineIcon:r.A,CreationIcon:l.A,ExportIcon:c.A,PackageVariantClosedIcon:u.A,SkillSessionControl:p.A,ThumbDownOutlineIcon:d.A,ThumbUpOutlineIcon:h.A}},g=m,f=s(81656),v=(0,f.A)(g,i,a,!1,null,"6e24a6ac",null),C=v.exports},46257:function(t,e,s){s.d(e,{A:function(){return g}});var i=function(){var t=this,e=t._self._c;return e("article",{staticClass:"story-content-part"},[e("div",{staticClass:"story-side"},[e("div",{staticClass:"open-sidebar-button"},[e("mcr-button",{staticClass:"white small square",on:{click:t.showStoryInfoModal}},[e("info-icon",{attrs:{size:20}})],1)],1),e("div",{staticClass:"story-title-container"},[e("router-link",{staticClass:"story-title heading-4",attrs:{to:t.detailsRoute}},[t._v(" "+t._s(t.story.title)+" ")])],1),e("div",{domProps:{innerHTML:t._s(t.story.content_html)},on:{click:t.onContentClick}}),t.storyAssets.length?e("div",{staticClass:"story-gallery"},t._l(t.storyAssets,function(s){return e("file-preview",{key:s.object_id||s.id,attrs:{src:s.url,"mime-type":s.mime_type,filename:s.filename,"use-thumbnail":!1!==s.use_thumbnail},nativeOn:{click:function(e){return t.onStoryAssetClick(s)}}})}),1):t._e()]),e("story-meta-sidebar",t._b({on:{"click-tag":function(e){return t.$emit("click-tag",e)}}},"story-meta-sidebar",t.storyMetaSidebarProps,!1))],1)},a=[],o=(s(18111),s(61701),s(77984)),n=s(40281),r=s(42106),l=s(73210),c=s(77378),u=s(63373),d={props:{story:{type:Object,required:!0},treeId:{type:String,default:""},canEdit:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},computed:{storyAssets(){return Array.isArray(this.story?.assets)?this.story.assets:[]}
1,detailsRoute(){return{name:"stories-detail",params:{treeId:this.treeId,slug:this.story.slug}}},storyMetaSidebarProps(){return{clans:Array.isArray(this.story.clans)?this.story.clans:[],mentionPersons:Array.isArray(this.story.mention_persons)?this.story.mention_persons:[],places:Array.isArray(this.story.places)?this.story.places:[],dateText:this.story.date_text||"",treePersons:Array.isArray(this.story.tree_persons)?this.story.tree_persons:[],sources:Array.isArray(this.story.sources)?this.story.sources:[],tags:Array.isArray(this.story.tags)?this.story.tags:[],isEditable:!!this.story.is_editable,status:this.story.status||"",author:this.story.author||"",publicationDate:this.story.publication_date||"",treeId:this.treeId,storySlug:this.story.slug||"",allowEditButton:this.showEditButton}}},methods:{onStoryAssetClick(t){const e=this.storyAssets.map(t=>({...t,_id:t.object_id||t.id,src:(0,r.dQ)(this,t.filename)||t.url,mainTitle:this.story.title,editable:this.canEdit}));this.$store.commit("setGalleryItemsState",e),this.$store.dispatch("displayGalleryAction",t.object_id||t.id)},onContentClick(t){(0,u.Os)(t,this)},showStoryInfoModal(){const t={classes:"clear_modal white_modal",class:"mobile_bottom",name:"story-info-modal",scrollable:!1},e={...this.storyMetaSidebarProps,inModal:!0,tagClickHandler:t=>{this.$modal.hide("story-info-modal"),this.$emit("click-tag",t)}};this.$modal.show(c.A,e,t)}},name:"StoryContentPart",components:{FilePreview:n.A,InfoIcon:l.A,McrButton:o.A,StoryMetaSidebar:c.A}},h=d,p=s(81656),m=(0,p.A)(h,i,a,!1,null,"522ab5e1",null),g=m.exports},37191:function(t,e,s){s.d(e,{A:function(){return u}});var i=function(){var t=this,e=t._self._c;return e("library-gallery-overlay-container",{attrs:{"show-delete-action":!1}})},a=[],o=s(28210),n={components:{LibraryGalleryOverlayContainer:o.A}},r=n,l=s(81656),c=(0,l.A)(r,i,a,!1,null,"5c3a69c2",null),u=c.exports},77378:function(t,e,s){s.d(e,{A:function(){return M}});var i=function(){var t=this,e=t._self._c;return t.showMetaSidebar?e("div",{staticClass:"meta-sidebar text-sm",class:{"hidden-on-mobile":!t.inModal&&t.hideOnMobile}},[t.tags.length?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("tag-icon",{attrs:{size:16}}),e("span",[t._v("Tags")])],1),e("div",{staticClass:"values"},[e("div",{staticClass:"tags"},t._l(t.tags,function(s){return e("div",{key:s,staticClass:"chip outlined pointer slim",on:{click:function(e){return t.onTagClick(s)}}},["Memory"===s?e("memory-icon",{attrs:{size:16,"aria-hidden":"true"}}):t._e(),t._v(" "+t._s(s)+" ")],1)}),0)])]):t._e(),t.treePersons.length?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("family-icon",{attrs:{size:18}}),e("span",[t._v("Relatives mentioned")])],1),e("div",{staticClass:"values",class:{"people-values":t.treePersons.length>1}},t._l(t.treePersons,function(s){return e("relative-item-compact",{key:s.object_id,attrs:{person:s,"profile-picture":s.profile_picture,"as-row":1===t.treePersons.length}})}),1)]):t._e(),t.places.length?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("places-icon",{attrs:{size:16}}),e("span",[t._v("Places")])],1),e("div",{staticClass:"values offseted"},t._l(t.places,function(s){return e("div",{staticClass:"value"},[e("router-link",{attrs:{to:t.getPlaceDetailRoute(s.id,s.pinyin)}},[t._v(" "+t._s(s.place_name))])],1)}),0)]):t._e(),t.dateText?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("date-icon",{attrs:{size:16}}),e("span",[t._v("Date or Time Period")])],1),e("div",{staticClass:"values offseted"},[t._v(t._s(t.dateText))])]):t._e(),t.clans.length?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("clan-icon",{attrs:{size:18}}),e("span",[t._v("Clans")])],1),e("div",{staticClass:"values offseted"},t._l(t.clans,function(s){return e("div",{staticClass:"value"},[e("router-link",{attrs:{to:t.getSurnameDetailRoute(s.name_hant||s.name_ch)}},[t._v(" "+t._s(t.getClanDisplay(s))+" ")])],1)}),0)]):t._e(),t.mentionPersons.length||t.sources.length?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("records-icon",{attrs:{size:16}}),e("span",[t._v("My China Roots Records")])],1),e("div",{staticClass:"values offseted"},[t._l(t.mentionPersons,function(s){return e("div",{staticClass:"value"},[e("router-link",{attrs:{to:t.getPersonRecordDetailRoute(s.code,s.full_name)}},[t._v(" "+t._s(s.full_name||"Unknown")+" ")]),e("div",{staticClass:"description text-sm"},[e("book-icon",{attrs:{size:16}}),t._v(t._s(s.source_type))],1)],1)}),t._l(t.sources,function(s){return e("div",{staticClass:"value"},[e("router-link",{attrs:{to:t.getSourceDetailRoute(s.id)}},[t._v(" "+t._s(s.full_name||"Unknown")+" ")]),e("div",{staticClass:"description text-sm"},[e("book-icon",{attrs:{size:16}}),t._v(t._s(s.type))],1)],1)})],2)]):t._e(),t.compilations&&t.compilations.length?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("folder-icon",{attrs:{size:16}}),e("span",[t._v("Compilations")])],1),e("div",{staticClass:"values offseted"},t._l(t.compilations,function(s){return e("div",{staticClass:"report-value"},[e("div",{staticClass:"link-container"},[e("router-link",{attrs:{to:{name:"stories-compilation",params:{slug:s.slug,treeId:t.treeId}}}},[t._v(" "+t._s(s.title)+" ")])],1)])}),0)]):t._e(),t.author||t.publicationDate?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("author-icon",{attrs:{size:16}}),e("span",[t._v("Author")])],1),e("div",{staticClass:"values offseted"},[e("div",[e("div",{staticClass:"text-neutral text-sm"},[t.author?e("span",{staticClass:"bold-medium"},[t._v(t._s(t.author))]):t._e(),t.author&&t.publicationDate?e("span",[t._v(" on ")]):t._e(),t.publicationDate?e("span",{staticClass:"bold-medium"},[t._v(t._s(t.publicationDate))]):t._e()])])])]):t._e(),t.isShared?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("ownership-icon",{attrs:{size:16}}),e("span",[t._v("Ownership")])],1),e("div",{staticClass:"values offseted"},[e("div",{staticClass:"value flex text-neutral"},[e("shared-icon",{attrs:{size:16}}),e("span",{staticClass:"text-sm"},[t._v("Shared with me")])],1)])]):t._e(),t.showRecommendations?e("div",{staticClass:"meta-sidebar-item"},[e("div",{staticClass:"label"},[e("alert-icon",{attrs:{size:16}}),e("span",[t._v("Recommendations")])],1),e("div",{staticClass:"values offseted"},[e("ul",{staticClass:"recommendations-list"}
1,t._l(t.recommendations,function(s){return e("li",{key:s.id},[t._v(" "+t._s(s.message)+" ")])}),0)])]):t._e(),t.userIsStaffState?e("div",{staticClass:"meta-sidebar-item bottom-item"},[e("div",{staticClass:"values status-values"},[t.userIsStaffState&&t.status?e("span",{staticClass:"chip",class:{"bg-green":t.isStatusGreen,"bg-red":!t.isStatusGreen}},[t._v(t._s(t.status))]):t._e(),t.userIsStaffState?e("span",{staticClass:"text-sm chip bg-neutral"},[t._v(" User can edit: "+t._s(t.isEditable?"Yes":"No")+" ")]):t._e(),t.showEditButton?e("mcr-button-router-link",{staticClass:"small white",attrs:{to:t.editRoute}},[e("pencil-icon",{attrs:{size:18}}),e("span",[t._v("Edit")])],1):t._e()],1)]):t._e()]):t._e()},a=[],o=s(12273),n=s(7565),r=s(83282),l=s(45978),c=s(17639),u=s(6217),d=s(88894),h=s(40743),p=s(25218),m=s(69228),g=s(84675),f=s(94507),v=s(5580),C=s(27312),b=s(70668),y=s(72419),_=s(95353),S=function(){var t=this,e=t._self._c;return e("div",{staticClass:"relative-item-compact",class:{"as-row":t.asRow}},[e("router-link",{staticClass:"profile-picture",attrs:{to:t.profileRoute}},[t.profilePicture?e("img",{attrs:{src:t.profilePicture,alt:"Profile picture"}}):e("person-icon-colored",{attrs:{gender:t.person.gender}})],1),e("div",[e("div",{staticClass:"person-name text-sm"},[e("router-link",{attrs:{to:t.profileRoute}},[t._v(t._s(t.getName(t.person)))])],1)])],1)},w=[],A=s(89279),k=s(5480),I={props:{person:Object,profilePicture:String,asRow:Boolean},computed:{familyTreeId(){return this.person.family_tree_id||this.$route.params.id},profileRoute(){return{name:"familytree-profile-details",params:{id:this.familyTreeId,personId:this.person.object_id},query:{tab:"timeline"}}}},methods:{getName(t){return t.full_name||A.vr}},components:{PersonIconColored:k.A}},x=I,D=s(81656),L=(0,D.A)(x,S,w,!1,null,"3858988d",null),T=L.exports,$={props:{clans:{type:Array,default:()=>[]},mentionPersons:{type:Array,default:()=>[]},places:{type:Array,default:()=>[]},dateText:{type:String,default:""},treePersons:{type:Array,default:()=>[]},sources:{type:Array,default:()=>[]},tags:{type:Array,default:()=>[]},compilations:{type:Array,default:()=>[]},isEditable:Boolean,isShared:Boolean,author:String,publicationDate:String,status:String,recommendations:{type:Array,default:()=>[]},hideOnMobile:{type:Boolean,default:!0},treeId:String,storySlug:String,inModal:Boolean,tagClickHandler:Function,allowEditButton:{type:Boolean,default:!0}},computed:{...(0,_.L8)(["userIsStaffState"]),showMetaSidebar(){return!!this.userIsStaffState||(this.treePersons.length||this.places.length||this.mentionPersons.length||this.sources.length||this.clans.length||this.tags.length||this.showRecommendations||this.author||this.publicationDate||this.compilations&&this.compilations.length)},isStatusGreen(){return"Published"===this.status||"published"===this.status},showRecommendations(){return"draft"===this.status&&this.recommendations.length>0},showEditButton(){return this.allowEditButton&&"draft"===this.status&&this.treeId&&this.storySlug&&(this.userIsStaffState||this.isEditable)},editRoute(){return{name:"stories-edit-story",params:{slug:this.storySlug,treeId:this.treeId}}}},methods:{getPlaceDetailRoute:n.yQ,getPersonRecordDetailRoute:n.$,getSurnameDetailRoute:n.MO,getSourceDetailRoute(t){return{name:"source-detail",params:{sourceId:t}}},getClanDisplay(t){const e=t.name_hant&&t.name_ch!==t.name_hant?`${t.name_ch} / ${t.name_hant}`:t.name_ch;return[t.pinyin||"",e].join(" ").trim()},onTagClick(t){return this.inModal&&this.tagClickHandler?this.tagClickHandler(t):this.$emit("click-tag",t)}},name:"StoryMetaSidebar",components:{McrButtonRouterLink:o.A,PencilIcon:C.A,RelativeItemCompact:T,SharedIcon:r.A,AlertIcon:l.A,OwnershipIcon:b.A,BookIcon:c.A,FolderIcon:p.A,TagIcon:y.A,FamilyIcon:m.A,PlacesIcon:g.A,DateIcon:d.A,ClanIcon:h.A,RecordsIcon:u.A,AuthorIcon:v.A,MemoryIcon:f.A}},P=$,R=(0,D.A)(P,i,a,!1,null,"1207be8a",null),M=R.exports},66757:function(t,e,s){s.d(e,{A:function(){return d}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compilation-select"},[e("mcr-multiselect",{ref:"input",attrs:{value:t.value,placeholder:"Type to search or create",searchable:!0,"internal-search":!0,preserveSearch:!1,clearOnSelect:!1,"show-no-options":!0,"hide-selected":!1,options:t.allOptions,multiple:!0,"track-by":"id",label:"title",showLabels:!1,id:t.id}
1,on:{"search-change":t.onSearchChange,select:t.onSelect,remove:t.onRemove}})],1)},a=[],o=s(95691),n=s(13321),r={props:{value:Array,options:Array,id:{type:String,default:""}},data(){return{searchQuery:""}},computed:{allOptions(){if(this.searchQuery){const t={title:`Create new Compilation "${this.searchQuery}"`,id:(0,n.$f)(),value:this.searchQuery,isCreate:!0};return[...this.options,t]}return this.options}},methods:{onSelect(t){this.$emit("select",t)},onRemove(t){this.$emit("remove",t)},onSearchChange(t){this.searchQuery=t}},components:{McrMultiselect:o.A}},l=r,c=s(81656),u=(0,c.A)(l,i,a,!1,null,"5a3b7398",null),d=u.exports},43290:function(t,e,s){s.d(e,{A:function(){return F}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"edit-story-form"},[e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v(" Story Title "),e("asterisk-icon",{attrs:{size:12}})],1),e("input",{staticClass:"input",class:{"has-error":t.errors.title},attrs:{placeholder:"E.g. My Grandfather's Journey to Canada"},domProps:{value:t.formData.title},on:{input:function(e){return t.onInputChange("title",e)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onInputEnter.apply(null,arguments)}}}),t.errors.title?e("div",{staticClass:"input-error"},[t._v(t._s(t.errors.title))]):t._e()]),e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label story-content-label-row"},[e("span",[t._v("Story Text")]),e("div",{staticClass:"story-content-inspection"},[e("span",{staticClass:"text-xs story-word-count",class:{"has-recommendations":t.hasRecommendations}},[t._v("words: "+t._s(t.storyContentWordCount))]),t.hasRecommendations?e("v-dropdown",{attrs:{shown:t.isRecommendationsOpen,"auto-hide":!0,offset:10,"popper-triggers":["click"],placement:"bottom-end"},on:{"update:shown":function(e){t.isRecommendationsOpen=e}}},[e("button",{staticClass:"link-button recommendation-trigger",attrs:{type:"button","aria-label":"Show story recommendations","aria-expanded":t.isRecommendationsOpen?"true":"false"}},[e("span",[t._v("see recommendations")]),t._v(" "),e("alert-icon",{attrs:{size:18}})],1),e("div",{staticClass:"story-recommendations-popover",attrs:{slot:"popper"},slot:"popper"},[e("div",{staticClass:"text-md bold"},[t._v("Recommendations")]),e("ul",{staticClass:"recommendations-list"},t._l(t.recommendations,function(s){return e("li",{key:s.id,staticClass:"text-sm"},[t._v(" "+t._s(s.message)+" ")])}),0)])]):t._e()],1)]),e("markdown-editor",{staticClass:"expanded",attrs:{value:t.formData.content},on:{input:t.onContentChange}})],1),e("transition",{attrs:{name:"expand"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.isAudioFocusMode,expression:"!isAudioFocusMode"}],staticClass:"form-item"},[e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("Compilations")]),e("compilation-select",{attrs:{value:t.formData.collections,options:t.storiesOptionsState.collections||[]},on:{select:t.onCompilationSelect,remove:t.onCompilationRemove}})],1),e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("People in my Family Tree")]),e("family-tree-people-multiselect-container",{staticClass:"bordered",attrs:{value:t.formData.tree_persons,multiple:!0,"allow-clear":!1,"show-icon":!1,placeholder:""},on:{select:function(e){return t.onPersonsSelect([e])},remove:t.onPersonRemove,clear:t.onPersonsClear}}),e("edit-story-suggestions-tags",{attrs:{options:t.suggestedPersonsDisplay,"label-field":"full_name"},on:{select:t.onPersonsSelect}})],1),e("div",{staticClass:"form-item"},[e("place-input",{attrs:{value:t.formData.places,multiple:!0,label:"Places",labelClasses:"input-label",multiselectClasses:"bordered",id:"places",placeholder:""},on:{select:function(e){return t.onPlacesSelect([e])},remove:t.onPlaceRemove,clear:t.onPlacesClear}}),e("edit-story-suggestions-tags",{attrs:{options:t.suggestedPlacesDisplay,"label-field":"place_name"},on:{select:t.onPlacesSelect}})],1),e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("Date or Time Period")]),e("input",{staticClass:"input",domProps:{value:t.formData.date_text},on:{input:function(e){return t.onInputChange("date_text",e)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onInputEnter.apply(null,arguments)}}}),e("edit-story-suggestions-tags",{attrs:{options:t.suggestedDateTextsDisplay,"allow-select-all":!1},on:{select:function(e){return t.onValueChange("date_text",e[0])}}}
1)],1),e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("Tags")]),e("story-tags-input",{attrs:{value:t.formData.tags,"suggested-options":t.suggestedTagsDisplay},on:{input:function(e){return t.onValueChange("tags",e)}}})],1),e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("Clans")]),e("surname-input",{attrs:{value:t.formData.clans||[],multiple:!0,"allow-remove":!1,id:"clan-surname"},on:{select:function(e){return t.onClansSelect([e])},remove:t.onClanRemove,clear:t.onClansClear}}),e("edit-story-suggestions-tags",{attrs:{options:t.suggestedClansDisplay,"label-field":"full_name"},on:{select:t.onClansSelect}})],1),e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("Author")]),e("input",{staticClass:"input",attrs:{placeholder:"Leave empty to auto-generate"},domProps:{value:t.formData.author},on:{input:function(e){return t.onInputChange("author",e)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onInputEnter.apply(null,arguments)}}})]),t.userIsStaffState?e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("My China Roots Sources")]),e("source-input",{attrs:{value:t.formData.sources||[],multiple:!0},on:{select:t.onSourceSelect,remove:t.onSourceRemove,clear:t.onSourcesClear}})],1):t._e(),t.userIsStaffState?e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("My China Roots Records")]),e("mention-input",{attrs:{value:t.formData.mention_persons||[],multiple:!0},on:{select:t.onMentionSelect,remove:t.onMentionRemove,clear:t.onMentionsClear}})],1):t._e(),t.userIsStaffState?e("div",{staticClass:"form-item"},[e("div",{staticClass:"input-label"},[t._v("Status")]),e("single-option-select",{attrs:{value:t.formData.status,options:t.statusOptions,searchable:!1,"allow-remove":!1},on:{select:t.onStatusSelect}})],1):t._e()])])],1)},a=[],o=(s(74423),s(44114),s(18111),s(22489),s(7588),s(61701),s(45367),s(92731),s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698),s(41286)),n=function(){var t=this,e=t._self._c;return e("mcr-multiselect",{ref:"source-input",staticClass:"bordered",attrs:{value:t.value,clearable:t.allowRemove,"clear-aria-label":"Clear selected person","is-clear-visible":Boolean(t.value&&(t.value.id||t.value.length)&&t.allowRemove),placeholder:t.placeholder,searchable:!0,"internal-search":!1,preserveSearch:!1,clearOnSelect:!0,"show-no-options":!0,"show-no-results":!0,"hide-selected":!1,multiple:t.multiple,options:t.options,"track-by":"code",label:"full_name",openDirection:"bottom",showLabels:!1,loading:t.loading},on:{"search-change":t.onSearchChange,select:t.onSelect,remove:t.onRemove,clear:t.clearSource,close:t.clearOptions},scopedSlots:t._u([{key:"singleLabel",fn:function(s){return e("span",{},[[t._v(t._s(s.option.name||t.placeholder))]],2)}}])},[e("span",{staticClass:"input-helper",attrs:{slot:"noResult"},slot:"noResult"},[t._v("Not found")]),e("span",{staticClass:"input-helper",attrs:{slot:"noOptions"},slot:"noOptions"},[t._v("Start typing to search...")]),t.loading?e("div",{staticClass:"loading-after-list",attrs:{slot:"afterList"},slot:"afterList"},[e("span",{staticClass:"input-helper"},[t._v("Searching...")])]):t._e()])},r=[],l=s(95691),c=s(89279),u=s(38221),d=s.n(u),h={props:{value:[Object,Array],placeholder:{type:String,default:"Search by person code or person id"},multiple:Boolean,allowRemove:Boolean},data(){return{options:[],loading:!1}},methods:{onSearchChange(t){this.options=[],t&&this.searchSources(t)},searchSources:d()(function(t){this.loading=!0,this.network.source.searchMentions({code:t}).then(t=>{this.options=t.objects.map(t=>({code:t.person.code,object_id:t.person.id,full_name:this.getName(t.person)}))}).finally(()=>{this.loading=!1})},200),onSelect(t){this.$emit("select",t)},onRemove(t){this.$emit("remove",t)},clearSource(){this.multiple?this.$emit("clear"):this.onSelect({})},clearOptions(){this.options=[]},getName(t){const e=(0,c.I0)(t.first_names,t.surnames),s=(0,c.E7)(t.first_names,t.surnames),i=[e,s].join(" ").trim();if(i)return i;const a=this.item.person.info||{};return a.business?`${a.business} (Business)`.trim():"Unknown"}},name:"MentionInput",components:{McrMultiselect:l.A}},p=h,m=s(81656),g=(0,m.A)(p,n,r,!1,null,"b08dcfc0",null),f=g.exports,v=s(7359),C=function(){var t=this,e=t._self._c;return e("mcr-multiselect",{ref:"source-input",staticClass:"bordered",attrs:{value:t.value,clearable:t.allowRemove,"clear-aria-label":"Clear selected source","is-clear-visible":Boolean(t.value&&(t.value.id||t.value.length)&&t.allowRemove),placeholder:t.placeholder,searchable:!0,"internal-search":!1,preserveSearch:!1,clearOnSelect:!0,"show-no-options":!0,"show-no-results":t.searchR
1an,"hide-selected":!1,multiple:t.multiple,options:t.sourcesAutocompleteState,"track-by":"id",label:"name",openDirection:"bottom",showLabels:!1,loading:t.sourcesAutocompleteLoadingState},on:{"search-change":t.onSearchChange,select:t.onSelect,remove:t.onRemove,clear:t.clearSource,close:t.clearOptions},scopedSlots:t._u([{key:"singleLabel",fn:function(s){return e("span",{},[[t._v(t._s(s.option.name||t.placeholder||"All Sources"))]],2)}}])},[e("span",{staticClass:"input-helper",attrs:{slot:"noResult"},slot:"noResult"},[t._v("Not found")]),e("span",{staticClass:"input-helper",attrs:{slot:"noOptions"},slot:"noOptions"},[t._v("Start typing to search...")]),t.sourcesAutocompleteLoadingState?e("div",{staticClass:"loading-after-list",attrs:{slot:"afterList"},slot:"afterList"},[e("span",{staticClass:"input-helper"},[t._v("Searching...")])]):t._e()])},b=[],y=s(95353),_={props:{value:[Object,Array],placeholder:{type:String,default:""},sourceTypes:String,multiple:Boolean,allowRemove:Boolean},data(){return{searchRan:!1}},computed:{...(0,y.L8)(["sourcesAutocompleteLoadingState","sourcesAutocompleteState"])},methods:{onSearchChange(t){this.$store.commit("setSourcesAutocompleteState",[]),t&&this.searchSources(t)},searchSources:d()(function(t){this.$store.dispatch("fetchSourcesAutocompleteAction",{source_types:this.sourceTypes,q:t})},200),onSelect(t){this.$emit("select",t)},onRemove(t){this.$emit("remove",t)},clearSource(){this.multiple?this.$emit("clear"):this.onSelect({})},clearOptions(){this.$store.commit("setSourcesAutocompleteState",[])},isMultiselectOpened(){return this.$refs["source-input"]&&this.$refs["source-input"].isOpen}},name:"SourceInput",components:{McrMultiselect:l.A}},S=_,w=(0,m.A)(S,C,b,!1,null,"3bc0dbff",null),A=w.exports,k=s(21127),I=s(76352),x=s(13321),D=s(62193),L=s.n(D),T=s(45978),$=s(76276),P=s(53967),R=s(63373),M=s(66757),O=s(57468),B=s(44220),N={props:{initData:Object,treeId:String,isAudioFocusMode:Boolean},data(){return{formData:{},initialFormData:{},errors:{},suggestionsByCompilation:{},isRecommendationsOpen:!1}},created(){const t=this.getInitialFormData();this.formData={...t},this.initialFormData={...t};for(let e of this.formData.collections||[])this.loadCompilationData(e)},computed:{...(0,y.L8)(["storiesOptionsState","userIsStaffState"]),statusOptions(){return[{value:"draft",name:"Draft"},{value:"published",name:"Published"},{value:"archived",name:"Archived"}]},suggestedTagsDisplay(){let t=this.formData.tags||[];return t=t.map(t=>t.toLowerCase()),this.getSuggestionsFlat("tags").filter(e=>!t.includes(e.toLowerCase()))},suggestedPersonsDisplay(){const t=this.formData.tree_persons||[],e=t.map(t=>t.object_id);return this.getSuggestionsFlat("tree_persons","object_id").filter(t=>!e.includes(t.object_id))},suggestedPlacesDisplay(){const t=this.formData.places||[],e=t.map(t=>t.id);return this.getSuggestionsFlat("places","id").filter(t=>!e.includes(t.id))},suggestedClansDisplay(){const t=this.formData.clans||[],e=t.map(t=>t.object_id);return this.getSuggestionsFlat("clans","object_id").filter(t=>!e.includes(t.object_id)).map(t=>({...t,full_name:(0,c.oi)(t)}))},suggestedDateTextsDisplay(){return this.getSuggestionsFlat("date_text").filter(t=>t!==this.formData.date_text)||[]},formDataCompilationIds(){return this.formData.collections?this.formData.collections.map(t=>t.id):[]},storyContentInspection(){return(0,R.Db)(this.formData.content)},storyContentWordCount(){return this.storyContentInspection.wordCount},recommendations(){return this.storyContentInspection.recommendations},hasRecommendations(){return!!this.userIsStaffState&&this.storyContentInspection.hasRecommendations}},methods:{getInitialFormData(){const t=this.initData||{};return{status:this.userIsStaffState?"draft":"published",content:t.content_html,...t}},getSuggestionsFlat(t,e=null){let s=Object.keys(this.suggestionsByCompilation).filter(t=>this.formDataCompilationIds.includes(t)).map(e=>this.suggestionsByCompilation[e][t]).flat();if(e){const t=new Set;s=s.filter(s=>{const i=s?.[e];return!t.has(i)&&(t.add(i),!0)})}else s=[...new Set(s)];return s},onInputChange(t,e){this.onValueChange(t,e.target.value.trim())},onValueChange(t,e){this.$set(this.formData,t,e),this.$emit("change",this.formData)},onContentChange(t){this.onValueChange("content",t)},addContent(t){const e=this.formData.content,s="<p>"+t+"</p>",i=e&&"<p></p>"!==e?e+s:s;this.onValueChange("content",i)},onCompilationSelect(t){const e=this.formData.collections||[];this.onValueChange("collections",[...e,t]),this.loadCompilationData(t,!0)},onCompilationRemove(t){const e=this.formData.collections||[];this.onValueChange("collections",e.filter(e=>e.id!==t.id))},onPersonsSelect(t){const e=this.formData.tree_persons||[];this.onValueChange("tree_persons",[...e,...t])},onPersonRemove(t){const e=this.formData.tree_persons||[];this.onValueChange("tree_persons",e.filter(e=>e.object_id!==t.object_id))},onPersonsClear(){this.onValueChange("tree_persons",[])},onPlacesSelect(t){const e=this.formData.places||[];this.onValueChange("places",[...e,...t])},onPlaceRemove(t){const e=this.formData.places||[];this.onValueChange("places",e.filter(e=>e.id!==t.id))},onPlacesClear(){this.onValueChange("places",[])},onClansSelect(t){const e=this.formData.clans||[];this.onValueChange("clans",[...e,...t])},onClanRemove(t){const e=this.formData.clans||[];this.onValueChange("clans",e.filter(e=>t.name_hant?e.name_hant!==t.name_hant:e.name_ch!==t.name_ch))},onSourceSelect(t){const e=this.formData.sources||[];this.onValueChange("sources",[...e,t])},onSourceRemove(t){const e=this.formData.sources||[];this.onValueChange("sources",e.filter(e=>e.id!==t.id))},onSourcesClear(){this.onValueChange("sources",[])},onMentionSelect(t){const e=this.formData.mention_persons||[];this.onValueChange("mention_persons",[...e,t])},onMentionRemove(t){const e=this.formData.mention_persons||[];this.onValueChange("mention_persons",e.filter(e=>e.code!==t.code))},onMentionsClear(){this.onValueChange("mention_persons",[])},onClansClear(){this.onValueChange("clans",[])},onStatusSelect(t){this.onValueChange("status",t)},onInputEnter(){this.submitClick()},submitClick(){const t=this.validate();t&&this.$emit("submit")},validate(){this.errors={},this.formData.title||(this.errors.title="This field is required");const t=L()(this.errors);return t||this.$nextTick(()=>{this.$scrollTo(".has-error",{offset:-150,force:!0,cancelable:!1}),this.$emit("validation-error",this.errors)}),t},loadCompilationData(t){!t||t.isCreate||this.suggestionsByCompilation[t.id]||this.network.fws.forceGetStories({tree_id:this.treeId,collections:t.id,with_details:"true"}).then(e=>{this.$set(this.suggestionsByCompilation,t.id,{tags:this.getSharedTags(e.objects),tree_persons:this.getSuggestedStoriesItems(e.objects,"tree_persons","object_id"),clans:this.getSuggestedStoriesItems(e.objects,"clans","object_id"),places:this.getSuggestedStoriesItems(e.objects,"places","id"),date_text:Array.from(new Set(e.objects.map(t=>
1t.date_text).filter(Boolean))),stories_length:e.objects.length})}).catch(t=>{console.error(t)})},getSuggestedStoriesItems(t,e,s){return Array.from(new Map(t.map(t=>t[e]).flat().map(t=>[t[s],t])).values())},getSharedTags(t){if(0===t.length)return[];if(1===t.length)return[...new Set(t[0].tags)];let e=new Set(t[0].tags);for(let s=1;s<t.length;s++)if(e=new Set(t[s].tags.filter(t=>e.has(t))),0===e.size)break;return[...e]},getCompilationDataOutput(t){if(!t.collections||0===t.collections.length)return[];const e=[];for(let s of t.collections)s.isCreate?e.push({name:s.value,id:null,order:0}):e.push({name:s.name,id:s.id,order:this.getStoryOrderWithinCompilation(s)});return e},getStoryOrderWithinCompilation(t){return t.order||0===t.order?t.order:this.suggestionsByCompilation[t.id]&&this.suggestionsByCompilation[t.id].stories_length||0},getFormDataOutput(t){const e=this.getCompilationDataOutput(t);return{title:t.title,content:(0,x.A5)(t.content),tags:t.tags||[],places:t.places?t.places.map(t=>t.id):[],clans:t.clans?t.clans.map(t=>t.object_id):[],tree_persons:t.tree_persons?t.tree_persons.map(t=>t.object_id):[],sources:t.sources?t.sources.map(t=>t.id):[],mention_persons:t.mention_persons?t.mention_persons.map(t=>t.object_id):[],status:t.status,date_text:t.date_text,author:t.author,collections:e}},getDataForSave(){return this.getFormDataOutput(this.formData)},getDiffDataForSave(){const t=this.getFormDataOutput(this.initialFormData),e=this.getFormDataOutput(this.formData),s=(0,x.dX)(t,e);return Object.fromEntries(Object.entries(s).map(([t,e])=>[t,e.to]))},resetForm(){this.formData={...this.initialFormData},this.errors={},Object.values(this.suggestionsByCompilation).forEach(t=>{this.$set(t,"stories_length",t.stories_length+1)})}},components:{EditStorySuggestionsTags:O.A,MarkdownEditor:I.A,SingleOptionSelect:o.A,SourceInput:A,MentionInput:f,SurnameInput:k.A,PlaceInput:v.A,FamilyTreePeopleMultiselectContainer:P.A,CompilationSelect:M.A,AlertIcon:T.A,AsteriskIcon:$.A,StoryTagsInput:B.A}},E=N,H=(0,m.A)(E,i,a,!1,null,"55843dbe",null),F=H.exports},57468:function(t,e,s){s.d(e,{A:function(){return c}});var i=function(){var t=this,e=t._self._c;return t.options&&t.options.length?e("div",{staticClass:"edit-story-suggestions-tags"},[e("div",{staticClass:"text-sm"},[t._v("Used in Compilations:")]),t._l(t.options,function(s){return e("a",{key:t.getTagKey(s),staticClass:"chip outlined small",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.onTagSelect(s)}}},[t._v(" "+t._s(t.getTagDisplay(s))+" ")])}),t.allowSelectAll?e("a",{staticClass:"text-sm link",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.onAllSelect.apply(null,arguments)}}},[t._v("Select All")]):t._e()],2):t._e()},a=[],o={props:{options:Array,labelField:String,allowSelectAll:{type:Boolean,default:!0}},methods:{getTagDisplay(t){return this.labelField&&t[this.labelField]?t[this.labelField]:t},getTagKey(t){return this.labelField?t.object_id||t.id||t.slug:t},onTagSelect(t){this.$emit("select",[t])},onAllSelect(){this.$emit("select",this.options)}}},n=o,r=s(81656),l=(0,r.A)(n,i,a,!1,null,"3ed81661",null),c=l.exports},44220:function(t,e,s){s.d(e,{A:function(){return p}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"story-tags-input"},[e("mcr-multiselect",{attrs:{id:t.inputId,multiple:!0,value:t.value,options:t.tagsOptions,"close-on-select":!1,taggable:!0,placeholder:"Type to search or add"},on:{select:function(e){return t.onTagsSelect([e])},tag:function(e){return t.onTagsSelect([e])},remove:t.onTagRemove}}),e("edit-story-suggestions-tags",{attrs:{options:t.suggestedTagsDisplay},on:{select:t.onTagsSelect}})],1)},a=[],o=(s(74423),s(18111),s(22489),s(61701),s(95691)),n=s(95353),r=s(57468);const l=["Migration","Education & Career","Hobbies & Activities","Health","Memories & Experiences","Food & Recipes","History & Origins","Culture & Religion","People","My China Roots Research","Re
1search Notes","Jiapu/Zupu","Records & Documents","Ancestral Village","Ancestral Hall","Ancestral House","Graves","Possessions","Collections & Databases","Associations & Organizations"];var c={props:{value:{type:Array,default:()=>[]},suggestedOptions:{type:Array,default:()=>[]},inputId:String},computed:{...(0,n.L8)(["storiesOptionsState"]),tagsOptions(){const t=this.storiesOptionsState.tags||[],e=l.filter(e=>!t.includes(e));return e.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase())),[...t,...e]},suggestedTagsDisplay(){const t=this.value.map(t=>t.toLowerCase());return this.suggestedOptions.filter(e=>!t.includes(e.toLowerCase()))}},methods:{onTagsSelect(t){const e=this.value||[],s=e.map(t=>t.toLowerCase()),i=t.filter(t=>!s.includes(t.toLowerCase()));this.$emit("input",[...e,...i])},onTagRemove(t){const e=this.value||[];this.$emit("input",e.filter(e=>e.toLowerCase()!==t.toLowerCase()))}},name:"StoryTagsInput",components:{EditStorySuggestionsTags:r.A,McrMultiselect:o.A}},u=c,d=s(81656),h=(0,d.A)(u,i,a,!1,null,null,null),p=h.exports},61157:function(t,e,s){s.d(e,{A:function(){return p}});var i=function(){var t=this,e=t._self._c;return e(t.listComponent,{tag:"component",staticClass:"selected-stories",attrs:{tag:"div",handle:".drag-icon","force-fallback":!0,animation:200},model:{value:t.orderedStories,callback:function(e){t.orderedStories=e},expression:"orderedStories"}},t._l(t.orderedStories,function(s,i){return e("div",{key:s.id||s.slug,staticClass:"selected-story"},[t.sortable?e("drag-icon",{staticClass:"drag-icon",attrs:{size:20,"aria-hidden":"true"}}):t._e(),e("span",{staticClass:"story-position text-sm"},[t._v(t._s(i+1))]),e("span",{staticClass:"story-title text-sm"},[t._v(t._s(s.title))]),t.removable?e("button",{staticClass:"link-button text-sm remove-button",attrs:{type:"button","aria-label":`Remove ${s.title} from selection`},on:{click:function(e){return t.removeStory(s)}}},[t._v(" Remove ")]):t._e()],1)}),0)},a=[],o=(s(18111),s(22489),s(87336)),n=s(432),r=s.n(n);const l={props:{value:{type:Array,default:()=>[]}},template:"<div><slot></slot></div>"};var c={props:{value:{type:Array,default:()=>[]},sortable:{type:Boolean,default:!0},removable:{type:Boolean,default:!0}},computed:{listComponent(){return this.sortable?"draggable":"plain-list"},orderedStories:{get(){return this.value||[]},set(t){this.$emit("input",t)}}},methods:{removeStory(t){this.$emit("input",this.orderedStories.filter(e=>e.slug!==t.slug))}},name:"StorySelectedStoriesList",components:{DragIcon:o.A,draggable:r(),PlainList:l}},u=c,d=s(81656),h=(0,d.A)(u,i,a,!1,null,"25ee620a",null),p=h.exports},55884:function(t,e,s){s(18111),s(22489),s(20116),s(61701),s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698);const i=t=>{const e=Array.isArray(t?.contacts)?t.contacts:null,s=Array.isArray(t?.raw?.contacts)?t.raw.contacts:null,i=e?.length?e:s||e||[];if(!Array.isArray(i))return[];const a=i.find(t=>t.is_main&&t.email);if(a)return[a.email];const o=i.filter(t=>t.member_id&&t.email);if(o.length)return[...new Set(o.map(t=>t.email))];const n=i.filter(t=>t.email);return n.length?[...new Set(n.map(t=>t.email))]:[]};s.d(e,["m",0,i])},63373:function(t,e,s){s.d(e,{A4:function(){return b},Db:function(){return w},Os:function(){return v},ac:function(){return f},sW:function(){return y}});s(44114),s(18111),s(22489);var i=s(13321),a=s(89279),o=s(75839),n=s(83282),r=s(17639),l=s(93285),c=s(40743),u=s(25218),d=s(45869),h=s(5580),p=s(85321),m=s(72419);const g=150;function f(t,e,s=!1){if("clans"===e){const e=(0,a.oi)(t);return s?`Clan: ${e}`:e}if("mention_persons"===e||"sources"===e){const e=t.full_name||"Unknown";return s?`Record: ${e}`:e}if("places"===e)return t.place_name;if("tree_persons"===e){const e=t.full_name||"Unknown";return s?`Relative: ${e}`:e}return"collections"===e?t.title:"tags"===e||"authors"===e?t:"ownership"===e?t.display_text:void 0}function v(t,e){let s=t.target;s&&3===s.nodeType&&(s=s.parentElement);const i=s&&s.closest&&s.closest("a.popup-trigger");i?t.currentTarget&&!t.currentTarget.contains(i)||(t.preventDefault(),t.stopPropagation(),e.$store.commit("setGlossaryWikiDataState",{content:i.dataset.popupMessage}),e.$store.commit("setGlossaryWikiNaturalIdState",null)):C(t,e,s)}function C(t,e,s){const i=s&&s.closest&&s.closest("a");if(!i||!e.$route||t.currentTarget&&!t.currentTarget.contains(i))return!1;const a=i.getAttribute("href");if(!a)return!1;let o;try{o=new URL(a,window.location.origin)}catch(n){return!1}return!(o.origin!==window.location.origin||!/^\/library\/file\/[^/]+\/?$/.test(o.pathname))&&(o.searchParams.set("returnto",e.$route.fullPath),i.href=o.pathname+o.search+o.hash,!0)}function b(){return(0,i.p_)("/assets/services/script_wall_optimized2.jpg")}function y(t){const e={tree_persons:o.A,authors:h.A,places:d.A,sources:r.A,mention_persons:l.A,collections:u.A,tags:m.A,clans:c.A,ownership:n.A,q:p.A};return e[t]}function _(t){if(!t)return"";if("undefined"===typeof document)return t.replace(/<[^>]*>/g," ").trim();const e=document.createElement("div");return e.innerHTML=t,(e.textContent||e.innerText||"").trim()}function S(t){if(!t)return 0;const e=_(t);
1return e?e.split(/\s+/).filter(Boolean).length:0}function w(t){const e=S(t),s=[];return e>g&&s.push({id:"story-content-word-limit",message:`Keep the story text to ${g} words or fewer when possible.`}),{wordCount:e,recommendations:s,hasRecommendations:s.length>0}}}}]); 2//# sourceMappingURL=4855.90c2aab6.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.