2026-10-13 13:23:32 +03:30
|
|
|
import{_ as me}from"./BasicMainCard-e958eff9.js";import{_ as _e}from"./BasicModal.vue_vue_type_style_index_0_lang-6969d1dc.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-1b5120f8.js";import{_ as ge}from"./BaseSwitch.vue_vue_type_script_setup_true_lang-8738a2db.js";import{_ as ve}from"./BasicInput.vue_vue_type_style_index_0_lang-1e71e6d8.js";import{_ as he,u as fe}from"./useBaseTable-2f44456a.js";import{_ as xe}from"./button.vue_vue_type_style_index_0_lang-c84b0596.js";import{_ as we,Y as ye,Z as N,I as Q,J as ee,K as V,d as be,i as k,o as $,c as D,e as i,w as f,b as e,f as ke,L as Ce,l as T,t as P,n as F,F as Ie,q as Ue,H as x,$ as qe,M as Te}from"./index-88b436a3.js";import{t as $e}from"./useDataTime-c5fd0475.js";import{I as S}from"./Icon-e9d21126.js";import{e as R,g as O}from"./convert-2ad76038.js";import{M as Z}from"./index-801e70c1.js";import{S as De}from"./index-77cb2497.js";import{T as z}from"./isSymbol-5adcf314.js";import{U as Se}from"./index-58f8102d.js";import"./Grid-3500d868.js";import"./index-3056cee8.js";import"./_plugin-vue_export-helper-0965689e.js";import"./shallowequal-a265b4c4.js";import"./index-70730f49.js";import"./vnode-4c3cf924.js";import"./index-608635af.js";import"./useState-89585daf.js";import"./useRefs-b589f2c4.js";import"./_flatRest-bfa472d2.js";import"./isMobile-e2e89480.js";import"./omit-c69ba12d.js";import"./index-ab792bfc.js";import"./Col-dbdf0e50.js";import"./styleChecker-e121d19f.js";import"./isPlainObject-6af67cf0.js";import"./index-5b1d7174.js";import"./SearchOutlined-a51da12b.js";import"./FormItemContext-0dc63d45.js";import"./index-371b21ab.js";import"./usePrice-bc935b83.js";import"./updateLocale-50b6b1dc.js";import"./useMemo-9783b0bd.js";import"./lodash-ff1cad4c.js";import"./index-59dbbd66.js";import"./Badge-b5f795c2.js";import"./isNumeric-3f69e2aa.js";import"./index-e3b71aec.js";import"./index-6971af25.js";import"./index-4ad375f9.js";import"./DialogWrap-540d386d.js";import"./pickAttrs-fd92707c.js";import"./css-aae66f86.js";import"./index-7fdb0173.js";import"./toArray-20aa7010.js";import"./index-4c23d157.js";import"./index-ad76e424.js";import"./index-f6397275.js";async function Ae(r){const{TableEngineRequest:g}=await we(()=>import("./buildSupabaseQuery-073609fa.js"),["assets/buildSupabaseQuery-073609fa.js","assets/index-88b436a3.js","assets/index-ceed3b68.css"]),l={...r};!l.sort&&!l.order&&(l.order="sort_order");const d=await g(l,"iran_tourism_challenges");try{if(Array.isArray(d==null?void 0:d.rows)){const v=l.page||1,y=l.limit||200,C=(v-1)*y,A=d.rows.map((U,q)=>({...U,index:C+q}));return{...d,rows:A}}}catch(v){console.log("[getIranTourismChallengeTable] normalize error:",v)}return d}async function Be(r){const g=await ye("iran_tourism_challenges",r),l=await N("iran_tourism_challenge_questions",{challenge_id:r});return{...g,questions:Array.isArray(l)?l:[]}}async function Le(r){const g=await Q("iran_tourism_challenges",{...r.challenge,updated_at:new Date().toISOString()});for(let l=0;l<r.questions.length;l++){const d=r.questions[l];await Q("iran_tourism_challenge_questions",{challenge_id:g.id,question:d.question,options:d.options,correct_answer:d.correct_answer||null,sort_order:d.sort_order??l})}return g}async function Re(r,g){await ee("iran_tourism_challenges",r,{...g.challenge,updated_at:new Date().toISOString()});const l=await N("iran_tourism_challenge_questions",{challenge_id:r});for(const d of Array.isArray(l)?l:[])await V("iran_tourism_challenge_questions",d.id);for(let d=0;d<g.questions.length;d++){const v=g.questions[d];await Q("iran_tourism_challenge_questions",{challenge_id:r,question:v.question,options:v.options,correct_answer:v.correct_answer||null,sort_order:v.sort_order??d})}return{id:r}}async function Me(r,g){const l=await ee("iran_tourism_challenges",r,{...g,updated_at:new Date().toISOString()});return Array.isArray(l)?l:[l]}async function je(r){const g=await N("iran_tourism_challenge_questions",{challenge_id:r});for(const l of Array.isArray(g)?g:[])await V("iran_tourism_challenge_questions",l.id);await V("iran_tourism_challenges",r)}const Pe=[{t
|