import{_ as m,s as p,r as f,o as c,c as d,a as i,t as r,F as v,b as _,d as w,n as y,e as z,w as b,f as L}from"./index-e263e3d6.js";const k={name:"CitizenActivitiesView",data(){return{activitiesList:[],loading:!0,adminService:p,tempActivities:[{id:"xuzh-book-launch",title_zh:"许志永新书纽约发布会,本机构创建人罗胜春女士发表演讲",title_en:"Xu Zhiyong New York Book Launch, ACR Founder Ms. Luo Shengchun Delivers Speech",content_zh:`在美国纽约法拉盛市政厅,本机构创建人罗胜春女士参加了许志永《美好中国》的新书发布会并发表题为《为了我们心中的美好中国》的演讲。此次新书发布会由博登书屋主办。一起回顾过去,思考当下,展望未来。
分享我们深陷狱中的朋友的泣血呐喊,分享我们对自由、公义和爱的理解和不懈追求,分享我们的痛苦、喜乐和盼望!
**美好中国一定要实现,也一定会实现!**
## 活动视频
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin: 20px 0;">
<iframe
src="https://customer-jja285q7eogvc05i.cloudflarestream.com/f6ffd056a907430822dbf09ff7f322c2/iframe"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;"
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
allowfullscreen="true">
</iframe>
</div>
---
活动在美国纽约法拉盛市政厅举行,现场气氛热烈,参与者们共同追忆许志永的公民理想与实践,展望中国民主化的未来。
### 关于活动
这不仅是一场新书发布会,更是一次对自由、民主、法治理念的深度交流,是对所有为中国民主事业付出努力的人们的致敬。
`,content_en:`At Flushing Town Hall in New York, USA, Ms. Luo Shengchun, founder of our organization, attended the book launch for Xu Zhiyong's "A Beautiful China" and delivered a speech titled "For the Beautiful China in Our Hearts." The book launch was organized by Boden Books. Together, we review the past, reflect on the present, and look forward to the future.
Sharing the heartfelt cries of our friends imprisoned, sharing our understanding and persistent pursuit of freedom, justice, and love, sharing our pain, joy, and hope!
**A Beautiful China must be realized, and will be realized!**
## Event Video
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin: 20px 0;">
<iframe
src="https://customer-jja285q7eogvc05i.cloudflarestream.com/f6ffd056a907430822dbf09ff7f322c2/iframe"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;"
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
allowfullscreen="true">
</iframe>
</div>
---
The event was held at Flushing Town Hall in New York, USA with an enthusiastic atmosphere. Participants collectively reminisced about Xu Zhiyong's civic ideals and practices, looking forward to China's democratic future.
### About the Event
This is not only a book launch but also a profound exchange on the ideals of freedom, democracy, and the rule of law, paying tribute to all those who have worked for China's democratic cause.
`,status:"published",created_at:new Date().toISOString(),date:new Date().toISOString()}]}},created(){this.loadActivitiesData()},watch:{"$i18n.locale"(){this.$forceUpdate()}},methods:{async loadActivitiesData(){this.loading=!0;try{console.log("开始加载公民动态数据...");let t=[...this.tempActivities];try{const e=await this.adminService.getCitizenActivitiesList({status:"published",limit:50});e&&e.length>0&&(t=[...t,...e],console.log("成功加载Supabase数据,数量:",e.length))}catch{console.log("Supabase表可能还未创建,使用临时数据")}this.activitiesList=t,console.log("总共加载公民动态数据,数量:",this.activitiesList.length),this.activitiesList.forEach((e,o)=>{console.log(`条目 ${o+1}:`,{id:e.id,title:e.title||e.title_zh||e.title_en,hasContent:!!e.content,hasContentZh:!!e.content_zh,hasContentEn:!!e.content_en,contentLength:(e.content||e.content_zh||e.content_en||"").length})})}catch(t){console.error("加载公民动态数据失败:",t),this.activitiesList=this.tempActivities}finally{this.loading=!1}},getLocalizedTitle(t){return this.$i18n.locale==="zh"?t.title_zh||t.title||"无标题":t.title_en||t.title||"No Title"},getLastImageFromContent(t){if(!t)return console.log("getLastImageFromContent: item为空"),null;const e=t.content||t.content_zh||t.content_en||"";if(!e)return console.log("getLastImageFromContent: 内容为空",t),null;console.log("getLastImageFromContent: 开始提取图片,内容长度:",e.length),console.log("getLastImageFromContent: 内容预览:",e.substring(0,200));try{const o=[],g=/!\[([^\]]*)\]\(([^)]+)\)/g;let a;for(;(a=g.exec(e))!==null;){const n=a[2].trim();n&&(o.push(n),console.log("找到Markdown图片:",n))}const l=/<img[^>]+src\s*=\s*["']([^"']+)["'][^>]*>/gi;for(;(a=l.exec(e))!==null;){const n=a[1].trim();n&&(o.push(n),console.log("找到HTML图片:",n))}const h=/https?:\/\/[^\s<>"]+\.(?:jpg|jpeg|png|gif|webp|svg)(?:\?[^\s<>"]*)?/gi;for(;(a=h.exec(e))!==null;){const n=a[0].trim();n&&!o.includes(n)&&(o.push(n),console.log("找到URL图片:",n))}console.log("getLastImageFromContent: 总共找到图片数量:",o.length),console.log("getLastImageFromContent: 所有图片:",o);const s=o.length>0?o[o.length-1]:null;return console.log("getLastImageFromContent: 返回最后一张图片:",s),s}catch(o){return console.error("提取图片失败:",o),null}},handleImageError(t){console.warn("图片加载失败:",t.target.src),t.target.style.display="none";const e=t.target.parentElement.querySelector(".no-image-placeholder");e&&(e.style.display="flex")},formatDate(t){if(!t)return"";const e=new Date(t);return new Intl.DateTimeFormat(this.$i18n.locale==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",timeZone:"Asia/Shanghai"}).format(e)}}},C={class:"citizen-activities"},I={class:"page-header"},S={class:"activities-intro"},A={class:"container"},F={class:"activities-list-section"},x={class:"container"},D={key:0,class:"loading-container"},T={key:1,class:"activities-grid"},E={class:"activity-date"},N={class:"activity-image-preview"},j=["src","alt"],B={key:1,class:"no-image-placeholder"},V={key:2,class:"empty-state"};function U(t,e,o,g,a,l){const h=f("router-link");return c(),d("div",C,[i("header",I,[i("h1",null,r(t.$t("nav.citizen_activities")),1)]),i("section",S,[i("div",A,[i("p",null,r(t.$t("nav.citizen_activities_desc")),1)])]),i("section",F,[i("div",x,[a.loading?(c(),d("div",D,[e[1]||(e[1]=i("div",{class:"loading-spinner"},null,-1)),i("p",null,r(t.$i18n.locale==="zh"?"加载中...":"Loading..."),1)])):(c(),d("div",T,[(c(!0),d(v,null,_(a.activitiesList,(s,n)=>(c(),d("div",{key:s.id,class:"activity-card",style:y({animationDelay:`${n*.1}s`})},[e[4]||(e[4]=i("div",{class:"gradient-line"},null,-1)),i("div",E,r(l.formatDate(s.created_at||s.date)),1),i("h2",null,r(l.getLocalizedTitle(s)),1),i("div",N,[l.getLastImageFromContent(s)?(c(),d("img",{key:0,src:l.getLastImageFromContent(s),alt:l.getLocalizedTitle(s),class:"preview-image",onError:e[0]||(e[0]=(...u)=>l.handleImageError&&l.handleImageError(...u))},null,40,j)):(c(),d("div",B,[e[2]||(e[2]=i("div",{class:"placeholder-icon"},"📸",-1)),i("span",null,r(t.$i18n.locale==="zh"?"暂无图片":"No Image"),1)]))]),z(h,{to:`/citizen-activities/${s.id}`,class:"read-more"},{default:b(()=>[L(r(t.$i18n.locale==="zh"?"查看详情":"View Details")+" ",1),e[3]||(e[3]=i("span",{class:"arrow"},"→",-1))]),_:2,__:[3]},1032,["to"])],4))),128))])),!a.loading&&a.activitiesList.length===0?(c(),d("div",V,[e[5]||(e[5]=i("div",{class:"empty-state-icon"},"🤔",-1)),i("h3",null,r(t.$i18n.locale==="zh"?"暂无公民动态内容":"No citizen activities available"),1),i("p",null,r(t.$i18n.locale==="zh"?"请稍后再试":"Please try again later"),1)])):w("",!0)])])])}const Z=m(k,[["render",U],["__scopeId","data-v-7b913c59"]]);export{Z as default};